Skip to content

Commit

Permalink
feat(bak): front add test bak
Browse files Browse the repository at this point in the history
  • Loading branch information
noovertime7 committed Oct 24, 2022
1 parent f09257f commit c890969
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conf/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ mysqlAvatar: http://qiniu.yunxue521.top/mysql.jpeg
elasticAvatar: http://qiniu.yunxue521.top/elastic.jpg
[cluster]
## 集群任务同步周期(分钟)
clusterSyncPeriod = "*/10 * * * *"
clusterSyncPeriod = "30 02 * * *"
8 changes: 8 additions & 0 deletions front/src/api/agent-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ export function StartAgentTask (query) {
})
}

export function TestAgentTask (query) {
return request({
url: '/agent/bak_test',
method: 'put',
params: query
})
}

export function StopAgentTask (query) {
return request({
url: '/agent/bakstop',
Expand Down
17 changes: 16 additions & 1 deletion front/src/views/cluster/task/mysql/table/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
更多 <a-icon type="down" />
</a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleTest(record)">测试</a>
</a-menu-item>
<a-menu-item>
<a @click="handleDetail">详情</a>
</a-menu-item>
Expand All @@ -92,7 +95,7 @@ import {
StartAgentHostTask,
StartAgentTask,
StopAgentHostTask,
StopAgentTask
StopAgentTask, TestAgentTask
} from '@/api/agent-task'
import { GetHostNames } from '@/api/agent-host'
Expand Down Expand Up @@ -217,6 +220,18 @@ clear: () => {
this.getHostList()
},
methods: {
handleTest (record) {
const query = {
'service_name': this.service_name,
'task_id': record.id
}
TestAgentTask(query).then((res) => {
if (res) {
this.$message.success(res.data)
this.$refs.table.refresh()
}
})
},
// 获取主机ID
getvalue (inhost) {
for (let i = 0; i < this.TestMap.length; i++) {
Expand Down

0 comments on commit c890969

Please sign in to comment.