فهرست منبع

算法发布提示

wangyi 2 سال پیش
والد
کامیت
046eeb14bd

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

@@ -289,7 +289,7 @@ export default {
     },
     // 发布算法
     publishAlgorithm(name, id) {
-      this.$confirm(`是否对算法${name}进行发布`, "提示", {
+      this.$confirm(`是否对算法${name}进行发布?该算法需已指定主运行文件且算法名称不可包含中文及大写英文字母`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -468,7 +468,7 @@ export default {
     handleLog(id) {
       var websocket = null;
       
-      var host = "ws://127.0.0.1:8085/mkcloud/webSocket/log";
+      var host = "ws://150.158.138.99:8085/mkcloud/webSocket/log";
       // if (window.location.protocol == 'http:') {
       //   host = 'ws://' + window.location.host + '/websocket';
       // } else {

+ 50 - 1
src/views/modules/monitor/components/applicationMonitor/appRunningLog.vue

@@ -3,7 +3,7 @@
     :title="'应用日志'"
     :visible.sync="visible"
     width="80%"
-    @close="cancel"
+    :before-close="handleClose"
   >
     <el-form>
         
@@ -23,11 +23,15 @@ export default {
       loading:true,
       name: "",
       applicationLog: "",
+      timer:null,
       eventsData: [], //定义应用事件数据结构体
       totalPage: 0,
       pageIndex: 1,
       pageSize: this.$store.state.settings.pageSize,
     };
+  },
+  activated(){
+    
   },
   methods: {
     init(name) {
@@ -60,7 +64,52 @@ export default {
             console.log("获取日志信息错误", error);
           });
       });
+      this.timer=window.setInterval(()=>{
+      setTimeout(()=>{
+        console.log("执行定时任务");
+        this.getOutput();
+      },0)
+      },1000);
     },
+    getOutput(){
+      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;
+          })
+          .catch((error) => {
+            console.log("获取日志信息错误", error);
+          });
+    },
+    handleClose(){
+      if (this.timer) {
+        clearInterval(this.timer);
+        this.timer = null;
+        
+      }
+      this.visible=false;
+    },
+    //切换路由时,清楚定时器
+    beforeRouteLeave(to, from, next){
+      next();
+      if (this.timer) {
+        clearInterval(this.timer);
+        this.timer = null;
+      }
+    },
+
   },
 };
 </script>