Add configurable title and subtitle v0.6.1
This commit is contained in:
1 parent
47b8d42295
commit
c2640cf75a
8 files changed
+34
-9
No files matched your search
+9
-2
@@ -29,8 +29,13 @@ from pillow_heif import register_heif_opener
|
||||
register_heif_opener()
|
||||
|
||||
APP_NAME = os.getenv("APP_NAME", "Photo Date Editor")
|
||||
APP_TITLE = os.getenv("APP_TITLE") or APP_NAME
|
||||
APP_SUBTITLE = (
|
||||
os.getenv("APP_SUBTITLE")
|
||||
or "Local folder · in-place JPG, PNG, TIFF and HEIF metadata"
|
||||
)
|
||||
APP_URL = os.getenv("APP_URL", "http://localhost:8080")
|
||||
APP_VERSION = "0.6.0"
|
||||
APP_VERSION = "0.6.1"
|
||||
MAX_UPLOAD_MB = int(os.getenv("MAX_UPLOAD_MB", "150"))
|
||||
MAX_UPLOAD_BYTES = MAX_UPLOAD_MB * 1024 * 1024
|
||||
PREVIEW_MAX_EDGE = int(os.getenv("PREVIEW_MAX_EDGE", "2400"))
|
||||
@@ -96,7 +101,7 @@ class FavoriteLocationInput(BaseModel):
|
||||
longitude: float = Field(ge=-180, le=180)
|
||||
|
||||
|
||||
app = FastAPI(title=APP_NAME, docs_url=None, redoc_url=None)
|
||||
app = FastAPI(title=APP_TITLE, docs_url=None, redoc_url=None)
|
||||
|
||||
|
||||
@app.get("/api/health")
|
||||
@@ -108,6 +113,8 @@ def health() -> dict[str, str]:
|
||||
def config() -> dict[str, str | int | float]:
|
||||
return {
|
||||
"appName": APP_NAME,
|
||||
"appTitle": APP_TITLE,
|
||||
"appSubtitle": APP_SUBTITLE,
|
||||
"appUrl": APP_URL,
|
||||
"version": APP_VERSION,
|
||||
"maxUploadMb": MAX_UPLOAD_MB,
|
||||
|
||||
+5
-2
@@ -20,6 +20,7 @@ const $$ = (selector) => [...document.querySelectorAll(selector)];
|
||||
|
||||
const elements = {
|
||||
appName: $('#app-name'),
|
||||
appSubtitle: $('#app-subtitle'),
|
||||
openButtons: [$('#open-folder'), $('#open-folder-top'), $('#open-folder-center')],
|
||||
rescan: $('#rescan-folder'),
|
||||
folderName: $('#folder-name'),
|
||||
@@ -1029,8 +1030,10 @@ async function initialise() {
|
||||
const response = await fetch('/api/config', { cache: 'no-store' });
|
||||
if (response.ok) {
|
||||
const config = await response.json();
|
||||
elements.appName.textContent = config.appName;
|
||||
document.title = config.appName;
|
||||
const pageTitle = config.appTitle || config.appName;
|
||||
elements.appName.textContent = pageTitle;
|
||||
elements.appSubtitle.textContent = config.appSubtitle;
|
||||
document.title = pageTitle;
|
||||
state.mapConfig = config;
|
||||
}
|
||||
} catch {}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="brand-mark" aria-hidden="true">◫</div>
|
||||
<div>
|
||||
<h1 id="app-name">Photo Date Editor</h1>
|
||||
<p>Local folder · in-place JPG, PNG, TIFF and HEIF metadata</p>
|
||||
<p id="app-subtitle">Local folder · in-place JPG, PNG, TIFF and HEIF metadata</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="top-actions">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const CACHE_NAME = 'photo-date-editor-v6-0';
|
||||
const CACHE_NAME = 'photo-date-editor-v6-1';
|
||||
const SHELL = ['/', '/styles.css', '/app.js', '/manifest.webmanifest', '/vendor/leaflet/leaflet.css', '/vendor/leaflet/leaflet.js'];
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
|
||||
Reference in new issue
Block a user