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

pull/3288/head
zhengkunwang 12 months ago committed by GitHub
parent 9bfc159e9e
commit 745d87a6d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -16,8 +16,8 @@
<OpDialog ref="opRef" /> <OpDialog ref="opRef" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from 'vue'; import { computed, onMounted, ref } from 'vue';
import { OpWebsiteLog } from '@/api/modules/website'; import { GetWebsite, OpWebsiteLog } from '@/api/modules/website';
import i18n from '@/lang'; import i18n from '@/lang';
import LogFile from '@/components/log-file/index.vue'; import LogFile from '@/components/log-file/index.vue';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
@ -74,4 +74,20 @@ const cleanLog = async () => {
params: { id: id.value, operate: 'delete', logType: logType.value }, 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> </script>

Loading…
Cancel
Save