|
@@ -2,7 +2,8 @@
|
|
<el-dialog
|
|
<el-dialog
|
|
:title="'应用详情'"
|
|
:title="'应用详情'"
|
|
:visible.sync="visible"
|
|
:visible.sync="visible"
|
|
- width="80%"
|
|
|
|
|
|
+ width="60%"
|
|
|
|
+ :before-close="handleClose"
|
|
@close="cancel"
|
|
@close="cancel"
|
|
>
|
|
>
|
|
<el-form>
|
|
<el-form>
|
|
@@ -46,6 +47,15 @@
|
|
</el-row>
|
|
</el-row>
|
|
</el-card>
|
|
</el-card>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item class="card-header">控制台输出</el-form-item>
|
|
|
|
+ <el-form-item
|
|
|
|
+ class="text item"
|
|
|
|
+
|
|
|
|
+ >
|
|
|
|
+ <el-card shadow="nerver" style="font-size: 15px">
|
|
|
|
+ <div style = "white-space: pre-wrap" v-loading="loading">{{applicationLog}}</div>
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-form-item>
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
<!--
|
|
<!--
|
|
@@ -164,6 +174,8 @@ export default {
|
|
return {
|
|
return {
|
|
//定义可见性,即获取数据成功与否后再可见
|
|
//定义可见性,即获取数据成功与否后再可见
|
|
visible: false,
|
|
visible: false,
|
|
|
|
+ timer:null,
|
|
|
|
+ applicationLog: "正在读取...",
|
|
ingressesVisible: false,
|
|
ingressesVisible: false,
|
|
serviceVisible: false,
|
|
serviceVisible: false,
|
|
eventsVisible:false,
|
|
eventsVisible:false,
|
|
@@ -187,6 +199,7 @@ export default {
|
|
init(name, version,createTime,applicationType,applicationDescription,parentProjectName) {
|
|
init(name, version,createTime,applicationType,applicationDescription,parentProjectName) {
|
|
this.name = name;
|
|
this.name = name;
|
|
this.version = version;//版本号
|
|
this.version = version;//版本号
|
|
|
|
+ this.applicationLog="正在读取...";
|
|
this.visible = true;
|
|
this.visible = true;
|
|
this.createTime=createTime;
|
|
this.createTime=createTime;
|
|
this.applicationType=applicationType;
|
|
this.applicationType=applicationType;
|
|
@@ -288,6 +301,12 @@ export default {
|
|
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
|
+ this.timer=window.setInterval(()=>{
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ console.log("执行定时任务");
|
|
|
|
+ this.getOutput();
|
|
|
|
+ },0)
|
|
|
|
+ },1000);
|
|
},
|
|
},
|
|
formatMessage(){
|
|
formatMessage(){
|
|
var item=this.eventsData.data.items[0].status;
|
|
var item=this.eventsData.data.items[0].status;
|
|
@@ -314,9 +333,36 @@ export default {
|
|
|
|
|
|
|
|
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ getOutput(){
|
|
|
|
+ this.$http({
|
|
|
|
+ url: this.$http.adornUrl(
|
|
|
|
+ `/generator/applications/appRunningLog/${this.name}`
|
|
|
|
+ ),
|
|
|
|
+ method: "get",
|
|
|
|
+ //
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if(res.data.code==500){
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.applicationLog=res.data.log;
|
|
|
|
+ })
|
|
|
|
+ .catch((error) => {
|
|
|
|
+ console.log("获取日志信息错误", error);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handleClose(){
|
|
|
|
+ if (this.timer) {
|
|
|
|
+ clearInterval(this.timer);
|
|
|
|
+ this.timer = null;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ this.visible=false;
|
|
|
|
+ },
|
|
cancel() {
|
|
cancel() {
|
|
this.visible = false;
|
|
this.visible = false;
|
|
|
|
+ this.timer=null;
|
|
this.ingressesVisible = false;
|
|
this.ingressesVisible = false;
|
|
this.serviceVisible = false;
|
|
this.serviceVisible = false;
|
|
this.eventsVisible=false;
|
|
this.eventsVisible=false;
|
|
@@ -326,6 +372,15 @@ export default {
|
|
this.eventsData=[];
|
|
this.eventsData=[];
|
|
this.name = "";
|
|
this.name = "";
|
|
this.version = "";
|
|
this.version = "";
|
|
|
|
+ this.applicationLog="正在读取...";
|
|
|
|
+ },
|
|
|
|
+ //切换路由时,清楚定时器
|
|
|
|
+ beforeRouteLeave(to, from, next){
|
|
|
|
+ next();
|
|
|
|
+ if (this.timer) {
|
|
|
|
+ clearInterval(this.timer);
|
|
|
|
+ this.timer = null;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|