Merge branch 'dev-2.0' of https://git.mesalab.cn/nezha/nezha-fronted into dev-2.0
This commit is contained in:
@@ -5,6 +5,7 @@ const cn = {
|
||||
customPicture: '上传图片',
|
||||
endpointTemplate: 'endpoint模板',
|
||||
AddByTemplate: '使用模板创建',
|
||||
exprTemp: '表达式模板',
|
||||
oneHour: '1 小时',
|
||||
twoHour: '2 小时',
|
||||
sixHour: '6 小时',
|
||||
@@ -213,6 +214,7 @@ const cn = {
|
||||
},
|
||||
dashboard: {
|
||||
title: '仪表盘',
|
||||
addChartTemp: '添加图表模板',
|
||||
panel: {
|
||||
title: '面板',
|
||||
searchItem: {
|
||||
@@ -382,7 +384,7 @@ const cn = {
|
||||
moreTitleOther: '仅显示 10 条数据。',
|
||||
showAll: '全部显示 ',
|
||||
showAllOther: '全部数据 ',
|
||||
addChartTemp: 'addChartTemp'
|
||||
addChartTemp: '添加图表'
|
||||
},
|
||||
metric: {
|
||||
name: '指标名称',
|
||||
@@ -1200,6 +1202,16 @@ const cn = {
|
||||
projectInfo: '系统信息',
|
||||
endpointInfo: 'Endpoint信息'
|
||||
},
|
||||
topo: {
|
||||
list: '列表',
|
||||
update: '更新',
|
||||
icon: {
|
||||
list: '列表',
|
||||
delete: '删除',
|
||||
save: '保存',
|
||||
info: '信息',
|
||||
}
|
||||
},
|
||||
project: {
|
||||
project: '名称',
|
||||
projectName: '系统',
|
||||
@@ -1242,6 +1254,7 @@ const cn = {
|
||||
editEndpoint: '修改 Endpoint',
|
||||
endpoint: 'Endpoint',
|
||||
endpointId: 'Endpoint ID',
|
||||
list: '列表',
|
||||
host: '主机',
|
||||
port: '端口',
|
||||
param: '参数',
|
||||
@@ -1550,7 +1563,55 @@ const cn = {
|
||||
add: '新增',
|
||||
edit: '修改',
|
||||
delete: '删除',
|
||||
expire: '过期'
|
||||
expired: '过期',
|
||||
panel: {
|
||||
addChart: '新增图标',
|
||||
editChart: '修改图表',
|
||||
deleteChart: '删除图表'
|
||||
},
|
||||
asset: {
|
||||
view: '查看',
|
||||
connect: '连接'
|
||||
},
|
||||
snmp: {
|
||||
view: '查看',
|
||||
add: '新增',
|
||||
edit: '修改',
|
||||
delete: '删除',
|
||||
mibBrowser: 'MIB浏览器',
|
||||
},
|
||||
credential: {
|
||||
view: '查看',
|
||||
add: '新增',
|
||||
edit: '修改',
|
||||
delete: '删除',
|
||||
},
|
||||
system: {
|
||||
basic: '基础设置',
|
||||
email: 'Email',
|
||||
terminal: '终端',
|
||||
ldap: 'LDAP',
|
||||
apiKey : {
|
||||
add: '新增',
|
||||
edit: '修改',
|
||||
delete: '删除',
|
||||
}
|
||||
},
|
||||
terminalLog: {
|
||||
kill: 'Kill',
|
||||
monitor: '监控'
|
||||
}
|
||||
},
|
||||
system: {
|
||||
notification: {
|
||||
notification: '通知方式'
|
||||
},
|
||||
reset: {
|
||||
reset: '重置'
|
||||
},
|
||||
apikey: {
|
||||
apiKey: 'Api Key',
|
||||
}
|
||||
},
|
||||
...zhLocale
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ const en = {
|
||||
customPicture: 'Custom picture',
|
||||
endpointTemplate: 'Endpoint template',
|
||||
AddByTemplate: 'Add by template',
|
||||
exprTemp: 'Expr temp',
|
||||
oneHour: '1 hour',
|
||||
twoHour: '2 hours',
|
||||
sixHour: '6 hours',
|
||||
@@ -220,6 +221,7 @@ const en = {
|
||||
},
|
||||
dashboard: {
|
||||
title: 'Dashboard',
|
||||
addChartTemp: 'Add chart temp',
|
||||
panel: {
|
||||
title: 'Panel', // '面板'
|
||||
searchItem: {
|
||||
@@ -1210,6 +1212,16 @@ const en = {
|
||||
projectInfo: 'Project information',
|
||||
endpointInfo: 'Endpoint information'
|
||||
},
|
||||
topo: {
|
||||
list: 'List',
|
||||
update: 'Update',
|
||||
icon: {
|
||||
list: 'List',
|
||||
delete: 'Delete',
|
||||
save: 'Save',
|
||||
info: 'Info',
|
||||
}
|
||||
},
|
||||
project: {
|
||||
project: 'Name', // "系统"
|
||||
projectName: 'Project', // "系统名称"
|
||||
@@ -1252,6 +1264,7 @@ const en = {
|
||||
editEndpoint: 'Edit endpoint', // "编辑Endpoint"
|
||||
endpoint: 'Endpoint', // "Endpoint"
|
||||
endpointId: 'Endpoint ID', // "Endpoint ID"
|
||||
list: 'List',
|
||||
host: 'Host', // "Host"
|
||||
port: 'Port', // "端口"
|
||||
param: 'Parameter', // "参数"
|
||||
@@ -1439,7 +1452,55 @@ const en = {
|
||||
add: 'Add',
|
||||
edit: 'Edit',
|
||||
delete: 'Delete',
|
||||
expire: 'Expire'
|
||||
expired: 'Expired',
|
||||
panel: {
|
||||
addChart: 'Add chart',
|
||||
editChart: 'Edit chart',
|
||||
deleteChart: 'Delete chart'
|
||||
},
|
||||
asset: {
|
||||
view: 'View',
|
||||
connect: 'Connect'
|
||||
},
|
||||
snmp: {
|
||||
view: 'View',
|
||||
add: 'Add',
|
||||
edit: 'Edit',
|
||||
delete: 'Delete',
|
||||
mibBrowser: 'Mib browser',
|
||||
},
|
||||
credential: {
|
||||
view: 'View',
|
||||
add: 'Add',
|
||||
edit: 'Edit',
|
||||
delete: 'Delete',
|
||||
},
|
||||
system: {
|
||||
basic: 'Basic',
|
||||
email: 'Email',
|
||||
terminal: 'Terminal',
|
||||
ldap: 'LDAP',
|
||||
apiKey : {
|
||||
add: 'Add',
|
||||
edit: 'Edit',
|
||||
delete: 'Delete',
|
||||
}
|
||||
},
|
||||
terminalLog: {
|
||||
kill: 'Kill',
|
||||
monitor: 'Monitor'
|
||||
}
|
||||
},
|
||||
system: {
|
||||
notification: {
|
||||
notification: 'Notification'
|
||||
},
|
||||
reset: {
|
||||
reset: 'Reset'
|
||||
},
|
||||
apikey: {
|
||||
apiKey: 'Api Key',
|
||||
}
|
||||
},
|
||||
...enLocale
|
||||
}
|
||||
|
||||
@@ -12,52 +12,52 @@
|
||||
@mouseenter="enter(index)" @mouseleave="leave(index)"
|
||||
>
|
||||
<div class="item__title">{{guide.title}}</div>
|
||||
<div class="item__icon" @click="jump(guide.route)"><i :class="guide.icon"></i></div>
|
||||
<div :class="{'item__icon--disabled': !hasButton(guide.permissionCode)}" class="item__icon" @click="jump(guide.route)"><i :class="guide.icon"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="guide-desc">
|
||||
<template v-if="activeIndex === 0">
|
||||
<div class="desc-text">{{$t('guide.dcTip')}}</div>
|
||||
<div class="guide__btn-group">
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('dc_add')}" @click="jumpAndOpen('dc')">{{$t('guide.addDc')}}</button>
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('dc_add')}" @click="jumpAndOpen('cabinet')">{{$t('guide.addCabinet')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('dc_add')}" class="guide__btn" type="button" @click="jumpAndOpen('dc')">{{$t('guide.addDc')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('dc_add')}" class="guide__btn" type="button" @click="jumpAndOpen('cabinet')">{{$t('guide.addCabinet')}}</button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="activeIndex === 1">
|
||||
<div class="desc-text">{{$t('guide.agentTip')}}</div>
|
||||
<div class="guide__btn-group">
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('agent_add')}" @click="jumpAndOpen('agent')">{{$t('guide.addAgent')}}</button>
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('agent_add')}" @click="downloadAgent">{{$t('guide.downloadAgent')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('agent_add')}" class="guide__btn" type="button" @click="jumpAndOpen('agent')">{{$t('guide.addAgent')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('agent_add')}" class="guide__btn" type="button" @click="downloadAgent">{{$t('guide.downloadAgent')}}</button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="activeIndex === 2">
|
||||
<div class="desc-text">{{$t('guide.assetTip')}}</div>
|
||||
<div class="guide__btn-group">
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('asset_add')}" @click="jumpAndOpen('asset')">{{$t('guide.addAsset')}}</button>
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('asset_add')}" @click="jumpAndOpen('importAsset')">{{$t('guide.importAsset')}}</button>
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('asset_add')}" @click="openTerminal">{{$t('guide.webTerminal')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('asset_add')}" class="guide__btn" type="button" @click="jumpAndOpen('asset')">{{$t('guide.addAsset')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('asset_add')}" class="guide__btn" type="button" @click="jumpAndOpen('importAsset')">{{$t('guide.importAsset')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('asset_add')}" class="guide__btn" type="button" @click="openTerminal">{{$t('guide.webTerminal')}}</button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="activeIndex === 3">
|
||||
<div class="desc-text">{{$t('guide.monitorTip')}}</div>
|
||||
<div class="guide__btn-group">
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('project_add')}" @click="jumpAndOpen('project')">{{$t('guide.addProject')}}</button>
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('monitor_module_add')}" @click="jumpAndOpen('module')">{{$t('guide.addModule')}}</button>
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('monitor_endpoint_add')}" @click="jumpAndOpen('endpoint')">{{$t('guide.addEndpoint')}}</button>
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('monitor_endpoint_add')}" @click="jumpAndOpen('importEndpoint')">{{$t('guide.importEndpoint')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('project_add')}" class="guide__btn" type="button" @click="jumpAndOpen('project')">{{$t('guide.addProject')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('monitor_module_add')}" class="guide__btn" type="button" @click="jumpAndOpen('module')">{{$t('guide.addModule')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('monitor_endpoint_add')}" class="guide__btn" type="button" @click="jumpAndOpen('endpoint')">{{$t('guide.addEndpoint')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('monitor_endpoint_add')}" class="guide__btn" type="button" @click="jumpAndOpen('importEndpoint')">{{$t('guide.importEndpoint')}}</button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="activeIndex === 4">
|
||||
<div class="desc-text">{{$t('guide.visualizationTip')}}</div>
|
||||
<div class="guide__btn-group">
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('panel_add')}" @click="jumpAndOpen('panel')">{{$t('guide.addPanel')}}</button>
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('panel_chart_add')}" @click="jumpAndOpen('chart')">{{$t('guide.addChart')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('panel_add')}" class="guide__btn" type="button" @click="jumpAndOpen('panel')">{{$t('guide.addPanel')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('panel_chart_add')}" class="guide__btn" type="button" @click="jumpAndOpen('chart')">{{$t('guide.addChart')}}</button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="activeIndex === 5">
|
||||
<div class="desc-text">{{$t('guide.alertTip')}}</div>
|
||||
<div class="guide__btn-group">
|
||||
<button class="guide__btn" type="button" :class="{'nz-btn-permissions': !hasButton('alertRule_add')}" @click="jumpAndOpen('alertRule')">{{$t('guide.addAlertRule')}}</button>
|
||||
<button :class="{'guide__btn--disabled': !hasButton('alertRule_add')}" class="guide__btn" type="button" @click="jumpAndOpen('alertRule')">{{$t('guide.addAlertRule')}}</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
@@ -83,42 +83,42 @@ export default {
|
||||
title: this.$t('guide.dc'),
|
||||
icon: 'nz-icon nz-icon-datacenter1',
|
||||
tip: this.$t('guide.dcTip'),
|
||||
buttonPermissions: 'dc_add'
|
||||
permissionCode: 'dc_view'
|
||||
},
|
||||
{
|
||||
route: '/agent',
|
||||
title: this.$t('guide.agent'),
|
||||
icon: 'nz-icon nz-icon-agent',
|
||||
tip: this.$t('guide.agentTip'),
|
||||
buttonPermissions: 'agent_add'
|
||||
permissionCode: 'agent_view'
|
||||
},
|
||||
{
|
||||
route: '/asset',
|
||||
title: this.$t('guide.asset'),
|
||||
icon: 'nz-icon nz-icon-menu-assets',
|
||||
tip: this.$t('guide.assetTip'),
|
||||
buttonPermissions: 'asset_add'
|
||||
permissionCode: 'asset_view'
|
||||
},
|
||||
{
|
||||
route: '/monitor/project',
|
||||
title: this.$t('guide.monitor'),
|
||||
icon: 'nz-icon nz-icon-menu-project',
|
||||
tip: this.$t('guide.monitorTip'),
|
||||
buttonPermissions: 'project_add'
|
||||
permissionCode: 'project_view'
|
||||
},
|
||||
{
|
||||
route: '/panel',
|
||||
title: this.$t('guide.visualization'),
|
||||
icon: 'nz-icon nz-icon-visualization',
|
||||
tip: this.$t('guide.visualizationTip'),
|
||||
buttonPermissions: 'panel_add'
|
||||
permissionCode: 'panel_view'
|
||||
},
|
||||
{
|
||||
route: '/alertRule',
|
||||
title: this.$t('guide.alert'),
|
||||
icon: 'nz-icon nz-icon-menu-alert',
|
||||
tip: this.$t('guide.alertTip'),
|
||||
buttonPermissions: "alertRule_add"
|
||||
permissionCode: 'alertRule_view'
|
||||
}
|
||||
],
|
||||
interval: null
|
||||
@@ -157,13 +157,13 @@ export default {
|
||||
this.$store.commit('openConsole')
|
||||
},
|
||||
jump (route) {
|
||||
let buttonPermissions = true
|
||||
let allowed = false
|
||||
this.guideList.forEach(ele => {
|
||||
if (!this.hasButton(ele.buttonPermissions)){
|
||||
buttonPermissions = false
|
||||
if (this.hasButton(ele.permissionCode)) {
|
||||
allowed = true
|
||||
}
|
||||
})
|
||||
if (!buttonPermissions){
|
||||
if (!allowed) {
|
||||
return
|
||||
}
|
||||
this.$emit('close')
|
||||
@@ -407,6 +407,9 @@ export default {
|
||||
color: #ABABAB;
|
||||
}
|
||||
}
|
||||
.item__icon.item__icon--disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
.item__title {
|
||||
padding-top: 20px;
|
||||
@@ -483,9 +486,8 @@ export default {
|
||||
.guide__btn:hover {
|
||||
opacity: .9;
|
||||
}
|
||||
.nz-btn-permissions {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
.guide__btn.guide__btn--disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,12 +106,12 @@ export default {
|
||||
prop: 'id',
|
||||
show: true,
|
||||
width: 80,
|
||||
sortable:'custom'
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('overall.name'),
|
||||
prop: 'name',
|
||||
show: true,
|
||||
sortable:'custom'
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('config.mib.fileName'),
|
||||
prop: 'fileName',
|
||||
@@ -127,11 +127,11 @@ export default {
|
||||
}, {
|
||||
label: this.$t('config.mib.updateUser'),
|
||||
prop: 'updateUser',
|
||||
show: true
|
||||
show: false
|
||||
}, {
|
||||
label: this.$t('config.mib.updateAt'),
|
||||
prop: 'updateAt',
|
||||
show: true
|
||||
show: false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user