Add self-healing path relocation for multi-disk portability, macOS native folder picker, and double-clickable launch.command
This commit is contained in:
15
index.html
15
index.html
@@ -341,6 +341,7 @@ mark{background:rgba(34,211,238,.28);color:#fff;border-radius:2px;padding:0 1px}
|
||||
<div class="controls">
|
||||
<div class="folderRow">
|
||||
<input id="folder" spellcheck="false" placeholder="/path/to/your/photos">
|
||||
<button id="btnBrowseFolder" title="Open native macOS folder chooser">📁 Browse</button>
|
||||
<button id="btnScan">◈ Scan Directory</button>
|
||||
</div>
|
||||
<button id="btnStart" class="btn-primary" disabled>▶ Start Pipeline</button>
|
||||
@@ -991,6 +992,20 @@ async function api(path, body){
|
||||
return j;
|
||||
}
|
||||
|
||||
if($("btnBrowseFolder")){
|
||||
$("btnBrowseFolder").onclick = async ()=>{
|
||||
$("btnBrowseFolder").disabled = true;
|
||||
const j = await api("/api/choose_folder");
|
||||
$("btnBrowseFolder").disabled = false;
|
||||
if(j.ok && j.folder){
|
||||
$("folder").value = j.folder;
|
||||
showToast("Selected folder: " + j.folder, "ok");
|
||||
const scanRes = await api("/api/scan",{folder: j.folder});
|
||||
if(scanRes.images!=null){ scanned=true; setBadge("idle"); }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$("btnScan").onclick = async ()=>{
|
||||
const j = await api("/api/scan",{folder:$("folder").value});
|
||||
if(j.images!=null){ scanned=true; setBadge("idle"); }
|
||||
|
||||
Reference in New Issue
Block a user