1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-14 22:22:39 +01:00

add button (#34)

This commit is contained in:
Viktor Geringer 2017-01-31 16:13:15 +01:00 committed by Tim Meier
parent b954375d44
commit 1d332f19b1
2 changed files with 13 additions and 2 deletions

View File

@ -18,8 +18,7 @@
Route::post('/import', 'SettingController@import');
Route::get('/check-update', 'SettingController@checkForUpdate');
// todo: POST
Route::get('/fetch-files', 'SettingController@fetchFiles');
Route::post('/fetch-files', 'SettingController@fetchFiles');
Route::get('/sync-scout', 'SettingController@syncScout');
Route::patch('/update-genre', 'SettingController@updateGenre');

View File

@ -10,6 +10,7 @@
</div>
<div class="misc-btn-wrap">
<button @click="fetchFiles()" class="export-btn">Update files</button>
<button @click="updateGenre()" class="export-btn">{{ lang('update genre') }}</button>
<button @click="updateAlternativeTitles()" class="export-btn">Update alternative titles</button>
<button @click="syncScout()" class="export-btn">{{ lang('sync scout') }}</button>
@ -56,6 +57,17 @@
methods: {
...mapMutations([ 'SET_LOADING' ]),
fetchFiles() {
this.SET_LOADING(true);
http.post(`${config.api}/fetch-files`).then(() => {
this.SET_LOADING(false);
}).catch(error => {
this.SET_LOADING(false);
alert(error.response.data);
});
},
checkUpdate() {
http(`${config.api}/check-update`).then(response => {
this.isUpdate = response.data;