Settings page is now on some baseline of "works", but needs some minor touch-ups
This commit is contained in:
parent
a8847bdeff
commit
fcfc0361dc
@ -78,6 +78,7 @@
|
|||||||
:settings="settings"
|
:settings="settings"
|
||||||
:siteSettings="selectedSiteSettings"
|
:siteSettings="selectedSiteSettings"
|
||||||
:isDefaultConfiguration="selectedSite === '@global'"
|
:isDefaultConfiguration="selectedSite === '@global'"
|
||||||
|
:visibleSegments="{advancedPlayerSettings: role === 'settings'}"
|
||||||
></SiteExtensionSettings>
|
></SiteExtensionSettings>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -98,6 +99,7 @@ export default {
|
|||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
'settings',
|
'settings',
|
||||||
|
'role',
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
SiteExtensionSettings,
|
SiteExtensionSettings,
|
||||||
|
|||||||
@ -115,8 +115,8 @@
|
|||||||
|
|
||||||
<OtherSiteSettings
|
<OtherSiteSettings
|
||||||
v-if="selectedTab === 'website-extension-settings'"
|
v-if="selectedTab === 'website-extension-settings'"
|
||||||
|
:role="role"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
:enableSettingsEditor="true"
|
|
||||||
></OtherSiteSettings>
|
></OtherSiteSettings>
|
||||||
|
|
||||||
<PlayerElementSettings
|
<PlayerElementSettings
|
||||||
@ -230,8 +230,6 @@ const AVAILABLE_TABS = {
|
|||||||
{ id: 'website-extension-settings', label: 'Website exceptions', },
|
{ id: 'website-extension-settings', label: 'Website exceptions', },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
'siteSettings': {id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs' },
|
|
||||||
'settings.player-element-settings': { id: 'settings.player-element-settings', label: 'Advanced video player options', icon: 'play-box-edit-outline' },
|
|
||||||
'window.player-element-settings': { id: 'window.player-element-settings', label: 'Advanced video player options', icon: 'play-box-edit-outline' },
|
'window.player-element-settings': { id: 'window.player-element-settings', label: 'Advanced video player options', icon: 'play-box-edit-outline' },
|
||||||
'autodetectionSettings': {id: 'autodetectionSettings', label: 'Autodetection options', icon: 'auto-fix'},
|
'autodetectionSettings': {id: 'autodetectionSettings', label: 'Autodetection options', icon: 'auto-fix'},
|
||||||
'ui-settings': {id: 'ui-settings', label: 'UI settings', icon: 'movie-cog-outline' },
|
'ui-settings': {id: 'ui-settings', label: 'UI settings', icon: 'movie-cog-outline' },
|
||||||
@ -275,6 +273,12 @@ const TAB_LOADOUT = {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const DEFAULT_TABS = {
|
||||||
|
settings: 'default-extension-settings',
|
||||||
|
updated: 'updated',
|
||||||
|
popup: 'video-settings',
|
||||||
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
VideoSettings,
|
VideoSettings,
|
||||||
@ -304,7 +308,7 @@ export default defineComponent({
|
|||||||
tabs: [
|
tabs: [
|
||||||
|
|
||||||
],
|
],
|
||||||
selectedTab: 'extensionSettings',
|
selectedTab: undefined,
|
||||||
BrowserDetect: BrowserDetect,
|
BrowserDetect: BrowserDetect,
|
||||||
preventClose: false,
|
preventClose: false,
|
||||||
siteSettings: null,
|
siteSettings: null,
|
||||||
@ -408,6 +412,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.tabs = tabs;
|
this.tabs = tabs;
|
||||||
|
this.selectedTab = this.selectedTab ?? DEFAULT_TABS[this.role];
|
||||||
},
|
},
|
||||||
setInitialPath(path: string[] = this.initialPath) {
|
setInitialPath(path: string[] = this.initialPath) {
|
||||||
console.log('setting initial path:', this.initialPath)
|
console.log('setting initial path:', this.initialPath)
|
||||||
|
|||||||
@ -50,6 +50,7 @@
|
|||||||
<template v-if="tab === 'otherSites'">
|
<template v-if="tab === 'otherSites'">
|
||||||
<OtherSiteSettings
|
<OtherSiteSettings
|
||||||
v-if="settings"
|
v-if="settings"
|
||||||
|
:role="role"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
>
|
>
|
||||||
</OtherSiteSettings>
|
</OtherSiteSettings>
|
||||||
@ -174,6 +175,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mixins: [],
|
mixins: [],
|
||||||
props: [
|
props: [
|
||||||
|
'role',
|
||||||
'settings',
|
'settings',
|
||||||
'site',
|
'site',
|
||||||
'enableSettingsEditor',
|
'enableSettingsEditor',
|
||||||
|
|||||||
@ -43,6 +43,7 @@
|
|||||||
:settings="settings"
|
:settings="settings"
|
||||||
:siteSettings="selectedSiteSettings"
|
:siteSettings="selectedSiteSettings"
|
||||||
:isDefaultConfiguration="selectedSite === '@global'"
|
:isDefaultConfiguration="selectedSite === '@global'"
|
||||||
|
:visibleSegments="{advancedPlayerSettings: role === 'settings'}"
|
||||||
></SiteExtensionSettings>
|
></SiteExtensionSettings>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -63,6 +64,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
|
'role',
|
||||||
'settings',
|
'settings',
|
||||||
'isCompact',
|
'isCompact',
|
||||||
],
|
],
|
||||||
|
|||||||
@ -317,10 +317,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-4">
|
<div v-if="visibleSegments?.advancedPlayerSettings" class="mt-4">
|
||||||
<h4 class="mt-4 text-primary-400 text-[1.125em] font-bold mb-2">Other options</h4>
|
<h4 class="mt-4 text-primary-400 text-[1.125em] font-bold mb-2">Other options</h4>
|
||||||
<button @click="playerDetectionOptionsDialog.visible = true">Advanced video player options</button>
|
<button @click="playerDetectionOptionsDialog.visible = true">Advanced video player options</button>
|
||||||
<p>{{playerDetectionOptionsDialog.visible}}</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -328,13 +327,13 @@
|
|||||||
<Popup
|
<Popup
|
||||||
v-if="playerDetectionOptionsDialog.visible"
|
v-if="playerDetectionOptionsDialog.visible"
|
||||||
title="Player detection options"
|
title="Player detection options"
|
||||||
confirmButtonText="Save"
|
:clientSideButtons="true"
|
||||||
cancelButtonText="Cancel"
|
|
||||||
@onCancel="playerDetectionOptionsDialog.visible = false"
|
|
||||||
>
|
>
|
||||||
<PlayerSelectorAdvancedForm
|
<PlayerSelectorAdvancedForm
|
||||||
|
role="popup"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
:siteSettings="siteSettings"
|
:siteSettings="siteSettings"
|
||||||
|
@close="playerDetectionOptionsDialog.visible = false"
|
||||||
></PlayerSelectorAdvancedForm>
|
></PlayerSelectorAdvancedForm>
|
||||||
</Popup>
|
</Popup>
|
||||||
</template>
|
</template>
|
||||||
@ -361,6 +360,7 @@ export default defineComponent({
|
|||||||
'siteSettings',
|
'siteSettings',
|
||||||
'isDefaultConfiguration',
|
'isDefaultConfiguration',
|
||||||
'showPlayerSettings',
|
'showPlayerSettings',
|
||||||
|
'visibleSegments', // object of {[segment: string]: true}
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -148,7 +148,7 @@
|
|||||||
<div class="w-full flex flex-row gap-2 justify-end">
|
<div class="w-full flex flex-row gap-2 justify-end">
|
||||||
<button @click="openSaveAsDialog()">Save as</button>
|
<button @click="openSaveAsDialog()">Save as</button>
|
||||||
<button :disabled="!siteSettings.raw.DOMConfig?.[DOMConfigName] || DOMConfigName?.startsWith('@')">Save</button>
|
<button :disabled="!siteSettings.raw.DOMConfig?.[DOMConfigName] || DOMConfigName?.startsWith('@')">Save</button>
|
||||||
<button @click="closeForm()">Close</button>
|
<button v-if="role === 'popup'" @click="closeForm()">Close</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- PRESET SELECT DIALOG -->
|
<!-- PRESET SELECT DIALOG -->
|
||||||
@ -317,6 +317,7 @@ export default({
|
|||||||
ConfirmButton,
|
ConfirmButton,
|
||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
|
'role',
|
||||||
'settings',
|
'settings',
|
||||||
'siteSettings'
|
'siteSettings'
|
||||||
],
|
],
|
||||||
@ -352,16 +353,16 @@ export default({
|
|||||||
this.DOMConfigName = configKey;
|
this.DOMConfigName = configKey;
|
||||||
|
|
||||||
if (!DOMConfigData.elements) {
|
if (!DOMConfigData.elements) {
|
||||||
DOMConfigData.elements = _cp(siteSettings.blankSettings.DOMConfig.empty);
|
DOMConfigData.elements = _cp(siteSettings.blankSettings.DOMConfig['@empty']);
|
||||||
}
|
}
|
||||||
if (!DOMConfigData.elements.player) {
|
if (!DOMConfigData.elements.player) {
|
||||||
DOMConfigData.elements.player = _cp(siteSettings.blankSettings.DOMConfig.empty.elements.player);
|
DOMConfigData.elements.player = _cp(siteSettings.blankSettings.DOMConfig['@empty'].elements.player);
|
||||||
}
|
}
|
||||||
if (!DOMConfigData.elements.video) {
|
if (!DOMConfigData.elements.video) {
|
||||||
DOMConfigData.elements.video = _cp(siteSettings.blankSettings.DOMConfig.empty.elements.video);
|
DOMConfigData.elements.video = _cp(siteSettings.blankSettings.DOMConfig['@empty'].elements.video);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DOMConfigData = _cp(siteSettings.blankSettings.DOMConfig.empty)
|
DOMConfigData = _cp(siteSettings.blankSettings.DOMConfig['@empty'])
|
||||||
}
|
}
|
||||||
this.DOMConfigData = DOMConfigData;
|
this.DOMConfigData = DOMConfigData;
|
||||||
|
|
||||||
@ -369,7 +370,6 @@ export default({
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
openSelectSnapshotDialog() {
|
openSelectSnapshotDialog() {
|
||||||
this.selectSnapshotDialog = {
|
this.selectSnapshotDialog = {
|
||||||
visible: true
|
visible: true
|
||||||
@ -478,6 +478,10 @@ export default({
|
|||||||
this.siteSettings.raw.activeDOMConfig = this.DOMConfigName;
|
this.siteSettings.raw.activeDOMConfig = this.DOMConfigName;
|
||||||
this.saveAsDialog = {visible: false};
|
this.saveAsDialog = {visible: false};
|
||||||
await this.settings.save();
|
await this.settings.save();
|
||||||
|
},
|
||||||
|
|
||||||
|
closeForm() {
|
||||||
|
this.$emit('close');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,19 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col relative w-full">
|
<div class="flex flex-col relative w-full">
|
||||||
|
|
||||||
<h2 class="text-[1.75em]">Player UI options</h2>
|
<h2 class="text-[1.75em]">Player UI options</h2>
|
||||||
|
|
||||||
<!-- The rest of the tab is under 'edit ratios and shortcuts' row -->
|
<!-- The rest of the tab is under 'edit ratios and shortcuts' row -->
|
||||||
<div class="flex flex-col" style="width: 100%">
|
<div v-if="settings" class="flex flex-col" style="width: 100%">
|
||||||
|
|
||||||
<div class="flex flex-col compact-form">
|
<div class="flex flex-col compact-form">
|
||||||
<div v-if="!siteSettings.data.enableUI.fullscreen">
|
|
||||||
UI is disabled for this site.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="flex flex-col field-group compact-form"
|
class="flex flex-col field-group compact-form"
|
||||||
:class="{disabled: !siteSettings.data.enableUI.fullscreen}"
|
|
||||||
>
|
>
|
||||||
<div class="field disabled">
|
<div class="field disabled">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
@ -107,6 +101,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
Loading settings ...
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user