diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-08-14 18:36:22 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-08-14 18:36:22 +0900 |
| commit | f95d5701a22757f73ddb3e56cc99153de4146be5 (patch) | |
| tree | b47eded7d8a9c9341bf0d072569356bba9f37265 /src/client/widgets | |
| parent | add sound (diff) | |
| download | sharkey-f95d5701a22757f73ddb3e56cc99153de4146be5.tar.gz sharkey-f95d5701a22757f73ddb3e56cc99153de4146be5.tar.bz2 sharkey-f95d5701a22757f73ddb3e56cc99153de4146be5.zip | |
feat(client): ジョブキューウィジェットに警報音を鳴らす設定を追加
Diffstat (limited to 'src/client/widgets')
| -rw-r--r-- | src/client/widgets/job-queue.vue | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/widgets/job-queue.vue b/src/client/widgets/job-queue.vue index beb80f7faf..327d8ede6d 100644 --- a/src/client/widgets/job-queue.vue +++ b/src/client/widgets/job-queue.vue @@ -50,6 +50,7 @@ import { defineComponent, markRaw } from 'vue'; import define from './define'; import * as os from '@client/os'; import number from '@client/filters/number'; +import * as sound from '@client/scripts/sound'; const widget = define({ name: 'jobQueue', @@ -58,6 +59,10 @@ const widget = define({ type: 'boolean', default: false, }, + sound: { + type: 'boolean', + default: false, + }, }) }); @@ -79,6 +84,7 @@ export default defineComponent({ delayed: 0, }, prev: {}, + sound: sound.setVolume(sound.getAudio('syuilo/queue-jammed'), 1) }; }, created() { @@ -107,6 +113,10 @@ export default defineComponent({ this[domain].active = stats[domain].active; this[domain].waiting = stats[domain].waiting; this[domain].delayed = stats[domain].delayed; + + if (this[domain].waiting > 0 && this.props.sound && this.sound.paused) { + this.sound.play(); + } } }, |