Skip to content

Commit

Permalink
Implement #43
Browse files Browse the repository at this point in the history
  • Loading branch information
jxmx committed Apr 3, 2024
1 parent a68ce7d commit 323d105
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/configmgr.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ <h2>Config Manager</h2>
</td>
</tr>
<tr>
<td colspan="2">
<td>
<button type="submit" class="btn btn-primary btn-sm">Save Config</button>
</td>
<td>
<button type="button" class="btn btn-danger btn-sm" onclick="clearBrowserConfig()">Clear Local Browser Config</button>
</td>
</tr>
</tbody>
</table>
Expand Down
12 changes: 12 additions & 0 deletions web/js/configmgr.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,15 @@ async function getConfig(){
window.addEventListener("load", async function(){
await getConfig();
});

function clearBrowserConfig(){
let d = new Date();
d.setTime(0);
let expires = "expires=" + d.toUTCString();
let cElements = [ "operator" , "band" , "mode" ];
for(let i in cElements){
document.cookie = cElements[i] + "=" + null + ";" + expires + "; SameSite=Lax;";
}
alert("The local browser configuration for this logger has been deleted. You will be returned to the main page.");
window.location.replace("index.html");
}

0 comments on commit 323d105

Please sign in to comment.