2020-11-15 21:30:53 +00:00
|
|
|
<template>
|
2020-11-16 20:32:25 +00:00
|
|
|
<AppSidebar
|
|
|
|
v-show="showSidebar"
|
2020-11-15 21:30:53 +00:00
|
|
|
:title="sidebarStation.name"
|
|
|
|
:subtitle="stationTags"
|
2020-11-16 20:32:25 +00:00
|
|
|
:background="sidebarStation.favicon"
|
|
|
|
class="has-preview"
|
2020-11-17 12:32:15 +00:00
|
|
|
@close="toggleSidebar">
|
2020-11-16 20:32:25 +00:00
|
|
|
<div class="configBox">
|
|
|
|
<span class="icon icon-link" />
|
|
|
|
<span class="title">
|
|
|
|
Stream URL
|
|
|
|
</span>
|
|
|
|
<div class="content">
|
2020-11-19 09:16:00 +00:00
|
|
|
<input type="text" :value="urlResolved" disabled="disabled">
|
2020-11-16 20:32:25 +00:00
|
|
|
<Actions>
|
2020-11-19 09:16:00 +00:00
|
|
|
<ActionButton icon="icon-clippy" @click="copyLink">
|
2020-11-16 20:32:25 +00:00
|
|
|
{{ t('radio', 'Copy link to clipboard') }}
|
|
|
|
</ActionButton>
|
|
|
|
</Actions>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="configBox">
|
|
|
|
<span class="icon icon-external" />
|
|
|
|
<span class="title">
|
|
|
|
Homepage
|
|
|
|
</span>
|
|
|
|
<div class="content">
|
|
|
|
<span>
|
|
|
|
<a
|
|
|
|
:href="sidebarStation.homepage"
|
|
|
|
target="new">
|
|
|
|
{{ sidebarStation.homepage }}
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="configBox">
|
|
|
|
<span class="icon icon-details" />
|
|
|
|
<span class="title">
|
|
|
|
Country & Language
|
|
|
|
</span>
|
|
|
|
<div class="content">
|
|
|
|
<span>
|
|
|
|
{{ sidebarStation.country }}, {{ sidebarStation.language }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="configBox">
|
|
|
|
<span class="icon icon-details" />
|
|
|
|
<span class="title">
|
|
|
|
Codec & Bitrate
|
|
|
|
</span>
|
|
|
|
<div class="content">
|
|
|
|
<span>
|
|
|
|
{{ sidebarStation.codec }}, {{ sidebarStation.bitrate }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-11-15 21:30:53 +00:00
|
|
|
</AppSidebar>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import AppSidebar from '@nextcloud/vue/dist/Components/AppSidebar'
|
|
|
|
import Actions from '@nextcloud/vue/dist/Components/Actions'
|
|
|
|
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
|
2020-11-19 09:16:00 +00:00
|
|
|
import { showError, showSuccess } from '@nextcloud/dialogs'
|
2020-11-15 21:30:53 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Sidebar',
|
|
|
|
components: {
|
|
|
|
AppSidebar,
|
|
|
|
Actions,
|
|
|
|
ActionButton,
|
|
|
|
},
|
2020-11-16 20:32:25 +00:00
|
|
|
props: {
|
|
|
|
showSidebar: {
|
|
|
|
type: Boolean,
|
|
|
|
default() { return false },
|
|
|
|
},
|
|
|
|
sidebarStation: {
|
2020-11-19 21:35:13 +00:00
|
|
|
type: Object,
|
|
|
|
default() {
|
|
|
|
return {}
|
|
|
|
},
|
2020-11-16 20:32:25 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
2020-11-19 09:16:00 +00:00
|
|
|
urlResolved() {
|
|
|
|
if (this.sidebarStation.url_resolved) {
|
|
|
|
return this.sidebarStation.url_resolved
|
|
|
|
} else {
|
|
|
|
return this.sidebarStation.urlresolved
|
|
|
|
}
|
|
|
|
},
|
2020-11-16 20:32:25 +00:00
|
|
|
stationTags() {
|
|
|
|
if (this.sidebarStation.tags) {
|
|
|
|
return this.sidebarStation.tags.replaceAll(',', ', ')
|
|
|
|
}
|
|
|
|
return ''
|
|
|
|
},
|
|
|
|
},
|
2020-11-17 12:32:15 +00:00
|
|
|
methods: {
|
|
|
|
toggleSidebar(station) {
|
|
|
|
this.$emit('toggleSidebar')
|
|
|
|
},
|
2020-11-19 09:16:00 +00:00
|
|
|
copyLink() {
|
2020-11-19 21:35:13 +00:00
|
|
|
console.log(this.sidebarStation.favicon)
|
2020-11-19 09:16:00 +00:00
|
|
|
this.$copyText(this.urlResolved).then(
|
|
|
|
function() {
|
|
|
|
showSuccess(t('radio', 'Link copied to clipboard'))
|
|
|
|
},
|
|
|
|
function() {
|
|
|
|
showError(t('radio', 'Error while copying link to clipboard'))
|
|
|
|
}
|
|
|
|
)
|
|
|
|
},
|
2020-11-17 12:32:15 +00:00
|
|
|
},
|
2020-11-15 21:30:53 +00:00
|
|
|
}
|
|
|
|
</script>
|
2020-11-16 20:32:25 +00:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
.app-sidebar {
|
|
|
|
&.has-preview::v-deep {
|
|
|
|
.app-sidebar-header__figure {
|
|
|
|
background-size: cover;
|
|
|
|
height: 200px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.configBox {
|
|
|
|
padding: 0 15px;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.configBox .title {
|
|
|
|
font-size: 1.2em;
|
|
|
|
display: block;
|
|
|
|
margin-bottom: 15px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.configBox .icon {
|
|
|
|
float: left;
|
|
|
|
margin: 4px 7px 0px 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.configBox .content {
|
|
|
|
display: flex;
|
|
|
|
margin-left: 25px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.configBox .content input {
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.configBox .content button {
|
|
|
|
margin-top: -3px;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|