NEZ-3483 feat: Log settings页面开发
This commit is contained in:
2
nezha-docs/package-lock.json
generated
2
nezha-docs/package-lock.json
generated
@@ -5,7 +5,7 @@
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "nezha",
|
||||
"name": "nezha-docs",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
.table-list {
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
padding: 20px 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<!--图表-->
|
||||
<div id="tableList" class="table-list chart-list-box" style="padding-top: 0;overflow: hidden">
|
||||
<div id="tableList" class="table-list chart-list-box" style="overflow: hidden;">
|
||||
<div id="dashboardScrollbar" class="table-list-box">
|
||||
<div class="box-content" ref="dashboardScrollbar" v-my-loading="chartListLoading" style="overflow-y: scroll;display: flex;flex-direction: column;overflow-x: hidden">
|
||||
<panel-variables :labelArrs="variables" :time-range="searchTime" @getPanelData="getPanelData"></panel-variables>
|
||||
|
||||
@@ -260,11 +260,10 @@ export default {
|
||||
this.$refs.emailForm.clearValidate()
|
||||
}
|
||||
if (type == 'monitor') {
|
||||
if(response.data.interface_name){
|
||||
let arr = response.data.interface_name.split(',')
|
||||
this.monitor.interface_name = arr.map(item=>{
|
||||
return {text: item}
|
||||
|
||||
if (response.data.interface_name) {
|
||||
const arr = response.data.interface_name.split(',')
|
||||
this.monitor.interface_name = arr.map(item => {
|
||||
return { text: item }
|
||||
})
|
||||
}
|
||||
localStorage.setItem('nz-prometheus-federation-enabled', this.monitor.prometheus_federation_enabled)
|
||||
@@ -284,8 +283,8 @@ export default {
|
||||
param.map_center_config = JSON.stringify(mapConfig)
|
||||
param.pin_policy = JSON.stringify(this.basic.pin_policy)
|
||||
}
|
||||
if(type == 'monitor') {
|
||||
let str = this.monitor.interface_name.map(item=>{
|
||||
if (type == 'monitor') {
|
||||
const str = this.monitor.interface_name.map(item => {
|
||||
return item.text
|
||||
})
|
||||
param.interface_name = str.join(',')
|
||||
|
||||
91
nezha-fronted/src/components/page/config/auditLog.vue
Normal file
91
nezha-fronted/src/components/page/config/auditLog.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div class="system">
|
||||
<div class="system-config-form basicForm">
|
||||
<el-form :model="auditlog" label-width="180px" size="small" ref="auditlogForm" :rules="auditlogRules" :validate-on-rule-change="false">
|
||||
<!--operation log-->
|
||||
<div class="system-title">{{$t('config.operationlog.operationlog')}}</div>
|
||||
<el-form-item :label="$t('config.system.monitor.metrics_storage_retention')" prop="operation_log_retention" style="padding-bottom: 15px;">
|
||||
<el-input v-model.number="auditlog.operation_log_retention">
|
||||
<template slot="append"><span >{{$t('config.system.basic.day')}}</span></template>
|
||||
</el-input>
|
||||
<div class="el-form-item__tip">{{$t('config.system.basic.passPeriodValue')}}</div>
|
||||
</el-form-item>
|
||||
<!--web terminal log-->
|
||||
<div class="system-title system-title-border">{{$t('config.terminallog.terminallog')}}</div>
|
||||
<el-form-item :label="$t('config.system.monitor.metrics_storage_retention')" prop="terminal_record_local_retention">
|
||||
<el-input v-model.number="auditlog.terminal_record_local_retention">
|
||||
<template slot="append"><span >{{$t('config.system.basic.day')}}</span></template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.system.monitor.metrics_storage_type')" prop="terminal_storage_type">
|
||||
<el-select v-model="auditlog.terminal_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>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<transition name="el-zoom-in-top">
|
||||
<div v-show="auditlog.terminal_storage_type == 2">
|
||||
<el-form-item :label="$t('asset.endpoint')" prop="terminal_storage_s3_endpoint" :rules=" [ { required: auditlog.terminal_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]">
|
||||
<el-input v-model="auditlog.terminal_storage_s3_endpoint">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.system.monitor.metrics_storage_s3_bucket')" prop="terminal_storage_s3_bucket" :rules=" [ { required: auditlog.terminal_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]">
|
||||
<el-input v-model="auditlog.terminal_storage_s3_bucket">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.system.monitor.metrics_storage_s3_access_key')" prop="terminal_storage_s3_access_key" :rules=" [ { required: auditlog.terminal_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]">
|
||||
<el-input v-model="auditlog.terminal_storage_s3_access_key">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.terminallog.key')" prop="terminal_storage_s3_secret_access_key" :rules=" [ { required: auditlog.terminal_storage_type == 2, message: this.$t('validate.required'), trigger: 'blur' }]" class="monitorLastElement">
|
||||
<el-input v-model="auditlog.terminal_storage_s3_secret_access_key" type="password" auto-complete="new-password" >
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</transition>
|
||||
<el-form-item>
|
||||
<button id="system-monitor-save" v-has="'system_basic_edit'" :class="{'nz-btn-disabled':prevent_opt.save}" :disabled="prevent_opt.save" class="nz-btn nz-btn-size-normal nz-btn-style-normal" type="button" @click="saveSetInfo('auditlog','auditlogForm')">{{$t('overall.save')}}</button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import systemMixin from '../../common/mixin/system/systemMixin'
|
||||
import routerPathParams from '../../common/mixin/routerPathParams'
|
||||
|
||||
export default {
|
||||
name: 'auditlog',
|
||||
mixins: [systemMixin, routerPathParams],
|
||||
components: {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
switchTab: 'auditlog',
|
||||
tag: '',
|
||||
auditlog: {
|
||||
operation_log_retention: '',
|
||||
terminal_record_local_retention: '',
|
||||
terminal_storage_type: '',
|
||||
terminal_storage_s3_endpoint: '',
|
||||
terminal_storage_s3_bucket: '',
|
||||
terminal_storage_s3_access_key: '',
|
||||
terminal_storage_s3_secret_access_key: ''
|
||||
},
|
||||
auditlogRules: {
|
||||
operation_log_retention: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
terminal_record_local_retention: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
terminal_storage_type: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
metrics_storage_type: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.querySetInfo(this.switchTab)
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -8,7 +8,7 @@ import bus from '@/libs/bus'
|
||||
import Message from '@/components/common/message/index'
|
||||
Vue.use(VueResource)
|
||||
|
||||
const loginWhiteList = ['/setup', '/sys/license/upload', '/sys/license/state', '/sys/appearance', '/i18n', '/terminal', 'uPlot'] // 免登陆白名单
|
||||
const loginWhiteList = ['/setup', '/sys/license/upload', '/sys/license/state', '/sys/appearance', '/i18n', '/terminal', '/auditLog'] // 免登陆白名单
|
||||
export const permissionWhiteList = ['/profile', '/menu', ...loginWhiteList] // 权限白名单
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (window.entrance) {
|
||||
|
||||
@@ -180,6 +180,10 @@ export default new Router({
|
||||
path: '/monitor',
|
||||
component: resolve => require(['@/components/page/config/monitor'], resolve)
|
||||
},
|
||||
{
|
||||
path: '/auditLog',
|
||||
component: resolve => require(['@/components/page/config/auditLog'], resolve)
|
||||
},
|
||||
{
|
||||
path: '/terminalSetting',
|
||||
component: resolve => require(['@/components/page/config/terminal'], resolve)
|
||||
|
||||
Reference in New Issue
Block a user