|
|
@ -16,22 +16,22 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
import { useI18n } from 'vue-i18n' |
|
|
|
import { useI18n } from 'vue-i18n' |
|
|
|
import { NSelect, NSpace } from 'naive-ui' |
|
|
|
import { NSelect, NSpace, NSwitch } from 'naive-ui' |
|
|
|
import { defineComponent } from 'vue' |
|
|
|
import { defineComponent } from 'vue' |
|
|
|
import { useLogTimerStore } from '@/store/logTimer/logTimer' |
|
|
|
import { useUISettingStore } from '@/store/ui-setting/ui-setting' |
|
|
|
import Card from '@/components/card' |
|
|
|
import Card from '@/components/card' |
|
|
|
|
|
|
|
|
|
|
|
// Update LogTimer store when select value is updated
|
|
|
|
// Update LogTimer store when select value is updated
|
|
|
|
const handleUpdateValue = (logTimer: number) => { |
|
|
|
const handleUpdateValue = (logTimer: number) => { |
|
|
|
const logTimerStore = useLogTimerStore() |
|
|
|
const uiSettingStore = useUISettingStore() |
|
|
|
logTimerStore.setLogTimer(logTimer) |
|
|
|
uiSettingStore.setLogTimer(logTimer) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const setting = defineComponent({ |
|
|
|
const setting = defineComponent({ |
|
|
|
name: 'ui-setting', |
|
|
|
name: 'ui-setting', |
|
|
|
setup() { |
|
|
|
setup() { |
|
|
|
const logTimerStore = useLogTimerStore() |
|
|
|
const uiSettingStore = useUISettingStore() |
|
|
|
const defaultLogTimer = logTimerStore.getLogTimer |
|
|
|
const defaultLogTimer = uiSettingStore.getLogTimer |
|
|
|
|
|
|
|
|
|
|
|
const logTimerMap = { |
|
|
|
const logTimerMap = { |
|
|
|
0: 'Off', |
|
|
|
0: 'Off', |
|
|
@ -75,8 +75,9 @@ const setting = defineComponent({ |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Card style={{ marginLeft: '25%', width: '50%' }} title={t('menu.ui_setting')}> |
|
|
|
<Card style={{ marginLeft: '25%', width: '50%' }} title={t('menu.ui_setting')}> |
|
|
|
|
|
|
|
<h4>{t('ui_setting.request_settings')}</h4> |
|
|
|
<NSpace align='center' justify='space-between'> |
|
|
|
<NSpace align='center' justify='space-between'> |
|
|
|
<span>{t('ui_setting.log.refresh_time')}</span> |
|
|
|
<span>{t('ui_setting.refresh_time')}</span> |
|
|
|
<NSelect |
|
|
|
<NSelect |
|
|
|
style={{ width: '200px' }} |
|
|
|
style={{ width: '200px' }} |
|
|
|
default-value={this.logTimerMap[this.defaultLogTimer]} |
|
|
|
default-value={this.logTimerMap[this.defaultLogTimer]} |
|
|
@ -84,6 +85,11 @@ const setting = defineComponent({ |
|
|
|
onUpdateValue={handleUpdateValue} |
|
|
|
onUpdateValue={handleUpdateValue} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</NSpace> |
|
|
|
</NSpace> |
|
|
|
|
|
|
|
<h4>{t('ui_setting.experimental_feature')}</h4> |
|
|
|
|
|
|
|
<NSpace align='center' justify='space-between'> |
|
|
|
|
|
|
|
<span>{t('ui_setting.dynamic_task_component')}</span> |
|
|
|
|
|
|
|
<NSwitch round={false}></NSwitch> |
|
|
|
|
|
|
|
</NSpace> |
|
|
|
</Card> |
|
|
|
</Card> |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|