1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-01 00:08:31 +09:00

コントロールパネルでログ見れるように

This commit is contained in:
syuilo 2021-05-11 14:31:20 +09:00
parent f24f7f14c3
commit 3461f0ffc9
2 changed files with 15 additions and 7 deletions

View File

@ -43,6 +43,7 @@
<FormGroup>
<template #label>{{ $ts.info }}</template>
<FormLink :active="page === 'database'" replace to="/instance/database"><template #icon><i class="fas fa-database"></i></template>{{ $ts.database }}</FormLink>
<FormLink :active="page === 'logs'" replace to="/instance/logs"><template #icon><i class="fas fa-stream"></i></template>{{ $ts.logs }}</FormLink>
</FormGroup>
</FormBase>
</div>
@ -105,6 +106,7 @@ export default defineComponent({
case 'announcements': return defineAsyncComponent(() => import('./announcements.vue'));
case 'ads': return defineAsyncComponent(() => import('./ads.vue'));
case 'database': return defineAsyncComponent(() => import('./database.vue'));
case 'logs': return defineAsyncComponent(() => import('./logs.vue'));
case 'abuses': return defineAsyncComponent(() => import('./abuses.vue'));
case 'settings': return defineAsyncComponent(() => import('./settings.vue'));
case 'files-settings': return defineAsyncComponent(() => import('./files-settings.vue'));

View File

@ -5,13 +5,13 @@
<span>{{ $ts.domain }}</span>
</MkInput>
<MkSelect v-model:value="logLevel">
<template #label>{{ $ts.level }}</template>
<option value="all">{{ $ts.levels.all }}</option>
<option value="info">{{ $ts.levels.info }}</option>
<option value="success">{{ $ts.levels.success }}</option>
<option value="warning">{{ $ts.levels.warning }}</option>
<option value="error">{{ $ts.levels.error }}</option>
<option value="debug">{{ $ts.levels.debug }}</option>
<template #label>Level</template>
<option value="all">All</option>
<option value="info">Info</option>
<option value="success">Success</option>
<option value="warning">Warning</option>
<option value="error">Error</option>
<option value="debug">Debug</option>
</MkSelect>
</div>
@ -45,6 +45,8 @@ export default defineComponent({
MkTextarea,
},
emits: ['info'],
data() {
return {
[symbols.PAGE_INFO]: {
@ -72,6 +74,10 @@ export default defineComponent({
this.fetchLogs();
},
mounted() {
this.$emit('info', this[symbols.PAGE_INFO]);
},
methods: {
fetchLogs() {
os.api('admin/logs', {