Frontend: Code clean-up

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-07-04 11:58:08 +02:00
parent 8899eb4894
commit 44c0c4a58b
2 changed files with 25 additions and 46 deletions

View file

@ -29,7 +29,6 @@ https://docs.photoprism.org/developer-guide/
*/
import Model from "./model";
import Api from "common/api";
import {DateTime} from "luxon";
import {$gettext} from "common/vm";
@ -90,26 +89,6 @@ export default class Link extends Model {
return new this.constructor(this.getValues());
}
/*find(id, params) {
return Api.get(this.getEntityResource(id), params).then((response) => Promise.resolve(new this.constructor(response.data)));
}
save() {
if (this.hasId()) {
return this.update();
}
return Api.post(this.constructor.getCollectionResource(), this.getValues()).then((response) => Promise.resolve(this.setValues(response.data)));
}
update() {
return Api.put(this.getEntityResource(), this.getValues(true)).then((response) => Promise.resolve(this.setValues(response.data)));
}
remove() {
return Api.delete(this.getEntityResource()).then(() => Promise.resolve(this));
}*/
expires() {
return DateTime.fromISO(this.UpdatedAt).plus({ seconds: this.Expires }).toLocaleString(DateTime.DATE_SHORT);
}

View file

@ -16,97 +16,97 @@ export const Months = () => {
result.push({"Month": -1, "Name": $gettext("Unknown")});
return result;
}
};
export const Languages = () => [
{
"text": $gettext("English"),
"value": "en"
"value": "en",
},
{
"text": $gettext("German"),
"value": "de"
"value": "de",
},
{
"text": $gettext("Dutch"),
"value": "nl"
"value": "nl",
},
{
"text": $gettext("Russian"),
"value": "ru"
}
"value": "ru",
},
];
export const Themes = () => [
{
"text": $gettext("Default"),
"value": "default"
"value": "default",
},
{
"text": $gettext("Cyano"),
"value": "cyano"
"value": "cyano",
},
{
"text": $gettext("Lavender"),
"value": "lavender"
"value": "lavender",
},
{
"text": $gettext("Moonlight"),
"value": "moonlight"
"value": "moonlight",
},
{
"text": $gettext("Onyx"),
"value": "onyx"
"value": "onyx",
},
{
"text": $gettext("Raspberry"),
"value": "raspberry"
"value": "raspberry",
},
{
"text": $gettext("Seaweed"),
"value": "seaweed"
}
"value": "seaweed",
},
];
export const MapsAnimate = () => [
{
"text": $gettext("None"),
"value": 0
"value": 0,
},
{
"text": $gettext("Fast"),
"value": 2500
"value": 2500,
},
{
"text": $gettext("Medium"),
"value": 6250
"value": 6250,
},
{
"text": $gettext("Slow"),
"value": 10000
}
"value": 10000,
},
];
export const MapsStyle = () => [
{
"text": $gettext("Offline"),
"value": "offline"
"value": "offline",
},
{
"text": $gettext("Streets"),
"value": "streets"
"value": "streets",
},
{
"text": $gettext("Hybrid"),
"value": "hybrid"
"value": "hybrid",
},
{
"text": $gettext("Topographic"),
"value": "topo"
"value": "topo",
},
{
"text": $gettext("Moonlight"),
"value": "darkmatter"
}
"value": "darkmatter",
},
];
export const Intervals = () => [