Merge branch 'dev-2.0' of https://git.mesalab.cn/nezha/nezha-fronted into dev-2.0
This commit is contained in:
@@ -362,7 +362,7 @@ li{
|
|||||||
.nz-btn-disabled {
|
.nz-btn-disabled {
|
||||||
background-image: none;
|
background-image: none;
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
cursor: default;
|
cursor: default !important;
|
||||||
}
|
}
|
||||||
.nz-btn-group {
|
.nz-btn-group {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
|||||||
@@ -1121,7 +1121,7 @@ const cn = {
|
|||||||
create: '创建告警静默',
|
create: '创建告警静默',
|
||||||
edit: '修改告警静默',
|
edit: '修改告警静默',
|
||||||
time: '时间',
|
time: '时间',
|
||||||
matchers: 'matchers',
|
matchers: '规则',
|
||||||
remark: '描述',
|
remark: '描述',
|
||||||
selectTime: '请选择时间',
|
selectTime: '请选择时间',
|
||||||
selectMather: '必填项',
|
selectMather: '必填项',
|
||||||
@@ -1148,7 +1148,7 @@ const cn = {
|
|||||||
endpointInfo: 'Endpoint信息'
|
endpointInfo: 'Endpoint信息'
|
||||||
},
|
},
|
||||||
project: {
|
project: {
|
||||||
project: '系统',
|
project: '名称',
|
||||||
projectName: '系统名称',
|
projectName: '系统名称',
|
||||||
editProject: '编辑系统',
|
editProject: '编辑系统',
|
||||||
description: '描述',
|
description: '描述',
|
||||||
@@ -1175,7 +1175,7 @@ const cn = {
|
|||||||
authProtocol: '认证协议',
|
authProtocol: '认证协议',
|
||||||
privProtocol: '隐私协议',
|
privProtocol: '隐私协议',
|
||||||
contextName: '内容名称',
|
contextName: '内容名称',
|
||||||
alerts: 'Alerts',
|
alerts: '告警',
|
||||||
privpin: '隐私密码',
|
privpin: '隐私密码',
|
||||||
asset: 'Asset',
|
asset: 'Asset',
|
||||||
editEndpoint: '编辑 Endpoint',
|
editEndpoint: '编辑 Endpoint',
|
||||||
|
|||||||
@@ -1143,7 +1143,7 @@ const en = {
|
|||||||
create: 'New alert silence',
|
create: 'New alert silence',
|
||||||
edit: 'Edit alert silence',
|
edit: 'Edit alert silence',
|
||||||
time: 'Time',
|
time: 'Time',
|
||||||
matchers: 'matchers',
|
matchers: 'Matchers',
|
||||||
remark: 'Description',
|
remark: 'Description',
|
||||||
selectTime: 'Please select time',
|
selectTime: 'Please select time',
|
||||||
selectMather: 'Required',
|
selectMather: 'Required',
|
||||||
@@ -1194,7 +1194,7 @@ const en = {
|
|||||||
privProtocol: 'Priv protocol',
|
privProtocol: 'Priv protocol',
|
||||||
contextName: 'Context name',
|
contextName: 'Context name',
|
||||||
privpin: 'Priv password',
|
privpin: 'Priv password',
|
||||||
alerts: 'Alerts',
|
alerts: 'Alert',
|
||||||
asset: 'Asset',
|
asset: 'Asset',
|
||||||
editEndpoint: 'Edit endpoint',
|
editEndpoint: 'Edit endpoint',
|
||||||
createEndpoint: 'New endpoint',
|
createEndpoint: 'New endpoint',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login" @click="langListShow = false">
|
<div class="login" @click="langListShow = false">
|
||||||
<div class="model"></div>
|
<div class="model"></div>
|
||||||
<div class="logo"><img height="155" src="../../assets/img/logo-big.png"></div>
|
<div class="logo"><img src="../../assets/img/logo-big.png"></div>
|
||||||
<div class='login-box'>
|
<div class='login-box'>
|
||||||
<div class="login-label"></div>
|
<div class="login-label"></div>
|
||||||
<div class="login-input">
|
<div class="login-input">
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<input v-model="loginData.pin" type="password" name="password" autocomplete="on" :placeholder="$t('login.pin')"></input>
|
<input v-model="loginData.pin" type="password" name="password" autocomplete="on" :placeholder="$t('login.pin')"></input>
|
||||||
</div>
|
</div>
|
||||||
<div class="login-foot">
|
<div class="login-foot">
|
||||||
<button @click="login" class="login-btn" id="login" v-loading="loading" :class="{'nz-btn-disabled btn-disabled-cursor-not-allowed':!license.valid}">{{$t("login.login")}}</button>
|
<button id="login" v-loading="loading" :class="{'nz-btn-disabled': !license.valid}" class="login-btn" @click="login">{{$t("login.login")}}</button>
|
||||||
<div class="login-foot-lang" @click.stop="langListShow = !langListShow">
|
<div class="login-foot-lang" @click.stop="langListShow = !langListShow">
|
||||||
<i v-if="lang == 'en'" class="nz-icon nz-icon-lang-en"></i>
|
<i v-if="lang == 'en'" class="nz-icon nz-icon-lang-en"></i>
|
||||||
<i v-else-if="lang == 'cn'" class="nz-icon nz-icon-lang-zh"></i>
|
<i v-else-if="lang == 'cn'" class="nz-icon nz-icon-lang-zh"></i>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="login-license">
|
<div class="login-license">
|
||||||
<div class="license-warn" v-if="license.warnInfo">{{license.warnInfo}}</div>
|
<div class="license-warn" v-if="license.warnInfo">{{license.warnInfo}}</div>
|
||||||
<div class="license-info" v-if="!license.valid">INSTALLATION ID:{{license.token}}</div>
|
<div v-if="!license.valid" class="license-info">INSTALLATION ID: {{license.token}}</div>
|
||||||
<div class="license-upload" v-if="!license.valid">
|
<div class="license-upload" v-if="!license.valid">
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="upload"
|
ref="upload"
|
||||||
@@ -50,7 +50,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions } from 'vuex'
|
import { mapActions } from 'vuex'
|
||||||
import moment from 'moment-timezone'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'login',
|
name: 'login',
|
||||||
data () {
|
data () {
|
||||||
@@ -75,7 +74,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
...mapActions(['loginSuccess']),
|
...mapActions(['loginSuccess']),
|
||||||
login () {
|
login () {
|
||||||
if (this.loading) {
|
if (this.loading || !this.license.valid) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// if (this.license.valid && this.validateLogin() && (this.$route.path == '/' || this.$route.path == '/login')) {
|
// if (this.license.valid && this.validateLogin() && (this.$route.path == '/' || this.$route.path == '/login')) {
|
||||||
@@ -112,9 +111,12 @@ export default {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
licenseStat: function () {
|
licenseStat () {
|
||||||
|
/*this.license.valid = false
|
||||||
|
this.license.warnInfo = 'hehehe'
|
||||||
|
this.license.token = 'dRqrWja/PzI8FrWVJeGqLw=='*/
|
||||||
this.$get('/sys/license/state').then(response => {
|
this.$get('/sys/license/state').then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code && response.code === 200) {
|
||||||
this.license.warnInfo = ''
|
this.license.warnInfo = ''
|
||||||
this.license.valid = true
|
this.license.valid = true
|
||||||
} else {
|
} else {
|
||||||
@@ -124,7 +126,7 @@ export default {
|
|||||||
this.license.token = response.token
|
this.license.token = response.token
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleChange: function (file, fileList) {
|
handleChange (file, fileList) {
|
||||||
if (fileList.length > 0) {
|
if (fileList.length > 0) {
|
||||||
this.uploadFileList = [fileList[fileList.length - 1]]
|
this.uploadFileList = [fileList[fileList.length - 1]]
|
||||||
}
|
}
|
||||||
@@ -144,7 +146,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
/* 'loginData.username': function(n, o) {
|
/* 'loginData.username'(n, o) {
|
||||||
let lang = localStorage.getItem('nz-language-' + n);
|
let lang = localStorage.getItem('nz-language-' + n);
|
||||||
if (lang) {
|
if (lang) {
|
||||||
this.lang = lang;
|
this.lang = lang;
|
||||||
@@ -168,9 +170,13 @@ export default {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.login {
|
.login {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
background-image: url("../../assets/img/login-background.png");
|
background-image: url("../../assets/img/login-background.png");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
position: relative;
|
|
||||||
}
|
}
|
||||||
.model {
|
.model {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -183,24 +189,20 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
position: absolute;
|
|
||||||
top: 25%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
width: 460px;
|
||||||
|
img{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-box {
|
.login-box {
|
||||||
width: 460px;
|
|
||||||
position: absolute;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
top: 50%;
|
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
width: 460px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-box .login-input {
|
.login-box .login-input {
|
||||||
padding: 20px 0;
|
padding: 12px 0;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@@ -233,15 +235,18 @@ export default {
|
|||||||
|
|
||||||
.login-btn {
|
.login-btn {
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 3px;
|
border-radius: $--button-border-radius;
|
||||||
background-image: $btn-normal-background-color;
|
background-color: var(--theme-color-light-20);
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
width: 320px;
|
width: 320px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
box-shadow: 0 2px 3px 2px rgba(0, 0, 0, 0.30);
|
transition: all linear .2s;
|
||||||
|
}
|
||||||
|
.login-btn:not(.nz-btn-disabled):hover {
|
||||||
|
background-color: var(--theme-color-light-30);
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-foot-lang {
|
.login-foot-lang {
|
||||||
@@ -288,7 +293,8 @@ export default {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 20px;
|
bottom: 20px;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
left: calc(50% - 90px);
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
a{
|
a{
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #eee;
|
color: #eee;
|
||||||
@@ -309,23 +315,21 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
.license-warn{
|
.license-warn{
|
||||||
color: #EF7458;
|
color: #d92926;
|
||||||
|
text-shadow: 1px 1px 3px #ddd;
|
||||||
}
|
}
|
||||||
.license-info{
|
.license-info {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: white;
|
||||||
|
text-shadow: 1px 1px 3px #333;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.login-btn{
|
.login-btn{
|
||||||
height: 30px;
|
height: 40px;
|
||||||
width: 120px;
|
width: auto;
|
||||||
|
padding: 0 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.login-btn.nz-btn-disabled{
|
|
||||||
background-image: none;
|
|
||||||
color: #e5e5e5;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-color: #e5e5e5 ;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.license-upload .el-upload-list{
|
.license-upload .el-upload-list{
|
||||||
|
|||||||
@@ -234,9 +234,12 @@ export default {
|
|||||||
if (pageSize && pageSize !== 'undefined') {
|
if (pageSize && pageSize !== 'undefined') {
|
||||||
this.pageObj.pageSize = pageSize
|
this.pageObj.pageSize = pageSize
|
||||||
}
|
}
|
||||||
this.tools.customTableTitle = localStorage.getItem('nz-tableTitle-' + localStorage.getItem('nz-username') + '-' + this.tableId)
|
let localStorageTableTitle = localStorage.getItem('nz-tableTitle-' + localStorage.getItem('nz-username') + '-' + this.tableId)
|
||||||
? JSON.parse(localStorage.getItem('nz-tableTitle-' + localStorage.getItem('nz-username') + '-' + this.tableId))
|
localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : this.$refs.dataTable.tableTitle
|
||||||
: this.$refs.dataTable.tableTitle
|
this.tools.customTableTitle = localStorageTableTitle.map((item, index) => { // 修复切换中英文的问题
|
||||||
|
item.label = this.$refs.dataTable.tableTitle[index].label
|
||||||
|
return item
|
||||||
|
})
|
||||||
if (!this.fromBottom) {
|
if (!this.fromBottom) {
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,70 +1,66 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<el-dialog
|
||||||
<el-dialog
|
:title="$t('guide.title')"
|
||||||
:title="$t('guide.title')"
|
:visible.sync="visible"
|
||||||
:visible.sync="visible"
|
custom-class="guild-pop"
|
||||||
custom-class="guild-pop"
|
width="1000px"
|
||||||
width="1000px"
|
>
|
||||||
@closed="dialogClosed"
|
<div class="guide-list">
|
||||||
@open="dialogOpened"
|
<div ref="guideShadow" class="guide-shadow"></div>
|
||||||
>
|
<div v-for="(guide, index) in guideList" :key="index" :class="{'guide-item--active': index === activeIndex}" class="guide-item"
|
||||||
<div class="guide-list">
|
@mouseenter="enter(index)" @mouseleave="leave(index)"
|
||||||
<div ref="guideShadow" class="guide-shadow"></div>
|
>
|
||||||
<div v-for="(guide, index) in guideList" :key="index" :class="{'guide-item--active': index === activeIndex}" class="guide-item"
|
<div class="item__title">{{guide.title}}</div>
|
||||||
@mouseenter="enter(index)" @mouseleave="leave(index)"
|
<div class="item__icon" @click="jump(guide.route)"><i :class="guide.icon"></i></div>
|
||||||
>
|
</div>
|
||||||
<div class="item__title">{{guide.title}}</div>
|
</div>
|
||||||
<div class="item__icon" @click="jump(guide.route)"><i :class="guide.icon"></i></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" @click="jumpAndOpen('dc')">{{$t('guide.addDc')}}</button>
|
||||||
|
<button class="guide__btn" type="button" @click="jumpAndOpen('cabinet')">{{$t('guide.addCabinet')}}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
<div class="guide-desc">
|
<template v-if="activeIndex === 1">
|
||||||
<template v-if="activeIndex === 0">
|
<div class="desc-text">{{$t('guide.agentTip')}}</div>
|
||||||
<div class="desc-text">{{$t('guide.dcTip')}}</div>
|
<div class="guide__btn-group">
|
||||||
<div class="guide__btn-group">
|
<button class="guide__btn" type="button" @click="jumpAndOpen('agent')">{{$t('guide.addAgent')}}</button>
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('dc')">{{$t('guide.addDc')}}</button>
|
<button class="guide__btn" type="button" @click="downloadAgent">{{$t('guide.downloadAgent')}}</button>
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('cabinet')">{{$t('guide.addCabinet')}}</button>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
</template>
|
<template v-if="activeIndex === 2">
|
||||||
<template v-if="activeIndex === 1">
|
<div class="desc-text">{{$t('guide.assetTip')}}</div>
|
||||||
<div class="desc-text">{{$t('guide.agentTip')}}</div>
|
<div class="guide__btn-group">
|
||||||
<div class="guide__btn-group">
|
<button class="guide__btn" type="button" @click="jumpAndOpen('asset')">{{$t('guide.addAsset')}}</button>
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('agent')">{{$t('guide.addAgent')}}</button>
|
<button class="guide__btn" type="button" @click="jumpAndOpen('importAsset')">{{$t('guide.importAsset')}}</button>
|
||||||
<button class="guide__btn" type="button" @click="downloadAgent">{{$t('guide.downloadAgent')}}</button>
|
<button class="guide__btn" type="button" @click="openTerminal">{{$t('guide.webTerminal')}}</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="activeIndex === 2">
|
<template v-if="activeIndex === 3">
|
||||||
<div class="desc-text">{{$t('guide.assetTip')}}</div>
|
<div class="desc-text">{{$t('guide.monitorTip')}}</div>
|
||||||
<div class="guide__btn-group">
|
<div class="guide__btn-group">
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('asset')">{{$t('guide.addAsset')}}</button>
|
<button class="guide__btn" type="button" @click="jumpAndOpen('project')">{{$t('guide.addProject')}}</button>
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('importAsset')">{{$t('guide.importAsset')}}</button>
|
<button class="guide__btn" type="button" @click="jumpAndOpen('module')">{{$t('guide.addModule')}}</button>
|
||||||
<button class="guide__btn" type="button" @click="openTerminal">{{$t('guide.webTerminal')}}</button>
|
<button class="guide__btn" type="button" @click="jumpAndOpen('endpoint')">{{$t('guide.addEndpoint')}}</button>
|
||||||
</div>
|
<button class="guide__btn" type="button" @click="jumpAndOpen('importEndpoint')">{{$t('guide.importEndpoint')}}</button>
|
||||||
</template>
|
</div>
|
||||||
<template v-if="activeIndex === 3">
|
</template>
|
||||||
<div class="desc-text">{{$t('guide.monitorTip')}}</div>
|
<template v-if="activeIndex === 4">
|
||||||
<div class="guide__btn-group">
|
<div class="desc-text">{{$t('guide.visualizationTip')}}</div>
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('project')">{{$t('guide.addProject')}}</button>
|
<div class="guide__btn-group">
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('module')">{{$t('guide.addModule')}}</button>
|
<button class="guide__btn" type="button" @click="jumpAndOpen('panel')">{{$t('guide.addPanel')}}</button>
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('endpoint')">{{$t('guide.addEndpoint')}}</button>
|
<button class="guide__btn" type="button" @click="jumpAndOpen('chart')">{{$t('guide.addChart')}}</button>
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('importEndpoint')">{{$t('guide.importEndpoint')}}</button>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
</template>
|
<template v-if="activeIndex === 5">
|
||||||
<template v-if="activeIndex === 4">
|
<div class="desc-text">{{$t('guide.alertTip')}}</div>
|
||||||
<div class="desc-text">{{$t('guide.visualizationTip')}}</div>
|
<div class="guide__btn-group">
|
||||||
<div class="guide__btn-group">
|
<button class="guide__btn" type="button" @click="jumpAndOpen('alertRule')">{{$t('guide.addAlertRule')}}</button>
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('panel')">{{$t('guide.addPanel')}}</button>
|
</div>
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('chart')">{{$t('guide.addChart')}}</button>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</el-dialog>
|
||||||
<template v-if="activeIndex === 5">
|
|
||||||
<div class="desc-text">{{$t('guide.alertTip')}}</div>
|
|
||||||
<div class="guide__btn-group">
|
|
||||||
<button class="guide__btn" type="button" @click="jumpAndOpen('alertRule')">{{$t('guide.addAlertRule')}}</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -122,14 +118,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
dialogOpened () {
|
|
||||||
if (this.$refs.changePinForm) {
|
|
||||||
this.$refs.changePinForm.resetFields()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dialogClosed () {
|
|
||||||
this.$emit('dialogClosed')
|
|
||||||
},
|
|
||||||
close () {
|
close () {
|
||||||
this.visible = false
|
this.visible = false
|
||||||
},
|
},
|
||||||
@@ -142,10 +130,10 @@ export default {
|
|||||||
this.interval && clearInterval(this.interval)
|
this.interval && clearInterval(this.interval)
|
||||||
},
|
},
|
||||||
downloadAgent () {
|
downloadAgent () {
|
||||||
|
// TODO
|
||||||
},
|
},
|
||||||
openTerminal () {
|
openTerminal () {
|
||||||
|
// TODO
|
||||||
},
|
},
|
||||||
jump (route) {
|
jump (route) {
|
||||||
this.visible = false
|
this.visible = false
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export default {
|
|||||||
} else if (this.importUrl.indexOf('rule') > -1) {
|
} else if (this.importUrl.indexOf('rule') > -1) {
|
||||||
url = '/alert/rule/cancelImport'
|
url = '/alert/rule/cancelImport'
|
||||||
} else if (this.importUrl.indexOf('panel') > -1) {
|
} else if (this.importUrl.indexOf('panel') > -1) {
|
||||||
url = '/panel/cancelImport'
|
url = 'visual/panel/cancelImport'
|
||||||
} else if (this.importUrl.indexOf('tmpl') > -1) {
|
} else if (this.importUrl.indexOf('tmpl') > -1) {
|
||||||
url = '/expression/tmpl/cancelImport'
|
url = '/expression/tmpl/cancelImport'
|
||||||
}
|
}
|
||||||
@@ -227,7 +227,7 @@ export default {
|
|||||||
} else if (this.importUrl.indexOf('rule') > -1) {
|
} else if (this.importUrl.indexOf('rule') > -1) {
|
||||||
url = '/alert/rule/template'
|
url = '/alert/rule/template'
|
||||||
} else if (this.importUrl.indexOf('panel') > -1) {
|
} else if (this.importUrl.indexOf('panel') > -1) {
|
||||||
url = '/panel/template'
|
url = 'visual/panel/template'
|
||||||
} else if (this.importUrl.indexOf('endpoint') > -1) {
|
} else if (this.importUrl.indexOf('endpoint') > -1) {
|
||||||
url = '/monitor/endpoint/template'
|
url = '/monitor/endpoint/template'
|
||||||
} else if (this.importUrl.indexOf('tmpl') > -1) {
|
} else if (this.importUrl.indexOf('tmpl') > -1) {
|
||||||
|
|||||||
@@ -127,12 +127,12 @@ export default {
|
|||||||
sortable: 'custom'
|
sortable: 'custom'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Name',
|
label: this.$t('alert.silence.name'),
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
show: true,
|
show: true,
|
||||||
width: 150
|
width: 150
|
||||||
}, {
|
}, {
|
||||||
label: 'Matchers',
|
label: this.$t('alert.silence.matchers'),
|
||||||
prop: 'matchers',
|
prop: 'matchers',
|
||||||
show: true,
|
show: true,
|
||||||
sortable: 'custom'
|
sortable: 'custom'
|
||||||
|
|||||||
@@ -95,31 +95,31 @@ export default {
|
|||||||
prop: 'id',
|
prop: 'id',
|
||||||
show: true,
|
show: true,
|
||||||
width: 80,
|
width: 80,
|
||||||
sortable:'custom'
|
sortable: 'custom'
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('project.project.project'),
|
label: this.$t('project.project.project'),
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
show: true,
|
show: true,
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
sortable:'custom'
|
sortable: 'custom'
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('project.module.module'),
|
label: this.$t('project.module.module'),
|
||||||
prop: 'moduleNum',
|
prop: 'moduleNum',
|
||||||
show: true,
|
show: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
sortable:'custom'
|
sortable: 'custom'
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('project.endpoint.endpoint'),
|
label: this.$t('project.endpoint.endpoint'),
|
||||||
prop: 'endpointNum',
|
prop: 'endpointNum',
|
||||||
show: true,
|
show: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
sortable:'custom'
|
sortable: 'custom'
|
||||||
}, {
|
}, {
|
||||||
label: this.$t('project.endpoint.alerts'),
|
label: this.$t('project.endpoint.alerts'),
|
||||||
prop: 'alertNum',
|
prop: 'alertNum',
|
||||||
show: true,
|
show: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
sortable:'custom'
|
sortable: 'custom'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('overall.remark'),
|
label: this.$t('overall.remark'),
|
||||||
|
|||||||
@@ -12,15 +12,16 @@
|
|||||||
<template v-slot:top-tool-right>
|
<template v-slot:top-tool-right>
|
||||||
<export-excel
|
<export-excel
|
||||||
id="alert-rule"
|
id="alert-rule"
|
||||||
|
:permissions="{import: 'alertRule_add'}"
|
||||||
:params="searchLabel"
|
:params="searchLabel"
|
||||||
:permissions="{import: 'rule_import', export: 'rule_export'}"
|
class="top-tool-export margin-r-10"
|
||||||
export-file-name="AlertRule"
|
export-file-name="AlertRule"
|
||||||
export-url="/alert/rule/export"
|
export-url="/alert/rule/export"
|
||||||
import-url="/alert/rule/import"
|
import-url="/alert/rule/import"
|
||||||
@afterImport="getTableData"
|
@afterImport="getTableData"
|
||||||
>
|
>
|
||||||
<template slot="optionZone">
|
<template slot="optionZone">
|
||||||
<button id="alert-add" v-has="'alertRule_add'" :title="$t('overall.createAlertRule')" class="top-tool-btn margin-r-10"
|
<button id="alert-add" v-has="'alertRule_add'" :title="$t('overall.createAlertRule')" class="top-tool-btn"
|
||||||
@click="add">
|
@click="add">
|
||||||
<i class="nz-icon-create-square nz-icon"></i>
|
<i class="nz-icon-create-square nz-icon"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -125,6 +125,12 @@ export default {
|
|||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
edit (u) {
|
||||||
|
this.object ={...u}
|
||||||
|
this.rightBox.show = true
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<nz-data-list
|
<nzDataList
|
||||||
ref="dataList"
|
ref="dataList"
|
||||||
:api="url"
|
:api="url"
|
||||||
:layout="['searchInput', 'elementSet']"
|
:layout="['searchInput', 'elementSet']"
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<template v-slot:pagination>
|
<template v-slot:pagination>
|
||||||
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
|
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
|
||||||
</template>
|
</template>
|
||||||
</nz-data-list>
|
</nzDataList>
|
||||||
<transition name="right-box">
|
<transition name="right-box">
|
||||||
<chart-box :chart="object" :show-panel="showPanel" :from="'temp'" @close="closeChartBox" @delete-chart="delChart" @on-create-success="createSuccess" @on-delete-success="delChartOk" @reload="panelReload" @reloadOnlyPanel="panelReloadOnlyPanel" ref="addChartModal" v-if="rightBox.show"></chart-box>
|
<chart-box :chart="object" :show-panel="showPanel" :from="'temp'" @close="closeChartBox" @delete-chart="delChart" @on-create-success="createSuccess" @on-delete-success="delChartOk" @reload="panelReload" @reloadOnlyPanel="panelReloadOnlyPanel" ref="addChartModal" v-if="rightBox.show"></chart-box>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -70,7 +70,6 @@ import bus from '@/libs/bus'
|
|||||||
import exportXLSX from '@/components/common/exportXLSX'
|
import exportXLSX from '@/components/common/exportXLSX'
|
||||||
import chartBox from '@/components/page/dashboard/chartBox'
|
import chartBox from '@/components/page/dashboard/chartBox'
|
||||||
import deleteButton from '@/components/common/deleteButton'
|
import deleteButton from '@/components/common/deleteButton'
|
||||||
import nzDataList from '@/components/common/table/nzDataList'
|
|
||||||
import dataListMixin from '@/components/common/mixin/dataList'
|
import dataListMixin from '@/components/common/mixin/dataList'
|
||||||
import chartTmplTable from '@/components/common/table/settings/chartTmplTable'
|
import chartTmplTable from '@/components/common/table/settings/chartTmplTable'
|
||||||
|
|
||||||
@@ -79,7 +78,6 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
chartBox,
|
chartBox,
|
||||||
deleteButton,
|
deleteButton,
|
||||||
nzDataList,
|
|
||||||
chartTmplTable,
|
chartTmplTable,
|
||||||
'export-excel': exportXLSX
|
'export-excel': exportXLSX
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<nz-data-list
|
<nzDataList
|
||||||
ref="dataList"
|
ref="dataList"
|
||||||
:api="url"
|
:api="url"
|
||||||
:layout="['searchInput', 'elementSet']"
|
:layout="['searchInput', 'elementSet']"
|
||||||
@@ -37,7 +37,8 @@
|
|||||||
</export-excel>
|
</export-excel>
|
||||||
|
|
||||||
<delete-button :delete-objs="batchDeleteObjs" @after="getTableData"
|
<delete-button :delete-objs="batchDeleteObjs" @after="getTableData"
|
||||||
id="alert-msg-batch-delete" v-has="'expressionTemplate_delete'" :api="url"></delete-button></template>
|
id="alert-msg-batch-delete" v-has="'expressionTemplate_delete'" :api="url"></delete-button>
|
||||||
|
</template>
|
||||||
<template v-slot:default="slotProps">
|
<template v-slot:default="slotProps">
|
||||||
<expr-tmpl-table
|
<expr-tmpl-table
|
||||||
ref="dataTable"
|
ref="dataTable"
|
||||||
@@ -58,7 +59,7 @@
|
|||||||
<template v-slot:pagination>
|
<template v-slot:pagination>
|
||||||
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
|
<Pagination ref="Pagination" :pageObj="pageObj" :tableId="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination>
|
||||||
</template>
|
</template>
|
||||||
</nz-data-list>
|
</nzDataList>
|
||||||
<transition name="right-box">
|
<transition name="right-box">
|
||||||
<expr-tmpl-box v-if="rightBox.show" :exprTemp="object" @close="closeRightBox"></expr-tmpl-box>
|
<expr-tmpl-box v-if="rightBox.show" :exprTemp="object" @close="closeRightBox"></expr-tmpl-box>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -84,7 +85,6 @@ import bus from '@/libs/bus'
|
|||||||
import exportXLSX from '@/components/common/exportXLSX'
|
import exportXLSX from '@/components/common/exportXLSX'
|
||||||
import exprTmplBox from '@/components/common/rightBox/exprTmplBox'
|
import exprTmplBox from '@/components/common/rightBox/exprTmplBox'
|
||||||
import deleteButton from '@/components/common/deleteButton'
|
import deleteButton from '@/components/common/deleteButton'
|
||||||
import nzDataList from '@/components/common/table/nzDataList'
|
|
||||||
import dataListMixin from '@/components/common/mixin/dataList'
|
import dataListMixin from '@/components/common/mixin/dataList'
|
||||||
import exprTmplTable from '@/components/common/table/settings/exprTmplTable'
|
import exprTmplTable from '@/components/common/table/settings/exprTmplTable'
|
||||||
|
|
||||||
@@ -93,7 +93,6 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
deleteButton,
|
deleteButton,
|
||||||
exprTmplBox,
|
exprTmplBox,
|
||||||
nzDataList,
|
|
||||||
exprTmplTable,
|
exprTmplTable,
|
||||||
'export-excel': exportXLSX
|
'export-excel': exportXLSX
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="temp">
|
||||||
<exprTemp class="template-tab" :show-tab="showTab" v-show="showTab == 'exprTemp'" @changeShowTab="changeShowTab" @toCredentialTab="changeTab(['mib','credentials'],'credentials')" @toBrowserTab="changeTab(['mib','browser'],'browser')"></exprTemp>
|
<exprTemp class="template-tab" :show-tab="showTab" v-if="showTab == 'exprTemp'" @changeShowTab="changeShowTab"></exprTemp>
|
||||||
<chartTemp class="template-tab" :show-tab="showTab" v-if="showTab == 'chartTemp'" @changeShowTab="changeShowTab" @toCredentialTab="changeTab(['mib','credentials'],'credentials')" @toBrowserTab="changeTab(['mib','browser'],'browser')"></chartTemp>
|
<chartTemp class="template-tab" :show-tab="showTab" v-if="showTab == 'chartTemp'" @changeShowTab="changeShowTab"></chartTemp>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -9,14 +9,14 @@
|
|||||||
import exprTemp from './exprTemp'
|
import exprTemp from './exprTemp'
|
||||||
import chartTemp from './chartTemp'
|
import chartTemp from './chartTemp'
|
||||||
export default {
|
export default {
|
||||||
name: 'template',
|
name: 'v-template',
|
||||||
components: {
|
components: {
|
||||||
exprTemp,
|
exprTemp,
|
||||||
chartTemp
|
chartTemp
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
showTab: 'exprTemp'
|
showTab: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -45,16 +45,10 @@ export default {
|
|||||||
this.showTab = showTab
|
this.showTab = showTab
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
mounted () {
|
||||||
$routePath: {
|
this.$nextTick(()=>{
|
||||||
|
this.showTab = 'exprTemp'
|
||||||
immediate: true,
|
})
|
||||||
handler (n, o) {
|
|
||||||
if (n.indexOf('mib') != -1 && this.$route.params.tab) {
|
|
||||||
this.$set(this, 'showTab', this.$route.params.tab)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot:after>
|
<template v-slot:after>
|
||||||
<el-dropdown-item v-has="'panel_chart_add'">
|
<el-dropdown-item v-has="'panel_chart_add'">
|
||||||
<div id="chart-temp-add" @click="addChartByTemp"><i class="nz-icon nz-icon-download1"></i>Add by template</div>
|
<div id="chart-temp-add" @click="addChartByTemp"><i class="nz-icon nz-icon-add"></i>Add by template</div>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</template>
|
</template>
|
||||||
</top-tool-more-options>
|
</top-tool-more-options>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import bus from '@/libs/bus'
|
|||||||
import theme from '@/assets/css/theme.scss'
|
import theme from '@/assets/css/theme.scss'
|
||||||
import myDatePicker from '@/components/common/myDatePicker'
|
import myDatePicker from '@/components/common/myDatePicker'
|
||||||
import vSelectPage from 'v-selectpage'
|
import vSelectPage from 'v-selectpage'
|
||||||
|
import nzDataList from '@/components/common/table/nzDataList'
|
||||||
Vue.use(vSelectPage, {
|
Vue.use(vSelectPage, {
|
||||||
dataLoad: function (vue, url, params) {
|
dataLoad: function (vue, url, params) {
|
||||||
if (params.pageNumber) {
|
if (params.pageNumber) {
|
||||||
@@ -52,6 +53,7 @@ Vue.component('element-set', elementSet)
|
|||||||
Vue.component('loading', loading)
|
Vue.component('loading', loading)
|
||||||
Vue.component('pick-time', pickTime)
|
Vue.component('pick-time', pickTime)
|
||||||
Vue.component('myDatePicker', myDatePicker)
|
Vue.component('myDatePicker', myDatePicker)
|
||||||
|
Vue.component('nzDataList', nzDataList)
|
||||||
|
|
||||||
Vue.prototype.$axios = axios
|
Vue.prototype.$axios = axios
|
||||||
Vue.prototype.$post = post
|
Vue.prototype.$post = post
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import router from './router'
|
import router from './router'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
import { post } from './http'
|
import { get, post } from './http'
|
||||||
import ElementUI from 'element-ui'
|
import ElementUI from 'element-ui'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import i18n from './components/common/i18n'
|
import i18n from './components/common/i18n'
|
||||||
@@ -8,19 +8,32 @@ import VueResource from 'vue-resource'
|
|||||||
|
|
||||||
Vue.use(VueResource)
|
Vue.use(VueResource)
|
||||||
|
|
||||||
const loginWhiteList = ['/login', '/setup', '/sys/license/upload', '/sys/license/state'] // 免登陆白名单
|
const loginWhiteList = ['/setup', '/sys/license/upload', '/sys/license/state'] // 免登陆白名单
|
||||||
const permissionWhiteList = ['/menu', ...loginWhiteList] // 权限白名单
|
const permissionWhiteList = ['/menu', ...loginWhiteList] // 权限白名单
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
if (sessionStorage.getItem('nz-token')) {
|
if (to.path === '/login') { // 拦截登录页面,系统初始化检查
|
||||||
|
const configUrl = 'static/config.json?Timestamp=' + new Date().getTime()
|
||||||
|
Vue.http.get(configUrl).then(config => {
|
||||||
|
get(config.body.baseUrl + 'setup/inited').then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
if (res.inited === 0) {
|
||||||
|
next({ path: '/setup' })
|
||||||
|
} else {
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else if (sessionStorage.getItem('nz-token')) {
|
||||||
if (permissionWhiteList.indexOf(to.path) !== -1) {
|
if (permissionWhiteList.indexOf(to.path) !== -1) {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
new Promise(resolve => {
|
new Promise(resolve => {
|
||||||
if (store.getters.menuList.length === 0) {
|
if (store.getters.menuList.length === 0) {
|
||||||
const configUrl = 'static/config.json?Timestamp=' + new Date().getTime()
|
const configUrl = 'static/config.json?Timestamp=' + new Date().getTime()
|
||||||
Vue.http.get(configUrl).then(res => {
|
Vue.http.get(configUrl).then(config => {
|
||||||
post(res.body.baseUrl + 'sys/user/permissions', { token: sessionStorage.getItem('nz-token') }).then(res => {
|
post(config.body.baseUrl + 'sys/user/permissions', { token: sessionStorage.getItem('nz-token') }).then(res => {
|
||||||
store.commit('setMenuList', sortByOrderNum(res.data.menus))
|
store.commit('setMenuList', sortByOrderNum(res.data.menus))
|
||||||
store.commit('setButtonList', res.data.buttons)
|
store.commit('setButtonList', res.data.buttons)
|
||||||
store.commit('setRoleList', res.data.roles)
|
store.commit('setRoleList', res.data.roles)
|
||||||
|
|||||||
Reference in New Issue
Block a user