NEZ-2446 feat:web terminal 样式调整
This commit is contained in:
@@ -72,6 +72,9 @@
|
|||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.el-input--suffix .el-input__inner{
|
||||||
|
padding-right: 106px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.file-directory-content{
|
.file-directory-content{
|
||||||
height: calc(100% - 60px);
|
height: calc(100% - 60px);
|
||||||
@@ -100,6 +103,14 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
.nz-icon-link{
|
||||||
|
position: absolute;
|
||||||
|
font-size: 10px;
|
||||||
|
left: 7px;
|
||||||
|
bottom: -5px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.file-size{
|
.file-size{
|
||||||
width: 15%;
|
width: 15%;
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ export default {
|
|||||||
closeSocket () {
|
closeSocket () {
|
||||||
if (this.terminalSocket) {
|
if (this.terminalSocket) {
|
||||||
this.terminalSocket.close()
|
this.terminalSocket.close()
|
||||||
|
this.terminalSocket = ''
|
||||||
}
|
}
|
||||||
if (this.term) {
|
if (this.term) {
|
||||||
this.term.destroy()
|
this.term.destroy()
|
||||||
@@ -305,10 +306,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
enterStr (message) {
|
enterStr (message) {
|
||||||
this.terminalSocket.send(message)
|
if (this.terminalSocket && this.terminal.isLogin) {
|
||||||
setTimeout(()=>{
|
this.terminalSocket.send(message)
|
||||||
this.terminalSocket.send('\n')
|
setTimeout(()=>{
|
||||||
}, 100)
|
this.terminalSocket.send('\n')
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
@@ -15,8 +15,12 @@
|
|||||||
</span>
|
</span>
|
||||||
<i class="nz-icon nz-icon-edit" @click="showEditPath"/>
|
<i class="nz-icon nz-icon-edit" @click="showEditPath"/>
|
||||||
</span>
|
</span>
|
||||||
<span v-show="editPathShow">
|
<span v-show="editPathShow" style="display: inline-block;flex: 1;padding-right: 40px">
|
||||||
<el-input v-model="editPath" size="small" @keyup.enter.native="goEditPath"/>
|
<el-input v-model="editPath" size="mini" @keyup.enter.native="goEditPath">
|
||||||
|
<span slot="suffix">
|
||||||
|
{{$t('terminal.confirm')}}
|
||||||
|
</span>
|
||||||
|
</el-input>
|
||||||
</span>
|
</span>
|
||||||
<div class="path-option">
|
<div class="path-option">
|
||||||
<span style="margin-right: 5px">Show hide File: </span>
|
<span style="margin-right: 5px">Show hide File: </span>
|
||||||
@@ -29,7 +33,19 @@
|
|||||||
<div style="padding: 0 20px;height: calc(100% - 50px)" v-my-loading="fileDirectoryLoading">
|
<div style="padding: 0 20px;height: calc(100% - 50px)" v-my-loading="fileDirectoryLoading">
|
||||||
<div class="directory-content-header">
|
<div class="directory-content-header">
|
||||||
<div class="text-ellipsis file-name">
|
<div class="text-ellipsis file-name">
|
||||||
{{$t('overall.name')}}
|
<div class="file-arrow-header" >
|
||||||
|
<div>
|
||||||
|
{{$t('overall.name')}}
|
||||||
|
</div>
|
||||||
|
<div class="nz-arrow-box">
|
||||||
|
<div class="nz-arrow-up" :class="{
|
||||||
|
'is-select': nameOrderType === 'asc'
|
||||||
|
}" @click="orderBy('nameOrderType','asc' , 'size')"></div>
|
||||||
|
<div class="nz-arrow-down" :class="{
|
||||||
|
'is-select': nameOrderType === 'desc'
|
||||||
|
}" @click="orderBy('nameOrderType','desc', 'size')"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-ellipsis file-size">
|
<div class="text-ellipsis file-size">
|
||||||
<div class="file-arrow-header" >
|
<div class="file-arrow-header" >
|
||||||
@@ -66,16 +82,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-directory-content">
|
<div class="file-directory-content">
|
||||||
<div v-if="fileDirectory !== '/'" @click="backFileDirectory" class="file-item">
|
<div v-if="fileDirectory !== '/'" @dblclick.prevent="backFileDirectory" class="file-item">
|
||||||
<div class="text-ellipsis file-name">
|
<div class="text-ellipsis file-name">
|
||||||
<i class="nz-icon nz-icon-a-upperlevel" style="margin-right: 10px"/>
|
<i class="nz-icon nz-icon-Folder colorFA901C" style="margin-right: 3px"/>
|
||||||
{{$t('terminal.back')}}
|
<i class="nz-icon nz-icon-more1"/>
|
||||||
|
<!-- {{$t('terminal.back')}}-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(item,index) in fileList" :key="index" class="file-item" @click="selectFile(item)">
|
<div v-for="(item,index) in fileList" :key="index" class="file-item" onselectstart="return false;" style="-moz-user-select:none;" @dblclick.prevent="selectFile(item)">
|
||||||
<div class="text-ellipsis file-name">
|
<div class="text-ellipsis file-name">
|
||||||
<i class="nz-icon" :class="selIcon(item)"/>
|
<i class="nz-icon" :class="selIcon(item)"/>
|
||||||
{{item.name}}
|
<i class="nz-icon nz-icon-link" v-if="item.isLink"/>
|
||||||
|
{{item.name}} <span v-if="item.isLink">-> {{item.linkName}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-ellipsis file-size">
|
<div class="text-ellipsis file-size">
|
||||||
<span v-if="!item.isDir">{{bytes(item.size, 0, 0)}}</span>
|
<span v-if="!item.isDir">{{bytes(item.size, 0, 0)}}</span>
|
||||||
@@ -243,6 +261,7 @@ export default {
|
|||||||
fileDirectory: '/',
|
fileDirectory: '/',
|
||||||
sizeOrderType: 0,
|
sizeOrderType: 0,
|
||||||
dateOrderType: 0,
|
dateOrderType: 0,
|
||||||
|
nameOrderType: 0,
|
||||||
breadcrumb: [],
|
breadcrumb: [],
|
||||||
fileList: [],
|
fileList: [],
|
||||||
oldFileList: [],
|
oldFileList: [],
|
||||||
@@ -326,6 +345,7 @@ export default {
|
|||||||
const path = this.fileDirectory == '/' ? '' : this.fileDirectory
|
const path = this.fileDirectory == '/' ? '' : this.fileDirectory
|
||||||
this.getSftpPath(path + '/' + item.name)
|
this.getSftpPath(path + '/' + item.name)
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
},
|
},
|
||||||
showFileInfo (item) {
|
showFileInfo (item) {
|
||||||
this.fileInfo = item
|
this.fileInfo = item
|
||||||
@@ -352,6 +372,7 @@ export default {
|
|||||||
arr.pop()
|
arr.pop()
|
||||||
const path = arr.join('/')
|
const path = arr.join('/')
|
||||||
this.getSftpPath(path || '/')
|
this.getSftpPath(path || '/')
|
||||||
|
return false
|
||||||
},
|
},
|
||||||
gotoPath (item, index) {
|
gotoPath (item, index) {
|
||||||
const path = '/' + this.breadcrumb.slice(0, index + 1).join('/')
|
const path = '/' + this.breadcrumb.slice(0, index + 1).join('/')
|
||||||
@@ -455,6 +476,15 @@ export default {
|
|||||||
if (item.isReg) {
|
if (item.isReg) {
|
||||||
return 'nz-icon-File'
|
return 'nz-icon-File'
|
||||||
}
|
}
|
||||||
|
if (item.isFifo) {
|
||||||
|
return 'nz-icon-guandaowenjian'
|
||||||
|
}
|
||||||
|
if (item.isSock) {
|
||||||
|
return 'nz-icon-taojieziwenjian'
|
||||||
|
}
|
||||||
|
if (item.isBlk) {
|
||||||
|
return 'nz-icon-kuaishebeiwenjian'
|
||||||
|
}
|
||||||
return 'nz-icon-File'
|
return 'nz-icon-File'
|
||||||
},
|
},
|
||||||
selInfo (item, key) {
|
selInfo (item, key) {
|
||||||
@@ -491,10 +521,10 @@ export default {
|
|||||||
return this.momentTz(item.uts * 1000)
|
return this.momentTz(item.uts * 1000)
|
||||||
}
|
}
|
||||||
if (key === 'Owner') {
|
if (key === 'Owner') {
|
||||||
return 'Owner'
|
return item.uid
|
||||||
}
|
}
|
||||||
if (key === 'group') {
|
if (key === 'group') {
|
||||||
return 'group'
|
return item.gid
|
||||||
}
|
}
|
||||||
if (key === 'permissionsString') {
|
if (key === 'permissionsString') {
|
||||||
return item.permissionsString
|
return item.permissionsString
|
||||||
@@ -505,6 +535,9 @@ export default {
|
|||||||
if (this[key] == orderType) {
|
if (this[key] == orderType) {
|
||||||
this[key] = 0
|
this[key] = 0
|
||||||
this.fileList = this.oldFileList
|
this.fileList = this.oldFileList
|
||||||
|
} else if (orderType == 'nameOrderType') {
|
||||||
|
this[key] = orderType
|
||||||
|
this.fileList = this.$loadsh.orderBy(this.oldFileList, [user => user.name.toLowerCase()], [orderType])
|
||||||
} else {
|
} else {
|
||||||
this[key] = orderType
|
this[key] = orderType
|
||||||
this.fileList = this.$loadsh.orderBy(this.oldFileList, order, orderType)
|
this.fileList = this.$loadsh.orderBy(this.oldFileList, order, orderType)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
<el-popover
|
<el-popover
|
||||||
slot="label"
|
slot="label"
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
|
:ref="'popover' + index"
|
||||||
width="180"
|
width="180"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
:popper-class="'popover-webshell popover-webshell-new'"
|
:popper-class="'popover-webshell popover-webshell-new'"
|
||||||
@@ -572,6 +573,7 @@ export default {
|
|||||||
name: newTabName,
|
name: newTabName,
|
||||||
circleColor: 1, // 1 grey,2 green, 3 red
|
circleColor: 1, // 1 grey,2 green, 3 red
|
||||||
uuid: uuid,
|
uuid: uuid,
|
||||||
|
showTooltip: false,
|
||||||
terminal: {
|
terminal: {
|
||||||
name: newTabName,
|
name: newTabName,
|
||||||
cols: 225,
|
cols: 225,
|
||||||
@@ -619,6 +621,10 @@ export default {
|
|||||||
if (item.terminal.assetId) {
|
if (item.terminal.assetId) {
|
||||||
const newTabName = ++this.tabIndex + ''
|
const newTabName = ++this.tabIndex + ''
|
||||||
this.editableTabsValue = newTabName
|
this.editableTabsValue = newTabName
|
||||||
|
const console = JSON.parse(JSON.stringify(item))
|
||||||
|
console.name = newTabName
|
||||||
|
console.terminal.name = newTabName
|
||||||
|
console.terminal.isLogin = false
|
||||||
this.editableTabs.push(console)
|
this.editableTabs.push(console)
|
||||||
} else {
|
} else {
|
||||||
this.customConnect = {
|
this.customConnect = {
|
||||||
@@ -628,6 +634,9 @@ export default {
|
|||||||
}
|
}
|
||||||
this.customShow = true
|
this.customShow = true
|
||||||
}
|
}
|
||||||
|
if (this.$refs['popover' + index] && this.$refs['popover' + index][0]) {
|
||||||
|
this.$refs['popover' + index][0].doClose()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
debounce (operate, delay) {
|
debounce (operate, delay) {
|
||||||
let time = null
|
let time = null
|
||||||
@@ -653,12 +662,21 @@ export default {
|
|||||||
},
|
},
|
||||||
reconnect (item, index) {
|
reconnect (item, index) {
|
||||||
this.$refs['console' + index][0].reconnect()
|
this.$refs['console' + index][0].reconnect()
|
||||||
|
if (this.$refs['popover' + index] && this.$refs['popover' + index][0]) {
|
||||||
|
this.$refs['popover' + index][0].doClose()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
showFileDir (item, index) {
|
showFileDir (item, index) {
|
||||||
this.$refs['console' + index][0].showFileDir(true)
|
this.$refs['console' + index][0].showFileDir(true)
|
||||||
|
if (this.$refs['popover' + index] && this.$refs['popover' + index][0]) {
|
||||||
|
this.$refs['popover' + index][0].doClose()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
closeShell (item, index) {
|
closeShell (item, index) {
|
||||||
this.removeTab(item.name)
|
this.removeTab(item.name)
|
||||||
|
if (this.$refs['popover' + index] && this.$refs['popover' + index][0]) {
|
||||||
|
this.$refs['popover' + index][0].doClose()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
sendMessage (message) {
|
sendMessage (message) {
|
||||||
this.editableTabs.forEach((item, index) => {
|
this.editableTabs.forEach((item, index) => {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import VueResource from 'vue-resource'
|
|||||||
import bus from '@/libs/bus'
|
import bus from '@/libs/bus'
|
||||||
Vue.use(VueResource)
|
Vue.use(VueResource)
|
||||||
|
|
||||||
const loginWhiteList = ['/setup', '/sys/license/upload', '/sys/license/state', '/sys/appearance', '/i18n', '/externalTerminal'] // 免登陆白名单
|
const loginWhiteList = ['/setup', '/sys/license/upload', '/sys/license/state', '/sys/appearance', '/i18n', '/terminal'] // 免登陆白名单
|
||||||
const permissionWhiteList = ['/profile', '/menu', ...loginWhiteList] // 权限白名单
|
const permissionWhiteList = ['/profile', '/menu', ...loginWhiteList] // 权限白名单
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (window.entrance) {
|
if (window.entrance) {
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export default new Router({
|
|||||||
component: resolve => require(['@/components/page/config/monitor'], resolve)
|
component: resolve => require(['@/components/page/config/monitor'], resolve)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/terminal',
|
path: '/terminalSetting',
|
||||||
component: resolve => require(['@/components/page/config/terminal'], resolve)
|
component: resolve => require(['@/components/page/config/terminal'], resolve)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -223,7 +223,7 @@ export default new Router({
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/externalTerminal',
|
path: '/terminal',
|
||||||
component: resolve => require(['@/components/cli/terminal'], resolve),
|
component: resolve => require(['@/components/cli/terminal'], resolve),
|
||||||
meta: {
|
meta: {
|
||||||
hideHeader: true,
|
hideHeader: true,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const terminalFile = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (state.externalTerminal) {
|
if (state.externalTerminal) {
|
||||||
state.externalTerminalWindow = window.open('/ui/externalTerminal', 'terminal')
|
state.externalTerminalWindow = window.open('/ui/terminal', 'terminal')
|
||||||
} else {
|
} else {
|
||||||
state.externalTerminalWindow = ''
|
state.externalTerminalWindow = ''
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ const terminalFile = {
|
|||||||
if (state.externalTerminalWindow) {
|
if (state.externalTerminalWindow) {
|
||||||
window.open('', 'terminal')
|
window.open('', 'terminal')
|
||||||
} else {
|
} else {
|
||||||
state.externalTerminalWindow = window.open('/ui/externalTerminal', 'terminal')
|
state.externalTerminalWindow = window.open('/ui/terminal', 'terminal')
|
||||||
}
|
}
|
||||||
if (item) {
|
if (item) {
|
||||||
state.externalTerminalWindow.postMessage(
|
state.externalTerminalWindow.postMessage(
|
||||||
|
|||||||
Reference in New Issue
Block a user