Config: Rename edition to about in client config values
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
fb4bfe1b2f
commit
69d14997f4
12 changed files with 89 additions and 64 deletions
|
@ -9,8 +9,8 @@
|
|||
{{if .config.LegalUrl}}<a href="{{ .config.LegalUrl }}" target="_blank" class="legal-info">{{ .config.LegalInfo }}</a>
|
||||
{{else}}<span class="legal-info">{{ .config.LegalInfo }}</span>{{end}}
|
||||
{{else}}
|
||||
<div class="edition">
|
||||
{{ .config.Edition }}
|
||||
<div class="about">
|
||||
{{ .config.About }}
|
||||
</div>
|
||||
<div class="days">
|
||||
<span class="quote-0">One picture is worth a thousand words.</span>
|
||||
|
|
|
@ -36,7 +36,7 @@ var version = "development"
|
|||
var log = event.Log
|
||||
|
||||
const appName = "PhotoPrism"
|
||||
const appEdition = "PhotoPrism® CE"
|
||||
const appAbout = "PhotoPrism® CE"
|
||||
const appDescription = "PhotoPrism® is an AI-Powered Photos App for the Decentralized Web." +
|
||||
" It makes use of the latest technologies to tag and find pictures automatically without getting in your way." +
|
||||
" You can run it at home, on a private server, or in the cloud."
|
||||
|
@ -45,7 +45,7 @@ const appCopyright = "(c) 2018-2022 PhotoPrism UG. All rights reserved."
|
|||
// Metadata contains build specific information.
|
||||
var Metadata = map[string]interface{}{
|
||||
"Name": appName,
|
||||
"Edition": appEdition,
|
||||
"About": appAbout,
|
||||
"Description": appDescription,
|
||||
"Version": version,
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ func main() {
|
|||
}()
|
||||
|
||||
app := cli.NewApp()
|
||||
app.Usage = appEdition
|
||||
app.Usage = appAbout
|
||||
app.Description = appDescription
|
||||
app.Version = version
|
||||
app.Copyright = appCopyright
|
||||
|
|
|
@ -596,11 +596,21 @@ export default class Config {
|
|||
return name;
|
||||
}
|
||||
|
||||
getAbout() {
|
||||
const about = this.get("about");
|
||||
|
||||
if (!about) {
|
||||
return "PhotoPrism® Dev";
|
||||
}
|
||||
|
||||
return about;
|
||||
}
|
||||
|
||||
getEdition() {
|
||||
const edition = this.get("edition");
|
||||
|
||||
if (!edition) {
|
||||
return "PhotoPrism® Dev";
|
||||
return "ce";
|
||||
}
|
||||
|
||||
return edition;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<v-card-actions class="footer-actions">
|
||||
<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">{{ $config.getEdition() }}</router-link></strong>
|
||||
<strong><router-link to="/about" class="text-link">{{ $config.getAbout() }}</router-link></strong>
|
||||
<span class="body-link text-selectable">Build <a href="https://docs.photoprism.app/release-notes/" target="_blank" :title="version" class="body-link">{{ build }}</a></span>
|
||||
</v-flex>
|
||||
|
||||
|
|
|
@ -521,7 +521,7 @@
|
|||
|
||||
<v-list-tile v-show="auth && !isPublic && $config.feature('settings')" class="p-profile" @click.stop="onAccount">
|
||||
<v-list-tile-avatar size="36">
|
||||
<img :src="userAvatarURL" :alt="displayName">
|
||||
<img :src="userAvatarURL" :alt="accountInfo" :title="accountInfo">
|
||||
</v-list-tile-avatar>
|
||||
|
||||
<v-list-tile-content>
|
||||
|
@ -693,7 +693,7 @@ export default {
|
|||
canManagePeople: this.$config.allow("people", "manage"),
|
||||
appNameSuffix: appNameSuffix,
|
||||
appName: this.$config.getName(),
|
||||
appEdition: this.$config.getEdition(),
|
||||
appAbout: this.$config.getAbout(),
|
||||
appIcon: this.$config.getIcon(),
|
||||
indexing: false,
|
||||
drawer: null,
|
||||
|
|
|
@ -278,7 +278,7 @@
|
|||
color: #858581;
|
||||
}
|
||||
|
||||
#splash-info .edition {
|
||||
#splash-info .about {
|
||||
font-weight: 600;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ msgstr ""
|
|||
msgid "%{n} files uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/library/browse.vue:304
|
||||
#: src/page/library/browse.vue:311
|
||||
msgid "%{n} folders found"
|
||||
msgstr ""
|
||||
|
||||
|
@ -68,7 +68,7 @@ msgstr ""
|
|||
|
||||
#: src/component/navigation.vue:3
|
||||
#: src/component/navigation.vue:93
|
||||
#: src/component/navigation.vue:1907
|
||||
#: src/component/navigation.vue:1908
|
||||
#: src/dialog/share/upload.vue:108
|
||||
#: src/model/service.js:98
|
||||
#: src/model/user.js:144
|
||||
|
@ -366,7 +366,7 @@ msgid "Being 100% self-funded and independent, we can promise you that we will n
|
|||
msgstr ""
|
||||
|
||||
#: src/page/people/recognized.vue:434
|
||||
#: src/page/settings/account.vue:279
|
||||
#: src/page/settings/account.vue:280
|
||||
msgid "Bio"
|
||||
msgstr ""
|
||||
|
||||
|
@ -439,8 +439,8 @@ msgstr ""
|
|||
#: src/page/albums.vue:485
|
||||
#: src/page/labels.vue:204
|
||||
#: src/page/labels.vue:224
|
||||
#: src/page/library/browse.vue:194
|
||||
#: src/page/library/browse.vue:210
|
||||
#: src/page/library/browse.vue:201
|
||||
#: src/page/library/browse.vue:217
|
||||
#: src/page/people/new.vue:215
|
||||
#: src/page/people/new.vue:231
|
||||
#: src/page/people/recognized.vue:294
|
||||
|
@ -479,6 +479,10 @@ msgstr ""
|
|||
msgid "Category"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/settings/account.vue:251
|
||||
msgid "Change Avatar"
|
||||
msgstr ""
|
||||
|
||||
#: src/dialog/account/password.vue:7
|
||||
#: src/page/settings/account.vue:51
|
||||
msgid "Change Password"
|
||||
|
@ -496,8 +500,8 @@ msgstr ""
|
|||
msgid "Change private flag"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/settings/account.vue:106
|
||||
#: src/page/settings/account.vue:121
|
||||
#: src/page/settings/account.vue:114
|
||||
#: src/page/settings/account.vue:129
|
||||
#: src/page/settings/advanced.vue:42
|
||||
#: src/page/settings/general.vue:105
|
||||
#: src/page/settings/library.vue:50
|
||||
|
@ -609,7 +613,7 @@ msgstr ""
|
|||
|
||||
#: src/component/photo/toolbar.vue:178
|
||||
#: src/dialog/photo/edit/details.vue:248
|
||||
#: src/page/settings/account.vue:578
|
||||
#: src/page/settings/account.vue:579
|
||||
msgid "Country"
|
||||
msgstr ""
|
||||
|
||||
|
@ -650,7 +654,7 @@ msgid "Daily"
|
|||
msgstr ""
|
||||
|
||||
#: src/dialog/photo/edit/details.vue:116
|
||||
#: src/page/settings/account.vue:444
|
||||
#: src/page/settings/account.vue:445
|
||||
msgid "Day"
|
||||
msgstr ""
|
||||
|
||||
|
@ -828,7 +832,7 @@ msgstr ""
|
|||
#: src/component/photo/list.vue:124
|
||||
#: src/component/subject/clipboard.vue:55
|
||||
#: src/dialog/photo/edit/files.vue:69
|
||||
#: src/page/library/browse.vue:100
|
||||
#: src/page/library/browse.vue:107
|
||||
msgid "Downloading…"
|
||||
msgstr ""
|
||||
|
||||
|
@ -995,7 +999,7 @@ msgstr ""
|
|||
msgid "Feature Request"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/settings/account.vue:669
|
||||
#: src/page/settings/account.vue:670
|
||||
msgid "Feed"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1057,11 +1061,11 @@ msgstr ""
|
|||
msgid "Folder"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/library/browse.vue:306
|
||||
#: src/page/library/browse.vue:313
|
||||
msgid "Folder contains %{n} files"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/library/browse.vue:298
|
||||
#: src/page/library/browse.vue:305
|
||||
msgid "Folder is empty"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1285,12 +1289,12 @@ msgstr ""
|
|||
#: src/page/settings/account.vue:141
|
||||
#: src/page/settings/account.vue:167
|
||||
#: src/page/settings/account.vue:222
|
||||
#: src/page/settings/account.vue:278
|
||||
#: src/page/settings/account.vue:562
|
||||
#: src/page/settings/account.vue:589
|
||||
#: src/page/settings/account.vue:616
|
||||
#: src/page/settings/account.vue:644
|
||||
#: src/page/settings/account.vue:672
|
||||
#: src/page/settings/account.vue:279
|
||||
#: src/page/settings/account.vue:563
|
||||
#: src/page/settings/account.vue:590
|
||||
#: src/page/settings/account.vue:617
|
||||
#: src/page/settings/account.vue:645
|
||||
#: src/page/settings/account.vue:673
|
||||
msgid "Invalid"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1414,7 +1418,7 @@ msgstr ""
|
|||
msgid "Lime"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/library/browse.vue:308
|
||||
#: src/page/library/browse.vue:315
|
||||
msgid "Limit reached, showing first %{n} files"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1455,7 +1459,7 @@ msgstr ""
|
|||
#: src/component/photo/cards.vue:513
|
||||
#: src/component/photo/list.vue:138
|
||||
#: src/dialog/album/edit.vue:125
|
||||
#: src/page/settings/account.vue:559
|
||||
#: src/page/settings/account.vue:560
|
||||
msgid "Location"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1466,14 +1470,14 @@ msgstr ""
|
|||
|
||||
#: src/component/navigation.vue:454
|
||||
#: src/component/navigation.vue:1686
|
||||
#: src/component/navigation.vue:1959
|
||||
#: src/component/navigation.vue:1960
|
||||
msgid "Login"
|
||||
msgstr ""
|
||||
|
||||
#: src/component/navigation.vue:501
|
||||
#: src/component/navigation.vue:1796
|
||||
#: src/component/navigation.vue:1827
|
||||
#: src/component/navigation.vue:1878
|
||||
#: src/component/navigation.vue:1797
|
||||
#: src/component/navigation.vue:1828
|
||||
#: src/component/navigation.vue:1879
|
||||
msgid "Logout"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1551,7 +1555,7 @@ msgstr ""
|
|||
|
||||
#: src/component/photo/toolbar.vue:291
|
||||
#: src/dialog/photo/edit/details.vue:142
|
||||
#: src/page/settings/account.vue:467
|
||||
#: src/page/settings/account.vue:468
|
||||
msgid "Month"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1624,7 +1628,7 @@ msgstr ""
|
|||
#: src/dialog/photo/edit/labels.vue:25
|
||||
#: src/dialog/photo/edit/people.vue:24
|
||||
#: src/page/labels.vue:45
|
||||
#: src/page/library/browse.vue:41
|
||||
#: src/page/library/browse.vue:44
|
||||
#: src/page/people/new.vue:46
|
||||
#: src/page/people/recognized.vue:45
|
||||
msgid "Name too long"
|
||||
|
@ -1800,7 +1804,7 @@ msgstr ""
|
|||
msgid "One album found"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/library/browse.vue:300
|
||||
#: src/page/library/browse.vue:307
|
||||
msgid "One file found"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1808,7 +1812,7 @@ msgstr ""
|
|||
msgid "One file uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/library/browse.vue:302
|
||||
#: src/page/library/browse.vue:309
|
||||
msgid "One folder found"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1923,7 +1927,7 @@ msgstr ""
|
|||
msgid "Permanently remove files to free up storage."
|
||||
msgstr ""
|
||||
|
||||
#: src/page/settings/account.vue:613
|
||||
#: src/page/settings/account.vue:614
|
||||
msgid "Phone"
|
||||
msgstr ""
|
||||
|
||||
|
@ -2121,7 +2125,7 @@ msgid "Red"
|
|||
msgstr ""
|
||||
|
||||
#: src/component/album/toolbar.vue:64
|
||||
#: src/component/navigation.vue:1892
|
||||
#: src/component/navigation.vue:1893
|
||||
#: src/component/photo/toolbar.vue:54
|
||||
#: src/dialog/reload.vue:12
|
||||
#: src/page/albums.vue:126
|
||||
|
@ -2292,7 +2296,7 @@ msgstr ""
|
|||
#: src/component/navigation.vue:18
|
||||
#: src/component/navigation.vue:4
|
||||
#: src/component/navigation.vue:1520
|
||||
#: src/component/navigation.vue:1925
|
||||
#: src/component/navigation.vue:1926
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
|
@ -2608,8 +2612,8 @@ msgstr ""
|
|||
#: src/options/options.js:51
|
||||
#: src/options/options.js:65
|
||||
#: src/options/options.js:77
|
||||
#: src/page/library/errors.vue:168
|
||||
#: src/page/library/errors.vue:175
|
||||
#: src/page/library/errors.vue:173
|
||||
#: src/page/library/errors.vue:180
|
||||
#: src/page/library/logs.vue:18
|
||||
msgid "Unknown"
|
||||
msgstr ""
|
||||
|
@ -2617,6 +2621,7 @@ msgstr ""
|
|||
#: src/component/navigation.vue:82
|
||||
#: src/model/user.js:130
|
||||
#: src/page/settings/account.vue:35
|
||||
#: src/page/settings/account.vue:43
|
||||
msgid "Unregistered"
|
||||
msgstr ""
|
||||
|
||||
|
@ -2648,7 +2653,7 @@ msgstr ""
|
|||
msgid "Updating moments"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/settings/account.vue:116
|
||||
#: src/page/settings/account.vue:124
|
||||
msgid "Updating picture…"
|
||||
msgstr ""
|
||||
|
||||
|
@ -2661,7 +2666,7 @@ msgid "Updating stacks"
|
|||
msgstr ""
|
||||
|
||||
#: src/component/album/toolbar.vue:192
|
||||
#: src/component/navigation.vue:1943
|
||||
#: src/component/navigation.vue:1944
|
||||
#: src/component/photo/toolbar.vue:122
|
||||
#: src/dialog/share/upload.vue:35
|
||||
#: src/dialog/upload.vue:8
|
||||
|
@ -2811,7 +2816,7 @@ msgstr ""
|
|||
msgid "WebDAV Upload"
|
||||
msgstr ""
|
||||
|
||||
#: src/page/settings/account.vue:641
|
||||
#: src/page/settings/account.vue:642
|
||||
msgid "Website"
|
||||
msgstr ""
|
||||
|
||||
|
@ -2821,7 +2826,7 @@ msgstr ""
|
|||
|
||||
#: src/component/photo/toolbar.vue:268
|
||||
#: src/dialog/photo/edit/details.vue:168
|
||||
#: src/page/settings/account.vue:490
|
||||
#: src/page/settings/account.vue:491
|
||||
msgid "Year"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<footer v-if="sponsor">
|
||||
<v-layout wrap align-top pa-0 ma-0>
|
||||
<v-flex xs12 class="pa-0 body-2 text-selectable text-xs-center white--tex text-sm-left sm6">
|
||||
{{ $config.getEdition() }}
|
||||
{{ $config.getAbout() }}
|
||||
</v-flex>
|
||||
|
||||
<v-flex v-if="config.legalInfo" xs12 sm6 class="pa-0 body-2 text-xs-center text-sm-right white--text">
|
||||
|
|
|
@ -5,7 +5,7 @@ import StorageShim from "node-storage-shim";
|
|||
let chai = require("chai/chai");
|
||||
let assert = chai.assert;
|
||||
|
||||
const config2 = new Config(new StorageShim(), window.__CONFIG__);
|
||||
const defaultConfig = new Config(new StorageShim(), window.__CONFIG__);
|
||||
|
||||
describe("common/config", () => {
|
||||
it("should get all config values", () => {
|
||||
|
@ -78,25 +78,33 @@ describe("common/config", () => {
|
|||
assert.equal(result, "Berlin");
|
||||
});
|
||||
|
||||
it("should return app about", () => {
|
||||
assert.equal(defaultConfig.getAbout(), "PhotoPrism® CE");
|
||||
});
|
||||
|
||||
it("should return app edition", () => {
|
||||
assert.equal(defaultConfig.getEdition(), "ce");
|
||||
});
|
||||
|
||||
it("should return settings", () => {
|
||||
const result = config2.settings();
|
||||
const result = defaultConfig.settings();
|
||||
assert.equal(result.ui.theme, "default");
|
||||
assert.equal(result.ui.language, "en");
|
||||
});
|
||||
|
||||
it("should return feature", () => {
|
||||
assert.equal(config2.feature("places"), true);
|
||||
assert.equal(config2.feature("download"), true);
|
||||
assert.equal(defaultConfig.feature("places"), true);
|
||||
assert.equal(defaultConfig.feature("download"), true);
|
||||
});
|
||||
|
||||
it("should test get name", () => {
|
||||
const result = config2.getPerson("a");
|
||||
const result = defaultConfig.getPerson("a");
|
||||
assert.equal(result, null);
|
||||
|
||||
const result2 = config2.getPerson("Andrea Sander");
|
||||
const result2 = defaultConfig.getPerson("Andrea Sander");
|
||||
assert.equal(result2.UID, "jr0jgyx2viicdnf7");
|
||||
|
||||
const result3 = config2.getPerson("Otto Sander");
|
||||
const result3 = defaultConfig.getPerson("Otto Sander");
|
||||
assert.equal(result3.UID, "jr0jgyx2viicdn88");
|
||||
});
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
const clientConfig = {
|
||||
mode: "user",
|
||||
name: "PhotoPrism",
|
||||
about: "PhotoPrism® CE",
|
||||
edition: "ce",
|
||||
version: "210710-bae1f2d7-Linux-x86_64-DEBUG",
|
||||
copyright: "(c) 2018-2022 PhotoPrism UG. All rights reserved.",
|
||||
flags: "public debug experimental settings",
|
||||
|
|
|
@ -25,6 +25,7 @@ const (
|
|||
type ClientConfig struct {
|
||||
Mode string `json:"mode"`
|
||||
Name string `json:"name"`
|
||||
About string `json:"about"`
|
||||
Edition string `json:"edition"`
|
||||
Version string `json:"version"`
|
||||
Copyright string `json:"copyright"`
|
||||
|
@ -66,7 +67,6 @@ type ClientConfig struct {
|
|||
Countries entity.Countries `json:"countries"`
|
||||
People entity.People `json:"people"`
|
||||
Thumbs ThumbSizes `json:"thumbs"`
|
||||
Status string `json:"status"`
|
||||
MapKey string `json:"mapKey"`
|
||||
DownloadToken string `json:"downloadToken,omitempty"`
|
||||
PreviewToken string `json:"previewToken,omitempty"`
|
||||
|
@ -228,7 +228,8 @@ func (c *Config) ClientPublic() ClientConfig {
|
|||
Flags: strings.Join(c.Flags(), " "),
|
||||
Mode: string(ClientPublic),
|
||||
Name: c.Name(),
|
||||
Edition: c.Edition(),
|
||||
About: c.Edition(),
|
||||
Edition: c.Hub().Status,
|
||||
BaseUri: c.BaseUri(""),
|
||||
StaticUri: c.StaticUri(),
|
||||
CssUri: a.AppCssUri(),
|
||||
|
@ -264,7 +265,6 @@ func (c *Config) ClientPublic() ClientConfig {
|
|||
Lenses: entity.Lenses{},
|
||||
Countries: entity.Countries{},
|
||||
People: entity.People{},
|
||||
Status: "",
|
||||
MapKey: "",
|
||||
Thumbs: Thumbs,
|
||||
Colors: colors.All.List(),
|
||||
|
@ -304,7 +304,8 @@ func (c *Config) ClientShare() ClientConfig {
|
|||
Flags: strings.Join(c.Flags(), " "),
|
||||
Mode: string(ClientShare),
|
||||
Name: c.Name(),
|
||||
Edition: c.Edition(),
|
||||
About: c.Edition(),
|
||||
Edition: c.Hub().Status,
|
||||
BaseUri: c.BaseUri(""),
|
||||
StaticUri: c.StaticUri(),
|
||||
CssUri: a.AppCssUri(),
|
||||
|
@ -343,7 +344,6 @@ func (c *Config) ClientShare() ClientConfig {
|
|||
People: entity.People{},
|
||||
Colors: colors.All.List(),
|
||||
Thumbs: Thumbs,
|
||||
Status: c.Hub().Status,
|
||||
MapKey: c.Hub().MapKey(),
|
||||
DownloadToken: c.DownloadToken(),
|
||||
PreviewToken: c.PreviewToken(),
|
||||
|
@ -386,7 +386,8 @@ func (c *Config) ClientUser(withSettings bool) ClientConfig {
|
|||
Flags: strings.Join(c.Flags(), " "),
|
||||
Mode: string(ClientUser),
|
||||
Name: c.Name(),
|
||||
Edition: c.Edition(),
|
||||
About: c.Edition(),
|
||||
Edition: c.Hub().Status,
|
||||
BaseUri: c.BaseUri(""),
|
||||
StaticUri: c.StaticUri(),
|
||||
CssUri: a.AppCssUri(),
|
||||
|
@ -425,7 +426,6 @@ func (c *Config) ClientUser(withSettings bool) ClientConfig {
|
|||
People: entity.People{},
|
||||
Colors: colors.All.List(),
|
||||
Thumbs: Thumbs,
|
||||
Status: c.Hub().Status,
|
||||
MapKey: c.Hub().MapKey(),
|
||||
DownloadToken: c.DownloadToken(),
|
||||
PreviewToken: c.PreviewToken(),
|
||||
|
|
|
@ -164,7 +164,7 @@ func NewOptions(ctx *cli.Context) *Options {
|
|||
}
|
||||
|
||||
// Set app edition from metadata if possible.
|
||||
if s, ok := ctx.App.Metadata["Edition"]; ok {
|
||||
if s, ok := ctx.App.Metadata["About"]; ok {
|
||||
c.Edition = fmt.Sprintf("%s", s)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue