mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-22 04:16:07 +00:00
feat: 完成异步任务跟踪架构基础
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
</v-card>
|
||||
<div class="plugins-container">
|
||||
<PluginCard class="plugin-card" v-for="plugin in plugins" :key="plugin.name" :plugin="plugin"
|
||||
@toggle="togglePlugin" />
|
||||
@toggle="togglePlugin" @update="updatePlugin" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -88,7 +88,7 @@ const refresh = () => {
|
||||
onMounted(refresh)
|
||||
|
||||
const togglePlugin = (plugin) => {
|
||||
proxy.$axios.put(`/plugins/toggle/${plugin.author}/${plugin.name}`, {
|
||||
proxy.$axios.put(`/plugins/${plugin.author}/${plugin.name}/toggle`, {
|
||||
target_enabled: !plugin.enabled
|
||||
}).then(res => {
|
||||
if (res.data.code != 0) {
|
||||
@@ -101,6 +101,18 @@ const togglePlugin = (plugin) => {
|
||||
})
|
||||
}
|
||||
|
||||
const updatePlugin = (plugin) => {
|
||||
proxy.$axios.post(`/plugins/${plugin.author}/${plugin.name}/update`).then(res => {
|
||||
if (res.data.code != 0) {
|
||||
snackbar.error(res.data.msg)
|
||||
return
|
||||
}
|
||||
snackbar.success(`已添加更新任务 请到任务列表查看进度`)
|
||||
}).catch(error => {
|
||||
snackbar.error(error)
|
||||
})
|
||||
}
|
||||
|
||||
const isOrchestrationDialogActive = ref(false)
|
||||
|
||||
const cancelOrderChanges = () => {
|
||||
|
||||
Reference in New Issue
Block a user