Merge branch 'dev-3.3' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.4
46
nezha-fronted/src/assets/css/components/common/intro.scss
Normal file
@@ -0,0 +1,46 @@
|
||||
.is-intro.el-dialog{
|
||||
max-height: unset;
|
||||
max-width: unset;
|
||||
height: 100%;
|
||||
.el-dialog__header{
|
||||
display: none;
|
||||
}
|
||||
.el-dialog__body{
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
> div{
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.dc-img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url("~@/assets/img/jj.png") no-repeat;
|
||||
background-size:cover;
|
||||
}
|
||||
.dc-img1{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url("~@/assets/img/jj1.png") no-repeat;
|
||||
background-size:cover;
|
||||
}
|
||||
.dc-img2{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url("~@/assets/img/jj3.png") no-repeat;
|
||||
background-size:cover;
|
||||
}
|
||||
.dc-img3{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url("~@/assets/img/dc3.png") no-repeat;
|
||||
background-size:cover;
|
||||
}
|
||||
.intro-bottom{
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
bottom: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@@ -67,6 +67,7 @@
|
||||
@import './common/elementSet.scss';
|
||||
@import './common/loading.scss';
|
||||
@import './common/login.scss';
|
||||
@import './common/intro.scss';
|
||||
@import './common/multipleTime.scss';
|
||||
@import './common/nezhaColor.scss';
|
||||
@import './common/nzTransfer.scss';
|
||||
|
||||
BIN
nezha-fronted/src/assets/img/dc.png
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
nezha-fronted/src/assets/img/dc1.png
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
nezha-fronted/src/assets/img/dc2.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
nezha-fronted/src/assets/img/dc3.png
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
nezha-fronted/src/assets/img/jj.png
Normal file
|
After Width: | Height: | Size: 292 KiB |
BIN
nezha-fronted/src/assets/img/jj1.png
Normal file
|
After Width: | Height: | Size: 407 KiB |
BIN
nezha-fronted/src/assets/img/jj3.png
Normal file
|
After Width: | Height: | Size: 217 KiB |
@@ -109,7 +109,7 @@ export default {
|
||||
show: true,
|
||||
width: 150
|
||||
}, {
|
||||
label: this.$t('overall.enable'),
|
||||
label: this.$t('overall.enabled'),
|
||||
prop: 'status',
|
||||
show: true,
|
||||
width: 100
|
||||
|
||||
@@ -3,6 +3,8 @@ import locale from 'element-ui/lib/locale'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import { get } from '@/http'
|
||||
import messages from './language'
|
||||
import enLocale from 'element-ui/lib/locale/lang/en' // 引入element语言包
|
||||
import zhLocale from 'element-ui/lib/locale/lang/zh-CN' // 引入element语言包
|
||||
Vue.use(VueI18n)
|
||||
// 从localStorage获取语言选择。
|
||||
const i18n = new VueI18n({
|
||||
@@ -14,7 +16,12 @@ locale.i18n((key, value) => i18n.t(key, value)) // 兼容element
|
||||
export function loadI18n (i18nData) {
|
||||
if (i18nData) {
|
||||
Object.keys(i18nData).forEach(lang => {
|
||||
i18n.setLocaleMessage(lang, i18nData[lang])
|
||||
if (lang === 'zh') {
|
||||
Object.assign(i18nData[lang], { ...zhLocale })
|
||||
} else if (lang === 'en') {
|
||||
Object.assign(i18nData[lang], { ...enLocale })
|
||||
}
|
||||
i18n.setLocaleMessage(lang, { ...i18nData[lang] })
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
78
nezha-fronted/src/components/common/intro.vue
Normal file
@@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
width="100%"
|
||||
height="100%"
|
||||
title="内层 Dialog"
|
||||
:custom-class="'is-intro'"
|
||||
:show-close="false"
|
||||
:visible.sync="showIntro"
|
||||
append-to-body>
|
||||
<div>
|
||||
<div v-if="introStep==='main'">
|
||||
<el-button @click="introStepChange('dc')">设置dc</el-button>
|
||||
<el-button>设置asset</el-button>
|
||||
<el-button>设置project</el-button>
|
||||
<el-button>设置dc</el-button>
|
||||
</div>
|
||||
<div v-if="introStep === 'dc'" style="height: 100%">
|
||||
<div v-if="step === 0" class="dc-img"></div>
|
||||
<div v-else-if="step === 1" class="dc-img1"></div>
|
||||
<div v-else-if="step === 2" class="dc-img2"></div>
|
||||
<div v-else-if="step === 3" class="dc-img3"></div>
|
||||
<div v-else>
|
||||
<el-button @click="introStepChange('asset')">继续设置asset</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="introStep === 'asset'" style="height: 100%">
|
||||
<div v-if="step === 0" >设置asset</div>
|
||||
<div v-if="step === 1" ></div>
|
||||
<div v-if="step === 2" ></div>
|
||||
<div v-if="step === 3" ></div>
|
||||
<div v-if="step === 4" ></div>
|
||||
</div>
|
||||
<div class="intro-bottom">
|
||||
<el-button @click="prev()">上一步</el-button>
|
||||
<el-button @click="next()">下一步</el-button>
|
||||
<el-button @click="exit()">退出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'intro',
|
||||
data: function () {
|
||||
return {
|
||||
showIntro: false,
|
||||
introStep: 'main',
|
||||
step: 0,
|
||||
timer: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
introStepChange (type) {
|
||||
this.step = 0
|
||||
this.introStep = type
|
||||
},
|
||||
prev () {
|
||||
this.step--
|
||||
},
|
||||
next () {
|
||||
this.step++
|
||||
if (this.introStep == 'dc' && this.step === 4) {
|
||||
this.timer = setTimeout(() => {
|
||||
this.introStepChange('main')
|
||||
})
|
||||
}
|
||||
},
|
||||
exit () {
|
||||
this.showIntro = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -97,5 +97,4 @@ const newen = {
|
||||
},
|
||||
...enLocale
|
||||
}
|
||||
|
||||
export default newen
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="input-box">
|
||||
<div class="input-box-item" style="display: none;">
|
||||
<el-input v-model="lnglat" @blur="setLatlng" @change="setLatlng">
|
||||
<template slot="prepend" v-if="showZoom">{{$t('config.dc.lnglat')}}</template>
|
||||
<template slot="prepend" v-if="showZoom">{{$t('config.system.basic.lnglat')}}</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="input-box-item" v-if="showZoom">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div v-clickoutside="{obj:endpoint,func:clickOutside}" :class="{'right-box-add-endpoint-snmp': currentModule.type && currentModule.type.toLowerCase() == 'snmp'}" class="right-box right-box-add-endpoint">
|
||||
<div class="right-box__header">
|
||||
<!-- begin--标题-->
|
||||
<div class="header__title">{{$t("overall.createEndpoint")}}</div>
|
||||
<div class="header__title">{{$t("config.system.basic.lnglatll.createEndpoint")}}</div>
|
||||
<!-- end--标题-->
|
||||
<div class="header__operation">
|
||||
<span v-cancel="{obj: object, func: esc}"><i class="nz-icon nz-icon-close"></i></span>
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
:label="$t('overall.enable')"
|
||||
:label="$t('overall.enabled')"
|
||||
prop="status"
|
||||
class="form-item__switch"
|
||||
>
|
||||
|
||||
@@ -184,7 +184,7 @@ export default {
|
||||
roles: [],
|
||||
mfaLevelList: [
|
||||
{ value: 0, label: this.$t('profile.close') },
|
||||
{ value: 1, label: this.$t('overall.enable') },
|
||||
{ value: 1, label: this.$t('overall.enabled') },
|
||||
{ value: 2, label: this.$t('config.user.forceEnable') }
|
||||
],
|
||||
languageList: [
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.dc.lnglat')" prop="lnglat">
|
||||
<el-form-item :label="$t('config.system.basic.lnglat')" prop="lnglat">
|
||||
<div style="display: flex">
|
||||
<el-input v-model="editDc.lnglat" maxlength="256" placeholder="" size="small" style="width: calc(100% - 50px);margin-right: 20px;"></el-input>
|
||||
<latlng-picker
|
||||
|
||||
@@ -715,7 +715,7 @@ export default {
|
||||
{ name: this.$t('project.endpoint.authTypeToken'), value: 2 }
|
||||
],
|
||||
endpointStateList: [
|
||||
{ name: this.$t('overall.enable'), value: 1 },
|
||||
{ name: this.$t('overall.enabled'), value: 1 },
|
||||
{ name: this.$t('profile.close'), value: 0 }
|
||||
],
|
||||
configsCopyValue: '',
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
</nz-tooltip>
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'enabled'">
|
||||
<span v-if="scope.row[item.prop] === 1">{{$t('overall.enable')}}</span>
|
||||
<span v-if="scope.row[item.prop] === 1">{{$t('overall.enabled')}}</span>
|
||||
<span v-else>{{$t('profile.close')}}</span>
|
||||
</template>
|
||||
<span v-else-if="item.prop === 'id'" :id="'globalSearch' + scope.row.id">{{scope.row[item.prop]}}</span>
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<guide :show-dialog="showGuide" @dialogClosed="dialogClosed" @close="showGuide = false"></guide>
|
||||
<intro></intro>
|
||||
<!-- <span v-for="item in fontData" :key="item">-->
|
||||
<!-- <span class="temp-dom" :class="`temp-dom--${fontSzie}`" v-for="fontSzie in [12,13,14,15]" :key="fontSzie">{{item}}</span>-->
|
||||
<!-- </span>-->
|
||||
@@ -76,16 +77,19 @@
|
||||
import bus from '../../libs/bus'
|
||||
import { mapActions } from 'vuex'
|
||||
import guide from '@/components/common/popBox/guide'
|
||||
import intro from '@/components/common/intro'
|
||||
export default {
|
||||
name: 'Header',
|
||||
components: {
|
||||
guide
|
||||
guide,
|
||||
intro
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
username: '',
|
||||
name: '',
|
||||
language: 'en',
|
||||
showIntro: 'true',
|
||||
// 顶部菜单相关
|
||||
createMenu: [ // 新增按钮内容
|
||||
{
|
||||
@@ -228,32 +232,6 @@ export default {
|
||||
this.getLinkData()
|
||||
}
|
||||
window.addEventListener('visibilitychange', this.testUser)
|
||||
// setTimeout(() => {
|
||||
// this.$intro()
|
||||
// .setOptions({
|
||||
// // 我给看的效果图是英⽂的(默认英⽂),这⾥是更换成中⽂
|
||||
// prevLabel: '上⼀步',
|
||||
// nextLabel: '下⼀步',
|
||||
// skipLabel: '跳过',
|
||||
// doneLabel: '完成',
|
||||
// // steps步骤,可以写个⼯具类保存起来
|
||||
// steps: this.steps,
|
||||
// dontShowAgain: true
|
||||
// })
|
||||
// .oncomplete(() => {
|
||||
// // 需要注意的是,这⾥⽤了箭头函数
|
||||
// // 点击结束按钮后执⾏的事件
|
||||
// })
|
||||
// .onexit(() => {
|
||||
// // 点击跳过按钮后执⾏的事件
|
||||
// })
|
||||
// .onbeforeexit(() => {
|
||||
// // 确认完毕之后执⾏的事件
|
||||
// // return confirm('Are you sure?')
|
||||
// })
|
||||
// // this.$intro('#personal').start() // start the guide
|
||||
// // this.$intro('#personal').showHints() // show hints
|
||||
// }, 1000)
|
||||
},
|
||||
computed: {
|
||||
linkData () {
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
customTableTitle: [
|
||||
{ label: this.$t('alert.config.schedEnable'), prop: 'schedule' },
|
||||
{ label: this.$t('backup.backupRetention'), prop: 'retention' },
|
||||
{ label: this.$t('overall.enable'), prop: 'state' }
|
||||
{ label: this.$t('overall.enabled'), prop: 'state' }
|
||||
],
|
||||
customTableTitle2: [
|
||||
{ label: this.$t('config.assetLabel.date'), prop: 'time', minwidth: 228 },
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<el-form-item :label="$t('config.system.basic.mapConfig')" class="basic-lnglat" prop="lnglat">
|
||||
<div style="display: flex">
|
||||
<el-input v-model="basic.lnglat" maxlength="256" placeholder="" style="width: calc(100% - 50px); padding-right: 50px;">
|
||||
<template slot="prepend">{{$t('config.dc.lnglat')}}</template>
|
||||
<template slot="prepend">{{$t('config.system.basic.lnglat')}}</template>
|
||||
</el-input>
|
||||
<latlng-picker ref="latlngPicker" :init-data="basic.lnglat" :show-zoom="true" @lnglatChange="lnglatChange"></latlng-picker>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<template slot="append"><span >{{$t('config.system.basic.day')}}</span></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.system.monitor.logs_storage_type')" prop="logs_storage_type">
|
||||
<el-form-item :label="$t('config.system.monitor.metrics_storage_type')" prop="logs_storage_type">
|
||||
<el-select v-model="monitor.logs_storage_type" popper-class="right-box-select-top right-public-box-dropdown-top">
|
||||
<el-option :label="$t('config.system.monitor.local')" value="1"></el-option>
|
||||
<el-option :label="$t('config.system.monitor.s3')" value="2"></el-option>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
<div class="profile-left__button table-operation-items">
|
||||
<button @click="profileEnable" class="footer__btn" v-if="mfaEnable != '1' && mfaLevel == 0">
|
||||
<span>{{$t('overall.enable')}}</span>
|
||||
<span>{{$t('overall.enabled')}}</span>
|
||||
</button>
|
||||
<button @click="profileDisable" class="footer__btn footer__btn--light" :class="{'footer__btn--disabled': mfaEnable == 1 || mfaLevel == 2}" v-if="mfaEnable == '1' || mfaLevel > 0" :disabled="mfaEnable == 1 || mfaLevel == 2 ">
|
||||
<span>{{$t('profile.close')}}</span>
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('setup.system.federation')" prop="prometheusFederationEnabled" key="sysprometheusFederationEnabled" >
|
||||
<el-select v-model="system.prometheusFederationEnabled" :placeholder="$t('el.select.placeholder')" style="width: 100%" >
|
||||
<el-option :label="$t('overall.enable')" :value="1"></el-option>
|
||||
<el-option :label="$t('overall.enabled')" :value="1"></el-option>
|
||||
<el-option :label="$t('overall.unavailable')" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<el-form-item :label="$t('config.system.basic.mapConfig')" class="basic-lnglat" prop="lnglat">
|
||||
<div style="display: flex">
|
||||
<el-input v-model="basic.lnglat" maxlength="256" placeholder="" style="width: calc(100% - 50px); padding-right: 50px;">
|
||||
<template slot="prepend">{{$t('config.dc.lnglat')}}</template>
|
||||
<template slot="prepend">{{$t('config.system.basic.lnglat')}}</template>
|
||||
</el-input>
|
||||
<latlng-picker ref="latlngPicker" :init-data="basic.lnglat" :show-zoom="true" @lnglatChange="lnglatChange"></latlng-picker>
|
||||
</div>
|
||||
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
prop: 'name',
|
||||
show: true
|
||||
}, {
|
||||
label: 'Token',
|
||||
label: this.$t('apiKey.key'),
|
||||
prop: 'token',
|
||||
show: true
|
||||
}, {
|
||||
|
||||
@@ -89,7 +89,7 @@ export default {
|
||||
minWidth: 100,
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('asset.talon.token'),
|
||||
label: this.$t('apiKey.key'),
|
||||
prop: 'token',
|
||||
minWidth: 180,
|
||||
show: true
|
||||
|
||||