Przeglądaj źródła

日志管理功能代码提交

jingyuanchao 1 rok temu
rodzic
commit
21e0759072

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

@@ -43,3 +43,12 @@ export function transferLogData(data) {
     data: data
   })
 }
+
+// 转存目标服务器上的日志到 挂载目录下
+export function downloadLogData(data) {
+  return request({
+    url: '/system/server/downloadLogData',
+    method: 'post',
+    data: data
+  })
+}

+ 17 - 5
src/views/system/logManagement/dialog.info.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="edu-training-edit">
-    <DialogCom :title="this.title" :visible.sync="isShow" append-to-body>
+    <DialogCom :title="this.title" :visible.sync="isShow"  width="1000px" append-to-body>
       <div class="page-body">
         <div class="extend_mod" style="max-height: 500px;">
-          <el-table :data="logList" border style="width: 100%;max-height: 500px;overflow-y: auto;" row-key="id" :default-expand-all="false" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
+          <el-table :data="logList" border style="width: 100%;max-height: 500px;" row-key="id" :default-expand-all="false" :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
             <el-table-column
               prop="fileName"
               label="文件名称"
@@ -45,7 +45,7 @@
                   type="text"
                   icon="el-icon-delete"
                   v-if="scope.row.exit == 1"
-
+                  @click="downloadLog(scope.row)"
                 >下载
                 </el-button>
               </template>
@@ -128,8 +128,20 @@ export default {
         this.$message.success("获取成功");
       });
     },
-    checkExit(row) {
-      return;
+    downloadLog(row){
+      let data = {
+        serverId: this.serverId,
+        parentPath: row.parentPath,
+        path: row.path,
+        rootDir: row.path,
+      };
+      this.download(
+        "/system/server/downloadLogData",
+        {
+          ...data,
+        },
+        row.fileName
+      );
     },
     // 事件
     onHide() {