ADD: Idle timeout setting
This commit is contained in:
@@ -63,6 +63,17 @@
|
|||||||
</p>
|
</p>
|
||||||
<MenubarShortcut>⌘R</MenubarShortcut>
|
<MenubarShortcut>⌘R</MenubarShortcut>
|
||||||
</MenubarItem>
|
</MenubarItem>
|
||||||
|
<MenubarItem class="flex justify-between" @click="deviceStore.cycleIdleTimeout">
|
||||||
|
<p>Idle Timeout: </p>
|
||||||
|
<p>
|
||||||
|
{{
|
||||||
|
deviceStore.settings?.idleTimeout
|
||||||
|
? `${Math.round(deviceStore.settings.idleTimeout / 1000)}s`
|
||||||
|
: 'Off'
|
||||||
|
}}
|
||||||
|
</p>
|
||||||
|
<MenubarShortcut>⌘R</MenubarShortcut>
|
||||||
|
</MenubarItem>
|
||||||
<MenubarSeparator />
|
<MenubarSeparator />
|
||||||
<MenubarItem class="flex justify-between" @click="appStore.switchPreviewDeviceModel">
|
<MenubarItem class="flex justify-between" @click="appStore.switchPreviewDeviceModel">
|
||||||
<p>Skin: </p>
|
<p>Skin: </p>
|
||||||
|
|||||||
@@ -382,6 +382,17 @@ export const useDeviceStore = defineStore('device', {
|
|||||||
this.setDirtyState(true)
|
this.setDirtyState(true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
cycleIdleTimeout() {
|
||||||
|
if (this.settings!.idleTimeout === 0) {
|
||||||
|
this.setIdleTimeout(10)
|
||||||
|
} else if (this.settings!.idleTimeout === 10) {
|
||||||
|
this.setIdleTimeout(30)
|
||||||
|
} else if (this.settings!.idleTimeout === 30) {
|
||||||
|
this.setIdleTimeout(60)
|
||||||
|
} else {
|
||||||
|
this.setIdleTimeout(0)
|
||||||
|
}
|
||||||
|
},
|
||||||
setPosition(position: number) {
|
setPosition(position: number) {
|
||||||
this.position = position
|
this.position = position
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user