3 Commits 15422aeb56 ... 98fcbef383

Autore SHA1 Messaggio Data
  reghao 98fcbef383 构建过程所产生日志文件的获取和展示 2 giorni fa
  reghao c2b826f631 删除无用的后台侧边栏菜单 2 giorni fa
  reghao 9c1315303c 更新 BuildDeploy.vue 页面中构建部署列表的列 2 giorni fa
3 ha cambiato i file con 63 aggiunte e 77 eliminazioni
  1. 4 0
      src/api/devops.js
  2. 0 50
      src/router/background_devops.js
  3. 59 27
      src/views/devops/app/BuildDeploy.vue

+ 4 - 0
src/api/devops.js

@@ -358,6 +358,10 @@ export function getBuildConsumed(queryInfo) {
   return get(devopsApi.getBuildDeployList + '/consumed', queryInfo)
 }
 
+export function getBuildLogFile(queryInfo) {
+  return get(devopsApi.getBuildDeployList + '/log', queryInfo)
+}
+
 export function getBuildPackageUrl(queryInfo) {
   return get(devopsApi.getBuildDeployList + '/package_url', queryInfo)
 }

+ 0 - 50
src/router/background_devops.js

@@ -98,48 +98,6 @@ export default {
           icon: 'el-icon-s-data',
           component: AliyunKey,
           meta: { needAuth: true, roles: ['devops_admin'] }
-        },
-        {
-          path: '/bg/machine/proc',
-          name: 'MachineProc',
-          title: '服务进程',
-          icon: 'el-icon-s-data',
-          component: MachineProc,
-          meta: { needAuth: true, roles: ['devops_admin'] }
-        },
-        {
-          path: '/bg/machine/task',
-          name: 'MachineTask',
-          title: '定时任务',
-          icon: 'el-icon-s-data',
-          component: MachineTask,
-          meta: { needAuth: true, roles: ['devops_admin'] }
-        }
-      ]
-    },
-    {
-      path: '/bg/srv',
-      name: 'MachineSrv',
-      title: '服务',
-      icon: 'el-icon-s-data',
-      component: { render: (e) => e('router-view') },
-      meta: { needAuth: true, roles: ['devops_admin'] },
-      children: [
-        {
-          path: '/bg/srv/nginx',
-          name: 'MachineNginx',
-          title: 'Nginx',
-          icon: 'el-icon-s-data',
-          component: MachineNginx,
-          meta: { needAuth: true, roles: ['devops_admin'] }
-        },
-        {
-          path: '/bg/srv/nginx_log',
-          name: 'NginxLog',
-          title: 'NginxLog',
-          icon: 'el-icon-s-data',
-          component: NginxLog,
-          meta: { needAuth: true, roles: ['devops_admin'] }
         }
       ]
     },
@@ -159,14 +117,6 @@ export default {
           component: DockerRegistry,
           meta: { needAuth: true, roles: ['devops_admin'] }
         },
-        {
-          path: '/bg/docker/container',
-          name: 'Docker',
-          title: '容器镜像',
-          icon: 'el-icon-user-solid',
-          component: Docker,
-          meta: { needAuth: true, roles: ['devops_admin'] }
-        },
         {
           path: '/bg/docker/image',
           name: 'DockerImage',

+ 59 - 27
src/views/devops/app/BuildDeploy.vue

@@ -40,7 +40,6 @@
         <!--        <el-button type="success" icon="el-icon-search" style="margin-left: 5px" @click="onSearch">查询</el-button>-->
         <el-button type="text" style="margin-left: 5px" @click="onRefresh">刷新</el-button>
         <el-button type="text" style="margin-left: 5px" @click="handleBuildTask">构建任务</el-button>
-        <el-button type="text" style="margin-left: 5px" @click="handleResetStat">重置状态</el-button>
       </el-row>
     </el-header>
     <el-main>
@@ -55,14 +54,16 @@
           label="No"
           type="index"
         />
-        <el-table-column
-          prop="appName"
-          label="应用名"
-        />
         <el-table-column
           prop="appId"
           label="应用 ID"
-        />
+        >
+          <template slot-scope="scope">
+            <el-button type="text" @click="handleAppDetail(scope.row)">
+              {{ scope.row.appId }}
+            </el-button>
+          </template>
+        </el-table-column>
         <el-table-column
           prop="repoBranch"
           label="分支"
@@ -131,7 +132,7 @@
         </el-table-column>
         <el-table-column
           prop="buildBy"
-          label="用户"
+          label="操作用户"
         />
         <el-table-column
           fixed="right"
@@ -193,16 +194,12 @@
             label="应用"
           />
           <el-table-column
-            prop="appType"
-            label="类型"
-          />
-          <el-table-column
-            prop="env"
-            label="环境"
+            prop="status"
+            label="状态"
           />
           <el-table-column
-            prop="stat"
-            label="状态"
+            prop="waitTime"
+            label="等待时间(秒)"
           />
           <el-table-column
             fixed="right"
@@ -427,7 +424,7 @@
               <el-button
                 style="margin-top: 5px; margin-left: 5px"
                 size="mini"
-                @click="handleBuildLogFile(scope.$index, scope.row)"
+                @click="handleBuildLogFile(scope.row)"
               >日志</el-button>
               <el-button
                 style="margin-top: 5px; margin-left: 5px"
@@ -460,6 +457,16 @@
         />
       </template>
     </el-dialog>
+    <el-dialog
+      title="应用详情"
+      append-to-body
+      :visible.sync="showAppDialog"
+      width="100%"
+      center
+    >
+      <template>
+      </template>
+    </el-dialog>
     <el-dialog
       title="构建结果"
       append-to-body
@@ -586,6 +593,19 @@
         </div>
       </template>
     </el-dialog>
+    <el-dialog
+      title="构建日志"
+      width="100%"
+      append-to-body
+      :visible.sync="showBuildLogFileDialog"
+      center
+    >
+      <template>
+        <div v-if="buildLogFile !== null" style="margin-bottom: 20px;">
+          {{ buildLogFile }}
+        </div>
+      </template>
+    </el-dialog>
   </el-container>
 </template>
 
@@ -593,12 +613,12 @@
 import {
   buildApp,
   cancelBuildTask, deleteBuildLog, deployApp, getBuildConfigSnapshot, getBuildConsumed,
-  getBuildDeployList,
+  getBuildDeployList, getBuildLogFile,
   getBuildLogList, getBuildPackageUrl, getBuildResult,
   getBuildTaskList,
   getDeployList,
   getEnvList,
-  resetBuildStat, updateApp
+  updateApp
 } from '@/api/devops'
 
 export default {
@@ -633,12 +653,15 @@ export default {
       pageSize1: 10,
       totalSize1: 0,
       dataList1: [],
+      showAppDialog: false,
       showResultDialog: false,
       buildResult: null,
       showSnapshotDialog: false,
       buildConfigSnapshot: null,
       showConsumedDialog: false,
       buildConsumed: null,
+      showBuildLogFileDialog: false,
+      buildLogFile: null,
       // **********************************************************************
       deployDialogTitle: '',
       showDeployDialog: false,
@@ -728,13 +751,6 @@ export default {
         this.$message.error(error.message)
       })
     },
-    handleResetStat() {
-      resetBuildStat().then(resp => {
-        this.$message.info(resp.msg)
-      }).catch(error => {
-        this.$message.error(error.message)
-      })
-    },
     handleBuildLog(index, row) {
       this.queryInfo1.appId = row.appId
       this.queryInfo1.pn = 1
@@ -766,6 +782,12 @@ export default {
         this.$message.error(error.message)
       })
     },
+    handleAppDetail(row) {
+      this.$message.info('get ' + row.appId + ' detail')
+      const queryInfo = {}
+      queryInfo.appId = row.appId
+      this.showAppDialog = true
+    },
     handleBuildResult(row) {
       const queryInfo = {}
       queryInfo.buildLogId = row.buildLogId
@@ -800,7 +822,6 @@ export default {
       getBuildConsumed(queryInfo).then(resp => {
         if (resp.code === 0) {
           this.buildConsumed = resp.data
-          console.log(this.buildConsumed)
           this.showConsumedDialog = true
         } else {
           this.$message.error(resp.msg)
@@ -823,7 +844,18 @@ export default {
       })
     },
     handleBuildLogFile(row) {
-      this.$message.info('get build log file')
+      const queryInfo = {}
+      queryInfo.buildLogId = row.buildLogId
+      getBuildLogFile(queryInfo).then(resp => {
+        if (resp.code === 0) {
+          this.buildLogFile = resp.data
+          this.showBuildLogFileDialog = true
+        } else {
+          this.$message.error(resp.msg)
+        }
+      }).catch(error => {
+        this.$message.error(error.message)
+      })
     },
     handleDeployBuild(index, row) {
       const formData = new FormData()