This is an automated email from the ASF dual-hosted git repository.

peacewong pushed a commit to branch dev-1.2.0
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.2.0 by this push:
     new bef6281ea Support displaying history EngineConn information (#2495)
bef6281ea is described below

commit bef6281ea9498c8c3c20a3489a81f269f82d4a22
Author: peacewong <[email protected]>
AuthorDate: Tue Jul 19 21:10:25 2022 +0800

    Support displaying history EngineConn information (#2495)
---
 web/src/apps/linkis/components/tag/index.vue       |   2 +-
 web/src/apps/linkis/i18n/common/en.json            |   2 +
 web/src/apps/linkis/i18n/common/zh.json            |   2 +
 web/src/apps/linkis/module/ECM/index.vue           |   2 +-
 web/src/apps/linkis/module/ECM/log.vue             |   5 +-
 web/src/apps/linkis/module/ECM/search.vue          |   5 +-
 web/src/apps/linkis/module/datasource/index.vue    |   2 +-
 .../module/globalHistoryManagement/index.scss      |   2 +-
 .../module/resourceManagement/engineConn.vue       | 386 +++++++++++++++++++++
 .../linkis/module/resourceManagement/index.scss    |  50 +++
 .../linkis/module/resourceManagement/index.vue     |  21 +-
 .../module/{ECM => resourceManagement}/log.vue     |   9 +-
 .../module/{ECM => resourceManagement}/search.vue  |  88 +++--
 web/src/apps/linkis/router.js                      |  12 +-
 web/src/apps/linkis/view/linkis/index.vue          |  20 +-
 web/src/components/consoleComponent/log.vue        |   3 +
 16 files changed, 557 insertions(+), 54 deletions(-)

diff --git a/web/src/apps/linkis/components/tag/index.vue 
b/web/src/apps/linkis/components/tag/index.vue
index 1492a81f3..b242453ce 100644
--- a/web/src/apps/linkis/components/tag/index.vue
+++ b/web/src/apps/linkis/components/tag/index.vue
@@ -35,7 +35,7 @@
         :color="item.modifiable ? 'primary' : 'default'"
         @on-close="handleClose2"
         @on-change="handleTagChange"
-      >{{ item.key }}-{{ item.value }}
+      >{{ item.key }}{{ item.key ? '-' : '' }}{{ item.value }}
       </Tag>
       <!-- 编辑标签 -->
       <div class="addAndCancel" v-else>
diff --git a/web/src/apps/linkis/i18n/common/en.json 
b/web/src/apps/linkis/i18n/common/en.json
index 9884ba716..2e0d72271 100644
--- a/web/src/apps/linkis/i18n/common/en.json
+++ b/web/src/apps/linkis/i18n/common/en.json
@@ -20,6 +20,7 @@
       "fold": "Fold",
       "jumpPage": "Please check in the jump page...",
       "initiator": "Created From",
+      "inputOwnerHint": "Please input owner",
       "find": "Find",
       "errorCode": "Error code",
       "errorDescription": "Error description",
@@ -142,6 +143,7 @@
           "children": {
             "globalHistory": "Global History",
             "resource": "Resource Manager",
+            "resourceEngineConnList": "History Engine List",
             "setting": "Settings",
             "dateReport": "Global Variables",
             "globalValiable": "Frequently Asked",
diff --git a/web/src/apps/linkis/i18n/common/zh.json 
b/web/src/apps/linkis/i18n/common/zh.json
index 5161d5543..8cb191b8c 100644
--- a/web/src/apps/linkis/i18n/common/zh.json
+++ b/web/src/apps/linkis/i18n/common/zh.json
@@ -18,6 +18,7 @@
             "addTags": "添加标签",
             "find": "查询",
             "initiator": "创建者",
+            "inputOwnerHint": "请输入创建者",
             "jumpPage": "请在跳转页面查看……",
             "editedSuccess": "修改成功",
             "errorCode": "错误码",
@@ -144,6 +145,7 @@
                     "children": {
                         "globalHistory": "全局历史",
                         "resource": "资源管理",
+                        "resourceEngineConnList": "历史引擎信息",
                         "setting": "参数配置",
                         "dateReport": "全局变量",
                         "globalValiable": "常见问题",
diff --git a/web/src/apps/linkis/module/ECM/index.vue 
b/web/src/apps/linkis/module/ECM/index.vue
index d9cffa653..59cbb58fe 100644
--- a/web/src/apps/linkis/module/ECM/index.vue
+++ b/web/src/apps/linkis/module/ECM/index.vue
@@ -240,7 +240,7 @@ export default {
         }
         return data;
       }
-      return  v && (v.cores !== undefined || v.memonry !== undefined || 
v.instance !== undefined) ? 
`${calcCompany(v.cores)}cores,${calcCompany(v.memory, 
true)}G,${calcCompany(v.instance)}apps` : ''
+      return  v && (v.cores !== undefined || v.memory !== undefined || 
v.instance !== undefined) ? 
`${calcCompany(v.cores)}cores,${calcCompany(v.memory, 
true)}G,${calcCompany(v.instance)}apps` : ''
     }
   },
   created() {
diff --git a/web/src/apps/linkis/module/ECM/log.vue 
b/web/src/apps/linkis/module/ECM/log.vue
index e0be67049..23e28b4f3 100644
--- a/web/src/apps/linkis/module/ECM/log.vue
+++ b/web/src/apps/linkis/module/ECM/log.vue
@@ -16,7 +16,7 @@
   -->
 
 <template>
-  <div style="position:relative">
+  <div class="log" style="position:relative">
     <Tabs @on-click="onClickTabs" :value="tabName">
       <TabPane name="stdout" label="stdout"></TabPane>
       <TabPane name="stderr" label="stderr"></TabPane>
@@ -122,6 +122,9 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.log {
+  height: 100%;
+}
  .backButton {
   position: absolute;
   top: -2px;
diff --git a/web/src/apps/linkis/module/ECM/search.vue 
b/web/src/apps/linkis/module/ECM/search.vue
index 9021f4e74..09e89b7ca 100644
--- a/web/src/apps/linkis/module/ECM/search.vue
+++ b/web/src/apps/linkis/module/ECM/search.vue
@@ -16,7 +16,7 @@
   -->
 
 <template>
-  <Form :model="searchBar" :rules="ruleInline" inline>
+  <Form :model="searchBar" :rules="ruleInline" inline @submit.native.prevent>
     <FormItem prop="instance" :label="`${$t('message.linkis.instanceName')}`">
       <Input :maxlength="50" v-model="searchBar.instance" 
:placeholder="$t('message.linkis.instanceName')"/>
     </FormItem>
@@ -115,7 +115,8 @@ export default {
     display: flex;
     .ivu-form-item {
       display: flex;
-      margin-right: 30px;
+      margin-right: 8px;
+      margin-bottom: 8px;
       flex: none;
     }
   }
diff --git a/web/src/apps/linkis/module/datasource/index.vue 
b/web/src/apps/linkis/module/datasource/index.vue
index 5f02c7b5e..f4fae6658 100644
--- a/web/src/apps/linkis/module/datasource/index.vue
+++ b/web/src/apps/linkis/module/datasource/index.vue
@@ -503,7 +503,7 @@ export default {
       })
     },
     openVersionList(row) {
-      this.currentSourceData = row
+      this.currentSourceData = JSON.parse(JSON.stringify(row))
       this.getVersionListBySourceId()
       this.showVersionList = true
     },
diff --git a/web/src/apps/linkis/module/globalHistoryManagement/index.scss 
b/web/src/apps/linkis/module/globalHistoryManagement/index.scss
index 0e25d5618..1e201eb15 100644
--- a/web/src/apps/linkis/module/globalHistoryManagement/index.scss
+++ b/web/src/apps/linkis/module/globalHistoryManagement/index.scss
@@ -91,7 +91,7 @@
     }
 }
 .workbench-log-view {
-    height: 100%;
+    height: calc(100% - 76px) !important;
     .log-tools {
         height: 36px;
         line-height: 36px;
diff --git a/web/src/apps/linkis/module/resourceManagement/engineConn.vue 
b/web/src/apps/linkis/module/resourceManagement/engineConn.vue
new file mode 100644
index 000000000..40bdf0637
--- /dev/null
+++ b/web/src/apps/linkis/module/resourceManagement/engineConn.vue
@@ -0,0 +1,386 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<template>
+  <div :style="{height: '100%'}">
+    <div v-show="!showviewlog" class="ecmEngine">
+      <Search ref="search" :statusList="statusList" :engineTypes="engineTypes" 
@search="search" :stopbtn="true" :page="page" />
+      <Spin
+        v-if="loading"
+        size="large"
+        fix/>
+      <Table class="table-content ecm-engine-table" border :width="tableWidth" 
:columns="columns" :data="tableData" @on-selection-change="selctionChange">
+        <template slot-scope="{row}" slot="serviceInstance">
+          <span>{{row.serviceInstance ? row.serviceInstance : '-'}}</span>
+        </template>
+        <template slot-scope="{row}" slot="usedResource">
+          <!-- 后台未做返回时的处理,下面几个可按照处理 -->
+          <span 
v-if="row.usedResource">{{`${calcCompany(row.usedResource.cores)}cores,${calcCompany(row.usedResource.memory,
 true)}G,${calcCompany(row.usedResource.instance)}apps`}}</span>
+          <span v-else>-</span>
+        </template>
+        <template slot-scope="{row}" slot="labelValue" >
+          <div class="tag-box">
+            <Tooltip v-for="(item, index) in row.labelValue.split(',')" 
:key="index" :content="`${item}`" placement="top">
+              <Tag class="tag-item" type="border" 
color="primary">{{`${item}`}}</Tag>
+            </Tooltip>
+          </div>
+        </template>
+        <template slot-scope="{row}" slot="usedTime">
+          <span>{{ row.usedTime ? timeFormat(row) : '-' }}</span>
+        </template>
+      </Table>
+      <div class="page-bar">
+        <Page
+          ref="page"
+          :total="page.totalSize"
+          :page-size-opts="page.sizeOpts"
+          :page-size="page.pageSize"
+          :current="page.pageNow"
+          class-name="page"
+          size="small"
+          show-total
+          show-sizer
+          :prev-text="$t('message.linkis.previousPage')" 
:next-text="$t('message.linkis.nextPage')"
+          @on-change="change"
+          @on-page-size-change="changeSize" />
+      </div>
+      <Modal
+        @on-ok="submitTagEdit"
+        :title="$t('message.linkis.tagEdit')"
+        v-model="isTagEdit"
+        :mask-closable="false">
+        <Form :model="formItem" :label-width="80">
+          <FormItem :label="`${$t('message.linkis.instanceName')}`">
+            <Input disabled v-model="formItem.serviceInstance" ></Input>
+          </FormItem>
+          <FormItem class="addTagClass" 
:label="`${$t('message.linkis.tableColumns.label')}:`">
+            <WbTag :tagList="formItem.labelValue" :selectList="keyList" 
@addEnter="addEnter"></WbTag>
+          </FormItem>
+        </Form>
+      </Modal>
+    </div>
+    <ViewLog ref="logPanel" v-show="showviewlog" @back="showviewlog = false" />
+  </div>
+</template>
+<script>
+import api from '@/common/service/api';
+import moment from "moment";
+import Search from './search.vue';
+import WbTag from '@/apps/linkis/components/tag';
+import ViewLog from './log'
+export default {
+  name: 'engineConn',
+  data() {
+    return {
+      showviewlog: false,
+      loading: false,
+      healthyStatusList: [],
+      engineTypes: [],
+      keyList: [],
+      statusList: [],
+      formItem: {
+        serviceInstance: '',
+        labelValue: [],
+        emStatus: '',
+      },
+      tagTitle: [],
+      applicationList: {},
+      addTagForm: { // 新增标签的form表单
+        key: '',
+        value: ''
+      },
+      isShowTable: false,
+      addTagFormRule: { // 验证规则
+        key: [
+          { required: true, message: this.$t('message.linkis.keyTip'), 
trigger: 'blur' }
+        ]
+      },
+      tableData: [],
+      allEngines: [],
+      tableWidth: 0,
+      // 开启标签修改弹框
+      isTagEdit: false,
+      page: {
+        totalSize: 0,
+        sizeOpts: [15, 30, 45],
+        pageSize: 15,
+        pageNow: 1
+      },
+      columns: [
+        {
+          type: 'selection',
+          width: 60,
+          align: 'center'
+        },
+        {
+          title: this.$t('message.linkis.tableColumns.engineInstance'),
+          key: 'serviceInstance',
+          minWidth: 160,
+          className: 'table-project-column',
+          slot: 'serviceInstance'
+        },
+        {
+          title: this.$t('message.linkis.tableColumns.engineType'),
+          key: 'engineType',
+          minWidth: 100,
+          className: 'table-project-column'
+        },
+        {
+          title: this.$t('message.linkis.tableColumns.label'),
+          key: 'labelValue',
+          minWidth: 300,
+          className: 'table-project-column',
+          slot: 'labelValue'
+        },
+        {
+          title: this.$t('message.linkis.tableColumns.usedResources'),
+          key: 'usedResource',
+          className: 'table-project-column',
+          slot: 'usedResource',
+          minWidth: 150,
+        },
+        /* {
+          title: 
this.$t('message.linkis.tableColumns.maximumAvailableResources'),
+          key: 'maxResource',
+          slot: 'maxResource',
+          className: 'table-project-column',
+          minWidth: 150,
+        },
+        {
+          title: 
this.$t('message.linkis.tableColumns.minimumAvailableResources'),
+          key: 'minResource',
+          slot: 'minResource',
+          minWidth: 150,
+          className: 'table-project-column',
+        }, */
+        {
+          title: this.$t('message.linkis.tableColumns.requestApplicationName'),
+          key: 'createUser',
+          className: 'table-project-column',
+          minWidth: 150,
+        },
+        {
+          title: this.$t('message.linkis.tableColumns.startTime'),
+          key: 'usedTime',
+          className: 'table-project-column',
+          slot: 'usedTime',
+          minWidth: 150,
+        },
+        {
+          title: this.$t('message.linkis.tableColumns.control.title'),
+          key: 'action',
+          width: '100',
+          align: 'center',
+          render: (h, params) => {
+            return h('div', [
+              h('Button', {
+                props: {
+                  size: 'small'
+                },
+                style: {
+                  marginRight: '5px'
+                },
+                on: {
+                  click: () => {
+                    this.showviewlog = true
+                    this.$refs.logPanel.getLogs(0, {
+                      applicationName: "linkis-cg-engineconn",
+                      emInstance: params.row.ecmInstance,
+                      instance: params.row.serviceInstance,
+                      ticketId: params.row.ticketId,
+                      logDirSuffix: params.row.logDirSuffix,
+                    })
+                  }
+                }
+              }, this.$t('message.linkis.viewlog')),
+            ]);
+          }
+        }
+      ],
+    }
+  },
+  components: {
+    Search,
+    WbTag,
+    ViewLog
+  },
+  created() {
+    this.initExpandList();
+    // 获取状态信息列表
+    this.getListAllNodeHealthyStatus();
+    this.getSearchStatus();
+    this.getKeyList();
+  },
+  methods: {
+    selctionChange(selection) {
+      this.selection = selection
+    },
+    // 刷新进度条
+    refreshResource() {
+      this.initExpandList();
+    },
+    // 初始化引擎列表
+    async initExpandList() {
+      // 获取引擎数据
+      this.loading = true;
+      try {
+        let url = '/linkisManager/ecinfo/ecrHistoryList?';
+        if (this.page.pageNow) url += `pageNow=${this.page.pageNow}&`
+        if (this.page.pageSize) url += `pageSize=${this.page.pageSize}`
+        let engines = await api.fetch(url, 'get') || {};
+        // 获取使用的引擎资源列表
+        let enginesList = engines.engineList || [];
+        this.page.totalSize = engines.totalPage ? engines.totalPage : 
enginesList.length;
+        this.allEngines = [ ...enginesList ];
+        this.tableData = [ ...enginesList ];
+        let data = await api.fetch('/configuration/engineType', 'get')
+        this.engineTypes = data && data.engineType ? data.engineType : []
+        this.loading = false;
+      } catch (err) {
+        console.log(err)
+        this.loading = false;
+      }
+    },
+    // 获取所有可修改的labelKey
+    getKeyList() {
+      api.fetch('/microservice/modifiableLabelKey', 'get').then((res) => {
+        let list = res.keyList || [];
+        this.keyList = list.map(item => {
+          return {
+            lable: item,
+            value: item
+          }
+        })
+      })
+    },
+    // 获取所有可修改的状态信息
+    async getListAllNodeHealthyStatus() {
+      try {
+        let healthyStatusList = await 
api.fetch('/linkisManager/listAllECMHealthyStatus', { onlyEditable: true }, 
'get') || {};
+        let list = healthyStatusList.nodeStatus || [];
+        this.healthyStatusList = [...list];
+      } catch (err) {
+        console.log(err)
+      }
+    },
+    // 获取搜索的状态列表
+    async getSearchStatus() {
+      try {
+        let statusList = await 
api.fetch('/linkisManager/listAllNodeHealthyStatus', 'get') || {};
+        let list = statusList.nodeStatus || [];
+        this.statusList = [...list];
+      } catch (err) {
+        console.log(err)
+      }
+    },
+    // 添加tag
+    addEnter (key, value) {
+      this.formItem.labelValue.push({ key, value });
+
+    },
+    //  提交修改
+    submitTagEdit() {
+      let param = JSON.parse(JSON.stringify(this.formItem));
+      param.instance = param.serviceInstance
+      delete param.serviceInstance
+      let tempLabelValue = ''
+      param.labelValue.forEach((item, index) => {
+        if (index === 0) {
+          tempLabelValue += item.value
+        } else {
+          tempLabelValue += ',' + item.value
+        }
+      })
+      param.labelValue = tempLabelValue
+      api.fetch('/linkisManager/modifyEngineInfo', param, 'put').then(() => {
+        this.isTagEdit = false;
+        this.$Message.success(this.$t('message.linkis.editedSuccess'));
+        this.refreshResource(); // 刷新
+      }).catch(() => {
+        this.isTagEdit = false;
+      })
+    },
+    // 切换分页
+    change(val) {
+      this.page.pageNow = val;
+      this.$refs.search.search(true);
+    },
+    // 页容量变化
+    changeSize(val) {
+      this.page.pageSize = val;
+      this.page.pageNow = 1;
+      this.$refs.search.search(true);
+    },
+    // 搜索
+    search(e) {
+      let url = '/linkisManager/ecinfo/ecrHistoryList?';
+      if (e.instance) url += `instance=${e.instance}&`
+      if (e.owner) url += `creator=${e.owner}&`
+      if (e.shortcut[0]) url += `startDate=${moment(new 
Date(e.shortcut[0])).format('YYYY-MM-DD HH:mm:ss')}&`
+      if (e.shortcut[1]) {
+        if (moment(new Date(e.shortcut[1])).format('YYYY-MM-DD HH:mm:ss') === 
moment(new Date(e.shortcut[0])).format('YYYY-MM-DD HH:mm:ss')) {
+          // 如果起始时间选的是同一天,则endDate要加到第二天的零点
+          url += `endDate=${moment(new Date(e.shortcut[1]).getTime() + 24 * 60 
* 60 * 1000).format('YYYY-MM-DD HH:mm:ss')}&`
+        } else {
+          url += `endDate=${moment(new Date(e.shortcut[1])).format('YYYY-MM-DD 
HH:mm:ss')}&`
+        }
+      }
+      if (e.engineType) url += `engineType=${e.engineType}&`
+      if (this.page.pageNow) url += `pageNow=${this.page.pageNow}&`
+      if (this.page.pageSize) url += `pageSize=${this.page.pageSize}`
+      api.fetch(url,'get').then((res)=>{
+        this.tableData=res.engineList
+        this.page.totalSize = res.totalPage ? res.totalPage : 
this.page.totalSize;
+      })
+    },
+    // 时间格式转换
+    timeFormat(row) {
+      return moment(new Date(row.usedTime)).format('YYYY-MM-DD HH:mm:ss')
+    },
+    calcCompany(num, isCompany = false) {
+      let data = num > 0 ? num : 0;
+      if(isCompany) {
+        return data / 1024 / 1024 / 1024;
+      }
+      return data;
+    }
+  }
+}
+</script>
+
+<style src="./index.scss" lang="scss" scoped></style>
+
+<style lang="scss">
+.ecm-engine-table {
+  border: 0;
+  height: calc(100% - 110px);
+  overflow: auto;
+
+  .ivu-table:before {
+    height: 0
+  }
+  
+  .ivu-table:after {
+    width: 0
+  }
+
+  .ivu-table {
+    height: auto;
+    border: 1px solid #dcdee2;
+  }
+}
+</style>
diff --git a/web/src/apps/linkis/module/resourceManagement/index.scss 
b/web/src/apps/linkis/module/resourceManagement/index.scss
index 98ac37560..d4506a774 100644
--- a/web/src/apps/linkis/module/resourceManagement/index.scss
+++ b/web/src/apps/linkis/module/resourceManagement/index.scss
@@ -88,3 +88,53 @@ td.table-project-column {
 .label-critical {
   color: $error-color
 }
+
+
+.table-content {
+  // width: 100% !important;
+  margin-top: 15px;
+  .latestVersion {
+    padding:  0 10px;
+    background-color: #169bd5;
+    border-radius: $border-radius-small;
+    overflow: hidden;
+    display: inline-block;
+  }
+}
+td.table-name-column {
+  .workflow-name {
+    color: $primary-color;
+    cursor: pointer;
+  }
+}
+/deep/.table-project-column {
+  text-align: center;
+  .ivu-table-cell {
+    display: inline-block;
+    padding: 0 10px!important;
+  }
+}
+td.table-project-column {
+  color: $success-color;
+}
+.page-bar {
+  text-align: center;
+  padding: 10px 0;
+}
+/deep/.addTagClass {
+  position: relative;
+  z-index: 99;
+}
+.ecm, .ecmEngine {
+  height: 100%;
+  overflow: hidden;
+  /deep/ .ivu-tag {
+    max-width: 140px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  /deep/ .ivu-tooltip-inner {
+    max-width: 100%;
+  }
+}
diff --git a/web/src/apps/linkis/module/resourceManagement/index.vue 
b/web/src/apps/linkis/module/resourceManagement/index.vue
index ba1104849..ea8adfcb2 100644
--- a/web/src/apps/linkis/module/resourceManagement/index.vue
+++ b/web/src/apps/linkis/module/resourceManagement/index.vue
@@ -143,25 +143,25 @@
     <template v-if="isAdminModel">
       <Table class="table-content" border :width="tableWidth" 
:columns="admincolumns" :data="adminTableData">
         <template slot-scope="{row}" slot="usedResource">
-          <span>{{`${calcCompanyAdmin(row, 'usedResource', 
'cores')},${calcCompanyAdmin(row, 'usedResource', 
'memory')},${calcCompanyAdmin(row, 'usedResource', 'instances')}`}}</span>
+          <span>{{`${calcCompanyAdmin(row, 'usedResource', 
'cores')},${calcCompanyAdmin(row, 'usedResource', 
'memory')},${calcCompanyAdmin(row, 'usedResource', 'instance')}`}}</span>
         </template>
         <template slot-scope="{row}" slot="lockedResource">
-          <span>{{`${calcCompanyAdmin(row, 'lockedResource', 
'cores')},${calcCompanyAdmin(row, 'lockedResource', 
'memory')},${calcCompanyAdmin(row, 'lockedResource', 'instances')}`}}</span>
+          <span>{{`${calcCompanyAdmin(row, 'lockedResource', 
'cores')},${calcCompanyAdmin(row, 'lockedResource', 
'memory')},${calcCompanyAdmin(row, 'lockedResource', 'instance')}`}}</span>
         </template>
         <template slot-scope="{row}" slot="maxResource">
-          <span>{{`${calcCompanyAdmin(row, 'maxResource', 
'cores')},${calcCompanyAdmin(row, 'maxResource', 
'memory')},${calcCompanyAdmin(row, 'maxResource', 'instances')}`}}</span>
+          <span>{{`${calcCompanyAdmin(row, 'maxResource', 
'cores')},${calcCompanyAdmin(row, 'maxResource', 
'memory')},${calcCompanyAdmin(row, 'maxResource', 'instance')}`}}</span>
         </template>
         <template slot-scope="{row}" slot="leftResource">
-          <span 
:class="'label-'+row.loadResourceStatus">{{`${calcCompanyAdmin(row, 
'leftResource', 'cores')},${calcCompanyAdmin(row, 'leftResource', 
'memory')},${calcCompanyAdmin(row, 'leftResource', 'instances')}`}}</span>
+          <span 
:class="'label-'+row.loadResourceStatus">{{`${calcCompanyAdmin(row, 
'leftResource', 'cores')},${calcCompanyAdmin(row, 'leftResource', 
'memory')},${calcCompanyAdmin(row, 'leftResource', 'instance')}`}}</span>
         </template>
         <template slot-scope="{row}" slot="yarnUsedResource">
-          <span>{{`${calcCompanyAdmin(row, 'usedResource', 'cores', 
true)},${calcCompanyAdmin(row, 'usedResource', 'memory', 
true)},${calcCompanyAdmin(row, 'usedResource', 'instances', true)}`}}</span>
+          <span>{{`${calcCompanyAdmin(row, 'usedResource', 'cores', 
true)},${calcCompanyAdmin(row, 'usedResource', 'memory', 
true)},${calcCompanyAdmin(row, 'usedResource', 'instance', true)}`}}</span>
         </template>
         <template slot-scope="{row}" slot="yarnMaxResource">
-          <span>{{`${calcCompanyAdmin(row, 'maxResource', 'cores', 
true)},${calcCompanyAdmin(row, 'maxResource', 'memory', 
true)},${calcCompanyAdmin(row, 'maxResource', 'instances', true)}`}}</span>
+          <span>{{`${calcCompanyAdmin(row, 'maxResource', 'cores', 
true)},${calcCompanyAdmin(row, 'maxResource', 'memory', 
true)},${calcCompanyAdmin(row, 'maxResource', 'instance', true)}`}}</span>
         </template>
         <template slot-scope="{row}" slot="yarnLeftResource">
-          <span 
:class="'label-'+row.queueResourceStatus">{{`${calcCompanyAdmin(row, 
'leftResource', 'cores', true)},${calcCompanyAdmin(row, 'leftResource', 
'memory', true)},${calcCompanyAdmin(row, 'leftResource', 'instances', 
true)}`}}</span>
+          <span 
:class="'label-'+row.queueResourceStatus">{{`${calcCompanyAdmin(row, 
'leftResource', 'cores', true)},${calcCompanyAdmin(row, 'leftResource', 
'memory', true)},${calcCompanyAdmin(row, 'leftResource', 'instance', 
true)}`}}</span>
         </template>
       </Table>
       <div class="page-bar">
@@ -538,15 +538,14 @@ export default {
         }
         return data;
       }
-      console.log(resource);
-      return  resource && (resource.cores !== undefined || resource.memonry 
!== undefined || resource.instance !== undefined) ? 
`${calcCompanyToData(resource.cores)}cores,${calcCompanyToData(resource.memory, 
true)}G,${calcCompanyToData(resource.instance)}apps` : ''
+      return resource && (resource.cores !== undefined || resource.memory !== 
undefined || resource.instance !== undefined) ? 
`${calcCompanyToData(resource.cores)}cores,${calcCompanyToData(resource.memory, 
true)}G,${calcCompanyToData(resource.instance)}apps` : ''
     },
     calcCompanyAdmin(row, field, type, yarn) {
       let data = ' -- '
       if (row.resourceType === 'LoadInstance') {
         if (!yarn) {
           data = row[field][type]
-          if (type === 'instances' && data === undefined) {
+          if (type === 'instance' && data === undefined) {
             data = row[field]['instance']
           }
         }
@@ -564,7 +563,7 @@ export default {
       if (data !== ' -- ') {
         if (type === 'memory') {
           data = data + 'G'
-        } else if (type === 'instances') {
+        } else if (type === 'instance') {
           data = data + 'apps'
         } else {
           data = data + 'cores'
diff --git a/web/src/apps/linkis/module/ECM/log.vue 
b/web/src/apps/linkis/module/resourceManagement/log.vue
similarity index 94%
copy from web/src/apps/linkis/module/ECM/log.vue
copy to web/src/apps/linkis/module/resourceManagement/log.vue
index e0be67049..0f0d499c8 100644
--- a/web/src/apps/linkis/module/ECM/log.vue
+++ b/web/src/apps/linkis/module/resourceManagement/log.vue
@@ -16,7 +16,7 @@
   -->
 
 <template>
-  <div style="position:relative">
+  <div class="log" style="position:relative">
     <Tabs @on-click="onClickTabs" :value="tabName">
       <TabPane name="stdout" label="stdout"></TabPane>
       <TabPane name="stderr" label="stderr"></TabPane>
@@ -89,7 +89,9 @@ export default {
           parameters: {
             pageSize: 1000,
             fromLine,
-            logType: this.tabName
+            logType: this.tabName,
+            logDirSuffix: this.param.logDirSuffix,
+            ticketId: this.param.ticketId
           }
         }
         let res = await api.fetch('/linkisManager/openEngineLog', params, 
'post') || {};
@@ -122,6 +124,9 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.log {
+  height: 100%;
+}
  .backButton {
   position: absolute;
   top: -2px;
diff --git a/web/src/apps/linkis/module/ECM/search.vue 
b/web/src/apps/linkis/module/resourceManagement/search.vue
similarity index 51%
copy from web/src/apps/linkis/module/ECM/search.vue
copy to web/src/apps/linkis/module/resourceManagement/search.vue
index 9021f4e74..88852ea76 100644
--- a/web/src/apps/linkis/module/ECM/search.vue
+++ b/web/src/apps/linkis/module/resourceManagement/search.vue
@@ -20,26 +20,25 @@
     <FormItem prop="instance" :label="`${$t('message.linkis.instanceName')}`">
       <Input :maxlength="50" v-model="searchBar.instance" 
:placeholder="$t('message.linkis.instanceName')"/>
     </FormItem>
-    <FormItem prop="nodeHealthy" 
:label="$t('message.linkis.formItems.status.label')">
-      <Select v-model="searchBar.nodeHealthy" style="width:200px" clearable>
-        <Option
-          v-for="(item) in statusList"
-          :label="item"
-          :value="item"
-          :key="item"/>
-      </Select>
-    </FormItem>
     <FormItem prop="owner" :label="$t('message.linkis.initiator')" >
-      <Select  v-model="searchBar.owner" style="width:200px" clearable>
-        <Option
-          v-for="(item) in ownerList"
-          :label="item"
-          :value="item"
-          :key="item"/>
-      </Select>
+      <Input :maxlength="50" v-model="searchBar.owner" style="width:100px" 
clearable :placeholder="$t('message.linkis.inputOwnerHint')"/>
+    </FormItem>
+    <FormItem prop="shortcut" 
:label="$t('message.linkis.formItems.date.label')">
+      <DatePicker
+        :transfer="true"
+        class="datepicker"
+        :options="shortcutOpt"
+        v-model="searchBar.shortcut"
+        type="daterange"
+        placement="bottom-start"
+        format="yyyy-MM-dd"
+        :placeholder="$t('message.linkis.formItems.date.placeholder')"
+        style="width: 190px"
+        :editable="false"
+      />
     </FormItem>
-    <FormItem v-if="engineTypes.length" prop="engineType" 
:label="$t('message.linkis.tableColumns.engineType')" >
-      <Select  v-model="searchBar.engineType" style="width:200px" clearable>
+    <FormItem prop="engineType" 
:label="$t('message.linkis.tableColumns.engineType')" >
+      <Select  v-model="searchBar.engineType" style="width:80px" clearable>
         <Option
           v-for="(item) in engineTypes"
           :label="item"
@@ -48,12 +47,9 @@
       </Select>
     </FormItem>
     <FormItem>
-      <Button type="primary" @click="search">
+      <Button type="primary" @click="search(false)">
         {{ $t('message.linkis.search') }}
       </Button>
-      <Button v-if="stopbtn" type="error" @click="stop"  
style="margin-left:20px">
-        {{ $t('message.linkis.stop') }}
-      </Button>
     </FormItem>
   </Form>
 
@@ -68,25 +64,57 @@ export default {
       type: Array,
       default: () => []
     },
-    ownerList: {
-      type: Array,
-      default: () => []
-    },
     engineTypes: {
       type: Array,
       default: () => []
     },
     stopbtn: {
       type: Boolean
+    },
+    page: {
+      type: Object
     }
   },
   data() {
+    const today = new Date(new Date().toLocaleDateString())
     return {
       ruleInline: {},
       searchBar: {
         instance: "",
-        nodeHealthy: "",
+        engineType: "",
         owner: "",
+        shortcut: [today, today]
+      },
+      shortcutOpt: {
+        shortcuts: [
+          {
+            text: this.$t('message.linkis.shortcuts.week'),
+            value() {
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+              return [start, end]
+            }
+          },
+          {
+            text: this.$t('message.linkis.shortcuts.month'),
+            value() {
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
+              return [start, end]
+            }
+          },
+          {
+            text: this.$t('message.linkis.shortcuts.threeMonths'),
+            value() {
+              const end = new Date()
+              const start = new Date()
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
+              return [start, end]
+            }
+          }
+        ]
       },
     };
   },
@@ -101,7 +129,8 @@ export default {
   activated() {
   },
   methods: {
-    search() {
+    search(isChangingPage) {
+      if (!isChangingPage) this.page.pageNow = 1
       this.$emit("search", this.searchBar)
     },
     stop() {
@@ -115,7 +144,8 @@ export default {
     display: flex;
     .ivu-form-item {
       display: flex;
-      margin-right: 30px;
+      margin-right: 8px;
+      margin-bottom: 8px;
       flex: none;
     }
   }
diff --git a/web/src/apps/linkis/router.js b/web/src/apps/linkis/router.js
index 13b04ccc0..52f4906d2 100644
--- a/web/src/apps/linkis/router.js
+++ b/web/src/apps/linkis/router.js
@@ -65,8 +65,16 @@ export default [
         title: 'resource',
         publicPage: true,
       },
-    },
-    {
+    }, {
+      name: 'resourceEngineConnList',
+      path: 'resourceEngineConnList',
+      component: () =>
+        import('./module/resourceManagement/engineConn.vue'),
+      meta: {
+        title: '历史引擎信息',
+        publicPage: true,
+      },
+    }, {
       name: 'setting',
       path: 'setting',
       component: () =>
diff --git a/web/src/apps/linkis/view/linkis/index.vue 
b/web/src/apps/linkis/view/linkis/index.vue
index cf6a9beec..d8b835784 100644
--- a/web/src/apps/linkis/view/linkis/index.vue
+++ b/web/src/apps/linkis/view/linkis/index.vue
@@ -59,7 +59,7 @@
       <div
         class="content-body-side-right">
         <div class="content-body-side-right-title">
-          <Breadcrumb>
+          <Breadcrumb v-if="$route.name !== 'resource' && $route.name !== 
'resourceEngineConnList'">
             <BreadcrumbItem :to="skipPath"><Icon v-if="skipPath" 
type="ios-arrow-back" size="16" color="#338cf0"></Icon>{{ breadcrumbSecondName 
}}</BreadcrumbItem>
             <BreadcrumbItem v-if="$route.name === 'viewHistory'">{{ 
$route.query.taskID }}</BreadcrumbItem>
             <template v-if="$route.name === 'EngineConnList'">
@@ -67,6 +67,10 @@
               <BreadcrumbItem>EngineConnList</BreadcrumbItem>
             </template>
           </Breadcrumb>
+          <Tabs v-if="$route.name === 'resource' || $route.name === 
'resourceEngineConnList'" value="resource" @on-click="clickResourceTab" 
class="resource-tab">
+            <Tab-pane name="resource" 
:label="$t('message.linkis.sideNavList.function.children.resource')" 
href="/resource"></Tab-pane>
+            <Tab-pane name="resourceEngineConnList" 
:label="$t('message.linkis.sideNavList.function.children.resourceEngineConnList')"
 href="/ecm"></Tab-pane>
+          </Tabs>
         </div>
         <div
           class="content-body-side-right-content">
@@ -169,7 +173,10 @@ export default {
           workspaceId: this.$route.query.workspaceId
         },
       });
-    }
+    },
+    clickResourceTab(value) {
+      this.$router.push(`/console/${value}`)
+    },
   },
   beforeRouteEnter(to, from, next) {
     if (to.name === 'FAQ' && from.name === 'Home') {
@@ -203,4 +210,11 @@ export default {
     color: #338cf0;
   }
 </style>
-
+<style lang="scss">
+.resource-tab {
+  top: -6px;
+  .ivu-tabs-bar {
+    border-bottom: 0;
+  }
+}
+</style>
\ No newline at end of file
diff --git a/web/src/components/consoleComponent/log.vue 
b/web/src/components/consoleComponent/log.vue
index 9608b3011..4c983111f 100644
--- a/web/src/components/consoleComponent/log.vue
+++ b/web/src/components/consoleComponent/log.vue
@@ -199,6 +199,9 @@ export default {
 @import '@/common/style/variables.scss';
   .workbench-log-view {
     height: 100%;
+    .we-editor {
+      height: calc(100% - 36px) !important;
+    }
     .log-tools {
       height: 36px;
       line-height: 36px;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to