diff --git a/atune/server/controller/task.go b/atune/server/controller/task.go
index 17d7b1e06561d9ed3104139235d2d248516ad90a..f8a6cb4e29f2165fb1b88af5d629c5378c44c479 100644
--- a/atune/server/controller/task.go
+++ b/atune/server/controller/task.go
@@ -36,7 +36,7 @@ func DeleteTask(c *gin.Context) {
response.Fail(c, nil, err.Error())
return
}
- response.Success(c, nil, "已删除调优对象模板")
+ response.Success(c, nil, "已删除任务")
}
func SearchTask(c *gin.Context) {
diff --git a/atune/web/index.html b/atune/web/index.html
index 9437bd9e7299d4de06c0003f5c42e6aee1fb52c6..13d0e329a0279316b8f892afd4454d0a7dab52b8 100644
--- a/atune/web/index.html
+++ b/atune/web/index.html
@@ -4,7 +4,7 @@
-
+
智能调优
diff --git a/atune/web/src/api/atune.ts b/atune/web/src/api/atune.ts
index 0ea89bfb0517f4c1dc2590253c2b6c4f7b45d1fa..546fff1cfc24516ecc6a41babbd0c08a50384aa4 100644
--- a/atune/web/src/api/atune.ts
+++ b/atune/web/src/api/atune.ts
@@ -9,6 +9,15 @@ export function getTaskLists(data: Object) {
});
}
+// 高级搜索任务列表分页
+export function searchTask(data: object) {
+ return request({
+ url: "/plugin/atune/task_search",
+ method: "get",
+ params: data,
+ });
+}
+
// 新增任务
export function addTask(data: object) {
return request({
@@ -21,7 +30,7 @@ export function addTask(data: object) {
// 删除任务
export function deleteTask(data: object) {
return request({
- url: "/plugin/atune/delete",
+ url: "/plugin/atune/task_delete",
method: "delete",
data,
});
diff --git a/atune/web/src/components/atuneTemplete.vue b/atune/web/src/components/atuneTemplete.vue
index f1937d043fab95c4e788374db5dc066bcc0b3514..5cb87d3bd8e74551dd6db9d954f23f1ffd1b4d6c 100644
--- a/atune/web/src/components/atuneTemplete.vue
+++ b/atune/web/src/components/atuneTemplete.vue
@@ -4,6 +4,9 @@
+
+
+
@@ -17,12 +20,7 @@
-
+
@@ -36,7 +34,7 @@
import { ElMessage } from "element-plus";
import { reactive, watchEffect, ref } from "vue";
import { getAtuneInfo, saveTune, updateTune } from "@/api/atune";
-import { Atune } from "@/types/atune";
+import { Atune, Task } from "@/types/atune";
import MyButton from "@/components/myButton.vue";
let props = defineProps({
@@ -54,6 +52,7 @@ const isEdit = ref(false);
const form = reactive({
id: 0,
tuneName: "",
+ description: "",
workDir: "",
prepare: "",
tune: "",
diff --git a/atune/web/src/components/table.vue b/atune/web/src/components/table.vue
index 629cd42e1c30d859b3fb4f28aad55422a09842d3..6cb24f026200b483927b38fe40ba85a329b97c65 100644
--- a/atune/web/src/components/table.vue
+++ b/atune/web/src/components/table.vue
@@ -8,13 +8,8 @@
@@ -103,53 +84,7 @@ onMounted(async () => {
// 获取表格数据
const getTableData = () => {
- // loading.value = true;
- tableData.value = [
- {
- id: 2,
- task_name: "准备调优环境",
- command: "ls",
- task_status: "已完成",
- create_time: "2023-12-25 11:23:18",
- update_time: "2023-12-25 11:23:18",
- results: [
- {
- id: 2,
- task_id: 2,
- machine_uuid: "13ff60a7-0f7d-49d6-b7fc-b766cc347ba8",
- machine_ip: "192.168.160.20",
- command: "ls",
- retcode: 0,
- stdout:
- "app\nconfig_agent.yaml\nconfig_agent.yaml.templete\nconfig_server.yaml\nconfig_server.yaml.templete\ndbmanager\nglobal\ngo.mod\ngo.sum\nuser.xlsx.templete\nutils\nvendor",
- stderr: "",
- is_update: true,
- },
- ],
- },
- {
- id: 1,
- task_name: "执行中",
- command: "ls",
- task_status: "执行中",
- create_time: "2023-12-25 10:08:15",
- update_time: "",
- results: [
- {
- id: 1,
- task_id: 1,
- machine_uuid: "13ff60a7-0f7d-49d6-b7fc-b766cc347ba8",
- machine_ip: "192.168.160.20",
- command: "ls",
- retcode: 0,
- stdout:
- "app\nconfig_agent.yaml\nconfig_agent.yaml.templete\nconfig_server.yaml\nconfig_server.yaml.templete\ndbmanager\nglobal\ngo.mod\ngo.sum\nuser.xlsx.templete\nutils\nvendor",
- stderr: "",
- is_update: false,
- },
- ],
- },
- ];
+ loading.value = true;
props.getData!({ page: page.currentPage, size: page.pageSize }).then(
(res: { data: ReaultData }) => {
let result: ReaultData = res.data;
@@ -174,7 +109,7 @@ const handleSearch = () => {
.searchFunc({
page: page.currentPage,
size: page.pageSize,
- name: keyWord,
+ search: keyWord.value,
})
.then((res: any) => {
loading.value = false;
@@ -256,6 +191,7 @@ defineExpose({
justify-content: space-evenly;
width: 100%;
height: 100%;
+
&_header {
width: 100%;
height: 44px;
@@ -265,6 +201,7 @@ defineExpose({
display: flex;
align-items: center;
justify-content: space-between;
+
&_title {
font-size: 16px;
}
diff --git a/atune/web/src/types/atune.d.ts b/atune/web/src/types/atune.d.ts
index 349d456a099428c9fc4ddb2d0ecfa5ceeb3a263a..d2f093ab5a3aa4533795d169be0eb94938d06031 100644
--- a/atune/web/src/types/atune.d.ts
+++ b/atune/web/src/types/atune.d.ts
@@ -6,10 +6,15 @@ export interface Task {
create_time: string;
update_time: string;
results: Array;
+ tune_id: int;
+ tune: Atune
}
export interface Atune {
id: number;
+ description: string;
+ create_time: string;
+ update_time: string
tuneName: string;
workDir: string;
prepare: string;
diff --git a/atune/web/src/views/Home.vue b/atune/web/src/views/Home.vue
index 6f51d4c717c5df4047aa686eaef8faf1842465a9..2b2db2168d9e932b554c6e8c69126b85fe24a9f5 100644
--- a/atune/web/src/views/Home.vue
+++ b/atune/web/src/views/Home.vue
@@ -2,21 +2,14 @@
-
+
- 执行任务列表
+ 执行任务列表
任务详情
@@ -25,12 +18,8 @@
-
+
@@ -65,11 +54,11 @@ const returnHome = () => {
};
// 新增
-const handleCreat = () => {};
+const handleCreat = () => { };
// 查看模板详情
const handleAtuneDetail = (taskRow: Task | Atune) => {
- selectedEditRow.value = taskRow;
+ selectedEditRow.value = taskRow.tune;
showDialog.value = true;
};
@@ -98,6 +87,7 @@ const handleDataUpdated = () => {
margin: 0 auto;
height: 100%;
}
+
&-nav {
width: 96%;
margin: 0 auto;
diff --git a/atune/web/src/views/taskList.vue b/atune/web/src/views/taskList.vue
index e283e8585e6df662dafda8f254f83e94a265ea2f..a6568d488ee1ecce4d41521fe24e0f8b068bde8c 100644
--- a/atune/web/src/views/taskList.vue
+++ b/atune/web/src/views/taskList.vue
@@ -1,12 +1,7 @@
-
+
任务列表
新增
@@ -18,43 +13,23 @@
- {{ props.row.tune ? props.row.tune.tuneName : "暂无" }}
-
+ {{ props.row.tune ? props.row.tune_id : "暂无" }}
+
-
-
-
+
+
+
- 详情
+ 详情
@@ -64,7 +39,7 @@