Jelajahi Sumber

[修改]控制台输出

soleil 7 tahun lalu
induk
melakukan
d7a86ad7cd

+ 1 - 0
src/views/student/Code/ProjectDetail/BuildDetail.vue

@@ -111,5 +111,6 @@ export default {
   padding: $default-margin-between;
   background-color: #2d3044;
   color: #cacff1;
+  white-space: pre-line;
 }
 </style>

+ 8 - 2
src/views/student/Code/ProjectDetail/DeployDetail.vue

@@ -10,6 +10,7 @@
             <div>
               <b-radio v-model="radio" :native-value="`b${item.id}`"> </b-radio>
               <strong>构建ID: #</strong> {{ item.id }}
+              <b-tag type="is-success">success</b-tag>
               <span style="padding-left: 10px">
                 <strong>镜像ID: #</strong> {{ item.mirrorId }}
               </span>
@@ -22,7 +23,8 @@
           >
             <div>
               <b-radio v-model="radio" :native-value="`d${item.id}`"> </b-radio>
-              <strong>构建ID: #</strong> {{ item.id }}
+              <strong>部署ID: #</strong> {{ item.id }}
+              <b-tag type="is-success">success</b-tag>
               <span style="padding-left: 10px">
                 <strong>镜像ID: #</strong> {{ item.mirrorId }}
               </span>
@@ -51,6 +53,7 @@
         {{ isRunning ? "当前部署情况" : "上次部署结果" }}
       </div>
       <div class="deploy-item">本次部署ID: #{{ deployInfo.id }}</div>
+      <div class="deploy-item">本次部署镜像ID: #{{ deployInfo.mirrorId }}</div>
       <div class="deploy-item">
         本次部署创建时间: {{ handleTime(deployInfo.createdAt) }}
       </div>
@@ -188,8 +191,10 @@ export default {
               message: "开始部署",
               type: "is-success"
             });
-
             this.isRunning = true;
+            setTimeout(() => {
+              this.getLatestDeployInfo(this.projectDetail.latestDeploy.id);
+            }, 1000);
           })
           .then(e => {
             this.$toast.open({
@@ -320,6 +325,7 @@ export default {
 .code-section {
   background-color: #2d3044;
   padding: 20px 20px 20px 20px;
+  white-space: pre-line;
   .code-content {
     color: #cacff1;
   }

+ 13 - 2
src/views/student/Code/ProjectDetail/Test/FunctionalTestDetail.vue

@@ -24,10 +24,19 @@
         <div class="tag">{{ displayUnixTime(testDetail.time) }}</div>
       </template>
     </page-header>
-    <!--<div class="console-section">{{ testDetail.consoleOutput }}</div>-->
     <page-body>
       <div v-if="testDetailLoading"><page-section-loading show /></div>
       <div v-else>
+        <div class="gap-section">
+          <div class="page-section">
+            <a class="button is-small is-info" @click="showLog = !showLog">{{
+              showLog ? "收起控制台信息" : "查看控制台输出"
+            }}</a>
+            <div class="console-section" v-if="showLog">
+              {{ testDetail.consoleOutput }}
+            </div>
+          </div>
+        </div>
         <div
           v-for="item in testDetail.detail"
           :key="item.id"
@@ -62,7 +71,8 @@ export default {
   data() {
     return {
       testDetail: { detail: [] },
-      testDetailLoading: false
+      testDetailLoading: false,
+      showLog: false
     };
   },
   mixins: [timeMixins],
@@ -98,5 +108,6 @@ export default {
   padding: $default-margin-between $default-margin-between * 1.5;
   background-color: #2d3044;
   color: #cacff1;
+  white-space: pre-line;
 }
 </style>

+ 2 - 0
src/views/student/Code/ProjectDetail/Test/UnitTestDetail.vue

@@ -94,11 +94,13 @@ export default {
   padding: $default-margin-between;
   background-color: #2d3044;
   color: #cacff1;
+  white-space: pre-line;
 }
 
 .console-section {
   padding: $default-margin-between $default-margin-between * 1.5;
   background-color: #2d3044;
   color: #cacff1;
+  white-space: pre-line;
 }
 </style>

+ 8 - 5
src/views/teacher/Code/ProjectDetail/BuildDetail.vue

@@ -44,7 +44,7 @@
             >查看详细编译信息</a
           >
           <div class="code-section" v-show="buildMessageIsOpen[index]">
-            {{ item.buildMessage }}
+            <p v-html="item.buildMessage"></p>
           </div>
         </div>
       </div>
@@ -73,17 +73,19 @@ export default {
   watch: {
     projectDetail: function(newVal) {
       let buildMessageIsOpen = [];
-      for (let item of newVal.buildList) {
-        //处理buildTime格式
-        item.buildTime = item.buildTime.replace("T", " ") + "ms";
+      for (let i = 0; i < newVal.buildList.length; i++) {
+        let buildInfo = newVal.buildList[i];
+        buildInfo.buildTime = buildInfo.buildTime.replace("T", " ") + "ms";
         buildMessageIsOpen.push(false);
+        this.projectDetail.buildList[i] = buildInfo;
       }
       this.buildMessageIsOpen = buildMessageIsOpen;
     }
   },
   data() {
     return {
-      buildMessageIsOpen: []
+      buildMessageIsOpen: [],
+      testBuildMessage: "测试换行<br>第一行<br>第二行<br>"
     };
   },
   mounted() {},
@@ -111,5 +113,6 @@ export default {
   padding: $default-margin-between;
   background-color: #2d3044;
   color: #cacff1;
+  white-space: pre-line;
 }
 </style>

+ 1 - 0
src/views/teacher/Code/ProjectDetail/DeployDetail.vue

@@ -164,6 +164,7 @@ export default {
 .code-section {
   background-color: #2d3044;
   padding: 20px 20px 20px 20px;
+  white-space: pre-line;
   .code-content {
     color: #cacff1;
   }