forked from MrBrax/LiveStreamDVR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move client settings, start files view
- Loading branch information
Showing
6 changed files
with
172 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<template> | ||
<div class="section-content"> | ||
<div class="control"> | ||
<label class="checkbox"><input type="checkbox" v-model="updateConfig.enableNotifications" /> Notifications</label> | ||
</div> | ||
<div class="control"> | ||
<label class="checkbox"><input type="checkbox" v-model="updateConfig.useSpeech" /> Use speech</label> | ||
</div> | ||
<div class="control"> | ||
<label class="checkbox"><input type="checkbox" v-model="updateConfig.singlePage" /> Separate channels to their own page</label> | ||
</div> | ||
<div class="control"> | ||
<label class="checkbox"><input type="checkbox" v-model="updateConfig.animationsEnabled" /> Enable animations</label> | ||
</div> | ||
<div class="control"> | ||
<label class="checkbox"><input type="checkbox" v-model="updateConfig.tooltipStatic" /> Static side menu tooltip</label> | ||
</div> | ||
<div class="control"> | ||
<label class="checkbox"><input type="checkbox" v-model="updateConfig.useRelativeTime" /> Use relative time</label> | ||
</div> | ||
<div class="control"> | ||
<label class="checkbox"><input type="checkbox" v-model="updateConfig.useWebsockets" /> Use websockets</label> | ||
</div> | ||
<div class="control"> | ||
<label class="checkbox"><input type="checkbox" v-model="updateConfig.useBackgroundRefresh" /> Background capturing vod refresh</label> | ||
</div> | ||
<div class="control"> | ||
<label class="checkbox"><input type="checkbox" v-model="updateConfig.useBackgroundTicker" /> Background ticker</label> | ||
</div> | ||
<div class="control"> | ||
<input type="text" class="input" v-model="updateConfig.websocketAddressOverride" placeholder="Websocket address override" /> | ||
</div> | ||
<div class="control"> | ||
<button class="button is-primary" @click="saveClientConfig">Save</button> | ||
</div> | ||
<br /> | ||
<div class="control"> | ||
<button class="button is-small" @click="requestNotifications">Request notification permissions</button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { useStore } from "@/store"; | ||
import { defineComponent } from "vue"; | ||
import { defaultConfig } from "@/defs"; | ||
export default defineComponent({ | ||
name: "ClientSettingsForm", | ||
title: "Client settings", | ||
setup() { | ||
const store = useStore(); | ||
return { store }; | ||
}, | ||
data() { | ||
return { | ||
currentConfig: Object.assign({}, defaultConfig), | ||
updateConfig: Object.assign({}, defaultConfig), | ||
}; | ||
}, | ||
created() { | ||
const crConf = Object.assign({}, defaultConfig); | ||
const currentConfig = localStorage.getItem("twitchautomator_config") ? JSON.parse(localStorage.getItem("twitchautomator_config") as string) : crConf; | ||
this.updateConfig = currentConfig; | ||
this.currentConfig = currentConfig; | ||
}, | ||
methods: { | ||
saveClientConfig() { | ||
localStorage.setItem("twitchautomator_config", JSON.stringify(this.updateConfig)); | ||
if (this.currentConfig.enableNotifications !== this.updateConfig.enableNotifications && this.updateConfig.enableNotifications) { | ||
this.requestNotifications(); | ||
} | ||
this.store.updateClientConfig(this.updateConfig); | ||
alert("Settings saved, reloading..."); | ||
window.location.reload(); | ||
}, | ||
requestNotifications() { | ||
if (!("Notification" in window)) { | ||
alert("This browser does not support desktop notification"); | ||
} else if (Notification.permission === "granted") { | ||
// const notification = new Notification("Notifications already granted."); | ||
} else if (Notification.permission !== "denied") { | ||
Notification.requestPermission().then(function (permission) { | ||
if (permission === "granted") { | ||
new Notification("Notifications granted."); | ||
} | ||
}); | ||
} | ||
}, | ||
}, | ||
/* | ||
watch: { | ||
updateConfig: { | ||
handler() { | ||
this.saveClientConfig(); | ||
}, | ||
deep: true, | ||
}, | ||
}, | ||
*/ | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<template> | ||
<div class="container"> | ||
<section class="section"> | ||
<div class="section-title"><h1>Clips</h1></div> | ||
<div class="section-content"> | ||
</div> | ||
</section> | ||
<section class="section"> | ||
<div class="section-title"><h1>VODs</h1></div> | ||
<div class="section-content"> | ||
</div> | ||
</section> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { useStore } from "@/store"; | ||
import { defineComponent } from "vue"; | ||
// import { library } from "@fortawesome/fontawesome-svg-core"; | ||
// import { faSkull, faTrash } from "@fortawesome/free-solid-svg-icons"; | ||
// import { useStore } from "@/store"; | ||
// import { JobStatus } from "@common/Defs"; | ||
// library.add(faSkull, faTrash); | ||
export default defineComponent({ | ||
name: "FilesView", | ||
title: "Files", | ||
setup() { | ||
const store = useStore(); | ||
return { store }; | ||
}, | ||
data() { | ||
}, | ||
created() { | ||
}, | ||
methods: { | ||
}, | ||
components: { | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters