فهرست منبع

日志管理功能代码提交

jingyuanchao 1 سال پیش
والد
کامیت
54f50a3a60
2فایلهای تغییر یافته به همراه23 افزوده شده و 8 حذف شده
  1. 9 0
      src/api/system/logManagement.js
  2. 14 8
      src/views/system/logManagement/dialog.info.vue

+ 9 - 0
src/api/system/logManagement.js

@@ -34,3 +34,12 @@ export function getLogList(serverId, checkId) {
     method: 'get'
   })
 }
+
+// 转存目标服务器上的日志到 挂载目录下
+export function transferLog(data) {
+  return request({
+    url: '/system/transferLog',
+    method: 'post',
+    data: data
+  })
+}

+ 14 - 8
src/views/system/logManagement/dialog.info.vue

@@ -15,7 +15,7 @@
               align="center"
             >
               <template slot-scope="scope">
-                {{ scope.row.fileType == 1 ? '目录' : '文件' }}
+                {{ scope.row.fileType == 1 ? '文件' : '目录' }}
               </template>
 
             </el-table-column>
@@ -36,14 +36,14 @@
                   size="mini"
                   type="text"
                   icon="el-icon-edit-outline"
-                  @click="handleUpdate(scope.row)"
+                  @click="transferLog(scope.row)"
                 >获取日志
                 </el-button>
                 <el-button
                   size="mini"
                   type="text"
                   icon="el-icon-edit-outline"
-                  @click="handleUpdate(scope.row)"
+                  @click="transferLog(scope.row)"
                 >重新获取
                 </el-button>
                 <el-button
@@ -67,7 +67,7 @@
 </template>
 
 <script>
-import {mapState, mapMutations} from "vuex";
+import {mapMutations, mapState} from "vuex";
 import {getLogList} from "@/api/system/logManagement";
 import {getLabel} from "@/views/commonOption";
 
@@ -82,6 +82,8 @@ export default {
       formData: this.reset(),
       title: '',
       logList: [],
+      serverId: null,
+      serviceId: null,
     };
   },
 
@@ -95,7 +97,6 @@ export default {
     getLabel,
     reset(other = {}) {
       return {
-        id: null,
         fileName: null,
         fileSize: null,
         fileType: null,
@@ -103,22 +104,27 @@ export default {
       };
     },
     async refresh(serverId, serviceId) {
-
       if (!serverId || !serviceId) {
         this.reset(serverId);
       } else {
-        getLogList(serverId, serverId).then((response) => {
+        getLogList(serverId, serviceId).then((response) => {
           this.logList = response.data;
           this.loading = false;
         });
       }
     },
     async show(server, service, other = {}) {
-      this.id = server;
+      this.serverId = server.id;
+      this.serviceId = service.id;
       this.title = service.checkName + "日志详情页";
       await this.refresh(server.id, service.id);
       this.isShow = true;
     },
+
+    transferLog(row) {
+
+
+    },
     // 事件
     onHide() {
       this.isShow = false;