Merge branch 'feature/refactor' of github.com:AUTO-MAS-Project/AUTO-MAS into feature/refactor
This commit is contained in:
@@ -289,7 +289,6 @@ onMounted(() => {
|
|||||||
loadScripts()
|
loadScripts()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const loadScripts = async () => {
|
const loadScripts = async () => {
|
||||||
try {
|
try {
|
||||||
const scriptDetails = await getScriptsWithUsers()
|
const scriptDetails = await getScriptsWithUsers()
|
||||||
@@ -512,7 +511,7 @@ const handleStartMAAConfig = async (script: Script) => {
|
|||||||
// 调用启动配置任务API
|
// 调用启动配置任务API
|
||||||
const response = await Service.addTaskApiDispatchStartPost({
|
const response = await Service.addTaskApiDispatchStartPost({
|
||||||
taskId: script.id,
|
taskId: script.id,
|
||||||
mode: TaskCreateIn.mode.SettingScriptMode
|
mode: TaskCreateIn.mode.SettingScriptMode,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@@ -529,7 +528,7 @@ const handleStartMAAConfig = async (script: Script) => {
|
|||||||
message.success(`${script.name} 配置已完成`)
|
message.success(`${script.name} 配置已完成`)
|
||||||
activeConnections.value.delete(script.id)
|
activeConnections.value.delete(script.id)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// 记录连接和websocketId
|
// 记录连接和websocketId
|
||||||
@@ -569,7 +568,7 @@ const handleSaveMAAConfig = async (script: Script) => {
|
|||||||
|
|
||||||
// 调用停止配置任务API
|
// 调用停止配置任务API
|
||||||
const response = await Service.stopTaskApiDispatchStopPost({
|
const response = await Service.stopTaskApiDispatchStopPost({
|
||||||
taskId: websocketId
|
taskId: websocketId,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@@ -605,6 +604,11 @@ const handleToggleUserStatus = async (user: User) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
|
// 更新本地数据状态
|
||||||
|
const targetUser = script.users.find(u => u.id === user.id)
|
||||||
|
if (targetUser) {
|
||||||
|
targetUser.Info.Status = newStatus
|
||||||
|
}
|
||||||
message.success('用户状态更新成功')
|
message.success('用户状态更新成功')
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user