Auth: Implement 2FA setup and login in the web user interface #808 #3943

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-03-21 14:32:51 +01:00
parent cfe88f141b
commit 4425becb3d
222 changed files with 6384 additions and 7622 deletions

View File

@@ -50,6 +50,15 @@ module.exports = {
"vue/no-v-text-v-html-on-component": 0,
"vue/valid-model-definition": 0,
"vue/valid-attribute-name": 0,
"vue/singleline-html-element-content-newline": [
"off",
{
ignoreWhenNoAttributes: true,
ignoreWhenEmpty: true,
ignores: ["pre", "textarea", "span", "translate", "a", "v-icon", "v-text-field", "v-input", "v-select", "v-switch", "v-checkbox", "v-img"],
externalIgnores: [],
},
],
"vue/first-attribute-linebreak": [
"error",
{
@@ -60,7 +69,7 @@ module.exports = {
"prettier/prettier": [
"warn",
{
printWidth: 100,
printWidth: 300,
singleQuote: false,
semi: true,
trailingComma: "es5",

View File

@@ -52,13 +52,7 @@ module.exports = (config) => {
customLaunchers: {
LocalChrome: {
base: "ChromeHeadless",
flags: [
"--disable-translate",
"--disable-extensions",
"--no-sandbox",
"--disable-web-security",
"--disable-dev-shm-usage",
],
flags: ["--disable-translate", "--disable-extensions", "--no-sandbox", "--disable-web-security", "--disable-dev-shm-usage"],
},
},
@@ -136,11 +130,7 @@ module.exports = (config) => {
fallback: {
util: require.resolve("util"),
},
modules: [
path.join(__dirname, "src"),
path.join(__dirname, "node_modules"),
path.join(__dirname, "tests/unit"),
],
modules: [path.join(__dirname, "src"), path.join(__dirname, "node_modules"), path.join(__dirname, "tests/unit")],
preferRelative: true,
alias: {
vue: "vue/dist/vue.min.js",
@@ -157,10 +147,7 @@ module.exports = (config) => {
options: {
compact: false,
presets: ["@babel/preset-env"],
plugins: [
"@babel/plugin-transform-runtime",
["istanbul", { exclude: ["**/*_test.js"] }],
],
plugins: ["@babel/plugin-transform-runtime", ["istanbul", { exclude: ["**/*_test.js"] }]],
},
},
],

File diff suppressed because it is too large Load Diff

View File

@@ -21,16 +21,16 @@
"dep-list": "npx npm-check-updates"
},
"dependencies": {
"@babel/cli": "^7.23.9",
"@babel/core": "^7.24.0",
"@babel/eslint-parser": "^7.23.10",
"@babel/plugin-transform-runtime": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.3",
"@babel/eslint-parser": "^7.24.1",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"@babel/register": "^7.23.7",
"@babel/runtime": "^7.24.0",
"@babel/runtime": "^7.24.1",
"@lcdp/offline-plugin": "^5.1.1",
"@vvo/tzdb": "^6.126.0",
"axios": "^1.6.7",
"axios": "^1.6.8",
"axios-mock-adapter": "^1.22.0",
"babel-loader": "^9.1.3",
"babel-plugin-istanbul": "^6.1.1",
@@ -38,10 +38,10 @@
"chai": "^5.1.0",
"cheerio": "^1.0.0-rc.12",
"chrome-finder": "^1.0.7",
"core-js": "^3.36.0",
"core-js": "^3.36.1",
"cross-env": "^7.0.3",
"css-loader": "^6.10.0",
"cssnano": "^6.1.0",
"cssnano": "^6.1.1",
"easygettext": "^2.17.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
@@ -53,7 +53,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.23.0",
"eslint-webpack-plugin": "^4.0.1",
"eslint-webpack-plugin": "^4.1.0",
"eventsource-polyfill": "^0.9.6",
"file-loader": "^6.2.0",
"file-saver": "^2.0.5",
@@ -74,10 +74,10 @@
"mocha": "^10.3.0",
"node-storage-shim": "^2.0.1",
"photoswipe": "^4.1.3",
"postcss": "^8.4.35",
"postcss-import": "^16.0.1",
"postcss": "^8.4.38",
"postcss-import": "^16.1.0",
"postcss-loader": "^8.1.1",
"postcss-preset-env": "^9.5.1",
"postcss-preset-env": "^9.5.2",
"postcss-reporter": "^7.1.0",
"postcss-url": "^10.1.3",
"prettier": "^3.2.5",
@@ -86,7 +86,7 @@
"resolve-url-loader": "^5.0.0",
"sass": "^1.72.0",
"sass-loader": "^14.1.1",
"server": "^1.0.38",
"server": "^1.0.39",
"sockette": "^2.0.6",
"style-loader": "^3.3.4",
"svg-url-loader": "^8.0.0",
@@ -105,7 +105,7 @@
"vue-template-compiler": "^2.7.16",
"vue2-filters": "^0.14.0",
"vuetify": "^1.5.24",
"webpack": "^5.90.3",
"webpack": "^5.91.0",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4",
"webpack-hot-middleware": "^2.26.1",

View File

@@ -61,9 +61,7 @@ config.update().finally(() => {
config.progress(66);
const viewer = new Viewer();
const isPublic = config.isPublic();
const isMobile =
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||
(navigator.maxTouchPoints && navigator.maxTouchPoints > 2);
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || (navigator.maxTouchPoints && navigator.maxTouchPoints > 2);
// Initialize language and detect alignment.
Vue.config.language = config.getLanguage();
@@ -123,20 +121,13 @@ config.update().finally(() => {
// this is required to make scroll-pos-restore work on iOS in PWA-mode
window.addEventListener("pagehide", (event) => {
if (event.persisted) {
localStorage.setItem(
"lastScrollPosBeforePageHide",
JSON.stringify({ x: window.scrollX, y: window.scrollY })
);
localStorage.setItem("lastScrollPosBeforePageHide", JSON.stringify({ x: window.scrollX, y: window.scrollY }));
}
});
window.addEventListener("pageshow", (event) => {
if (event.persisted) {
const lastSavedScrollPos = localStorage.getItem("lastScrollPosBeforePageHide");
if (
lastSavedScrollPos !== undefined &&
lastSavedScrollPos !== null &&
lastSavedScrollPos !== ""
) {
if (lastSavedScrollPos !== undefined && lastSavedScrollPos !== null && lastSavedScrollPos !== "") {
window.positionToRestore = JSON.parse(localStorage.getItem("lastScrollPosBeforePageHide"));
// wait for other things that set the scroll-pos anywhere in the app to fire
setTimeout(() => {
@@ -188,10 +179,7 @@ config.update().finally(() => {
if (document.querySelector(".v-dialog--active.v-dialog--fullscreen")) {
// Disable back button in full-screen viewers and editors.
next(false);
} else if (
to.matched.some((record) => record.meta.settings) &&
config.values.disable.settings
) {
} else if (to.matched.some((record) => record.meta.settings) && config.values.disable.settings) {
next({ name: "home" });
} else if (to.matched.some((record) => record.meta.admin)) {
if (isPublic || session.isAdmin()) {

View File

@@ -33,19 +33,13 @@ export default {
},
computed: {
appClass: function () {
return [
this.$route.meta.background,
this.$vuetify.breakpoint.smAndDown ? "small-screen" : "large-screen",
this.$route.meta.hideNav ? "hide-nav" : "show-nav",
];
return [this.$route.meta.background, this.$vuetify.breakpoint.smAndDown ? "small-screen" : "large-screen", this.$route.meta.hideNav ? "hide-nav" : "show-nav"];
},
},
created() {
window.addEventListener("touchstart", (e) => this.onTouchStart(e), { passive: true });
window.addEventListener("touchmove", (e) => this.onTouchMove(e), { passive: true });
this.subscriptions["view.refresh"] = Event.subscribe("view.refresh", (ev, data) =>
this.onRefresh(data)
);
this.subscriptions["view.refresh"] = Event.subscribe("view.refresh", (ev, data) => this.onRefresh(data));
this.$config.setVuetify(this.$vuetify);
},
destroyed() {
@@ -68,8 +62,7 @@ export default {
if (document.querySelector(".v-dialog--active") !== null) return;
const y = e.touches[0].pageY;
const h =
window.document.documentElement.scrollHeight - window.document.documentElement.clientHeight;
const h = window.document.documentElement.scrollHeight - window.document.documentElement.clientHeight;
if (window.scrollY >= h - 200 && y < this.touchStart) {
Event.publish("touchmove.bottom");

View File

@@ -111,7 +111,9 @@ Api.interceptors.response.use(
// Show error notification.
if (errorMessage) {
if (code === 401) {
if (code === 32) {
Notify.info($gettext("Enter verification code"));
} else if (code === 401) {
Notify.logout(errorMessage);
} else {
Notify.error(errorMessage);

View File

@@ -231,12 +231,7 @@ export default class Config {
.filter((m) => m.UID === values.UID)
.forEach((m) => {
for (let key in values) {
if (
key !== "UID" &&
values.hasOwnProperty(key) &&
values[key] != null &&
typeof values[key] !== "object"
) {
if (key !== "UID" && values.hasOwnProperty(key) && values[key] != null && typeof values[key] !== "object") {
m[key] = values[key];
}
}
@@ -478,11 +473,7 @@ export default class Config {
if (stored) {
locale = stored;
}
} else if (
this.values.settings &&
this.values.settings.ui &&
this.values.settings.ui.language
) {
} else if (this.values.settings && this.values.settings.ui && this.values.settings.ui.language) {
locale = this.values.settings.ui.language;
}

View File

@@ -26,8 +26,7 @@ Additional information can be found in our Developer Guide:
import saveAs from "file-saver";
// Detect Safari browser.
const isSafari =
navigator.appVersion.indexOf("Safari/") !== -1 && navigator.appVersion.indexOf("Chrome") === -1;
const isSafari = navigator.appVersion.indexOf("Safari/") !== -1 && navigator.appVersion.indexOf("Chrome") === -1;
// Downloads a file from the server.
export default function download(url, name) {

View File

@@ -90,11 +90,7 @@ export default class Form {
}
getOptions(fieldName) {
if (
this.definition &&
this.definition.hasOwnProperty(fieldName) &&
this.definition[fieldName].hasOwnProperty("options")
) {
if (this.definition && this.definition.hasOwnProperty(fieldName) && this.definition[fieldName].hasOwnProperty("options")) {
return this.definition[fieldName].options;
}

View File

@@ -75,10 +75,7 @@ export class Input {
return InputInvalid;
}
if (
Math.abs(this.touches[0].screenX - ev.changedTouches[0].screenX) > 4 ||
Math.abs(this.touches[0].screenY - ev.changedTouches[0].screenY) > 4
) {
if (Math.abs(this.touches[0].screenX - ev.changedTouches[0].screenX) > 4 || Math.abs(this.touches[0].screenY - ev.changedTouches[0].screenY) > 4) {
return InputInvalid;
}
}

View File

@@ -14,15 +14,7 @@ const langFallbackDecorate = function (style, cfg) {
for (let i = layers.length - 1; i >= 0; i--) {
let layer = layers[i];
if (
!(
lf[0] === "in" &&
lfProp === "layout.text-field" &&
layer.layout &&
layer.layout["text-field"] &&
lfValues.indexOf(layer.layout["text-field"]) >= 0
)
) {
if (!(lf[0] === "in" && lfProp === "layout.text-field" && layer.layout && layer.layout["text-field"] && lfValues.indexOf(layer.layout["text-field"]) >= 0)) {
continue;
}
for (let j = decorators.length - 1; j >= 0; j--) {
@@ -95,54 +87,19 @@ maplibregl.Map.prototype.setLanguage = function (language, noAlt) {
return;
}
let isNonlatin =
[
"ar",
"hy",
"be",
"bg",
"zh",
"ka",
"el",
"he",
"ja",
"ja_kana",
"kn",
"kk",
"ko",
"mk",
"ru",
"sr",
"th",
"uk",
].indexOf(language) >= 0;
let isNonlatin = ["ar", "hy", "be", "bg", "zh", "ka", "el", "he", "ja", "ja_kana", "kn", "kk", "ko", "mk", "ru", "sr", "th", "uk"].indexOf(language) >= 0;
let style = JSON.parse(JSON.stringify(this.styleUndecorated));
let langCfg = {
"layer-filter": [
"in",
"layout.text-field",
"{name}",
"{name_de}",
"{name_en}",
"{name:latin}",
"{name:latin} {name:nonlatin}",
"{name:latin}\n{name:nonlatin}",
],
"layer-filter": ["in", "layout.text-field", "{name}", "{name_de}", "{name_en}", "{name:latin}", "{name:latin} {name:nonlatin}", "{name:latin}\n{name:nonlatin}"],
decorators: [
{
"layout.text-field": isNonlatin
? "{name:nonlatin}" + (noAlt ? "" : "\n{name:latin}")
: "{name:latin}" + (noAlt ? "" : "\n{name:nonlatin}"),
"layout.text-field": isNonlatin ? "{name:nonlatin}" + (noAlt ? "" : "\n{name:latin}") : "{name:latin}" + (noAlt ? "" : "\n{name:nonlatin}"),
"filter-all-part": ["!has", "name:" + language],
},
{
"layer-name-postfix": language,
"layout.text-field":
"{name:" +
language +
"}" +
(noAlt ? "" : "\n{name:" + (isNonlatin ? "latin" : "nonlatin") + "}"),
"layout.text-field": "{name:" + language + "}" + (noAlt ? "" : "\n{name:" + (isNonlatin ? "latin" : "nonlatin") + "}"),
"filter-all-part": ["has", "name:" + language],
},
],

View File

@@ -28,11 +28,7 @@ function isObject(val) {
}
function isModel(model) {
return (
model &&
typeof model.getId === "function" &&
typeof model.constructor.getCollectionResource === "function"
);
return model && typeof model.getId === "function" && typeof model.constructor.getCollectionResource === "function";
}
class Selection {

View File

@@ -54,10 +54,7 @@ export default class Session {
}
// Restore authentication from session storage.
if (
this.applyAuthToken(this.storage.getItem("authToken")) &&
this.applyId(this.storage.getItem("sessionId"))
) {
if (this.applyAuthToken(this.storage.getItem("authToken")) && this.applyId(this.storage.getItem("sessionId"))) {
const dataJson = this.storage.getItem("sessionData");
if (dataJson !== "undefined") {
this.data = JSON.parse(dataJson);
@@ -382,10 +379,10 @@ export default class Session {
return LoginPage === window.location.href.substring(window.location.href.lastIndexOf("/") + 1);
}
login(username, password, token) {
login(username, password, passcode, token) {
this.reset();
return Api.post("session", { username, password, token }).then((resp) => {
return Api.post("session", { username, password, passcode, token }).then((resp) => {
const reload = this.config.getLanguage() !== resp.data?.config?.settings?.ui?.language;
this.setResp(resp);
this.onLogin();

View File

@@ -127,12 +127,7 @@ export default class Util {
}
static encodeHTML(text) {
return text
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#x27;");
return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
}
static resetTimer() {

View File

@@ -131,18 +131,15 @@ class Viewer {
captionEl.children[0].innerHTML = Util.encodeHTML(item.Title);
if (item.Playable) {
captionEl.children[0].innerHTML +=
' <i aria-hidden="true" class="v-icon material-icons theme--dark" title="Play">play_circle_fill</i>';
captionEl.children[0].innerHTML += ' <i aria-hidden="true" class="v-icon material-icons theme--dark" title="Play">play_circle_fill</i>';
}
if (item.Description) {
captionEl.children[0].innerHTML +=
'<br><span class="description">' + Util.encodeHTML(item.Description) + "</span>";
captionEl.children[0].innerHTML += '<br><span class="description">' + Util.encodeHTML(item.Description) + "</span>";
}
if (item.Playable) {
captionEl.children[0].innerHTML =
"<button>" + captionEl.children[0].innerHTML + "</button>";
captionEl.children[0].innerHTML = "<button>" + captionEl.children[0].innerHTML + "</button>";
}
return true;
@@ -169,9 +166,7 @@ class Viewer {
gallery.listen("initialZoomIn", () => Event.publish("viewer.pause"));
gallery.listen("initialZoomOut", () => Event.publish("viewer.pause"));
gallery.listen("beforeChange", () =>
Event.publish("viewer.change", { gallery: gallery, item: gallery.currItem })
);
gallery.listen("beforeChange", () => Event.publish("viewer.change", { gallery: gallery, item: gallery.currItem }));
gallery.listen("beforeResize", () => {
realViewportWidth = gallery.viewportSize.x * window.devicePixelRatio;
@@ -237,12 +232,7 @@ class Viewer {
i = ctx.viewer.results.findIndex((p) => p.UID === selected.UID);
}
if (
i > -1 &&
(((ctx.viewer.complete || ctx.complete) &&
ctx.viewer.results.length >= ctx.results.length) ||
i + ctx.viewer.batchSize <= ctx.viewer.results.length)
) {
if (i > -1 && (((ctx.viewer.complete || ctx.complete) && ctx.viewer.results.length >= ctx.results.length) || i + ctx.viewer.batchSize <= ctx.viewer.results.length)) {
ctx.$viewer.show(ctx.viewer.results, i);
return;
}

View File

@@ -40,16 +40,10 @@ export const virtualizationTools = {
*/
let firstVisibleElementIndex, lastVisibileElementIndex;
for (const visibleElementIndex of visibleElementIndices.values()) {
if (
firstVisibleElementIndex === undefined ||
visibleElementIndex < firstVisibleElementIndex
) {
if (firstVisibleElementIndex === undefined || visibleElementIndex < firstVisibleElementIndex) {
firstVisibleElementIndex = visibleElementIndex;
}
if (
lastVisibileElementIndex === undefined ||
visibleElementIndex > lastVisibileElementIndex
) {
if (lastVisibileElementIndex === undefined || visibleElementIndex > lastVisibileElementIndex) {
lastVisibileElementIndex = visibleElementIndex;
}
}

View File

@@ -1,94 +1,36 @@
<template>
<div>
<v-container v-if="selection.length > 0" fluid class="pa-0">
<v-speed-dial
id="t-clipboard" v-model="expanded"
fixed bottom
direction="top"
transition="slide-y-reverse-transition"
:right="!rtl"
:left="rtl"
:class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-album-clipboard`"
>
<v-speed-dial id="t-clipboard" v-model="expanded" fixed bottom direction="top" transition="slide-y-reverse-transition" :right="!rtl" :left="rtl" :class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-album-clipboard`">
<template #activator>
<v-btn
fab dark
color="accent darken-2"
class="action-menu"
>
<v-btn fab dark color="accent darken-2" class="action-menu">
<v-icon v-if="selection.length === 0">menu</v-icon>
<span v-else class="count-clipboard">{{ selection.length }}</span>
</v-btn>
</template>
<v-btn
v-if="canShare"
fab dark small
:title="$gettext('Share')"
color="share"
:disabled="selection.length !== 1"
class="action-share"
@click.stop="shareDialog()"
>
<v-btn v-if="canShare" fab dark small :title="$gettext('Share')" color="share" :disabled="selection.length !== 1" class="action-share" @click.stop="shareDialog()">
<v-icon>share</v-icon>
</v-btn>
<v-btn
v-if="canManage"
fab dark small
:title="$gettext('Edit')"
color="edit"
:disabled="selection.length !== 1"
class="action-edit"
@click.stop="editDialog()"
>
<v-btn v-if="canManage" fab dark small :title="$gettext('Edit')" color="edit" :disabled="selection.length !== 1" class="action-edit" @click.stop="editDialog()">
<v-icon>edit</v-icon>
</v-btn>
<v-btn
fab dark small
:title="$gettext('Download')"
color="download"
class="action-download"
:disabled="!canDownload || selection.length !== 1"
@click.stop="download()"
>
<v-btn fab dark small :title="$gettext('Download')" color="download" class="action-download" :disabled="!canDownload || selection.length !== 1" @click.stop="download()">
<v-icon>get_app</v-icon>
</v-btn>
<v-btn
v-if="canManage"
fab dark small
:title="$gettext('Add to album')"
color="album"
:disabled="selection.length === 0"
class="action-clone"
@click.stop="dialog.album = true"
>
<v-btn v-if="canManage" fab dark small :title="$gettext('Add to album')" color="album" :disabled="selection.length === 0" class="action-clone" @click.stop="dialog.album = true">
<v-icon>bookmark</v-icon>
</v-btn>
<v-btn
v-if="canDelete && deletable.includes(context)"
fab dark small
color="remove"
:title="$gettext('Delete')"
:disabled="selection.length === 0"
class="action-delete"
@click.stop="dialog.delete = true"
>
<v-btn v-if="canDelete && deletable.includes(context)" fab dark small color="remove" :title="$gettext('Delete')" :disabled="selection.length === 0" class="action-delete" @click.stop="dialog.delete = true">
<v-icon>delete</v-icon>
</v-btn>
<v-btn
fab dark small
color="accent"
class="action-clear"
@click.stop="clearClipboard()"
>
<v-btn fab dark small color="accent" class="action-clear" @click.stop="clearClipboard()">
<v-icon>clear</v-icon>
</v-btn>
</v-speed-dial>
</v-container>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false"
@confirm="cloneAlbums"></p-photo-album-dialog>
<p-album-delete-dialog :show="dialog.delete" @cancel="dialog.delete = false"
@confirm="batchDelete"></p-album-delete-dialog>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false" @confirm="cloneAlbums"></p-photo-album-dialog>
<p-album-delete-dialog :show="dialog.delete" @cancel="dialog.delete = false" @confirm="batchDelete"></p-album-delete-dialog>
</div>
</template>
<script>
@@ -98,7 +40,7 @@ import Album from "model/album";
import download from "common/download";
export default {
name: 'PAlbumClipboard',
name: "PAlbumClipboard",
props: {
selection: {
type: Array,
@@ -106,23 +48,19 @@ export default {
},
refresh: {
type: Function,
default: () => {
},
default: () => {},
},
clearSelection: {
type: Function,
default: () => {
},
default: () => {},
},
share: {
type: Function,
default: () => {
},
default: () => {},
},
edit: {
type: Function,
default: () => {
},
default: () => {},
},
context: {
type: String,
@@ -155,11 +93,9 @@ export default {
}
this.model = new Album();
this.model.find(this.selection[0]).then(
(m) => {
this.model.find(this.selection[0]).then((m) => {
this.edit(m);
}
);
});
},
shareDialog() {
if (this.selection.length !== 1) {
@@ -168,11 +104,9 @@ export default {
}
this.model = new Album();
this.model.find(this.selection[0]).then(
(m) => {
this.model.find(this.selection[0]).then((m) => {
this.share(m);
}
);
});
},
clearClipboard() {
this.clearSelection();
@@ -181,7 +115,7 @@ export default {
cloneAlbums(ppid) {
this.dialog.album = false;
Api.post(`albums/${ppid}/clone`, {"albums": this.selection}).then(() => this.onCloned());
Api.post(`albums/${ppid}/clone`, { albums: this.selection }).then(() => this.onCloned());
},
onCloned() {
this.clearClipboard();
@@ -189,7 +123,7 @@ export default {
batchDelete() {
this.dialog.delete = false;
Api.post("batch/albums/delete", {"albums": this.selection}).then(this.onDeleted.bind(this));
Api.post("batch/albums/delete", { albums: this.selection }).then(this.onDeleted.bind(this));
},
onDeleted() {
Notify.success(this.$gettext("Albums deleted"));
@@ -210,6 +144,6 @@ export default {
onDownload(path) {
download(path, "photoprism-album.zip");
},
}
},
};
</script>

View File

@@ -1,7 +1,5 @@
<template>
<v-form ref="form" lazy-validation
dense autocomplete="off" class="p-photo-toolbar p-album-toolbar" accept-charset="UTF-8"
@submit.prevent="updateQuery()">
<v-form ref="form" lazy-validation dense autocomplete="off" class="p-photo-toolbar p-album-toolbar" accept-charset="UTF-8" @submit.prevent="updateQuery()">
<v-toolbar flat :dense="$vuetify.breakpoint.smAndDown" class="page-toolbar" color="secondary">
<v-toolbar-title :title="album.Title">
<span class="hidden-xs-only">
@@ -23,56 +21,44 @@
<v-icon>edit</v-icon>
</v-btn>
<v-btn v-if="canShare" icon class="action-share" :title="$gettext('Share')"
@click.stop="dialog.share = true">
<v-btn v-if="canShare" icon class="action-share" :title="$gettext('Share')" @click.stop="dialog.share = true">
<v-icon>share</v-icon>
</v-btn>
<v-btn v-if="canDownload" icon class="action-download" :title="$gettext('Download')"
@click.stop="download()">
<v-btn v-if="canDownload" icon class="action-download" :title="$gettext('Download')" @click.stop="download()">
<v-icon>get_app</v-icon>
</v-btn>
<v-btn v-if="settings.view === 'cards'" icon class="action-view-list" :title="$gettext('Toggle View')"
@click.stop="setView('list')">
<v-btn v-if="settings.view === 'cards'" icon class="action-view-list" :title="$gettext('Toggle View')" @click.stop="setView('list')">
<v-icon>view_list</v-icon>
</v-btn>
<v-btn v-else-if="settings.view === 'list'" icon class="action-view-mosaic" :title="$gettext('Toggle View')"
@click.stop="setView('mosaic')">
<v-btn v-else-if="settings.view === 'list'" icon class="action-view-mosaic" :title="$gettext('Toggle View')" @click.stop="setView('mosaic')">
<v-icon>view_comfy</v-icon>
</v-btn>
<v-btn v-else icon class="action-view-cards" :title="$gettext('Toggle View')" @click.stop="setView('cards')">
<v-icon>view_column</v-icon>
</v-btn>
<v-btn v-if="canUpload" icon class="hidden-sm-and-down action-upload"
:title="$gettext('Upload')" @click.stop="showUpload()">
<v-btn v-if="canUpload" icon class="hidden-sm-and-down action-upload" :title="$gettext('Upload')" @click.stop="showUpload()">
<v-icon>cloud_upload</v-icon>
</v-btn>
</v-toolbar>
<template v-if="album.Description">
<v-card flat class="px-2 py-1 hidden-sm-and-down"
color="secondary-light"
>
<v-card flat class="px-2 py-1 hidden-sm-and-down" color="secondary-light">
<v-card-text>
{{ album.Description }}
</v-card-text>
</v-card>
<v-card flat class="pa-0 hidden-md-and-up"
color="secondary-light"
>
<v-card flat class="pa-0 hidden-md-and-up" color="secondary-light">
<v-card-text>
{{ album.Description }}
</v-card-text>
</v-card>
</template>
<p-share-dialog :show="dialog.share" :model="album" @upload="webdavUpload"
@close="dialog.share = false"></p-share-dialog>
<p-share-upload-dialog :show="dialog.upload" :items="{albums: album.getId()}" :model="album"
@cancel="dialog.upload = false"
@confirm="dialog.upload = false"></p-share-upload-dialog>
<p-share-dialog :show="dialog.share" :model="album" @upload="webdavUpload" @close="dialog.share = false"></p-share-dialog>
<p-share-upload-dialog :show="dialog.upload" :items="{ albums: album.getId() }" :model="album" @cancel="dialog.upload = false" @confirm="dialog.upload = false"></p-share-upload-dialog>
<p-album-edit-dialog :show="dialog.edit" :album="album" @close="dialog.edit = false"></p-album-edit-dialog>
</v-form>
</template>
@@ -83,48 +69,46 @@ import download from "common/download";
import { T } from "common/vm";
export default {
name: 'PAlbumToolbar',
name: "PAlbumToolbar",
props: {
album: {
type: Object,
default: () => {
},
default: () => {},
},
filter: {
type: Object,
default: () => {
},
default: () => {},
},
updateFilter: {
type: Function,
default: () => {
},
default: () => {},
},
updateQuery: {
type: Function,
default: () => {
},
default: () => {},
},
settings: {
type: Object,
default: () => {
},
default: () => {},
},
refresh: {
type: Function,
default: () => {
},
default: () => {},
},
},
data() {
const cameras = [{
const cameras = [
{
ID: 0,
Name: this.$gettext('All Cameras')
}].concat(this.$config.get('cameras'));
const countries = [{
ID: '',
Name: this.$gettext('All Countries')
}].concat(this.$config.get('countries'));
Name: this.$gettext("All Cameras"),
},
].concat(this.$config.get("cameras"));
const countries = [
{
ID: "",
Name: this.$gettext("All Countries"),
},
].concat(this.$config.get("countries"));
const features = this.$config.settings().features;
return {
canUpload: this.$config.allow("files", "upload") && features.upload,
@@ -136,26 +120,26 @@ export default {
categories: this.$config.albumCategories(),
collectionTitle: this.$route.meta?.collectionTitle ? this.$route.meta.collectionTitle : this.$gettext("Albums"),
collectionRoute: this.$route.meta?.collectionRoute ? this.$route.meta.collectionRoute : "albums",
navIcon: this.$rtl ? 'navigate_before' : 'navigate_next',
navIcon: this.$rtl ? "navigate_before" : "navigate_next",
searchExpanded: false,
options: {
'views': [
{value: 'mosaic', text: this.$gettext('Mosaic')},
{value: 'cards', text: this.$gettext('Cards')},
{value: 'list', text: this.$gettext('List')},
views: [
{ value: "mosaic", text: this.$gettext("Mosaic") },
{ value: "cards", text: this.$gettext("Cards") },
{ value: "list", text: this.$gettext("List") },
],
'countries': countries,
'cameras': cameras,
'sorting': [
{value: 'newest', text: this.$gettext('Newest First')},
{value: 'oldest', text: this.$gettext('Oldest First')},
{value: 'added', text: this.$gettext('Recently Added')},
{value: 'edited', text: this.$gettext('Recently Edited')},
{value: 'name', text: this.$gettext('File Name')},
{value: 'size', text: this.$gettext('File Size')},
{value: 'duration', text: this.$gettext('Video Duration')},
{value: 'relevance', text: this.$gettext('Most Relevant')},
{value: 'similar', text: this.$gettext('Visual Similarity')},
countries: countries,
cameras: cameras,
sorting: [
{ value: "newest", text: this.$gettext("Newest First") },
{ value: "oldest", text: this.$gettext("Oldest First") },
{ value: "added", text: this.$gettext("Recently Added") },
{ value: "edited", text: this.$gettext("Recently Edited") },
{ value: "name", text: this.$gettext("File Name") },
{ value: "size", text: this.$gettext("File Size") },
{ value: "duration", text: this.$gettext("Video Duration") },
{ value: "relevance", text: this.$gettext("Most Relevant") },
{ value: "similar", text: this.$gettext("Visual Similarity") },
],
},
dialog: {
@@ -163,7 +147,7 @@ export default {
upload: false,
edit: false,
},
titleRule: v => v.length <= this.$config.get('clip') || this.$gettext("Name too long"),
titleRule: (v) => v.length <= this.$config.get("clip") || this.$gettext("Name too long"),
growDesc: false,
};
},
@@ -189,7 +173,7 @@ export default {
},
setView(name) {
if (name) {
this.refresh({'view': name});
this.refresh({ view: name });
}
},
download() {
@@ -200,6 +184,6 @@ export default {
download(path, "album.zip");
},
}
},
};
</script>

View File

@@ -7,16 +7,15 @@
</v-flex>
<v-flex v-if="legalInfo" xs12 sm6 class="pa-0 body-2 text-xs-center text-sm-right white--text">
<a v-if="legalUrl" :href="legalUrl" target="_blank" class="text-link"
:style="`color: ${colors.link}!important`">{{ legalInfo }}</a>
<a v-if="legalUrl" :href="legalUrl" target="_blank" class="text-link" :style="`color: ${colors.link}!important`">{{ legalInfo }}</a>
<span v-else>{{ legalInfo }}</span>
</v-flex>
<v-flex v-else-if="caption" xs12 sm6
class="pa-0 body-2 text-selectable text-xs-center text-sm-right white--text">
<v-flex v-else-if="caption" xs12 sm6 class="pa-0 body-2 text-selectable text-xs-center text-sm-right white--text">
<strong>{{ caption }}</strong>
</v-flex>
<v-flex v-else xs12 sm6 class="pa-0 body-2 text-selectable text-xs-center text-sm-right white--text">
<router-link to="/about" class="text-link"><span class="white--text">Made with in Berlin</span>
<router-link to="/about" class="text-link">
<span class="white--text">Made with in Berlin</span>
</router-link>
</v-flex>
</v-layout>
@@ -24,9 +23,8 @@
</div>
</template>
<script>
export default {
name: 'PAuthFooter',
name: "PAuthFooter",
props: {
colors: {
type: Object,
@@ -52,7 +50,6 @@ export default {
rtl: this.$rtl,
};
},
methods: {}
methods: {},
};
</script>

View File

@@ -1,14 +1,13 @@
<template>
<div class="auth-header">
<div id="auth-logo" class="logo text-xs-center">
<img :src="$config.getIcon()" :alt="config.name">
<img :src="$config.getIcon()" :alt="config.name" />
</div>
</div>
</template>
<script>
export default {
name: 'PAuthHeader',
name: "PAuthHeader",
props: {},
data() {
return {
@@ -17,7 +16,6 @@ export default {
rtl: this.$rtl,
};
},
methods: {}
methods: {},
};
</script>

View File

@@ -1,64 +1,28 @@
<template>
<div>
<v-container v-if="selection.length > 0" fluid class="pa-0">
<v-speed-dial
id="t-clipboard" v-model="expanded"
fixed
bottom
direction="top"
transition="slide-y-reverse-transition"
:right="!rtl"
:left="rtl"
:class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-file-clipboard`"
>
<v-speed-dial id="t-clipboard" v-model="expanded" fixed bottom direction="top" transition="slide-y-reverse-transition" :right="!rtl" :left="rtl" :class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-file-clipboard`">
<template #activator>
<v-btn
fab
dark
color="accent darken-2"
class="action-menu"
>
<v-btn fab dark color="accent darken-2" class="action-menu">
<v-icon v-if="selection.length === 0">menu</v-icon>
<span v-else class="count-clipboard">{{ selection.length }}</span>
</v-btn>
</template>
<v-btn
v-if="$config.feature('download')" fab dark
small
:title="$gettext('Download')"
color="download"
class="action-download"
:disabled="selection.length === 0"
@click.stop="download()"
>
<v-btn v-if="$config.feature('download')" fab dark small :title="$gettext('Download')" color="download" class="action-download" :disabled="selection.length === 0" @click.stop="download()">
<v-icon>get_app</v-icon>
</v-btn>
<v-btn
v-if="$config.feature('albums')"
fab dark small
:title="$gettext('Add to album')"
color="album"
:disabled="selection.length === 0"
class="action-album"
@click.stop="dialog.album = true"
>
<v-btn v-if="$config.feature('albums')" fab dark small :title="$gettext('Add to album')" color="album" :disabled="selection.length === 0" class="action-album" @click.stop="dialog.album = true">
<v-icon>bookmark</v-icon>
</v-btn>
<v-btn
fab dark small
color="accent"
class="action-clear"
@click.stop="clearClipboard()"
>
<v-btn fab dark small color="accent" class="action-clear" @click.stop="clearClipboard()">
<v-icon>clear</v-icon>
</v-btn>
</v-speed-dial>
</v-container>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false"
@confirm="addToAlbum"></p-photo-album-dialog>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false" @confirm="addToAlbum"></p-photo-album-dialog>
</div>
</template>
<script>
@@ -67,7 +31,7 @@ import Notify from "common/notify";
import download from "common/download";
export default {
name: 'PFileClipboard',
name: "PFileClipboard",
props: {
selection: {
type: Array,
@@ -94,13 +58,13 @@ export default {
addToAlbum(ppid) {
this.dialog.album = false;
Api.post(`albums/${ppid}/photos`, {"files": this.selection}).then(() => this.onAdded());
Api.post(`albums/${ppid}/photos`, { files: this.selection }).then(() => this.onAdded());
},
onAdded() {
this.clearClipboard();
},
download() {
Api.post("zip", {"files": this.selection}).then(r => {
Api.post("zip", { files: this.selection }).then((r) => {
this.onDownload(`${this.$config.apiUri}/zip/${r.data.filename}?t=${this.$config.downloadToken}`);
});
@@ -111,6 +75,6 @@ export default {
download(path, "photos.zip");
},
}
},
};
</script>

View File

@@ -4,32 +4,19 @@
<v-layout wrap align-top pt-3>
<v-flex xs12 sm6 class="px-0 pb-2 body-1 text-selectable text-xs-left">
<strong
><router-link to="/about" class="text-link text-selectable"
>{{ about }}{{ getMembership() }}</router-link
></strong
><router-link to="/about" class="text-link text-selectable">
{{ about }}{{ getMembership() }}
</router-link></strong
>
<span class="body-link text-selectable"
>Build&nbsp;<a
href="https://docs.photoprism.app/release-notes/"
target="_blank"
:title="version"
class="body-link"
>{{ build }}</a
></span
>Build&nbsp;<a href="https://docs.photoprism.app/release-notes/" target="_blank" :title="version" class="body-link">{{ build }}</a></span
>
</v-flex>
<v-flex xs12 sm6 class="px-0 pb-2 body-1 text-xs-center text-sm-right">
<div class="hidden-xs-only">
<a
href="https://raw.githubusercontent.com/photoprism/photoprism/develop/NOTICE"
target="_blank"
class="text-link"
>3rd-party software packages</a
>
<a href="https://www.photoprism.app/about/team/" target="_blank" class="body-link"
>© 2018-2024 PhotoPrism UG</a
>
<a href="https://raw.githubusercontent.com/photoprism/photoprism/develop/NOTICE" target="_blank" class="text-link">3rd-party software packages</a>
<a href="https://www.photoprism.app/about/team/" target="_blank" class="body-link">© 2018-2024 PhotoPrism UG</a>
</div>
</v-flex>
</v-layout>

View File

@@ -1,23 +1,9 @@
<template>
<div>
<v-container v-if="selection.length > 0" fluid class="pa-0">
<v-speed-dial
id="t-clipboard" v-model="expanded"
fixed
bottom
direction="top"
transition="slide-y-reverse-transition"
:right="!rtl"
:left="rtl"
:class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-label-clipboard`"
>
<v-speed-dial id="t-clipboard" v-model="expanded" fixed bottom direction="top" transition="slide-y-reverse-transition" :right="!rtl" :left="rtl" :class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-label-clipboard`">
<template #activator>
<v-btn
fab
dark
color="accent darken-2"
class="action-menu"
>
<v-btn fab dark color="accent darken-2" class="action-menu">
<v-icon v-if="selection.length === 0">menu</v-icon>
<span v-else class="count-clipboard">{{ selection.length }}</span>
</v-btn>
@@ -35,41 +21,20 @@
>
<v-icon>cloud_download</v-icon>
</v-btn -->
<v-btn
fab dark small
:title="$gettext('Add to album')"
color="album"
:disabled="!canAddAlbums || selection.length === 0"
class="action-album"
@click.stop="dialog.album = true"
>
<v-btn fab dark small :title="$gettext('Add to album')" color="album" :disabled="!canAddAlbums || selection.length === 0" class="action-album" @click.stop="dialog.album = true">
<v-icon>bookmark</v-icon>
</v-btn>
<v-btn
fab dark small
color="remove"
:title="$gettext('Delete')"
:disabled="!canManage || selection.length === 0"
class="action-delete"
@click.stop="dialog.delete = true"
>
<v-btn fab dark small color="remove" :title="$gettext('Delete')" :disabled="!canManage || selection.length === 0" class="action-delete" @click.stop="dialog.delete = true">
<v-icon>delete</v-icon>
</v-btn>
<v-btn
fab dark small
color="accent"
class="action-clear"
@click.stop="clearClipboard()"
>
<v-btn fab dark small color="accent" class="action-clear" @click.stop="clearClipboard()">
<v-icon>clear</v-icon>
</v-btn>
</v-speed-dial>
</v-container>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false"
@confirm="addToAlbum"></p-photo-album-dialog>
<p-label-delete-dialog :show="dialog.delete" @cancel="dialog.delete = false"
@confirm="batchDelete"></p-label-delete-dialog>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false" @confirm="addToAlbum"></p-photo-album-dialog>
<p-label-delete-dialog :show="dialog.delete" @cancel="dialog.delete = false" @confirm="batchDelete"></p-label-delete-dialog>
</div>
</template>
<script>
@@ -78,7 +43,7 @@ import Notify from "common/notify";
import download from "common/download";
export default {
name: 'PLabelClipboard',
name: "PLabelClipboard",
props: {
selection: {
type: Array,
@@ -119,7 +84,7 @@ export default {
this.dialog.album = false;
Api.post(`albums/${ppid}/photos`, {"labels": this.selection}).then(() => this.onAdded());
Api.post(`albums/${ppid}/photos`, { labels: this.selection }).then(() => this.onAdded());
},
onAdded() {
this.clearClipboard();
@@ -131,7 +96,7 @@ export default {
this.dialog.delete = false;
Api.post("batch/labels/delete", {"labels": this.selection}).then(this.onDeleted.bind(this));
Api.post("batch/labels/delete", { labels: this.selection }).then(this.onDeleted.bind(this));
},
onDeleted() {
Notify.success(this.$gettext("Labels deleted"));
@@ -156,6 +121,6 @@ export default {
download(path, "label.zip");
},
}
},
};
</script>

View File

@@ -1,11 +1,5 @@
<template>
<transition
id="p-loading-bar"
:css="false"
@before-enter="beforeEnter"
@enter="enter"
@after-enter="afterEnter"
>
<transition id="p-loading-bar" :css="false" @before-enter="beforeEnter" @enter="enter" @after-enter="afterEnter">
<div v-if="show" class="top-progress" :style="barStyle">
<div class="peg" :style="pegStyle"> </div>
</div>

View File

@@ -1,38 +1,14 @@
<template>
<div id="p-navigation" :class="{ 'sidenav-visible': drawer }">
<template v-if="visible && $vuetify.breakpoint.smAndDown">
<v-toolbar
dark
fixed
flat
scroll-off-screen
dense
color="navigation darken-1"
class="nav-small elevation-2"
@click.stop.prevent
>
<v-avatar
class="nav-avatar"
tile
:size="28"
:class="{ clickable: auth }"
@click.stop.prevent="showNavigation()"
>
<v-toolbar dark fixed flat scroll-off-screen dense color="navigation darken-1" class="nav-small elevation-2" @click.stop.prevent>
<v-avatar class="nav-avatar" tile :size="28" :class="{ clickable: auth }" @click.stop.prevent="showNavigation()">
<img :src="appIcon" :alt="config.name" :class="{ 'animate-hue': indexing }" />
</v-avatar>
<v-toolbar-title class="nav-title">
<span :class="{ clickable: auth }" @click.stop.prevent="showNavigation()">{{
page.title
}}</span>
<span :class="{ clickable: auth }" @click.stop.prevent="showNavigation()">{{ page.title }}</span>
</v-toolbar-title>
<v-btn
fab
dark
:ripple="false"
color="transparent"
class="mobile-menu-trigger elevation-0"
@click.stop.prevent="speedDial = true"
>
<v-btn fab dark :ripple="false" color="transparent" class="mobile-menu-trigger elevation-0" @click.stop.prevent="speedDial = true">
<v-icon dark>more_vert</v-icon>
</v-btn>
</v-toolbar>
@@ -42,32 +18,15 @@
<v-avatar class="nav-avatar" tile :size="28">
<img :src="appIcon" :alt="config.name" />
</v-avatar>
<v-toolbar-title class="nav-title">{{ page.title }}</v-toolbar-title>
<v-btn
fab
dark
:ripple="false"
color="transparent"
class="mobile-menu-trigger elevation-0"
@click.stop.prevent="speedDial = true"
>
<v-toolbar-title class="nav-title">
{{ page.title }}
</v-toolbar-title>
<v-btn fab dark :ripple="false" color="transparent" class="mobile-menu-trigger elevation-0" @click.stop.prevent="speedDial = true">
<v-icon dark>more_vert</v-icon>
</v-btn>
</v-toolbar>
</template>
<v-navigation-drawer
v-if="visible && auth"
v-model="drawer"
:mini-variant="isMini"
:width="270"
:mobile-break-point="960"
:mini-variant-width="80"
class="nav-sidebar navigation p-flex-nav"
fixed
dark
app
:right="rtl"
>
<v-navigation-drawer v-if="visible && auth" v-model="drawer" :mini-variant="isMini" :width="270" :mobile-break-point="960" :mini-variant-width="80" class="nav-sidebar navigation p-flex-nav" fixed dark app :right="rtl">
<v-toolbar flat :dense="$vuetify.breakpoint.smAndDown">
<v-list class="navigation-home">
<v-list-tile class="nav-logo">
@@ -75,7 +34,9 @@
<img :src="appIcon" :alt="appName" :class="{ 'animate-hue': indexing }" />
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title class="title">{{ appName }}</v-list-tile-title>
<v-list-tile-title class="title">
{{ appName }}
</v-list-tile-title>
</v-list-tile-content>
<v-list-tile-action class="hidden-sm-and-down" :title="$gettext('Minimize')">
<v-btn icon class="nav-minimize" @click.stop="toggleIsMini()">
@@ -95,12 +56,7 @@
</v-list-tile-action>
</v-list-tile>
<v-list-tile
v-if="isMini && $config.feature('search')"
to="/browse"
class="nav-browse"
@click.stop=""
>
<v-list-tile v-if="isMini && $config.feature('search')" to="/browse" class="nav-browse" @click.stop="">
<v-list-tile-action :title="$gettext('Search')">
<v-icon>search</v-icon>
</v-list-tile-action>
@@ -118,20 +74,13 @@
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Search">Search</translate>
<span v-if="config.count.all > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.all | abbreviateCount
}}</span>
<span v-if="config.count.all > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.all | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</template>
<v-list-tile
:to="{ name: 'browse', query: { q: 'mono:true quality:3 photo:true' } }"
:exact="true"
class="nav-monochrome"
@click.stop=""
>
<v-list-tile :to="{ name: 'browse', query: { q: 'mono:true quality:3 photo:true' } }" :exact="true" class="nav-monochrome" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`p-flex-menuitem menu-item ${rtl ? '--rtl' : ''}`">
<translate>Monochrome</translate>
@@ -139,12 +88,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile
:to="{ name: 'browse', query: { q: 'panoramas' } }"
:exact="true"
class="nav-panoramas"
@click.stop=""
>
<v-list-tile :to="{ name: 'browse', query: { q: 'panoramas' } }" :exact="true" class="nav-panoramas" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`menu-item ${rtl ? '--rtl' : ''}`">
<translate>Panoramas</translate>
@@ -152,12 +96,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile
:to="{ name: 'browse', query: { q: 'animated' } }"
:exact="true"
class="nav-animated"
@click.stop=""
>
<v-list-tile :to="{ name: 'browse', query: { q: 'animated' } }" :exact="true" class="nav-animated" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`menu-item ${rtl ? '--rtl' : ''}`">
<translate>Animated</translate>
@@ -165,13 +104,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="isSponsor"
:to="{ name: 'browse', query: { q: 'vectors' } }"
:exact="true"
class="nav-vectors"
@click.stop=""
>
<v-list-tile v-show="isSponsor" :to="{ name: 'browse', query: { q: 'vectors' } }" :exact="true" class="nav-vectors" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`menu-item ${rtl ? '--rtl' : ''}`">
<translate>Vectors</translate>
@@ -179,12 +112,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile
:to="{ name: 'photos', query: { q: 'stacks' } }"
:exact="true"
class="nav-stacks"
@click.stop=""
>
<v-list-tile :to="{ name: 'photos', query: { q: 'stacks' } }" :exact="true" class="nav-stacks" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`p-flex-menuitem menu-item ${rtl ? '--rtl' : ''}`">
<translate>Stacks</translate>
@@ -192,12 +120,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile
:to="{ name: 'photos', query: { q: 'scans' } }"
:exact="true"
class="nav-scans"
@click.stop=""
>
<v-list-tile :to="{ name: 'photos', query: { q: 'scans' } }" :exact="true" class="nav-scans" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`p-flex-menuitem menu-item ${rtl ? '--rtl' : ''}`">
<translate>Scans</translate>
@@ -205,49 +128,26 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-if="canManagePhotos"
v-show="$config.feature('review')"
to="/review"
class="nav-review"
@click.stop=""
>
<v-list-tile v-if="canManagePhotos" v-show="$config.feature('review')" to="/review" class="nav-review" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`p-flex-menuitem menu-item ${rtl ? '--rtl' : ''}`">
<translate>Review</translate>
<span v-show="config.count.review > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.review | abbreviateCount
}}</span>
<span v-show="config.count.review > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.review | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="$config.feature('archive')"
to="/archive"
class="nav-archive"
@click.stop=""
>
<v-list-tile v-show="$config.feature('archive')" to="/archive" class="nav-archive" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`p-flex-menuitem menu-item ${rtl ? '--rtl' : ''}`">
<translate>Archive</translate>
<span
v-show="config.count.archived > 0"
:class="`nav-count ${rtl ? '--rtl' : ''}`"
>{{ config.count.archived | abbreviateCount }}</span
>
<span v-show="config.count.archived > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.archived | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</v-list-group>
<v-list-tile
v-if="isMini"
v-show="$config.feature('albums')"
to="/albums"
class="nav-albums"
@click.stop=""
>
<v-list-tile v-if="isMini" v-show="$config.feature('albums')" to="/albums" class="nav-albums" @click.stop="">
<v-list-tile-action :title="$gettext('Albums')">
<v-icon>bookmark</v-icon>
</v-list-tile-action>
@@ -259,20 +159,13 @@
</v-list-tile-content>
</v-list-tile>
<v-list-group
v-if="!isMini"
v-show="$config.feature('albums')"
prepend-icon="bookmark"
no-action
>
<v-list-group v-if="!isMini" v-show="$config.feature('albums')" prepend-icon="bookmark" no-action>
<template #activator>
<v-list-tile :to="{ name: 'albums' }" class="nav-albums" @click.stop="">
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Albums">Albums</translate>
<span v-if="config.count.albums > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.albums | abbreviateCount
}}</span>
<span v-if="config.count.albums > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.albums | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
@@ -287,12 +180,7 @@
</v-list-tile>
</v-list-group>
<v-list-tile
v-if="isMini && $config.feature('videos')"
to="/videos"
class="nav-video"
@click.stop=""
>
<v-list-tile v-if="isMini && $config.feature('videos')" to="/videos" class="nav-video" @click.stop="">
<v-list-tile-action :title="$gettext('Videos')">
<v-icon>play_circle_fill</v-icon>
</v-list-tile-action>
@@ -304,21 +192,13 @@
</v-list-tile-content>
</v-list-tile>
<v-list-group
v-if="!isMini && $config.feature('videos')"
prepend-icon="play_circle_fill"
no-action
>
<v-list-group v-if="!isMini && $config.feature('videos')" prepend-icon="play_circle_fill" no-action>
<template #activator>
<v-list-tile to="/videos" class="nav-video" @click.stop="">
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Videos">Videos</translate>
<span
v-show="config.count.videos > 0"
:class="`nav-count ${rtl ? '--rtl' : ''}`"
>{{ config.count.videos | abbreviateCount }}</span
>
<span v-show="config.count.videos > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.videos | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
@@ -328,20 +208,13 @@
<v-list-tile-content>
<v-list-tile-title :class="`p-flex-menuitem menu-item ${rtl ? '--rtl' : ''}`">
<translate>Live Photos</translate>
<span v-show="config.count.live > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.live | abbreviateCount
}}</span>
<span v-show="config.count.live > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.live | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</v-list-group>
<v-list-tile
v-show="$config.feature('people') && (canManagePeople || config.count.people > 0)"
:to="{ name: 'people' }"
class="nav-people"
@click.stop=""
>
<v-list-tile v-show="$config.feature('people') && (canManagePeople || config.count.people > 0)" :to="{ name: 'people' }" class="nav-people" @click.stop="">
<v-list-tile-action :title="$gettext('People')">
<v-icon>person</v-icon>
</v-list-tile-action>
@@ -349,19 +222,12 @@
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="People">People</translate>
<span v-show="config.count.people > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.people | abbreviateCount
}}</span>
<span v-show="config.count.people > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.people | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="$config.feature('favorites')"
:to="{ name: 'favorites' }"
class="nav-favorites"
@click.stop=""
>
<v-list-tile v-show="$config.feature('favorites')" :to="{ name: 'favorites' }" class="nav-favorites" @click.stop="">
<v-list-tile-action :title="$gettext('Favorites')">
<v-icon>favorite</v-icon>
</v-list-tile-action>
@@ -369,21 +235,12 @@
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Favorites">Favorites</translate>
<span
v-show="config.count.favorites > 0"
:class="`nav-count ${rtl ? '--rtl' : ''}`"
>{{ config.count.favorites | abbreviateCount }}</span
>
<span v-show="config.count.favorites > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.favorites | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="$config.feature('moments')"
:to="{ name: 'moments' }"
class="nav-moments"
@click.stop=""
>
<v-list-tile v-show="$config.feature('moments')" :to="{ name: 'moments' }" class="nav-moments" @click.stop="">
<v-list-tile-action :title="$gettext('Moments')">
<v-icon>star</v-icon>
</v-list-tile-action>
@@ -391,19 +248,12 @@
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Moments">Moments</translate>
<span v-show="config.count.moments > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.moments | abbreviateCount
}}</span>
<span v-show="config.count.moments > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.moments | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="$config.feature('moments')"
:to="{ name: 'calendar' }"
class="nav-calendar"
@click.stop=""
>
<v-list-tile v-show="$config.feature('moments')" :to="{ name: 'calendar' }" class="nav-calendar" @click.stop="">
<v-list-tile-action :title="$gettext('Calendar')">
<v-icon>date_range</v-icon>
</v-list-tile-action>
@@ -411,20 +261,12 @@
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Calendar">Calendar</translate>
<span v-show="config.count.months > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.months | abbreviateCount
}}</span>
<span v-show="config.count.months > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.months | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-if="isRestricted"
v-show="$config.feature('places')"
to="/states"
class="nav-states"
@click.stop=""
>
<v-list-tile v-if="isRestricted" v-show="$config.feature('places')" to="/states" class="nav-states" @click.stop="">
<v-list-tile-action :title="$gettext('States')">
<v-icon>near_me</v-icon>
</v-list-tile-action>
@@ -432,21 +274,13 @@
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem" @click.stop="">
<translate key="States">States</translate>
<span v-show="config.count.states > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.states | abbreviateCount
}}</span>
<span v-show="config.count.states > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.states | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<template v-if="canSearchPlaces">
<v-list-tile
v-if="isMini"
v-show="canSearchPlaces && $config.feature('places')"
:to="{ name: 'places' }"
class="nav-places"
@click.stop=""
>
<v-list-tile v-if="isMini" v-show="canSearchPlaces && $config.feature('places')" :to="{ name: 'places' }" class="nav-places" @click.stop="">
<v-list-tile-action :title="$gettext('Places')">
<v-icon>place</v-icon>
</v-list-tile-action>
@@ -458,22 +292,13 @@
</v-list-tile-content>
</v-list-tile>
<v-list-group
v-if="!isMini"
v-show="canSearchPlaces && $config.feature('places')"
prepend-icon="place"
no-action
>
<v-list-group v-if="!isMini" v-show="canSearchPlaces && $config.feature('places')" prepend-icon="place" no-action>
<template #activator>
<v-list-tile to="/places" class="nav-places" @click.stop="">
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Places">Places</translate>
<span
v-show="config.count.places > 0"
:class="`nav-count ${rtl ? '--rtl' : ''}`"
>{{ config.count.places | abbreviateCount }}</span
>
<span v-show="config.count.places > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.places | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
@@ -483,23 +308,14 @@
<v-list-tile-content>
<v-list-tile-title :class="`p-flex-menuitem menu-item ${rtl ? '--rtl' : ''}`">
<translate key="States">States</translate>
<span
v-show="config.count.states > 0"
:class="`nav-count ${rtl ? '--rtl' : ''}`"
>{{ config.count.states | abbreviateCount }}</span
>
<span v-show="config.count.states > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.states | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</v-list-group>
</template>
<v-list-tile
v-show="$config.feature('labels')"
to="/labels"
class="nav-labels"
@click.stop=""
>
<v-list-tile v-show="$config.feature('labels')" to="/labels" class="nav-labels" @click.stop="">
<v-list-tile-action :title="$gettext('Labels')">
<v-icon>label</v-icon>
</v-list-tile-action>
@@ -507,19 +323,12 @@
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Labels">Labels</translate>
<span v-show="config.count.labels > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.labels | abbreviateCount
}}</span>
<span v-show="config.count.labels > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.labels | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="$config.feature('folders')"
:to="{ name: 'folders' }"
class="nav-folders"
@click.stop=""
>
<v-list-tile v-show="$config.feature('folders')" :to="{ name: 'folders' }" class="nav-folders" @click.stop="">
<v-list-tile-action :title="$gettext('Folders')">
<v-icon>folder</v-icon>
</v-list-tile-action>
@@ -527,19 +336,12 @@
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Folders">Folders</translate>
<span v-show="config.count.folders > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.folders | abbreviateCount
}}</span>
<span v-show="config.count.folders > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.folders | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="$config.feature('private')"
to="/private"
class="nav-private"
@click.stop=""
>
<v-list-tile v-show="$config.feature('private')" to="/private" class="nav-private" @click.stop="">
<v-list-tile-action :title="$gettext('Private')">
<v-icon>lock</v-icon>
</v-list-tile-action>
@@ -547,19 +349,12 @@
<v-list-tile-content>
<v-list-tile-title class="p-flex-menuitem">
<translate key="Private">Private</translate>
<span v-show="config.count.private > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.private | abbreviateCount
}}</span>
<span v-show="config.count.private > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.private | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-if="isMini && $config.feature('library')"
:to="{ name: 'library_index' }"
class="nav-library"
@click.stop=""
>
<v-list-tile v-if="isMini && $config.feature('library')" :to="{ name: 'library_index' }" class="nav-library" @click.stop="">
<v-list-tile-action :title="$gettext('Library')">
<v-icon>camera_roll</v-icon>
</v-list-tile-action>
@@ -571,11 +366,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-group
v-if="!isMini && $config.feature('library')"
prepend-icon="camera_roll"
no-action
>
<v-list-group v-if="!isMini && $config.feature('library')" prepend-icon="camera_roll" no-action>
<template #activator>
<v-list-tile :to="{ name: 'library_index' }" class="nav-library" @click.stop="">
<v-list-tile-content>
@@ -586,20 +377,11 @@
</v-list-tile>
</template>
<v-list-tile
v-show="$config.feature('files')"
to="/index/files"
class="nav-originals"
@click.stop=""
>
<v-list-tile v-show="$config.feature('files')" to="/index/files" class="nav-originals" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`p-flex-menuitem menu-item ${rtl ? '--rtl' : ''}`">
<translate key="Originals">Originals</translate>
<span
v-show="config.count.files > 0 && canAccessPrivate"
:class="`nav-count ${rtl ? '--rtl' : ''}`"
>{{ config.count.files | abbreviateCount }}</span
>
<span v-show="config.count.files > 0 && canAccessPrivate" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.files | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
@@ -608,9 +390,7 @@
<v-list-tile-content>
<v-list-tile-title :class="`p-flex-menuitem menu-item ${rtl ? '--rtl' : ''}`">
<translate key="Hidden">Hidden</translate>
<span v-show="config.count.hidden > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{
config.count.hidden | abbreviateCount
}}</span>
<span v-show="config.count.hidden > 0" :class="`nav-count ${rtl ? '--rtl' : ''}`">{{ config.count.hidden | abbreviateCount }}</span>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
@@ -625,13 +405,7 @@
</v-list-group>
<template v-if="!config.disable.settings">
<v-list-tile
v-if="isMini"
v-show="$config.feature('settings')"
:to="{ name: 'settings' }"
class="nav-settings"
@click.stop=""
>
<v-list-tile v-if="isMini" v-show="$config.feature('settings')" :to="{ name: 'settings' }" class="nav-settings" @click.stop="">
<v-list-tile-action :title="$gettext('Settings')">
<v-icon>settings</v-icon>
</v-list-tile-action>
@@ -643,12 +417,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-group
v-else
v-show="$config.feature('settings')"
prepend-icon="settings"
no-action
>
<v-list-group v-else v-show="$config.feature('settings')" prepend-icon="settings" no-action>
<template #activator>
<v-list-tile :to="{ name: 'settings' }" class="nav-settings" @click.stop="">
<v-list-tile-content>
@@ -659,13 +428,7 @@
</v-list-tile>
</template>
<v-list-tile
v-if="canManageUsers"
:to="{ path: '/admin/users' }"
:exact="false"
class="nav-admin-users"
@click.stop=""
>
<v-list-tile v-if="canManageUsers" :to="{ path: '/admin/users' }" :exact="false" class="nav-admin-users" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`menu-item ${rtl ? '--rtl' : ''}`">
<translate>Users</translate>
@@ -673,13 +436,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="featFeedback"
:to="{ name: 'feedback' }"
:exact="true"
class="nav-feedback"
@click.stop=""
>
<v-list-tile v-show="featFeedback" :to="{ name: 'feedback' }" :exact="true" class="nav-feedback" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`menu-item ${rtl ? '--rtl' : ''}`">
<translate>Feedback</translate>
@@ -695,13 +452,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="featUpgrade"
:to="{ name: 'upgrade' }"
class="nav-upgrade"
:exact="true"
@click.stop=""
>
<v-list-tile v-show="featUpgrade" :to="{ name: 'upgrade' }" class="nav-upgrade" :exact="true" @click.stop="">
<v-list-tile-content>
<v-list-tile-title :class="`menu-item ${rtl ? '--rtl' : ''}`">
<translate key="Upgrade">Upgrade</translate>
@@ -731,12 +482,7 @@
</v-list-tile-content>
</v-list-tile>
<v-list-tile
v-show="featMembership"
:to="{ name: 'upgrade' }"
class="nav-membership"
@click.stop=""
>
<v-list-tile v-show="featMembership" :to="{ name: 'upgrade' }" class="nav-membership" @click.stop="">
<v-list-tile-action :title="$gettext('Support Our Mission')">
<v-icon>diamond</v-icon>
</v-list-tile-action>
@@ -750,12 +496,7 @@
</v-list>
<v-list class="p-user-box">
<v-list-tile
v-show="$config.disconnected"
to="/help/websockets"
class="nav-connecting navigation"
@click.stop=""
>
<v-list-tile v-show="$config.disconnected" to="/help/websockets" class="nav-connecting navigation" @click.stop="">
<v-list-tile-action :title="$gettext('Offline')">
<v-icon color="warning">wifi_off</v-icon>
</v-list-tile-action>
@@ -784,11 +525,7 @@
</v-list-tile-action>
</v-list-tile>
<v-list-tile
v-show="isMini && auth && !isPublic"
class="nav-logout"
@click.stop.prevent="onLogout"
>
<v-list-tile v-show="isMini && auth && !isPublic" class="nav-logout" @click.stop.prevent="onLogout">
<v-list-tile-action :title="$gettext('Logout')">
<v-icon>power_settings_new</v-icon>
</v-list-tile-action>
@@ -804,120 +541,63 @@
<div id="mobile-menu" :class="{ active: speedDial }" @click.stop="speedDial = false">
<div class="menu-content grow-top-right">
<div class="menu-icons">
<a
v-if="auth && !isPublic"
href="#"
:title="$gettext('Logout')"
class="menu-action nav-logout"
@click.prevent="onLogout"
>
<a v-if="auth && !isPublic" href="#" :title="$gettext('Logout')" class="menu-action nav-logout" @click.prevent="onLogout">
<v-icon>power_settings_new</v-icon>
</a>
<a
href="#"
:title="$gettext('Reload')"
class="menu-action nav-reload"
@click.prevent="reloadApp"
>
<a href="#" :title="$gettext('Reload')" class="menu-action nav-reload" @click.prevent="reloadApp">
<v-icon>refresh</v-icon>
</a>
<router-link
v-if="auth && $config.feature('account')"
:to="{ name: 'settings_account' }"
:title="$gettext('Account')"
class="menu-action nav-account"
>
<router-link v-if="auth && $config.feature('account')" :to="{ name: 'settings_account' }" :title="$gettext('Account')" class="menu-action nav-account">
<v-icon>admin_panel_settings</v-icon>
</router-link>
<router-link
v-if="auth && $config.feature('settings') && !routeName('settings')"
:to="{ name: 'settings' }"
:title="$gettext('Settings')"
class="menu-action nav-settings"
>
<router-link v-if="auth && $config.feature('settings') && !routeName('settings')" :to="{ name: 'settings' }" :title="$gettext('Settings')" class="menu-action nav-settings">
<v-icon>settings</v-icon>
</router-link>
<a
v-if="auth && !config.readonly && $config.feature('upload')"
href="#"
:title="$gettext('Upload')"
class="menu-action nav-upload"
@click.prevent="openUpload()"
>
<a v-if="auth && !config.readonly && $config.feature('upload')" href="#" :title="$gettext('Upload')" class="menu-action nav-upload" @click.prevent="openUpload()">
<v-icon>cloud_upload</v-icon>
</a>
<router-link
v-if="!auth && !isPublic"
:to="{ name: 'login' }"
:title="$gettext('Login')"
class="menu-action nav-login"
>
<router-link v-if="!auth && !isPublic" :to="{ name: 'login' }" :title="$gettext('Login')" class="menu-action nav-login">
<v-icon>login</v-icon>
</router-link>
</div>
<div class="menu-actions">
<div
v-if="auth && !routeName('browse') && $config.feature('search')"
class="menu-action nav-search"
>
<div v-if="auth && !routeName('browse') && $config.feature('search')" class="menu-action nav-search">
<router-link to="/browse">
<v-icon>search</v-icon>
<translate>Search</translate>
</router-link>
</div>
<div
v-if="auth && !routeName('albums') && $config.feature('albums')"
class="menu-action nav-albums"
>
<div v-if="auth && !routeName('albums') && $config.feature('albums')" class="menu-action nav-albums">
<router-link to="/albums">
<v-icon>bookmark</v-icon>
<translate>Albums</translate>
</router-link>
</div>
<div
v-if="auth && canManagePeople && !routeName('people') && $config.feature('people')"
class="menu-action nav-people"
>
<div v-if="auth && canManagePeople && !routeName('people') && $config.feature('people')" class="menu-action nav-people">
<router-link to="/people">
<v-icon>person</v-icon>
<translate>People</translate>
</router-link>
</div>
<div
v-if="auth && canSearchPlaces && !routeName('places') && $config.feature('places')"
class="menu-action nav-places"
>
<div v-if="auth && canSearchPlaces && !routeName('places') && $config.feature('places')" class="menu-action nav-places">
<router-link to="/places">
<v-icon>place</v-icon>
<translate>Places</translate>
</router-link>
</div>
<div
v-if="
auth && !routeName('files') && $config.feature('files') && $config.feature('library')
"
class="menu-action nav-files"
>
<div v-if="auth && !routeName('files') && $config.feature('files') && $config.feature('library')" class="menu-action nav-files">
<router-link to="/index/files">
<v-icon>folder</v-icon>
<translate>Files</translate>
</router-link>
</div>
<div
v-if="auth && !routeName('library_index') && $config.feature('library')"
class="menu-action nav-index"
>
<div v-if="auth && !routeName('library_index') && $config.feature('library')" class="menu-action nav-index">
<router-link :to="{ name: 'library_index' }">
<v-icon>camera_roll</v-icon>
<translate>Index</translate>
</router-link>
</div>
<div
v-if="
auth && !routeName('index') && $config.feature('library') && $config.feature('logs')
"
class="menu-action nav-logs"
>
<div v-if="auth && !routeName('index') && $config.feature('library') && $config.feature('logs')" class="menu-action nav-logs">
<router-link :to="{ name: 'library_logs' }">
<v-icon>feed</v-icon>
<translate>Logs</translate>
@@ -945,25 +625,12 @@
</div>
</div>
<div v-if="config.legalInfo && visible" id="legal-info">
<span v-if="config.legalUrl" class="clickable" @click.stop.prevent="onInfo()">{{
config.legalInfo
}}</span>
<span v-if="config.legalUrl" class="clickable" @click.stop.prevent="onInfo()">{{ config.legalInfo }}</span>
<span v-else>{{ config.legalInfo }}</span>
</div>
<p-reload-dialog :show="reload.dialog" @close="reload.dialog = false"></p-reload-dialog>
<p-upload-dialog
:show="upload.dialog"
:data="upload.data"
@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"
@close="edit.dialog = false"
></p-photo-edit-dialog>
<p-upload-dialog :show="upload.dialog" :data="upload.data" @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" @close="edit.dialog = false"></p-photo-edit-dialog>
</div>
</template>

View File

@@ -1,12 +1,5 @@
<template>
<v-snackbar
id="p-notify"
v-model="visible"
:color="color"
:timeout="0"
:class="textColor"
:bottom="true"
>
<v-snackbar id="p-notify" v-model="visible" :color="color" :timeout="0" :class="textColor" :bottom="true">
<span :dir="!rtl ? 'let' : 'rtl'">{{ text }}</span>
<v-btn :class="textColor + ' pr-0'" icon flat @click="close">
<v-icon :class="textColor">close</v-icon>

View File

@@ -10,74 +10,37 @@
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<div class="pswp__taken hidden-xs-only">{{ formatDate(item.TakenAtLocal) }}</div>
<div class="pswp__taken hidden-xs-only">
{{ formatDate(item.TakenAtLocal) }}
</div>
<div class="pswp__counter"></div>
<button
class="pswp__button pswp__button--close action-close"
:title="$gettext('Close')"
></button>
<button class="pswp__button pswp__button--close action-close" :title="$gettext('Close')"></button>
<button
v-if="canDownload"
class="pswp__button action-download"
style="background: none"
:title="$gettext('Download')"
@click.exact="onDownload"
>
<button v-if="canDownload" class="pswp__button action-download" style="background: none" :title="$gettext('Download')" @click.exact="onDownload">
<v-icon size="16" color="white">get_app</v-icon>
</button>
<button
v-if="canEdit"
class="pswp__button action-edit hidden-shared-only"
style="background: none"
:title="$gettext('Edit')"
@click.exact="onEdit"
>
<button v-if="canEdit" class="pswp__button action-edit hidden-shared-only" style="background: none" :title="$gettext('Edit')" @click.exact="onEdit">
<v-icon size="16" color="white">edit</v-icon>
</button>
<button
class="pswp__button action-select"
style="background: none"
:title="$gettext('Select')"
@click.exact="onSelect"
>
<v-icon v-if="selection.length && $clipboard.has(item)" size="16" color="white"
>check_circle</v-icon
>
<button class="pswp__button action-select" style="background: none" :title="$gettext('Select')" @click.exact="onSelect">
<v-icon v-if="selection.length && $clipboard.has(item)" size="16" color="white">check_circle</v-icon>
<v-icon v-else size="16" color="white">radio_button_off</v-icon>
</button>
<button
v-if="canLike"
class="pswp__button action-like hidden-shared-only"
style="background: none"
:title="$gettext('Like')"
@click.exact="onLike"
>
<button v-if="canLike" class="pswp__button action-like hidden-shared-only" style="background: none" :title="$gettext('Like')" @click.exact="onLike">
<v-icon v-if="item.Favorite" size="16" color="white">favorite</v-icon>
<v-icon v-else size="16" color="white">favorite_border</v-icon>
</button>
<button
class="pswp__button pswp__button--fs action-toggle-fullscreen"
:title="$gettext('Fullscreen')"
></button>
<button class="pswp__button pswp__button--fs action-toggle-fullscreen" :title="$gettext('Fullscreen')"></button>
<button
class="pswp__button pswp__button--zoom action-zoom"
:title="$gettext('Zoom in/out')"
></button>
<button class="pswp__button pswp__button--zoom action-zoom" :title="$gettext('Zoom in/out')"></button>
<button
class="pswp__button action-slideshow"
style="background: none"
:title="$gettext('Start/Stop Slideshow')"
@click.exact="onSlideshow"
>
<button class="pswp__button action-slideshow" style="background: none" :title="$gettext('Start/Stop Slideshow')" @click.exact="onSlideshow">
<v-icon v-show="!interval" size="18" color="white">play_arrow</v-icon>
<v-icon v-show="interval" size="16" color="white">pause</v-icon>
</button>
@@ -95,16 +58,10 @@
<div class="pswp__share-tooltip"></div>
</div>
<button
class="pswp__button pswp__button--arrow--left action-previous"
title="Previous (arrow left)"
>
<button class="pswp__button pswp__button--arrow--left action-previous" title="Previous (arrow left)">
</button>
<button
class="pswp__button pswp__button--arrow--right action-next"
title="Next (arrow right)"
>
<button class="pswp__button pswp__button--arrow--right action-next" title="Next (arrow right)">
</button>
<div class="pswp__caption" @click="onPlay">
@@ -112,22 +69,8 @@
</div>
</div>
</div>
<div
v-if="player.show"
class="video-viewer"
@click.stop.prevent="closePlayer"
@keydown.esc.stop.prevent="closePlayer"
>
<p-video-player
ref="player"
:source="player.source"
:poster="player.poster"
:height="player.height"
:width="player.width"
:autoplay="player.autoplay"
:loop="player.loop"
@close="closePlayer"
>
<div v-if="player.show" class="video-viewer" @click.stop.prevent="closePlayer" @keydown.esc.stop.prevent="closePlayer">
<p-video-player ref="player" :source="player.source" :poster="player.poster" :height="player.height" :width="player.width" :autoplay="player.autoplay" :loop="player.loop" @close="closePlayer">
</p-video-player>
</div>
</div>

View File

@@ -1,13 +1,7 @@
<template>
<v-container grid-list-xs fluid class="pa-2 p-photos p-photo-cards">
<template v-if="photos.length === 0">
<v-alert
:value="true"
color="secondary-dark"
:icon="isSharedView ? 'image_not_supported' : 'lightbulb_outline'"
class="no-results ma-2 opacity-70"
outline
>
<v-alert :value="true" color="secondary-dark" :icon="isSharedView ? 'image_not_supported' : 'lightbulb_outline'" class="no-results ma-2 opacity-70" outline>
<h3 v-if="filter.order === 'edited'" class="body-2 ma-0 pa-0">
<translate>No recently edited pictures</translate>
</h3>
@@ -26,17 +20,8 @@
</v-alert>
</template>
<v-layout row wrap class="search-results photo-results cards-view" :class="{ 'select-results': selectMode }">
<div
v-for="(photo, index) in photos"
ref="items"
:key="photo.ID"
:data-index="index"
class="flex xs12 sm6 md4 lg3 xlg2 ul1 d-flex"
>
<div v-if="index < firstVisibleElementIndex || index > lastVisibileElementIndex"
:data-uid="photo.UID"
class="card result placeholder"
>
<div v-for="(photo, index) in photos" ref="items" :key="photo.ID" :data-index="index" class="flex xs12 sm6 md4 lg3 xlg2 ul1 d-flex">
<div v-if="index < firstVisibleElementIndex || index > lastVisibileElementIndex" :data-uid="photo.UID" class="card result placeholder">
<div class="card darken-1 image" />
<div v-if="photo.Quality < 3 && context === 'review'" style="width: 100%; height: 34px" />
<div class="pa-3 card-details">
@@ -50,7 +35,7 @@
<div class="caption">
<i />
{{ photo.getDateString(true) }}
<br>
<br />
<i />
<template v-if="photo.Type === 'video' || photo.Type === 'animated'">
{{ photo.getVideoInfo() }}
@@ -59,12 +44,12 @@
{{ photo.getPhotoInfo() }}
</template>
<template v-if="filter.order === 'name' && $config.feature('download')">
<br>
<br />
<i />
{{ photo.baseName() }}
</template>
<template v-if="featPlaces && photo.Country !== 'zz'">
<br>
<br />
<i />
{{ photo.locationInfo() }}
</template>
@@ -72,14 +57,10 @@
</div>
</div>
</div>
<div v-else
:data-id="photo.ID"
:data-uid="photo.UID"
class="result card"
:class="photo.classes()"
@contextmenu.stop="onContextMenu($event, index)">
<div v-else :data-id="photo.ID" :data-uid="photo.UID" class="result card" :class="photo.classes()" @contextmenu.stop="onContextMenu($event, index)">
<div class="card-background card"></div>
<div :key="photo.Hash"
<div
:key="photo.Hash"
:title="photo.Title"
class="card darken-1 clickable image"
:style="`background-image: url(${photo.thumbnailUrl('tile_500')})`"
@@ -91,33 +72,30 @@
@mouseleave="pauseLive(photo)"
>
<v-layout v-if="photo.Type === 'live' || photo.Type === 'animated'" class="live-player">
<video :id="'live-player-' + photo.ID" :key="photo.ID" width="500" height="500" preload="none"
loop muted playsinline>
<source :src="photo.videoUrl()">
<video :id="'live-player-' + photo.ID" :key="photo.ID" width="500" height="500" preload="none" loop muted playsinline>
<source :src="photo.videoUrl()" />
</video>
</v-layout>
<button v-if="photo.Type !== 'image' || photo.isStack()"
<button
v-if="photo.Type !== 'image' || photo.isStack()"
class="input-open"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onOpen($event, index, !isSharedView, photo.Type === 'live')"
@touchmove.stop.prevent
@click.stop.prevent="onOpen($event, index, !isSharedView, photo.Type === 'live')">
@click.stop.prevent="onOpen($event, index, !isSharedView, photo.Type === 'live')"
>
<i v-if="photo.Type === 'raw'" class="action-raw" :title="$gettext('RAW')"> raw_on </i>
<i v-if="photo.Type === 'live'" class="action-live" :title="$gettext('Live')"><icon-live-photo/></i>
<i v-if="photo.Type === 'live'" class="action-live" :title="$gettext('Live')">
<icon-live-photo />
</i>
<i v-if="photo.Type === 'video'" class="action-play" :title="$gettext('Video')"> play_arrow </i>
<i v-if="photo.Type === 'animated'" class="action-animated" :title="$gettext('Animated')"> gif </i>
<i v-if="photo.Type === 'vector'" class="action-vector" :title="$gettext('Vector')"> font_download </i>
<i v-if="photo.Type === 'image'" class="action-stack" :title="$gettext('Stack')"> burst_mode </i>
</button>
<button v-if="photo.Type === 'image' && selectMode"
class="input-view"
:title="$gettext('View')"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onOpen($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="onOpen($event, index)">
<button v-if="photo.Type === 'image' && selectMode" class="input-view" :title="$gettext('View')" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="onOpen($event, index)" @touchmove.stop.prevent @click.stop.prevent="onOpen($event, index)">
<i class="action-fullscreen"> zoom_in </i>
</button>
@@ -135,23 +113,12 @@
the v-hover component we instead hide the button by default and
use css to show it when it is being hovered.
-->
<button
class="input-select"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onSelect($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="onSelect($event, index)">
<button class="input-select" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="onSelect($event, index)" @touchmove.stop.prevent @click.stop.prevent="onSelect($event, index)">
<i class="select-on"> check_circle </i>
<i class="select-off"> radio_button_off </i>
</button>
<button
v-if="!isSharedView"
class="input-favorite"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="toggleLike($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="toggleLike($event, index)">
<button v-if="!isSharedView" class="input-favorite" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="toggleLike($event, index)" @touchmove.stop.prevent @click.stop.prevent="toggleLike($event, index)">
<i v-if="photo.Favorite"> favorite </i>
<i v-else> favorite_border </i>
</button>
@@ -160,18 +127,12 @@
<v-card-actions v-if="!isSharedView && photo.Quality < 3 && context === 'review'" class="card-details pa-0">
<v-layout row wrap align-center>
<v-flex xs6 class="text-xs-center pa-1">
<v-btn color="card darken-1"
small depressed dark block :round="false"
class="action-archive text-xs-center"
:title="$gettext('Archive')" @click.stop="photo.archive()">
<v-btn color="card darken-1" small depressed dark block :round="false" class="action-archive text-xs-center" :title="$gettext('Archive')" @click.stop="photo.archive()">
<v-icon dark>clear</v-icon>
</v-btn>
</v-flex>
<v-flex xs6 class="text-xs-center pa-1">
<v-btn color="card darken-1"
small depressed dark block :round="false"
class="action-approve text-xs-center"
:title="$gettext('Approve')" @click.stop="photo.approve()">
<v-btn color="card darken-1" small depressed dark block :round="false" class="action-approve text-xs-center" :title="$gettext('Approve')" @click.stop="photo.approve()">
<v-icon dark>check</v-icon>
</v-btn>
</v-flex>
@@ -181,8 +142,7 @@
<div class="pa-3 card-details">
<div>
<h3 class="body-2 mb-2" :title="photo.Title">
<button class="action-title-edit" :data-uid="photo.UID"
@click.exact="isSharedView ? openPhoto(index) : editPhoto(index)">
<button class="action-title-edit" :data-uid="photo.UID" @click.exact="isSharedView ? openPhoto(index) : editPhoto(index)">
{{ photo.Title | truncate(80) }}
</button>
</h3>
@@ -192,54 +152,45 @@
</button>
</div>
<div class="caption">
<button class="action-date-edit" :data-uid="photo.UID"
@click.exact="editPhoto(index)">
<button class="action-date-edit" :data-uid="photo.UID" @click.exact="editPhoto(index)">
<i :title="$gettext('Taken')"> date_range </i>
{{ photo.getDateString(true) }}
</button>
<br>
<button v-if="photo.Type === 'video'" :title="$gettext('Video')"
@click.exact="openPhoto(index)">
<br />
<button v-if="photo.Type === 'video'" :title="$gettext('Video')" @click.exact="openPhoto(index)">
<i>movie</i>
{{ photo.getVideoInfo() }}
</button>
<button v-else-if="photo.Type === 'live'" :title="$gettext('Live')"
@click.exact="openPhoto(index)">
<button v-else-if="photo.Type === 'live'" :title="$gettext('Live')" @click.exact="openPhoto(index)">
<i>play_circle</i>
{{ photo.getVideoInfo() }}
</button>
<button v-else-if="photo.Type === 'animated'" :title="$gettext('Animated')+' GIF'"
@click.exact="openPhoto(index)">
<button v-else-if="photo.Type === 'animated'" :title="$gettext('Animated') + ' GIF'" @click.exact="openPhoto(index)">
<i>gif_box</i>
{{ photo.getVideoInfo() }}
</button>
<button v-else-if="photo.Type === 'vector'" :title="$gettext('Vector')"
@click.exact="openPhoto(index)">
<button v-else-if="photo.Type === 'vector'" :title="$gettext('Vector')" @click.exact="openPhoto(index)">
<i>font_download</i>
{{ photo.getVectorInfo() }}
</button>
<button v-else :title="$gettext('Camera')" class="action-camera-edit"
:data-uid="photo.UID" @click.exact="editPhoto(index)">
<button v-else :title="$gettext('Camera')" class="action-camera-edit" :data-uid="photo.UID" @click.exact="editPhoto(index)">
<i>photo_camera</i>
{{ photo.getPhotoInfo() }}
</button>
<button v-if="photo.LensID > 1 || photo.FocalLength" :title="$gettext('Lens')" class="action-lens-edit"
:data-uid="photo.UID" @click.exact="editPhoto(index)">
<button v-if="photo.LensID > 1 || photo.FocalLength" :title="$gettext('Lens')" class="action-lens-edit" :data-uid="photo.UID" @click.exact="editPhoto(index)">
<i>camera</i>
{{ photo.getLensInfo() }}
</button>
<template v-if="filter.order === 'name' && $config.feature('download')">
<br>
<button :title="$gettext('Name')"
@click.exact="downloadFile(index)">
<br />
<button :title="$gettext('Name')" @click.exact="downloadFile(index)">
<i>insert_drive_file</i>
{{ photo.baseName() }}
</button>
</template>
<template v-if="featPlaces && photo.Country !== 'zz'">
<br>
<button :title="$gettext('Location')" class="action-location"
:data-uid="photo.UID" @click.exact="openLocation(index)">
<br />
<button :title="$gettext('Location')" class="action-location" :data-uid="photo.UID" @click.exact="openLocation(index)">
<i>location_on</i>
{{ photo.locationInfo() }}
</button>
@@ -256,11 +207,11 @@
import download from "common/download";
import Notify from "common/notify";
import { Input, InputInvalid, ClickShort, ClickLong } from "common/input";
import {virtualizationTools} from 'common/virtualization-tools';
import { virtualizationTools } from "common/virtualization-tools";
import IconLivePhoto from "component/icon/live-photo.vue";
export default {
name: 'PPhotoCards',
name: "PPhotoCards",
components: {
IconLivePhoto,
},
@@ -303,7 +254,7 @@ export default {
const featPlaces = this.$config.settings().features.places;
const featPrivate = this.$config.settings().features.private;
const input = new Input();
const debug = this.$config.get('debug');
const debug = this.$config.get("debug");
return {
featPlaces,
@@ -323,14 +274,17 @@ export default {
});
},
immediate: true,
}
},
},
beforeCreate() {
this.intersectionObserver = new IntersectionObserver((entries) => {
this.intersectionObserver = new IntersectionObserver(
(entries) => {
this.visibilitiesChanged(entries);
}, {
},
{
rootMargin: "50% 0px",
});
}
);
},
beforeDestroy() {
this.intersectionObserver.disconnect();
@@ -351,14 +305,10 @@ export default {
}
},
elementIndexFromIntersectionObserverEntry(entry) {
return parseInt(entry.target.getAttribute('data-index'));
return parseInt(entry.target.getAttribute("data-index"));
},
visibilitiesChanged(entries) {
const [smallestIndex, largestIndex] = virtualizationTools.updateVisibleElementIndices(
this.visibleElementIndices,
entries,
this.elementIndexFromIntersectionObserverEntry,
);
const [smallestIndex, largestIndex] = virtualizationTools.updateVisibleElementIndices(this.visibleElementIndices, entries, this.elementIndexFromIntersectionObserverEntry);
// we observe only every 5th item, so we increase the rendered
// range here by 4 items in every direction just to be safe
@@ -472,6 +422,6 @@ export default {
*/
this.$forceUpdate();
},
}
},
};
</script>

View File

@@ -1,156 +1,54 @@
<template>
<div>
<v-container v-if="selection.length > 0" fluid class="pa-0">
<v-speed-dial
id="t-clipboard" v-model="expanded" fixed
bottom
direction="top"
transition="slide-y-reverse-transition"
:right="!rtl"
:left="rtl"
:class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-photo-clipboard`"
>
<v-speed-dial id="t-clipboard" v-model="expanded" fixed bottom direction="top" transition="slide-y-reverse-transition" :right="!rtl" :left="rtl" :class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-photo-clipboard`">
<template #activator>
<v-btn
fab
dark
color="accent darken-2"
class="action-menu"
>
<v-btn fab dark color="accent darken-2" class="action-menu">
<v-icon v-if="selection.length === 0">menu</v-icon>
<span v-else class="count-clipboard">{{ selection.length }}</span>
</v-btn>
</template>
<v-btn
v-if="canShare && context !== 'archive' && context !== 'review'" fab dark
small
:title="$gettext('Share')"
color="share"
:disabled="selection.length === 0 || busy"
class="action-share"
@click.stop="dialog.share = true"
>
<v-btn v-if="canShare && context !== 'archive' && context !== 'review'" fab dark small :title="$gettext('Share')" color="share" :disabled="selection.length === 0 || busy" class="action-share" @click.stop="dialog.share = true">
<v-icon>cloud</v-icon>
</v-btn>
<v-btn
v-if="canManage && context === 'review'" fab dark
small
:title="$gettext('Approve')"
color="share"
:disabled="selection.length === 0 || busy"
class="action-approve"
@click.stop="batchApprove"
>
<v-btn v-if="canManage && context === 'review'" fab dark small :title="$gettext('Approve')" color="share" :disabled="selection.length === 0 || busy" class="action-approve" @click.stop="batchApprove">
<v-icon>check</v-icon>
</v-btn>
<v-btn
v-if="canEdit" fab dark
small
:title="$gettext('Edit')"
color="edit"
:disabled="selection.length === 0 || busy"
class="action-edit"
@click.stop="edit"
>
<v-btn v-if="canEdit" fab dark small :title="$gettext('Edit')" color="edit" :disabled="selection.length === 0 || busy" class="action-edit" @click.stop="edit">
<v-icon>edit</v-icon>
</v-btn>
<v-btn
v-if="canTogglePrivate" fab dark
small
:title="$gettext('Change private flag')"
color="private"
:disabled="selection.length === 0 || busy"
class="action-private"
@click.stop="batchPrivate"
>
<v-btn v-if="canTogglePrivate" fab dark small :title="$gettext('Change private flag')" color="private" :disabled="selection.length === 0 || busy" class="action-private" @click.stop="batchPrivate">
<v-icon>lock</v-icon>
</v-btn>
<v-btn
v-if="canDownload && context !== 'archive'" fab dark
small
:title="$gettext('Download')"
:disabled="busy"
color="download"
class="action-download"
@click.stop="download()"
>
<v-btn v-if="canDownload && context !== 'archive'" fab dark small :title="$gettext('Download')" :disabled="busy" color="download" class="action-download" @click.stop="download()">
<v-icon>get_app</v-icon>
</v-btn>
<v-btn
v-if="canEditAlbum && context !== 'archive'" fab dark
small
:title="$gettext('Add to album')"
color="album"
:disabled="selection.length === 0 || busy"
class="action-album"
@click.stop="dialog.album = true"
>
<v-btn v-if="canEditAlbum && context !== 'archive'" fab dark small :title="$gettext('Add to album')" color="album" :disabled="selection.length === 0 || busy" class="action-album" @click.stop="dialog.album = true">
<v-icon>bookmark</v-icon>
</v-btn>
<v-btn
v-if="canArchive && !isAlbum && context !== 'archive'" fab dark
small
color="remove"
:title="$gettext('Archive')"
:disabled="selection.length === 0 || busy"
class="action-archive"
@click.stop="archivePhotos"
>
<v-btn v-if="canArchive && !isAlbum && context !== 'archive'" fab dark small color="remove" :title="$gettext('Archive')" :disabled="selection.length === 0 || busy" class="action-archive" @click.stop="archivePhotos">
<v-icon>archive</v-icon>
</v-btn>
<v-btn
v-if="canArchive && !album && context === 'archive'" fab dark
small
color="restore"
:title="$gettext('Restore')"
:disabled="selection.length === 0 || busy"
class="action-restore"
@click.stop="batchRestore"
>
<v-btn v-if="canArchive && !album && context === 'archive'" fab dark small color="restore" :title="$gettext('Restore')" :disabled="selection.length === 0 || busy" class="action-restore" @click.stop="batchRestore">
<v-icon>unarchive</v-icon>
</v-btn>
<v-btn
v-if="canEditAlbum && isAlbum" fab dark
small
:title="$gettext('Remove from album')"
color="remove"
:disabled="selection.length === 0 || busy"
class="action-remove"
@click.stop="removeFromAlbum"
>
<v-btn v-if="canEditAlbum && isAlbum" fab dark small :title="$gettext('Remove from album')" color="remove" :disabled="selection.length === 0 || busy" class="action-remove" @click.stop="removeFromAlbum">
<v-icon>eject</v-icon>
</v-btn>
<v-btn
v-if="canDelete && !album && context === 'archive'" fab dark
small
:title="$gettext('Delete')"
color="remove"
:disabled="selection.length === 0 || busy"
class="action-delete"
@click.stop="deletePhotos"
>
<v-btn v-if="canDelete && !album && context === 'archive'" fab dark small :title="$gettext('Delete')" color="remove" :disabled="selection.length === 0 || busy" class="action-delete" @click.stop="deletePhotos">
<v-icon>delete</v-icon>
</v-btn>
<v-btn
fab dark small
color="accent"
class="action-clear"
@click.stop="clearClipboard()"
>
<v-btn fab dark small color="accent" class="action-clear" @click.stop="clearClipboard()">
<v-icon>clear</v-icon>
</v-btn>
</v-speed-dial>
</v-container>
<p-photo-archive-dialog :show="dialog.archive" @cancel="dialog.archive = false"
@confirm="batchArchive"></p-photo-archive-dialog>
<p-photo-delete-dialog :show="dialog.delete" @cancel="dialog.delete = false"
@confirm="batchDelete"></p-photo-delete-dialog>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false"
@confirm="addToAlbum"></p-photo-album-dialog>
<p-share-upload-dialog :show="dialog.share" :items="{photos: selection}" :model="album" @cancel="dialog.share = false"
@confirm="onShared"></p-share-upload-dialog>
<p-photo-archive-dialog :show="dialog.archive" @cancel="dialog.archive = false" @confirm="batchArchive"></p-photo-archive-dialog>
<p-photo-delete-dialog :show="dialog.delete" @cancel="dialog.delete = false" @confirm="batchDelete"></p-photo-delete-dialog>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false" @confirm="addToAlbum"></p-photo-album-dialog>
<p-share-upload-dialog :show="dialog.share" :items="{ photos: selection }" :model="album" @cancel="dialog.share = false" @confirm="onShared"></p-share-upload-dialog>
</div>
</template>
<script>
@@ -161,11 +59,11 @@ import download from "common/download";
import Photo from "model/photo";
export default {
name: 'PPhotoClipboard',
name: "PPhotoClipboard",
props: {
context: {
type: String,
default: 'photos',
default: "photos",
},
selection: {
type: Array,
@@ -184,7 +82,7 @@ export default {
const features = this.$config.settings().features;
return {
canTogglePrivate: this.$config.allow("photos", "manage") && this.context !== 'archive' && features.private,
canTogglePrivate: this.$config.allow("photos", "manage") && this.context !== "archive" && features.private,
canArchive: this.$config.allow("photos", "delete") && features.archive,
canDelete: this.$config.allow("photos", "delete") && features.delete,
canDownload: this.$config.allow("photos", "download") && features.download,
@@ -195,7 +93,7 @@ export default {
busy: false,
config: this.$config.values,
expanded: false,
isAlbum: this.album && this.album.Type === 'album',
isAlbum: this.album && this.album.Type === "album",
dialog: {
archive: false,
delete: false,
@@ -217,7 +115,7 @@ export default {
this.busy = true;
Api.post("batch/photos/approve", {"photos": this.selection})
Api.post("batch/photos/approve", { photos: this.selection })
.then(() => this.onApproved())
.finally(() => {
this.busy = false;
@@ -246,7 +144,7 @@ export default {
this.busy = true;
this.dialog.archive = false;
Api.post("batch/photos/archive", {"photos": this.selection})
Api.post("batch/photos/archive", { photos: this.selection })
.then(() => this.onArchived())
.finally(() => {
this.busy = false;
@@ -270,20 +168,20 @@ export default {
this.dialog.delete = false;
Api.post("batch/photos/delete", {"photos": this.selection}).then(() => this.onDeleted());
Api.post("batch/photos/delete", { photos: this.selection }).then(() => this.onDeleted());
},
onDeleted() {
Notify.success(this.$gettext("Permanently deleted"));
this.clearClipboard();
},
batchPrivate() {
Api.post("batch/photos/private", {"photos": this.selection}).then(() => this.onPrivateSaved());
Api.post("batch/photos/private", { photos: this.selection }).then(() => this.onPrivateSaved());
},
onPrivateSaved() {
this.clearClipboard();
},
batchRestore() {
Api.post("batch/photos/restore", {"photos": this.selection}).then(() => this.onRestored());
Api.post("batch/photos/restore", { photos: this.selection }).then(() => this.onRestored());
},
onRestored() {
Notify.success(this.$gettext("Selection restored"));
@@ -301,7 +199,7 @@ export default {
this.busy = true;
this.dialog.album = false;
Api.post(`albums/${ppid}/photos`, {"photos": this.selection})
Api.post(`albums/${ppid}/photos`, { photos: this.selection })
.then(() => this.onAdded())
.finally(() => {
this.busy = false;
@@ -326,7 +224,7 @@ export default {
this.dialog.album = false;
Api.delete(`albums/${uid}/photos`, {"data": {"photos": this.selection}})
Api.delete(`albums/${uid}/photos`, { data: { photos: this.selection } })
.then(() => this.onRemoved())
.finally(() => {
this.busy = false;
@@ -347,15 +245,16 @@ export default {
this.busy = false;
return;
case 1:
new Photo().find(this.selection[0])
.then(p => p.downloadAll())
new Photo()
.find(this.selection[0])
.then((p) => p.downloadAll())
.finally(() => {
this.busy = false;
});
break;
default:
Api.post("zip", {"photos": this.selection})
.then(r => {
Api.post("zip", { photos: this.selection })
.then((r) => {
this.onDownload(`${this.$config.apiUri}/zip/${r.data.filename}?t=${this.$config.downloadToken}`);
})
.finally(() => {
@@ -378,6 +277,6 @@ export default {
this.dialog.share = false;
this.clearClipboard();
},
}
},
};
</script>

View File

@@ -1,12 +1,7 @@
<template>
<div>
<div v-if="photos.length === 0" class="pa-2">
<v-alert
:value="true"
color="secondary-dark"
:icon="isSharedView ? 'image_not_supported' : 'lightbulb_outline'"
class="no-results ma-2 opacity-70"
outline>
<v-alert :value="true" color="secondary-dark" :icon="isSharedView ? 'image_not_supported' : 'lightbulb_outline'" class="no-results ma-2 opacity-70" outline>
<h3 v-if="filter.order === 'edited'" class="body-2 ma-0 pa-0">
<translate>No recently edited pictures</translate>
</h3>
@@ -31,16 +26,16 @@
<tr>
<th class="p-col-select" />
<th class="text-xs-left">
{{$gettext('Title')}}
{{ $gettext("Title") }}
</th>
<th class="text-xs-left hidden-xs-only">
{{$gettext('Taken')}}
{{ $gettext("Taken") }}
</th>
<th class="text-xs-left hidden-sm-and-down">
{{$gettext('Camera')}}
{{ $gettext("Camera") }}
</th>
<th class="text-xs-left hidden-xs-only">
{{showName ? $gettext('Name') : $gettext('Location')}}
{{ showName ? $gettext("Name") : $gettext("Location") }}
</th>
<th class="text-xs-center hidden-xs-only" />
</tr>
@@ -48,10 +43,7 @@
<tbody>
<tr v-for="(photo, index) in photos" :key="photo.ID" ref="items" :data-index="index">
<td :data-uid="photo.UID" class="result" :class="photo.classes()">
<div
v-if="index < firstVisibleElementIndex || index > lastVisibileElementIndex"
:key="photo.Hash"
class="image card darken-1">
<div v-if="index < firstVisibleElementIndex || index > lastVisibileElementIndex" :key="photo.Hash" class="image card darken-1">
</div>
<div
v-else
@@ -62,15 +54,16 @@
@touchend.stop.prevent="onClick($event, index)"
@mousedown="onMouseDown($event, index)"
@contextmenu.stop="onContextMenu($event, index)"
@click.stop.prevent="onClick($event, index)">
@click.stop.prevent="onClick($event, index)"
>
<button v-if="selectMode" class="input-select">
<i class="select-on"> check_circle </i>
<i class="select-off"> radio_button_off </i>
</button>
<button v-else-if="photo.Type === 'video' || photo.Type === 'live' || photo.Type === 'animated'"
class="input-open"
@click.stop.prevent="openPhoto(index, false, photo.Type === 'live')">
<i v-if="photo.Type === 'live'" class="action-live" :title="$gettext('Live')"><icon-live-photo/></i>
<button v-else-if="photo.Type === 'video' || photo.Type === 'live' || photo.Type === 'animated'" class="input-open" @click.stop.prevent="openPhoto(index, false, photo.Type === 'live')">
<i v-if="photo.Type === 'live'" class="action-live" :title="$gettext('Live')">
<icon-live-photo />
</i>
<i v-if="photo.Type === 'animated'" class="action-animated" :title="$gettext('Animated')"> gif </i>
<i v-if="photo.Type === 'vector'" class="action-vector" :title="$gettext('Vector')"> font_download </i>
<i v-if="photo.Type === 'video'" class="action-play" :title="$gettext('Video')"> play_arrow </i>
@@ -78,8 +71,7 @@
</div>
</td>
<td class="p-photo-desc clickable" :data-uid="photo.UID"
@click.exact="isSharedView ? openPhoto(index) : editPhoto(index)">
<td class="p-photo-desc clickable" :data-uid="photo.UID" @click.exact="isSharedView ? openPhoto(index) : editPhoto(index)">
{{ photo.Title }}
</td>
<td class="p-photo-desc hidden-xs-only" :title="photo.getDateString()">
@@ -93,12 +85,10 @@
</button>
</td>
<td class="p-photo-desc hidden-xs-only">
<button v-if="filter.order === 'name'"
:title="$gettext('Name')" @click.exact="downloadFile(index)">
<button v-if="filter.order === 'name'" :title="$gettext('Name')" @click.exact="downloadFile(index)">
{{ photo.FileName }}
</button>
<button v-else-if="photo.Country !== 'zz' && showLocation"
@click.stop.prevent="openLocation(index)">
<button v-else-if="photo.Country !== 'zz' && showLocation" @click.stop.prevent="openLocation(index)">
{{ photo.locationInfo() }}
</button>
<span v-else>
@@ -113,16 +103,12 @@
</template>
<template v-else>
<v-btn v-if="hidePrivate" class="input-private" icon small flat :ripple="false"
:data-uid="photo.UID" @click.stop.prevent="photo.togglePrivate()">
<v-btn v-if="hidePrivate" class="input-private" icon small flat :ripple="false" :data-uid="photo.UID" @click.stop.prevent="photo.togglePrivate()">
<v-icon v-if="photo.Private" color="secondary-dark" class="select-on">lock</v-icon>
<v-icon v-else color="secondary" class="select-off">lock_open</v-icon>
</v-btn>
<v-btn class="input-like" icon small flat :ripple="false"
:data-uid="photo.UID" @click.stop.prevent="photo.toggleLike()">
<v-icon v-if="photo.Favorite" color="pink lighten-3" :data-uid="photo.UID" class="select-on">
favorite
</v-icon>
<v-btn class="input-like" icon small flat :ripple="false" :data-uid="photo.UID" @click.stop.prevent="photo.toggleLike()">
<v-icon v-if="photo.Favorite" color="pink lighten-3" :data-uid="photo.UID" class="select-on"> favorite </v-icon>
<v-icon v-else color="secondary" :data-uid="photo.UID" class="select-off">favorite_border</v-icon>
</v-btn>
</template>
@@ -138,11 +124,11 @@
<script>
import download from "common/download";
import Notify from "common/notify";
import {virtualizationTools} from 'common/virtualization-tools';
import { virtualizationTools } from "common/virtualization-tools";
import IconLivePhoto from "component/icon/live-photo.vue";
export default {
name: 'PPhotoList',
name: "PPhotoList",
components: {
IconLivePhoto,
},
@@ -193,7 +179,7 @@ export default {
return {
config: this.$config.values,
notFoundMessage: m,
showName: this.filter.order === 'name',
showName: this.filter.order === "name",
showLocation: this.$config.values.settings.features.places,
hidePrivate: this.$config.values.settings.features.private,
mouseDown: {
@@ -214,14 +200,17 @@ export default {
});
},
immediate: true,
}
},
},
beforeCreate() {
this.intersectionObserver = new IntersectionObserver((entries) => {
this.intersectionObserver = new IntersectionObserver(
(entries) => {
this.visibilitiesChanged(entries);
}, {
},
{
rootMargin: "100% 0px",
});
}
);
},
beforeDestroy() {
this.intersectionObserver.disconnect();
@@ -244,14 +233,10 @@ export default {
}
},
elementIndexFromIntersectionObserverEntry(entry) {
return parseInt(entry.target.getAttribute('data-index'));
return parseInt(entry.target.getAttribute("data-index"));
},
visibilitiesChanged(entries) {
const [smallestIndex, largestIndex] = virtualizationTools.updateVisibleElementIndices(
this.visibleElementIndices,
entries,
this.elementIndexFromIntersectionObserverEntry,
);
const [smallestIndex, largestIndex] = virtualizationTools.updateVisibleElementIndices(this.visibleElementIndices, entries, this.elementIndexFromIntersectionObserverEntry);
// we observe only every 5th item, so we increase the rendered
// range here by 4 items in every directio just to be safe
@@ -277,8 +262,8 @@ export default {
this.mouseDown.timeStamp = ev.timeStamp;
},
onClick(ev, index) {
const longClick = (this.mouseDown.index === index && (ev.timeStamp - this.mouseDown.timeStamp) > 400);
const scrolled = (this.mouseDown.scrollY - window.scrollY) !== 0;
const longClick = this.mouseDown.index === index && ev.timeStamp - this.mouseDown.timeStamp > 400;
const scrolled = this.mouseDown.scrollY - window.scrollY !== 0;
if (scrolled) {
return;
@@ -307,6 +292,6 @@ export default {
selectRange(index) {
this.$clipboard.addRange(index, this.photos);
},
}
},
};
</script>

View File

@@ -1,13 +1,7 @@
<template>
<v-container grid-list-xs fluid class="pa-2 p-photos p-photo-mosaic">
<div v-if="photos.length === 0" class="pa-0">
<v-alert
:value="true"
color="secondary-dark"
:icon="isSharedView ? 'image_not_supported' : 'lightbulb_outline'"
class="no-results ma-2 opacity-70"
outline
>
<v-alert :value="true" color="secondary-dark" :icon="isSharedView ? 'image_not_supported' : 'lightbulb_outline'" class="no-results ma-2 opacity-70" outline>
<h3 v-if="filter.order === 'edited'" class="body-2 ma-0 pa-0">
<translate>No recently edited pictures</translate>
</h3>
@@ -26,23 +20,15 @@
</v-alert>
</div>
<v-layout row wrap class="search-results photo-results mosaic-view" :class="{ 'select-results': selectMode }">
<div
v-for="(photo, index) in photos"
ref="items"
:key="photo.ID"
class="flex xs4 sm3 md2 lg1"
:data-index="index"
>
<div v-for="(photo, index) in photos" ref="items" :key="photo.ID" class="flex xs4 sm3 md2 lg1" :data-index="index">
<!--
The following div is the layout + size container. It makes the browser not
re-layout all elements in the list when the children of one of them changes
-->
<div class="image-container">
<div v-if="index < firstVisibleElementIndex || index > lastVisibileElementIndex"
:data-uid="photo.UID"
class="card darken-1 result image"
/>
<div v-else
<div v-if="index < firstVisibleElementIndex || index > lastVisibileElementIndex" :data-uid="photo.UID" class="card darken-1 result image" />
<div
v-else
:key="photo.Hash"
tile
:data-id="photo.ID"
@@ -57,35 +43,33 @@
@mousedown.stop.prevent="input.mouseDown($event, index)"
@click.stop.prevent="onClick($event, index)"
@mouseover="playLive(photo)"
@mouseleave="pauseLive(photo)">
@mouseleave="pauseLive(photo)"
>
<v-layout v-if="photo.Type === 'live' || photo.Type === 'animated'" class="live-player">
<video :id="'live-player-' + photo.ID" :key="photo.ID" width="224" height="224" preload="none"
loop muted playsinline>
<source :src="photo.videoUrl()">
<video :id="'live-player-' + photo.ID" :key="photo.ID" width="224" height="224" preload="none" loop muted playsinline>
<source :src="photo.videoUrl()" />
</video>
</v-layout>
<button v-if="photo.Type !== 'image' || photo.isStack()"
<button
v-if="photo.Type !== 'image' || photo.isStack()"
class="input-open"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onOpen($event, index, !isSharedView, photo.Type === 'live')"
@touchmove.stop.prevent
@click.stop.prevent="onOpen($event, index, !isSharedView, photo.Type === 'live')">
@click.stop.prevent="onOpen($event, index, !isSharedView, photo.Type === 'live')"
>
<i v-if="photo.Type === 'raw'" class="action-raw" :title="$gettext('RAW')"> raw_on </i>
<i v-if="photo.Type === 'live'" class="action-live" :title="$gettext('Live')"><icon-live-photo/></i>
<i v-if="photo.Type === 'live'" class="action-live" :title="$gettext('Live')">
<icon-live-photo />
</i>
<i v-if="photo.Type === 'video'" class="action-play" :title="$gettext('Video')"> play_arrow </i>
<i v-if="photo.Type === 'animated'" class="action-animated" :title="$gettext('Animated')"> gif </i>
<i v-if="photo.Type === 'vector'" class="action-vector" :title="$gettext('Vector')"> font_download </i>
<i v-if="photo.Type === 'image'" class="action-stack" :title="$gettext('Stack')"> burst_mode </i>
</button>
<button v-if="photo.Type === 'image' && selectMode"
class="input-view"
:title="$gettext('View')"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onOpen($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="onOpen($event, index)">
<button v-if="photo.Type === 'image' && selectMode" class="input-view" :title="$gettext('View')" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="onOpen($event, index)" @touchmove.stop.prevent @click.stop.prevent="onOpen($event, index)">
<i color="white" class="action-fullscreen"> zoom_in </i>
</button>
@@ -103,24 +87,12 @@
the v-hover component we instead hide the button by default and
use css to show it when it is being hovered.
-->
<button
class="input-select"
@mousedown.stop.prevent="input.mouseDown($event, index)"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onSelect($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="onSelect($event, index)">
<button class="input-select" @mousedown.stop.prevent="input.mouseDown($event, index)" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="onSelect($event, index)" @touchmove.stop.prevent @click.stop.prevent="onSelect($event, index)">
<i color="white" class="select-on"> check_circle </i>
<i color="white" class="select-off"> radio_button_off </i>
</button>
<button v-if="!isSharedView"
class="input-favorite"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="toggleLike($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="toggleLike($event, index)"
>
<button v-if="!isSharedView" class="input-favorite" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="toggleLike($event, index)" @touchmove.stop.prevent @click.stop.prevent="toggleLike($event, index)">
<i v-if="photo.Favorite"> favorite </i>
<i v-else> favorite_border </i>
</button>
@@ -132,11 +104,11 @@
</template>
<script>
import { Input, InputInvalid, ClickShort, ClickLong } from "common/input";
import {virtualizationTools} from 'common/virtualization-tools';
import { virtualizationTools } from "common/virtualization-tools";
import IconLivePhoto from "component/icon/live-photo.vue";
export default {
name: 'PPhotoMosaic',
name: "PPhotoMosaic",
components: {
IconLivePhoto,
},
@@ -188,14 +160,17 @@ export default {
});
},
immediate: true,
}
},
},
beforeCreate() {
this.intersectionObserver = new IntersectionObserver((entries) => {
this.intersectionObserver = new IntersectionObserver(
(entries) => {
this.visibilitiesChanged(entries);
}, {
},
{
rootMargin: "50% 0px",
});
}
);
},
beforeDestroy() {
this.intersectionObserver.disconnect();
@@ -218,14 +193,10 @@ export default {
}
},
elementIndexFromIntersectionObserverEntry(entry) {
return parseInt(entry.target.getAttribute('data-index'));
return parseInt(entry.target.getAttribute("data-index"));
},
visibilitiesChanged(entries) {
const [smallestIndex, largestIndex] = virtualizationTools.updateVisibleElementIndices(
this.visibleElementIndices,
entries,
this.elementIndexFromIntersectionObserverEntry,
);
const [smallestIndex, largestIndex] = virtualizationTools.updateVisibleElementIndices(this.visibleElementIndices, entries, this.elementIndexFromIntersectionObserverEntry);
// we observe only every 5th item, so we increase the rendered
// range here by 4 items in every directio just to be safe
@@ -237,15 +208,17 @@ export default {
},
playLive(photo) {
const player = this.livePlayer(photo);
try { if (player) player.play(); }
catch (e) {
try {
if (player) player.play();
} catch (e) {
// Ignore.
}
},
pauseLive(photo) {
const player = this.livePlayer(photo);
try { if (player) player.pause(); }
catch (e) {
try {
if (player) player.pause();
} catch (e) {
// Ignore.
}
},
@@ -318,7 +291,7 @@ export default {
selectRange(index) {
this.$clipboard.addRange(index, this.photos);
this.$forceUpdate();
}
},
},
};
</script>

View File

@@ -1,7 +1,7 @@
<template>
<div class="p-photo-preview pa-0 ma-0 elevation-0 v-card v-sheet v-sheet--tile no-transition" :title="title">
<div class="v-responsive v-image card darken-1 elevation-0 clickable" @click.prevent.stop="openPhoto">
<div class="v-responsive__sizer" style="padding-bottom: 100%;"></div>
<div class="v-responsive__sizer" style="padding-bottom: 100%"></div>
<div class="v-image__image v-image__image--cover" :style="cover"></div>
<div class="v-responsive__content"></div>
</div>
@@ -12,7 +12,7 @@ import Photo from "model/photo";
import Thumb from "model/thumb";
export default {
name: 'PPhotoPreview',
name: "PPhotoPreview",
props: {
model: {
type: Object,
@@ -21,8 +21,8 @@ export default {
},
data() {
return {
url: this.model.thumbnailUrl('tile_500'),
title: this.model.Title ? this.model.Title : '',
url: this.model.thumbnailUrl("tile_500"),
title: this.model.Title ? this.model.Title : "",
};
},
computed: {
@@ -32,8 +32,8 @@ export default {
},
watch: {
model() {
this.url = this.model.thumbnailUrl('tile_500');
this.title = this.model.Title ? this.model.Title : '';
this.url = this.model.thumbnailUrl("tile_500");
this.title = this.model.Title ? this.model.Title : "";
},
},
methods: {

View File

@@ -1,23 +1,33 @@
<template>
<v-form ref="form" lazy-validation
dense autocomplete="off" class="p-photo-toolbar" accept-charset="UTF-8"
:class="{'embedded': embedded}"
@submit.prevent="updateQuery()">
<v-toolbar flat :dense="$vuetify.breakpoint.smAndDown" :height="embedded ? 45 : undefined"
class="page-toolbar" color="secondary">
<v-form ref="form" lazy-validation dense autocomplete="off" class="p-photo-toolbar" accept-charset="UTF-8" :class="{ embedded: embedded }" @submit.prevent="updateQuery()">
<v-toolbar flat :dense="$vuetify.breakpoint.smAndDown" :height="embedded ? 45 : undefined" class="page-toolbar" color="secondary">
<template v-if="!embedded">
<v-text-field :value="filter.q"
<v-text-field
:value="filter.q"
class="input-search background-inherit elevation-0"
solo hide-details clearable overflow single-line validate-on-blur
solo
hide-details
clearable
overflow
single-line
validate-on-blur
autocorrect="off"
autocapitalize="none"
browser-autocomplete="off"
:label="$gettext('Search')"
prepend-inner-icon="search"
color="secondary-dark"
@change="(v) => {updateFilter({'q': v})}"
@keyup.enter.native="(e) => updateQuery({'q': e.target.value})"
@click:clear="() => {updateQuery({'q': ''})}"
@change="
(v) => {
updateFilter({ q: v });
}
"
@keyup.enter.native="(e) => updateQuery({ q: e.target.value })"
@click:clear="
() => {
updateQuery({ q: '' });
}
"
></v-text-field>
<v-btn v-if="filter.latlng" icon :title="$gettext('Show more')" class="action-clear-location" @click.stop="clearLocation()">
@@ -31,27 +41,22 @@
<v-btn v-if="settings.view === 'cards'" icon :title="$gettext('Toggle View')" @click.stop="setView('list')">
<v-icon>view_list</v-icon>
</v-btn>
<v-btn v-else-if="settings.view === 'list'" icon :title="$gettext('Toggle View')"
@click.stop="setView('mosaic')">
<v-btn v-else-if="settings.view === 'list'" icon :title="$gettext('Toggle View')" @click.stop="setView('mosaic')">
<v-icon>view_comfy</v-icon>
</v-btn>
<v-btn v-else icon :title="$gettext('Toggle View')" @click.stop="setView('cards')">
<v-icon>view_column</v-icon>
</v-btn>
<v-btn v-if="canDelete && context === 'archive' && config.count.archived > 0" icon
class="hidden-sm-and-down action-delete-all"
:title="$gettext('Delete All')" @click.stop="deleteAll()">
<v-btn v-if="canDelete && context === 'archive' && config.count.archived > 0" icon class="hidden-sm-and-down action-delete-all" :title="$gettext('Delete All')" @click.stop="deleteAll()">
<v-icon>delete_sweep</v-icon>
</v-btn>
<v-btn v-else-if="canUpload" icon class="hidden-sm-and-down action-upload"
:title="$gettext('Upload')" @click.stop="showUpload()">
<v-btn v-else-if="canUpload" icon class="hidden-sm-and-down action-upload" :title="$gettext('Upload')" @click.stop="showUpload()">
<v-icon>cloud_upload</v-icon>
</v-btn>
<v-btn icon class="p-expand-search" :title="$gettext('Expand Search')"
@click.stop="searchExpanded = !searchExpanded">
<v-icon>{{ searchExpanded ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</v-icon>
<v-btn icon class="p-expand-search" :title="$gettext('Expand Search')" @click.stop="searchExpanded = !searchExpanded">
<v-icon>{{ searchExpanded ? "keyboard_arrow_up" : "keyboard_arrow_down" }}</v-icon>
</v-btn>
</template>
<template v-else>
@@ -65,86 +70,130 @@
</template>
</v-toolbar>
<v-card v-show="searchExpanded"
class="pt-1 page-toolbar-expanded"
flat
color="secondary-light">
<v-card v-show="searchExpanded" class="pt-1 page-toolbar-expanded" flat color="secondary-light">
<v-card-text>
<v-layout row wrap>
<v-flex xs12 sm6 md3 pa-2 class="p-countries-select">
<v-select :value="filter.country"
<v-select
:value="filter.country"
:label="$gettext('Country')"
:menu-props="{'maxHeight':346}"
flat solo hide-details
:menu-props="{ maxHeight: 346 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
item-value="ID"
item-text="Name"
:items="countryOptions"
class="input-countries"
@change="(v) => {updateQuery({'country': v})}"
@change="
(v) => {
updateQuery({ country: v });
}
"
>
</v-select>
</v-flex>
<v-flex xs12 sm6 md3 pa-2 class="p-camera-select">
<v-select :value="filter.camera"
<v-select
:value="filter.camera"
:label="$gettext('Camera')"
:menu-props="{'maxHeight':346}"
flat solo hide-details
:menu-props="{ maxHeight: 346 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
item-value="ID"
item-text="Name"
:items="cameraOptions"
@change="(v) => {updateQuery({'camera': v})}">
@change="
(v) => {
updateQuery({ camera: v });
}
"
>
</v-select>
</v-flex>
<v-flex xs12 sm6 md3 pa-2 class="p-view-select">
<v-select id="viewSelect"
<v-select
id="viewSelect"
:value="settings.view"
:label="$gettext('View')"
flat solo hide-details
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
:items="options.views"
@change="(v) => {setView(v)}">
@change="
(v) => {
setView(v);
}
"
>
</v-select>
</v-flex>
<v-flex xs12 sm6 md3 pa-2 class="p-time-select">
<v-select :value="filter.order"
<v-select
:value="filter.order"
:label="$gettext('Sort Order')"
:menu-props="{'maxHeight':400}"
flat solo hide-details
:menu-props="{ maxHeight: 400 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
:items="options.sorting"
@change="(v) => {updateQuery({'order': v})}">
@change="
(v) => {
updateQuery({ order: v });
}
"
>
</v-select>
</v-flex>
<v-flex xs12 sm6 md3 pa-2 class="p-year-select">
<v-select :value="filter.year"
<v-select
:value="filter.year"
:label="$gettext('Year')"
:menu-props="{'maxHeight':346}"
flat solo hide-details
:menu-props="{ maxHeight: 346 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
item-value="value"
item-text="text"
:items="yearOptions()"
@change="(v) => {updateQuery({'year': v})}">
@change="
(v) => {
updateQuery({ year: v });
}
"
>
</v-select>
</v-flex>
<v-flex xs12 sm6 md3 pa-2 class="p-month-select">
<v-select :value="filter.month"
<v-select
:value="filter.month"
:label="$gettext('Month')"
:menu-props="{'maxHeight':346}"
flat solo hide-details
:menu-props="{ maxHeight: 346 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
item-value="value"
item-text="text"
:items="monthOptions()"
@change="(v) => {updateQuery({'month': v})}">
@change="
(v) => {
updateQuery({ month: v });
}
"
>
</v-select>
</v-flex>
<!-- v-flex xs12 sm6 md3 pa-2 class="p-lens-select">
@@ -160,39 +209,51 @@
</v-select>
</v-flex -->
<v-flex xs12 sm6 md3 pa-2 class="p-color-select">
<v-select :value="filter.color"
<v-select
:value="filter.color"
:label="$gettext('Color')"
:menu-props="{'maxHeight':346}"
flat solo hide-details
:menu-props="{ maxHeight: 346 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
item-value="Slug"
item-text="Name"
:items="colorOptions()"
@change="(v) => {updateQuery({'color': v})}">
@change="
(v) => {
updateQuery({ color: v });
}
"
>
</v-select>
</v-flex>
<v-flex xs12 sm6 md3 pa-2 class="p-category-select">
<v-select :value="filter.label"
<v-select
:value="filter.label"
:label="$gettext('Category')"
:menu-props="{'maxHeight':346}"
flat solo hide-details
:menu-props="{ maxHeight: 346 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
item-value="Slug"
item-text="Name"
:items="categoryOptions"
@change="(v) => {updateQuery({'label': v})}">
@change="
(v) => {
updateQuery({ label: v });
}
"
>
</v-select>
</v-flex>
</v-layout>
</v-card-text>
</v-card>
<p-photo-delete-dialog
:show="dialog.delete"
:text="$gettext('Are you sure you want to delete all archived pictures?')"
:action="$gettext('Delete All')"
@cancel="dialog.delete = false" @confirm="batchDelete">
<p-photo-delete-dialog :show="dialog.delete" :text="$gettext('Are you sure you want to delete all archived pictures?')" :action="$gettext('Delete All')" @cancel="dialog.delete = false" @confirm="batchDelete">
</p-photo-delete-dialog>
</v-form>
</template>
@@ -203,41 +264,35 @@ import Api from "common/api";
import Notify from "common/notify";
export default {
name: 'PPhotoToolbar',
name: "PPhotoToolbar",
props: {
context: {
type: String,
default: 'photos',
default: "photos",
},
filter: {
type: Object,
default: () => {
},
default: () => {},
},
staticFilter: {
type: Object,
default: () => {
},
default: () => {},
},
updateFilter: {
type: Function,
default: () => {
},
default: () => {},
},
updateQuery: {
type: Function,
default: () => {
},
default: () => {},
},
settings: {
type: Object,
default: () => {
},
default: () => {},
},
refresh: {
type: Function,
default: () => {
},
default: () => {},
},
onClose: {
type: Function,
@@ -245,7 +300,7 @@ export default {
},
embedded: {
type: Boolean,
default: false
default: false,
},
},
data() {
@@ -270,21 +325,21 @@ export default {
years: [{ value: 0, text: this.$gettext("All Years") }],
},
options: {
'views': [
{value: 'mosaic', text: this.$gettext('Mosaic')},
{value: 'cards', text: this.$gettext('Cards')},
{value: 'list', text: this.$gettext('List')},
views: [
{ value: "mosaic", text: this.$gettext("Mosaic") },
{ value: "cards", text: this.$gettext("Cards") },
{ value: "list", text: this.$gettext("List") },
],
'sorting': [
{value: 'newest', text: this.$gettext('Newest First')},
{value: 'oldest', text: this.$gettext('Oldest First')},
{value: 'added', text: this.$gettext('Recently Added')},
{value: 'edited', text: this.$gettext('Recently Edited')},
{value: 'name', text: this.$gettext('File Name')},
{value: 'size', text: this.$gettext('File Size')},
{value: 'duration', text: this.$gettext('Video Duration')},
{value: 'relevance', text: this.$gettext('Most Relevant')},
{value: 'similar', text: this.$gettext('Visual Similarity')},
sorting: [
{ value: "newest", text: this.$gettext("Newest First") },
{ value: "oldest", text: this.$gettext("Oldest First") },
{ value: "added", text: this.$gettext("Recently Added") },
{ value: "edited", text: this.$gettext("Recently Edited") },
{ value: "name", text: this.$gettext("File Name") },
{ value: "size", text: this.$gettext("File Size") },
{ value: "duration", text: this.$gettext("Video Duration") },
{ value: "relevance", text: this.$gettext("Most Relevant") },
{ value: "similar", text: this.$gettext("Visual Similarity") },
],
},
dialog: {
@@ -318,7 +373,7 @@ export default {
},
setView(name) {
if (name) {
this.refresh({'view': name});
this.refresh({ view: name });
}
},
showUpload() {
@@ -335,10 +390,10 @@ export default {
this.$router.push({ name: "browse" });
},
onBrowse() {
const route = {name: 'places_browse', query: this.staticFilter};
const route = { name: "places_browse", query: this.staticFilter };
const routeUrl = this.$router.resolve(route).href;
if (routeUrl) {
window.open(routeUrl, '_blank');
window.open(routeUrl, "_blank");
}
},
batchDelete() {
@@ -348,7 +403,7 @@ export default {
this.dialog.delete = false;
Api.post("batch/photos/delete", {"all": true}).then(() => this.onDeleted());
Api.post("batch/photos/delete", { all: true }).then(() => this.onDeleted());
},
onDeleted() {
Notify.success(this.$gettext("Permanently deleted"));

View File

@@ -66,12 +66,7 @@ export default class MapStyleControl {
}
onRemove() {
if (
!this.controlContainer ||
!this.controlContainer.parentNode ||
!this.map ||
!this.styleButton
) {
if (!this.controlContainer || !this.controlContainer.parentNode || !this.map || !this.styleButton) {
return;
}
this.styleButton.removeEventListener("click", this.onDocumentClick);
@@ -81,12 +76,7 @@ export default class MapStyleControl {
}
onDocumentClick(event) {
if (
this.controlContainer &&
!this.controlContainer.contains(event.target) &&
this.mapStyleContainer &&
this.styleButton
) {
if (this.controlContainer && !this.controlContainer.contains(event.target) && this.mapStyleContainer && this.styleButton) {
this.mapStyleContainer.style.display = "none";
this.styleButton.style.display = "block";
}

View File

@@ -1,14 +1,6 @@
<template>
<transition name="fade-transition">
<v-btn
v-if="show"
color="transparent"
dark
fab
fixed
class="p-scroll-top"
@click.stop="scrollToTop"
>
<v-btn v-if="show" color="transparent" dark fab fixed class="p-scroll-top" @click.stop="scrollToTop">
<v-icon>arrow_upward</v-icon>
</v-btn>
</transition>

View File

@@ -1,63 +1,28 @@
<template>
<div>
<v-container v-if="selection.length > 0" fluid class="pa-0">
<v-speed-dial
id="t-clipboard" v-model="expanded"
fixed
bottom
direction="top"
transition="slide-y-reverse-transition"
:right="!rtl"
:left="rtl"
:class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-subject-clipboard`"
>
<v-speed-dial id="t-clipboard" v-model="expanded" fixed bottom direction="top" transition="slide-y-reverse-transition" :right="!rtl" :left="rtl" :class="`p-clipboard ${!rtl ? '--ltr' : '--rtl'} p-subject-clipboard`">
<template #activator>
<v-btn
fab
dark
color="accent darken-2"
class="action-menu"
>
<v-btn fab dark color="accent darken-2" class="action-menu">
<v-icon v-if="selection.length === 0">menu</v-icon>
<span v-else class="count-clipboard">{{ selection.length }}</span>
</v-btn>
</template>
<v-btn
fab dark small
:title="$gettext('Download')"
color="download"
class="action-download"
:disabled="!canDownload || selection.length !== 1"
@click.stop="download()"
>
<v-btn fab dark small :title="$gettext('Download')" color="download" class="action-download" :disabled="!canDownload || selection.length !== 1" @click.stop="download()">
<v-icon>get_app</v-icon>
</v-btn>
<v-btn
v-if="canAddAlbums"
fab dark small
:title="$gettext('Add to album')"
color="album"
:disabled="selection.length === 0"
class="action-album"
@click.stop="dialog.album = true"
>
<v-btn v-if="canAddAlbums" fab dark small :title="$gettext('Add to album')" color="album" :disabled="selection.length === 0" class="action-album" @click.stop="dialog.album = true">
<v-icon>bookmark</v-icon>
</v-btn>
<v-btn
fab dark small
color="accent"
class="action-clear"
@click.stop="clearClipboard()"
>
<v-btn fab dark small color="accent" class="action-clear" @click.stop="clearClipboard()">
<v-icon>clear</v-icon>
</v-btn>
</v-speed-dial>
</v-container>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false"
@confirm="addToAlbum"></p-photo-album-dialog>
<p-photo-album-dialog :show="dialog.album" @cancel="dialog.album = false" @confirm="addToAlbum"></p-photo-album-dialog>
</div>
</template>
<script>
@@ -66,7 +31,7 @@ import Notify from "common/notify";
import download from "common/download";
export default {
name: 'PSubjectClipboard',
name: "PSubjectClipboard",
props: {
selection: {
type: Array,
@@ -104,7 +69,7 @@ export default {
addToAlbum(ppid) {
this.dialog.album = false;
Api.post(`albums/${ppid}/photos`, {"subjects": this.selection}).then(() => this.onAdded());
Api.post(`albums/${ppid}/photos`, { subjects: this.selection }).then(() => this.onAdded());
},
onAdded() {
this.clearClipboard();
@@ -117,7 +82,7 @@ export default {
Notify.success(this.$gettext("Downloading…"));
Api.post("zip", {"subjects": this.selection}).then(r => {
Api.post("zip", { subjects: this.selection }).then((r) => {
this.onDownload(`${this.$config.apiUri}/zip/${r.data.filename}?t=${this.$config.downloadToken}`);
});
@@ -126,6 +91,6 @@ export default {
onDownload(path) {
download(path, "photos.zip");
},
}
},
};
</script>

View File

@@ -1,21 +1,6 @@
<template>
<div class="video-wrapper" :style="style">
<video
:key="source"
ref="video"
class="video-player"
:height="height"
:width="width"
:autoplay="autoplay"
:style="style"
:poster="poster"
:loop="loop"
preload="auto"
controls
playsinline
@click.stop
@keydown.esc.stop.prevent="$emit('close')"
>
<video :key="source" ref="video" class="video-player" :height="height" :width="width" :autoplay="autoplay" :style="style" :poster="poster" :loop="loop" preload="auto" controls playsinline @click.stop @keydown.esc.stop.prevent="$emit('close')">
<source :src="source" />
</video>
</div>

View File

@@ -85,6 +85,10 @@
min-width: 90%;
}
.width-100 {
width: 100%;
}
/* Rounded Elements */
.v-progress-linear,

View File

@@ -0,0 +1,120 @@
<template>
<v-dialog :value="show" lazy persistent max-width="500" class="modal-dialog p-account-apps-dialog" @keydown.esc="close">
<v-form ref="form" lazy-validation dense class="form-password" accept-charset="UTF-8" @submit.prevent>
<v-card raised elevation="24">
<v-card-title primary-title class="pa-2">
<v-layout row wrap class="pa-2">
<v-flex xs9 class="text-xs-left">
<h3 class="headline pa-0">
<translate>Apps and Devices</translate>
</h3>
</v-flex>
<v-flex xs3 class="text-xs-right">
<v-icon size="28" color="primary">smartphone</v-icon>
</v-flex>
</v-layout>
</v-card-title>
<!-- Setup -->
<v-card-text class="py-0 px-2">
<v-layout wrap align-top>
</v-layout>
</v-card-text>
<v-card-actions class="pa-2">
<v-layout row wrap class="pa-2">
<v-flex xs12 text-xs-right>
<v-btn depressed color="secondary-light" class="action-close mr-0" @click.stop="close">
<translate>Close</translate>
</v-btn>
</v-flex>
</v-layout>
</v-card-actions>
</v-card>
</v-form>
</v-dialog>
</template>
<script>
import User from "model/user";
import Util from "../../common/util";
export default {
name: "PAccountAppsDialog",
props: {
show: Boolean,
model: {
type: Object,
default: () => new User(null),
},
},
data() {
return {
busy: false,
isDemo: this.$config.get("demo"),
isPublic: this.$config.get("public"),
password: "",
showPassword: false,
minLength: this.$config.get("passwordLength"),
maxLength: 72,
rtl: this.$rtl,
passwords: [],
user: this.$session.getUser(),
};
},
computed: {
page() {
return "setup";
},
},
watch: {
show: function (show) {
if (show) {
this.reset();
}
},
},
created() {
if (this.isPublic && !this.isDemo) {
this.$emit("close");
}
},
methods: {
async copyText(text) {
if (!text) {
return;
}
try {
await Util.copyToMachineClipboard(text);
this.$notify.success(this.$gettext("Copied to clipboard"));
} catch (error) {
this.$notify.error(this.$gettext("Failed copying to clipboard"));
}
},
reset() {
this.password = "";
this.showPassword = false;
this.updateUser();
},
updateUser() {
this.$notify.blockUI();
this.$session
.refresh()
.then(() => {
this.user = this.$session.getUser();
})
.finally(() => {
this.$notify.unblockUI();
});
},
confirm() {
this.close();
},
close() {
if (this.busy) {
return;
}
this.$emit("close");
},
},
};
</script>

View File

@@ -0,0 +1,407 @@
<template>
<v-dialog :value="show" lazy persistent max-width="500" class="modal-dialog p-account-passcode-dialog" @keydown.esc="close">
<v-form ref="form" lazy-validation dense accept-charset="UTF-8" class="form-password" @submit.prevent>
<v-card raised elevation="24">
<v-card-title primary-title class="pa-2">
<v-layout row wrap class="pa-2">
<v-flex xs10 class="text-xs-left">
<h3 class="headline pa-0">
<translate>2-Factor Authentication</translate>
</h3>
</v-flex>
<v-flex xs2 class="text-xs-right">
<v-icon size="28" color="primary">vpn_key</v-icon>
</v-flex>
</v-layout>
</v-card-title>
<!-- Setup -->
<template v-if="page === 'setup'">
<v-card-text class="py-0 px-2">
<v-layout wrap align-top>
<v-flex xs12 class="pa-2 body-2">
<translate>After entering your password for confirmation, you can set up two-factor authentication with a compatible authenticator app or device:</translate>
</v-flex>
<v-flex xs12 class="pa-2">
<v-text-field
id="auth-password"
v-model="password"
hide-details
required
autofocus
solo
flat
:type="showPassword ? 'text' : 'password'"
:disabled="busy"
name="password"
autocorrect="off"
autocapitalize="none"
:label="$gettext('Password')"
class="input-password text-selectable"
:append-icon="showPassword ? 'visibility' : 'visibility_off'"
prepend-inner-icon="lock"
color="secondary-dark"
@click:append="showPassword = !showPassword"
@keyup.enter.native="onSetup"
></v-text-field>
</v-flex>
</v-layout>
<v-flex xs12 class="pa-2 body-1">
<translate>Enabling two-factor authentication means that you will need a randomly generated passcode to log in, so even if someone gains access to your password, they will not be able to access your account.</translate>
</v-flex>
</v-card-text>
<v-card-actions class="pa-2">
<v-layout row wrap class="pa-2">
<v-flex xs12 text-xs-right>
<v-btn depressed color="secondary-light" class="action-cancel ml-0" @click.stop="close">
<translate>Cancel</translate>
</v-btn>
<v-btn depressed color="primary-button" class="action-confirm white--text compact mr-0" :disabled="setupDisabled()" @click.stop="onSetup">
<translate>Setup</translate>
</v-btn>
</v-flex>
</v-layout>
</v-card-actions>
</template>
<!-- Confirm -->
<template v-else-if="page === 'confirm'">
<v-card-text class="py-0 px-2">
<v-layout wrap align-top>
<v-flex xs12 class="pa-2 body-1">
<translate>Scan the QR code with your authenticator app or use the setup key shown below and then enter the generated passcode for verification:</translate>
</v-flex>
<v-flex xs12 class="pa-2">
<img :src="key.QRCode" class="width-100" alt="QR Code" />
</v-flex>
</v-layout>
<v-flex xs12 class="pa-2 subheading text-xs-center">
<pre class="clickable" @click.stop.prevent="copyText(key.Secret)">{{ key.Secret }}</pre>
</v-flex>
<v-flex xs12 class="pa-2">
<v-text-field
v-model="passcode"
hide-details
required
solo
flat
type="text"
mask="### ###"
:disabled="busy"
browser-autocomplete="off"
autocorrect="off"
autocapitalize="none"
:label="$gettext('Verification Code')"
class="input-passcode"
color="secondary-dark"
prepend-inner-icon="verified_user"
@keyup.enter.native="onConfirm"
></v-text-field>
</v-flex>
</v-card-text>
<v-card-actions class="pa-2">
<v-layout row wrap class="pa-2">
<v-flex xs12 text-xs-right>
<v-btn depressed color="secondary-light" class="action-cancel ml-0" @click.stop="close">
<translate>Cancel</translate>
</v-btn>
<v-btn depressed color="primary-button" class="action-confirm white--text compact mr-0" :disabled="passcode.length !== 6" @click.stop="onConfirm">
<translate>Confirm</translate>
</v-btn>
</v-flex>
</v-layout>
</v-card-actions>
</template>
<!-- Activate -->
<template v-else-if="page === 'activate'">
<v-card-text class="py-0 px-2">
<v-layout wrap align-top>
<v-flex xs12 class="pa-2 body-2">
<translate>Use the following recovery code to access your account when you are unable to generate a valid passcode with your authenticator app or device:</translate>
</v-flex>
<v-flex xs12 class="pa-2">
<v-text-field
v-model="key.RecoveryCode"
hide-details
readonly
solo
flat
type="text"
mask="nnn nnn nnn nnn"
browser-autocomplete="off"
autocorrect="off"
autocapitalize="none"
append-icon="content_copy"
class="input-recovery-code clickable"
color="secondary-dark"
@click:append="onCopyRecoveryCode"
></v-text-field>
</v-flex>
<v-flex xs12 class="pa-2 body-1">
<translate>To avoid being locked out of your account, please download, print or copy this recovery code now and keep it in a safe place.</translate>
<translate>It is a one-time use code that will disable 2FA for your account when you use it.</translate>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions class="pa-2">
<v-layout row wrap class="pa-2">
<v-flex xs12 text-xs-right>
<v-btn depressed color="secondary-light" class="action-cancel ml-0" @click.stop="close">
<translate>Cancel</translate>
</v-btn>
<v-btn v-if="recoveryCodeCopied" depressed color="primary-button" class="action-confirm white--text compact mr-0" @click.stop="onActivate">
<translate>Activate</translate>
</v-btn>
<v-btn v-else depressed color="primary-button" class="action-confirm white--text compact mr-0" @click.stop="onCopyRecoveryCode">
<translate>Copy</translate>
</v-btn>
</v-flex>
</v-layout>
</v-card-actions>
</template>
<!-- Deactivate -->
<template v-else-if="page === 'deactivate'">
<v-card-text class="py-0 px-2">
<v-layout wrap align-top>
<v-flex xs12 class="pa-2 body-2">
<translate>Two-factor authentication has been enabled for your account.</translate>
</v-flex>
<v-flex xs12 class="pa-2 body-1">
<translate>If you lose access to your authenticator app or device, you can use your recovery code to regain access to your account.</translate>
<translate>It is a one-time use code that will disable 2FA for your account when you use it.</translate>
</v-flex>
<v-flex xs12 class="pa-2 body-1">
<translate>To switch to a new authenticator app or device, first deactivate two-factor authentication and then reactivate it:</translate>
</v-flex>
<v-flex xs12 class="pa-2">
<v-text-field
id="auth-password"
v-model="password"
hide-details
required
solo
flat
:type="showPassword ? 'text' : 'password'"
:disabled="busy"
name="password"
autocorrect="off"
autocapitalize="none"
:label="$gettext('Password')"
class="input-password text-selectable"
:append-icon="showPassword ? 'visibility' : 'visibility_off'"
prepend-inner-icon="lock"
color="secondary-dark"
@click:append="showPassword = !showPassword"
@keyup.enter.native="onDeactivate"
></v-text-field>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions class="pa-2">
<v-layout row wrap class="pa-2">
<v-flex xs12 text-xs-right>
<v-btn depressed color="primary-button" class="action-confirm white--text compact ml-0" :disabled="setupDisabled()" @click.stop="onDeactivate">
<translate>Deactivate</translate>
</v-btn>
<v-btn depressed color="secondary-light" class="action-close mr-0" @click.stop="close">
<translate>Close</translate>
</v-btn>
</v-flex>
</v-layout>
</v-card-actions>
</template>
<!-- Not Available -->
<template v-else-if="page === 'not_available'">
<v-card-text class="py-0 px-2">
<v-layout wrap align-top>
<v-flex xs12 class="pa-2 body-2">
<translate>Only locally managed accounts can be set up for authentication with 2FA.</translate>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions class="pa-2">
<v-layout row wrap class="pa-2">
<v-flex xs12 text-xs-right>
<v-btn depressed color="secondary-light" class="action-close mr-0" @click.stop="close">
<translate>Close</translate>
</v-btn>
</v-flex>
</v-layout>
</v-card-actions>
</template>
</v-card>
</v-form>
</v-dialog>
</template>
<script>
import User from "model/user";
import Util from "common/util";
export default {
name: "PAccountPasscodeDialog",
props: {
show: Boolean,
model: {
type: Object,
default: () => new User(null),
},
},
data() {
return {
busy: false,
isDemo: this.$config.get("demo"),
isPublic: this.$config.get("public"),
passcode: "",
password: "",
recoveryCodeCopied: false,
showPassword: false,
minLength: this.$config.get("passwordLength"),
maxLength: 72,
rtl: this.$rtl,
key: {},
user: this.$session.getUser(),
};
},
computed: {
page() {
if (this.user?.AuthProvider !== "default" && this.user?.AuthProvider !== "local" && this.user?.AuthProvider !== "ldap") {
return "not_available";
} else if (this.user?.AuthMethod === "2fa") {
return "deactivate";
} else if (this.key?.Type === "totp") {
if (!this.key?.VerifiedAt) {
return "confirm";
} else if (!this.key?.ActivatedAt) {
return "activate";
} else {
return "deactivate";
}
}
return "setup";
},
},
watch: {
show: function (show) {
if (show) {
this.reset();
}
},
},
created() {
if (this.isPublic && !this.isDemo) {
this.$emit("close");
}
},
methods: {
async copyText(text) {
if (!text) {
return;
}
try {
await Util.copyToMachineClipboard(text);
this.$notify.success(this.$gettext("Copied to clipboard"));
} catch (error) {
this.$notify.error(this.$gettext("Failed copying to clipboard"));
}
},
reset() {
this.passcode = "";
this.password = "";
this.showPassword = false;
this.recoveryCodeCopied = false;
this.updateUser();
},
updateUser() {
this.$notify.blockUI();
this.$session
.refresh()
.then(() => {
this.user = this.$session.getUser();
})
.finally(() => {
this.$notify.unblockUI();
});
},
setupDisabled() {
return this.isDemo || this.busy || this.password.length < this.minLength;
},
onSetup() {
if (this.busy || this.password === "") {
return;
}
this.busy = true;
this.model
.createPasscode(this.password)
.then((resp) => {
this.key = resp;
})
.finally(() => {
this.busy = false;
});
},
onConfirm() {
if (this.busy || this.passcode === "") {
return;
}
this.busy = true;
this.model
.confirmPasscode(this.passcode)
.then((resp) => {
this.key = resp;
this.$notify.success(this.$gettext("Successfully verified"));
})
.finally(() => {
this.busy = false;
this.passcode = "";
this.password = "";
this.showPassword = false;
this.recoveryCodeCopied = false;
});
},
onCopyRecoveryCode() {
this.copyText(this.key.RecoveryCode);
this.recoveryCodeCopied = true;
},
onActivate() {
if (this.busy) {
return;
}
this.busy = true;
this.model
.activatePasscode()
.then((resp) => {
this.key = resp;
this.$notify.success(this.$gettext("Successfully activated"));
})
.finally(() => {
this.busy = false;
this.reset();
});
},
onDeactivate() {
if (this.busy || this.password === "") {
return;
}
this.busy = true;
this.model
.deactivatePasscode(this.password)
.then(() => {
this.$notify.success(this.$gettext("Settings saved"));
this.reset();
this.key = {};
})
.finally(() => {
this.busy = false;
});
},
close() {
if (this.busy) {
return;
}
this.$emit("close");
},
},
};
</script>

View File

@@ -1,13 +1,6 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="500"
class="modal-dialog p-account-password-dialog"
@keydown.esc="cancel"
>
<v-form ref="form" dense class="form-password" accept-charset="UTF-8">
<v-dialog :value="show" lazy persistent max-width="500" class="modal-dialog p-account-password-dialog" @keydown.esc="close">
<v-form ref="form" dense class="form-password" accept-charset="UTF-8" @submit.prevent>
<v-card raised elevation="24">
<v-card-title primary-title class="pa-2">
<v-layout row wrap class="pa-2">
@@ -86,7 +79,7 @@
class="input-retype-password"
color="secondary-dark"
:hint="$gettext('Please confirm your new password.')"
@keyup.enter.native="confirm"
@keyup.enter.native="onConfirm"
></v-text-field>
</v-flex>
</v-layout>
@@ -94,21 +87,10 @@
<v-card-actions class="pt-1 pb-2 px-2">
<v-layout row wrap class="pa-2">
<v-flex xs12 text-xs-right>
<v-btn
depressed
color="secondary-light"
class="action-cancel ml-0"
@click.stop="cancel"
>
<v-btn depressed color="secondary-light" class="action-cancel ml-0" @click.stop="close">
<translate>Cancel</translate>
</v-btn>
<v-btn
depressed
color="primary-button"
class="action-confirm white--text compact mr-0"
:disabled="disabled()"
@click.stop="confirm"
>
<v-btn depressed color="primary-button" class="action-confirm white--text compact mr-0" :disabled="isDisabled()" @click.stop="onConfirm">
<translate>Save</translate>
</v-btn>
</v-flex>
@@ -119,7 +101,7 @@
</v-dialog>
</template>
<script>
import User from "../../model/user";
import User from "model/user";
export default {
name: "PAccountPasswordDialog",
@@ -156,38 +138,31 @@ export default {
},
created() {
if (this.isPublic && !this.isDemo) {
this.$emit("cancel");
this.$emit("close");
}
},
methods: {
disabled() {
return (
this.isDemo ||
this.busy ||
(this.oldPassword === "" && this.oldRequired) ||
this.newPassword.length < this.minLength ||
this.newPassword.length > this.maxLength ||
this.newPassword !== this.confirmPassword
);
isDisabled() {
return this.isDemo || this.busy || (this.oldPassword === "" && this.oldRequired) || this.newPassword.length < this.minLength || this.newPassword.length > this.maxLength || this.newPassword !== this.confirmPassword;
},
confirm() {
onConfirm() {
this.busy = true;
this.model
.changePassword(this.oldPassword, this.newPassword)
.then(() => {
this.$notify.success(this.$gettext("Password changed"));
this.$emit("confirm");
this.$emit("close");
})
.finally(() => {
this.busy = false;
});
},
cancel() {
close() {
if (this.busy) {
return;
}
this.$emit("cancel");
this.$emit("close");
},
},
};

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="350"
class="p-album-delete-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="350" class="p-album-delete-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-container fluid class="pb-2 pr-2 pl-2">
<v-layout row wrap>
@@ -15,22 +8,14 @@
</v-flex>
<v-flex xs9 text-xs-left align-self-center>
<div class="subheading pr-1">
<translate key="Are you sure you want to delete these albums?"
>Are you sure you want to delete these albums?</translate
>
<translate key="Are you sure you want to delete these albums?">Are you sure you want to delete these albums?</translate>
</div>
</v-flex>
<v-flex xs12 text-xs-right class="pt-3">
<v-btn depressed color="secondary-light" class="action-cancel" @click.stop="cancel">
<translate key="Cancel">Cancel</translate>
</v-btn>
<v-btn
color="primary-button"
depressed
dark
class="action-confirm"
@click.stop="confirm"
>
<v-btn color="primary-button" depressed dark class="action-confirm" @click.stop="confirm">
<translate key="Delete">Delete</translate>
</v-btn>
</v-flex>

View File

@@ -1,21 +1,6 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="500"
class="dialog-album-edit"
color="application"
@keydown.esc="close"
>
<v-form
ref="form"
lazy-validation
dense
class="form-album-edit"
accept-charset="UTF-8"
@submit.prevent="confirm"
>
<v-dialog :value="show" lazy persistent max-width="500" class="dialog-album-edit" color="application" @keydown.esc="close">
<v-form ref="form" lazy-validation dense class="form-album-edit" accept-charset="UTF-8" @submit.prevent="confirm">
<v-card raised elevation="24">
<v-card-title primary-title class="pb-0">
<v-layout row wrap>
@@ -31,103 +16,25 @@
<v-container fluid class="pa-0">
<v-layout row wrap>
<v-flex v-if="album.Type !== 'month'" xs12 pa-2>
<v-text-field
v-model="model.Title"
hide-details
autofocus
box
flat
:rules="[titleRule]"
:label="$gettext('Name')"
:disabled="disabled"
color="secondary-dark"
class="input-title"
@keyup.enter.native="confirm"
></v-text-field>
<v-text-field v-model="model.Title" hide-details autofocus box flat :rules="[titleRule]" :label="$gettext('Name')" :disabled="disabled" color="secondary-dark" class="input-title" @keyup.enter.native="confirm"></v-text-field>
</v-flex>
<v-flex xs12 pa-2>
<v-text-field
v-model="model.Location"
hide-details
box
flat
:label="$gettext('Location')"
:disabled="disabled"
color="secondary-dark"
class="input-location"
></v-text-field>
<v-text-field v-model="model.Location" hide-details box flat :label="$gettext('Location')" :disabled="disabled" color="secondary-dark" class="input-location"></v-text-field>
</v-flex>
<v-flex xs12 pa-2>
<v-textarea
:key="growDesc"
v-model="model.Description"
auto-grow
hide-details
box
flat
browser-autocomplete="off"
:label="$gettext('Description')"
:rows="1"
:disabled="disabled"
class="input-description"
color="secondary-dark"
>
</v-textarea>
<v-textarea :key="growDesc" v-model="model.Description" auto-grow hide-details box flat browser-autocomplete="off" :label="$gettext('Description')" :rows="1" :disabled="disabled" class="input-description" color="secondary-dark"></v-textarea>
</v-flex>
<v-flex xs12 pa-2>
<v-combobox
v-model="model.Category"
hide-details
box
flat
:search-input.sync="model.Category"
:items="categories"
:disabled="disabled"
:label="$gettext('Category')"
:allow-overflow="false"
return-masked-value
color="secondary-dark"
class="input-category"
>
</v-combobox>
<v-combobox v-model="model.Category" hide-details box flat :search-input.sync="model.Category" :items="categories" :disabled="disabled" :label="$gettext('Category')" :allow-overflow="false" return-masked-value color="secondary-dark" class="input-category"></v-combobox>
</v-flex>
<v-flex xs12 sm6 pa-2>
<v-select
v-model="model.Order"
:label="$gettext('Sort Order')"
:menu-props="{ maxHeight: 400 }"
hide-details
box
flat
:items="sorting"
:disabled="disabled"
item-value="value"
item-text="text"
color="secondary-dark"
>
</v-select>
<v-select v-model="model.Order" :label="$gettext('Sort Order')" :menu-props="{ maxHeight: 400 }" hide-details box flat :items="sorting" :disabled="disabled" item-value="value" item-text="text" color="secondary-dark"></v-select>
</v-flex>
<v-flex sm3 pa-2>
<v-checkbox
v-model="model.Favorite"
:disabled="disabled"
color="secondary-dark"
:label="$gettext('Favorite')"
hide-details
flat
>
</v-checkbox>
<v-checkbox v-model="model.Favorite" :disabled="disabled" color="secondary-dark" :label="$gettext('Favorite')" hide-details flat> </v-checkbox>
</v-flex>
<v-flex v-if="experimental && featPrivate" sm3 pa-2>
<v-checkbox
v-model="model.Private"
:disabled="disabled"
color="secondary-dark"
:label="$gettext('Private')"
hide-details
flat
>
</v-checkbox>
<v-checkbox v-model="model.Private" :disabled="disabled" color="secondary-dark" :label="$gettext('Private')" hide-details flat> </v-checkbox>
</v-flex>
</v-layout>
</v-container>
@@ -138,14 +45,7 @@
<v-btn depressed color="secondary-light" class="action-cancel" @click.stop="close">
<translate>Cancel</translate>
</v-btn>
<v-btn
depressed
dark
color="primary-button"
class="action-confirm"
:disabled="disabled"
@click.stop="confirm"
>
<v-btn depressed dark color="primary-button" class="action-confirm" :disabled="disabled" @click.stop="confirm">
<translate>Save</translate>
</v-btn>
</v-flex>

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="350"
class="p-confirm-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="350" class="p-confirm-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-container fluid class="pb-2 pr-2 pl-2">
<v-layout row wrap>
@@ -19,21 +12,10 @@
</div>
</v-flex>
<v-flex xs12 text-xs-right class="pt-3">
<v-btn
depressed
color="secondary-light"
class="action-cancel compact"
@click.stop="cancel"
>
<v-btn depressed color="secondary-light" class="action-cancel compact" @click.stop="cancel">
<translate key="Cancel">Cancel</translate>
</v-btn>
<v-btn
color="primary-button"
depressed
dark
class="action-confirm compact"
@click.stop="confirm"
>
<v-btn color="primary-button" depressed dark class="action-confirm compact" @click.stop="confirm">
<translate key="Delete">Yes</translate>
</v-btn>
</v-flex>

View File

@@ -43,6 +43,8 @@ import PWebdavDialog from "dialog/webdav.vue";
import PReloadDialog from "dialog/reload.vue";
import PSponsorDialog from "dialog/sponsor.vue";
import PConfirmDialog from "dialog/confirm.vue";
import PAccountAppsDialog from "dialog/account/apps.vue";
import PAccountPasscodeDialog from "dialog/account/passcode.vue";
import PAccountPasswordDialog from "dialog/account/password.vue";
const dialogs = {};
@@ -68,6 +70,8 @@ dialogs.install = (Vue) => {
Vue.component("PReloadDialog", PReloadDialog);
Vue.component("PSponsorDialog", PSponsorDialog);
Vue.component("PConfirmDialog", PConfirmDialog);
Vue.component("PAccountAppsDialog", PAccountAppsDialog);
Vue.component("PAccountPasscodeDialog", PAccountPasscodeDialog);
Vue.component("PAccountPasswordDialog", PAccountPasswordDialog);
};

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="350"
class="p-file-delete-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="350" class="p-file-delete-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-container fluid class="pb-2 pr-2 pl-2">
<v-layout row wrap>
@@ -22,14 +15,7 @@
<v-btn depressed color="secondary-light" class="action-cancel" @click.stop="cancel">
<translate key="Cancel">Cancel</translate>
</v-btn>
<v-btn
color="primary-button"
depressed
dark
compact
class="action-confirm"
@click.stop="confirm"
>
<v-btn color="primary-button" depressed dark compact class="action-confirm" @click.stop="confirm">
<translate key="Delete">Delete</translate>
</v-btn>
</v-flex>

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="350"
class="p-label-delete-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="350" class="p-label-delete-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-container fluid class="pb-2 pr-2 pl-2">
<v-layout row wrap>
@@ -15,22 +8,14 @@
</v-flex>
<v-flex xs9 text-xs-left align-self-center>
<div class="subheading pr-1">
<translate key="Are you sure you want to delete these labels?"
>Are you sure you want to delete these labels?</translate
>
<translate key="Are you sure you want to delete these labels?">Are you sure you want to delete these labels?</translate>
</div>
</v-flex>
<v-flex xs12 text-xs-right class="pt-3">
<v-btn depressed color="secondary-light" class="action-cancel" @click.stop="cancel">
<translate key="Cancel">Cancel</translate>
</v-btn>
<v-btn
color="primary-button"
depressed
dark
class="action-confirm"
@click.stop="confirm"
>
<v-btn color="primary-button" depressed dark class="action-confirm" @click.stop="confirm">
<translate key="Delete">Delete</translate>
</v-btn>
</v-flex>

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="350"
class="p-people-merge-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="350" class="p-people-merge-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-container fluid class="pb-2 pr-2 pl-2">
<v-layout row wrap>
@@ -22,13 +15,7 @@
<v-btn depressed color="secondary-light" class="action-cancel" @click.stop="cancel">
<translate key="No">No</translate>
</v-btn>
<v-btn
color="primary-button"
depressed
dark
class="action-confirm"
@click.stop="confirm"
>
<v-btn color="primary-button" depressed dark class="action-confirm" @click.stop="confirm">
<translate key="Yes">Yes</translate>
</v-btn>
</v-flex>

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="356"
class="p-photo-album-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="356" class="p-photo-album-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-card-text class="pt-3 px-3">
<v-layout row wrap>
@@ -40,20 +33,10 @@
<v-card-actions class="pt-0 pb-3 px-3">
<v-layout row wrap class="pa-0">
<v-flex xs12 text-xs-right>
<v-btn
depressed
color="secondary-light"
class="action-cancel mx-1"
@click.stop="cancel"
>
<v-btn depressed color="secondary-light" class="action-cancel mx-1" @click.stop="cancel">
<translate>Cancel</translate>
</v-btn>
<v-btn
depressed
color="primary-button"
class="action-confirm white--text compact mx-0"
@click.stop="confirm"
>
<v-btn depressed color="primary-button" class="action-confirm white--text compact mx-0" @click.stop="confirm">
<span v-if="!album">{{ labels.createAlbum }}</span>
<span v-else>{{ labels.addToAlbum }}</span>
</v-btn>

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="350"
class="p-photo-archive-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="350" class="p-photo-archive-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-container fluid class="pb-2 pr-2 pl-2">
<v-layout row wrap>
@@ -22,13 +15,7 @@
<v-btn depressed color="secondary-light" class="action-cancel" @click.stop="cancel">
<translate>No</translate>
</v-btn>
<v-btn
color="primary-button"
depressed
dark
class="action-confirm"
@click.stop="confirm"
>
<v-btn color="primary-button" depressed dark class="action-confirm" @click.stop="confirm">
<translate>Yes</translate>
</v-btn>
</v-flex>

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="360"
class="p-photo-delete-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="360" class="p-photo-delete-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-container fluid class="pb-2 pr-2 pl-2">
<v-layout row wrap>
@@ -25,24 +18,10 @@
<v-btn depressed color="secondary-light" class="action-cancel" @click.stop="cancel">
<translate key="Cancel">Cancel</translate>
</v-btn>
<v-btn
v-if="action === ''"
color="primary-button"
depressed
dark
class="action-confirm"
@click.stop="confirm"
>
<v-btn v-if="action === ''" color="primary-button" depressed dark class="action-confirm" @click.stop="confirm">
<translate key="Delete">Delete</translate>
</v-btn>
<v-btn
v-else
color="primary-button"
depressed
dark
class="action-confirm"
@click.stop="confirm"
>
<v-btn v-else color="primary-button" depressed dark class="action-confirm" @click.stop="confirm">
{{ action }}
</v-btn>
</v-flex>

View File

@@ -1,14 +1,5 @@
<template>
<v-dialog
:value="show"
fullscreen
hide-overlay
scrollable
lazy
persistent
class="p-photo-edit-dialog"
@keydown.esc="close"
>
<v-dialog :value="show" fullscreen hide-overlay scrollable lazy persistent class="p-photo-edit-dialog" @keydown.esc="close">
<v-card color="application">
<v-toolbar dark flat color="navigation" :dense="$vuetify.breakpoint.smAndDown">
<v-btn icon dark class="action-close" @click.stop="close">
@@ -25,26 +16,13 @@
<v-icon v-else>navigate_next</v-icon>
</v-btn>
<v-btn
icon
:disabled="selected >= selection.length - 1"
class="action-next"
@click.stop="next"
>
<v-btn icon :disabled="selected >= selection.length - 1" class="action-next" @click.stop="next">
<v-icon v-if="!rtl">navigate_next</v-icon>
<v-icon v-else>navigate_before</v-icon>
</v-btn>
</v-toolbar-items>
</v-toolbar>
<v-tabs
v-model="active"
flat
grow
class="form"
color="secondary"
slider-color="secondary-dark"
:height="$vuetify.breakpoint.smAndDown ? 48 : 64"
>
<v-tabs v-model="active" flat grow class="form" color="secondary" slider-color="secondary-dark" :height="$vuetify.breakpoint.smAndDown ? 48 : 64">
<v-tab id="tab-details" ripple>
<v-icon v-if="$vuetify.breakpoint.smAndDown" :title="$gettext('Details')">edit</v-icon>
<template v-else>
@@ -67,9 +45,7 @@
</v-tab>
<v-tab id="tab-people" :disabled="!$config.feature('people')" ripple>
<v-icon v-if="$vuetify.breakpoint.smAndDown" :title="$gettext('People')"
>people_alt</v-icon
>
<v-icon v-if="$vuetify.breakpoint.smAndDown" :title="$gettext('People')">people_alt</v-icon>
<template v-else>
<v-icon :size="18" :left="!rtl" :right="rtl">people_alt</v-icon>
<v-badge color="secondary-dark" :left="rtl" :right="!rtl">
@@ -82,9 +58,7 @@
</v-tab>
<v-tab id="tab-files" ripple>
<v-icon v-if="$vuetify.breakpoint.smAndDown" :title="$gettext('Files')"
>camera_roll</v-icon
>
<v-icon v-if="$vuetify.breakpoint.smAndDown" :title="$gettext('Files')">camera_roll</v-icon>
<template v-else>
<v-icon :size="18" :left="!rtl" :right="rtl">camera_roll</v-icon>
<v-badge color="secondary-dark" :left="rtl" :right="!rtl">
@@ -102,51 +76,23 @@
<v-tabs-items touchless>
<v-tab-item lazy>
<p-tab-photo-details
:key="uid"
ref="details"
:model="model"
:uid="uid"
@close="close"
@prev="prev"
@next="next"
></p-tab-photo-details>
<p-tab-photo-details :key="uid" ref="details" :model="model" :uid="uid" @close="close" @prev="prev" @next="next"></p-tab-photo-details>
</v-tab-item>
<v-tab-item lazy>
<p-tab-photo-labels
:key="uid"
:model="model"
:uid="uid"
@close="close"
></p-tab-photo-labels>
<p-tab-photo-labels :key="uid" :model="model" :uid="uid" @close="close"></p-tab-photo-labels>
</v-tab-item>
<v-tab-item lazy>
<p-tab-photo-people
:key="uid"
:model="model"
:uid="uid"
@close="close"
></p-tab-photo-people>
<p-tab-photo-people :key="uid" :model="model" :uid="uid" @close="close"></p-tab-photo-people>
</v-tab-item>
<v-tab-item lazy>
<p-tab-photo-files
:key="uid"
:model="model"
:uid="uid"
@close="close"
></p-tab-photo-files>
<p-tab-photo-files :key="uid" :model="model" :uid="uid" @close="close"></p-tab-photo-files>
</v-tab-item>
<v-tab-item v-if="$config.feature('edit')" lazy>
<p-tab-photo-info
:key="uid"
:model="model"
:uid="uid"
@close="close"
></p-tab-photo-info>
<p-tab-photo-info :key="uid" :model="model" :uid="uid" @close="close"></p-tab-photo-info>
</v-tab-item>
</v-tabs-items>
</v-tabs>
@@ -225,9 +171,7 @@ export default {
},
},
created() {
this.subscriptions.push(
Event.subscribe("photos.updated", (ev, data) => this.onUpdate(ev, data))
);
this.subscriptions.push(Event.subscribe("photos.updated", (ev, data) => this.onUpdate(ev, data)));
},
destroyed() {
for (let i = 0; i < this.subscriptions.length; i++) {
@@ -236,14 +180,7 @@ export default {
},
methods: {
onUpdate(ev, data) {
if (
!data ||
!data.entities ||
!Array.isArray(data.entities) ||
this.loading ||
!this.model ||
!this.model.UID
) {
if (!data || !data.entities || !Array.isArray(data.entities) || this.loading || !this.model || !this.model.UID) {
return;
}

View File

@@ -1,23 +1,10 @@
<template>
<div class="p-tab p-tab-photo-details">
<v-form
ref="form"
lazy-validation
dense
class="p-form-photo-details-meta"
accept-charset="UTF-8"
@submit.prevent="save"
>
<v-form ref="form" lazy-validation dense class="p-form-photo-details-meta" accept-charset="UTF-8" @submit.prevent="save">
<v-layout class="pa-2" row wrap align-top fill-height>
<v-flex class="pa-2 p-photo" xs12 sm4 md2 fill-height>
<v-card tile class="pa-0 ma-0 elevation-0" :title="model.Title">
<v-img
v-touch="{ left, right }"
:src="model.thumbnailUrl('tile_500')"
aspect-ratio="1"
class="card darken-1 elevation-0 clickable"
@click.exact="openPhoto()"
>
<v-img v-touch="{ left, right }" :src="model.thumbnailUrl('tile_500')" aspect-ratio="1" class="card darken-1 elevation-0 clickable" @click.exact="openPhoto()">
</v-img>
</v-card>
</v-flex>
@@ -118,22 +105,7 @@
</v-flex>
<v-flex xs6 sm6 md6 lg3 class="pa-2">
<v-autocomplete
v-model="model.TimeZone"
:disabled="disabled"
:label="$gettext('Time Zone')"
browser-autocomplete="off"
hide-details
box
flat
hide-no-data
color="secondary-dark"
item-value="ID"
item-text="Name"
:items="options.TimeZones()"
class="input-timezone"
@change="updateTime"
>
<v-autocomplete v-model="model.TimeZone" :disabled="disabled" :label="$gettext('Time Zone')" browser-autocomplete="off" hide-details box flat hide-no-data color="secondary-dark" item-value="ID" item-text="Name" :items="options.TimeZones()" class="input-timezone" @change="updateTime">
</v-autocomplete>
</v-flex>
@@ -159,20 +131,7 @@
</v-flex>
<v-flex xs4 md2 lg2 class="pa-2">
<v-text-field
v-model="model.Altitude"
:disabled="disabled"
hide-details
box
flat
browser-autocomplete="off"
autocorrect="off"
autocapitalize="none"
:label="$gettext('Altitude (m)')"
placeholder=""
color="secondary-dark"
class="input-altitude"
></v-text-field>
<v-text-field v-model="model.Altitude" :disabled="disabled" hide-details box flat browser-autocomplete="off" autocorrect="off" autocapitalize="none" :label="$gettext('Altitude (m)')" placeholder="" color="secondary-dark" class="input-altitude"></v-text-field>
</v-flex>
<v-flex xs4 sm6 md3 lg2 class="pa-2">
@@ -234,37 +193,11 @@
</v-flex>
<v-flex xs6 md3 class="pa-2">
<v-text-field
v-model="model.Iso"
:disabled="disabled"
hide-details
box
flat
browser-autocomplete="off"
autocorrect="off"
autocapitalize="none"
label="ISO"
placeholder=""
color="secondary-dark"
class="input-iso"
></v-text-field>
<v-text-field v-model="model.Iso" :disabled="disabled" hide-details box flat browser-autocomplete="off" autocorrect="off" autocapitalize="none" label="ISO" placeholder="" color="secondary-dark" class="input-iso"></v-text-field>
</v-flex>
<v-flex xs6 md3 class="pa-2">
<v-text-field
v-model="model.Exposure"
:disabled="disabled"
hide-details
box
flat
browser-autocomplete="off"
autocorrect="off"
autocapitalize="none"
:label="$gettext('Exposure')"
placeholder=""
color="secondary-dark"
class="input-exposure"
></v-text-field>
<v-text-field v-model="model.Exposure" :disabled="disabled" hide-details box flat browser-autocomplete="off" autocorrect="off" autocapitalize="none" :label="$gettext('Exposure')" placeholder="" color="secondary-dark" class="input-exposure"></v-text-field>
</v-flex>
<v-flex xs12 md6 pa-2 class="p-lens-select">
@@ -288,36 +221,11 @@
</v-flex>
<v-flex xs6 md3 class="pa-2">
<v-text-field
v-model="model.FNumber"
f
:disabled="disabled"
hide-details
box
flat
browser-autocomplete="off"
autocorrect="off"
autocapitalize="none"
:label="$gettext('F Number')"
placeholder=""
color="secondary-dark"
class="input-fnumber"
></v-text-field>
<v-text-field v-model="model.FNumber" f :disabled="disabled" hide-details box flat browser-autocomplete="off" autocorrect="off" autocapitalize="none" :label="$gettext('F Number')" placeholder="" color="secondary-dark" class="input-fnumber"></v-text-field>
</v-flex>
<v-flex xs6 md3 class="pa-2">
<v-text-field
v-model="model.FocalLength"
:disabled="disabled"
hide-details
box
flat
browser-autocomplete="off"
:label="$gettext('Focal Length')"
placeholder=""
color="secondary-dark"
class="input-focal-length"
></v-text-field>
<v-text-field v-model="model.FocalLength" :disabled="disabled" hide-details box flat browser-autocomplete="off" :label="$gettext('Focal Length')" placeholder="" color="secondary-dark" class="input-focal-length"></v-text-field>
</v-flex>
<v-flex xs12 md6 class="pa-2">
@@ -447,33 +355,14 @@
</v-flex>
<v-flex v-if="!disabled" xs12 :text-xs-right="!rtl" :text-xs-left="rtl" class="pt-3">
<v-btn
depressed
color="secondary-light"
class="compact action-close"
@click.stop="close"
>
<v-btn depressed color="secondary-light" class="compact action-close" @click.stop="close">
<translate>Close</translate>
</v-btn>
<v-btn
color="primary-button"
depressed
dark
class="compact action-apply action-approve"
@click.stop="save(false)"
>
<span v-if="$config.feature('review') && model.Quality < 3"
><translate>Approve</translate></span
>
<v-btn color="primary-button" depressed dark class="compact action-apply action-approve" @click.stop="save(false)">
<span v-if="$config.feature('review') && model.Quality < 3"><translate>Approve</translate></span>
<span v-else><translate>Apply</translate></span>
</v-btn>
<v-btn
color="primary-button"
depressed
dark
class="compact action-done hidden-xs-only"
@click.stop="save(true)"
>
<v-btn color="primary-button" depressed dark class="compact action-done hidden-xs-only" @click.stop="save(true)">
<translate>Done</translate>
</v-btn>
</v-flex>

View File

@@ -2,21 +2,18 @@
<div class="p-tab p-tab-photo-files">
<v-expansion-panel expand class="pa-0 elevation-0 secondary" :value="state">
<template v-for="file in model.fileModels()">
<v-expansion-panel-content
v-if="!file.Missing"
:key="file.UID"
class="pa-0 elevation-0 secondary-light"
style="margin-top: 1px"
>
<v-expansion-panel-content v-if="!file.Missing" :key="file.UID" class="pa-0 elevation-0 secondary-light" style="margin-top: 1px">
<template #header>
<div class="caption filename">{{ file.baseName(70) }}</div>
<div class="caption filename">
{{ file.baseName(70) }}
</div>
</template>
<v-card>
<v-card-text class="white pa-0">
<v-container fluid class="pa-0">
<v-alert :value="file.Error" type="error" class="my-0 text-capitalize">{{
file.Error
}}</v-alert>
<v-alert :value="file.Error" type="error" class="my-0 text-capitalize">
{{ file.Error }}
</v-alert>
<v-layout row wrap fill-height align-center justify-center>
<v-flex xs12 class="pa-0">
<div class="v-table__overflow">
@@ -27,15 +24,7 @@
<translate>Preview</translate>
</td>
<td>
<v-img
:src="file.thumbnailUrl('tile_224')"
aspect-ratio="1"
max-width="112"
max-height="112"
class="card darken-1 elevation-0 clickable my-1"
@click.exact="openFile(file)"
>
</v-img>
<v-img :src="file.thumbnailUrl('tile_224')" aspect-ratio="1" max-width="112" max-height="112" class="card darken-1 elevation-0 clickable my-1" @click.exact="openFile(file)"></v-img>
</td>
</tr>
<tr>
@@ -43,97 +32,35 @@
<translate>Actions</translate>
</td>
<td>
<v-btn
v-if="features.download"
small
depressed
dark
color="primary-button"
class="btn-action action-download"
:disabled="busy"
@click.stop.prevent="downloadFile(file)"
>
<v-btn v-if="features.download" small depressed dark color="primary-button" class="btn-action action-download" :disabled="busy" @click.stop.prevent="downloadFile(file)">
<translate>Download</translate>
</v-btn>
<v-btn
v-if="
features.edit &&
(file.FileType === 'jpg' || file.FileType === 'png') &&
!file.Error &&
!file.Primary
"
small
depressed
dark
color="primary-button"
class="btn-action action-primary"
:disabled="busy"
@click.stop.prevent="primaryFile(file)"
>
<v-btn v-if="features.edit && (file.FileType === 'jpg' || file.FileType === 'png') && !file.Error && !file.Primary" small depressed dark color="primary-button" class="btn-action action-primary" :disabled="busy" @click.stop.prevent="primaryFile(file)">
<translate>Primary</translate>
</v-btn>
<v-btn
v-if="
features.edit &&
!file.Sidecar &&
!file.Error &&
!file.Primary &&
file.Root === '/'
"
small
depressed
dark
color="primary-button"
class="btn-action action-unstack"
:disabled="busy"
@click.stop.prevent="unstackFile(file)"
>
<v-btn v-if="features.edit && !file.Sidecar && !file.Error && !file.Primary && file.Root === '/'" small depressed dark color="primary-button" class="btn-action action-unstack" :disabled="busy" @click.stop.prevent="unstackFile(file)">
<translate>Unstack</translate>
</v-btn>
<v-btn
v-if="features.delete && !file.Primary"
small
depressed
dark
color="primary-button"
class="btn-action action-delete"
:disabled="busy"
@click.stop.prevent="showDeleteDialog(file)"
>
<v-btn v-if="features.delete && !file.Primary" small depressed dark color="primary-button" class="btn-action action-delete" :disabled="busy" @click.stop.prevent="showDeleteDialog(file)">
<translate>Delete</translate>
</v-btn>
<v-btn
v-if="experimental && canAccessPrivate && file.Primary"
small
depressed
dark
color="primary-button"
class="btn-action action-open-folder"
:href="folderUrl(file)"
target="_blank"
>
<v-btn v-if="experimental && canAccessPrivate && file.Primary" small depressed dark color="primary-button" class="btn-action action-open-folder" :href="folderUrl(file)" target="_blank">
<translate>File Browser</translate>
</v-btn>
</td>
</tr>
<tr>
<td title="Unique ID"> UID </td>
<td
><span class="clickable" @click.stop.prevent="copyText(file.UID)">{{
file.UID | uppercase
}}</span></td
>
<td>
<span class="clickable" @click.stop.prevent="copyText(file.UID)">{{ file.UID | uppercase }}</span>
</td>
</tr>
<tr v-if="file.InstanceID" title="XMP">
<td>
<translate>Instance ID</translate>
</td>
<td
><span
class="clickable"
@click.stop.prevent="copyText(file.InstanceID)"
>{{ file.InstanceID | uppercase }}</span
></td
><span class="clickable" @click.stop.prevent="copyText(file.InstanceID)">{{ file.InstanceID | uppercase }}</span></td
>
</tr>
<tr>
@@ -141,9 +68,7 @@
<translate>Hash</translate>
</td>
<td
><span class="clickable" @click.stop.prevent="copyText(file.Hash)">{{
file.Hash
}}</span></td
><span class="clickable" @click.stop.prevent="copyText(file.Hash)">{{ file.Hash }}</span></td
>
</tr>
<tr v-if="file.Name">
@@ -151,9 +76,7 @@
<translate>Filename</translate>
</td>
<td
><span class="clickable" @click.stop.prevent="copyText(file.Name)">{{
file.Name
}}</span></td
><span class="clickable" @click.stop.prevent="copyText(file.Name)">{{ file.Name }}</span></td
>
</tr>
<tr v-if="file.Root">
@@ -167,11 +90,7 @@
<translate>Original Name</translate>
</td>
<td
><span
class="clickable"
@click.stop.prevent="copyText(file.OriginalName)"
>{{ file.OriginalName }}</span
></td
><span class="clickable" @click.stop.prevent="copyText(file.OriginalName)">{{ file.OriginalName }}</span></td
>
</tr>
<tr>
@@ -273,27 +192,16 @@
hide-details
color="secondary-dark"
:items="options.Orientations()"
:readonly="
readonly ||
!features.edit ||
file.Error ||
(file.Frames && file.Frames > 1) ||
(file.Duration && file.Duration > 1) ||
(file.FileType !== 'jpg' && file.FileType !== 'png')
"
:readonly="readonly || !features.edit || file.Error || (file.Frames && file.Frames > 1) || (file.Duration && file.Duration > 1) || (file.FileType !== 'jpg' && file.FileType !== 'png')"
:disabled="busy"
class="input-orientation"
@change="changeOrientation(file)"
>
<template #selection="{ item }">
<span :title="item.text"
><v-icon :class="orientationClass(item)">portrait</v-icon></span
>
<span :title="item.text"><v-icon :class="orientationClass(item)">portrait</v-icon></span>
</template>
<template #item="{ item }">
<span :title="item.text"
><v-icon :class="orientationClass(item)">portrait</v-icon></span
>
<span :title="item.text"><v-icon :class="orientationClass(item)">portrait</v-icon></span>
</template>
</v-select>
</td>
@@ -314,13 +222,7 @@
<td>
<translate>Chroma</translate>
</td>
<td
><v-progress-linear
:value="file.Chroma"
style="max-width: 300px"
:title="`${file.Chroma}%`"
></v-progress-linear
></td>
<td><v-progress-linear :value="file.Chroma" style="max-width: 300px" :title="`${file.Chroma}%`"></v-progress-linear></td>
</tr>
<tr v-if="file.Missing">
<td>
@@ -361,11 +263,7 @@
</v-expansion-panel-content>
</template>
</v-expansion-panel>
<p-file-delete-dialog
:show="deleteFile.dialog"
@cancel="closeDeleteDialog"
@confirm="confirmDeleteFile"
></p-file-delete-dialog>
<p-file-delete-dialog :show="deleteFile.dialog" @cancel="closeDeleteDialog" @confirm="confirmDeleteFile"></p-file-delete-dialog>
</div>
</template>
@@ -399,9 +297,7 @@ export default {
config: this.$config.values,
readonly: this.$config.get("readonly"),
experimental: this.$config.get("experimental"),
canAccessPrivate:
this.$config.allow("photos", "access_library") &&
this.$config.allow("photos", "access_private"),
canAccessPrivate: this.$config.allow("photos", "access_library") && this.$config.allow("photos", "access_private"),
options: options,
busy: false,
rtl: this.$rtl,
@@ -479,10 +375,7 @@ export default {
// "#" chars in path names must be explicitly escaped,
// see https://github.com/photoprism/photoprism/issues/3695
const path = name
.substring(0, name.lastIndexOf("/"))
.replaceAll(":", "%3A")
.replaceAll("#", "%23");
const path = name.substring(0, name.lastIndexOf("/")).replaceAll(":", "%3A").replaceAll("#", "%23");
return this.$router.resolve({ path: "/index/files/" + path }).href;
},
downloadFile(file) {

View File

@@ -7,17 +7,13 @@
<tr>
<td>UID</td>
<td
><span class="clickable" @click.stop.prevent="copyText(model.UID)">{{
model.UID | uppercase
}}</span></td
><span class="clickable" @click.stop.prevent="copyText(model.UID)">{{ model.UID | uppercase }}</span></td
>
</tr>
<tr v-if="model.DocumentID">
<td>Document ID</td>
<td
><span class="clickable" @click.stop.prevent="copyText(model.DocumentID)">{{
model.DocumentID | uppercase
}}</span></td
><span class="clickable" @click.stop.prevent="copyText(model.DocumentID)">{{ model.DocumentID | uppercase }}</span></td
>
</tr>
<tr>
@@ -26,18 +22,7 @@
<v-icon v-if="model.TypeSrc === 'manual'" class="src">check</v-icon>
</td>
<td>
<v-select
v-model="model.Type"
flat
solo
browser-autocomplete="off"
hide-details
color="secondary-dark"
:items="options.PhotoTypes()"
class="input-type"
@change="save"
>
</v-select>
<v-select v-model="model.Type" flat solo browser-autocomplete="off" hide-details color="secondary-dark" :items="options.PhotoTypes()" class="input-type" @change="save"> </v-select>
</td>
</tr>
<tr v-if="model.Path">
@@ -45,9 +30,7 @@
<translate>Folder</translate>
</td>
<td
><span class="clickable" @click.stop.prevent="copyText(model.Path)">{{
model.Path
}}</span></td
><span class="clickable" @click.stop.prevent="copyText(model.Path)">{{ model.Path }}</span></td
>
</tr>
<tr>
@@ -55,9 +38,7 @@
<translate>Name</translate>
</td>
<td
><span class="clickable" @click.stop.prevent="copyText(model.Name)">{{
model.Name
}}</span></td
><span class="clickable" @click.stop.prevent="copyText(model.Name)">{{ model.Name }}</span></td
>
</tr>
<tr v-if="model.OriginalName">
@@ -65,18 +46,7 @@
<translate>Original Name</translate>
</td>
<td>
<v-text-field
v-model="model.OriginalName"
flat
solo
dense
hide-details
browser-autocomplete="off"
autocorrect="off"
autocapitalize="none"
color="secondary-dark"
@change="save"
></v-text-field>
<v-text-field v-model="model.OriginalName" flat solo dense hide-details browser-autocomplete="off" autocorrect="off" autocapitalize="none" color="secondary-dark" @change="save"></v-text-field>
</td>
</tr>
<tr>
@@ -85,9 +55,7 @@
<v-icon v-if="model.TitleSrc === 'manual'" class="src">check</v-icon>
</td>
<td :title="sourceName(model.TitleSrc)">
<span class="clickable" @click.stop.prevent="copyText(model.Title)">{{
model.Title
}}</span>
<span class="clickable" @click.stop.prevent="copyText(model.Title)">{{ model.Title }}</span>
<v-icon v-if="model.TitleSrc === 'name'" class="src">insert_drive_file</v-icon>
</td>
</tr>
@@ -98,11 +66,7 @@
</td>
<td :title="sourceName(model.TakenSrc)">
{{ model.getDateString() }}
<v-icon
v-if="model.TakenSrc === 'name' || model.TakenSrc === 'estimate'"
class="src"
>insights</v-icon
>
<v-icon v-if="model.TakenSrc === 'name' || model.TakenSrc === 'estimate'" class="src">insights</v-icon>
</td>
</tr>
<tr v-if="albums.length > 0">
@@ -110,14 +74,7 @@
<translate>Albums</translate>
</td>
<td>
<a
v-for="(a, i) in albums"
:key="i"
:href="a.url"
class="primary--text text-link"
target="_blank"
><span v-if="i > 0">, </span>{{ a.title }}</a
>
<a v-for="(a, i) in albums" :key="i" :href="a.url" class="primary--text text-link" target="_blank"><span v-if="i > 0">, </span>{{ a.title }}</a>
</td>
</tr>
<tr>
@@ -151,15 +108,7 @@
<translate>Stackable</translate>
</td>
<td>
<v-switch
v-model="model.Stack"
hide-details
class="input-stackable"
:true-value="0"
:false-value="-1"
:label="model.Stack > -1 ? $gettext('Yes') : $gettext('No')"
@change="save"
></v-switch>
<v-switch v-model="model.Stack" hide-details class="input-stackable" :true-value="0" :false-value="-1" :label="model.Stack > -1 ? $gettext('Yes') : $gettext('No')" @change="save"></v-switch>
</td>
</tr>
<tr>
@@ -167,13 +116,7 @@
<translate>Favorite</translate>
</td>
<td>
<v-switch
v-model="model.Favorite"
hide-details
class="input-favorite"
:label="model.Favorite ? $gettext('Yes') : $gettext('No')"
@change="save"
></v-switch>
<v-switch v-model="model.Favorite" hide-details class="input-favorite" :label="model.Favorite ? $gettext('Yes') : $gettext('No')" @change="save"></v-switch>
</td>
</tr>
<tr v-if="$config.feature('private')">
@@ -181,13 +124,7 @@
<translate>Private</translate>
</td>
<td>
<v-switch
v-model="model.Private"
hide-details
class="input-private"
:label="model.Private ? $gettext('Yes') : $gettext('No')"
@change="save"
></v-switch>
<v-switch v-model="model.Private" hide-details class="input-private" :label="model.Private ? $gettext('Yes') : $gettext('No')" @change="save"></v-switch>
</td>
</tr>
<tr>
@@ -195,13 +132,7 @@
<translate>Scan</translate>
</td>
<td>
<v-switch
v-model="model.Scan"
hide-details
class="input-scan"
:label="model.Scan ? $gettext('Yes') : $gettext('No')"
@change="save"
></v-switch>
<v-switch v-model="model.Scan" hide-details class="input-scan" :label="model.Scan ? $gettext('Yes') : $gettext('No')" @change="save"></v-switch>
</td>
</tr>
<tr>
@@ -209,13 +140,7 @@
<translate>Panorama</translate>
</td>
<td>
<v-switch
v-model="model.Panorama"
hide-details
class="input-panorama"
:label="model.Panorama ? $gettext('Yes') : $gettext('No')"
@change="save"
></v-switch>
<v-switch v-model="model.Panorama" hide-details class="input-panorama" :label="model.Panorama ? $gettext('Yes') : $gettext('No')" @change="save"></v-switch>
</td>
</tr>
<tr>
@@ -255,21 +180,7 @@
<translate>Accuracy</translate>
</td>
<td>
<v-text-field
v-model="model.CellAccuracy"
flat
solo
dense
hide-details
browser-autocomplete="off"
autocorrect="off"
autocapitalize="none"
color="secondary-dark"
type="number"
suffix="m"
style="width: 100px"
@change="save"
></v-text-field>
<v-text-field v-model="model.CellAccuracy" flat solo dense hide-details browser-autocomplete="off" autocorrect="off" autocapitalize="none" color="secondary-dark" type="number" suffix="m" style="width: 100px" @change="save"></v-text-field>
</td>
</tr>
<tr>

View File

@@ -6,122 +6,45 @@
<p-photo-preview :model="model"></p-photo-preview>
</v-flex>
<v-flex class="pa-2-md-and-up ra-4-table-md-and-up" xs12 md10 xxl11 fill-width fill-height>
<v-data-table
v-model="selected"
:headers="listColumns"
:items="model.Labels"
hide-actions
class="elevation-0 p-results"
disable-initial-sort
item-key="ID"
:no-data-text="$gettext('No labels found')"
>
<v-data-table v-model="selected" :headers="listColumns" :items="model.Labels" hide-actions class="elevation-0 p-results" disable-initial-sort item-key="ID" :no-data-text="$gettext('No labels found')">
<template #items="props" class="p-file">
<td>
<v-edit-dialog
:return-value.sync="props.item.Label.Name"
lazy
class="p-inline-edit"
@save="renameLabel(props.item.Label)"
>
<v-edit-dialog :return-value.sync="props.item.Label.Name" lazy class="p-inline-edit" @save="renameLabel(props.item.Label)">
{{ props.item.Label.Name }}
<template #input>
<v-text-field
v-model="props.item.Label.Name"
:rules="[nameRule]"
:label="$gettext('Name')"
color="secondary-dark"
class="input-rename background-inherit elevation-0"
single-line
autofocus
solo
hide-details
></v-text-field>
<v-text-field v-model="props.item.Label.Name" :rules="[nameRule]" :label="$gettext('Name')" color="secondary-dark" class="input-rename background-inherit elevation-0" single-line autofocus solo hide-details></v-text-field>
</template>
</v-edit-dialog>
</td>
<td class="text-xs-left">{{ sourceName(props.item.LabelSrc) }}</td>
<td class="text-xs-left">
{{ sourceName(props.item.LabelSrc) }}
</td>
<td class="text-xs-center"> {{ 100 - props.item.Uncertainty }}% </td>
<td class="text-xs-center">
<v-btn
v-if="disabled"
icon
small
flat
:ripple="false"
class="action-view"
title="Search"
@click.stop.prevent="searchLabel(props.item.Label)"
>
<v-btn v-if="disabled" icon small flat :ripple="false" class="action-view" title="Search" @click.stop.prevent="searchLabel(props.item.Label)">
<v-icon color="secondary-dark">search</v-icon>
</v-btn>
<v-btn
v-else-if="props.item.Uncertainty < 100 && props.item.LabelSrc === 'manual'"
icon
small
flat
:ripple="false"
class="action-delete"
title="Delete"
@click.stop.prevent="removeLabel(props.item.Label)"
>
<v-btn v-else-if="props.item.Uncertainty < 100 && props.item.LabelSrc === 'manual'" icon small flat :ripple="false" class="action-delete" title="Delete" @click.stop.prevent="removeLabel(props.item.Label)">
<v-icon color="secondary-dark">delete</v-icon>
</v-btn>
<v-btn
v-else-if="props.item.Uncertainty < 100"
icon
small
flat
:ripple="false"
class="action-remove"
title="Remove"
@click.stop.prevent="removeLabel(props.item.Label)"
>
<v-btn v-else-if="props.item.Uncertainty < 100" icon small flat :ripple="false" class="action-remove" title="Remove" @click.stop.prevent="removeLabel(props.item.Label)">
<v-icon color="secondary-dark">remove</v-icon>
</v-btn>
<v-btn
v-else
icon
small
flat
:ripple="false"
class="action-on"
title="Activate"
@click.stop.prevent="activateLabel(props.item.Label)"
>
<v-btn v-else icon small flat :ripple="false" class="action-on" title="Activate" @click.stop.prevent="activateLabel(props.item.Label)">
<v-icon color="secondary-dark">add</v-icon>
</v-btn>
</td>
</template>
<template v-if="!disabled" #footer>
<td>
<v-text-field
v-model="newLabel"
:rules="[nameRule]"
color="secondary-dark"
browser-autocomplete="off"
:label="$gettext('Name')"
single-line
flat
solo
hide-details
autofocus
class="input-label"
@keyup.enter.native="addLabel"
></v-text-field>
<v-text-field v-model="newLabel" :rules="[nameRule]" color="secondary-dark" browser-autocomplete="off" :label="$gettext('Name')" single-line flat solo hide-details autofocus class="input-label" @keyup.enter.native="addLabel"></v-text-field>
</td>
<td class="text-xs-left">
{{ sourceName("manual") }}
</td>
<td class="text-xs-left">{{ sourceName("manual") }}</td>
<td class="text-xs-center"> 100% </td>
<td class="text-xs-center">
<v-btn
icon
small
flat
:ripple="false"
title="Add"
class="p-photo-label-add"
@click.stop.prevent="addLabel"
>
<v-btn icon small flat :ripple="false" title="Add" class="p-photo-label-add" @click.stop.prevent="addLabel">
<v-icon color="secondary-dark">add</v-icon>
</v-btn>
</td>

View File

@@ -1,13 +1,7 @@
<template>
<div class="p-tab p-tab-photo-people">
<v-container grid-list-xs fluid class="pa-2 p-faces">
<v-alert
:value="markers.length === 0"
color="secondary-dark"
icon="lightbulb_outline"
class="no-results ma-2 opacity-70"
outline
>
<v-alert :value="markers.length === 0" color="secondary-dark" icon="lightbulb_outline" class="no-results ma-2 opacity-70" outline>
<h3 class="body-2 ma-0 pa-0">
<translate>No people found</translate>
</h3>
@@ -18,32 +12,10 @@
</v-alert>
<v-layout class="search-results face-results cards-view" row wrap fill-height>
<v-flex v-for="(marker, index) in markers" :key="index" xs12 sm6 md3 xl2 d-flex>
<v-card
tile
:data-id="marker.UID"
style="user-select: none"
:class="marker.classes()"
class="result card"
>
<v-card tile :data-id="marker.UID" style="user-select: none" :class="marker.classes()" class="result card">
<div class="card-background card"></div>
<v-img
:src="marker.thumbnailUrl('tile_320')"
:transition="false"
aspect-ratio="1"
class="card darken-1"
>
<v-btn
v-if="!marker.SubjUID && !marker.Invalid"
:ripple="false"
:depressed="false"
class="input-reject"
icon
flat
small
absolute
:title="$gettext('Remove')"
@click.stop.prevent="onReject(marker)"
>
<v-img :src="marker.thumbnailUrl('tile_320')" :transition="false" aspect-ratio="1" class="card darken-1">
<v-btn v-if="!marker.SubjUID && !marker.Invalid" :ripple="false" :depressed="false" class="input-reject" icon flat small absolute :title="$gettext('Remove')" @click.stop.prevent="onReject(marker)">
<v-icon color="white" class="action-reject">clear</v-icon>
</v-btn>
</v-img>
@@ -51,17 +23,7 @@
<v-card-actions class="card-details pa-0">
<v-layout v-if="marker.Invalid" row wrap align-center>
<v-flex xs12 class="text-xs-center pa-0">
<v-btn
color="transparent"
:disabled="busy"
large
depressed
block
:round="false"
class="action-undo text-xs-center"
:title="$gettext('Undo')"
@click.stop="onApprove(marker)"
>
<v-btn color="transparent" :disabled="busy" large depressed block :round="false" class="action-undo text-xs-center" :title="$gettext('Undo')" @click.stop="onApprove(marker)">
<v-icon dark>undo</v-icon>
</v-btn>
</v-flex>

View File

@@ -9,14 +9,7 @@
<v-btn color="secondary-light" class="compact mx-2" depressed @click="close">
<translate>Cancel</translate>
</v-btn>
<v-btn
color="primary-button"
class="action-update-reload compact"
dark
small
depressed
@click="reload"
>
<v-btn color="primary-button" class="action-update-reload compact" dark small depressed @click="reload">
<translate>Reload</translate>
</v-btn>
</v-card-actions>

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="500"
class="p-account-add-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="500" class="p-account-add-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-card-title primary-title class="pa-2">
<v-layout row wrap>
@@ -20,31 +13,10 @@
<v-card-text class="pb-0 pt-0 px-2">
<v-layout row wrap>
<v-flex xs12 class="pa-2">
<v-text-field
v-model="model.AccURL"
hide-details
autofocus
box
flat
:label="$gettext('Service URL')"
placeholder="https://www.example.com/"
color="secondary-dark"
autocorrect="off"
autocapitalize="none"
></v-text-field>
<v-text-field v-model="model.AccURL" hide-details autofocus box flat :label="$gettext('Service URL')" placeholder="https://www.example.com/" color="secondary-dark" autocorrect="off" autocapitalize="none"></v-text-field>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-text-field
v-model="model.AccUser"
hide-details
box
flat
:label="$gettext('Username')"
placeholder="optional"
color="secondary-dark"
autocorrect="off"
autocapitalize="none"
></v-text-field>
<v-text-field v-model="model.AccUser" hide-details box flat :label="$gettext('Username')" placeholder="optional" color="secondary-dark" autocorrect="off" autocapitalize="none"></v-text-field>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-text-field
@@ -67,31 +39,14 @@
<v-card-actions class="pt-1 pb-2 px-2">
<v-layout row wrap class="pa-2">
<v-flex xs12 text-xs-left class="caption">
<translate
>Note: Only WebDAV servers, like Nextcloud or PhotoPrism, can be configured as remote
service for backup and file upload.</translate
>
<translate
>Support for additional services, like Google Drive, will be added over
time.</translate
>
<translate>Note: Only WebDAV servers, like Nextcloud or PhotoPrism, can be configured as remote service for backup and file upload.</translate>
<translate>Support for additional services, like Google Drive, will be added over time.</translate>
</v-flex>
<v-flex xs12 text-xs-right class="pt-2">
<v-btn
depressed
color="secondary-light"
class="action-cancel ml-2"
@click.stop="cancel"
>
<v-btn depressed color="secondary-light" class="action-cancel ml-2" @click.stop="cancel">
<span>{{ label.cancel }}</span>
</v-btn>
<v-btn
depressed
dark
color="primary-button"
class="action-confirm compact mr-0"
@click.stop="confirm"
>
<v-btn depressed dark color="primary-button" class="action-confirm compact mr-0" @click.stop="confirm">
<span>{{ label.confirm }}</span>
</v-btn>
</v-flex>

View File

@@ -1,80 +1,37 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="500"
class="p-account-edit-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="500" class="p-account-edit-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-card-title primary-title class="pa-2">
<v-layout v-if="scope === 'sharing'" row wrap class="py-2 pr-0 pl-2">
<v-flex xs9>
<h3 class="headline ma-0 pa-0">{{ $gettext("Manual Upload") }}</h3>
<h3 class="headline ma-0 pa-0">
{{ $gettext("Manual Upload") }}
</h3>
</v-flex>
<v-flex xs3 text-xs-right>
<v-switch
v-model="model.AccShare"
color="secondary-dark"
:true-value="true"
:false-value="false"
:disabled="model.AccType !== 'webdav'"
class="ma-0 hidden-xs-only float-right"
hide-details
></v-switch>
<v-switch
v-model="model.AccShare"
color="secondary-dark"
:true-value="true"
:false-value="false"
:disabled="model.AccType !== 'webdav'"
class="ma-0 hidden-sm-and-up float-right"
hide-details
></v-switch>
<v-switch v-model="model.AccShare" color="secondary-dark" :true-value="true" :false-value="false" :disabled="model.AccType !== 'webdav'" class="ma-0 hidden-xs-only float-right" hide-details></v-switch>
<v-switch v-model="model.AccShare" color="secondary-dark" :true-value="true" :false-value="false" :disabled="model.AccType !== 'webdav'" class="ma-0 hidden-sm-and-up float-right" hide-details></v-switch>
</v-flex>
</v-layout>
<v-layout v-else-if="scope === 'sync'" row wrap class="pa-2">
<v-flex xs9>
<h3 class="headline ma-0 pa-0">{{ $gettext("Remote Sync") }}</h3>
<h3 class="headline ma-0 pa-0">
{{ $gettext("Remote Sync") }}
</h3>
</v-flex>
<v-flex xs3 text-xs-right>
<v-switch
v-model="model.AccSync"
color="secondary-dark"
:true-value="true"
:false-value="false"
:disabled="model.AccType !== 'webdav'"
class="mt-0 hidden-xs-only float-right"
hide-details
box
flat
></v-switch>
<v-switch
v-model="model.AccSync"
color="secondary-dark"
:true-value="true"
:false-value="false"
:disabled="model.AccType !== 'webdav'"
class="mt-0 hidden-sm-and-up float-right"
hide-details
box
flat
></v-switch>
<v-switch v-model="model.AccSync" color="secondary-dark" :true-value="true" :false-value="false" :disabled="model.AccType !== 'webdav'" class="mt-0 hidden-xs-only float-right" hide-details box flat></v-switch>
<v-switch v-model="model.AccSync" color="secondary-dark" :true-value="true" :false-value="false" :disabled="model.AccType !== 'webdav'" class="mt-0 hidden-sm-and-up float-right" hide-details box flat></v-switch>
</v-flex>
</v-layout>
<v-layout v-else row wrap class="pt-2 pr-0 pl-2">
<v-flex xs10>
<h3 class="headline ma-0 pa-0">{{ $gettext("Edit Account") }}</h3>
<h3 class="headline ma-0 pa-0">
{{ $gettext("Edit Account") }}
</h3>
</v-flex>
<v-flex xs2 text-xs-right>
<v-btn
icon
flat
:ripple="false"
class="action-remove mt-0"
@click.stop.prevent="remove()"
>
<v-btn icon flat :ripple="false" class="action-remove mt-0" @click.stop.prevent="remove()">
<v-icon color="secondary-dark">delete</v-icon>
</v-btn>
</v-flex>
@@ -103,36 +60,10 @@
</v-autocomplete>
</v-flex>
<v-flex xs12 sm6 class="pa-2 input-share-size">
<v-select
v-model="model.ShareSize"
:disabled="!model.AccShare"
:label="$gettext('Size')"
browser-autocomplete="off"
hide-details
box
flat
color="secondary-dark"
item-text="text"
item-value="value"
:items="items.sizes"
>
</v-select>
<v-select v-model="model.ShareSize" :disabled="!model.AccShare" :label="$gettext('Size')" browser-autocomplete="off" hide-details box flat color="secondary-dark" item-text="text" item-value="value" :items="items.sizes"></v-select>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-select
v-model="model.ShareExpires"
:disabled="!model.AccShare"
:label="$gettext('Expires')"
browser-autocomplete="off"
hide-details
box
flat
color="secondary-dark"
item-text="text"
item-value="value"
:items="options.Expires()"
>
</v-select>
<v-select v-model="model.ShareExpires" :disabled="!model.AccShare" :label="$gettext('Expires')" browser-autocomplete="off" hide-details box flat color="secondary-dark" item-text="text" item-value="value" :items="options.Expires()"></v-select>
</v-flex>
</v-layout>
<v-layout v-else-if="scope === 'sync'" row wrap>
@@ -157,110 +88,30 @@
</v-autocomplete>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-select
v-model="model.SyncInterval"
:disabled="!model.AccSync"
:label="$gettext('Interval')"
browser-autocomplete="off"
hide-details
box
flat
color="secondary-dark"
item-text="text"
item-value="value"
:items="options.Intervals()"
>
</v-select>
<v-select v-model="model.SyncInterval" :disabled="!model.AccSync" :label="$gettext('Interval')" browser-autocomplete="off" hide-details box flat color="secondary-dark" item-text="text" item-value="value" :items="options.Intervals()"></v-select>
</v-flex>
<v-flex xs12 sm6 class="px-2">
<v-checkbox
v-model="model.SyncDownload"
:disabled="!model.AccSync || readonly"
hide-details
box
flat
color="secondary-dark"
on-icon="radio_button_checked"
off-icon="radio_button_unchecked"
:label="$gettext('Download remote files')"
@change="onChangeSync('download')"
></v-checkbox>
<v-checkbox v-model="model.SyncDownload" :disabled="!model.AccSync || readonly" hide-details box flat color="secondary-dark" on-icon="radio_button_checked" off-icon="radio_button_unchecked" :label="$gettext('Download remote files')" @change="onChangeSync('download')"></v-checkbox>
</v-flex>
<v-flex xs12 sm6 class="px-2">
<v-checkbox
v-model="model.SyncFilenames"
:disabled="!model.AccSync"
hide-details
box
flat
color="secondary-dark"
:label="$gettext('Preserve filenames')"
></v-checkbox>
<v-checkbox v-model="model.SyncFilenames" :disabled="!model.AccSync" hide-details box flat color="secondary-dark" :label="$gettext('Preserve filenames')"></v-checkbox>
</v-flex>
<v-flex xs12 sm6 class="px-2">
<v-checkbox
v-model="model.SyncUpload"
:disabled="!model.AccSync"
hide-details
box
flat
color="secondary-dark"
on-icon="radio_button_checked"
off-icon="radio_button_unchecked"
:label="$gettext('Upload local files')"
@change="onChangeSync('upload')"
></v-checkbox>
<v-checkbox v-model="model.SyncUpload" :disabled="!model.AccSync" hide-details box flat color="secondary-dark" on-icon="radio_button_checked" off-icon="radio_button_unchecked" :label="$gettext('Upload local files')" @change="onChangeSync('upload')"></v-checkbox>
</v-flex>
<v-flex xs12 sm6 class="px-2">
<v-checkbox
v-model="model.SyncRaw"
:disabled="!model.AccSync"
hide-details
box
flat
color="secondary-dark"
:label="$gettext('Sync raw and video files')"
></v-checkbox>
<v-checkbox v-model="model.SyncRaw" :disabled="!model.AccSync" hide-details box flat color="secondary-dark" :label="$gettext('Sync raw and video files')"></v-checkbox>
</v-flex>
</v-layout>
<v-layout v-else row wrap class="pt-0">
<v-flex xs12 class="pa-2">
<v-text-field
v-model="model.AccName"
hide-details
autofocus
box
flat
browser-autocomplete="off"
:label="$gettext('Name')"
placeholder=""
color="secondary-dark"
required
></v-text-field>
<v-text-field v-model="model.AccName" hide-details autofocus box flat browser-autocomplete="off" :label="$gettext('Name')" placeholder="" color="secondary-dark" required></v-text-field>
</v-flex>
<v-flex xs12 class="pa-2">
<v-text-field
v-model="model.AccURL"
hide-details
box
flat
browser-autocomplete="off"
:label="$gettext('Service URL')"
placeholder="https://www.example.com/"
color="secondary-dark"
></v-text-field>
<v-text-field v-model="model.AccURL" hide-details box flat browser-autocomplete="off" :label="$gettext('Service URL')" placeholder="https://www.example.com/" color="secondary-dark"></v-text-field>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-text-field
v-model="model.AccUser"
hide-details
box
flat
browser-autocomplete="off"
:label="$gettext('Username')"
placeholder="optional"
color="secondary-dark"
></v-text-field>
<v-text-field v-model="model.AccUser" hide-details box flat browser-autocomplete="off" :label="$gettext('Username')" placeholder="optional" color="secondary-dark"></v-text-field>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-text-field
@@ -278,83 +129,26 @@
></v-text-field>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-text-field
v-model="model.AccKey"
hide-details
box
flat
browser-autocomplete="off"
:label="$gettext('API Key')"
placeholder="optional"
color="secondary-dark"
required
></v-text-field>
<v-text-field v-model="model.AccKey" hide-details box flat browser-autocomplete="off" :label="$gettext('API Key')" placeholder="optional" color="secondary-dark" required></v-text-field>
</v-flex>
<v-flex xs12 sm6 pa-2 class="input-account-type">
<v-select
v-model="model.AccType"
:label="$gettext('Type')"
browser-autocomplete="off"
hide-details
box
flat
color="secondary-dark"
item-text="text"
item-value="value"
:items="items.types"
>
</v-select>
<v-select v-model="model.AccType" :label="$gettext('Type')" browser-autocomplete="off" hide-details box flat color="secondary-dark" item-text="text" item-value="value" :items="items.types"> </v-select>
</v-flex>
<v-flex xs12 sm6 class="px-2">
<v-select
v-model="model.AccTimeout"
:label="$gettext('Timeout')"
browser-autocomplete="off"
hide-details
box
flat
color="secondary-dark"
item-text="text"
item-value="value"
:items="options.Timeouts()"
>
</v-select>
<v-select v-model="model.AccTimeout" :label="$gettext('Timeout')" browser-autocomplete="off" hide-details box flat color="secondary-dark" item-text="text" item-value="value" :items="options.Timeouts()"> </v-select>
</v-flex>
<v-flex xs12 sm6 class="px-2">
<v-select
v-model="model.RetryLimit"
:label="$gettext('Retry Limit')"
browser-autocomplete="off"
hide-details
box
flat
color="secondary-dark"
item-text="text"
item-value="value"
:items="options.RetryLimits()"
>
</v-select>
<v-select v-model="model.RetryLimit" :label="$gettext('Retry Limit')" browser-autocomplete="off" hide-details box flat color="secondary-dark" item-text="text" item-value="value" :items="options.RetryLimits()"> </v-select>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions class="pt-0 pb-2 px-2">
<v-layout row wrap class="pa-2">
<v-flex xs12 text-xs-right class="pt-3 pb-0">
<v-btn
depressed
color="secondary-light"
class="action-cancel ml-2"
@click.stop="cancel"
>
<v-btn depressed color="secondary-light" class="action-cancel ml-2" @click.stop="cancel">
<translate>Cancel</translate>
</v-btn>
<v-btn
depressed
dark
color="primary-button"
class="action-save compact"
@click.stop="save"
>
<v-btn depressed dark color="primary-button" class="action-save compact" @click.stop="save">
<translate>Save</translate>
</v-btn>
</v-flex>

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="350"
class="p-account-delete-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="350" class="p-account-delete-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-container fluid class="pb-2 pr-2 pl-2">
<v-layout row wrap>
@@ -15,27 +8,14 @@
</v-flex>
<v-flex xs9 text-xs-left align-self-center>
<div class="subheading pr-1">
<translate key="Are you sure you want to delete this account?"
>Are you sure you want to delete this account?</translate
>
<translate key="Are you sure you want to delete this account?">Are you sure you want to delete this account?</translate>
</div>
</v-flex>
<v-flex xs12 text-xs-right class="pt-3">
<v-btn
depressed
color="secondary-light"
class="action-cancel ml-2"
@click.stop="cancel"
>
<v-btn depressed color="secondary-light" class="action-cancel ml-2" @click.stop="cancel">
<translate key="Cancel">Cancel</translate>
</v-btn>
<v-btn
depressed
dark
color="primary-button"
class="action-confirm"
@click.stop="confirm"
>
<v-btn depressed dark color="primary-button" class="action-confirm" @click.stop="confirm">
<translate key="Delete">Delete</translate>
</v-btn>
</v-flex>

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="500"
class="p-share-dialog"
@keydown.esc="close"
>
<v-dialog :value="show" lazy persistent max-width="500" class="p-share-dialog" @keydown.esc="close">
<v-card raised elevation="24">
<v-card-title primary-title class="pb-0">
<v-layout row wrap>
@@ -16,15 +9,7 @@
</h3>
</v-flex>
<v-flex xs3 :text-xs-right="!rtl" :text-xs-left="rtl">
<v-btn
icon
flat
dark
color="secondary-dark"
class="ma-0 action-add-link"
:title="$gettext('Add Link')"
@click.stop="add"
>
<v-btn icon flat dark color="secondary-dark" class="ma-0 action-add-link" :title="$gettext('Add Link')" @click.stop="add">
<v-icon>add_link</v-icon>
</v-btn>
</v-flex>
@@ -32,20 +17,11 @@
</v-card-title>
<v-card-text>
<v-expansion-panel class="pa-0 elevation-0">
<v-expansion-panel-content
v-for="(link, index) in links"
:key="link.UID"
class="pa-0 elevation-0 secondary mb-1"
>
<v-expansion-panel-content v-for="(link, index) in links" :key="link.UID" class="pa-0 elevation-0 secondary mb-1">
<template #header>
<button
:class="`text-xs-${!rtl ? 'left' : 'right'} action-url ml-0 mt-0 mb-0 pa-0 mr-2`"
style="user-select: none"
@click.stop="copyUrl(link)"
>
<button :class="`text-xs-${!rtl ? 'left' : 'right'} action-url ml-0 mt-0 mb-0 pa-0 mr-2`" style="user-select: none" @click.stop="copyUrl(link)">
<v-icon size="16" class="pr-1">link</v-icon>
/s/<strong v-if="link.Token" style="font-weight: 500">{{ link.getToken() }}</strong
><span v-else></span>
/s/<strong v-if="link.Token" style="font-weight: 500"> {{ link.getToken() }} </strong><span v-else></span>
</button>
</template>
<v-card>
@@ -53,53 +29,13 @@
<v-container fluid class="pa-0">
<v-layout row wrap>
<v-flex xs12 class="pa-2">
<v-text-field
:value="link.url()"
hide-details
box
flat
readonly
:label="$gettext('URL')"
autocorrect="off"
autocapitalize="none"
browser-autocomplete="off"
color="secondary-dark"
class="input-url"
@click.stop="selectText($event)"
>
</v-text-field>
<v-text-field :value="link.url()" hide-details box flat readonly :label="$gettext('URL')" autocorrect="off" autocapitalize="none" browser-autocomplete="off" color="secondary-dark" class="input-url" @click.stop="selectText($event)"> </v-text-field>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-select
v-model="link.Expires"
hide-details
box
flat
:label="expires(link)"
browser-autocomplete="off"
color="secondary-dark"
item-text="text"
item-value="value"
:items="options.Expires()"
class="input-expires"
>
</v-select>
<v-select v-model="link.Expires" hide-details box flat :label="expires(link)" browser-autocomplete="off" color="secondary-dark" item-text="text" item-value="value" :items="options.Expires()" class="input-expires"> </v-select>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-text-field
v-model="link.Token"
hide-details
box
flat
required
browser-autocomplete="off"
autocorrect="off"
autocapitalize="none"
:label="$gettext('Secret')"
:placeholder="$gettext('Token')"
color="secondary-dark"
class="input-secret"
></v-text-field>
<v-text-field v-model="link.Token" hide-details box flat required browser-autocomplete="off" autocorrect="off" autocapitalize="none" :label="$gettext('Secret')" :placeholder="$gettext('Token')" color="secondary-dark" class="input-secret"></v-text-field>
</v-flex>
<!-- v-flex xs12 sm6 class="pa-2">
<v-text-field
@@ -115,26 +51,12 @@
></v-text-field>
</v-flex -->
<v-flex xs6 :text-xs-left="!rtl" :text-xs-right="rtl" class="pa-2">
<v-btn
small
icon
flat
color="remove"
class="ma-0 action-delete"
:title="$gettext('Delete')"
@click.stop.exact="remove(index)"
>
<v-btn small icon flat color="remove" class="ma-0 action-delete" :title="$gettext('Delete')" @click.stop.exact="remove(index)">
<v-icon>delete</v-icon>
</v-btn>
</v-flex>
<v-flex xs6 :text-xs-right="!rtl" :text-xs-left="rtl" class="pa-2">
<v-btn
depressed
dark
color="primary-button"
class="ma-0 compact action-save"
@click.stop.exact="update(link)"
>
<v-btn depressed dark color="primary-button" class="ma-0 compact action-save" @click.stop.exact="update(link)">
<translate>Save</translate>
</v-btn>
</v-flex>
@@ -145,21 +67,11 @@
</v-expansion-panel-content>
</v-expansion-panel>
<v-container
fluid
:text-xs-left="!rtl"
:text-xs-right="rtl"
class="pb-0 pt-3 pr-0 pl-0 caption"
>
<translate :translate-params="{ name: model.modelName() }"
>People you share a link with will be able to view public contents.</translate
>
<v-container fluid :text-xs-left="!rtl" :text-xs-right="rtl" class="pb-0 pt-3 pr-0 pl-0 caption">
<translate :translate-params="{ name: model.modelName() }">People you share a link with will be able to view public contents.</translate>
<translate>A click will copy it to your clipboard.</translate>
<translate>Any private photos and videos remain private and won't be shared.</translate>
<translate
>Alternatively, you can upload files directly to WebDAV servers like
Nextcloud.</translate
>
<translate>Alternatively, you can upload files directly to WebDAV servers like Nextcloud.</translate>
</v-container>
</v-card-text>
<v-card-actions class="pt-0 px-3">

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="400"
class="p-share-upload-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" lazy persistent max-width="400" class="p-share-upload-dialog" @keydown.esc="cancel">
<v-card raised elevation="24">
<v-card-title primary-title class="pb-0">
<v-layout row wrap>
@@ -25,22 +18,7 @@
<v-card-text class="pt-0">
<v-layout row wrap>
<v-flex xs12 text-xs-left class="pt-2">
<v-select
v-model="service"
color="secondary-dark"
hide-details
hide-no-data
box
flat
:label="$gettext('Account')"
item-text="AccName"
item-value="ID"
return-object
:disabled="loading || noServices"
:items="services"
@change="onChange"
>
</v-select>
<v-select v-model="service" color="secondary-dark" hide-details hide-no-data box flat :label="$gettext('Account')" item-text="AccName" item-value="ID" return-object :disabled="loading || noServices" :items="services" @change="onChange"> </v-select>
</v-flex>
<v-flex xs12 text-xs-left class="pt-2">
<v-autocomplete
@@ -63,34 +41,13 @@
</v-autocomplete>
</v-flex>
<v-flex xs12 text-xs-right class="pt-4">
<v-btn
depressed
color="secondary-light"
class="action-cancel ml-0 mt-0 mb-0 mr-2"
@click.stop="cancel"
>
<v-btn depressed color="secondary-light" class="action-cancel ml-0 mt-0 mb-0 mr-2" @click.stop="cancel">
<translate>Cancel</translate>
</v-btn>
<v-btn
v-if="noServices"
:disabled="isPublic && !isDemo"
color="primary-button"
depressed
dark
class="action-setup ma-0"
@click.stop="setup"
>
<v-btn v-if="noServices" :disabled="isPublic && !isDemo" color="primary-button" depressed dark class="action-setup ma-0" @click.stop="setup">
<translate>Setup</translate>
</v-btn>
<v-btn
v-else
:disabled="noServices"
color="primary-button"
depressed
dark
class="action-upload ma-0"
@click.stop="confirm"
>
<v-btn v-else :disabled="noServices" color="primary-button" depressed dark class="action-upload ma-0" @click.stop="confirm">
<translate>Upload</translate>
</v-btn>
</v-flex>
@@ -179,9 +136,7 @@ export default {
if (files.length === 1) {
this.$notify.success(this.$gettext("One file uploaded"));
} else {
this.$notify.success(
this.$gettextInterpolate(this.$gettext("%{n} files uploaded"), { n: files.length })
);
this.$notify.success(this.$gettextInterpolate(this.$gettext("%{n} files uploaded"), { n: files.length }));
}
this.$emit("confirm", this.service);

View File

@@ -1,12 +1,5 @@
<template>
<v-dialog
:value="show"
lazy
persistent
max-width="575"
class="modal-dialog sponsor-dialog"
@keydown.esc="close"
>
<v-dialog :value="show" lazy persistent max-width="575" class="modal-dialog sponsor-dialog" @keydown.esc="close">
<v-card raised elevation="24">
<v-card-title primary-title class="px-2 pb-0">
<v-layout row wrap class="px-2">
@@ -24,23 +17,13 @@
<v-layout row wrap class="px-2">
<v-flex xs12 class="py-1">
<p class="body-2">
<translate
>Your continued support helps us provide regular updates and remain independent, so
we can fulfill our mission and protect your privacy.</translate
>
<translate>Your continued support helps us provide regular updates and remain independent, so we can fulfill our mission and protect your privacy.</translate>
</p>
<p class="body-1">
<translate
>Being 100% self-funded and independent, we can promise you that we will never sell
your data and that we will always be transparent about our software and
services.</translate
>
<translate>Being 100% self-funded and independent, we can promise you that we will never sell your data and that we will always be transparent about our software and services.</translate>
</p>
<p class="body-1">
<translate
>You are welcome to contact us at membership@photoprism.app for questions regarding
your membership.</translate
>
<translate>You are welcome to contact us at membership@photoprism.app for questions regarding your membership.</translate>
</p>
</v-flex>
</v-layout>
@@ -48,31 +31,13 @@
<v-card-actions class="pt-0 px-2">
<v-layout row wrap class="px-2">
<v-flex xs12 text-xs-right class="py-2">
<v-btn
depressed
color="secondary-light"
class="action-close compact"
@click.stop="close"
>
<v-btn depressed color="secondary-light" class="action-close compact" @click.stop="close">
<translate>No thanks</translate>
</v-btn>
<v-btn
v-if="isPublic || !isAdmin"
href="https://link.photoprism.app/personal-editions"
target="_blank"
depressed
color="primary-button"
class="white--text action-about compact"
>
<v-btn v-if="isPublic || !isAdmin" href="https://link.photoprism.app/personal-editions" target="_blank" depressed color="primary-button" class="white--text action-about compact">
<translate>Learn more</translate>
</v-btn>
<v-btn
v-else
depressed
color="primary-button"
class="white--text action-upgrade compact"
@click.stop="upgrade"
>
<v-btn v-else depressed color="primary-button" class="white--text action-upgrade compact" @click.stop="upgrade">
<translate>Upgrade Now</translate>
</v-btn>
</v-flex>

View File

@@ -1,14 +1,5 @@
<template>
<v-dialog
:value="show"
fullscreen
hide-overlay
scrollable
lazy
persistent
class="p-upload-dialog"
@keydown.esc="cancel"
>
<v-dialog :value="show" fullscreen hide-overlay scrollable lazy persistent class="p-upload-dialog" @keydown.esc="cancel">
<v-card color="application">
<v-toolbar dark flat color="navigation" :dense="$vuetify.breakpoint.smAndDown">
<v-btn icon dark @click.stop="cancel">
@@ -20,13 +11,7 @@
</v-toolbar>
<v-container grid-list-xs ext-xs-left fluid>
<v-form ref="form" class="p-photo-upload" lazy-validation dense @submit.prevent="submit">
<input
ref="upload"
type="file"
multiple
class="d-none input-upload"
@change.stop="onUpload()"
/>
<input ref="upload" type="file" multiple class="d-none input-upload" @change.stop="onUpload()" />
<v-container fluid>
<p class="subheading">
@@ -52,82 +37,46 @@
<v-list-tile>
<v-list-tile-content>
<v-list-tile-title>
<translate key="Press enter to create a new album."
>Press enter to create a new album.</translate
>
<translate key="Press enter to create a new album.">Press enter to create a new album.</translate>
</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</template>
<template #selection="data">
<v-chip
:key="JSON.stringify(data.item)"
:selected="data.selected"
:disabled="data.disabled"
class="v-chip--select-multi"
@input="data.parent.selectItem(data.item)"
>
<v-chip :key="JSON.stringify(data.item)" :selected="data.selected" :disabled="data.disabled" class="v-chip--select-multi" @input="data.parent.selectItem(data.item)">
<v-icon class="pr-1">bookmark</v-icon>
{{ data.item.Title ? data.item.Title : data.item | truncate(40) }}
</v-chip>
</template>
</v-combobox>
<span v-else-if="failed"
><translate key="Upload failed">Upload failed</translate></span
>
<span v-else-if="failed"><translate key="Upload failed">Upload failed</translate></span>
<span v-else-if="total > 0 && completedTotal < 100">
<translate :translate-params="{ n: current, t: total }"
>Uploading %{n} of %{t}</translate
>
<translate :translate-params="{ n: current, t: total }">Uploading %{n} of %{t}</translate>
</span>
<span v-else-if="indexing"
><translate key="Upload complete">Upload complete. Indexing</translate></span
>
<span v-else-if="completedTotal === 100"
><translate key="Done">Done.</translate></span
>
<span v-else-if="indexing"><translate key="Upload complete">Upload complete. Indexing</translate></span>
<span v-else-if="completedTotal === 100"><translate key="Done">Done.</translate></span>
</p>
<v-progress-linear
v-model="completedTotal"
height="1.5em"
color="secondary-dark"
:indeterminate="indexing"
>
<v-progress-linear v-model="completedTotal" height="1.5em" color="secondary-dark" :indeterminate="indexing">
<p class="px-2 ma-0 text-xs-right opacity-85"
><span v-if="eta">{{ eta }}</span></p
>
</v-progress-linear>
<p v-if="isDemo" class="body-2">
<translate :translate-params="{ n: fileLimit }"
>You can upload up to %{n} files for test purposes.</translate
>
<translate
>Please do not upload any private, unlawful or offensive pictures.
</translate>
<translate :translate-params="{ n: fileLimit }">You can upload up to %{n} files for test purposes.</translate>
<translate>Please do not upload any private, unlawful or offensive pictures. </translate>
</p>
<p v-else-if="rejectNSFW" class="body-2">
<translate>Please don't upload photos containing offensive content.</translate>
<translate
>Uploads that may contain such images will be rejected automatically.</translate
>
<translate>Uploads that may contain such images will be rejected automatically.</translate>
</p>
<p v-if="featReview" class="body-1">
<translate
>Non-photographic and low-quality images require a review before they appear in
search results.</translate
>
<translate>Non-photographic and low-quality images require a review before they appear in search results.</translate>
</p>
<v-btn
:disabled="busy"
color="primary-button"
class="white--text ml-0 mt-2 action-upload"
depressed
@click.stop="onUploadDialog()"
>
<v-btn :disabled="busy" color="primary-button" class="white--text ml-0 mt-2 action-upload" depressed @click.stop="onUploadDialog()">
<translate key="Upload">Upload</translate>
<v-icon :right="!rtl" :left="rtl" dark>cloud_upload</v-icon>
</v-btn>

View File

@@ -1,22 +1,6 @@
<template>
<div
v-if="show"
class="video-viewer"
role="dialog"
@click.stop.prevent="onClose"
@keydown.esc.stop.prevent="onClose"
>
<p-video-player
v-show="show"
ref="player"
:source="source"
:poster="poster"
:height="height"
:width="width"
:autoplay="true"
:loop="loop"
@close="onClose"
></p-video-player>
<div v-if="show" class="video-viewer" role="dialog" @click.stop.prevent="onClose" @keydown.esc.stop.prevent="onClose">
<p-video-player v-show="show" ref="player" :source="source" :poster="poster" :height="height" :width="width" :autoplay="true" :loop="loop" @close="onClose"></p-video-player>
</div>
</template>
<script>

View File

@@ -19,20 +19,7 @@
</v-card-text>
<v-card-text class="pa-2 body-1">
<v-text-field
autocorrect="off"
autocapitalize="none"
browser-autocomplete="off"
hide-details
readonly
single-line
outline
color="secondary-dark"
:value="webdavUrl()"
class="input-url"
@click.stop="selectText($event)"
>
</v-text-field>
<v-text-field autocorrect="off" autocapitalize="none" browser-autocomplete="off" hide-details readonly single-line outline color="secondary-dark" :value="webdavUrl()" class="input-url" @click.stop="selectText($event)"> </v-text-field>
</v-card-text>
<v-card-text class="pa-2 body-1 clickable" @click="windowsHelp($event)">
@@ -40,43 +27,16 @@
</v-card-text>
<v-card-text class="pa-2 body-1">
<v-text-field
autocorrect="off"
autocapitalize="none"
browser-autocomplete="off"
hide-details
readonly
single-line
outline
color="secondary-dark"
:value="windowsUrl()"
class="input-url"
@click.stop="selectText($event)"
>
</v-text-field>
<v-text-field autocorrect="off" autocapitalize="none" browser-autocomplete="off" hide-details readonly single-line outline color="secondary-dark" :value="windowsUrl()" class="input-url" @click.stop="selectText($event)"> </v-text-field>
</v-card-text>
<v-card-text class="pa-2 body-1">
<translate
>This mounts the originals folder as a network drive and allows you to open, edit, and
delete files from your computer or smartphone as if they were local.</translate
>
<translate>This mounts the originals folder as a network drive and allows you to open, edit, and delete files from your computer or smartphone as if they were local.</translate>
</v-card-text>
<v-card-text class="pa-2 body-1">
<v-alert
:value="true"
color="primary darken-2"
icon="info"
class="pa-2"
type="info"
outline
>
<a
style="color: inherit"
href="https://docs.photoprism.app/user-guide/sync/webdav/"
target="_blank"
>
<v-alert :value="true" color="primary darken-2" icon="info" class="pa-2" type="info" outline>
<a style="color: inherit" href="https://docs.photoprism.app/user-guide/sync/webdav/" target="_blank">
<translate>Detailed instructions can be found in our User Guide.</translate>
</a>
</v-alert>
@@ -153,10 +113,7 @@ export default {
return baseUrl;
},
windowsHelp(ev) {
window.open(
"https://docs.photoprism.app/user-guide/sync/webdav/#connect-to-a-webdav-server",
"_blank"
);
window.open("https://docs.photoprism.app/user-guide/sync/webdav/#connect-to-a-webdav-server", "_blank");
ev.preventDefault();
ev.stopPropagation();
},

View File

@@ -85,9 +85,7 @@ export class ConfigOptions extends Model {
}
save() {
return Api.post("config/options", this.getValues(true)).then((response) =>
Promise.resolve(this.setValues(response.data))
);
return Api.post("config/options", this.getValues(true)).then((response) => Promise.resolve(this.setValues(response.data)));
}
}

View File

@@ -199,11 +199,7 @@ export class File extends RestModel {
}
isAnimated() {
return (
this.MediaType &&
this.MediaType === MediaImage &&
((this.Frames && this.Frames > 1) || (this.Duration && this.Duration > 1))
);
return this.MediaType && this.MediaType === MediaImage && ((this.Frames && this.Frames > 1) || (this.Duration && this.Duration > 1));
}
typeInfo() {

View File

@@ -106,9 +106,7 @@ export default class Link extends Model {
}
expires() {
return DateTime.fromISO(this.ModifiedAt)
.plus({ seconds: this.Expires })
.toLocaleString(DateTime.DATE_MED);
return DateTime.fromISO(this.ModifiedAt).plus({ seconds: this.Expires }).toLocaleString(DateTime.DATE_MED);
}
static getCollectionResource() {

View File

@@ -116,15 +116,11 @@ export class Marker extends RestModel {
const payload = { SubjSrc: this.SubjSrc, Name: this.Name };
return Api.put(this.getEntityResource(), payload).then((resp) =>
Promise.resolve(this.setValues(resp.data))
);
return Api.put(this.getEntityResource(), payload).then((resp) => Promise.resolve(this.setValues(resp.data)));
}
clearSubject() {
return Api.delete(this.getEntityResource(this.getId()) + "/subject").then((r) =>
Promise.resolve(this.setValues(r.data))
);
return Api.delete(this.getEntityResource(this.getId()) + "/subject").then((r) => Promise.resolve(this.setValues(r.data)));
}
static batchSize() {

View File

@@ -199,18 +199,10 @@ export class Photo extends RestModel {
}
classes() {
return this.generateClasses(
this.isPlayable(),
Clipboard.has(this),
this.Portrait,
this.Favorite,
this.Private,
this.isStack()
);
return this.generateClasses(this.isPlayable(), Clipboard.has(this), this.Portrait, this.Favorite, this.Private, this.isStack());
}
generateClasses = memoizeOne(
(isPlayable, isInClipboard, portrait, favorite, isPrivate, isStack) => {
generateClasses = memoizeOne((isPlayable, isInClipboard, portrait, favorite, isPrivate, isStack) => {
let classes = ["is-photo", "uid-" + this.UID, "type-" + this.Type];
if (isPlayable) classes.push("is-playable");
@@ -221,8 +213,7 @@ export class Photo extends RestModel {
if (isStack) classes.push("is-stack");
return classes;
}
);
});
localDayString() {
if (!this.TakenAtLocal) {
@@ -593,9 +584,7 @@ export class Photo extends RestModel {
file = files.find((f) => f.MediaType === MediaImage && f.Root === "/");
break;
case MediaLive:
file = files.find(
(f) => (f.MediaType === MediaVideo || f.MediaType === MediaLive) && f.Root === "/"
);
file = files.find((f) => (f.MediaType === MediaVideo || f.MediaType === MediaLive) && f.Root === "/");
break;
case MediaRaw:
case MediaVideo:
@@ -670,18 +659,10 @@ export class Photo extends RestModel {
}
thumbnailUrl(size) {
return this.generateThumbnailUrl(
this.mainFileHash(),
this.videoFile(),
config.staticUri,
config.contentUri,
config.previewToken,
size
);
return this.generateThumbnailUrl(this.mainFileHash(), this.videoFile(), config.staticUri, config.contentUri, config.previewToken, size);
}
generateThumbnailUrl = memoizeOne(
(mainFileHash, videoFile, staticUri, contentUri, previewToken, size) => {
generateThumbnailUrl = memoizeOne((mainFileHash, videoFile, staticUri, contentUri, previewToken, size) => {
let hash = mainFileHash;
if (!hash) {
@@ -693,8 +674,7 @@ export class Photo extends RestModel {
}
return `${contentUri}/t/${hash}/${previewToken}/${size}`;
}
);
});
getDownloadUrl() {
return `${config.apiUri}/dl/${this.mainFileHash()}?t=${config.downloadToken}`;
@@ -781,14 +761,7 @@ export class Photo extends RestModel {
}
getDateString(showTimeZone) {
return this.generateDateString(
showTimeZone,
this.TakenAt,
this.Year,
this.Month,
this.Day,
this.TimeZone
);
return this.generateDateString(showTimeZone, this.TakenAt, this.Year, this.Month, this.Day, this.TimeZone);
}
generateDateString = memoizeOne((showTimeZone, takenAt, year, month, day, timeZone) => {
@@ -949,13 +922,7 @@ export class Photo extends RestModel {
// Example: Apple iPhone 12 Pro Max, DNG, 4032 × 3024, 32.9 MB
getPhotoInfo = () => {
let file = this.originalFile() || this.videoFile();
return this.generatePhotoInfo(
this.Camera,
this.CameraID,
this.CameraMake,
this.CameraModel,
file
);
return this.generatePhotoInfo(this.Camera, this.CameraID, this.CameraMake, this.CameraModel, file);
};
generatePhotoInfo = memoizeOne((camera, cameraId, cameraMake, cameraModel, file) => {
@@ -992,28 +959,14 @@ export class Photo extends RestModel {
// Example: iPhone 12 Pro Max 5.1mm ƒ/1.6, 26mm, ISO32, 1/4525
getLensInfo = () => {
return this.generateLensInfo(
this.Lens,
this.LensID,
this.LensMake,
this.LensModel,
this.CameraModel,
this.FNumber,
this.Iso,
this.Exposure,
this.FocalLength
);
return this.generateLensInfo(this.Lens, this.LensID, this.LensMake, this.LensModel, this.CameraModel, this.FNumber, this.Iso, this.Exposure, this.FocalLength);
};
generateLensInfo = memoizeOne(
(lens, lensId, lensMake, lensModel, cameraModel, fNumber, iso, exposure, focalLength) => {
generateLensInfo = memoizeOne((lens, lensId, lensMake, lensModel, cameraModel, fNumber, iso, exposure, focalLength) => {
let info = [];
const id = lensId ? lensId : lens && lens.ID ? lens.ID : 1;
const make = lensMake ? lensMake : lens && lens.Make ? lens.Make : "";
const model = (lensModel ? lensModel : lens && lens.Model ? lens.Model : "").replace(
"f/",
"ƒ/"
);
const model = (lensModel ? lensModel : lens && lens.Model ? lens.Model : "").replace("f/", "ƒ/");
// Example: EF-S18-55mm f/3.5-5.6 IS STM
if (id > 1) {
@@ -1047,8 +1000,7 @@ export class Photo extends RestModel {
}
return info.join(", ");
}
);
});
getCamera() {
if (this.Camera) {
@@ -1088,21 +1040,15 @@ export class Photo extends RestModel {
}
primaryFile(fileUID) {
return Api.post(`${this.getEntityResource()}/files/${fileUID}/primary`).then((r) =>
Promise.resolve(this.setValues(r.data))
);
return Api.post(`${this.getEntityResource()}/files/${fileUID}/primary`).then((r) => Promise.resolve(this.setValues(r.data)));
}
unstackFile(fileUID) {
return Api.post(`${this.getEntityResource()}/files/${fileUID}/unstack`).then((r) =>
Promise.resolve(this.setValues(r.data))
);
return Api.post(`${this.getEntityResource()}/files/${fileUID}/unstack`).then((r) => Promise.resolve(this.setValues(r.data)));
}
deleteFile(fileUID) {
return Api.delete(`${this.getEntityResource()}/files/${fileUID}`).then((r) =>
Promise.resolve(this.setValues(r.data))
);
return Api.delete(`${this.getEntityResource()}/files/${fileUID}`).then((r) => Promise.resolve(this.setValues(r.data)));
}
changeFileOrientation(file) {
@@ -1120,9 +1066,7 @@ export class Photo extends RestModel {
}
// Change file orientation.
return Api.put(`${this.getEntityResource()}/files/${file.UID}/orientation`, values).then((r) =>
Promise.resolve(this.setValues(r.data))
);
return Api.put(`${this.getEntityResource()}/files/${file.UID}/orientation`, values).then((r) => Promise.resolve(this.setValues(r.data)));
}
like() {
@@ -1136,27 +1080,19 @@ export class Photo extends RestModel {
}
addLabel(name) {
return Api.post(this.getEntityResource() + "/label", { Name: name, Priority: 10 }).then((r) =>
Promise.resolve(this.setValues(r.data))
);
return Api.post(this.getEntityResource() + "/label", { Name: name, Priority: 10 }).then((r) => Promise.resolve(this.setValues(r.data)));
}
activateLabel(id) {
return Api.put(this.getEntityResource() + "/label/" + id, { Uncertainty: 0 }).then((r) =>
Promise.resolve(this.setValues(r.data))
);
return Api.put(this.getEntityResource() + "/label/" + id, { Uncertainty: 0 }).then((r) => Promise.resolve(this.setValues(r.data)));
}
renameLabel(id, name) {
return Api.put(this.getEntityResource() + "/label/" + id, { Label: { Name: name } }).then((r) =>
Promise.resolve(this.setValues(r.data))
);
return Api.put(this.getEntityResource() + "/label/" + id, { Label: { Name: name } }).then((r) => Promise.resolve(this.setValues(r.data)));
}
removeLabel(id) {
return Api.delete(this.getEntityResource() + "/label/" + id).then((r) =>
Promise.resolve(this.setValues(r.data))
);
return Api.delete(this.getEntityResource() + "/label/" + id).then((r) => Promise.resolve(this.setValues(r.data)));
}
getMarkers(valid) {
@@ -1198,25 +1134,11 @@ export class Photo extends RestModel {
values.PlaceSrc = src.Manual;
}
if (
values.TakenAt ||
values.TakenAtLocal ||
values.TimeZone ||
values.Day ||
values.Month ||
values.Year
) {
if (values.TakenAt || values.TakenAtLocal || values.TimeZone || values.Day || values.Month || values.Year) {
values.TakenSrc = src.Manual;
}
if (
values.CameraID ||
values.LensID ||
values.FocalLength ||
values.FNumber ||
values.Iso ||
values.Exposure
) {
if (values.CameraID || values.LensID || values.FocalLength || values.FNumber || values.Iso || values.Exposure) {
values.CameraSrc = src.Manual;
}

View File

@@ -51,9 +51,7 @@ export class Rest extends Model {
}
find(id, params) {
return Api.get(this.getEntityResource(id), params).then((resp) =>
Promise.resolve(new this.constructor(resp.data))
);
return Api.get(this.getEntityResource(id), params).then((resp) => Promise.resolve(new this.constructor(resp.data)));
}
load() {
@@ -61,9 +59,7 @@ export class Rest extends Model {
return;
}
return Api.get(this.getEntityResource(this.getId())).then((resp) =>
Promise.resolve(this.setValues(resp.data))
);
return Api.get(this.getEntityResource(this.getId())).then((resp) => Promise.resolve(this.setValues(resp.data)));
}
save() {
@@ -71,9 +67,7 @@ export class Rest extends Model {
return this.update();
}
return Api.post(this.constructor.getCollectionResource(), this.getValues()).then((resp) =>
Promise.resolve(this.setValues(resp.data))
);
return Api.post(this.constructor.getCollectionResource(), this.getValues()).then((resp) => Promise.resolve(this.setValues(resp.data)));
}
update() {
@@ -86,9 +80,7 @@ export class Rest extends Model {
}
// Send PUT request.
return Api.put(this.getEntityResource(), values).then((resp) =>
Promise.resolve(this.setValues(resp.data))
);
return Api.put(this.getEntityResource(), values).then((resp) => Promise.resolve(this.setValues(resp.data)));
}
remove() {
@@ -96,9 +88,7 @@ export class Rest extends Model {
}
getEditForm() {
return Api.options(this.getEntityResource()).then((resp) =>
Promise.resolve(new Form(resp.data))
);
return Api.options(this.getEntityResource()).then((resp) => Promise.resolve(new Form(resp.data)));
}
getEntityResource(id) {
@@ -134,15 +124,11 @@ export class Rest extends Model {
values["Password"] = link.Password;
}
return Api.put(this.getEntityResource() + "/links/" + link.getId(), values).then((resp) =>
Promise.resolve(link.setValues(resp.data))
);
return Api.put(this.getEntityResource() + "/links/" + link.getId(), values).then((resp) => Promise.resolve(link.setValues(resp.data)));
}
removeLink(link) {
return Api.delete(this.getEntityResource() + "/links/" + link.getId()).then((resp) =>
Promise.resolve(link.setValues(resp.data))
);
return Api.delete(this.getEntityResource() + "/links/" + link.getId()).then((resp) => Promise.resolve(link.setValues(resp.data)));
}
links() {
@@ -172,9 +158,7 @@ export class Rest extends Model {
}
static getCreateForm() {
return Api.options(this.getCreateResource()).then((resp) =>
Promise.resolve(new Form(resp.data))
);
return Api.options(this.getCreateResource()).then((resp) => Promise.resolve(new Form(resp.data)));
}
static getModelName() {
@@ -182,9 +166,7 @@ export class Rest extends Model {
}
static getSearchForm() {
return Api.options(this.getCollectionResource()).then((resp) =>
Promise.resolve(new Form(resp.data))
);
return Api.options(this.getCollectionResource()).then((resp) => Promise.resolve(new Form(resp.data)));
}
static limit() {

View File

@@ -71,9 +71,7 @@ export class Service extends RestModel {
}
Folders() {
return Api.get(this.getEntityResource() + "/folders").then((response) =>
Promise.resolve(response.data)
);
return Api.get(this.getEntityResource() + "/folders").then((response) => Promise.resolve(response.data));
}
Upload(selection, folder) {
@@ -85,9 +83,7 @@ export class Service extends RestModel {
selection = { Photos: selection };
}
return Api.post(this.getEntityResource() + "/upload", { selection, folder }).then((response) =>
Promise.resolve(response.data)
);
return Api.post(this.getEntityResource() + "/upload", { selection, folder }).then((response) => Promise.resolve(response.data));
}
static getCollectionResource() {

View File

@@ -54,9 +54,7 @@ export class Settings extends Model {
}
save() {
return Api.post("settings", this.getValues(true)).then((response) =>
Promise.resolve(this.setValues(response.data))
);
return Api.post("settings", this.getValues(true)).then((response) => Promise.resolve(this.setValues(response.data)));
}
}

View File

@@ -29,6 +29,8 @@ import Util from "common/util";
import Api from "common/api";
import { T, $gettext } from "common/vm";
import { config } from "app/session";
import memoizeOne from "memoize-one";
import * as auth from "../options/auth";
export class User extends RestModel {
getDefaults() {
@@ -37,6 +39,7 @@ export class User extends RestModel {
UID: "",
UUID: "",
AuthProvider: "",
AuthMethod: "",
AuthID: "",
Name: "",
DisplayName: "",
@@ -170,9 +173,7 @@ export class User extends RestModel {
}
getRegisterForm() {
return Api.options(this.getEntityResource() + "/register").then((response) =>
Promise.resolve(new Form(response.data))
);
return Api.options(this.getEntityResource() + "/register").then((response) => Promise.resolve(new Form(response.data)));
}
getAvatarURL(size) {
@@ -200,21 +201,56 @@ export class User extends RestModel {
formData.append("files", file);
return Api.post(this.getEntityResource() + `/avatar`, formData, formConf).then((response) =>
Promise.resolve(this.setValues(response.data))
);
return Api.post(this.getEntityResource() + `/avatar`, formData, formConf).then((response) => Promise.resolve(this.setValues(response.data)));
}
getProfileForm() {
return Api.options(this.getEntityResource() + "/profile").then((response) =>
Promise.resolve(new Form(response.data))
);
return Api.options(this.getEntityResource() + "/profile").then((response) => Promise.resolve(new Form(response.data)));
}
isRemote() {
return this.AuthProvider && this.AuthProvider === "ldap";
}
disable2FA() {
switch (this.AuthProvider) {
case "default":
return false;
case "local":
return false;
case "ldap":
return false;
default:
return true;
}
}
authInfo() {
if (!this || !this.AuthProvider) {
return $gettext("Default");
}
let providerName = memoizeOne(auth.Providers)()[this.AuthProvider];
if (providerName) {
providerName = T(providerName);
} else {
providerName = Util.capitalize(this.AuthProvider);
}
if (!this.AuthMethod || this.AuthMethod === "" || this.AuthMethod === "default") {
return providerName;
}
let methodName = memoizeOne(auth.Methods)()[this.AuthMethod];
if (!methodName) {
methodName = this.AuthMethod;
}
return `${providerName} (${methodName})`;
}
changePassword(oldPassword, newPassword) {
return Api.put(this.getEntityResource() + "/password", {
old: oldPassword,
@@ -222,6 +258,33 @@ export class User extends RestModel {
}).then((response) => Promise.resolve(response.data));
}
createPasscode(password) {
return Api.post(this.getEntityResource() + "/passcode", {
type: "totp",
password: password,
}).then((response) => Promise.resolve(response.data));
}
confirmPasscode(passcode) {
return Api.post(this.getEntityResource() + "/passcode/confirm", {
type: "totp",
passcode: passcode,
}).then((response) => Promise.resolve(response.data));
}
activatePasscode() {
return Api.post(this.getEntityResource() + "/passcode/activate", {
type: "totp",
}).then((response) => Promise.resolve(response.data));
}
deactivatePasscode(password) {
return Api.post(this.getEntityResource() + "/passcode/deactivate", {
type: "totp",
password: password,
}).then((response) => Promise.resolve(response.data));
}
static getCollectionResource() {
return "users";
}

View File

@@ -42,7 +42,7 @@ export const Methods = () => {
client: $gettext("Client"),
access_token: $gettext("Access Token"),
oauth2: "OAuth2",
totp: "TOTP/2FA",
"2fa": $gettext("2FA"),
oidc: "OIDC",
};
};

View File

@@ -2,14 +2,7 @@ import { timeZonesNames } from "@vvo/tzdb";
import { $gettext } from "common/vm";
import { Info } from "luxon";
import { config } from "app/session";
import {
MediaImage,
MediaLive,
MediaVideo,
MediaAnimated,
MediaVector,
MediaRaw,
} from "model/photo";
import { MediaImage, MediaLive, MediaVideo, MediaAnimated, MediaVector, MediaRaw } from "model/photo";
export const UtcOffsets = [
{ ID: "UTC-12", Name: "UTC-12:00" },
@@ -39,8 +32,7 @@ export const UtcOffsets = [
{ ID: "UTC+12", Name: "UTC+12:00" },
];
export const TimeZones = () =>
[{ ID: "", Name: $gettext("Local Time") }].concat(UtcOffsets).concat(timeZonesNames);
export const TimeZones = () => [{ ID: "", Name: $gettext("Local Time") }].concat(UtcOffsets).concat(timeZonesNames);
export const Days = () => {
let result = [];

View File

@@ -1,9 +1,7 @@
<template>
<div class="p-page p-page-about">
<v-toolbar flat color="secondary" :dense="$vuetify.breakpoint.smAndDown">
<v-toolbar-title>
{{ $config.getAbout() }}{{ getMembership() }}
</v-toolbar-title>
<v-toolbar-title> {{ $config.getAbout() }}{{ getMembership() }} </v-toolbar-title>
<v-spacer></v-spacer>
@@ -22,32 +20,23 @@
</p>
<template v-if="canUpgrade">
<h3 class="subheading py-2"><translate>PhotoPrism+ Membership</translate></h3>
<h3 class="subheading py-2">
<translate>PhotoPrism+ Membership</translate>
</h3>
<p class="text-selectable">
<span v-if="tier < 4"><translate>Become a member today, support our mission and enjoy our member benefits!</translate></span>
<translate>Your continued support helps us provide regular updates and remain independent, so we can fulfill our mission and protect your privacy.</translate>
<translate>Being 100% self-funded and independent, we can promise you that we will never sell your data and that we will always be transparent about our software and services.</translate>
</p>
<p v-if="isSuperAdmin" class="text-xs-center my-4">
<v-btn
to="/upgrade"
color="primary-button"
class="white--text px-3 py-2 action-membership"
round depressed
>
<v-btn to="/upgrade" color="primary-button" class="white--text px-3 py-2 action-membership" round depressed>
<translate>Upgrade Now</translate>
<v-icon v-if="rtl" left dark>navigate_before</v-icon>
<v-icon v-else right dark>navigate_next</v-icon>
</v-btn>
</p>
<p v-else class="text-xs-center my-4">
<v-btn
href="https://link.photoprism.app/membership"
target="_blank"
color="primary-button"
class="white--text px-3 py-2 action-membership"
round depressed
>
<v-btn href="https://link.photoprism.app/membership" target="_blank" color="primary-button" class="white--text px-3 py-2 action-membership" round depressed>
<translate>Learn more</translate>
<v-icon v-if="rtl" left dark>navigate_before</v-icon>
<v-icon v-else right dark>navigate_next</v-icon>
@@ -62,12 +51,7 @@
<translate>You are welcome to contact us at membership@photoprism.app for questions regarding your membership.</translate>
</p>
<p class="text-xs-center my-4">
<v-btn
href="https://my.photoprism.app/dashboard" target="_blank"
color="primary-button"
class="white--text px-3 py-2 action-membership"
round depressed
>
<v-btn href="https://my.photoprism.app/dashboard" target="_blank" color="primary-button" class="white--text px-3 py-2 action-membership" round depressed>
<translate>Manage Account</translate>
<v-icon v-if="rtl" left dark>navigate_before</v-icon>
<v-icon v-else right dark>navigate_next</v-icon>
@@ -78,60 +62,69 @@
<div class="text-columns py-2">
<h3 class="subheading pb-2"> Getting Started </h3>
<p class="text-selectable">
Follow our <a href="https://docs.photoprism.app/user-guide/first-steps/" class="text-link" target="_blank">First Steps 👣</a> tutorial to learn how to navigate the user interface and ensure your library is indexed according to your individual preferences.
Additional help and product-specific information can be found in our <a href="https://www.photoprism.app/plus/kb" class="text-link" target="_blank">Knowledge Base</a>.
Follow our <a href="https://docs.photoprism.app/user-guide/first-steps/" class="text-link" target="_blank">First Steps 👣</a> tutorial to learn how to navigate the user interface and ensure your library is indexed according to your individual preferences. Additional help and
product-specific information can be found in our <a href="https://www.photoprism.app/plus/kb" class="text-link" target="_blank">Knowledge Base</a>.
</p>
<h3 class="subheading pb-2"> User Guide </h3>
<p>
Visit <a href="https://link.photoprism.app/docs" class="text-link" target="_blank">docs.photoprism.app/user-guide</a> to learn how to sync, organize, and share your pictures. Our <a href="https://docs.photoprism.app/user-guide/" class="text-link" target="_blank">User Guide</a> also covers many advanced topics, such as <a href="https://docs.photoprism.app/user-guide/use-cases/google/" class="text-link" target="_blank">migrating from Google Photos</a> and <a href="https://docs.photoprism.app/user-guide/settings/advanced/#images" class="text-link" target="_blank">thumbnail quality settings</a>.
Common issues can be quickly diagnosed and solved using the troubleshooting checklists we provide at <a href="https://docs.photoprism.app/getting-started/troubleshooting/" class="text-link" target="_blank">docs.photoprism.app/getting-started/troubleshooting</a>.
Visit <a href="https://link.photoprism.app/docs" class="text-link" target="_blank">docs.photoprism.app/user-guide</a> to learn how to sync, organize, and share your pictures. Our <a href="https://docs.photoprism.app/user-guide/" class="text-link" target="_blank">User Guide</a> also covers
many advanced topics, such as <a href="https://docs.photoprism.app/user-guide/use-cases/google/" class="text-link" target="_blank">migrating from Google Photos</a> and
<a href="https://docs.photoprism.app/user-guide/settings/advanced/#images" class="text-link" target="_blank">thumbnail quality settings</a>. Common issues can be quickly diagnosed and solved using the troubleshooting checklists we provide at
<a href="https://docs.photoprism.app/getting-started/troubleshooting/" class="text-link" target="_blank">docs.photoprism.app/getting-started/troubleshooting</a>.
</p>
<h3 class="subheading pb-2"> Getting Support </h3>
<p>Before reporting a bug, please use our <a href="https://docs.photoprism.app/getting-started/troubleshooting/" class="text-link" target="_blank">Troubleshooting Checklists</a>
to determine the cause of your problem. If you have a general question, need help, it could be a local configuration
issue, or a misunderstanding in how the software works, you are welcome to ask in our <a href="https://link.photoprism.app/chat" class="text-link" target="_blank">Community Chat</a>
or post your question in <a href="https://link.photoprism.app/discussions" class="text-link" target="_blank">GitHub Discussions</a>.</p>
<p>When reporting a problem, always include the software versions you are using and <a href="https://www.photoprism.app/kb/reporting-bugs" class="text-link" target="_blank">other information about your environment</a>
such as <a href="https://docs.photoprism.app/getting-started/troubleshooting/browsers/" class="text-link" target="_blank">browser, browser plugins</a>, operating system, storage type,
memory size, and processor.</p>
<p
>Before reporting a bug, please use our <a href="https://docs.photoprism.app/getting-started/troubleshooting/" class="text-link" target="_blank">Troubleshooting Checklists</a> to determine the cause of your problem. If you have a general question, need help, it could be a local
configuration issue, or a misunderstanding in how the software works, you are welcome to ask in our <a href="https://link.photoprism.app/chat" class="text-link" target="_blank">Community Chat</a> or post your question in
<a href="https://link.photoprism.app/discussions" class="text-link" target="_blank">GitHub Discussions</a>.</p
>
<p
>When reporting a problem, always include the software versions you are using and <a href="https://www.photoprism.app/kb/reporting-bugs" class="text-link" target="_blank">other information about your environment</a> such as
<a href="https://docs.photoprism.app/getting-started/troubleshooting/browsers/" class="text-link" target="_blank">browser, browser plugins</a>, operating system, storage type, memory size, and processor.</p
>
<p>We kindly ask you not to report bugs via GitHub Issues unless you are certain to have found a fully reproducible and previously unreported issue that must be fixed directly in the app.</p>
<h3 class="subheading pb-2"> Developer Guide </h3>
<p>Our <a href="https://docs.photoprism.app/developer-guide/" class="text-link" target="_blank">Developer Guide</a> contains all the information you need to get started as a developer. It guides you from <a href="https://docs.photoprism.app/developer-guide/setup/" class="text-link" target="_blank">setting up your development environment</a> and <a href="https://docs.photoprism.app/developer-guide/pull-requests/" class="text-link" target="_blank">creating pull requests</a> to <a href="https://docs.photoprism.app/developer-guide/tests/" class="text-link" target="_blank">running tests</a> and <a href="https://docs.photoprism.app/developer-guide/translations-weblate/" class="text-link" target="_blank">adding translations</a>. Multiple subsections provide details on specific features and links to external resources for further information.</p>
<p
>Our <a href="https://docs.photoprism.app/developer-guide/" class="text-link" target="_blank">Developer Guide</a> contains all the information you need to get started as a developer. It guides you from
<a href="https://docs.photoprism.app/developer-guide/setup/" class="text-link" target="_blank">setting up your development environment</a> and <a href="https://docs.photoprism.app/developer-guide/pull-requests/" class="text-link" target="_blank">creating pull requests</a> to
<a href="https://docs.photoprism.app/developer-guide/tests/" class="text-link" target="_blank">running tests</a> and <a href="https://docs.photoprism.app/developer-guide/translations-weblate/" class="text-link" target="_blank">adding translations</a>. Multiple subsections provide details
on specific features and links to external resources for further information.</p
>
<h3 class="subheading pb-2"> Terms &amp; Privacy </h3>
<p>Visit <a href="https://www.photoprism.app/terms" class="text-link" target="_blank"><strong>photoprism.app/terms</strong></a> to learn how we work, what you can expect from us, and what we expect from you.
What information we collect, how we use it, and under what circumstances we share it is explained in our <a href="https://www.photoprism.app/privacy" class="text-link" target="_blank">Privacy Policy</a>.</p>
<p
>Visit <a href="https://www.photoprism.app/terms" class="text-link" target="_blank"><strong>photoprism.app/terms</strong></a> to learn how we work, what you can expect from us, and what we expect from you. What information we collect, how we use it, and under what circumstances we share it
is explained in our <a href="https://www.photoprism.app/privacy" class="text-link" target="_blank">Privacy Policy</a>.</p
>
<p>Read our <a href="https://www.photoprism.app/privacy/gdpr" class="text-link" target="_blank">GDPR Compliance Statement</a> to learn more about the rights you have as a resident of the European Economic Area ("EEA"), our ongoing commitment to user privacy, and the General Data Protection Regulation ("GDPR").</p>
<p
>Read our <a href="https://www.photoprism.app/privacy/gdpr" class="text-link" target="_blank">GDPR Compliance Statement</a> to learn more about the rights you have as a resident of the European Economic Area ("EEA"), our ongoing commitment to user privacy, and the General Data Protection
Regulation ("GDPR").</p
>
<p>Our <a href="https://www.photoprism.app/trademark" class="text-link" target="_blank">Trademark and Brand Guidelines</a>, which may be updated from time to time, describe how our brand assets may be used. It is important to us that any permitted use of our brand assets is fair and meets the highest standards.</p>
<p
>Our <a href="https://www.photoprism.app/trademark" class="text-link" target="_blank">Trademark and Brand Guidelines</a>, which may be updated from time to time, describe how our brand assets may be used. It is important to us that any permitted use of our brand assets is fair and meets
the highest standards.</p
>
</div>
<p class="text-xs-center pt-4 ma-0 pb-0">
<router-link to="/license">
<img :src="$config.staticUri + '/img/badge-agpl.svg'" alt="License AGPL v3" style="max-width:100%;"/>
<img :src="$config.staticUri + '/img/badge-agpl.svg'" alt="License AGPL v3" style="max-width: 100%" />
</router-link>
<a target="_blank" href="https://link.photoprism.app/chat" rel="nofollow"><img
:src="$config.staticUri + '/img/badge-chat.svg'" alt="Community Chat" style="max-width:100%;"></a>
<a target="_blank" href="https://link.photoprism.app/discussions" rel="nofollow"><img
:src="$config.staticUri + '/img/badge-ask-on-github.svg'" alt="GitHub Discussions" style="max-width:100%;"></a>
<a target="_blank" href="https://link.photoprism.app/pixls-us" rel="nofollow"><img
:src="$config.staticUri + '/img/badge-pixls-us.svg'" alt="PIXLS.US" style="max-width:100%;"></a>
<a target="_blank" href="https://link.photoprism.app/mastodon" rel="nofollow"><img
:src="$config.staticUri + '/img/badge-mastodon.svg'" alt="Twitter" style="max-width:100%;"></a>
<a target="_blank" href="https://link.photoprism.app/reddit" rel="nofollow"><img
:src="$config.staticUri + '/img/badge-reddit.svg'" alt="Reddit" style="max-width:100%;"></a>
<a target="_blank" href="https://link.photoprism.app/chat" rel="nofollow"><img :src="$config.staticUri + '/img/badge-chat.svg'" alt="Community Chat" style="max-width: 100%" /></a>
<a target="_blank" href="https://link.photoprism.app/discussions" rel="nofollow"><img :src="$config.staticUri + '/img/badge-ask-on-github.svg'" alt="GitHub Discussions" style="max-width: 100%" /></a>
<a target="_blank" href="https://link.photoprism.app/pixls-us" rel="nofollow"><img :src="$config.staticUri + '/img/badge-pixls-us.svg'" alt="PIXLS.US" style="max-width: 100%" /></a>
<a target="_blank" href="https://link.photoprism.app/mastodon" rel="nofollow"><img :src="$config.staticUri + '/img/badge-mastodon.svg'" alt="Twitter" style="max-width: 100%" /></a>
<a target="_blank" href="https://link.photoprism.app/reddit" rel="nofollow"><img :src="$config.staticUri + '/img/badge-reddit.svg'" alt="Reddit" style="max-width: 100%" /></a>
</p>
<p class="caption mt-4 text-xs-center">
PhotoPrism® is a <a href="https://www.photoprism.app/trademark" target="_blank" class="text-link">registered trademark</a>.
By using the software and services we provide, you agree to our
<a href="https://www.photoprism.app/terms" target="_blank" class="text-link">Terms of Service</a>,
<a href="https://www.photoprism.app/privacy" target="_blank" class="text-link">Privacy Policy</a>, and
<a href="https://www.photoprism.app/code-of-conduct" target="_blank" class="text-link">Code of Conduct</a>.
PhotoPrism® is a <a href="https://www.photoprism.app/trademark" target="_blank" class="text-link">registered trademark</a>. By using the software and services we provide, you agree to our <a href="https://www.photoprism.app/terms" target="_blank" class="text-link">Terms of Service</a>,
<a href="https://www.photoprism.app/privacy" target="_blank" class="text-link">Privacy Policy</a>, and <a href="https://www.photoprism.app/code-of-conduct" target="_blank" class="text-link">Code of Conduct</a>.
</p>
</v-container>
<p-about-footer></p-about-footer>
@@ -140,7 +133,7 @@
<script>
export default {
name: 'PPageAbout',
name: "PPageAbout",
data() {
const tier = this.$config.getTier();
const membership = this.$config.getMembership();
@@ -172,7 +165,7 @@ export default {
}
return "";
}
},
},
};
</script>

View File

@@ -18,12 +18,10 @@
<translate>We do our best to respond within five business days or less.</translate>
</p>
<p class="mt-4 text-xs-center">
<img src="https://cdn.photoprism.app/thank-you/colorful.png" width="100%" alt="THANK YOU">
<img src="https://cdn.photoprism.app/thank-you/colorful.png" width="100%" alt="THANK YOU" />
</p>
</v-container>
<v-form v-else ref="form" v-model="valid"
autocomplete="off"
class="pa-3" lazy-validation>
<v-form v-else ref="form" v-model="valid" autocomplete="off" class="pa-3" lazy-validation>
<v-layout row wrap>
<v-flex xs12 class="pa-2">
<v-select
@@ -33,42 +31,30 @@
:label="$gettext('Category')"
color="secondary-dark"
background-color="secondary-light"
flat solo hide-details required
flat
solo
hide-details
required
browser-autocomplete="off"
class="input-category"
:rules="[v => !!v || $gettext('Required')]"
:rules="[(v) => !!v || $gettext('Required')]"
></v-select>
</v-flex>
<v-flex xs12 class="pa-2">
<v-textarea v-model="form.Message" required auto-grow flat solo hide-details
browser-autocomplete="off" rows="10" :rules="[v => !!v || $gettext('Required')]"
:label="$gettext('How can we help?')"></v-textarea>
<v-textarea v-model="form.Message" required auto-grow flat solo hide-details browser-autocomplete="off" rows="10" :rules="[(v) => !!v || $gettext('Required')]" :label="$gettext('How can we help?')"></v-textarea>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-text-field v-model="form.UserName" flat solo hide-details
browser-autocomplete="off"
color="secondary-dark"
background-color="secondary-light" :label="$gettext('Name')" type="text">
</v-text-field>
<v-text-field v-model="form.UserName" flat solo hide-details browser-autocomplete="off" color="secondary-dark" background-color="secondary-light" :label="$gettext('Name')" type="text"> </v-text-field>
</v-flex>
<v-flex xs12 sm6 class="pa-2">
<v-text-field v-model="form.UserEmail" flat solo hide-details required
autocapitalize="none"
color="secondary-dark"
:rules="[v => !!v || $gettext('Required')]"
background-color="secondary-light" :label="$gettext('E-Mail')" type="email">
</v-text-field>
<v-text-field v-model="form.UserEmail" flat solo hide-details required autocapitalize="none" color="secondary-dark" :rules="[(v) => !!v || $gettext('Required')]" background-color="secondary-light" :label="$gettext('E-Mail')" type="email"> </v-text-field>
</v-flex>
<v-flex xs12 grow class="px-2 py-1">
<v-btn color="primary-button"
class="white--text ml-0"
depressed
:disabled="!form.Category || !form.Message || !form.UserEmail"
@click.stop="send">
<v-btn color="primary-button" class="white--text ml-0" depressed :disabled="!form.Category || !form.Message || !form.UserEmail" @click.stop="send">
<translate>Send</translate>
<v-icon :right="!rtl" :left="rtl" dark>send</v-icon>
</v-btn>
@@ -85,7 +71,7 @@ import * as options from "options/options";
import Api from "common/api";
export default {
name: 'PPageSupport',
name: "PPageSupport",
data() {
return {
sent: false,
@@ -113,7 +99,6 @@ export default {
} else {
this.$notify.error(this.$gettext("All fields are required"));
}
},
},
};

View File

@@ -8,690 +8,403 @@
<v-spacer></v-spacer>
<a target="_blank" href="https://www.gnu.org/licenses/agpl-3.0.en.html">
<img :src="$config.staticUri + '/img/agplv3-small.png'" alt="AGPLv3 Logo">
<img :src="$config.staticUri + '/img/agplv3-small.png'" alt="AGPLv3 Logo" />
</a>
</v-toolbar>
<v-container fluid class="pa-4 text-selectable">
<h3 style="text-align: center">GNU AFFERO GENERAL PUBLIC LICENSE</h3>
<p style="text-align: center">Version 3, 19 November 2007</p>
<h3 style="text-align: center;">GNU AFFERO GENERAL PUBLIC LICENSE</h3>
<p style="text-align: center;">Version 3, 19 November 2007</p>
<p>Copyright © 2007 Free Software Foundation,
Inc. &lt;<a target="_blank" href="https://fsf.org/">https://fsf.org/</a>&gt;
<br>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</p>
<p
>Copyright © 2007 Free Software Foundation, Inc. &lt;<a target="_blank" href="https://fsf.org/">https://fsf.org/</a>&gt;
<br />
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.</p
>
<h3><a name="preamble"></a>Preamble</h3>
<p>The GNU Affero General Public License is a free, copyleft license
for software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.</p>
<p>The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.</p>
<p>The licenses for most software and other practical works are
designed to take away your freedom to share and change the works. By
contrast, our General Public Licenses are intended to guarantee your
freedom to share and change all versions of a program--to make sure it
remains free software for all its users.</p>
<p
>The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software
for all its users.</p
>
<p>When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.</p>
<p
>When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that
you can change the software or use pieces of it in new free programs, and that you know you can do these things.</p
>
<p>Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.</p>
<p>Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.</p>
<p>A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.</p>
<p
>A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting
cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.</p
>
<p>The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.</p>
<p
>The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that
server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.</p
>
<p>An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.</p>
<p
>An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this
license.</p
>
<p>The precise terms and conditions for copying, distribution and
modification follow.</p>
<p>The precise terms and conditions for copying, distribution and modification follow.</p>
<h3><a name="terms"></a>TERMS AND CONDITIONS</h3>
<h4><a name="section0"></a>0. Definitions.</h4>
<p>"This License" refers to version 3 of the GNU Affero General Public
License.</p>
<p>"This License" refers to version 3 of the GNU Affero General Public License.</p>
<p>"Copyright" also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.</p>
<p>"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.</p>
<p>"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.</p>
<p>"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.</p>
<p>To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.</p>
<p>To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.</p>
<p>A "covered work" means either the unmodified Program or a work based
on the Program.</p>
<p>A "covered work" means either the unmodified Program or a work based on the Program.</p>
<p>To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.</p>
<p
>To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or
without modification), making available to the public, and in some countries other activities as well.</p
>
<p>To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.</p>
<p>To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.</p>
<p>An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.</p>
<p
>An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that
warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.</p
>
<h4><a name="section1"></a>1. Source Code.</h4>
<p>The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.</p>
<p>The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.</p>
<p>A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.</p>
<p>A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.</p>
<p>The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.</p>
<p
>The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or
to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work
runs, or a compiler used to produce the work, or an object code interpreter used to run it.</p
>
<p>The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.</p>
<p
>The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries,
or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for
shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.</p
>
<p>The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.</p>
<p>The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.</p>
<p>The Corresponding Source for a work in source code form is that
same work.</p>
<p>The Corresponding Source for a work in source code form is that same work.</p>
<h4><a name="section2"></a>2. Basic Permissions.</h4>
<p>All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.</p>
<p
>All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered
by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.</p
>
<p>You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.</p>
<p
>You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for
running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that
prohibit them from making any copies of your copyrighted material outside their relationship with you.</p
>
<p>Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.</p>
<p>Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.</p>
<h4><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
<p>No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.</p>
<p>No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.</p>
<p>When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.</p>
<p
>When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.</p
>
<h4><a name="section4"></a>4. Conveying Verbatim Copies.</h4>
<p>You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.</p>
<p
>You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in
accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.</p
>
<p>You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.</p>
<p>You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.</p>
<h4><a name="section5"></a>5. Conveying Modified Source Versions.</h4>
<p>You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:</p>
<p>You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:</p>
<ul>
<li>a) The work must carry prominent notices stating that you modified it, and giving a relevant date. </li>
<li>a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
</li>
<li>b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
</li>
<li>c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
</li>
<li>d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
<li>b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". </li>
<li
>c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged.
This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
</li>
<li>d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. </li>
</ul>
<p>A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.</p>
<p
>A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if
the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.</p
>
<h4><a name="section6"></a>6. Conveying Non-Source Forms.</h4>
<p>You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:</p>
<p>You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:</p>
<ul>
<li>a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. </li>
<li>a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
<li
>b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who
possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
</li>
<li>b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
</li>
<li>c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
</li>
<li>d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
</li>
<li>e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
<li>c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. </li>
<li
>d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with
the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to
find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
</li>
<li>e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. </li>
</ul>
<p>A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.</p>
<p>A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.</p>
<p>A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.</p>
<p
>A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses,
or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.</p
>
<p>"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.</p>
<p
>"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to
ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.</p
>
<p>If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).</p>
<p
>If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term
(regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the
User Product (for example, the work has been installed in ROM).</p
>
<p>The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.</p>
<p
>The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.</p
>
<p>Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.</p>
<p
>Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or
copying.</p
>
<h4><a name="section7"></a>7. Additional Terms.</h4>
<p>"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.</p>
<p
>"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are
valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.</p
>
<p>When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.</p>
<p
>When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on
material, added by you to a covered work, for which you have or can give appropriate copyright permission.</p
>
<p>Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:</p>
<p>Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:</p>
<ul>
<li>a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or </li>
<li>a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
<li>b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or </li>
<li>c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or </li>
<li>d) Limiting the use for publicity purposes of names of licensors or authors of the material; or </li>
<li>e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or </li>
<li
>f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and
authors.
</li>
<li>b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
</li>
<li>c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
</li>
<li>d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
</li>
<li>e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
</li>
<li>f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
</li>
</ul>
<p>All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further restriction,
you may remove that term. If a license document contains a further
restriction but permits relicensing or conveying under this License, you
may add to a covered work material governed by the terms of that license
document, provided that the further restriction does not survive such
relicensing or conveying.</p>
<p
>All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may
remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or
conveying.</p
>
<p>If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.</p>
<p>If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.</p>
<p>Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.</p>
<p>Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.</p>
<h4><a name="section8"></a>8. Termination.</h4>
<p>You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).</p>
<p
>You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of
section 11).</p
>
<p>However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.</p>
<p
>However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you
of the violation by some reasonable means prior to 60 days after the cessation.</p
>
<p>Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.</p>
<p
>Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you
cure the violation prior to 30 days after your receipt of the notice.</p
>
<p>Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.</p>
<p
>Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under
section 10.</p
>
<h4><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4>
<p>You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.</p>
<p
>You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this
License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.</p
>
<h4><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4>
<p>Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.</p>
<p>Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.</p>
<p>An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.</p>
<p
>An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a
copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with
reasonable efforts.</p
>
<p>You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.</p>
<p
>You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a
cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.</p
>
<h4><a name="section11"></a>11. Patents.</h4>
<p>A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".</p>
<p>A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".</p>
<p>A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.</p>
<p
>A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include
claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.</p
>
<p>Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.</p>
<p>Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.</p>
<p>In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.</p>
<p
>In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means
to make such an agreement or commitment not to enforce a patent against the party.</p
>
<p>If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.</p>
<p
>If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must
either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients.
"Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are
valid.</p
>
<p>If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.</p>
<p
>If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy
of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.</p
>
<p>A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.</p>
<p
>A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party
to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work
from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that
arrangement, or that patent license was granted, prior to 28 March 2007.</p
>
<p>Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.</p>
<p>Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.</p>
<h4><a name="section12"></a>12. No Surrender of Others' Freedom.</h4>
<p>If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.</p>
<p
>If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.</p
>
<h4><a name="section13"></a>13. Remote Network Interaction; Use with the GNU General Public License.</h4>
<p>Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.</p>
<p
>Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of
your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General
Public License that is incorporated pursuant to the following paragraph.</p
>
<p>Notwithstanding any other provision of this License, you have permission
to link or combine any covered work with a work licensed under version 3
of the GNU General Public License into a single combined work, and to
convey the resulting work. The terms of this License will continue to
apply to the part which is the covered work, but the work with which it is
combined will remain governed by version 3 of the GNU General Public
License.</p>
<p
>Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply
to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.</p
>
<h4><a name="section14"></a>14. Revised Versions of this License.</h4>
<p>The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may differ
in detail to address new problems or concerns.</p>
<p>The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.</p>
<p>Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero
General Public License "or any later version" applies to it, you have
the option of following the terms and conditions either of that
numbered version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number
of the GNU Affero General Public License, you may choose any version
ever published by the Free Software Foundation.</p>
<p
>Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any
later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.</p
>
<p>If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that
proxy's public statement of acceptance of a version permanently
authorizes you to choose that version for the Program.</p>
<p>If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.</p>
<p>Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.</p>
<p>Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.</p>
<h4><a name="section15"></a>15. Disclaimer of Warranty.</h4>
<p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
<p
>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p
>
<h4><a name="section16"></a>16. Limitation of Liability.</h4>
<p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.</p>
<p
>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF
THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.</p
>
<h4><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4>
<p>If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.</p>
<p
>If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a
warranty or assumption of liability accompanies a copy of the Program in return for a fee.</p
>
<h3 style="text-align: center;"><a name="additional-terms"></a>ADDITIONAL TERMS</h3>
<h3 style="text-align: center"> <a name="additional-terms"></a>ADDITIONAL TERMS </h3>
<h4><a name="trademark"></a>18. PhotoPrism® Trademark and Brand Assets</h4>
<p>
(a) PhotoPrisms Brand Assets including trademarks, logos, icons, fonts,
corporate design, product and service names, and any other brand features
and elements, whether registered or unregistered (Brand Assets) are
proprietary assets owned exclusively by PhotoPrism UG (PhotoPrism). We
reserve the right to object to any use or misuse in any jurisdiction worldwide.
Visit <a target="_blank" href="https://www.photoprism.app/trademark">photoprism.app/trademark</a>
(a) PhotoPrisms Brand Assets including trademarks, logos, icons, fonts, corporate design, product and service names, and any other brand features and elements, whether registered or unregistered (Brand Assets) are proprietary assets owned exclusively by PhotoPrism UG (PhotoPrism).
We reserve the right to object to any use or misuse in any jurisdiction worldwide. Visit <a target="_blank" href="https://www.photoprism.app/trademark">photoprism.app/trademark</a>
to learn more.
</p>
<p>
(b) Contributors, licensees, business partners, and other third parties may
never claim ownership of PhotoPrism's Brand Assets or brands confusingly similar to
PhotoPrism's Brand Assets in any way, including, without limitation, as a trademark,
service mark, company name or designation, domain name, social media profile/handle,
or in any other manner.
(b) Contributors, licensees, business partners, and other third parties may never claim ownership of PhotoPrism's Brand Assets or brands confusingly similar to PhotoPrism's Brand Assets in any way, including, without limitation, as a trademark, service mark, company name or designation,
domain name, social media profile/handle, or in any other manner.
</p>
<p>
(c) You may not include the PhotoPrism trademark in the name of your app, product,
or service, whether commercial or non-commercial in nature. This includes online
services such as e-commerce, community, blog, information, advertising, and
personal home pages, as well as apps, app stores, client apps, or third-party apps
that interact with PhotoPrism.
</p>
<p>
(d) In the event that any provision is found to be unenforceable by a court or
other competent jurisdiction, the remaining portions hereof shall remain in full
force and effect.
(c) You may not include the PhotoPrism trademark in the name of your app, product, or service, whether commercial or non-commercial in nature. This includes online services such as e-commerce, community, blog, information, advertising, and personal home pages, as well as apps, app stores,
client apps, or third-party apps that interact with PhotoPrism.
</p>
<p> (d) In the event that any provision is found to be unenforceable by a court or other competent jurisdiction, the remaining portions hereof shall remain in full force and effect. </p>
<h3><a name="terms-end"></a>END OF TERMS AND CONDITIONS</h3>
</v-container>
@@ -701,7 +414,7 @@
<script>
export default {
name: 'PPageLicense',
name: "PPageLicense",
data() {
return {};
},

View File

@@ -6,7 +6,7 @@
import PPageAbout from "./about/about.vue";
export default {
name: 'PPageAdmin',
name: "PPageAdmin",
components: { PPageAbout },
data() {
return {

View File

@@ -1,9 +1,6 @@
<template>
<div v-infinite-scroll="loadMore" class="p-page p-page-album-photos" :infinite-scroll-disabled="scrollDisabled"
:infinite-scroll-distance="scrollDistance" :infinite-scroll-listen-for-event="'scrollRefresh'">
<p-album-toolbar :filter="filter" :album="model" :settings="settings" :refresh="refresh"
:update-filter="updateFilter" :update-query="updateQuery"></p-album-toolbar>
<div v-infinite-scroll="loadMore" class="p-page p-page-album-photos" :infinite-scroll-disabled="scrollDisabled" :infinite-scroll-distance="scrollDistance" :infinite-scroll-listen-for-event="'scrollRefresh'">
<p-album-toolbar :filter="filter" :album="model" :settings="settings" :refresh="refresh" :update-filter="updateFilter" :update-query="updateQuery"></p-album-toolbar>
<v-container v-if="loading" fluid class="pa-4">
<v-progress-linear color="secondary-dark" :indeterminate="true"></v-progress-linear>
@@ -11,39 +8,11 @@
<v-container v-else fluid class="pa-0">
<p-scroll-top></p-scroll-top>
<p-photo-clipboard :refresh="refresh"
:selection="selection"
:album="model" context="album"></p-photo-clipboard>
<p-photo-clipboard :refresh="refresh" :selection="selection" :album="model" context="album"></p-photo-clipboard>
<p-photo-mosaic v-if="settings.view === 'mosaic'"
context="album"
:photos="results"
:select-mode="selectMode"
:filter="filter"
:album="model"
:edit-photo="editPhoto"
:open-photo="openPhoto"
:is-shared-view="isShared"></p-photo-mosaic>
<p-photo-list v-else-if="settings.view === 'list'"
context="album"
:photos="results"
:select-mode="selectMode"
:filter="filter"
:album="model"
:open-photo="openPhoto"
:edit-photo="editPhoto"
:open-location="openLocation"
:is-shared-view="isShared"></p-photo-list>
<p-photo-cards v-else
context="album"
:photos="results"
:select-mode="selectMode"
:filter="filter"
:album="model"
:open-photo="openPhoto"
:edit-photo="editPhoto"
:open-location="openLocation"
:is-shared-view="isShared"></p-photo-cards>
<p-photo-mosaic v-if="settings.view === 'mosaic'" context="album" :photos="results" :select-mode="selectMode" :filter="filter" :album="model" :edit-photo="editPhoto" :open-photo="openPhoto" :is-shared-view="isShared"></p-photo-mosaic>
<p-photo-list v-else-if="settings.view === 'list'" context="album" :photos="results" :select-mode="selectMode" :filter="filter" :album="model" :open-photo="openPhoto" :edit-photo="editPhoto" :open-location="openLocation" :is-shared-view="isShared"></p-photo-list>
<p-photo-cards v-else context="album" :photos="results" :select-mode="selectMode" :filter="filter" :album="model" :open-photo="openPhoto" :edit-photo="editPhoto" :open-location="openLocation" :is-shared-view="isShared"></p-photo-cards>
</v-container>
</div>
</template>
@@ -56,7 +25,7 @@ import Event from "pubsub-js";
import Viewer from "common/viewer";
export default {
name: 'PPageAlbumPhotos',
name: "PPageAlbumPhotos",
props: {
staticFilter: {
type: Object,
@@ -67,10 +36,10 @@ export default {
const uid = this.$route.params.album;
const query = this.$route.query;
const routeName = this.$route.name;
const order = query['order'] ? query['order'] : 'oldest';
const camera = query['camera'] ? parseInt(query['camera']) : 0;
const q = query['q'] ? query['q'] : '';
const country = query['country'] ? query['country'] : '';
const order = query["order"] ? query["order"] : "oldest";
const camera = query["camera"] ? parseInt(query["camera"]) : 0;
const q = query["q"] ? query["q"] : "";
const country = query["country"] ? query["country"] : "";
const view = this.viewType();
const filter = { country: country, camera: camera, order: order, q: q };
const settings = { view: view };
@@ -116,12 +85,12 @@ export default {
},
},
watch: {
'$route'() {
$route() {
const query = this.$route.query;
this.filter.q = query['q'] ? query['q'] : '';
this.filter.camera = query['camera'] ? parseInt(query['camera']) : 0;
this.filter.country = query['country'] ? query['country'] : '';
this.filter.q = query["q"] ? query["q"] : "";
this.filter.camera = query["camera"] ? parseInt(query["camera"]) : 0;
this.filter.country = query["country"] ? query["country"] : "";
this.settings.view = this.viewType();
/**
@@ -150,7 +119,7 @@ export default {
} else {
this.search();
}
}
},
},
created() {
this.findAlbum().then(() => this.search());
@@ -168,7 +137,7 @@ export default {
},
methods: {
viewType() {
let queryParam = this.$route.query['view'] ? this.$route.query['view'] : "";
let queryParam = this.$route.query["view"] ? this.$route.query["view"] : "";
let defaultType = window.localStorage.getItem("photos_view");
let storedType = window.localStorage.getItem("album_photos_view");
@@ -180,10 +149,10 @@ export default {
} else if (defaultType) {
return defaultType;
} else if (window.innerWidth < 960) {
return 'mosaic';
return "mosaic";
}
return 'cards';
return "cards";
},
openLocation(index) {
if (!this.hasPlaces) {
@@ -222,7 +191,7 @@ export default {
const selected = this.results[index];
// Don't open as stack when user is selecting pictures, or a RAW has only one JPEG.
if (this.selection.length > 0 || selected.Type === MediaRaw && selected.jpegFiles().length < 2) {
if (this.selection.length > 0 || (selected.Type === MediaRaw && selected.jpegFiles().length < 2)) {
showMerged = false;
}
@@ -240,7 +209,7 @@ export default {
*
* preferVideo is true, when the user explicitly clicks the live-image-icon.
*/
if (preferVideo && selected.Type === MediaLive || selected.Type === MediaVideo || selected.Type === MediaAnimated) {
if ((preferVideo && selected.Type === MediaLive) || selected.Type === MediaVideo || selected.Type === MediaAnimated) {
if (selected.isPlayable()) {
this.$viewer.play({ video: selected, album: this.album });
} else {
@@ -280,9 +249,10 @@ export default {
Object.assign(params, this.staticFilter);
}
Photo.search(params).then(response => {
Photo.search(params)
.then((response) => {
this.results = Photo.mergeResponse(this.results, response);
this.complete = (response.count < count);
this.complete = response.count < count;
this.scrollDisabled = this.complete;
if (this.complete) {
@@ -306,9 +276,11 @@ export default {
}
});
}
}).catch(() => {
})
.catch(() => {
this.scrollDisabled = false;
}).finally(() => {
})
.finally(() => {
this.dirty = false;
this.loading = false;
this.listen = true;
@@ -363,7 +335,7 @@ export default {
if (this.loading) return;
const query = {
view: this.settings.view
view: this.settings.view,
};
Object.assign(query, this.filter);
@@ -428,12 +400,13 @@ export default {
const params = this.searchParams();
Photo.search(params).then(response => {
Photo.search(params)
.then((response) => {
this.offset = this.batchSize;
this.results = response.models;
this.viewer.results = [];
this.viewer.complete = false;
this.complete = (response.count < this.batchSize);
this.complete = response.count < this.batchSize;
this.scrollDisabled = this.complete;
if (this.complete) {
@@ -452,21 +425,25 @@ export default {
}
});
}
}).finally(() => {
})
.finally(() => {
this.dirty = false;
this.loading = false;
this.listen = true;
});
},
findAlbum() {
return this.model.find(this.uid).then(m => {
return this.model
.find(this.uid)
.then((m) => {
this.model = m;
this.filter.order = m.Order;
window.document.title = `${this.$config.get("siteTitle")}: ${this.model.Title}`;
return Promise.resolve(this.model);
}).catch((e) => {
})
.catch((e) => {
this.$router.push({ name: this.collectionRoute });
return Promise.reject(e);
});
@@ -506,7 +483,9 @@ export default {
}
},
updateResults(entity) {
this.results.filter((m) => m.UID === entity.UID).forEach((m) => {
this.results
.filter((m) => m.UID === entity.UID)
.forEach((m) => {
for (let key in entity) {
if (key !== "UID" && entity.hasOwnProperty(key) && entity[key] != null && typeof entity[key] !== "object") {
m[key] = entity[key];
@@ -514,7 +493,9 @@ export default {
}
});
this.viewer.results.filter((m) => m.UID === entity.UID).forEach((m) => {
this.viewer.results
.filter((m) => m.UID === entity.UID)
.forEach((m) => {
for (let key in entity) {
if (key !== "UID" && entity.hasOwnProperty(key) && entity[key] != null && typeof entity[key] !== "object") {
m[key] = entity[key];
@@ -536,15 +517,15 @@ export default {
return;
}
const type = ev.split('.')[1];
const type = ev.split(".")[1];
switch (type) {
case 'updated':
case "updated":
for (let i = 0; i < data.entities.length; i++) {
this.updateResults(data.entities[i]);
}
break;
case 'restored':
case "restored":
this.dirty = true;
this.scrollDisabled = false;
this.complete = false;
@@ -552,8 +533,8 @@ export default {
this.loadMore();
break;
case 'deleted':
case 'archived':
case "deleted":
case "archived":
this.dirty = true;
this.complete = false;

View File

@@ -1,12 +1,15 @@
<template>
<div v-infinite-scroll="loadMore" :class="$config.aclClasses('albums')" class="p-page p-page-albums" style="user-select: none"
:infinite-scroll-disabled="scrollDisabled" :infinite-scroll-distance="scrollDistance"
:infinite-scroll-listen-for-event="'scrollRefresh'">
<div v-infinite-scroll="loadMore" :class="$config.aclClasses('albums')" class="p-page p-page-albums" style="user-select: none" :infinite-scroll-disabled="scrollDisabled" :infinite-scroll-distance="scrollDistance" :infinite-scroll-listen-for-event="'scrollRefresh'">
<v-form ref="form" class="p-albums-search" lazy-validation dense @submit.prevent="updateQuery()">
<v-toolbar flat :dense="$vuetify.breakpoint.smAndDown" class="page-toolbar" color="secondary">
<v-text-field :value="filter.q"
solo hide-details clearable overflow single-line validate-on-blur
<v-text-field
:value="filter.q"
solo
hide-details
clearable
overflow
single-line
validate-on-blur
class="input-search background-inherit elevation-0"
:label="$gettext('Search')"
browser-autocomplete="off"
@@ -14,70 +17,96 @@
autocapitalize="none"
prepend-inner-icon="search"
color="secondary-dark"
@change="(v) => {updateFilter({'q': v})}"
@keyup.enter.native="(e) => updateQuery({'q': e.target.value})"
@click:clear="() => {updateQuery({'q': ''})}"
@change="
(v) => {
updateFilter({ q: v });
}
"
@keyup.enter.native="(e) => updateQuery({ q: e.target.value })"
@click:clear="
() => {
updateQuery({ q: '' });
}
"
></v-text-field>
<v-btn icon class="action-reload" :title="$gettext('Reload')" @click.stop="refresh()">
<v-icon>refresh</v-icon>
</v-btn>
<v-btn v-if="canUpload" icon class="hidden-sm-and-down action-upload"
:title="$gettext('Upload')" @click.stop="showUpload()">
<v-btn v-if="canUpload" icon class="hidden-sm-and-down action-upload" :title="$gettext('Upload')" @click.stop="showUpload()">
<v-icon>cloud_upload</v-icon>
</v-btn>
<v-btn v-if="canManage && staticFilter.type === 'album'" icon class="action-add" :title="$gettext('Add Album')"
@click.prevent="create()">
<v-btn v-if="canManage && staticFilter.type === 'album'" icon class="action-add" :title="$gettext('Add Album')" @click.prevent="create()">
<v-icon>add</v-icon>
</v-btn>
<v-btn v-if="canManage && !staticFilter['order']" icon class="p-expand-search" :title="$gettext('Expand Search')"
@click.stop="searchExpanded = !searchExpanded">
<v-icon>{{ searchExpanded ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</v-icon>
<v-btn v-if="canManage && !staticFilter['order']" icon class="p-expand-search" :title="$gettext('Expand Search')" @click.stop="searchExpanded = !searchExpanded">
<v-icon>{{ searchExpanded ? "keyboard_arrow_up" : "keyboard_arrow_down" }}</v-icon>
</v-btn>
</v-toolbar>
<v-card v-show="searchExpanded"
class="pt-1 page-toolbar-expanded"
flat
color="secondary-light">
<v-card v-show="searchExpanded" class="pt-1 page-toolbar-expanded" flat color="secondary-light">
<v-card-text>
<v-layout row wrap>
<v-flex xs12 sm4 pa-2 class="p-year-select">
<v-select :value="filter.year"
<v-select
:value="filter.year"
:label="$gettext('Year')"
:disabled="context === 'state'"
:menu-props="{'maxHeight':346}"
flat solo hide-details
:menu-props="{ maxHeight: 346 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
item-value="value"
item-text="text"
:items="yearOptions()"
@change="(v) => {updateQuery({'year': v})}">
@change="
(v) => {
updateQuery({ year: v });
}
"
>
</v-select>
</v-flex>
<v-flex xs12 sm4 pa-2 class="p-category-select">
<v-select :value="filter.category"
<v-select
:value="filter.category"
:label="$gettext('Category')"
:menu-props="{'maxHeight':346}"
flat solo hide-details
:menu-props="{ maxHeight: 346 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
:items="categories"
@change="(v) => {updateQuery({'category': v})}">
@change="
(v) => {
updateQuery({ category: v });
}
"
>
</v-select>
</v-flex>
<v-flex xs12 sm4 pa-2 class="p-sort-select">
<v-select :value="filter.order"
<v-select
:value="filter.order"
:label="$gettext('Sort Order')"
:menu-props="{'maxHeight':400}"
flat solo hide-details
:menu-props="{ maxHeight: 400 }"
flat
solo
hide-details
color="secondary-dark"
background-color="secondary"
:items="context === 'album' ? options.sorting : options.sorting.filter(item => item.value !== 'edited')"
@change="(v) => {updateQuery({'order': v})}">
:items="context === 'album' ? options.sorting : options.sorting.filter((item) => item.value !== 'edited')"
@change="
(v) => {
updateQuery({ order: v });
}
"
>
</v-select>
</v-flex>
</v-layout>
@@ -91,14 +120,10 @@
<v-container v-else fluid class="pa-0">
<p-scroll-top></p-scroll-top>
<p-album-clipboard :refresh="refresh" :selection="selection" :share="share" :edit="edit"
:clear-selection="clearSelection" :context="context"></p-album-clipboard>
<p-album-clipboard :refresh="refresh" :selection="selection" :share="share" :edit="edit" :clear-selection="clearSelection" :context="context"></p-album-clipboard>
<v-container grid-list-xs fluid class="pa-2">
<v-alert
:value="results.length === 0"
color="secondary-dark" icon="lightbulb_outline" class="no-results ma-2 opacity-70" outline
>
<v-alert :value="results.length === 0" color="secondary-dark" icon="lightbulb_outline" class="no-results ma-2 opacity-70" outline>
<h3 class="body-2 ma-0 pa-0">
<translate>No albums found</translate>
</h3>
@@ -114,19 +139,8 @@
</v-alert>
<v-layout row wrap class="search-results album-results cards-view" :class="{ 'select-results': selection.length > 0 }">
<v-flex
v-for="(album, index) in results"
:key="album.UID"
xs6 sm4 md3 xlg2 xxl1 d-flex
>
<v-card tile
:data-uid="album.UID"
style="user-select: none"
class="result card"
:class="album.classes(selection.includes(album.UID))"
:to="album.route(view)"
@contextmenu.stop="onContextMenu($event, index)"
>
<v-flex v-for="(album, index) in results" :key="album.UID" xs6 sm4 md3 xlg2 xxl1 d-flex>
<v-card tile :data-uid="album.UID" style="user-select: none" class="result card" :class="album.classes(selection.includes(album.UID))" :to="album.route(view)" @contextmenu.stop="onContextMenu($event, index)">
<div class="card-background card" style="user-select: none"></div>
<v-img
:src="album.thumbnailUrl('tile_500')"
@@ -140,67 +154,50 @@
@mousedown.stop.prevent="input.mouseDown($event, index)"
@click.stop.prevent="onClick($event, index)"
>
<v-btn v-if="canShare && album.LinkCount > 0" :ripple="false"
icon flat absolute
class="action-share"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onShare($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="onShare($event, index)">
<v-btn v-if="canShare && album.LinkCount > 0" :ripple="false" icon flat absolute class="action-share" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="onShare($event, index)" @touchmove.stop.prevent @click.stop.prevent="onShare($event, index)">
<v-icon color="white">share</v-icon>
</v-btn>
<v-btn :ripple="false"
icon flat absolute
class="input-select"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onSelect($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="onSelect($event, index)">
<v-btn :ripple="false" icon flat absolute class="input-select" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="onSelect($event, index)" @touchmove.stop.prevent @click.stop.prevent="onSelect($event, index)">
<v-icon color="white" class="select-on">check_circle</v-icon>
<v-icon color="white" class="select-off">radio_button_off</v-icon>
</v-btn>
<v-btn :ripple="false"
icon flat absolute
class="input-favorite"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="toggleLike($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="toggleLike($event, index)">
<v-btn :ripple="false" icon flat absolute class="input-favorite" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="toggleLike($event, index)" @touchmove.stop.prevent @click.stop.prevent="toggleLike($event, index)">
<v-icon color="#FFD600" class="select-on">star</v-icon>
<v-icon color="white" class="select-off">star_border</v-icon>
</v-btn>
<v-btn v-if="canManage && experimental && featPrivate && album.Private"
<v-btn
v-if="canManage && experimental && featPrivate && album.Private"
:ripple="false"
icon flat absolute
icon
flat
absolute
class="input-private"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onEdit($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="onEdit($event, index)">
@click.stop.prevent="onEdit($event, index)"
>
<v-icon color="white" class="select-on">lock</v-icon>
</v-btn>
</v-img>
<v-card-title primary-title class="pl-3 pt-3 pr-3 pb-2 card-details" style="user-select: none;">
<v-card-title primary-title class="pl-3 pt-3 pr-3 pb-2 card-details" style="user-select: none">
<div>
<h3 class="body-2 mb-0">
<button v-if="album.Type !== 'month'" class="action-title-edit" :data-uid="album.UID"
@click.stop.prevent="edit(album)">
<button v-if="album.Type !== 'month'" class="action-title-edit" :data-uid="album.UID" @click.stop.prevent="edit(album)">
{{ album.Title | truncate(80) }}
</button>
<button v-else class="action-title-edit" :data-uid="album.UID"
@click.stop.prevent="edit(album)">
<button v-else class="action-title-edit" :data-uid="album.UID" @click.stop.prevent="edit(album)">
{{ album.getDateString() | capitalize }}
</button>
</h3>
</div>
</v-card-title>
<v-card-text primary-title class="pb-2 pt-0 card-details" style="user-select: none;"
@click.stop.prevent="">
<v-card-text primary-title class="pb-2 pt-0 card-details" style="user-select: none" @click.stop.prevent="">
<div v-if="album.Description" class="caption mb-2" :title="$gettext('Description')">
<button @click.exact="edit(album)">
{{ album.Description | truncate(100) }}
@@ -246,10 +243,8 @@
</div>
</v-container>
</v-container>
<p-share-dialog :show="dialog.share" :model="model" @upload="webdavUpload"
@close="dialog.share = false"></p-share-dialog>
<p-share-upload-dialog :show="dialog.upload" :items="{albums: selection}" :model="model" @cancel="dialog.upload = false"
@confirm="dialog.upload = false"></p-share-upload-dialog>
<p-share-dialog :show="dialog.share" :model="model" @upload="webdavUpload" @close="dialog.share = false"></p-share-dialog>
<p-share-upload-dialog :show="dialog.upload" :items="{ albums: selection }" :model="model" @cancel="dialog.upload = false" @confirm="dialog.upload = false"></p-share-upload-dialog>
<p-album-edit-dialog :show="dialog.edit" :album="model" @close="dialog.edit = false"></p-album-edit-dialog>
</div>
</template>
@@ -265,7 +260,7 @@ import {Input, InputInvalid, ClickShort, ClickLong} from "common/input";
import * as options from "options/options";
export default {
name: 'PPageAlbums',
name: "PPageAlbums",
props: {
staticFilter: {
type: Object,
@@ -286,17 +281,19 @@ export default {
const order = this.sortOrder();
const q = query["q"] ? query["q"] : "";
const category = query["category"] ? query["category"] : "";
const year = query['year'] ? parseInt(query['year']) : "";
const year = query["year"] ? parseInt(query["year"]) : "";
const filter = { q, category, order, year };
const settings = {};
const features = this.$config.settings().features;
let categories = [{"value": "", "text": this.$gettext("All Categories")}];
let categories = [{ value: "", text: this.$gettext("All Categories") }];
if (this.$config.albumCategories().length > 0) {
categories = categories.concat(this.$config.albumCategories().map(cat => {
return {"value": cat, "text": cat};
}));
categories = categories.concat(
this.$config.albumCategories().map((cat) => {
return { value: cat, text: cat };
})
);
}
return {
@@ -326,7 +323,7 @@ export default {
filter: filter,
lastFilter: {},
routeName: routeName,
titleRule: v => v.length <= this.$config.get('clip') || this.$gettext("Title too long"),
titleRule: (v) => v.length <= this.$config.get("clip") || this.$gettext("Title too long"),
input: new Input(),
lastId: "",
dialog: {
@@ -339,14 +336,14 @@ export default {
years: [{ value: "", text: this.$gettext("All Years") }],
},
options: {
'sorting': [
{value: 'favorites', text: this.$gettext('Favorites')},
{value: 'name', text: this.$gettext('Name')},
{value: 'place', text: this.$gettext('Location')},
{value: 'newest', text: this.$gettext('Newest First')},
{value: 'oldest', text: this.$gettext('Oldest First')},
{value: 'added', text: this.$gettext('Recently Added')},
{value: 'edited', text: this.$gettext('Recently Edited')}
sorting: [
{ value: "favorites", text: this.$gettext("Favorites") },
{ value: "name", text: this.$gettext("Name") },
{ value: "place", text: this.$gettext("Location") },
{ value: "newest", text: this.$gettext("Newest First") },
{ value: "oldest", text: this.$gettext("Oldest First") },
{ value: "added", text: this.$gettext("Recently Added") },
{ value: "edited", text: this.$gettext("Recently Edited") },
],
},
};
@@ -362,10 +359,10 @@ export default {
}
return "";
}
},
},
watch: {
'$route'() {
$route() {
const query = this.$route.query;
this.routeName = this.$route.name;
@@ -373,11 +370,11 @@ export default {
this.q = query["q"] ? query["q"] : "";
this.filter.q = this.q;
this.filter.category = query["category"] ? query["category"] : "";
this.filter.year = query['year'] ? parseInt(query['year']) : "";
this.filter.year = query["year"] ? parseInt(query["year"]) : "";
this.filter.order = this.sortOrder();
this.search();
}
},
},
created() {
this.search();
@@ -400,12 +397,14 @@ export default {
const c = data.config.albumCategories;
this.categories = [{"value": "", "text": this.$gettext("All Categories")}];
this.categories = [{ value: "", text: this.$gettext("All Categories") }];
if (c.length > 0) {
this.categories = this.categories.concat(c.map(cat => {
return {"value": cat, "text": cat};
}));
this.categories = this.categories.concat(
c.map((cat) => {
return { value: cat, text: cat };
})
);
}
},
yearOptions() {
@@ -472,9 +471,10 @@ export default {
}
// Pre-select manually managed album in upload dialog.
if(this.context === 'album' && this.selection && this.selection.length === 1) {
return this.model.find(this.selection[0])
.then(m => Event.publish("dialog.upload", {albums: [m]}))
if (this.context === "album" && this.selection && this.selection.length === 1) {
return this.model
.find(this.selection[0])
.then((m) => Event.publish("dialog.upload", { albums: [m] }))
.catch(() => Event.publish("dialog.upload", { albums: [] }));
} else {
Event.publish("dialog.upload", { albums: [] });
@@ -522,7 +522,7 @@ export default {
this.addSelection(models[i].getId());
}
return (rangeEnd - rangeStart) + 1;
return rangeEnd - rangeStart + 1;
},
onEdit(ev, index) {
if (!this.canManage) {
@@ -611,10 +611,11 @@ export default {
Object.assign(params, this.staticFilter);
}
Album.search(params).then(resp => {
Album.search(params)
.then((resp) => {
this.results = this.dirty ? resp.models : this.results.concat(resp.models);
this.scrollDisabled = (resp.count < resp.limit);
this.scrollDisabled = resp.count < resp.limit;
if (this.scrollDisabled) {
this.setOffset(resp.offset);
@@ -632,9 +633,11 @@ export default {
}
});
}
}).catch(() => {
})
.catch(() => {
this.scrollDisabled = false;
}).finally(() => {
})
.finally(() => {
this.dirty = false;
this.loading = false;
this.listen = true;
@@ -684,7 +687,7 @@ export default {
if (this.loading) return;
const query = {
view: this.settings.view
view: this.settings.view,
};
Object.assign(query, this.filter);
@@ -742,11 +745,12 @@ export default {
const params = this.searchParams();
Album.search(params).then(resp => {
Album.search(params)
.then((resp) => {
this.offset = resp.limit;
this.results = resp.models;
this.scrollDisabled = (resp.count < resp.limit);
this.scrollDisabled = resp.count < resp.limit;
if (this.scrollDisabled) {
if (!this.results.length) {
@@ -764,7 +768,8 @@ export default {
}
});
}
}).finally(() => {
})
.finally(() => {
this.dirty = false;
this.loading = false;
this.listen = true;
@@ -786,10 +791,10 @@ export default {
let title = DateTime.local().toFormat("LLLL yyyy");
// Add suffix if the album title already exists.
if (this.results.findIndex(a => a.Title.startsWith(title)) !== -1) {
const re = new RegExp(`${title} \\((\\d?)\\)`, 'i');
if (this.results.findIndex((a) => a.Title.startsWith(title)) !== -1) {
const re = new RegExp(`${title} \\((\\d?)\\)`, "i");
let i = 1;
this.results.forEach(a => {
this.results.forEach((a) => {
const found = a.Title.match(re);
if (found && found.length > 0 && found[1]) {
const n = parseInt(found[1]);
@@ -802,7 +807,7 @@ export default {
title = `${title} (${i + 1})`;
}
const album = new Album({"Title": title, "Favorite": false});
const album = new Album({ Title: title, Favorite: false });
album.save().then(() => this.$notify.success(this.$gettext("Album created")));
},
@@ -859,10 +864,10 @@ export default {
return;
}
const type = ev.split('.')[1];
const type = ev.split(".")[1];
switch (type) {
case 'updated':
case "updated":
for (let i = 0; i < data.entities.length; i++) {
const values = data.entities[i];
const model = this.results.find((m) => m.UID === values.UID);
@@ -876,18 +881,20 @@ export default {
}
}
let categories = [{"value": "", "text": this.$gettext("All Categories")}];
let categories = [{ value: "", text: this.$gettext("All Categories") }];
if (this.$config.albumCategories().length > 0) {
categories = categories.concat(this.$config.albumCategories().map(cat => {
return {"value": cat, "text": cat};
}));
categories = categories.concat(
this.$config.albumCategories().map((cat) => {
return { value: cat, text: cat };
})
);
}
this.categories = categories;
break;
case 'deleted':
case "deleted":
this.dirty = true;
for (let i = 0; i < data.entities.length; i++) {
@@ -902,7 +909,7 @@ export default {
}
break;
case 'created':
case "created":
this.dirty = true;
for (let i = 0; i < data.entities.length; i++) {
@@ -917,7 +924,7 @@ export default {
default:
console.warn("unexpected event type", ev);
}
}
},
},
};
</script>

View File

@@ -1,20 +1,9 @@
<template>
<v-container
id="auth-login"
fluid
fill-height
class="auth-login wallpaper background-welcome pa-4"
:style="wallpaper()"
>
<v-container id="auth-login" fluid fill-height class="auth-login wallpaper background-welcome pa-4"
:style="wallpaper()">
<v-layout id="auth-layout" class="auth-layout">
<v-flex xs12 sm9 md6 lg4 xl3 xxl2>
<v-form
ref="form"
dense
class="auth-login-form"
accept-charset="UTF-8"
@submit.prevent="login"
>
<v-form ref="form" dense class="auth-login-form" accept-charset="UTF-8" @submit.prevent="onLogin">
<v-card id="auth-login-box" class="elevation-12 auth-login-box blur-7">
<v-card-text class="pa-4">
<p-auth-header></p-auth-header>
@@ -31,7 +20,7 @@
light
autofocus
type="text"
:disabled="loading"
:disabled="loading || enterPasscode"
name="username"
autocorrect="off"
autocapitalize="none"
@@ -40,10 +29,33 @@
class="input-username text-selectable"
color="primary"
prepend-inner-icon="person"
@keyup.enter.native="login"
@keyup.enter.native="onLogin"
></v-text-field>
</v-flex>
<v-flex xs12 class="pa-2">
<v-flex v-if="enterPasscode" xs12 class="pa-2">
<v-text-field
id="auth-passcode"
v-model="passcode"
hide-details
required
solo
flat
light
type="text"
:disabled="loading"
name="passcode"
autocorrect="off"
autocapitalize="none"
mask="nnn nnn nnn nnn"
:label="$gettext('Verification Code')"
background-color="grey lighten-5"
class="input-passcode text-selectable"
prepend-inner-icon="verified_user"
color="primary"
@keyup.enter.native="onLogin"
></v-text-field>
</v-flex>
<v-flex v-else xs12 class="pa-2">
<v-text-field
id="auth-password"
v-model="password"
@@ -64,30 +76,24 @@
prepend-inner-icon="lock"
color="primary"
@click:append="showPassword = !showPassword"
@keyup.enter.native="login"
@keyup.enter.native="onLogin"
></v-text-field>
</v-flex>
<v-flex xs12 class="px-2 py-1 auth-actions">
<div class="action-buttons auth-buttons text-xs-center">
<v-btn
v-if="registerUri"
:color="colors.secondary"
outline
:block="$vuetify.breakpoint.xsOnly"
:style="`color: ${colors.link}!important`"
class="action-register ra-6 px-3 py-2 opacity-80"
@click.stop.prevent="register"
>
<v-btn v-if="enterPasscode" :color="colors.secondary" outline :block="$vuetify.breakpoint.xsOnly"
:style="`color: ${colors.link}!important`" class="action-cancel ra-6 px-3 py-2 opacity-80"
@click.stop.prevent="onCancel">
<translate>Cancel</translate>
</v-btn>
<v-btn v-else-if="registerUri" :color="colors.secondary" outline :block="$vuetify.breakpoint.xsOnly"
:style="`color: ${colors.link}!important`" class="action-register ra-6 px-3 py-2 opacity-80"
@click.stop.prevent="onRegister">
<translate>Create Account</translate>
</v-btn>
<v-btn
:color="colors.primary"
depressed
:disabled="loginDisabled"
:block="$vuetify.breakpoint.xsOnly"
class="white--text action-confirm ra-6 py-2 px-3"
@click.stop.prevent="login"
>
<v-btn :color="colors.primary" depressed :disabled="loginDisabled"
:block="$vuetify.breakpoint.xsOnly" class="white--text action-confirm ra-6 py-2 px-3"
@click.stop.prevent="onLogin">
<translate>Sign in</translate>
<v-icon v-if="rtl" left dark>navigate_before</v-icon>
<v-icon v-else right dark>navigate_next</v-icon>
@@ -121,9 +127,11 @@ export default {
link: "#c8e3e7",
},
loading: false,
showPassword: false,
username: "",
password: "",
showPassword: false,
passcode: "",
enterPasscode: false,
sponsor: this.$config.isSponsor(),
config: this.$config.values,
siteDescription: this.$config.getSiteDescription(),
@@ -164,12 +172,26 @@ export default {
window.location = route.href;
}, 100);
},
register() {
reset() {
this.username = "";
this.password = "";
this.showPassword = false;
this.passcode = "";
this.enterPasscode = false;
},
onCancel() {
if (this.loading) {
return;
}
this.reset();
},
onRegister() {
window.location = this.registerUri;
},
login() {
onLogin() {
const username = this.username.trim();
const password = this.password.trim();
const passcode = this.passcode.trim();
if (username === "" || password === "") {
return;
@@ -177,11 +199,16 @@ export default {
this.loading = true;
this.$session
.login(username, password)
.login(username, password, passcode)
.then(() => {
this.load();
})
.catch(() => (this.loading = false));
.catch((e) => {
if (e.response?.data?.code === 32) {
this.enterPasscode = true;
}
this.loading = false;
});
},
},
};

View File

@@ -21,12 +21,11 @@
<v-spacer></v-spacer>
<v-btn icon href="https://link.photoprism.app/personal-editions" target="_blank" class="action-upgrade"
:title="$gettext('Learn more')">
<v-btn icon href="https://link.photoprism.app/personal-editions" target="_blank" class="action-upgrade" :title="$gettext('Learn more')">
<v-icon size="26" color="secondary-dark" v-html="'$vuetify.icons.prism'"></v-icon>
</v-btn>
</v-toolbar>
<v-form ref="form" v-model="valid" autocomplete="off" class="px-3 pt-3 pb-0" lazy-validation>
<v-form ref="form" v-model="valid" autocomplete="off" class="px-3 pt-3 pb-0" lazy-validation @submit.prevent>
<v-layout v-if="busy" row wrap>
<v-flex xs12 d-flex class="text-sm-center pa-2">
<v-progress-linear color="secondary-dark" :indeterminate="true"></v-progress-linear>
@@ -34,29 +33,15 @@
</v-layout>
<v-layout v-else-if="error" row wrap>
<v-flex xs12 class="text-sm-left pa-2">
<v-alert
:value="true"
color="error"
icon="gpp_bad"
class="mt-3"
outline
>
<v-alert :value="true" color="error" icon="gpp_bad" class="mt-3" outline>
{{ error }}
</v-alert>
</v-flex>
<v-flex xs12 class="pa-2">
<v-btn color="primary-button lighten-2" :block="$vuetify.breakpoint.xsOnly"
class="ml-0"
outline
:disabled="busy"
@click.stop="reset">
<v-btn color="primary-button lighten-2" :block="$vuetify.breakpoint.xsOnly" class="ml-0" outline :disabled="busy" @click.stop="reset">
<translate>Cancel</translate>
</v-btn>
<v-btn color="primary-button" :block="$vuetify.breakpoint.xsOnly"
class="white--text ml-0"
href="https://www.photoprism.app/contact"
target="_blank"
depressed>
<v-btn color="primary-button" :block="$vuetify.breakpoint.xsOnly" class="white--text ml-0" href="https://www.photoprism.app/contact" target="_blank" depressed>
<translate>Contact Us</translate>
</v-btn>
</v-flex>
@@ -71,17 +56,14 @@
</p>
</v-flex>
<v-flex xs12 grow class="pa-2">
<v-btn href="https://my.photoprism.app/dashboard" target="_blank" color="primary-button lighten-2" :block="$vuetify.breakpoint.xsOnly"
class="ml-0" outline :disabled="busy">
<v-btn href="https://my.photoprism.app/dashboard" target="_blank" color="primary-button lighten-2" :block="$vuetify.breakpoint.xsOnly" class="ml-0" outline :disabled="busy">
<translate>Manage Account</translate>
</v-btn>
<v-btn v-if="$config.values.restart" color="primary-button" :block="$vuetify.breakpoint.xsOnly"
class="white--text ml-0" depressed :disabled="busy" @click.stop.p.prevent="onRestart">
<v-btn v-if="$config.values.restart" color="primary-button" :block="$vuetify.breakpoint.xsOnly" class="white--text ml-0" depressed :disabled="busy" @click.stop.p.prevent="onRestart">
<translate>Restart</translate>
<v-icon :right="!rtl" :left="rtl" dark>restart_alt</v-icon>
</v-btn>
<v-btn v-if="$config.getTier() < 4" href="https://my.photoprism.app/dashboard/membership" target="_blank" color="primary-button" :block="$vuetify.breakpoint.xsOnly"
class="white--text ml-0" depressed :disabled="busy">
<v-btn v-if="$config.getTier() < 4" href="https://my.photoprism.app/dashboard/membership" target="_blank" color="primary-button" :block="$vuetify.breakpoint.xsOnly" class="white--text ml-0" depressed :disabled="busy">
<translate>Upgrade Now</translate>
<v-icon v-if="rtl" left dark>navigate_before</v-icon>
<v-icon v-else right dark>navigate_next</v-icon>
@@ -94,48 +76,25 @@
<translate>Your continued support helps us provide regular updates and remain independent, so we can fulfill our mission and protect your privacy.</translate>
</v-flex>
<v-flex xs12 grow align-center justify-center class="px-2 py-1">
<v-alert
:value="true"
color="secondary-dark"
outline
>
<v-alert :value="true" color="secondary-dark" outline>
<p class="subheading text-selectable">
<strong><translate>To upgrade, you can either enter an activation code or click "Register" to sign up on our website:</translate></strong>
</p>
<v-text-field v-model="form.token" flat solo hide-details return-masked-value :mask="tokenMask"
browser-autocomplete="off"
color="secondary-dark"
background-color="secondary-light" :label="$gettext('Activation Code')" type="text">
</v-text-field>
<v-text-field v-model="form.token" flat solo hide-details return-masked-value :mask="tokenMask" browser-autocomplete="off" color="secondary-dark" background-color="secondary-light" :label="$gettext('Activation Code')" type="text"> </v-text-field>
<div class="action-buttons text-xs-left mt-3">
<v-btn v-if="$config.getTier() >= 4" href="https://my.photoprism.app/dashboard" target="_blank" color="primary-button lighten-2" :block="$vuetify.breakpoint.xsOnly"
class="ml-0"
outline
:disabled="busy">
<v-btn v-if="$config.getTier() >= 4" href="https://my.photoprism.app/dashboard" target="_blank" color="primary-button lighten-2" :block="$vuetify.breakpoint.xsOnly" class="ml-0" outline :disabled="busy">
<translate>Manage Account</translate>
</v-btn>
<v-btn v-else color="primary-button lighten-2" :block="$vuetify.breakpoint.xsOnly"
class="ml-0"
outline
:disabled="busy"
@click.stop="compare">
<v-btn v-else color="primary-button lighten-2" :block="$vuetify.breakpoint.xsOnly" class="ml-0" outline :disabled="busy" @click.stop="compare">
<translate>Compare Editions</translate>
</v-btn>
<v-btn v-if="!form.token.length" color="primary-button"
class="white--text ml-0 action-proceed" :block="$vuetify.breakpoint.xsOnly"
depressed
:disabled="busy"
@click.stop="connect">
<v-btn v-if="!form.token.length" color="primary-button" class="white--text ml-0 action-proceed" :block="$vuetify.breakpoint.xsOnly" depressed :disabled="busy" @click.stop="connect">
<translate>Register</translate>
<v-icon v-if="rtl" left dark>navigate_before</v-icon>
<v-icon v-else right dark>navigate_next</v-icon>
</v-btn>
<v-btn v-else color="primary-button" :block="$vuetify.breakpoint.xsOnly"
class="white--text ml-0 action-activate"
depressed
:disabled="busy || form.token.length !== tokenMask.length"
@click.stop="activate">
<v-btn v-else color="primary-button" :block="$vuetify.breakpoint.xsOnly" class="white--text ml-0 action-activate" depressed :disabled="busy || form.token.length !== tokenMask.length" @click.stop="activate">
<translate>Activate</translate>
<v-icon v-if="rtl" left dark>navigate_before</v-icon>
<v-icon v-else right dark>navigate_next</v-icon>
@@ -159,7 +118,7 @@ import Api from "common/api";
import { restart } from "common/server";
export default {
name: 'PPageConnect',
name: "PPageConnect",
data() {
const token = this.$route.params.token ? this.$route.params.token : "";
const membership = this.$config.getMembership();
@@ -177,7 +136,7 @@ export default {
membership: membership,
showInfo: !token && membership === "ce",
rtl: this.$rtl,
tokenMask: 'nnnn-nnnn-nnnn',
tokenMask: "nnnn-nnnn-nnnn",
form: {
token,
},
@@ -200,10 +159,10 @@ export default {
this.error = "";
},
compare() {
window.open('https://link.photoprism.app/personal-editions', '_blank').focus();
window.open("https://link.photoprism.app/personal-editions", "_blank").focus();
},
connect() {
window.location = 'https://my.photoprism.app/connect/' + encodeURIComponent(window.location);
window.location = "https://my.photoprism.app/connect/" + encodeURIComponent(window.location);
},
activate() {
if (!this.form.token || this.form.token.length !== this.tokenMask.length) {
@@ -215,12 +174,14 @@ export default {
if (values.Token.length >= 4) {
this.busy = true;
this.$notify.blockUI();
Api.put("connect/hub", values).then(() => {
Api.put("connect/hub", values)
.then(() => {
this.$notify.success(this.$gettext("Connected"));
this.success = true;
this.busy = false;
this.$config.update();
}).catch((error) => {
})
.catch((error) => {
this.busy = false;
if (error.response && error.response.data) {
let data = error.response.data;
@@ -230,14 +191,14 @@ export default {
if (!this.error) {
this.error = this.$gettext("Invalid parameters");
}
}).finally(() => {
})
.finally(() => {
this.$notify.unblockUI();
});
} else {
this.$notify.error(this.$gettext("Invalid parameters"));
this.$router.push({ name: "upgrade" });
}
},
getMembership() {
const m = this.$config.getMembership();

View File

@@ -1,13 +1,6 @@
<template>
<div class="p-page p-page-discover">
<v-tabs
v-model="active"
flat
grow
color="secondary"
slider-color="secondary-dark"
:height="$vuetify.breakpoint.smAndDown ? 48 : 64"
>
<v-tabs v-model="active" flat grow color="secondary" slider-color="secondary-dark" :height="$vuetify.breakpoint.smAndDown ? 48 : 64">
<v-tab id="tab-discover-colors" ripple @click="changePath('/discover')">
<translate>Colors</translate>
</v-tab>
@@ -50,13 +43,13 @@ import tabColors from "page/discover/colors.vue";
import tabTodo from "page/discover/todo.vue";
export default {
name: 'PPageDiscover',
name: "PPageDiscover",
components: {
'p-tab-discover-colors': tabColors,
'p-tab-discover-todo': tabTodo,
"p-tab-discover-colors": tabColors,
"p-tab-discover-todo": tabTodo,
},
props: {
tab: Number
tab: Number,
},
data() {
return {
@@ -69,7 +62,7 @@ export default {
if (this.$route.path !== path) {
this.$router.replace(path);
}
}
},
},
};
</script>

View File

@@ -1,23 +1,12 @@
<template>
<div class="p-tab p-tab-discover-colors">
<v-container grid-list-xs text-xs-center fluid>
<p class="subheading pb-3">
This is a very first draft for a "Discover" area where you can find photos by
color, by similarity, by season or just randomly. Feedback and contributions welcome.
</p>
<p class="subheading pb-3"> This is a very first draft for a "Discover" area where you can find photos by color, by similarity, by season or just randomly. Feedback and contributions welcome. </p>
<v-layout row wrap class="p-colors">
<v-flex
v-for="(color, index) in colors"
:key="index"
class="p-color pa-2"
xs3 d-flex grow
>
<v-flex v-for="(color, index) in colors" :key="index" class="p-color pa-2" xs3 d-flex grow>
<v-hover>
<v-card slot-scope="{ hover }" :to="{name: 'browse', query: { color: color.name }}"
:dark="useDark(color)" :color="color.example" :flat="!hover"
class="clickable py-1">
<v-card slot-scope="{ hover }" :to="{ name: 'browse', query: { color: color.name } }" :dark="useDark(color)" :color="color.example" :flat="!hover" class="clickable py-1">
<v-card-text class="px-0 py-5 body-2">{{ color.label }}</v-card-text>
</v-card>
</v-hover>
@@ -28,9 +17,8 @@
</template>
<script>
export default {
name: 'PTabDiscoverColors',
name: "PTabDiscoverColors",
data() {
return {
readonly: this.$config.get("readonly"),
@@ -38,8 +26,7 @@ export default {
labels: {},
};
},
created() {
},
created() {},
methods: {
useDark(color) {
switch (color.name) {
@@ -48,7 +35,7 @@ export default {
default:
return true;
}
}
},
},
};
</script>

View File

@@ -1,17 +1,14 @@
<template>
<div class="p-tab p-tab-discover-todo">
<v-container grid-list-xs text-xs-center fluid>
<p class="subheading pb-3">
This is a very first draft for a "Discover" area where you can find photos by
color, by similarity, by season or just randomly. Feedback and contributions welcome.
</p>
<p class="subheading pb-3"> This is a very first draft for a "Discover" area where you can find photos by color, by similarity, by season or just randomly. Feedback and contributions welcome. </p>
</v-container>
</div>
</template>
<script>
export default {
name: 'p-tab-discover-todo',
name: "PTabDiscoverTodo",
data() {
return {
readonly: this.$config.get("readonly"),
@@ -19,8 +16,7 @@ export default {
labels: {},
};
},
created() {},
methods: {},
created() {
},
};
</script>

View File

@@ -24,9 +24,9 @@
import PHelpWebsockets from "./help/websockets.vue";
export default {
name: 'PPageHelp',
name: "PPageHelp",
components: {
PHelpWebsockets
PHelpWebsockets,
},
data() {
return {

View File

@@ -1,10 +1,8 @@
<template>
<div class="p-help-websockets">
<h3>PhotoPrism uses <a target="_blank" href="https://en.wikipedia.org/wiki/WebSocket">WebSockets</a>
for two-way interactive communication between your browser and the server</h3>
<h3>PhotoPrism uses <a target="_blank" href="https://en.wikipedia.org/wiki/WebSocket">WebSockets</a> for two-way interactive communication between your browser and the server</h3>
<p>If the connection fails and can't be reestablished, your browser won't receive photo counts, log messages, or metadata updates.</p>
<p>To fix this issue, please make sure you didn't block WebSocket connections in your browser or firewall and check the
configuration of any Web server that is in front of PhotoPrism:</p>
<p>To fix this issue, please make sure you didn't block WebSocket connections in your browser or firewall and check the configuration of any Web server that is in front of PhotoPrism:</p>
<v-expansion-panel class="elevation-0">
<v-expansion-panel-content class="secondary mb-1">
<template #header>
@@ -12,12 +10,8 @@
</template>
<v-card class="secondary-light">
<v-card-text>
<p>
This <a target="_blank" href="https://www.serverlab.ca/tutorials/linux/web-servers-linux/how-to-configure-nginx-for-websockets/" class="text-link">tutorial</a> explains, how to configure NGINX WebSocket connections between your client and backend services.
</p>
<p>
You may enable WebSockets and transparent proxying as show in this example:
</p>
<p>This <a target="_blank" href="https://www.serverlab.ca/tutorials/linux/web-servers-linux/how-to-configure-nginx-for-websockets/" class="text-link">tutorial</a> explains, how to configure NGINX WebSocket connections between your client and backend services.</p>
<p>You may enable WebSockets and transparent proxying as show in this example:</p>
<pre>
http {
server {
@@ -38,9 +32,7 @@ http {
}
}
</pre>
<p>
Please refer to the <a target="_blank" href="https://nginx.org/en/docs/" class="text-link">official documentation</a> for more details.
</p>
<p>Please refer to the <a target="_blank" href="https://nginx.org/en/docs/" class="text-link">official documentation</a> for more details.</p>
</v-card-text>
</v-card>
</v-expansion-panel-content>
@@ -50,9 +42,7 @@ http {
</template>
<v-card class="secondary-light">
<v-card-text>
<p>
You may enable WebSockets and transparent proxying as show in this example:
</p>
<p>You may enable WebSockets and transparent proxying as show in this example:</p>
<pre>
example.com {
proxy / photoprism:2342 {
@@ -61,9 +51,7 @@ example.com {
}
}
</pre>
<p>
Please refer to the <a target="_blank" href="https://caddyserver.com/v1/docs/websocket" class="text-link">official documentation</a> for more details.
</p>
<p>Please refer to the <a target="_blank" href="https://caddyserver.com/v1/docs/websocket" class="text-link">official documentation</a> for more details.</p>
</v-card-text>
</v-card>
</v-expansion-panel-content>
@@ -73,21 +61,14 @@ example.com {
</template>
<v-card class="secondary-light">
<v-card-text>
<p>
WebSocket proxying automatically works in Caddy 2. There is no need to enable this, as necessary for Caddy 1, Apache, and NGINX.
</p>
<p>
Example configuration:
</p>
<p>WebSocket proxying automatically works in Caddy 2. There is no need to enable this, as necessary for Caddy 1, Apache, and NGINX.</p>
<p>Example configuration:</p>
<pre>
example.com {
reverse_proxy photoprism:2342
}
</pre>
<p>
In addition, Caddy 2 may automatically create and update Let's Encrypt HTTPS certificates.
Please refer to the <a target="_blank" href="https://caddyserver.com/docs/v2-upgrade#proxy" class="text-link">official documentation</a> for more details.
</p>
<p>In addition, Caddy 2 may automatically create and update Let's Encrypt HTTPS certificates. Please refer to the <a target="_blank" href="https://caddyserver.com/docs/v2-upgrade#proxy" class="text-link">official documentation</a> for more details.</p>
</v-card-text>
</v-card>
</v-expansion-panel-content>
@@ -97,9 +78,7 @@ example.com {
</template>
<v-card class="secondary-light">
<v-card-text>
<p>
You may enable WebSockets and transparent proxying as show in this example:
</p>
<p>You may enable WebSockets and transparent proxying as show in this example:</p>
<pre>
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
@@ -110,18 +89,12 @@ ProxyPass / http://photoprism:2342/
ProxyPassReverse / http://photoprism:2342/
ProxyRequests off
</pre>
<p>
You will have to enable the <code>proxy_wstunnel</code> module:
</p>
<p>You will have to enable the <code>proxy_wstunnel</code> module:</p>
<pre>
a2enmod proxy_wstunnel
</pre>
<p>
Then you will have to reload Apache.
</p>
<p>
The <a target="_blank" href="https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html" class="text-link">official documentation</a> explains in detail, how to configure Apache Web Server 2.4 to reverse proxy WebSockets.
</p>
<p>Then you will have to reload Apache.</p>
<p>The <a target="_blank" href="https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html" class="text-link">official documentation</a> explains in detail, how to configure Apache Web Server 2.4 to reverse proxy WebSockets.</p>
</v-card-text>
</v-card>
</v-expansion-panel-content>
@@ -131,12 +104,10 @@ ProxyRequests off
<script>
export default {
name: 'PHelpWebsockets',
name: "PHelpWebsockets",
data() {
return {
};
},
methods: {
return {};
},
methods: {},
};
</script>

View File

@@ -1,12 +1,15 @@
<template>
<div v-infinite-scroll="loadMore" :class="$config.aclClasses('labels')" class="p-page p-page-labels" style="user-select: none"
:infinite-scroll-disabled="scrollDisabled" :infinite-scroll-distance="scrollDistance"
:infinite-scroll-listen-for-event="'scrollRefresh'">
<div v-infinite-scroll="loadMore" :class="$config.aclClasses('labels')" class="p-page p-page-labels" style="user-select: none" :infinite-scroll-disabled="scrollDisabled" :infinite-scroll-distance="scrollDistance" :infinite-scroll-listen-for-event="'scrollRefresh'">
<v-form ref="form" class="p-labels-search" lazy-validation dense @submit.stop.prevent="updateQuery()">
<v-toolbar flat :dense="$vuetify.breakpoint.smAndDown" class="page-toolbar" color="secondary">
<v-text-field :value="filter.q"
solo hide-details clearable overflow single-line validate-on-blur
<v-text-field
:value="filter.q"
solo
hide-details
clearable
overflow
single-line
validate-on-blur
class="input-search background-inherit elevation-0"
:label="$gettext('Search')"
prepend-inner-icon="search"
@@ -14,9 +17,17 @@
autocorrect="off"
autocapitalize="none"
color="secondary-dark"
@change="(v) => {updateFilter({'q': v})}"
@keyup.enter.native="(e) => updateQuery({'q': e.target.value})"
@click:clear="() => {updateQuery({'q': ''})}"
@change="
(v) => {
updateFilter({ q: v });
}
"
@keyup.enter.native="(e) => updateQuery({ q: e.target.value })"
@click:clear="
() => {
updateQuery({ q: '' });
}
"
></v-text-field>
<v-btn icon class="action-reload" :title="$gettext('Reload')" @click.stop="refresh()">
@@ -36,16 +47,12 @@
<v-progress-linear color="secondary-dark" :indeterminate="true"></v-progress-linear>
</v-container>
<v-container v-else fluid class="pa-0">
<p-label-clipboard v-if="canSelect" :refresh="refresh" :selection="selection"
:clear-selection="clearSelection"></p-label-clipboard>
<p-label-clipboard v-if="canSelect" :refresh="refresh" :selection="selection" :clear-selection="clearSelection"></p-label-clipboard>
<p-scroll-top></p-scroll-top>
<v-container grid-list-xs fluid class="pa-2">
<v-alert
:value="results.length === 0"
color="secondary-dark" icon="lightbulb_outline" class="no-results ma-2 opacity-70" outline
>
<v-alert :value="results.length === 0" color="secondary-dark" icon="lightbulb_outline" class="no-results ma-2 opacity-70" outline>
<h3 class="body-2 ma-0 pa-0">
<translate>No labels found</translate>
</h3>
@@ -55,19 +62,8 @@
</p>
</v-alert>
<v-layout row wrap class="search-results label-results cards-view" :class="{ 'select-results': selection.length > 0 }">
<v-flex
v-for="(label, index) in results"
:key="label.UID"
xs6 sm4 md3 lg2 xxl1 d-flex
>
<v-card tile
:data-uid="label.UID"
style="user-select: none"
class="result card"
:class="label.classes(selection.includes(label.UID))"
:to="label.route(view)"
@contextmenu.stop="onContextMenu($event, index)"
>
<v-flex v-for="(label, index) in results" :key="label.UID" xs6 sm4 md3 lg2 xxl1 d-flex>
<v-card tile :data-uid="label.UID" style="user-select: none" class="result card" :class="label.classes(selection.includes(label.UID))" :to="label.route(view)" @contextmenu.stop="onContextMenu($event, index)">
<div class="card-background card"></div>
<v-img
:src="label.thumbnailUrl('tile_500')"
@@ -81,36 +77,19 @@
@mousedown.stop.prevent="input.mouseDown($event, index)"
@click.stop.prevent="onClick($event, index)"
>
<v-btn v-if="canSelect" :ripple="false"
icon flat absolute
class="input-select"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onSelect($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="onSelect($event, index)">
<v-btn v-if="canSelect" :ripple="false" icon flat absolute class="input-select" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="onSelect($event, index)" @touchmove.stop.prevent @click.stop.prevent="onSelect($event, index)">
<v-icon color="white" class="select-on">check_circle</v-icon>
<v-icon color="white" class="select-off">radio_button_off</v-icon>
</v-btn>
<v-btn :ripple="false"
icon flat absolute
class="input-favorite"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="toggleLike($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="toggleLike($event, index)">
<v-btn :ripple="false" icon flat absolute class="input-favorite" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="toggleLike($event, index)" @touchmove.stop.prevent @click.stop.prevent="toggleLike($event, index)">
<v-icon color="#FFD600" class="select-on">star</v-icon>
<v-icon color="white" class="select-off">star_border</v-icon>
</v-btn>
</v-img>
<v-card-title primary-title class="pa-3 card-details" style="user-select: none;" @click.stop.prevent="">
<v-edit-dialog v-if="canManage"
:return-value.sync="label.Name"
lazy
class="inline-edit"
@save="onSave(label)"
>
<v-card-title primary-title class="pa-3 card-details" style="user-select: none" @click.stop.prevent="">
<v-edit-dialog v-if="canManage" :return-value.sync="label.Name" lazy class="inline-edit" @save="onSave(label)">
<span v-if="label.Name" class="body-2 ma-0">
{{ label.Name }}
</span>
@@ -118,14 +97,7 @@
<v-icon>edit</v-icon>
</span>
<template #input>
<v-text-field
v-model="label.Name"
:rules="[titleRule]"
:label="$gettext('Name')"
color="secondary-dark"
class="input-rename background-inherit elevation-0"
single-line autofocus solo hide-details
></v-text-field>
<v-text-field v-model="label.Name" :rules="[titleRule]" :label="$gettext('Name')" color="secondary-dark" class="input-rename background-inherit elevation-0" single-line autofocus solo hide-details></v-text-field>
</template>
</v-edit-dialog>
<span v-else class="body-2 ma-0">
@@ -133,8 +105,7 @@
</span>
</v-card-title>
<v-card-text primary-title class="pb-2 pt-0 card-details" style="user-select: none;"
@click.stop.prevent="">
<v-card-text primary-title class="pb-2 pt-0 card-details" style="user-select: none" @click.stop.prevent="">
<div class="caption mb-2">
<button v-if="label.PhotoCount === 1">
<translate>Contains one picture.</translate>
@@ -161,7 +132,7 @@ import Notify from "common/notify";
import { Input, InputInvalid, ClickShort, ClickLong } from "common/input";
export default {
name: 'PPageLabels',
name: "PPageLabels",
props: {
staticFilter: {
type: Object,
@@ -171,8 +142,8 @@ export default {
data() {
const query = this.$route.query;
const routeName = this.$route.name;
const q = query['q'] ? query['q'] : '';
const all = query['all'] ? query['all'] : '';
const q = query["q"] ? query["q"] : "";
const all = query["all"] ? query["all"] : "";
const canManage = this.$config.allow("labels", "manage");
const canAddAlbums = this.$config.allow("albums", "create") && this.$config.feature("albums");
@@ -180,7 +151,7 @@ export default {
return {
canManage: canManage,
canSelect: canManage || canAddAlbums,
view: 'all',
view: "all",
config: this.$config.values,
subscriptions: [],
listen: false,
@@ -197,19 +168,19 @@ export default {
filter: { q, all },
lastFilter: {},
routeName: routeName,
titleRule: v => v.length <= this.$config.get('clip') || this.$gettext("Name too long"),
titleRule: (v) => v.length <= this.$config.get("clip") || this.$gettext("Name too long"),
input: new Input(),
lastId: "",
};
},
watch: {
'$route'() {
$route() {
const query = this.$route.query;
this.routeName = this.$route.name;
this.lastFilter = {};
this.filter.q = query['q'] ? query['q'] : '';
this.filter.all = query['all'] ? query['all'] : '';
this.filter.q = query["q"] ? query["q"] : "";
this.filter.all = query["all"] ? query["all"] : "";
this.search();
},
@@ -285,7 +256,7 @@ export default {
this.addSelection(models[i].getId());
}
return (rangeEnd - rangeStart) + 1;
return rangeEnd - rangeStart + 1;
},
onSelect(ev, index) {
if (!this.canSelect) {
@@ -420,10 +391,11 @@ export default {
this.results = [];
}
Label.search(params).then(resp => {
this.results = (offset === 0) ? resp.models : this.results.concat(resp.models);
Label.search(params)
.then((resp) => {
this.results = offset === 0 ? resp.models : this.results.concat(resp.models);
this.scrollDisabled = (resp.count < resp.limit);
this.scrollDisabled = resp.count < resp.limit;
if (this.scrollDisabled) {
this.setOffset(resp.offset);
@@ -440,9 +412,11 @@ export default {
}
});
}
}).catch(() => {
})
.catch(() => {
this.scrollDisabled = false;
}).finally(() => {
})
.finally(() => {
this.dirty = false;
this.loading = false;
this.listen = true;
@@ -492,7 +466,7 @@ export default {
if (this.loading) return;
const query = {
view: this.settings.view
view: this.settings.view,
};
Object.assign(query, this.filter);
@@ -562,11 +536,12 @@ export default {
const params = this.searchParams();
Label.search(params).then(resp => {
Label.search(params)
.then((resp) => {
this.offset = resp.limit;
this.results = resp.models;
this.scrollDisabled = (resp.count < resp.limit);
this.scrollDisabled = resp.count < resp.limit;
if (this.scrollDisabled) {
if (!this.results.length) {
@@ -584,7 +559,8 @@ export default {
}
});
}
}).finally(() => {
})
.finally(() => {
this.dirty = false;
this.loading = false;
this.listen = true;
@@ -597,10 +573,10 @@ export default {
return;
}
const type = ev.split('.')[1];
const type = ev.split(".")[1];
switch (type) {
case 'updated':
case "updated":
for (let i = 0; i < data.entities.length; i++) {
const values = data.entities[i];
const model = this.results.find((m) => m.UID === values.UID);
@@ -614,7 +590,7 @@ export default {
}
}
break;
case 'deleted':
case "deleted":
this.dirty = true;
for (let i = 0; i < data.entities.length; i++) {
@@ -629,13 +605,13 @@ export default {
}
break;
case 'created':
case "created":
this.dirty = true;
break;
default:
console.warn("unexpected event type", ev);
}
}
},
},
};
</script>

View File

@@ -1,15 +1,7 @@
<template>
<div :class="$config.aclClasses('library')" class="p-page p-page-library">
<v-tabs
v-model="active"
flat
grow
color="secondary"
slider-color="secondary-dark"
:height="$vuetify.breakpoint.smAndDown ? 48 : 64"
>
<v-tab v-for="(item, index) in tabs" :id="'tab-' + item.name" :key="index" :class="item.class" ripple
@click="changePath(item.path)">
<v-tabs v-model="active" flat grow color="secondary" slider-color="secondary-dark" :height="$vuetify.breakpoint.smAndDown ? 48 : 64">
<v-tab v-for="(item, index) in tabs" :id="'tab-' + item.name" :key="index" :class="item.class" ripple @click="changePath(item.path)">
<v-icon v-if="$vuetify.breakpoint.smAndDown" :title="item.label">{{ item.icon }}</v-icon>
<template v-else>
<v-icon :size="18" :left="!rtl" :right="rtl">{{ item.icon }}</v-icon> {{ item.label }}
@@ -42,7 +34,7 @@ function initTabs(flag, tabs) {
}
export default {
name: 'PPageLibrary',
name: "PPageLibrary",
props: {
tab: {
type: String,
@@ -54,41 +46,41 @@ export default {
const isDemo = this.$config.get("demo");
const isPublic = this.$config.get("public");
const isReadOnly = this.$config.get("readonly");
const canImport = this.$config.feature('import') && !isReadOnly;
const canImport = this.$config.feature("import") && !isReadOnly;
const tabs = [
{
'name': 'library_index',
'component': Index,
'label': this.$gettext('Index'),
'class': '',
'path': '/index',
'icon': 'camera_roll',
'readonly': true,
'demo': true,
name: "library_index",
component: Index,
label: this.$gettext("Index"),
class: "",
path: "/index",
icon: "camera_roll",
readonly: true,
demo: true,
},
{
'name': 'library_import',
'component': Import,
'label': this.$gettext('Import'),
'class': '',
'path': '/import',
'icon': 'create_new_folder',
'readonly': false,
'demo': true,
name: "library_import",
component: Import,
label: this.$gettext("Import"),
class: "",
path: "/import",
icon: "create_new_folder",
readonly: false,
demo: true,
},
];
if(this.$config.feature('logs')) {
if (this.$config.feature("logs")) {
tabs.push({
'name': 'library_logs',
'component': Logs,
'label': this.$gettext('Logs'),
'class': '',
'path': '/logs',
'icon': 'feed',
'readonly': true,
'demo': true,
name: "library_logs",
component: Logs,
label: this.$gettext("Logs"),
class: "",
path: "/logs",
icon: "feed",
readonly: true,
demo: true,
});
}
@@ -102,9 +94,9 @@ export default {
let active = 0;
if (typeof this.$route.name === 'string' && this.$route.name !== '') {
if (typeof this.$route.name === "string" && this.$route.name !== "") {
active = tabs.findIndex((t) => t.name === this.$route.name);
} else if (typeof this.tab === 'string' && this.tab !== '') {
} else if (typeof this.tab === "string" && this.tab !== "") {
active = tabs.findIndex((t) => t.name === this.tab);
}
@@ -123,17 +115,17 @@ export default {
};
},
watch: {
'$route'() {
$route() {
let active = this.active;
if (typeof this.$route.name === 'string' && this.$route.name !== '') {
if (typeof this.$route.name === "string" && this.$route.name !== "") {
active = this.tabs.findIndex((t) => t.name === this.$route.name);
}
if (active >= 0) {
this.active = active;
}
}
},
},
created() {
if (!this.tabs || this.tabs.length === 0) {
@@ -145,7 +137,7 @@ export default {
if (this.$route.path !== path) {
this.$router.replace(path);
}
}
}
},
},
};
</script>

View File

@@ -25,16 +25,12 @@
<v-progress-linear color="secondary-dark" :indeterminate="true"></v-progress-linear>
</v-container>
<v-container v-else fluid class="pa-0">
<p-file-clipboard :refresh="refresh" :selection="selection"
:clear-selection="clearSelection"></p-file-clipboard>
<p-file-clipboard :refresh="refresh" :selection="selection" :clear-selection="clearSelection"></p-file-clipboard>
<p-scroll-top></p-scroll-top>
<v-container grid-list-xs fluid class="pa-2 p-files p-files-cards">
<v-alert
:value="results.length === 0"
color="secondary-dark" icon="lightbulb_outline" class="no-results ma-2 opacity-70" outline
>
<v-alert :value="results.length === 0" color="secondary-dark" icon="lightbulb_outline" class="no-results ma-2 opacity-70" outline>
<h3 class="body-2 ma-0 pa-0">
<translate>No pictures found</translate>
</h3>
@@ -44,17 +40,8 @@
</p>
</v-alert>
<v-layout row wrap class="search-results file-results cards-view" :class="{ 'select-results': selection.length > 0 }">
<v-flex
v-for="(model, index) in results"
:key="model.UID"
xs6 sm4 md3 lg2 xxl1 d-flex
>
<v-card tile
:data-uid="model.UID"
class="result card"
:class="model.classes(selection.includes(model.UID))"
@contextmenu.stop="onContextMenu($event, index)"
>
<v-flex v-for="(model, index) in results" :key="model.UID" xs6 sm4 md3 lg2 xxl1 d-flex>
<v-card tile :data-uid="model.UID" class="result card" :class="model.classes(selection.includes(model.UID))" @contextmenu.stop="onContextMenu($event, index)">
<div class="card-background card"></div>
<v-img
:src="model.thumbnailUrl('tile_500')"
@@ -68,20 +55,13 @@
@mousedown.stop.prevent="input.mouseDown($event, index)"
@click.stop.prevent="onClick($event, index)"
>
<v-btn :ripple="false"
icon flat absolute
class="input-select"
@touchstart.stop.prevent="input.touchStart($event, index)"
@touchend.stop.prevent="onSelect($event, index)"
@touchmove.stop.prevent
@click.stop.prevent="onSelect($event, index)">
<v-btn :ripple="false" icon flat absolute class="input-select" @touchstart.stop.prevent="input.touchStart($event, index)" @touchend.stop.prevent="onSelect($event, index)" @touchmove.stop.prevent @click.stop.prevent="onSelect($event, index)">
<v-icon color="white" class="select-on">check_circle</v-icon>
<v-icon color="white" class="select-off">radio_button_off</v-icon>
</v-btn>
</v-img>
<v-card-title v-if="model.isFile()" primary-title class="pa-3 card-details"
style="user-select: none;">
<v-card-title v-if="model.isFile()" primary-title class="pa-3 card-details" style="user-select: none">
<div>
<h3 class="body-2 mb-2" :title="model.Name">
<button @click.exact="openFile(index)">
@@ -123,7 +103,7 @@ import download from "common/download";
import { Input, InputInvalid, ClickShort, ClickLong } from "common/input";
export default {
name: 'PPageFiles',
name: "PPageFiles",
props: {
staticFilter: {
type: Object,
@@ -133,14 +113,14 @@ export default {
data() {
const query = this.$route.query;
const routeName = this.$route.name;
const q = query['q'] ? query['q'] : '';
const all = query['all'] ? query['all'] : '';
const q = query["q"] ? query["q"] : "";
const all = query["all"] ? query["all"] : "";
const filter = { q: q, all: all };
const settings = {};
return {
config: this.$config.values,
navIcon: this.$rtl ? 'navigate_before' : 'navigate_next',
navIcon: this.$rtl ? "navigate_before" : "navigate_next",
subscriptions: [],
listen: false,
dirty: false,
@@ -157,24 +137,24 @@ export default {
limit: 999,
offset: 0,
},
titleRule: v => v.length <= this.$config.get('clip') || this.$gettext("Name too long"),
titleRule: (v) => v.length <= this.$config.get("clip") || this.$gettext("Name too long"),
input: new Input(),
lastId: "",
breadcrumbs: [],
};
},
watch: {
'$route'() {
$route() {
const query = this.$route.query;
this.filter.q = query['q'] ? query['q'] : '';
this.filter.all = query['all'] ? query['all'] : '';
this.filter.q = query["q"] ? query["q"] : "";
this.filter.all = query["all"] ? query["all"] : "";
this.lastFilter = {};
this.routeName = this.$route.name;
this.path = this.$route.params.pathMatch;
this.search();
}
},
},
created() {
if (this.$config.deny("files", "access_library")) {
@@ -201,7 +181,7 @@ export default {
const crumbs = this.path.split("/");
crumbs.forEach(dir => {
crumbs.forEach((dir) => {
if (dir) {
path += "/" + dir;
result.push({ path: path, name: dir });
@@ -220,7 +200,7 @@ export default {
// "#" chars in path names must be explicitly escaped,
// see https://github.com/photoprism/photoprism/issues/3695
const path = model.Path.replaceAll(":", "%3A").replaceAll("#", "%23");
this.$router.push({path: '/index/files/' + path});
this.$router.push({ path: "/index/files/" + path });
}
},
downloadFile(index) {
@@ -252,7 +232,7 @@ export default {
this.addSelection(models[i].getId());
}
return (rangeEnd - rangeStart) + 1;
return rangeEnd - rangeStart + 1;
},
onSelect(ev, index) {
const inputType = this.input.eval(ev, index);
@@ -310,7 +290,7 @@ export default {
this.updateQuery();
},
clearQuery() {
this.filter.q = '';
this.filter.q = "";
this.updateQuery();
},
addSelection(uid) {
@@ -358,7 +338,7 @@ export default {
this.filter.q = this.filter.q.trim();
const query = {
view: this.settings.view
view: this.settings.view,
};
Object.assign(query, this.filter);
@@ -400,7 +380,7 @@ export default {
},
search() {
// Don't query the same data more than once
if (!this.dirty && (JSON.stringify(this.lastFilter) === JSON.stringify(this.filter))) {
if (!this.dirty && JSON.stringify(this.lastFilter) === JSON.stringify(this.filter)) {
this.loading = false;
this.listen = true;
return;
@@ -415,18 +395,19 @@ export default {
const params = this.searchParams();
Folder.originals(this.path, params).then(response => {
Folder.originals(this.path, params)
.then((response) => {
this.files.offset = this.files.limit;
this.results = response.models;
this.breadcrumbs = this.getBreadcrumbs();
if (response.count === 0) {
this.$notify.warn(this.$gettext('Folder is empty'));
this.$notify.warn(this.$gettext("Folder is empty"));
} else if (response.files === 1) {
this.$notify.info(this.$gettext('One file found'));
this.$notify.info(this.$gettext("One file found"));
} else if (response.files === 0 && response.folders === 1) {
this.$notify.info(this.$gettext('One folder found'));
this.$notify.info(this.$gettext("One folder found"));
} else if (response.files === 0 && response.folders > 1) {
this.$notify.info(this.$gettextInterpolate(this.$gettext("%{n} folders found"), { n: response.folders }));
} else if (response.files < this.files.limit) {
@@ -434,7 +415,8 @@ export default {
} else {
this.$notify.warn(this.$gettextInterpolate(this.$gettext("Limit reached, showing first %{n} files"), { n: response.files }));
}
}).finally(() => {
})
.finally(() => {
this.dirty = false;
this.loading = false;
this.listen = true;
@@ -447,10 +429,10 @@ export default {
return;
}
const type = ev.split('.')[1];
const type = ev.split(".")[1];
switch (type) {
case 'updated':
case "updated":
for (let i = 0; i < data.entities.length; i++) {
const values = data.entities[i];
const model = this.results.find((m) => m.UID === values.UID);
@@ -462,7 +444,7 @@ export default {
}
}
break;
case 'deleted':
case "deleted":
this.dirty = true;
for (let i = 0; i < data.entities.length; i++) {
@@ -477,13 +459,13 @@ export default {
}
break;
case 'created':
case "created":
this.dirty = true;
break;
default:
console.warn("unexpected event type", ev);
}
}
},
},
};
</script>

View File

@@ -1,9 +1,14 @@
<template>
<div v-infinite-scroll="loadMore" class="p-page p-page-errors" :infinite-scroll-disabled="scrollDisabled"
:infinite-scroll-distance="scrollDistance" :infinite-scroll-listen-for-event="'scrollRefresh'">
<div v-infinite-scroll="loadMore" class="p-page p-page-errors" :infinite-scroll-disabled="scrollDisabled" :infinite-scroll-distance="scrollDistance" :infinite-scroll-listen-for-event="'scrollRefresh'">
<v-toolbar flat :dense="$vuetify.breakpoint.smAndDown" class="page-toolbar" color="secondary">
<v-text-field :value="filter.q"
solo hide-details clearable overflow single-line validate-on-blur
<v-text-field
:value="filter.q"
solo
hide-details
clearable
overflow
single-line
validate-on-blur
class="input-search background-inherit elevation-0"
browser-autocomplete="off"
autocorrect="off"
@@ -11,9 +16,17 @@
:label="$gettext('Search')"
prepend-inner-icon="search"
color="secondary-dark"
@change="(v) => {updateFilter({'q': v})}"
@keyup.enter.native="(e) => updateQuery({'q': e.target.value})"
@click:clear="() => {updateQuery({'q': ''})}"
@change="
(v) => {
updateFilter({ q: v });
}
"
@keyup.enter.native="(e) => updateQuery({ q: e.target.value })"
@click:clear="
() => {
updateQuery({ q: '' });
}
"
></v-text-field>
<v-spacer></v-spacer>
<v-btn icon class="action-reload" :title="$gettext('Reload')" @click.stop="onReload()">
@@ -22,8 +35,7 @@
<v-btn v-if="!isPublic" icon class="action-delete" :title="$gettext('Delete')" @click.stop="onDelete()">
<v-icon>delete</v-icon>
</v-btn>
<v-btn icon href="https://docs.photoprism.app/getting-started/troubleshooting/" target="_blank" class="action-bug-report"
:title="$gettext('Troubleshooting Checklists')">
<v-btn icon href="https://docs.photoprism.app/getting-started/troubleshooting/" target="_blank" class="action-bug-report" :title="$gettext('Troubleshooting Checklists')">
<v-icon>bug_report</v-icon>
</v-btn>
</v-toolbar>
@@ -31,12 +43,7 @@
<v-progress-linear color="secondary-dark" :indeterminate="true"></v-progress-linear>
</v-container>
<v-list v-else-if="errors.length > 0" dense two-line class="transparent pa-1">
<v-list-tile
v-for="err in errors" :key="err.ID"
avatar
class="rounded-4"
@click="showDetails(err)"
>
<v-list-tile v-for="err in errors" :key="err.ID" avatar class="rounded-4" @click="showDetails(err)">
<v-list-tile-avatar>
<v-icon :color="err.Level">{{ err.Level }}</v-icon>
</v-list-tile-avatar>
@@ -48,10 +55,7 @@
</v-list-tile>
</v-list>
<div v-else class="pa-2">
<v-alert
:value="true"
color="secondary-dark" icon="check_circle_outline" class="no-results ma-2 opacity-70" outline
>
<v-alert :value="true" color="secondary-dark" icon="check_circle_outline" class="no-results ma-2 opacity-70" outline>
<p class="body-1 mt-0 mb-0 pa-0">
<template v-if="filter.q !== ''">
<translate>No warnings or error containing this keyword. Note that search is case-sensitive.</translate>
@@ -62,12 +66,8 @@
</p>
</v-alert>
</div>
<p-confirm-dialog :show="dialog.delete" icon="delete_outline" @cancel="dialog.delete = false"
@confirm="onConfirmDelete"></p-confirm-dialog>
<v-dialog
v-model="details.show"
max-width="500"
>
<p-confirm-dialog :show="dialog.delete" icon="delete_outline" @cancel="dialog.delete = false" @confirm="onConfirmDelete"></p-confirm-dialog>
<v-dialog v-model="details.show" max-width="500">
<v-card class="pa-2">
<v-card-title class="headline pa-2">
{{ details.err.Level | capitalize }}
@@ -83,8 +83,7 @@
<v-card-actions class="pa-2">
<v-spacer></v-spacer>
<v-btn color="secondary-light" depressed class="action-close"
@click="details.show = false">
<v-btn color="secondary-light" depressed class="action-close" @click="details.show = false">
<translate>Close</translate>
</v-btn>
</v-card-actions>
@@ -98,7 +97,7 @@ import {DateTime} from "luxon";
import Api from "common/api";
export default {
name: 'PPageErrors',
name: "PPageErrors",
data() {
const query = this.$route.query;
const q = query["q"] ? query["q"] : "";
@@ -119,16 +118,16 @@ export default {
},
details: {
show: false,
err: {"Level": "", "Message": "", "Time": ""},
err: { Level: "", Message: "", Time: "" },
},
};
},
watch: {
'$route'() {
$route() {
const query = this.$route.query;
this.filter.q = query['q'] ? query['q'] : '';
this.filter.q = query["q"] ? query["q"] : "";
this.onReload();
}
},
},
created() {
if (this.$config.deny("logs", "view")) {
@@ -200,14 +199,16 @@ export default {
this.scrollDisabled = true;
// Delete error logs.
Api.delete("errors").then((resp) => {
Api.delete("errors")
.then((resp) => {
if (resp && resp.data.code && resp.data.code === 200) {
this.errors = [];
this.dirty = false;
this.page = 0;
this.offset = 0;
}
}).finally(() => {
})
.finally(() => {
this.scrollDisabled = false;
this.loading = false;
});
@@ -239,7 +240,8 @@ export default {
const params = { count, offset, q };
// Fetch error logs.
Api.get("errors", {params}).then((resp) => {
Api.get("errors", { params })
.then((resp) => {
if (!resp.data) {
resp.data = [];
}
@@ -250,13 +252,14 @@ export default {
this.errors = this.errors.concat(resp.data);
}
this.scrollDisabled = (resp.data.length < count);
this.scrollDisabled = resp.data.length < count;
if (!this.scrollDisabled) {
this.offset = offset + count;
this.page++;
}
}).finally(() => {
})
.finally(() => {
this.loading = false;
this.dirty = false;
});

View File

@@ -14,7 +14,10 @@
color="secondary-dark"
class="my-3 input-import-folder"
hide-details
hide-no-data flat solo browser-autocomplete="off"
hide-no-data
flat
solo
browser-autocomplete="off"
:items="dirs"
:loading="loading"
:disabled="busy || !ready"
@@ -26,8 +29,7 @@
</v-autocomplete>
<p class="options">
<v-progress-linear color="secondary-dark" height="1.5em" :value="completed"
:indeterminate="busy"></v-progress-linear>
<v-progress-linear color="secondary-dark" height="1.5em" :value="completed" :indeterminate="busy"></v-progress-linear>
</p>
<v-layout wrap align-top class="pb-2">
@@ -55,34 +57,16 @@
</v-flex>
</v-layout>
<v-btn
:disabled="!busy || !ready"
color="primary-button"
class="white--text ml-0 action-cancel"
depressed
@click.stop="cancelImport()"
>
<v-btn :disabled="!busy || !ready" color="primary-button" class="white--text ml-0 action-cancel" depressed @click.stop="cancelImport()">
<translate>Cancel</translate>
</v-btn>
<v-btn v-if="!$config.values.readonly && $config.feature('upload')"
:disabled="busy || !ready"
color="primary-button"
class="white--text ml-0 hidden-xs-only action-upload"
depressed
@click.stop="showUpload()"
>
<v-btn v-if="!$config.values.readonly && $config.feature('upload')" :disabled="busy || !ready" color="primary-button" class="white--text ml-0 hidden-xs-only action-upload" depressed @click.stop="showUpload()">
<translate>Upload</translate>
<v-icon :right="!rtl" :left="rtl" dark>cloud_upload</v-icon>
</v-btn>
<v-btn
:disabled="busy || !ready"
color="primary-button"
class="white--text ml-0 mt-2 action-import"
depressed
@click.stop="startImport()"
>
<v-btn :disabled="busy || !ready" color="primary-button" class="white--text ml-0 mt-2 action-import" depressed @click.stop="startImport()">
<translate>Import</translate>
<v-icon :right="!rtl" :left="rtl" dark>sync</v-icon>
</v-btn>
@@ -101,9 +85,9 @@ import Util from "common/util";
import { Folder, RootImport } from "model/folder";
export default {
name: 'PTabImport',
name: "PTabImport",
data() {
const root = {"path": "/", "name": this.$gettext("All files from import folder")};
const root = { path: "/", name: this.$gettext("All files from import folder") };
return {
ready: !this.$config.loading(),
@@ -112,8 +96,8 @@ export default {
busy: false,
loading: false,
completed: 0,
subscriptionId: '',
fileName: '',
subscriptionId: "",
fileName: "",
source: null,
root: root,
dirs: [root],
@@ -121,7 +105,7 @@ export default {
};
},
created() {
this.subscriptionId = Event.subscribe('import', this.handleEvent);
this.subscriptionId = Event.subscribe("import", this.handleEvent);
this.load();
},
destroyed() {
@@ -136,12 +120,12 @@ export default {
if (this.settings.import.path !== this.root.path) {
this.dirs.push({
path: this.settings.import.path,
name: "/" + Util.truncate(this.settings.import.path, 100, "…")
name: "/" + Util.truncate(this.settings.import.path, 100, "…"),
});
}
this.ready = true;
})
});
},
onChange() {
if (!this.$config.values.disable.settings) {
@@ -155,7 +139,8 @@ export default {
this.loading = true;
Folder.findAllUncached(RootImport).then((r) => {
Folder.findAllUncached(RootImport)
.then((r) => {
const folders = r.models ? r.models : [];
const currentPath = this.settings.import.path;
let found = currentPath === this.root.path;
@@ -173,7 +158,8 @@ export default {
if (!found) {
this.settings.import.path = this.root.path;
}
}).finally(() => this.loading = false);
})
.finally(() => (this.loading = false));
},
showUpload() {
Event.publish("dialog.upload");
@@ -182,24 +168,26 @@ export default {
// DO NOTHING
},
cancelImport() {
Api.delete('import');
Api.delete("import");
},
startImport() {
this.source = Axios.CancelToken.source();
this.started = Date.now();
this.busy = true;
this.completed = 0;
this.fileName = '';
this.fileName = "";
const ctx = this;
Notify.blockUI();
Api.post('import', this.settings.import, {cancelToken: this.source.token}).then(function () {
Api.post("import", this.settings.import, { cancelToken: this.source.token })
.then(function () {
Notify.unblockUI();
ctx.busy = false;
ctx.completed = 100;
ctx.fileName = '';
}).catch(function (e) {
ctx.fileName = "";
})
.catch(function (e) {
Notify.unblockUI();
if (Axios.isCancel(e)) {
@@ -211,28 +199,28 @@ export default {
ctx.busy = false;
ctx.completed = 0;
ctx.fileName = '';
ctx.fileName = "";
});
},
handleEvent(ev, data) {
if (this.source) {
this.source.cancel('run in background');
this.source.cancel("run in background");
this.source = null;
Notify.unblockUI();
}
const type = ev.split('.')[1];
const type = ev.split(".")[1];
switch (type) {
case 'file':
case "file":
this.busy = true;
this.completed = 0;
this.fileName = data.baseName;
break;
case 'completed':
case "completed":
this.busy = false;
this.completed = 100;
this.fileName = '';
this.fileName = "";
break;
default:
console.log(data);

View File

@@ -15,7 +15,10 @@
color="secondary-dark"
class="my-3 input-index-folder"
hide-details
hide-no-data flat solo browser-autocomplete="off"
hide-no-data
flat
solo
browser-autocomplete="off"
:items="dirs"
:loading="loading"
:disabled="busy || !ready"
@@ -27,8 +30,7 @@
</v-autocomplete>
<p class="options">
<v-progress-linear color="secondary-dark" height="1.5em" :value="completed"
:indeterminate="busy"></v-progress-linear>
<v-progress-linear color="secondary-dark" height="1.5em" :value="completed" :indeterminate="busy"></v-progress-linear>
</p>
<v-layout wrap align-top class="pb-3">
@@ -47,49 +49,20 @@
</v-checkbox>
</v-flex>
<v-flex v-if="isAdmin" xs12 sm6 lg3 xl2 class="px-2 pb-2 pt-2">
<v-checkbox
v-model="cleanup"
:disabled="busy || !ready"
class="ma-0 pa-0"
color="secondary-dark"
:label="$gettext('Cleanup')"
:hint="$gettext('Delete orphaned index entries, sidecar files and thumbnails.')"
prepend-icon="delete_sweep"
persistent-hint
>
</v-checkbox>
<v-checkbox v-model="cleanup" :disabled="busy || !ready" class="ma-0 pa-0" color="secondary-dark" :label="$gettext('Cleanup')" :hint="$gettext('Delete orphaned index entries, sidecar files and thumbnails.')" prepend-icon="delete_sweep" persistent-hint> </v-checkbox>
</v-flex>
</v-layout>
<v-btn
:disabled="!busy || !ready"
color="primary-button"
class="white--text ml-0 mt-2 action-cancel"
depressed
@click.stop="cancelIndexing()"
>
<v-btn :disabled="!busy || !ready" color="primary-button" class="white--text ml-0 mt-2 action-cancel" depressed @click.stop="cancelIndexing()">
<translate>Cancel</translate>
</v-btn>
<v-btn
:disabled="busy || !ready"
color="primary-button"
class="white--text ml-0 mt-2 action-index"
depressed
@click.stop="startIndexing()"
>
<v-btn :disabled="busy || !ready" color="primary-button" class="white--text ml-0 mt-2 action-index" depressed @click.stop="startIndexing()">
<translate>Start</translate>
<v-icon :right="!rtl" :left="rtl" dark>update</v-icon>
</v-btn>
<v-alert
v-if="ready && !busy && config.count.hidden > 1"
:value="true"
color="error"
icon="priority_high"
class="mt-3"
outline
>
<v-alert v-if="ready && !busy && config.count.hidden > 1" :value="true" color="error" icon="priority_high" class="mt-3" outline>
<translate :translate-params="{ n: config.count.hidden }">The index currently contains %{n} hidden files.</translate>
<translate>Their format may not be supported, they haven't been converted to JPEG yet or there are duplicates.</translate>
</v-alert>
@@ -108,9 +81,9 @@ import Util from "common/util";
import { Folder, RootOriginals } from "model/folder";
export default {
name: 'PTabIndex',
name: "PTabIndex",
data() {
const root = {"path": "/", "name": this.$gettext("All originals")};
const root = { path: "/", name: this.$gettext("All originals") };
return {
ready: !this.$config.loading(),
@@ -133,7 +106,7 @@ export default {
};
},
created() {
this.subscriptionId = Event.subscribe('index', this.handleEvent);
this.subscriptionId = Event.subscribe("index", this.handleEvent);
this.load();
},
destroyed() {
@@ -148,7 +121,7 @@ export default {
if (this.settings.index.path !== this.root.path) {
this.dirs.push({
path: this.settings.index.path,
name: "/" + Util.truncate(this.settings.index.path, 100, "…")
name: "/" + Util.truncate(this.settings.index.path, 100, "…"),
});
}
@@ -167,7 +140,8 @@ export default {
this.loading = true;
Folder.findAll(RootOriginals).then((r) => {
Folder.findAll(RootOriginals)
.then((r) => {
const folders = r.models ? r.models : [];
const currentPath = this.settings.index.path;
let found = currentPath === this.root.path;
@@ -185,20 +159,21 @@ export default {
if (!found) {
this.settings.index.path = this.root.path;
}
}).finally(() => this.loading = false);
})
.finally(() => (this.loading = false));
},
submit() {
// DO NOTHING
},
cancelIndexing() {
Api.delete('index');
Api.delete("index");
},
startIndexing() {
this.source = Axios.CancelToken.source();
this.started = Date.now();
this.busy = true;
this.completed = 0;
this.fileName = '';
this.fileName = "";
const ctx = this;
Notify.blockUI();
@@ -211,12 +186,14 @@ export default {
};
// Submit POST request.
Api.post('index', params, {cancelToken: this.source.token}).then(function () {
Api.post("index", params, { cancelToken: this.source.token })
.then(function () {
Notify.unblockUI();
ctx.busy = false;
ctx.completed = 100;
ctx.fileName = '';
}).catch(function (e) {
ctx.fileName = "";
})
.catch(function (e) {
Notify.unblockUI();
if (Axios.isCancel(e)) {
@@ -228,17 +205,17 @@ export default {
ctx.busy = false;
ctx.completed = 0;
ctx.fileName = '';
ctx.fileName = "";
});
},
handleEvent(ev, data) {
if (this.source) {
this.source.cancel('run in background');
this.source.cancel("run in background");
this.source = null;
Notify.unblockUI();
}
const type = ev.split('.')[1];
const type = ev.split(".")[1];
switch (type) {
case "folder":
@@ -284,11 +261,11 @@ export default {
this.completed = 0;
this.fileName = data.fileName;
break;
case 'completed':
case "completed":
this.action = "";
this.busy = false;
this.completed = 100;
this.fileName = '';
this.fileName = "";
break;
default:
console.log(data);

View File

@@ -1,7 +1,7 @@
<template>
<v-container fluid fill-height class="pa-0 ma-0 p-tab p-tab-logs">
<v-layout row wrap fill-height class="pa-0 ma-3">
<v-flex grow xs12 class="pa-2 terminal elevation-0 p-logs" style="overflow: auto;">
<v-flex grow xs12 class="pa-2 terminal elevation-0 p-logs" style="overflow: auto">
<p v-if="logs.length === 0" class="p-log-empty">
<translate>Nothing to see here yet.</translate>
</p>
@@ -17,14 +17,13 @@
import { DateTime } from "luxon";
export default {
name: 'PTabLogs',
name: "PTabLogs",
data() {
return {
logs: this.$log.logs,
};
},
created() {
},
created() {},
methods: {
level(log) {
return log.level.substr(0, 4).toUpperCase();

View File

@@ -1,16 +1,7 @@
<template>
<div class="p-page p-page-people" :class="$config.aclClasses('people')">
<v-tabs
v-model="active"
flat
grow
touchless
color="secondary"
slider-color="secondary-dark"
:height="$vuetify.breakpoint.smAndDown ? 48 : 64"
>
<v-tab v-for="(item, index) in tabs" :id="'tab-' + item.name" :key="index" :class="item.class"
ripple @click.stop.prevent="changePath(item.path)">
<v-tabs v-model="active" flat grow touchless color="secondary" slider-color="secondary-dark" :height="$vuetify.breakpoint.smAndDown ? 48 : 64">
<v-tab v-for="(item, index) in tabs" :id="'tab-' + item.name" :key="index" :class="item.class" ripple @click.stop.prevent="changePath(item.path)">
<v-icon v-if="$vuetify.breakpoint.smAndDown" :title="item.label">{{ item.icon }}</v-icon>
<template v-else>
<v-icon :size="18" :left="!rtl" :right="rtl">{{ item.icon }}</v-icon>
@@ -25,8 +16,7 @@
<v-tabs-items touchless>
<v-tab-item v-for="(item, index) in tabs" :key="index" lazy>
<component :is="item.component" :static-filter="item.filter" :active="active === index"
@updateFaceCount="onUpdateFaceCount"></component>
<component :is="item.component" :static-filter="item.filter" :active="active === index" @updateFaceCount="onUpdateFaceCount"></component>
</v-tab-item>
</v-tabs-items>
</v-tabs>
@@ -38,7 +28,7 @@ import Recognized from "page/people/recognized.vue";
import NewFaces from "page/people/new.vue";
export default {
name: 'PPagePeople',
name: "PPagePeople",
data() {
const config = this.$config.values;
const isDemo = this.$config.get("demo");
@@ -47,32 +37,32 @@ export default {
const tabs = [
{
'name': 'people',
'component': Recognized,
'filter': {files: 1, type: "person"},
'label': this.$gettext('Recognized'),
'class': '',
'path': '/people',
'icon': 'people_alt',
name: "people",
component: Recognized,
filter: { files: 1, type: "person" },
label: this.$gettext("Recognized"),
class: "",
path: "/people",
icon: "people_alt",
},
];
if (this.$config.allow("people", "manage")) {
tabs.push({
'name': 'people_faces',
'component': NewFaces,
'filter': {markers: true, unknown: true},
'label': this.$gettext('New'),
'class': '',
'path': '/people/new',
'icon': 'person_add',
'count': 0,
name: "people_faces",
component: NewFaces,
filter: { markers: true, unknown: true },
label: this.$gettext("New"),
class: "",
path: "/people/new",
icon: "person_add",
count: 0,
});
}
let active = 0;
if (typeof this.$route.name === 'string' && this.$route.name !== '') {
if (typeof this.$route.name === "string" && this.$route.name !== "") {
active = tabs.findIndex((t) => t.name === this.$route.name);
}
@@ -91,9 +81,9 @@ export default {
};
},
watch: {
'$route'() {
$route() {
this.openTab();
}
},
},
created() {
this.openTab();
@@ -113,7 +103,7 @@ export default {
if (this.$route.path !== path) {
this.$router.replace(path);
}
}
}
},
},
};
</script>

Some files were not shown because too many files have changed in this diff Show More