Jelajahi Sumber

应用日志

wangyi 2 tahun lalu
induk
melakukan
1abfb21460

+ 1 - 1
config/index.js

@@ -11,7 +11,7 @@ module.exports = {
 
     // Paths
     assetsSubDirectory: 'static',
-    assetsPublicPath: './',
+    assetsPublicPath: '/',
     // 代理列表, 是否开启代理通过[./dev.env.js]配置
     proxyTable: devEnv.OPEN_PROXY === false ? {} : {
       '/mkcloud' : {

+ 1 - 1
src/views/modules/generator/algorithm.vue

@@ -5,7 +5,7 @@
       :visible.sync="imagesLogVisible"
       width="30%"
       >
-      <p>{{imagesLog}}</p>
+      <div style = "white-space: pre-wrap">{{imagesLog}}</div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="imagesLogVisible = false">确 定</el-button>
       </span>

+ 67 - 0
src/views/modules/monitor/components/applicationMonitor/appRunningLog.vue

@@ -0,0 +1,67 @@
+<template>
+  <el-dialog
+    :title="'应用日志'"
+    :visible.sync="visible"
+    width="80%"
+    @close="cancel"
+  >
+    <el-form>
+        
+    </el-form>
+    <div style = "white-space: pre-wrap" v-loading="loading">
+        {{applicationLog}}
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      //定义可见性,即获取数据成功与否后再可见
+      visible: false,
+      loading:true,
+      name: "",
+      applicationLog: "",
+      eventsData: [], //定义应用事件数据结构体
+      totalPage: 0,
+      pageIndex: 1,
+      pageSize: this.$store.state.settings.pageSize,
+    };
+  },
+  methods: {
+    init(name) {
+      this.name = name;
+      this.visible = true;
+      this.loading=true;
+      this.applicationLog="";
+      this.$nextTick(() => {
+        // 获取路由
+        this.$http({
+          url: this.$http.adornUrl(
+            `/generator/applications/appRunningLog/${this.name}`
+          ),
+          method: "get",
+          //
+        })
+          .then((res) => {
+            if(res.data.code==500){
+                this.$message({
+                    type: 'info',
+                    message: '暂无数据'
+                });  
+            }
+            
+            this.applicationLog=res.data.log;
+            this.loading=false;
+          })
+          .catch((error) => {
+            
+            console.log("获取日志信息错误", error);
+          });
+      });
+    },
+  },
+};
+</script>
+

+ 9 - 4
src/views/modules/monitor/components/applications.vue

@@ -119,14 +119,14 @@
               >查看应用日志</el-button
             ></el-row
           >
-          <el-row>
+          <!-- <el-row>
             <el-button
               type="text"
               size="small"
               @click="viewApplicationResult(scope.row.applicationId)"
               >查看应用结果</el-button
             ></el-row
-          >
+          > -->
           <el-row>
             <el-button
               type="text"
@@ -154,12 +154,15 @@
     </application-log>
     <application-view v-if="applicationViewVisible" ref="applicationView">
     </application-view>
+    <apprunning-log v-if="appRunningLogVisible" ref="apprunningLog">
+    </apprunning-log>
   </div>
 </template>
 
 <script>
 import applicationLog from "./applicationMonitor/applicationLog.vue";
 import applicationView from "./applicationMonitor/appMonitor.vue";
+import apprunningLog from "./applicationMonitor/appRunningLog.vue";
 export default {
   data() {
     return {
@@ -175,6 +178,7 @@ export default {
       dataListSelections: [],
       addOrUpdateVisible: false,
       viewDetailVisible: false,
+      appRunningLogVisible:false,
       applicationViewVisible: false,
       filterVal: "",
       applicationTypeOptions: [
@@ -196,6 +200,7 @@ export default {
   components: {
     applicationLog,
     applicationView,
+    apprunningLog,
   },
   activated() {
     this.getDataList();
@@ -252,9 +257,9 @@ export default {
       var item = this.dataList.filter((item) => item.applicationId === id);
       // 获取应用的name和版本号,传入到详情
       console.log("查看item中数据" + item);
-      this.viewDetailVisible = true;
+      this.appRunningLogVisible = true;
       this.$nextTick(() => {
-        this.$refs.viewDetail.init(item[0].applicationName+"log");
+        this.$refs.apprunningLog.init(item[0].applicationName);
       });
     },
     viewApplicationResult(id){