Commit c6658d17 authored by Richard Blechinger's avatar Richard Blechinger
Browse files

Update file structure, move edit playlist out of modal, fix bug with file uploads

parent 68061d17
......@@ -78,7 +78,7 @@
<b-row>
<b-col align="center">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="submitting new schedule"
>
</b-col>
......
......@@ -25,7 +25,7 @@
<span v-if="!loaded.scheduleTimeslots">
<br>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading schedule data"
>
</span>
......@@ -82,7 +82,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading schedule data"
>
</div>
......@@ -184,7 +184,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading timeslot data"
>
</div>
......@@ -202,7 +202,7 @@
>
<div>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading schedule data"
>
<b-progress
......
......@@ -277,7 +277,7 @@ export default {
},
editPlaylistItemDuration (index) {
console.log(this.playlistEditor.entries);
console.log(this.playlistEditor.entries, index);
},
movePlaylistItemUp (index) {
......@@ -314,7 +314,7 @@ export default {
// add a line input to the playlist that is being edited
addPlaylistItemLine (line) {
this.playlistEditor.entries.push({uri: 'line://' + line + '?duration=9999999' })
this.playlistEditor.entries.push({ uri: 'line://' + line, duration: 999999 })
},
// controls sub-modal to add a new URI to the playlist editor
......
......@@ -5,7 +5,7 @@
<b-row>
<b-col align="center">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</b-col>
......@@ -191,7 +191,7 @@
<template v-slot:cell(metadata.album)="data">
<span v-if="data.item.source.import.state === 'aborted'"><b-badge variant="danger">Error:</b-badge></span>
<span v-else-if="data.item.source.import.state !== 'done'"><img
src="../../assets/radio.gif"
src="/assets/radio.gif"
width="24"
alt="loading data"
></span>
......
......@@ -29,7 +29,7 @@
<div v-else>
<div align="center">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
width="96"
alt="loading data"
><br>
......
......@@ -7,7 +7,7 @@
<b-row>
<b-col align="center">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</b-col>
......@@ -58,21 +58,16 @@
This column displays the number of entries of the playlist.
-->
<template v-slot:cell(entries)="data">
{{ data.value.length }} items
<b-button
v-b-tooltip.html="playlistToolTip(data.value)"
variant="outline-success"
size="sm"
>
show entries
</b-button>
<span v-b-tooltip.html="playlistToolTip(data.value)" class="tw-underline hover:tw-no-underline tw-cursor-help">
{{ data.value.length }} items
</span>
</template>
<!-- Column: Duration
This column displays the duration of all playlist entries combined
-->
<template v-slot:cell(duration)="data">
{{ playlistDuration(data) }} ({{ unknownDurationCount(data) }} unspecified)
{{ playlistDuration(data) }}
</template>
<!-- Column: Last edit
......@@ -88,9 +83,12 @@
-->
<template v-slot:cell(actions)="data">
<b-button-group size="sm">
<b-button @click="editPlaylist(data.item.id)">
<b-button
:to="'/playlists/' + data.item.id"
>
Edit
</b-button>
<b-button
variant="danger"
@click="deletePlaylist(data.item.id)"
......@@ -205,14 +203,6 @@ export default {
return this.prettyNanoseconds(totalDuration)
},
unknownDurationCount({ item }) {
if (!item.entries) {
return 0
}
return item.entries.filter(entry => !entry.duration).length;
}
},
}
</script>
......@@ -47,7 +47,7 @@
<b-col cols="9">
<div v-if="!loaded.types">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</div>
......@@ -67,7 +67,7 @@
<b-col cols="9">
<div v-if="!loaded.fundingcategories">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</div>
......
......@@ -65,7 +65,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading playlists"
>
</div>
......
......@@ -5,7 +5,7 @@
<span v-if="loaded.shows">
{{ selectedShow.name }}
<img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit name of show"
@click="openModalName()"
>
......@@ -16,7 +16,7 @@
<template slot="lead">
<span v-if="loaded.shows">{{ selectedShow.short_description }}</span>
<img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit short description"
@click="openModalShortDescription()"
>
......@@ -24,7 +24,7 @@
<!-- The rest of the jumbotron is filled with the show description -->
<div v-if="loaded.shows">
<b>Description:</b> <img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit description"
@click="openModalDescription()"
>
......
......@@ -6,7 +6,7 @@
<b-badge style="width:80%;">
Categories:
</b-badge> <img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalCategories()"
>
......@@ -29,7 +29,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
height="24px"
alt="loading data"
><br>
......@@ -41,7 +41,7 @@
<b-badge style="width:80%;">
Topics:
</b-badge> <img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalTopics()"
>
......@@ -64,7 +64,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
height="24px"
alt="loading data"
><br>
......@@ -76,7 +76,7 @@
<b-badge style="width:80%;">
Musicfocus:
</b-badge> <img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalMusicFocus()"
>
......@@ -99,7 +99,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
height="24px"
alt="loading data"
><br>
......@@ -111,7 +111,7 @@
<b-badge style="width:80%;">
Languages:
</b-badge> <img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalLanguages()"
>
......@@ -134,7 +134,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
height="24px"
alt="loading data"
><br>
......@@ -146,7 +146,7 @@
<b-badge style="width:80%;">
Hosts:
</b-badge> <img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalHosts()"
>
......@@ -170,7 +170,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
height="24px"
alt="loading data"
><br>
......@@ -190,7 +190,7 @@
<b-col align="center">
<div v-if="!loaded.categories">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</div>
......@@ -225,7 +225,7 @@
<b-col align="center">
<div v-if="!loaded.topics">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</div>
......@@ -260,7 +260,7 @@
<b-col align="center">
<div v-if="!loaded.musicfocus">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</div>
......@@ -295,7 +295,7 @@
<b-col align="center">
<div v-if="!loaded.languages">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</div>
......@@ -330,7 +330,7 @@
<b-col align="center">
<div v-if="!loaded.hosts">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</div>
......
......@@ -5,7 +5,7 @@
<b-badge style="width:80%;">
Logo:
</b-badge> <img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalLogo()"
>
......@@ -29,7 +29,7 @@
<b-badge style="width:80%;">
Image:
</b-badge> <img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalImage()"
>
......
......@@ -9,7 +9,7 @@
>
Owners:
</b-badge> <img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalOwners()"
>
......@@ -41,7 +41,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
height="24px"
alt="loading data"
><br>
......@@ -137,7 +137,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
height="32px"
alt="loading user data"
>
......
......@@ -9,7 +9,7 @@
<span v-if="selectedShow.email === null"><small><i>(none set)</i></small></span>
<span v-else>{{ selectedShow.email }}</span>
<img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit contact e-mail"
@click="openModalEmail()"
>
......@@ -24,7 +24,7 @@
<span v-if="selectedShow.website === null"><small><i>(none set)</i></small></span>
<span v-else><a :href="selectedShow.website">{{ selectedShow.website }}</a></span>
<img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit website"
@click="openModalWebsite()"
>
......@@ -41,13 +41,13 @@
<span v-if="selectedShow.type === null"><small><i>(none set)</i></small></span>
<span v-else>{{ type }}</span>
<img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalType()"
>
</span>
<span v-else><img
src="../../assets/radio.gif"
src="/assets/radio.gif"
height="24px"
alt="loading data"
></span>
......@@ -64,13 +64,13 @@
<span v-if="selectedShow.fundingcategory === null"><small><i>(none set)</i></small></span>
<span v-else>{{ fundingCategory }}</span>
<img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalFundingCategory()"
>
</span>
<span v-else><img
src="../../assets/radio.gif"
src="/assets/radio.gif"
height="24px"
alt="loading data"
></span>
......@@ -87,7 +87,7 @@
<span v-if="selectedShow.predecessor === null"><small><i>This show has no predecessor show.</i></small></span>
<span v-else>{{ predecessorName }}</span>
<img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalPredecessor()"
>
......@@ -102,7 +102,7 @@
<span v-if="selectedShow.cba_series_id === null"><small><i>(none set)</i></small></span>
<span v-else>{{ selectedShow.cba_series_id }}</span>
<img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit CBA series ID"
@click="openModalCBAid()"
>
......@@ -117,7 +117,7 @@
<span v-if="!selectedShow.fallback_id"><small><i>(none set)</i></small></span>
<span v-else>{{ fallbackInfo }}</span>
<img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="edit"
@click="openModalFallback()"
>
......@@ -216,7 +216,7 @@
<b-col align="center">
<div v-if="!loaded">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</div>
......@@ -240,7 +240,7 @@
<b-col align="center">
<div v-if="!loaded">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
>
</div>
......
......@@ -85,7 +85,7 @@
</div>
<div v-else>
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading playlists"
>
</div>
......
......@@ -117,7 +117,7 @@
class="timeslotEditLink"
@click="editTimeslotNote(data.item.options.id, data.item.options.schedule)"
><img
src="../../assets/16x16/emblem-system.png"
src="/assets/16x16/emblem-system.png"
alt="Edit description"
title="Edit description"
></span>
......@@ -125,7 +125,7 @@
class="timeslotEditLink"
@click="editTimeslotPlaylist(selectedShow, data.item.options.schedule, data.item.options.id)"
><img
src="../../assets/16x16/media-eject.png"
src="/assets/16x16/media-eject.png"
alt="Edit playlist"
title="Edit playlist"
></span>
......@@ -134,7 +134,7 @@
class="timeslotEditLink"
@click="notYetImplemented()"
><img
src="../../assets/16x16/media-playback-start.png"
src="/assets/16x16/media-playback-start.png"
alt="Open player"
title="Open player"
></span>
......@@ -158,7 +158,7 @@
<div v-else>
<div style="text-align: center;">
<img
src="../../assets/radio.gif"
src="/assets/radio.gif"
alt="loading data"
><br>
</div>
......
......@@ -4,7 +4,7 @@ import router from './router'
import store from './store'
import BootstrapVue from 'bootstrap-vue'
import VueLogger from 'vuejs-logger';
import './assets/tailwind.css'
import '../public/assets/tailwind.css'
// Use this if you also have to debug a production build
// Only use it temporarily!
......
......@@ -84,11 +84,17 @@ export default {
var hours = Math.floor(sec_total / 3600)
var minutes = Math.floor((sec_total - (hours * 3600)) / 60)
var seconds = Math.floor((sec_total - (hours * 3600) - (minutes * 60)) * 10) / 10
return hours + ':' + leadingZero(minutes) + ':' + leadingZero(seconds.toFixed(0))
return leadingZero(hours) + ':' + leadingZero(minutes) + ':' + leadingZero(seconds.toFixed(0))
},
nanosecondsToMinutes: function(ns) {
return ns / 1000 / 1000 / 1000 / 60;
},
hmsToNanoseconds: function(hms) {
const parts = hms.split(':');
const seconds = (+parts[0]) * 60 * 60 + (+parts[1]) * 60 + (+parts[2]);
return seconds * 1000 * 1000 * 1000;
},
prettyWeekday: function(weekday) {
return day[weekday];
}
......
import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Help from '@/components/Help'
import Credits from '@/components/Credits'
import Settings from '@/components/Settings'
import ShowManager from '@/components/ShowManager'
import FileManager from '@/components/FileManager'
import EmissionManager from '@/components/EmissionManager'
import Home from '@/Pages/Home'
import Help from '@/Pages/Help'
import Credits from '@/Pages/Credits'
import Settings from '@/Pages/Settings'
import ShowManager from '@/Pages/ShowManager'
import FileManager from '@/Pages/FileManager'
import EmissionManager from '@/Pages/EmissionManager'
import EditPlaylist from '@/Pages/EditPlaylist'
Vue.use(Router)
export default new Router({
mode: 'history',
routes: [
{ path: '/', alias: '/home', name: 'home', component: Home },
{ path: '/shows', name: 'shows', component: ShowManager },
......@@ -19,5 +21,6 @@ export default new Router({
{ path: '/help', name: 'help', component: Help },
{ path: '/settings', name: 'settings', component: Settings },
{ path: '/credits', name: 'credits', component: Credits },
{ path: '/playlists/:id', name: 'editPlaylist', component: EditPlaylist, props: true }
]
})
......@@ -146,7 +146,8 @@ const actions = {
if (!data.addNewFileURI) {
ctx.dispatch('startUpload', {
show: data.show,
file: response.data.id
file: response.data.id,
...data
})
}
if (data && typeof(data.callback) === 'function') { data.callback() }
......@@ -197,12 +198,14 @@ const actions = {
flow.addFile(this.uploadSourceFile)
flow.upload()
*/
let uri = process.env.VUE_APP_API_TANK + 'shows/' + data.show + '/files/' + data.file + '/upload'
console.log(data);
axios.put(uri, data.uploadSourceFile, {
withCredentials: true,
headers: {
'Authorization': 'Bearer ' + ctx.rootState.auth.tank.session_token,
'Content-Type': 'application/octet-stream'
'Content-Type': 'application/octet-stream',
}
}).then(() => {
this.$log.info('Sucessfully uploaded file: ' + data.uploadSourceFile.name)
......
......@@ -32,7 +32,8 @@ const getters = {
getPlaylistById: state => id => {
let list
if (id !== undefined) {
list = state.playlists.find(l => l.id === id)
list = state.playlists.find(l => l.id == id);
if (list === undefined) {
console.log('[ERROR] getPlaylistById: ID not found in store!')
}
......