implement add custom radio station (fixes #157)

This commit is contained in:
Jonas Heinrich 2021-03-10 17:31:44 +01:00
parent 230afae5f1
commit eef14a79b7
2 changed files with 42 additions and 25 deletions

View File

@ -42,9 +42,10 @@ testing:
packaging: packaging:
stage: packaging stage: packaging
image: ubuntu:rolling
script: script:
- apt update - apt update
- DEBIAN_FRONTEND="noninteractive" apt install -y wget sudo gettext php php-simplexml - DEBIAN_FRONTEND="noninteractive" apt install -y wget sudo gettext php php-simplexml nodejs npm
- wget https://github.com/ChristophWurst/krankerl/releases/download/v0.13.0/krankerl_0.13.0_amd64.deb - wget https://github.com/ChristophWurst/krankerl/releases/download/v0.13.0/krankerl_0.13.0_amd64.deb
- sudo dpkg -i krankerl_0.13.0_amd64.deb - sudo dpkg -i krankerl_0.13.0_amd64.deb
- krankerl package - krankerl package

View File

@ -68,7 +68,7 @@
<h2 class="oc-dialog-title"> <h2 class="oc-dialog-title">
{{ t('radio', 'Add custom station') }} {{ t('radio', 'Add custom station') }}
</h2> </h2>
<form> <form @submit="addCustomStation">
<label for="stationName">{{ t('radio', 'Name') }}:</label> <label for="stationName">{{ t('radio', 'Name') }}:</label>
<input <input
id="stationName" id="stationName"
@ -85,16 +85,16 @@
<input <input
id="faviconUrl" id="faviconUrl"
v-model="station.faviconUrl" v-model="station.faviconUrl"
type="url" type="url">
required>
</form>
<div class="formControls"> <div class="formControls">
<!-- FIXME: Use nextcloud-vue button component --> <!-- FIXME: Use nextcloud-vue button component -->
<button class="icon-add-white primary button new-button" <button
@click="addCustomStation()"> type="submit"
class="icon-add-white primary button new-button">
{{ t('radio', 'Add station') }} {{ t('radio', 'Add station') }}
</button> </button>
</div> </div>
</form>
</div> </div>
</Modal> </Modal>
</AppContent> </AppContent>
@ -144,7 +144,9 @@ export default {
sidebarStation: {}, sidebarStation: {},
tableData: [], tableData: [],
modal: true, modal: true,
station: {}, station: {
faviconUrl: '',
},
}), }),
computed: { computed: {
...mapGetters([ ...mapGetters([
@ -241,9 +243,22 @@ export default {
this.modal = false this.modal = false
}, },
addCustomStation() { addCustomStation(e) {
console.log('Add custom station', this.station.name) e.preventDefault()
// this.addFavorite(station) const station = {
name: this.station.name,
urlresolved: this.station.streamUrl,
favicon: this.station.faviconUrl,
stationuuid: '932eb148-e6f6-11e9-a96c-52543be04c81',
bitrate: '',
country: '',
language: '',
homepage: '',
codec: '',
tags: '',
}
this.addFavorite(station)
this.modal = false
}, },
}, },
@ -289,13 +304,13 @@ export default {
grid-template-columns: 100px 1fr; grid-template-columns: 100px 1fr;
align-items: center; align-items: center;
// FIXME: No flex gap support in Chrome // FIXME: No flex gap support in Chrome
margin-bottom: 15px;
}
.formControls { .formControls {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
margin-right: 40px; margin-right: 40px;
margin-top: 10px;
grid-column: 1 / 3;
.button { .button {
padding-left: 35px; padding-left: 35px;
@ -303,6 +318,7 @@ export default {
background-position: 10px center; background-position: 10px center;
} }
} }
}
} }
@media only screen and (max-width: 1024px) { @media only screen and (max-width: 1024px) {