Make useAzuraCast a named import.
This commit is contained in:
parent
3a23e6ad43
commit
f75dfd2fcb
|
@ -16,13 +16,15 @@
|
|||
{{ formatTimestamp(row.item.timestamp) }}
|
||||
</template>
|
||||
<template #cell(operation)="row">
|
||||
<span class="text-success" v-if="row.item.operation_text === 'insert'" :title="langInsert">
|
||||
<span class="text-success" v-if="row.item.operation_text === 'insert'"
|
||||
:title="$gettext('Insert')">
|
||||
<icon class="lg inline" icon="add_circle"></icon>
|
||||
</span>
|
||||
<span class="text-danger" v-else-if="row.item.operation_text === 'delete'" :title="langDelete">
|
||||
<span class="text-danger" v-else-if="row.item.operation_text === 'delete'"
|
||||
:title="$gettext('Delete')">
|
||||
<icon class="lg inline" icon="remove_circle"></icon>
|
||||
</span>
|
||||
<span class="text-primary" v-else :title="langUpdate">
|
||||
<span class="text-primary" v-else :title="$gettext('Update')">
|
||||
<icon class="lg inline" icon="swap_horizontal_circle"></icon>
|
||||
</span>
|
||||
</template>
|
||||
|
@ -82,66 +84,56 @@ pre.changes {
|
|||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import Icon from "~/components/Common/Icon";
|
||||
import DataTable from "~/components/Common/DataTable";
|
||||
import DateRangeDropdown from "~/components/Common/DateRangeDropdown";
|
||||
import {DateTime} from 'luxon';
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
<script setup>
|
||||
import {DateTime} from "luxon";
|
||||
import {computed, ref} from "vue";
|
||||
import {useTranslate} from "~/vendor/gettext";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
import DataTable from "~/components/Common/DataTable.vue";
|
||||
import DateRangeDropdown from "~/components/Common/DateRangeDropdown.vue";
|
||||
import Icon from "~/components/Common/Icon.vue";
|
||||
|
||||
export default {
|
||||
name: 'AdminAuditLog',
|
||||
components: {DateRangeDropdown, Icon, DataTable},
|
||||
props: {
|
||||
baseApiUrl: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dateRange: {
|
||||
startDate: DateTime.now().minus({days: 13}).toJSDate(),
|
||||
endDate: DateTime.now().toJSDate(),
|
||||
},
|
||||
fields: [
|
||||
{key: 'date_time', label: this.$gettext('Date/Time'), sortable: false},
|
||||
{key: 'user', label: this.$gettext('User'), sortable: false},
|
||||
{key: 'operation', isRowHeader: true, label: this.$gettext('Operation'), sortable: false},
|
||||
{key: 'identifier', label: this.$gettext('Identifier'), sortable: false},
|
||||
{key: 'target', label: this.$gettext('Target'), sortable: false},
|
||||
{key: 'actions', label: this.$gettext('Actions'), sortable: false}
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
langInsert() {
|
||||
return this.$gettext('Insert');
|
||||
},
|
||||
langUpdate() {
|
||||
return this.$gettext('Update');
|
||||
},
|
||||
langDelete() {
|
||||
return this.$gettext('Delete');
|
||||
},
|
||||
apiUrl() {
|
||||
let apiUrl = new URL(this.baseApiUrl, document.location);
|
||||
const props = defineProps({
|
||||
baseApiUrl: String,
|
||||
});
|
||||
|
||||
let apiUrlParams = apiUrl.searchParams;
|
||||
apiUrlParams.set('start', DateTime.fromJSDate(this.dateRange.startDate).toISO());
|
||||
apiUrlParams.set('end', DateTime.fromJSDate(this.dateRange.endDate).toISO());
|
||||
const dateRange = ref({
|
||||
startDate: DateTime.now().minus({days: 13}).toJSDate(),
|
||||
endDate: DateTime.now().toJSDate(),
|
||||
});
|
||||
|
||||
return apiUrl.toString();
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
relist() {
|
||||
this.$refs.datatable.relist();
|
||||
},
|
||||
formatTimestamp(unix_timestamp) {
|
||||
const {timeConfig} = useAzuraCast();
|
||||
const {$gettext} = useTranslate();
|
||||
|
||||
return DateTime.fromSeconds(unix_timestamp).toLocaleString(
|
||||
{...DateTime.DATETIME_SHORT, timeConfig}
|
||||
);
|
||||
}
|
||||
}
|
||||
const fields = [
|
||||
{key: 'date_time', label: $gettext('Date/Time'), sortable: false},
|
||||
{key: 'user', label: $gettext('User'), sortable: false},
|
||||
{key: 'operation', isRowHeader: true, label: $gettext('Operation'), sortable: false},
|
||||
{key: 'identifier', label: $gettext('Identifier'), sortable: false},
|
||||
{key: 'target', label: $gettext('Target'), sortable: false},
|
||||
{key: 'actions', label: $gettext('Actions'), sortable: false}
|
||||
];
|
||||
|
||||
const apiUrl = computed(() => {
|
||||
let apiUrl = new URL(props.baseApiUrl, document.location);
|
||||
|
||||
let apiUrlParams = apiUrl.searchParams;
|
||||
apiUrlParams.set('start', DateTime.fromJSDate(dateRange.value.startDate).toISO());
|
||||
apiUrlParams.set('end', DateTime.fromJSDate(dateRange.value.endDate).toISO());
|
||||
|
||||
return apiUrl.toString();
|
||||
});
|
||||
|
||||
const datatable = ref(); // DataTable Template Ref
|
||||
|
||||
const relist = () => {
|
||||
datatable.value.relist();
|
||||
};
|
||||
|
||||
const formatTimestamp = (unix_timestamp) => {
|
||||
const {timeConfig} = useAzuraCast();
|
||||
|
||||
return DateTime.fromSeconds(unix_timestamp).toLocaleString(
|
||||
{...DateTime.DATETIME_SHORT, timeConfig}
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -116,7 +116,7 @@ import formatFileSize from "~/functions/formatFileSize";
|
|||
import AdminBackupsConfigureModal from "~/components/Admin/Backups/ConfigureModal";
|
||||
import AdminBackupsRunBackupModal from "~/components/Admin/Backups/RunBackupModal";
|
||||
import EnabledBadge from "~/components/Common/Badges/EnabledBadge.vue";
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
export default {
|
||||
name: 'AdminBackups',
|
||||
|
|
|
@ -8,7 +8,7 @@ import {useVModel} from "@vueuse/core";
|
|||
import {computed} from "vue";
|
||||
import {css} from "@codemirror/lang-css";
|
||||
import {javascript} from "@codemirror/lang-javascript";
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: String,
|
||||
|
|
|
@ -73,7 +73,7 @@ import Icon from './Icon';
|
|||
import _ from 'lodash';
|
||||
import {computed, onMounted, onUnmounted, reactive, ref} from "vue";
|
||||
import Flow from "@flowjs/flow.js";
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
const props = defineProps({
|
||||
targetUrl: String,
|
||||
|
|
|
@ -9,7 +9,7 @@ import allLocales from '@fullcalendar/core/locales-all';
|
|||
import luxon2Plugin from '@fullcalendar/luxon2';
|
||||
import timeGridPlugin from '@fullcalendar/timegrid';
|
||||
import {shallowRef} from "vue";
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
const props = defineProps({
|
||||
scheduleUrl: String,
|
||||
|
|
|
@ -164,7 +164,7 @@ import PlayButton from "~/components/Common/PlayButton";</script>
|
|||
import formatFileSize from '~/functions/formatFileSize.js';
|
||||
import _ from 'lodash';
|
||||
import {DateTime} from 'luxon';
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
|
|
|
@ -142,7 +142,7 @@ import Icon from '~/components/Common/Icon';
|
|||
import CloneModal from './Playlists/CloneModal';
|
||||
import {DateTime} from 'luxon';
|
||||
import humanizeDuration from 'humanize-duration';
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
export default {
|
||||
name: 'StationPlaylists',
|
||||
|
|
|
@ -49,7 +49,7 @@ export default {
|
|||
import {DateTime} from "luxon";
|
||||
import _ from "lodash";
|
||||
import {computed} from "vue";
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
const props = defineProps({
|
||||
scheduleItems: Array,
|
||||
|
|
|
@ -57,7 +57,7 @@ import DataTable from '../Common/DataTable';
|
|||
import QueueLogsModal from './Queue/LogsModal';
|
||||
import Icon from "~/components/Common/Icon";
|
||||
import {DateTime} from 'luxon';
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
export default {
|
||||
name: 'StationQueue',
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<script setup>
|
||||
import {onMounted, provide, ref, shallowRef} from "vue";
|
||||
import L from "leaflet";
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
const props = defineProps({
|
||||
attribution: String
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
import DataTable from '~/components/Common/DataTable';
|
||||
import Icon from "~/components/Common/Icon";
|
||||
import {DateTime} from 'luxon';
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
export default {
|
||||
name: 'StationRequests',
|
||||
|
|
|
@ -82,7 +82,7 @@ import Icon from "~/components/Common/Icon";
|
|||
import DataTable from "~/components/Common/DataTable";
|
||||
import DateRangeDropdown from "~/components/Common/DateRangeDropdown";
|
||||
import {DateTime} from 'luxon';
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
export default {
|
||||
name: 'StationsReportsTimeline',
|
||||
|
|
|
@ -43,7 +43,7 @@ import Icon from '~/components/Common/Icon';
|
|||
import PlayButton from "~/components/Common/PlayButton";
|
||||
import {DateTime} from 'luxon';
|
||||
import '~/vendor/sweetalert.js';
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
export default {
|
||||
name: 'StreamerBroadcastsModal',
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import axios from "axios";
|
||||
import VueAxios from "vue-axios";
|
||||
import {inject} from "vue";
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
import {useTranslate} from "~/vendor/gettext";
|
||||
import {useNotify} from "~/vendor/bootstrapVue";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export default function useAzuraCast() {
|
||||
export function useAzuraCast() {
|
||||
return {
|
||||
lang: {
|
||||
confirm: App.lang.confirm ?? 'Are you sure?',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import translations from "../../../translations/translations.json";
|
||||
import {createGettext} from "vue3-gettext";
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
const {locale} = useAzuraCast();
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Settings} from 'luxon';
|
||||
import useAzuraCast from "~/vendor/azuracast";
|
||||
import {useAzuraCast} from "~/vendor/azuracast";
|
||||
|
||||
const {localeWithDashes} = useAzuraCast();
|
||||
|
||||
|
|
Loading…
Reference in New Issue