mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-01 03:24:14 +08:00
fix: 解决网站日志清空页面没有刷新的问题 (#3645)
This commit is contained in:
parent
5152e7b8d5
commit
f5bf111203
@ -247,6 +247,10 @@ const init = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const clearLog = (): void => {
|
||||||
|
content.value = '';
|
||||||
|
};
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
onCloseLog();
|
onCloseLog();
|
||||||
});
|
});
|
||||||
@ -255,5 +259,5 @@ onMounted(() => {
|
|||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({ changeTail, onDownload });
|
defineExpose({ changeTail, onDownload, clearLog });
|
||||||
</script>
|
</script>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<el-switch v-model="data.enable" @change="updateEnable"></el-switch>
|
<el-switch v-model="data.enable" @change="updateEnable"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<LogFile :config="{ id: id, type: 'website', name: logType }" :style="style">
|
<LogFile :config="{ id: id, type: 'website', name: logType }" :style="style" ref="logRef">
|
||||||
<template #button>
|
<template #button>
|
||||||
<el-button @click="cleanLog" icon="Delete">
|
<el-button @click="cleanLog" icon="Delete">
|
||||||
{{ $t('commons.button.clean') }}
|
{{ $t('commons.button.clean') }}
|
||||||
@ -13,7 +13,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</LogFile>
|
</LogFile>
|
||||||
</div>
|
</div>
|
||||||
<OpDialog ref="opRef" />
|
<OpDialog ref="opRef" @search="clearLog" />
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
@ -46,6 +46,7 @@ const data = ref({
|
|||||||
path: '',
|
path: '',
|
||||||
});
|
});
|
||||||
const opRef = ref();
|
const opRef = ref();
|
||||||
|
const logRef = ref();
|
||||||
|
|
||||||
const updateEnable = () => {
|
const updateEnable = () => {
|
||||||
const operate = data.value.enable ? 'enable' : 'disable';
|
const operate = data.value.enable ? 'enable' : 'disable';
|
||||||
@ -64,6 +65,10 @@ const updateEnable = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const clearLog = () => {
|
||||||
|
logRef.value.clearLog();
|
||||||
|
};
|
||||||
|
|
||||||
const cleanLog = async () => {
|
const cleanLog = async () => {
|
||||||
let log = logType.value === 'access.log' ? i18n.global.t('website.accessLog') : i18n.global.t('website.errLog');
|
let log = logType.value === 'access.log' ? i18n.global.t('website.accessLog') : i18n.global.t('website.errLog');
|
||||||
opRef.value.acceptParams({
|
opRef.value.acceptParams({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user