Mass Composition-API-ification and Gettext clarification.

This commit is contained in:
Buster Neece 2022-12-26 00:50:50 -06:00
parent d2cb74095a
commit f46ff95928
No known key found for this signature in database
GPG Key ID: F1D2E64A0005E80E
56 changed files with 360 additions and 661 deletions

View File

@ -1,12 +0,0 @@
import {ref} from "vue";
import {cloneDeep} from "lodash";
export function useResettableForm(blankForm) {
const form = ref(cloneDeep(blankForm));
const resetForm = () => {
form.value = cloneDeep(blankForm);
}
return {form, resetForm};
}

View File

@ -1,14 +1,14 @@
import useVuelidate from "@vuelidate/core"; import useVuelidate from "@vuelidate/core";
import {useResettableForm} from "~/components/Form/UseResettableForm"; import {useResettableRef} from "~/functions/useResettableRef";
export function useVuelidateOnForm(validations, blankForm, options = {}) { export function useVuelidateOnForm(validations, blankForm, options = {}) {
const {form, resetForm: parentResetForm} = useResettableForm(blankForm); const {record: form, reset} = useResettableRef(blankForm);
const v$ = useVuelidate(validations, form, options); const v$ = useVuelidate(validations, form, options);
const resetForm = () => { const resetForm = () => {
v$.value.$reset(); v$.value.$reset();
parentResetForm(); reset();
} }
return { return {

View File

@ -18,7 +18,7 @@
<form id="recover-form" class="form vue-form" action="" method="post"> <form id="recover-form" class="form vue-form" action="" method="post">
<input type="hidden" name="csrf" :value="csrf"/> <input type="hidden" name="csrf" :value="csrf"/>
<b-wrapped-form-group id="password" name="password" label-class="mb-2" :field="v$.form.password" <b-wrapped-form-group id="password" name="password" label-class="mb-2" :field="v$.password"
input-type="password"> input-type="password">
<template #label> <template #label>
<icon icon="vpn_key" class="mr-1"></icon> <icon icon="vpn_key" class="mr-1"></icon>
@ -26,7 +26,7 @@
</template> </template>
</b-wrapped-form-group> </b-wrapped-form-group>
<b-button type="submit" size="lg" block variant="primary" :disabled="v$.form.$invalid" <b-button type="submit" size="lg" block variant="primary" :disabled="v$.$invalid"
class="mt-2"> class="mt-2">
{{ $gettext('Recover Account') }} {{ $gettext('Recover Account') }}
</b-button> </b-button>
@ -36,36 +36,24 @@
</div> </div>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import Icon from "~/components/Common/Icon"; import Icon from "~/components/Common/Icon";
import validatePassword from '~/functions/validatePassword.js'; import validatePassword from '~/functions/validatePassword.js';
import useVuelidate from "@vuelidate/core";
import {required} from '@vuelidate/validators'; import {required} from '@vuelidate/validators';
import {useVuelidateOnForm} from "~/components/Form/useVuelidateOnForm";
export default { const props = defineProps({
name: 'SetupRegister', csrf: String,
components: {Icon, BWrappedFormGroup}, error: String,
setup() { });
return {v$: useVuelidate()}
const {form, v$} = useVuelidateOnForm(
{
password: {required, validatePassword}
}, },
props: { {
csrf: String, password: null,
error: String,
},
validations() {
return {
form: {
password: {required, validatePassword}
}
}
},
data() {
return {
form: {
password: null,
}
}
} }
} )
</script> </script>

View File

@ -60,7 +60,7 @@
</section> </section>
</div> </div>
<b-modal id="import_modal" ref="modal" :title="langModalTitle"> <b-modal id="import_modal" ref="modal" :title="$gettext('Import Results')">
<div> <div>
<p class="card-text">{{ importResults.message }}</p> <p class="card-text">{{ importResults.message }}</p>
@ -124,11 +124,6 @@ export default {
importResults: {}, importResults: {},
}; };
}, },
computed: {
langModalTitle() {
return this.$gettext('Import Results');
}
},
methods: { methods: {
doSubmit() { doSubmit() {
let formData = new FormData(); let formData = new FormData();

View File

@ -20,7 +20,7 @@
{{ $gettext('Select Custom Fallback File') }} {{ $gettext('Select Custom Fallback File') }}
</template> </template>
<flow-upload :target-url="apiUrl" :valid-mime-types="acceptMimeTypes" <flow-upload :target-url="apiUrl" :valid-mime-types="['audio/*']"
@success="onFileSuccess"></flow-upload> @success="onFileSuccess"></flow-upload>
</b-form-group> </b-form-group>
@ -50,32 +50,28 @@
</section> </section>
</template> </template>
<script> <script setup>
import FlowUpload from '~/components/Common/FlowUpload'; import FlowUpload from '~/components/Common/FlowUpload';
import InfoCard from "~/components/Common/InfoCard"; import InfoCard from "~/components/Common/InfoCard";
import {ref} from "vue";
import {useAxios} from "~/vendor/axios";
export default { const props = defineProps({
name: 'StationsFallback', apiUrl: String,
components: {InfoCard, FlowUpload}, recordHasFallback: Boolean
props: { });
apiUrl: String,
recordHasFallback: Boolean const hasFallback = ref(props.recordHasFallback);
},
data() { const onFileSuccess = () => {
return { hasFallback.value = true;
hasFallback: this.recordHasFallback,
acceptMimeTypes: ['audio/*']
};
},
methods: {
onFileSuccess() {
this.hasFallback = true;
},
deleteFallback() {
this.axios.delete(this.apiUrl).then(() => {
this.hasFallback = false;
});
}
}
}; };
const {axios} = useAxios();
const deleteFallback = () => {
axios.delete(props.apiUrl).then(() => {
hasFallback.value = false;
});
}
</script> </script>

View File

@ -47,21 +47,19 @@
</div> </div>
</template> </template>
<script> <script setup>
import Icon from "~/components/Common/Icon"; import Icon from "~/components/Common/Icon";
import StreamingLogModal from "~/components/Common/StreamingLogModal"; import StreamingLogModal from "~/components/Common/StreamingLogModal";
import LogList from "~/components/Common/LogList"; import LogList from "~/components/Common/LogList";
import {ref} from "vue";
export default { const props = defineProps({
name: 'StationsHelp', logsUrl: String,
components: {LogList, StreamingLogModal, Icon}, });
props: {
logsUrl: String, const modal = ref(); // BModal
},
methods: { const viewLog = (url) => {
viewLog(url) { modal.value?.show(url);
this.$refs.modal.show(url); };
}
}
}
</script> </script>

View File

@ -1,35 +1,44 @@
<template> <template>
<modal-form ref="modal" :loading="loading" :title="langTitle" :error="error" :disable-save-button="v$.form.$invalid" <modal-form ref="modal" :loading="loading" :title="langTitle" :error="error" :disable-save-button="v$.$invalid"
@submit="doSubmit" @hidden="clearContents"> @submit="doSubmit" @hidden="clearContents">
<b-tabs content-class="mt-3" pills> <b-tabs content-class="mt-3" pills>
<form-basic-info :form="v$.form"></form-basic-info> <form-basic-info :form="v$"></form-basic-info>
</b-tabs> </b-tabs>
</modal-form> </modal-form>
</template> </template>
<script> <script>
import {required} from '@vuelidate/validators'; import {required} from '@vuelidate/validators';
import BaseEditModal from '~/components/Common/BaseEditModal'; import BaseEditModal from '~/components/Common/BaseEditModal';
import FormBasicInfo from './Form/BasicInfo'; import FormBasicInfo from './Form/BasicInfo';
import mergeExisting from "~/functions/mergeExisting"; import mergeExisting from "~/functions/mergeExisting";
import useVuelidate from "@vuelidate/core"; import {useVuelidateOnForm} from "~/components/Form/UseVuelidateOnForm";
export default { export default {
name: 'EditModal', name: 'EditModal',
emits: ['needs-restart'], emits: ['needs-restart'],
setup() { setup() {
return {v$: useVuelidate()} const {form, resetForm, v$} = useVuelidateOnForm(
}, {
mixins: [BaseEditModal],
components: {FormBasicInfo},
validations() {
return {
form: {
name: {required}, name: {required},
format: {required}, format: {required},
bitrate: {required} bitrate: {required}
},
{
name: null,
format: 'aac',
bitrate: 128
} }
}; );
return {
form,
resetForm,
v$
}
}, },
mixins: [BaseEditModal],
components: {FormBasicInfo},
computed: { computed: {
langTitle() { langTitle() {
return this.isEditMode return this.isEditMode
@ -38,13 +47,6 @@ export default {
} }
}, },
methods: { methods: {
resetForm() {
this.form = {
name: null,
format: 'aac',
bitrate: 128
};
},
populateForm(d) { populateForm(d) {
this.record = d; this.record = d;
this.form = mergeExisting(this.form, d); this.form = mergeExisting(this.form, d);

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle" active> <b-tab :title="$gettext('Basic Info')" active>
<b-form-group> <b-form-group>
<div class="form-row mb-3"> <div class="form-row mb-3">
<b-wrapped-form-group class="col-md-12" id="edit_form_name" :field="form.name"> <b-wrapped-form-group class="col-md-12" id="edit_form_name" :field="form.name">
@ -46,39 +46,29 @@
</b-tab> </b-tab>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import BWrappedFormCheckbox from "~/components/Form/BWrappedFormCheckbox"; import {map} from "lodash";
export default { const props = defineProps({
name: 'HlsStreamFormBasicInfo', form: Object,
components: {BWrappedFormCheckbox, BWrappedFormGroup}, stationFrontendType: String
props: { });
form: Object,
stationFrontendType: String const formatOptions = [
}, {
computed: { value: 'aac',
langTabTitle() { text: 'AAC'
return this.$gettext('Basic Info');
},
formatOptions() {
return [
{
value: 'aac',
text: 'AAC'
}
];
},
bitrateOptions() {
let options = [];
[32, 48, 64, 96, 128, 192, 256, 320].forEach((val) => {
options.push({
value: val,
text: val
});
});
return options;
},
} }
}; ];
const bitrateOptions = map(
[32, 48, 64, 96, 128, 192, 256, 320],
(val) => {
return {
value: val,
text: val
}
},
);
</script> </script>

View File

@ -109,7 +109,7 @@
<template #cell(playlists)="row"> <template #cell(playlists)="row">
<template v-for="(playlist, index) in row.item.playlists"> <template v-for="(playlist, index) in row.item.playlists">
<a class="btn-search" href="#" @click.prevent="filter('playlist:'+playlist.name)" <a class="btn-search" href="#" @click.prevent="filter('playlist:'+playlist.name)"
:title="langPlaylistSelect">{{ playlist.name }}</a> :title="$gettext('View tracks in playlist')">{{ playlist.name }}</a>
<span v-if="index+1 < row.item.playlists.length">, </span> <span v-if="index+1 < row.item.playlists.length">, </span>
</template> </template>
</template> </template>
@ -117,12 +117,12 @@
<template v-if="row.item.media.links.edit"> <template v-if="row.item.media.links.edit">
<b-button size="sm" variant="primary" <b-button size="sm" variant="primary"
@click.prevent="edit(row.item.media.links.edit, row.item.media.links.art, row.item.media.links.play, row.item.media.links.waveform)"> @click.prevent="edit(row.item.media.links.edit, row.item.media.links.art, row.item.media.links.play, row.item.media.links.waveform)">
{{ langEditButton }} {{ $gettext('Edit') }}
</b-button> </b-button>
</template> </template>
<template v-else> <template v-else>
<b-button size="sm" variant="primary" @click.prevent="rename(row.item.path)"> <b-button size="sm" variant="primary" @click.prevent="rename(row.item.path)">
{{ langRenameButton }} {{ $gettext('Rename') }}
</b-button> </b-button>
</template> </template>
</template> </template>
@ -304,20 +304,6 @@ export default {
unmounted() { unmounted() {
window.removeEventListener('hashchange', this.onHashChange); window.removeEventListener('hashchange', this.onHashChange);
}, },
computed: {
langAlbumArt() {
return this.$gettext('Album Art');
},
langRenameButton() {
return this.$gettext('Rename');
},
langEditButton() {
return this.$gettext('Edit');
},
langPlaylistSelect() {
return this.$gettext('View tracks in playlist');
},
},
methods: { methods: {
formatFileSize(size) { formatFileSize(size) {
return formatFileSize(size); return formatFileSize(size);

View File

@ -80,15 +80,11 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'MediaFormAdvancedSettings', form: Object,
components: {BWrappedFormGroup}, songLength: String
props: { });
form: Object,
songLength: String
},
};
</script> </script>

View File

@ -52,14 +52,10 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'MediaFormBasicInfo', form: Object
components: {BWrappedFormGroup}, });
props: {
form: Object
}
};
</script> </script>

View File

@ -10,15 +10,11 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'MediaFormCustomFields', form: Object,
components: {BWrappedFormGroup}, customFields: Array
props: { });
form: Object,
customFields: Array
},
};
</script> </script>

View File

@ -18,26 +18,22 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import _ from 'lodash';
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import {map} from "lodash";
import {computed} from "vue";
export default { const props = defineProps({
name: 'MediaFormPlaylists', form: Object,
components: {BWrappedFormGroup}, playlists: Array
props: { });
form: Object,
playlists: Array const options = computed(() => {
}, return map(props.playlists, function (row) {
computed: { return {
options() { text: row.name,
return _.map(this.playlists, function (row) { value: row.id
return { };
text: row.name, });
value: row.id });
};
});
}
}
};
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<b-modal id="create_directory" centered ref="modal" :title="langNewDirectory"> <b-modal id="create_directory" centered ref="modal" :title="$gettext('New Directory')">
<b-form @submit.prevent="doMkdir"> <b-form @submit.prevent="doMkdir">
<b-wrapped-form-group id="new_directory_name" :field="v$.newDirectory" autofocus> <b-wrapped-form-group id="new_directory_name" :field="v$.newDirectory" autofocus>
<template #label> <template #label>
@ -42,11 +42,6 @@ export default {
required required
} }
}, },
computed: {
langNewDirectory () {
return this.$gettext('New Directory');
}
},
methods: { methods: {
close() { close() {
this.newDirectory = null; this.newDirectory = null;

View File

@ -1,5 +1,5 @@
<template> <template>
<b-modal id="rename_file" centered ref="modal" :title="langRenameFile"> <b-modal id="rename_file" centered ref="modal" :title="$gettext('Rename File/Directory')">
<b-form @submit.prevent="doRename"> <b-form @submit.prevent="doRename">
<b-wrapped-form-group id="new_directory_name" :field="v$.form.newPath" autofocus> <b-wrapped-form-group id="new_directory_name" :field="v$.form.newPath" autofocus>
<template #label> <template #label>
@ -46,11 +46,6 @@ export default {
} }
} }
}, },
computed: {
langRenameFile () {
return this.$gettext('Rename File/Directory');
}
},
methods: { methods: {
open(filePath) { open(filePath) {
this.form.file = filePath; this.form.file = filePath;

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle"> <b-tab :title="$gettext('Advanced')">
<b-form-group> <b-form-group>
<div class="form-row mb-3"> <div class="form-row mb-3">
<b-wrapped-form-group class="col-md-12" id="edit_form_custom_listen_url" <b-wrapped-form-group class="col-md-12" id="edit_form_custom_listen_url"
@ -44,9 +44,6 @@ export default {
stationFrontendType: String stationFrontendType: String
}, },
computed: { computed: {
langTabTitle() {
return this.$gettext('Advanced');
},
isIcecast() { isIcecast() {
return FRONTEND_ICECAST === this.stationFrontendType; return FRONTEND_ICECAST === this.stationFrontendType;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle"> <b-tab :title="$gettext('AutoDJ')">
<b-form-group> <b-form-group>
<div class="form-row mb-3"> <div class="form-row mb-3">
<b-wrapped-form-checkbox class="col-md-12" id="edit_form_enable_autodj" :field="form.enable_autodj"> <b-wrapped-form-checkbox class="col-md-12" id="edit_form_enable_autodj" :field="form.enable_autodj">
@ -60,9 +60,6 @@ export default {
stationFrontendType: String stationFrontendType: String
}, },
computed: { computed: {
langTabTitle() {
return this.$gettext('AutoDJ');
},
formatOptions() { formatOptions() {
return [ return [
{ {

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle" active> <b-tab :title="$gettext('Basic Info')" active>
<b-form-group> <b-form-group>
<div class="form-row mb-3"> <div class="form-row mb-3">
<b-wrapped-form-group class="col-md-6" id="edit_form_name" :field="form.name"> <b-wrapped-form-group class="col-md-6" id="edit_form_name" :field="form.name">
@ -120,9 +120,6 @@ export default {
stationFrontendType: String stationFrontendType: String
}, },
computed: { computed: {
langTabTitle() {
return this.$gettext('Basic Info');
},
langAuthhashDesc() { langAuthhashDesc() {
let text = 'If your stream is set to advertise to YP directories above, you must specify an authorization hash. You can manage authhashes <a href="%{ url }" target="_blank">on the Shoutcast web site</a>.'; let text = 'If your stream is set to advertise to YP directories above, you must specify an authorization hash. You can manage authhashes <a href="%{ url }" target="_blank">on the Shoutcast web site</a>.';
let url = 'https://radiomanager.shoutcast.com/'; let url = 'https://radiomanager.shoutcast.com/';

View File

@ -16,7 +16,7 @@
</b-row> </b-row>
</b-card-header> </b-card-header>
<b-tabs pills card lazy> <b-tabs pills card lazy>
<b-tab :title="langAllPlaylistsTab" no-body> <b-tab :title="$gettext('All Playlists')" no-body>
<b-card-body body-class="card-padding-sm"> <b-card-body body-class="card-padding-sm">
<b-button variant="outline-primary" @click.prevent="doCreate"> <b-button variant="outline-primary" @click.prevent="doCreate">
<icon icon="add"></icon> <icon icon="add"></icon>
@ -35,28 +35,28 @@
{{ $gettext('Delete') }} {{ $gettext('Delete') }}
</b-button> </b-button>
<b-dropdown size="sm" variant="dark" boundary="window" :text="langMore"> <b-dropdown size="sm" variant="dark" boundary="window" :text="$gettext('More')">
<b-dropdown-item @click.prevent="doModify(row.item.links.toggle)"> <b-dropdown-item @click.prevent="doModify(row.item.links.toggle)">
{{ langToggleButton(row.item) }} {{ langToggleButton(row.item) }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item @click.prevent="doImport(row.item.links.import)" <b-dropdown-item @click.prevent="doImport(row.item.links.import)"
v-if="row.item.source === 'songs'"> v-if="row.item.source === 'songs'">
{{ langImportButton }} {{ $gettext('Import from PLS/M3U') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item @click.prevent="doReorder(row.item.links.order)" <b-dropdown-item @click.prevent="doReorder(row.item.links.order)"
v-if="row.item.source === 'songs' && row.item.order === 'sequential'"> v-if="row.item.source === 'songs' && row.item.order === 'sequential'">
{{ langReorderButton }} {{ $gettext('Reorder') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item @click.prevent="doQueue(row.item.links.queue)" <b-dropdown-item @click.prevent="doQueue(row.item.links.queue)"
v-if="row.item.source === 'songs' && row.item.order !== 'random'"> v-if="row.item.source === 'songs' && row.item.order !== 'random'">
{{ langQueueButton }} {{ $gettext('Playback Queue') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item @click.prevent="doModify(row.item.links.reshuffle)" <b-dropdown-item @click.prevent="doModify(row.item.links.reshuffle)"
v-if="row.item.order === 'shuffle'"> v-if="row.item.order === 'shuffle'">
{{ langReshuffleButton }} {{ $gettext('Reshuffle') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item @click.prevent="doClone(row.item.name, row.item.links.clone)"> <b-dropdown-item @click.prevent="doClone(row.item.name, row.item.links.clone)">
{{ langCloneButton }} {{ $gettext('Duplicate') }}
</b-dropdown-item> </b-dropdown-item>
<template v-for="format in ['pls', 'm3u']"> <template v-for="format in ['pls', 'm3u']">
<b-dropdown-item :href="row.item.links.export[format]" target="_blank"> <b-dropdown-item :href="row.item.links.export[format]" target="_blank">
@ -114,7 +114,7 @@
</template> </template>
</data-table> </data-table>
</b-tab> </b-tab>
<b-tab :title="langScheduleViewTab" no-body> <b-tab :title="$gettext('Schedule View')" no-body>
<schedule ref="schedule" :schedule-url="scheduleUrl" :station-time-zone="stationTimeZone" <schedule ref="schedule" :schedule-url="scheduleUrl" :station-time-zone="stationTimeZone"
@click="doCalendarClick"></schedule> @click="doCalendarClick"></schedule>
</b-tab> </b-tab>
@ -166,32 +166,6 @@ export default {
] ]
}; };
}, },
computed: {
langAllPlaylistsTab () {
return this.$gettext('All Playlists');
},
langScheduleViewTab () {
return this.$gettext('Schedule View');
},
langMore () {
return this.$gettext('More');
},
langReorderButton () {
return this.$gettext('Reorder');
},
langQueueButton () {
return this.$gettext('Playback Queue');
},
langReshuffleButton () {
return this.$gettext('Reshuffle');
},
langCloneButton () {
return this.$gettext('Duplicate');
},
langImportButton () {
return this.$gettext('Import from PLS/M3U');
}
},
methods: { methods: {
langToggleButton (record) { langToggleButton (record) {
return (record.is_enabled) return (record.is_enabled)

View File

@ -1,5 +1,5 @@
<template> <template>
<modal-form ref="modal" id="clone_modal" :title="langTitle" :error="error" <modal-form ref="modal" id="clone_modal" :title="$gettext('Duplicate Playlist')" :error="error"
:disable-save-button="v$.form.$invalid" @submit="doSubmit" @hidden="clearContents"> :disable-save-button="v$.form.$invalid" @submit="doSubmit" @hidden="clearContents">
<div class="form-row"> <div class="form-row">
@ -50,11 +50,6 @@ export default {
form: {} form: {}
}; };
}, },
computed: {
langTitle() {
return this.$gettext('Duplicate Playlist');
}
},
validations: { validations: {
form: { form: {
'name': { required }, 'name': { required },

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle"> <b-tab :title="$gettext('Advanced')">
<b-form-group> <b-form-group>
<div class="form-row"> <div class="form-row">
<b-wrapped-form-group class="col-md-6" id="edit_form_backend_options" :field="form.backend_options"> <b-wrapped-form-group class="col-md-6" id="edit_form_backend_options" :field="form.backend_options">
@ -28,19 +28,10 @@
</b-tab> </b-tab>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'PlaylistEditAdvanced', form: Object
components: {BWrappedFormGroup}, });
props: {
form: Object
},
computed: {
langTabTitle() {
return this.$gettext('Advanced');
}
}
};
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle" active> <b-tab :title="$gettext('Basic Info')" active>
<b-form-group> <b-form-group>
<div class="form-row"> <div class="form-row">
<b-wrapped-form-group class="col-md-6" id="form_edit_name" :field="form.name"> <b-wrapped-form-group class="col-md-6" id="form_edit_name" :field="form.name">
@ -343,11 +343,6 @@ export default {
return { return {
weightOptions: weightOptions weightOptions: weightOptions
}; };
},
computed: {
langTabTitle() {
return this.$gettext('Basic Info');
}
} }
}; };
</script> </script>

View File

@ -1,11 +1,13 @@
<template> <template>
<b-tab :title="langTabTitle"> <b-tab :title="$gettext('Schedule')">
<b-form-group v-if="scheduleItems.length === 0"> <b-form-group v-if="scheduleItems.length === 0">
<label> <label>
{{ $gettext('Not Scheduled') }} {{ $gettext('Not Scheduled') }}
</label> </label>
<p> <p>
{{ $gettext('This playlist currently has no scheduled times. It will play at all times. To add a new scheduled time, click the button below.') }} {{
$gettext('This playlist currently has no scheduled times. It will play at all times. To add a new scheduled time, click the button below.')
}}
</p> </p>
</b-form-group> </b-form-group>
@ -37,11 +39,6 @@ export default {
stationTimeZone: String, stationTimeZone: String,
scheduleItems: Array scheduleItems: Array
}, },
computed: {
langTabTitle() {
return this.$gettext('Schedule');
}
},
methods: { methods: {
add () { add () {
this.scheduleItems.push({ this.scheduleItems.push({

View File

@ -1,5 +1,5 @@
<template> <template>
<b-modal id="import_modal" ref="modal" :title="langTitle" @hidden="onHidden"> <b-modal id="import_modal" ref="modal" :title="$gettext('Import from PLS/M3U')" @hidden="onHidden">
<div v-if="results"> <div v-if="results">
<p class="card-text">{{ results.message }}</p> <p class="card-text">{{ results.message }}</p>
@ -65,11 +65,6 @@ export default {
results: null, results: null,
}; };
}, },
computed: {
langTitle () {
return this.$gettext('Import from PLS/M3U');
}
},
methods: { methods: {
open (importPlaylistUrl) { open (importPlaylistUrl) {
this.playlistFile = null; this.playlistFile = null;

View File

@ -1,5 +1,5 @@
<template> <template>
<b-modal size="lg" id="queue_modal" ref="modal" :title="langTitle" :busy="loading"> <b-modal size="lg" id="queue_modal" ref="modal" :title="$gettext('Playback Queue')" :busy="loading">
<p> <p>
{{ {{
$gettext('This queue contains the remaining tracks in the order they will be queued by the AzuraCast AutoDJ (if the tracks are eligible to be played).') $gettext('This queue contains the remaining tracks in the order they will be queued by the AzuraCast AutoDJ (if the tracks are eligible to be played).')
@ -45,11 +45,6 @@ export default {
media: [] media: []
}; };
}, },
computed: {
langTitle () {
return this.$gettext('Playback Queue');
}
},
methods: { methods: {
open (queueUrl) { open (queueUrl) {
this.$refs.modal.show(); this.$refs.modal.show();

View File

@ -1,5 +1,5 @@
<template> <template>
<b-modal size="lg" id="reorder_modal" ref="modal" :title="langTitle" :busy="loading" hide-footer> <b-modal size="lg" id="reorder_modal" ref="modal" :title="$gettext('Reorder Playlist')" :busy="loading" hide-footer>
<b-overlay variant="card" :show="loading"> <b-overlay variant="card" :show="loading">
<div style="min-height: 40px;" class="flex-fill text-left bg-primary rounded mb-2"> <div style="min-height: 40px;" class="flex-fill text-left bg-primary rounded mb-2">
<inline-player ref="player"></inline-player> <inline-player ref="player"></inline-player>
@ -27,11 +27,12 @@
<td> <td>
<b-button-group size="sm"> <b-button-group size="sm">
<b-button size="sm" variant="primary" @click.prevent="moveDown(index)" <b-button size="sm" variant="primary" @click.prevent="moveDown(index)"
:title="langDownBtn" :title="$gettext('Down')"
v-if="index+1 < media.length"> v-if="index+1 < media.length">
<icon icon="arrow_downward"></icon> <icon icon="arrow_downward"></icon>
</b-button> </b-button>
<b-button size="sm" variant="primary" @click.prevent="moveUp(index)" :title="langUpBtn" <b-button size="sm" variant="primary" @click.prevent="moveUp(index)"
:title="$gettext('Up')"
v-if="index > 0"> v-if="index > 0">
<icon icon="arrow_upward"></icon> <icon icon="arrow_upward"></icon>
</b-button> </b-button>
@ -71,17 +72,6 @@ export default {
media: [] media: []
}; };
}, },
computed: {
langTitle () {
return this.$gettext('Reorder Playlist');
},
langDownBtn () {
return this.$gettext('Down');
},
langUpBtn () {
return this.$gettext('Up');
}
},
methods: { methods: {
open (reorderUrl) { open (reorderUrl) {
this.$refs.modal.show(); this.$refs.modal.show();

View File

@ -4,26 +4,23 @@
<list-view v-else v-bind="$props" @select-podcast="onSelectPodcast"></list-view> <list-view v-else v-bind="$props" @select-podcast="onSelectPodcast"></list-view>
</template> </template>
<script> <script setup>
import EpisodesView, {episodeViewProps} from './Podcasts/EpisodesView'; import EpisodesView, {episodeViewProps} from './Podcasts/EpisodesView';
import ListView, {listViewProps} from './Podcasts/ListView'; import ListView, {listViewProps} from './Podcasts/ListView';
import {ref} from "vue";
export default { const props = defineProps({
name: 'StationPodcasts', ...episodeViewProps.props,
components: {ListView, EpisodesView}, ...listViewProps.props
mixins: [episodeViewProps, listViewProps], });
data() {
return { const activePodcast = ref(null);
activePodcast: null
}; const onSelectPodcast = (podcast) => {
}, activePodcast.value = podcast;
methods: {
onSelectPodcast (podcast) {
this.activePodcast = podcast;
},
onClearPodcast () {
this.activePodcast = null;
}
}
}; };
const onClearPodcast = () => {
activePodcast.value = null;
}
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTitle" active> <b-tab :title="$gettext('Basic Information')" active>
<b-form-group> <b-form-group>
<div class="form-row"> <div class="form-row">
@ -73,21 +73,12 @@
</b-tab> </b-tab>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import BWrappedFormCheckbox from "~/components/Form/BWrappedFormCheckbox"; import BWrappedFormCheckbox from "~/components/Form/BWrappedFormCheckbox";
export default { const props = defineProps({
name: 'EpisodeFormBasicInfo', form: Object,
components: {BWrappedFormCheckbox, BWrappedFormGroup}, locale: String
props: { });
form: Object,
locale: String
},
computed: {
langTitle() {
return this.$gettext('Basic Information');
}
}
};
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTitle" active> <b-tab :title="$gettext('Basic Information')" active>
<b-form-group> <b-form-group>
<div class="form-row"> <div class="form-row">
@ -83,21 +83,12 @@
</b-tab> </b-tab>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'PodcastFormBasicInfo', form: Object,
components: {BWrappedFormGroup}, languageOptions: Object,
props: { categoriesOptions: Object
form: Object, });
languageOptions: Object,
categoriesOptions: Object
},
computed: {
langTitle() {
return this.$gettext('Basic Information');
}
}
};
</script> </script>

View File

@ -11,27 +11,26 @@
</section> </section>
</template> </template>
<script> <script setup>
import AdminStationsForm, {stationFormProps} from "~/components/Admin/Stations/StationForm"; import AdminStationsForm, {stationFormProps} from "~/components/Admin/Stations/StationForm";
import {onMounted, ref} from "vue";
export default { const props = defineProps({
name: 'StationsProfileEdit', ...stationFormProps,
components: {AdminStationsForm}, editUrl: String,
props: { continueUrl: {
...stationFormProps, type: String,
editUrl: String, required: true
continueUrl: {
type: String,
required: true
}
},
mounted() {
this.$refs.form.reset();
},
methods: {
onSubmitted() {
window.location.href = this.continueUrl;
},
} }
});
const form = ref(); // AdminStationsForm
onMounted(() => {
form.value?.reset();
});
const onSubmitted = () => {
window.location.href = props.continueUrl;
} }
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle"> <b-tab :title="$gettext('AutoDJ')">
<div class="form-row mb-3"> <div class="form-row mb-3">
<b-wrapped-form-checkbox class="col-md-12" id="edit_form_enable_autodj" :field="form.enable_autodj"> <b-wrapped-form-checkbox class="col-md-12" id="edit_form_enable_autodj" :field="form.enable_autodj">
<template #label> <template #label>
@ -102,9 +102,6 @@ export default {
stationFrontendType: String stationFrontendType: String
}, },
computed: { computed: {
langTabTitle() {
return this.$gettext('AutoDJ');
},
formatOptions() { formatOptions() {
return [ return [
{ {

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle" active> <b-tab :title="$gettext('Basic Info')" active>
<b-form-group> <b-form-group>
<div class="form-row"> <div class="form-row">
<b-wrapped-form-group class="col-md-12" id="edit_form_type" :field="form.type"> <b-wrapped-form-group class="col-md-12" id="edit_form_type" :field="form.type">
@ -90,9 +90,6 @@ export default {
form: Object form: Object
}, },
computed: { computed: {
langTabTitle() {
return this.$gettext('Basic Info');
},
typeOptions() { typeOptions() {
return [ return [
{ {

View File

@ -23,8 +23,10 @@
</div> </div>
</div> </div>
<b-tabs pills card> <b-tabs pills card>
<b-tab key="live" active @click="setIsLive(true)" :title="langLiveListeners" no-body></b-tab> <b-tab key="live" active @click="setIsLive(true)" :title="$gettext('Live Listeners')"
<b-tab key="not-live" @click="setIsLive(false)" :title="langListenerHistory" no-body></b-tab> no-body></b-tab>
<b-tab key="not-live" @click="setIsLive(false)" :title="$gettext('Listener History')"
no-body></b-tab>
</b-tabs> </b-tabs>
<div id="map"> <div id="map">
<StationReportsListenersMap :listeners="listeners"></StationReportsListenersMap> <StationReportsListenersMap :listeners="listeners"></StationReportsListenersMap>
@ -154,12 +156,6 @@ export default {
}; };
}, },
computed: { computed: {
langLiveListeners() {
return this.$gettext('Live Listeners');
},
langListenerHistory() {
return this.$gettext('Listener History');
},
nowTz() { nowTz() {
return DateTime.now().setZone(this.stationTimeZone); return DateTime.now().setZone(this.stationTimeZone);
}, },

View File

@ -1,6 +1,6 @@
<template> <template>
<common-metrics-view :date-range="dateRange" :api-url="apiUrl" <common-metrics-view :date-range="dateRange" :api-url="apiUrl"
field-key="browser" :field-label="langFieldLabel"> field-key="browser" :field-label="$gettext('Browser')">
<template #by_listeners_legend> <template #by_listeners_legend>
{{ $gettext('Top Browsers by Listeners') }} {{ $gettext('Top Browsers by Listeners') }}
</template> </template>
@ -10,20 +10,11 @@
</common-metrics-view> </common-metrics-view>
</template> </template>
<script> <script setup>
import CommonMetricsView from "./CommonMetricsView"; import CommonMetricsView from "./CommonMetricsView";
export default { const props = defineProps({
name: 'BrowsersTab', dateRange: Object,
components: {CommonMetricsView}, apiUrl: String,
props: { });
dateRange: Object,
apiUrl: String,
},
computed: {
langFieldLabel() {
return this.$gettext('Browser');
}
}
}
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<common-metrics-view :date-range="dateRange" :api-url="apiUrl" <common-metrics-view :date-range="dateRange" :api-url="apiUrl"
field-key="client" :field-label="langFieldLabel"> field-key="client" :field-label="$gettext('Client')">
<template #by_listeners_legend> <template #by_listeners_legend>
{{ $gettext('Clients by Listeners') }} {{ $gettext('Clients by Listeners') }}
</template> </template>
@ -10,20 +10,11 @@
</common-metrics-view> </common-metrics-view>
</template> </template>
<script> <script setup>
import CommonMetricsView from "./CommonMetricsView"; import CommonMetricsView from "./CommonMetricsView";
export default { const props = defineProps({
name: 'ClientsTab', dateRange: Object,
components: {CommonMetricsView}, apiUrl: String,
props: { });
dateRange: Object,
apiUrl: String,
},
computed: {
langFieldLabel() {
return this.$gettext('Client');
}
}
}
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<common-metrics-view :date-range="dateRange" :api-url="apiUrl" <common-metrics-view :date-range="dateRange" :api-url="apiUrl"
field-key="country" :field-label="langFieldLabel"> field-key="country" :field-label="$gettext('Country')">
<template #by_listeners_legend> <template #by_listeners_legend>
{{ $gettext('Top Countries by Listeners') }} {{ $gettext('Top Countries by Listeners') }}
</template> </template>
@ -10,20 +10,11 @@
</common-metrics-view> </common-metrics-view>
</template> </template>
<script> <script setup>
import CommonMetricsView from "./CommonMetricsView"; import CommonMetricsView from "./CommonMetricsView";
export default { const props = defineProps({
name: 'CountriesTab', dateRange: Object,
components: {CommonMetricsView}, apiUrl: String,
props: { });
dateRange: Object,
apiUrl: String,
},
computed: {
langFieldLabel() {
return this.$gettext('Country');
}
}
}
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<common-metrics-view :date-range="dateRange" :api-url="apiUrl" <common-metrics-view :date-range="dateRange" :api-url="apiUrl"
field-key="stream" :field-label="langFieldLabel"> field-key="stream" :field-label="$gettext('Stream')">
<template #by_listeners_legend> <template #by_listeners_legend>
{{ $gettext('Top Streams by Listeners') }} {{ $gettext('Top Streams by Listeners') }}
</template> </template>
@ -10,20 +10,11 @@
</common-metrics-view> </common-metrics-view>
</template> </template>
<script> <script setup>
import CommonMetricsView from "./CommonMetricsView"; import CommonMetricsView from "./CommonMetricsView";
export default { const props = defineProps({
name: 'StreamsTab', dateRange: Object,
components: {CommonMetricsView}, apiUrl: String,
props: { });
dateRange: Object,
apiUrl: String,
},
computed: {
langFieldLabel() {
return this.$gettext('Stream');
}
}
}
</script> </script>

View File

@ -37,15 +37,11 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'SftpUsersForm', form: Object,
components: {BWrappedFormGroup}, isEditMode: Boolean
props: { });
form: Object,
isEditMode: Boolean
},
};
</script> </script>

View File

@ -19,7 +19,7 @@
</b-card-header> </b-card-header>
<b-tabs pills card lazy> <b-tabs pills card lazy>
<b-tab :title="langAccountListTab" no-body> <b-tab :title="$gettext('Account List')" no-body>
<b-card-body body-class="card-padding-sm"> <b-card-body body-class="card-padding-sm">
<b-button variant="outline-primary" @click.prevent="doCreate"> <b-button variant="outline-primary" @click.prevent="doCreate">
<icon icon="add"></icon> <icon icon="add"></icon>
@ -56,7 +56,7 @@
</template> </template>
</data-table> </data-table>
</b-tab> </b-tab>
<b-tab :title="langScheduleViewTab" no-body> <b-tab :title="$gettext('Schedule View')" no-body>
<schedule ref="schedule" :schedule-url="scheduleUrl" :station-time-zone="stationTimeZone" <schedule ref="schedule" :schedule-url="scheduleUrl" :station-time-zone="stationTimeZone"
@click="doCalendarClick"></schedule> @click="doCalendarClick"></schedule>
</b-tab> </b-tab>
@ -103,14 +103,6 @@ export default {
] ]
}; };
}, },
computed: {
langAccountListTab() {
return this.$gettext('Account List');
},
langScheduleViewTab() {
return this.$gettext('Schedule View');
}
},
methods: { methods: {
relist() { relist() {
this.$refs.datatable.refresh(); this.$refs.datatable.refresh();

View File

@ -1,5 +1,5 @@
<template> <template>
<b-modal id="streamer_broadcasts" size="lg" centered ref="modal" :title="langHeader"> <b-modal id="streamer_broadcasts" size="lg" centered ref="modal" :title="$gettext('Streamer Broadcasts')">
<template v-if="listUrl"> <template v-if="listUrl">
<div style="min-height: 40px;" class="flex-fill text-left bg-primary rounded mb-2"> <div style="min-height: 40px;" class="flex-fill text-left bg-primary rounded mb-2">
<inline-player ref="player"></inline-player> <inline-player ref="player"></inline-player>
@ -13,7 +13,7 @@
:url="row.item.recording?.links?.download"></play-button> :url="row.item.recording?.links?.download"></play-button>
&nbsp; &nbsp;
<a class="name" :href="row.item.recording?.links?.download" target="_blank" <a class="name" :href="row.item.recording?.links?.download" target="_blank"
:title="langDownload"> :title="$gettext('Download')">
<icon icon="cloud_download"></icon> <icon icon="cloud_download"></icon>
</a> </a>
</template> </template>
@ -108,17 +108,6 @@ export default {
] ]
}; };
}, },
computed: {
langHeader () {
return this.$gettext('Streamer Broadcasts');
},
langPlayPause () {
return this.$gettext('Play/Pause');
},
langDownload () {
return this.$gettext('Download');
}
},
methods: { methods: {
doDelete (url) { doDelete (url) {
this.$confirmDelete({ this.$confirmDelete({

View File

@ -78,11 +78,9 @@
</div> </div>
</div> </div>
</template> </template>
<script>
export default { <script setup>
name: 'ConnectionInfo', const props = defineProps({
props: { connectionInfo: Object
connectionInfo: Object });
}
}
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle" active> <b-tab :title="$gettext('Basic Info')" active>
<b-form-group> <b-form-group>
<div class="form-row"> <div class="form-row">
@ -74,20 +74,11 @@
</b-tab> </b-tab>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import BWrappedFormCheckbox from "~/components/Form/BWrappedFormCheckbox"; import BWrappedFormCheckbox from "~/components/Form/BWrappedFormCheckbox";
export default { const props = defineProps({
name: 'StreamerFormBasicInfo', form: Object
components: {BWrappedFormCheckbox, BWrappedFormGroup}, });
props: {
form: Object
},
computed: {
langTabTitle() {
return this.$gettext('Basic Info');
}
}
};
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<b-tab :title="langTabTitle"> <b-tab :title="$gettext('Schedule')">
<b-form-group v-if="scheduleItems.length === 0"> <b-form-group v-if="scheduleItems.length === 0">
<label> <label>
{{ $gettext('Not Scheduled') }} {{ $gettext('Not Scheduled') }}
@ -50,11 +50,6 @@ export default {
] ]
}; };
}, },
computed: {
langTabTitle () {
return this.$gettext('Schedule');
}
},
methods: { methods: {
add () { add () {
this.scheduleItems.push({ this.scheduleItems.push({

View File

@ -33,15 +33,11 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'BasicInfo', form: Object,
components: {BWrappedFormGroup}, triggerOptions: Array
props: { });
form: Object,
triggerOptions: Array
}
}
</script> </script>

View File

@ -19,11 +19,8 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
export default { const props = defineProps({
name: 'CommonFormattingInfo', nowPlayingUrl: String
props: { });
nowPlayingUrl: String
}
}
</script> </script>

View File

@ -63,16 +63,12 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import CommonFormattingInfo from "./Common/FormattingInfo"; import CommonFormattingInfo from "./Common/FormattingInfo";
export default { const props = defineProps({
name: 'Discord', form: Object,
components: {CommonFormattingInfo, BWrappedFormGroup}, nowPlayingUrl: String
props: { });
form: Object,
nowPlayingUrl: String
}
}
</script> </script>

View File

@ -31,16 +31,12 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import CommonFormattingInfo from "./Common/FormattingInfo"; import CommonFormattingInfo from "./Common/FormattingInfo";
export default { const props = defineProps({
name: 'Email', form: Object,
components: {CommonFormattingInfo, BWrappedFormGroup}, nowPlayingUrl: String
props: { });
form: Object,
nowPlayingUrl: String
}
}
</script> </script>

View File

@ -76,14 +76,10 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'Generic', form: Object
components: {BWrappedFormGroup}, });
props: {
form: Object
}
}
</script> </script>

View File

@ -13,14 +13,10 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'GoogleAnalytics', form: Object
components: {BWrappedFormGroup}, });
props: {
form: Object
}
}
</script> </script>

View File

@ -70,41 +70,34 @@
<common-social-post-fields :form="form" :now-playing-url="nowPlayingUrl"></common-social-post-fields> <common-social-post-fields :form="form" :now-playing-url="nowPlayingUrl"></common-social-post-fields>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import RateLimitFields from "./Common/RateLimitFields";
import CommonRateLimitFields from "./Common/RateLimitFields"; import CommonRateLimitFields from "./Common/RateLimitFields";
import CommonSocialPostFields from "./Common/SocialPostFields"; import CommonSocialPostFields from "./Common/SocialPostFields";
import {computed} from "vue";
import {useTranslate} from "~/vendor/gettext";
export default { const props = defineProps({
name: 'Mastodon', form: Object,
components: { nowPlayingUrl: String
CommonRateLimitFields, });
CommonSocialPostFields,
RateLimitFields, const {$gettext} = useTranslate();
BWrappedFormGroup
}, const visibilityOptions = computed(() => {
props: { return [
form: Object, {
nowPlayingUrl: String text: $gettext('Public'),
}, value: 'public',
computed: { },
visibilityOptions() { {
return [ text: $gettext('Unlisted'),
{ value: 'unlisted',
text: this.$gettext('Public'), },
value: 'public', {
}, text: $gettext('Private'),
{ value: 'private',
text: this.$gettext('Unlisted'),
value: 'unlisted',
},
{
text: this.$gettext('Private'),
value: 'private',
}
];
} }
} ];
} });
</script> </script>

View File

@ -32,14 +32,10 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'MatomoAnalytics', form: Object
components: {BWrappedFormGroup}, });
props: {
form: Object
}
}
</script> </script>

View File

@ -64,30 +64,29 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import CommonFormattingInfo from "./Common/FormattingInfo"; import CommonFormattingInfo from "./Common/FormattingInfo";
import {computed} from "vue";
import {useTranslate} from "~/vendor/gettext";
export default { const props = defineProps({
name: 'Telegram', form: Object,
components: {CommonFormattingInfo, BWrappedFormGroup}, nowPlayingUrl: String
props: { });
form: Object,
nowPlayingUrl: String const {$gettext} = useTranslate();
},
computed: { const parseModeOptions = computed(() => {
parseModeOptions() { return [
return [ {
{ text: $gettext('Markdown'),
text: this.$gettext('Markdown'), value: 'Markdown',
value: 'Markdown', },
}, {
{ text: $gettext('HTML'),
text: this.$gettext('HTML'), value: 'HTML',
value: 'HTML',
}
];
} }
} ];
} });
</script> </script>

View File

@ -25,14 +25,10 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
export default { const props = defineProps({
name: 'Tunein', form: Object
components: {BWrappedFormGroup}, });
props: {
form: Object
}
}
</script> </script>

View File

@ -65,17 +65,13 @@
<common-social-post-fields :form="form" :now-playing-url="nowPlayingUrl"></common-social-post-fields> <common-social-post-fields :form="form" :now-playing-url="nowPlayingUrl"></common-social-post-fields>
</template> </template>
<script> <script setup>
import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup"; import BWrappedFormGroup from "~/components/Form/BWrappedFormGroup";
import CommonRateLimitFields from "./Common/RateLimitFields"; import CommonRateLimitFields from "./Common/RateLimitFields";
import CommonSocialPostFields from "./Common/SocialPostFields"; import CommonSocialPostFields from "./Common/SocialPostFields";
export default { const props = defineProps({
name: 'Twitter', form: Object,
components: {CommonSocialPostFields, CommonRateLimitFields, BWrappedFormGroup}, nowPlayingUrl: String
props: { });
form: Object,
nowPlayingUrl: String
}
}
</script> </script>

View File

@ -14,17 +14,14 @@
</b-form-group> </b-form-group>
</template> </template>
<script> <script setup>
export default { const props = defineProps({
name: 'TypeSelect', webhookTypes: Object,
emits: ['select'], });
props: {
webhookTypes: Object, const emit = defineEmits(['select']);
},
methods: { const selectType = (type) => {
selectType(type) { emit('select', type);
this.$emit('select', type);
}
}
} }
</script> </script>

View File

@ -0,0 +1,12 @@
import {ref} from "vue";
import {cloneDeep} from "lodash";
export function useResettableRef(original) {
const record = ref(cloneDeep(original));
const reset = () => {
record.value = cloneDeep(original);
}
return {record, reset};
}