From 4a8d9f1920bdbf93dd6b685a4ca0fc6bb91c8ec2 Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Mon, 2 Mar 2020 17:44:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD=20web?= =?UTF-8?q?shell=E6=A8=A1=E5=9D=97=EF=BC=88=E4=BB=A5=E4=B8=8B=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=9C=89=E5=BE=85=E8=AE=A4=E7=9C=9F=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=EF=BC=8C=E6=AD=A4=E6=AC=A1=E6=8F=90=E4=BA=A4=E4=B8=BA=E6=96=B9?= =?UTF-8?q?=E4=BE=BF=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95?= =?UTF-8?q?=EF=BC=89=201.=E7=95=8C=E9=9D=A2=E5=B8=83=E5=B1=80=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=AE=8C=E6=88=90=202.=E5=A4=9Atab=E9=A1=B5=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E5=A4=9Axshell=E8=BF=9E=E6=8E=A5=EF=BC=88=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E9=97=AE=E9=A2=98=E6=9C=89=E5=BE=85=E8=B0=83=E6=95=B4?= =?UTF-8?q?=EF=BC=89=203.=E5=85=B3=E9=97=AD=E5=8A=9F=E8=83=BD=EF=BC=88?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=89=80=E6=9C=89=E8=BF=9E=E6=8E=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/cli/console.vue | 116 +++++++++ nezha-fronted/src/components/cli/webSSH.scss | 62 +++++ nezha-fronted/src/components/cli/webSSH.vue | 230 ++++++++++++++++++ .../src/components/page/asset/asset.vue | 17 +- 4 files changed, 423 insertions(+), 2 deletions(-) create mode 100644 nezha-fronted/src/components/cli/console.vue create mode 100644 nezha-fronted/src/components/cli/webSSH.scss create mode 100644 nezha-fronted/src/components/cli/webSSH.vue diff --git a/nezha-fronted/src/components/cli/console.vue b/nezha-fronted/src/components/cli/console.vue new file mode 100644 index 000000000..1304005b0 --- /dev/null +++ b/nezha-fronted/src/components/cli/console.vue @@ -0,0 +1,116 @@ + + + diff --git a/nezha-fronted/src/components/cli/webSSH.scss b/nezha-fronted/src/components/cli/webSSH.scss new file mode 100644 index 000000000..2578831d4 --- /dev/null +++ b/nezha-fronted/src/components/cli/webSSH.scss @@ -0,0 +1,62 @@ + +.console-dialog { + .menu { + + } + .console{ + + } + + .console-title-icon{ + font-size:18px; + color: #909399; + position: absolute; + top:9px; + } + .console-title-icon:hover:before{ + color: #1989fa; + } + + .el-dialog { + .el-dialog__body{ + padding: 0px !important; + } + .el-dialog__header{ + padding: 0px !important; + } + } + .el-tabs--border-card>.el-tabs__content { + padding: 0px !important; + } + + .el-tabs { + /*background-color: #F5F7FA;*/ + } + + .el-tabs .el-tabs__header { + margin-left:90px; + margin-right:150px; + } + + .el-menu--horizontal>.el-submenu .el-submenu__title { + height: 40px; + line-height: 40px; + } + + .el-menu.el-menu--horizontal .el-submenu__title i:first-child:before{ + color: #909399; + font-size:22px; + } + .el-menu.el-menu--horizontal .el-submenu__title i:first-child:hover:before{ + color: #1989fa; + } + + .el-submenu__title:hover{ + background-color:#FFF !important; + } + + +} +.dailog-custom{ + width:100%; +} diff --git a/nezha-fronted/src/components/cli/webSSH.vue b/nezha-fronted/src/components/cli/webSSH.vue new file mode 100644 index 000000000..2afad366c --- /dev/null +++ b/nezha-fronted/src/components/cli/webSSH.vue @@ -0,0 +1,230 @@ + + + + + diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 66ba498fc..d94f618f6 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -164,7 +164,7 @@ class="el-icon-delete">       - @@ -195,6 +195,7 @@ ref="elementset" > + @@ -202,11 +203,14 @@ import bus from "../../../libs/bus"; import exportXLSX from "../../common/exportXLSX"; import endpointStatusPop from "./endpointStatusPop"; + import webSSH from "../../cli/webSSH"; + export default { name: "asset", components:{ 'export-excel':exportXLSX, - 'endpoint-status-pop':endpointStatusPop + 'endpoint-status-pop':endpointStatusPop, + 'web-ssh':webSSH, }, data() { return { @@ -498,6 +502,15 @@ }); window.open(routeData.href); }, + cli(id,host,accounts){ + let port = ''; + let accountId = ''; + if(accounts && accounts.length>0 && accounts[0].port){ + port = accounts[0].port; + accountId = accounts[0].id; + } + this.$refs.webSsh.show(id,host,accountId,port); + }, jumpToAlertMsg(assetId) { this.$store.commit('assetForAlertListChange', assetId); bus.$emit("menu-change", 'alertList');