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:
parent
9bfc159e9e
commit
745d87a6d3
@ -21,6 +21,8 @@ export namespace Website {
|
||||
user: string;
|
||||
group: string;
|
||||
IPV6: boolean;
|
||||
accessLog?: boolean;
|
||||
errorLog?: boolean;
|
||||
}
|
||||
|
||||
export interface WebsiteDTO extends Website {
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user