mirror of
https://github.com/AzuraCast/AzuraCast.git
synced 2024-06-14 05:06:37 +00:00
91 lines
3.3 KiB
Vue
91 lines
3.3 KiB
Vue
<template>
|
|
<section class="card" role="region" id="profile-backend">
|
|
<div class="card-header bg-primary-dark">
|
|
<h3 class="card-title">
|
|
{{ $gettext('AutoDJ Service') }}
|
|
<running-badge :running="np.services.backend_running"></running-badge>
|
|
<br>
|
|
<small>{{ backendName }}</small>
|
|
</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-text">
|
|
{{ langTotalTracks }}
|
|
</p>
|
|
|
|
<div class="buttons" v-if="userCanManageMedia">
|
|
<a class="btn btn-primary" :href="manageMediaUri">{{ $gettext('Music Files') }}</a>
|
|
<a class="btn btn-primary" :href="managePlaylistsUri">{{ $gettext('Playlists') }}</a>
|
|
</div>
|
|
</div>
|
|
<div class="card-actions" v-if="userCanManageBroadcasting && hasStarted">
|
|
<a class="api-call no-reload btn btn-outline-secondary" :href="backendRestartUri">
|
|
<icon icon="update"></icon>
|
|
{{ $gettext('Restart') }}
|
|
</a>
|
|
<a class="api-call no-reload btn btn-outline-success" v-show="!np.services.backend_running"
|
|
:href="backendStartUri">
|
|
<icon icon="play_arrow"></icon>
|
|
{{ $gettext('Start') }}
|
|
</a>
|
|
<a class="api-call no-reload btn btn-outline-danger" v-show="np.services.backend_running"
|
|
:href="backendStopUri">
|
|
<icon icon="stop"></icon>
|
|
{{ $gettext('Stop') }}
|
|
</a>
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
<script>
|
|
import {BACKEND_LIQUIDSOAP} from '~/components/Entity/RadioAdapters.js';
|
|
import Icon from '~/components/Common/Icon';
|
|
import RunningBadge from "./Common/RunningBadge.vue";
|
|
|
|
export const profileBackendProps = {
|
|
props: {
|
|
numSongs: Number,
|
|
numPlaylists: Number,
|
|
backendType: String,
|
|
hasStarted: Boolean,
|
|
userCanManageBroadcasting: Boolean,
|
|
userCanManageMedia: Boolean,
|
|
manageMediaUri: String,
|
|
managePlaylistsUri: String,
|
|
backendRestartUri: String,
|
|
backendStartUri: String,
|
|
backendStopUri: String
|
|
}
|
|
};
|
|
|
|
export default {
|
|
inheritAttrs: false,
|
|
components: {RunningBadge, Icon},
|
|
mixins: [profileBackendProps],
|
|
props: {
|
|
np: Object
|
|
},
|
|
computed: {
|
|
langTotalTracks() {
|
|
let numSongsRaw = this.$ngettext('%{numSongs} uploaded song', '%{numSongs} uploaded songs', this.numSongs);
|
|
let numSongs = this.$gettextInterpolate(numSongsRaw, {numSongs: this.numSongs});
|
|
|
|
let numPlaylistsRaw = this.$ngettext('%{numPlaylists} playlist', '%{numPlaylists} playlists', this.numPlaylists);
|
|
let numPlaylists = this.$gettextInterpolate(numPlaylistsRaw, { numPlaylists: this.numPlaylists });
|
|
|
|
let translated = this.$gettext('LiquidSoap is currently shuffling from %{songs} and %{playlists}.');
|
|
return this.$gettextInterpolate(translated, {
|
|
songs: numSongs,
|
|
playlists: numPlaylists
|
|
});
|
|
},
|
|
backendName () {
|
|
if (this.backendType === BACKEND_LIQUIDSOAP) {
|
|
return 'Liquidsoap';
|
|
}
|
|
return '';
|
|
}
|
|
}
|
|
};
|
|
</script>
|