Frontend: Suggest reload when PhotoPrism has been updated

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-07-12 04:06:55 +02:00
parent e1c45c4d5f
commit 8470eb4bf1
8 changed files with 129 additions and 37 deletions

View file

@ -71,8 +71,6 @@ export default class Config {
} else {
this.setTheme("default");
}
}
update() {
@ -89,6 +87,10 @@ export default class Config {
console.log("config: new values", values);
}
if(values.jsHash && this.values.jsHash !== values.jsHash) {
Event.publish("dialog.reload", {values});
}
for (let key in values) {
if (values.hasOwnProperty(key)) {
this.set(key, values[key]);

View file

@ -404,6 +404,7 @@
</v-list-tile>
</v-list>
</v-navigation-drawer>
<p-reload-dialog :show="reload.dialog" @close="reload.dialog = false"></p-reload-dialog>
<p-upload-dialog :show="upload.dialog" @cancel="upload.dialog = false"
@confirm="upload.dialog = false"></p-upload-dialog>
<p-photo-edit-dialog :show="edit.dialog" :selection="edit.selection" :index="edit.index" :album="edit.album"
@ -426,6 +427,10 @@
readonly: this.$config.get("readonly"),
config: this.$config.values,
page: this.$config.page,
reload: {
subscription: null,
dialog: false,
},
upload: {
subscription: null,
dialog: false,
@ -476,6 +481,7 @@
},
},
created() {
this.reload.subscription = Event.subscribe("dialog.reload", () => this.reload.dialog = true);
this.upload.subscription = Event.subscribe("dialog.upload", () => this.upload.dialog = true);
this.edit.subscription = Event.subscribe("dialog.edit", (ev, data) => {
@ -488,6 +494,7 @@
});
},
destroyed() {
Event.unsubscribe(this.reload.subscription);
Event.unsubscribe(this.upload.subscription);
Event.unsubscribe(this.edit.subscription);
}

View file

@ -42,6 +42,7 @@ import PVideoDialog from "./video.vue";
import PShareDialog from "./share.vue";
import PShareUploadDialog from "./share/upload.vue";
import PWebdavDialog from "./webdav.vue";
import PReloadDialog from "./reload.vue";
const dialogs = {};
@ -60,6 +61,7 @@ dialogs.install = (Vue) => {
Vue.component("p-share-dialog", PShareDialog);
Vue.component("p-share-upload-dialog", PShareUploadDialog);
Vue.component("p-webdav-dialog", PWebdavDialog);
Vue.component("p-reload-dialog", PReloadDialog);
};
export default dialogs;

View file

@ -0,0 +1,63 @@
<template>
<v-dialog v-model="visible" max-width="300">
<v-card>
<v-card-title class="subheading pa-3">
<translate>PhotoPrism has been updated</translate>
</v-card-title>
<v-card-actions class="pa-3">
<v-spacer></v-spacer>
<v-btn
color="secondary-light"
depressed small
@click="close"
>
<translate>Cancel</translate>
</v-btn>
<v-btn
color="secondary-dark"
dark depressed small
@click="reload"
>
<translate>Reload</translate>
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
export default {
name: 'p-dialog-webdav',
props: {
show: Boolean,
},
data() {
return {
visible: this.show,
};
},
watch: {
show(val) {
this.visible = val;
},
visible(val) {
if (!val) {
this.close();
}
},
},
methods: {
close() {
this.$emit('close');
},
reload() {
this.$notify.info(this.$gettext("Reloading…"));
this.$notify.blockUI();
setTimeout(() => window.location.reload(), 100);
},
},
};
</script>

Binary file not shown.

View file

@ -17,7 +17,7 @@ msgstr ""
msgid "%{n} albums found"
msgstr "%{n} Alben gefunden"
#: src/pages/album/photos.vue:358 src/share/photos.vue:401
#: src/pages/album/photos.vue:354 src/share/photos.vue:397
msgid "%{n} entries found"
msgstr "%{n} Einträge gefunden"
@ -33,7 +33,7 @@ msgstr "%{n} Ordner gefunden"
msgid "%{n} labels found"
msgstr "%{n} Kategorien gefunden"
#: src/pages/photos.vue:391
#: src/pages/photos.vue:387
msgid "%{n} results"
msgstr "%{n} Ergebnisse"
@ -151,7 +151,7 @@ msgstr "Alben gelöscht"
msgid "All %{n} albums loaded"
msgstr "Alle %{n} Alben werden angezeigt"
#: src/pages/album/photos.vue:255 src/share/photos.vue:298
#: src/pages/album/photos.vue:251 src/share/photos.vue:294
msgid "All %{n} entries loaded"
msgstr "Alle %{n} Einträge werden angezeigt"
@ -314,17 +314,17 @@ msgstr "Kamera"
msgid "Camera Serial"
msgstr "Kamera-Seriennummer"
#: src/pages/album/photos.vue:261 src/pages/photos.vue:296
#: src/share/photos.vue:304
#: src/pages/album/photos.vue:257 src/pages/photos.vue:292
#: src/share/photos.vue:300
msgid "Can't load more, limit reached"
msgstr "Limit erreicht, bitte Suche eingrenzen"
#: src/dialog/account/add.vue:81 src/dialog/account/edit.vue:95
#: src/dialog/account/remove.vue:13 src/dialog/album/delete.vue:13
#: src/dialog/album/edit.vue:39 src/dialog/label/delete.vue:13
#: src/dialog/photo/album.vue:15 src/dialog/share.vue:155
#: src/dialog/share/upload.vue:29 src/pages/library/import.vue:34
#: src/pages/library/index.vue:26
#: src/dialog/photo/album.vue:15 src/dialog/reload.vue:11
#: src/dialog/share.vue:155 src/dialog/share/upload.vue:29
#: src/pages/library/import.vue:34 src/pages/library/index.vue:26
msgid "Cancel"
msgstr "Abbrechen"
@ -986,11 +986,11 @@ msgstr "Mehr als 20 Alben gefunden"
msgid "More than 20 labels found"
msgstr "Mehr als 20 Labels gefunden"
#: src/pages/album/photos.vue:361 src/share/photos.vue:404
#: src/pages/album/photos.vue:357 src/share/photos.vue:400
msgid "More than 50 entries found"
msgstr "Mehr als 50 Einträge gefunden"
#: src/pages/photos.vue:394
#: src/pages/photos.vue:390
msgid "More than 50 results"
msgstr "Mehr als 50 Ergebnisse"
@ -1054,7 +1054,7 @@ msgstr "Nein"
msgid "No albums found"
msgstr "Keine Alben gefunden"
#: src/pages/album/photos.vue:354 src/share/photos.vue:397
#: src/pages/album/photos.vue:350 src/share/photos.vue:393
msgid "No entries found"
msgstr "Keine Einträge gefunden"
@ -1066,7 +1066,7 @@ msgstr "Keine Labels gefunden"
msgid "No photos found"
msgstr "Keine Bilder gefunden"
#: src/pages/photos.vue:387
#: src/pages/photos.vue:383
msgid "No results"
msgstr "Keine Ergebnisse"
@ -1161,7 +1161,7 @@ msgstr "Einmal die Woche"
msgid "One album found"
msgstr "Ein Album gefunden"
#: src/pages/album/photos.vue:356 src/share/photos.vue:399
#: src/pages/album/photos.vue:352 src/share/photos.vue:395
msgid "One entry found"
msgstr "Ein Eintrag gefunden"
@ -1173,7 +1173,7 @@ msgstr "Eine Datei gefunden"
msgid "One folder found"
msgstr "Ein Ordner gefunden"
#: src/pages/photos.vue:389
#: src/pages/photos.vue:385
msgid "One result"
msgstr "Ein Ergebnis"
@ -1231,6 +1231,10 @@ msgstr ""
"PhotoPrism analysiert im Hintergrund deine Bilder und erstellt Alben mit "
"besonderen Momenten, Reisen und Orten."
#: src/dialog/reload.vue:4
msgid "PhotoPrism has been updated…"
msgstr "PhotoPrism wurde aktualisiert…"
#: src/pages/about/about.vue:74
msgid "PhotoPrism™ is a registered trademark of Michael Mayer."
msgstr "PhotoPrism™ ist ein registriertes Markenzeichen von Michael Mayer."
@ -1332,7 +1336,11 @@ msgstr "Zuletzt hinzugefügt"
msgid "Red"
msgstr "Rot"
#: src/pages/settings/general.vue:377
#: src/dialog/reload.vue:15
msgid "Reload"
msgstr "Neu laden"
#: src/dialog/reload.vue:57 src/pages/settings/general.vue:377
msgid "Reloading…"
msgstr "Wird neu geladen…"
@ -1476,7 +1484,7 @@ msgstr "Datei-Verwaltung in der Hauptnavigation anzeigen."
msgid "Show server logs in Library."
msgstr "Server-Ereignisprotokoll anzeigen, um Fehler zu finden."
#: src/pages/photos.vue:290
#: src/pages/photos.vue:286
msgid "Showing all %{n} results"
msgstr "Alle %{n} Ergebnisse werden angezeigt"

File diff suppressed because one or more lines are too long

View file

@ -10,8 +10,8 @@ msgstr ""
msgid "%{n} albums found"
msgstr ""
#: src/pages/album/photos.vue:358
#: src/share/photos.vue:401
#: src/pages/album/photos.vue:354
#: src/share/photos.vue:397
msgid "%{n} entries found"
msgstr ""
@ -27,7 +27,7 @@ msgstr ""
msgid "%{n} labels found"
msgstr ""
#: src/pages/photos.vue:391
#: src/pages/photos.vue:387
msgid "%{n} results"
msgstr ""
@ -152,8 +152,8 @@ msgstr ""
msgid "All %{n} albums loaded"
msgstr ""
#: src/pages/album/photos.vue:255
#: src/share/photos.vue:298
#: src/pages/album/photos.vue:251
#: src/share/photos.vue:294
msgid "All %{n} entries loaded"
msgstr ""
@ -323,9 +323,9 @@ msgstr ""
msgid "Camera Serial"
msgstr ""
#: src/pages/album/photos.vue:261
#: src/pages/photos.vue:296
#: src/share/photos.vue:304
#: src/pages/album/photos.vue:257
#: src/pages/photos.vue:292
#: src/share/photos.vue:300
msgid "Can't load more, limit reached"
msgstr ""
@ -336,6 +336,7 @@ msgstr ""
#: src/dialog/album/edit.vue:39
#: src/dialog/label/delete.vue:13
#: src/dialog/photo/album.vue:15
#: src/dialog/reload.vue:11
#: src/dialog/share.vue:155
#: src/dialog/share/upload.vue:29
#: src/pages/library/import.vue:34
@ -1043,12 +1044,12 @@ msgstr ""
msgid "More than 20 labels found"
msgstr ""
#: src/pages/album/photos.vue:361
#: src/share/photos.vue:404
#: src/pages/album/photos.vue:357
#: src/share/photos.vue:400
msgid "More than 50 entries found"
msgstr ""
#: src/pages/photos.vue:394
#: src/pages/photos.vue:390
msgid "More than 50 results"
msgstr ""
@ -1128,8 +1129,8 @@ msgstr ""
msgid "No albums found"
msgstr ""
#: src/pages/album/photos.vue:354
#: src/share/photos.vue:397
#: src/pages/album/photos.vue:350
#: src/share/photos.vue:393
msgid "No entries found"
msgstr ""
@ -1142,7 +1143,7 @@ msgstr ""
msgid "No photos found"
msgstr ""
#: src/pages/photos.vue:387
#: src/pages/photos.vue:383
msgid "No results"
msgstr ""
@ -1224,8 +1225,8 @@ msgstr ""
msgid "One album found"
msgstr ""
#: src/pages/album/photos.vue:356
#: src/share/photos.vue:399
#: src/pages/album/photos.vue:352
#: src/share/photos.vue:395
msgid "One entry found"
msgstr ""
@ -1237,7 +1238,7 @@ msgstr ""
msgid "One folder found"
msgstr ""
#: src/pages/photos.vue:389
#: src/pages/photos.vue:385
msgid "One result"
msgstr ""
@ -1295,6 +1296,10 @@ msgstr ""
msgid "PhotoPrism continuously analyzes your library to find special moments, journeys and places."
msgstr ""
#: src/dialog/reload.vue:4
msgid "PhotoPrism has been updated…"
msgstr ""
#: src/pages/about/about.vue:74
msgid "PhotoPrism™ is a registered trademark of Michael Mayer."
msgstr ""
@ -1406,6 +1411,11 @@ msgstr ""
msgid "Red"
msgstr ""
#: src/dialog/reload.vue:15
msgid "Reload"
msgstr ""
#: src/dialog/reload.vue:57
#: src/pages/settings/general.vue:377
msgid "Reloading…"
msgstr ""
@ -1565,7 +1575,7 @@ msgstr ""
msgid "Show server logs in Library."
msgstr ""
#: src/pages/photos.vue:290
#: src/pages/photos.vue:286
msgid "Showing all %{n} results"
msgstr ""