1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 解决网站日志开启关闭失败的问题 (#3285)

This commit is contained in:
zhengkunwang 2023-12-12 15:16:08 +08:00 committed by GitHub
parent 9bfc159e9e
commit 745d87a6d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -21,6 +21,8 @@ export namespace Website {
user: string;
group: string;
IPV6: boolean;
accessLog?: boolean;
errorLog?: boolean;
}
export interface WebsiteDTO extends Website {

View File

@ -16,8 +16,8 @@
<OpDialog ref="opRef" />
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue';
import { OpWebsiteLog } from '@/api/modules/website';
import { computed, onMounted, ref } from 'vue';
import { GetWebsite, OpWebsiteLog } from '@/api/modules/website';
import i18n from '@/lang';
import LogFile from '@/components/log-file/index.vue';
import { MsgSuccess } from '@/utils/message';
@ -74,4 +74,20 @@ const cleanLog = async () => {
params: { id: id.value, operate: 'delete', logType: logType.value },
});
};
const getWebsite = async () => {
try {
const res = await GetWebsite(props.id);
if (props.logType === 'access.log') {
data.value.enable = res.data.accessLog;
}
if (props.logType === 'error.log') {
data.value.enable = res.data.errorLog;
}
} catch (error) {}
};
onMounted(() => {
getWebsite();
});
</script>