Remove immich references from the UI
This commit is contained in:
@@ -33,14 +33,13 @@
|
||||
|
||||
<section class="rounded-2xl border bg-white dark:bg-gray-800 dark:border-gray-700 p-4 space-y-4">
|
||||
<div>
|
||||
<div class="text-sm font-medium mb-1">Target album (optional)</div>
|
||||
<div class="text-sm font-medium mb-1">Target folder (optional)</div>
|
||||
<div id="albumControls" class="space-y-2">
|
||||
<div id="albumSelectWrap" class="hidden">
|
||||
<select id="albumSelect" class="w-full rounded-lg border px-3 py-3 bg-white dark:bg-gray-900 dark:border-gray-700"></select>
|
||||
</div>
|
||||
<div id="albumInputWrap" class="hidden">
|
||||
<input id="albumInput" placeholder="Album name (leave blank for none)" class="w-full rounded-lg border px-3 py-3 bg-white dark:bg-gray-900 dark:border-gray-700" />
|
||||
<button id="btnCreateAlbum" class="mt-2 w-full sm:w-auto rounded-xl bg-black text-white px-4 py-3 dark:bg-white dark:text-black">Create album</button>
|
||||
<input id="albumInput" placeholder="New folder name (leave blank for public)" class="w-full rounded-lg border px-3 py-3 bg-white dark:bg-gray-900 dark:border-gray-700" />
|
||||
</div>
|
||||
<div id="albumHint" class="text-sm text-gray-500"></div>
|
||||
</div>
|
||||
@@ -103,7 +102,7 @@
|
||||
<th class="py-2" style="width: 18%;">Status</th>
|
||||
<th class="py-2">Uses</th>
|
||||
<th class="py-2">Expires</th>
|
||||
<th class="py-2">Album</th>
|
||||
<th class="py-2">Folder</th>
|
||||
<th class="py-2">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -119,7 +118,7 @@
|
||||
</section>
|
||||
|
||||
<section class="text-xs text-gray-500">
|
||||
If album listing or creation is forbidden by your token, specify a fixed album in the .env file as IMMICH_ALBUM_NAME.
|
||||
Admin link page
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -130,7 +129,6 @@
|
||||
const albumInputWrap = document.getElementById('albumInputWrap');
|
||||
const albumInput = document.getElementById('albumInput');
|
||||
const albumHint = document.getElementById('albumHint');
|
||||
const btnCreateAlbum = document.getElementById('btnCreateAlbum');
|
||||
const btnCreate = document.getElementById('btnCreate');
|
||||
const usage = document.getElementById('usage');
|
||||
const days = document.getElementById('days');
|
||||
@@ -159,29 +157,17 @@
|
||||
}
|
||||
const list = await r.json();
|
||||
if (Array.isArray(list)){
|
||||
const opts = [{id:'', name:'— No album —'}].concat(list.map(a => ({id:a.id, name:(a.albumName || a.title || a.id)})));
|
||||
const opts = [{id:'', name:'Select existing...'}].concat(list.map(a => ({id:a.id, name:(a.albumName || a.title || a.id)})));
|
||||
albumSelect.innerHTML = opts.map(a => `<option value="${a.id}">${a.name}</option>`).join('');
|
||||
albumSelectWrap.classList.remove('hidden');
|
||||
albumInputWrap.classList.remove('hidden');
|
||||
albumHint.textContent = 'Pick an existing album, or type a new name and click Create album. Select “— No album —” or leave the field blank to skip album association.';
|
||||
albumHint.textContent = 'Pick an existing folder, or type a new folder name.';
|
||||
}
|
||||
} catch (e) {
|
||||
albumHint.textContent = 'Failed to load albums.';
|
||||
}
|
||||
}
|
||||
|
||||
btnCreateAlbum.onclick = async () => {
|
||||
const name = albumInput.value.trim();
|
||||
if (!name) return;
|
||||
try{
|
||||
const r = await fetch('/api/albums', { method:'POST', headers:{'Content-Type':'application/json','Accept':'application/json'}, body: JSON.stringify({ name }) });
|
||||
const j = await r.json().catch(()=>({}));
|
||||
if(!r.ok){ showResult('err', j.error || 'Album create failed'); return; }
|
||||
showResult('ok', `Album created: ${j.albumName || j.id || name}`);
|
||||
try { await loadAlbums(); } catch {}
|
||||
}catch(err){ showResult('err', String(err)); }
|
||||
};
|
||||
|
||||
btnCreate.onclick = async () => {
|
||||
let albumId = null, albumName = null;
|
||||
if (!albumSelectWrap.classList.contains('hidden') && albumSelect.value) {
|
||||
|
||||
Reference in New Issue
Block a user