`;
@@ -43,10 +45,16 @@ const userPIN=prompt('Please enter your PIN:');
fetch(\`/api/\${action}/\${planId}\`,{method:actionMethod.get(action),body:JSON.stringify({name:userName,pin:userPIN,folder:newName,planName:newName})})
.catch((e)=>{e.text().then((text)=>{alert(text);});})
.then((r) => {
-if(r.status===200){localStorage.setItem('name',userName);r.text().then((text)=>{alert(text);location.reload();});}
+if(r.status===200){localStorage.setItem('name',userName);r.text().then((text)=>{alert(text);window.location.reload();});}
else{r.text().then((text)=>{alert(text);});}
});
}
+function openPlan(planId){window.open(\`${config.api.publicDomain}#/share/\${planId}\`);}
+async function sharePlan(planId){
+const link=\`${config.api.publicDomain}#/share/\${planId}\`;
+try{await navigator.clipboard.writeText(link);alert('Link copied to clipboard');}
+catch (error){prompt('Failed to copy to clipboard, please select and copy the link below:',link);}
+}
This is a very basic management page. Please excuse the number of alert/prompts that will come up when you click on things as it was the quickest way to build it out.
Please note: anything modifying data will require you to enter your PIN again as both the web view you are looking at and server behind it are completely stateless for simplicity.