2015-12-13 04:42:28 +00:00
|
|
|
<template>
|
2016-01-06 10:57:45 +00:00
|
|
|
<section id="settingsWrapper">
|
2015-12-13 04:42:28 +00:00
|
|
|
<h1 class="heading">
|
|
|
|
<span>Settings</span>
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
<form @submit.prevent="save" class="main-scroll-wrap">
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="inputSettingsPath">Media Path</label>
|
|
|
|
<p class="help">
|
|
|
|
The <em>absolute</em> path to the server directory containing your media.
|
|
|
|
Koel will scan this directory for songs and extract any available information.<br>
|
2016-01-03 17:04:52 +00:00
|
|
|
Scanning may take a while, especially if you have a lot of songs, so be patient.
|
2015-12-13 04:42:28 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<input type="text" v-model="state.settings.media_path" id="inputSettingsPath">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-row">
|
|
|
|
<button type="submit">Scan</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2016-01-06 10:57:45 +00:00
|
|
|
</section>
|
2015-12-13 04:42:28 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import settingStore from '../../../stores/setting';
|
2015-12-15 16:28:54 +00:00
|
|
|
import utils from '../../../services/utils';
|
2015-12-13 04:42:28 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
state: settingStore.state,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
/**
|
|
|
|
* Save the settings.
|
|
|
|
*/
|
|
|
|
save() {
|
2015-12-15 16:28:54 +00:00
|
|
|
this.$root.showOverlay();
|
2015-12-13 04:42:28 +00:00
|
|
|
|
|
|
|
settingStore.update(() => {
|
2016-01-01 07:47:03 +00:00
|
|
|
// Re-init the app.
|
|
|
|
this.$root.init();
|
2016-01-07 09:03:38 +00:00
|
|
|
}, error => {
|
2016-01-01 07:47:03 +00:00
|
|
|
var msg = 'Unknown error.';
|
|
|
|
|
|
|
|
if (error.status === 422) {
|
|
|
|
msg = utils.parseValidationError(error.data)[0];
|
2015-12-15 16:28:54 +00:00
|
|
|
}
|
|
|
|
|
2016-01-01 07:47:03 +00:00
|
|
|
this.$root.showOverlay(`Error: ${msg}`, 'error', true);
|
2015-12-13 04:42:28 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="sass">
|
2016-03-13 17:00:32 +00:00
|
|
|
@import "../../../../sass/partials/_vars.scss";
|
|
|
|
@import "../../../../sass/partials/_mixins.scss";
|
2015-12-13 04:42:28 +00:00
|
|
|
|
|
|
|
#settingsWrapper {
|
|
|
|
input[type="text"] {
|
|
|
|
width: 384px;
|
|
|
|
margin-top: 12px;
|
|
|
|
}
|
|
|
|
|
2016-01-16 18:11:24 +00:00
|
|
|
@media only screen and (max-device-width : 667px) {
|
2015-12-13 04:42:28 +00:00
|
|
|
input[type="text"] {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|