mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-07 22:16:16 +08:00
feat: 日志菜单样式调整 (#1106)
This commit is contained in:
parent
74cfc11a37
commit
a0a1cc410f
7 changed files with 63 additions and 23 deletions
|
@ -715,6 +715,7 @@ const message = {
|
||||||
emptyTerminal: 'No terminal is currently connected',
|
emptyTerminal: 'No terminal is currently connected',
|
||||||
},
|
},
|
||||||
logs: {
|
logs: {
|
||||||
|
panelLog: 'Panel logs',
|
||||||
operation: 'Operation logs',
|
operation: 'Operation logs',
|
||||||
login: 'Login logs',
|
login: 'Login logs',
|
||||||
system: 'System logs',
|
system: 'System logs',
|
||||||
|
|
|
@ -720,6 +720,7 @@ const message = {
|
||||||
emptyTerminal: '暂无终端连接',
|
emptyTerminal: '暂无终端连接',
|
||||||
},
|
},
|
||||||
logs: {
|
logs: {
|
||||||
|
panelLog: '面板日志',
|
||||||
operation: '操作日志',
|
operation: '操作日志',
|
||||||
login: '登录日志',
|
login: '登录日志',
|
||||||
loginIP: '登录 IP',
|
loginIP: '登录 IP',
|
||||||
|
|
|
@ -323,4 +323,9 @@
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-active-button {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
}
|
}
|
|
@ -14,17 +14,9 @@ import RouterButton from '@/components/router-button/index.vue';
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
label: i18n.global.t('logs.operation'),
|
label: i18n.global.t('logs.panelLog'),
|
||||||
path: '/logs/operation',
|
path: '/logs/operation',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: i18n.global.t('logs.login'),
|
|
||||||
path: '/logs/login',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: i18n.global.t('logs.system'),
|
|
||||||
path: '/logs/system',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: i18n.global.t('ssh.loginLogs'),
|
label: i18n.global.t('ssh.loginLogs'),
|
||||||
path: '/logs/ssh',
|
path: '/logs/ssh',
|
||||||
|
|
|
@ -4,8 +4,14 @@
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-button type="primary" plain @click="onClean()">
|
<el-button class="no-active-button" @click="onChangeRoute('OperationLog')">
|
||||||
{{ $t('logs.deleteLogs') }}
|
{{ $t('logs.operation') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="onChangeRoute('LoginLog')">
|
||||||
|
{{ $t('logs.login') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button class="no-active-button" @click="onChangeRoute('SystemLog')">
|
||||||
|
{{ $t('logs.system') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
@ -32,6 +38,9 @@
|
||||||
<el-option :label="$t('commons.status.success')" value="Success"></el-option>
|
<el-option :label="$t('commons.status.success')" value="Success"></el-option>
|
||||||
<el-option :label="$t('commons.status.failed')" value="Failed"></el-option>
|
<el-option :label="$t('commons.status.failed')" value="Failed"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<el-button type="primary" plain @click="onClean()" style="margin-left: 10px">
|
||||||
|
{{ $t('logs.deleteLogs') }}
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #main>
|
<template #main>
|
||||||
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search">
|
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search">
|
||||||
|
@ -73,6 +82,8 @@ import { cleanLogs, getLoginLogs } from '@/api/modules/log';
|
||||||
import { onMounted, reactive, ref } from '@vue/runtime-core';
|
import { onMounted, reactive, ref } from '@vue/runtime-core';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const loading = ref();
|
const loading = ref();
|
||||||
const data = ref();
|
const data = ref();
|
||||||
|
@ -104,6 +115,10 @@ const search = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onChangeRoute = async (addr: string) => {
|
||||||
|
router.push({ name: addr });
|
||||||
|
};
|
||||||
|
|
||||||
const onClean = async () => {
|
const onClean = async () => {
|
||||||
let params = {
|
let params = {
|
||||||
header: i18n.global.t('logs.deleteLogs'),
|
header: i18n.global.t('logs.deleteLogs'),
|
||||||
|
@ -123,13 +138,3 @@ onMounted(() => {
|
||||||
search();
|
search();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.pre {
|
|
||||||
white-space: pre-wrap;
|
|
||||||
white-space: -moz-pre-wrap;
|
|
||||||
white-space: -pre-wrap;
|
|
||||||
white-space: -o-pre-wrap;
|
|
||||||
word-wrap: break-word;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -4,8 +4,14 @@
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-button type="primary" plain @click="onClean()">
|
<el-button type="primary" @click="onChangeRoute('OperationLog')">
|
||||||
{{ $t('logs.deleteLogs') }}
|
{{ $t('logs.operation') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button class="no-active-button" @click="onChangeRoute('LoginLog')">
|
||||||
|
{{ $t('logs.login') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button class="no-active-button" @click="onChangeRoute('SystemLog')">
|
||||||
|
{{ $t('logs.system') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
@ -44,6 +50,9 @@
|
||||||
<el-option :label="$t('commons.status.success')" value="Success"></el-option>
|
<el-option :label="$t('commons.status.success')" value="Success"></el-option>
|
||||||
<el-option :label="$t('commons.status.failed')" value="Failed"></el-option>
|
<el-option :label="$t('commons.status.failed')" value="Failed"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
<el-button type="primary" style="margin-left: 10px" plain @click="onClean()">
|
||||||
|
{{ $t('logs.deleteLogs') }}
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #main>
|
<template #main>
|
||||||
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search">
|
<ComplexTable :pagination-config="paginationConfig" :data="data" @search="search">
|
||||||
|
@ -106,6 +115,8 @@ import { onMounted, reactive, ref } from '@vue/runtime-core';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { MsgSuccess } from '@/utils/message';
|
import { MsgSuccess } from '@/utils/message';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const loading = ref();
|
const loading = ref();
|
||||||
const data = ref();
|
const data = ref();
|
||||||
|
@ -155,6 +166,10 @@ const onClean = async () => {
|
||||||
confirmDialogRef.value!.acceptParams(params);
|
confirmDialogRef.value!.acceptParams(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onChangeRoute = async (addr: string) => {
|
||||||
|
router.push({ name: addr });
|
||||||
|
};
|
||||||
|
|
||||||
const loadDetail = (log: string) => {
|
const loadDetail = (log: string) => {
|
||||||
if (log.indexOf('[enable]') !== -1) {
|
if (log.indexOf('[enable]') !== -1) {
|
||||||
log = log.replace('[enable]', '[' + i18n.global.t('commons.button.enable') + ']');
|
log = log.replace('[enable]', '[' + i18n.global.t('commons.button.enable') + ']');
|
||||||
|
|
|
@ -1,6 +1,21 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<LayoutContent v-loading="loading" :title="$t('logs.system')">
|
<LayoutContent v-loading="loading" :title="$t('logs.system')">
|
||||||
|
<template #toolbar>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="16">
|
||||||
|
<el-button class="no-active-button" @click="onChangeRoute('OperationLog')">
|
||||||
|
{{ $t('logs.operation') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button class="no-active-button" @click="onChangeRoute('LoginLog')">
|
||||||
|
{{ $t('logs.login') }}
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="onChangeRoute('SystemLog')">
|
||||||
|
{{ $t('logs.system') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
<template #main>
|
<template #main>
|
||||||
<codemirror
|
<codemirror
|
||||||
:autofocus="true"
|
:autofocus="true"
|
||||||
|
@ -30,6 +45,8 @@ import { oneDark } from '@codemirror/theme-one-dark';
|
||||||
import { nextTick, onMounted, ref, shallowRef } from 'vue';
|
import { nextTick, onMounted, ref, shallowRef } from 'vue';
|
||||||
import { LoadFile } from '@/api/modules/files';
|
import { LoadFile } from '@/api/modules/files';
|
||||||
import { loadBaseDir } from '@/api/modules/setting';
|
import { loadBaseDir } from '@/api/modules/setting';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const loading = ref();
|
const loading = ref();
|
||||||
const extensions = [javascript(), oneDark];
|
const extensions = [javascript(), oneDark];
|
||||||
|
@ -59,6 +76,10 @@ const loadSystemlogs = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onChangeRoute = async (addr: string) => {
|
||||||
|
router.push({ name: addr });
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadSystemlogs();
|
loadSystemlogs();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue