diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
| commit | c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (patch) | |
| tree | 3e4f42f93c7ae89a364e4d51fff6e5cec4e55fa9 /rushs/eplace/src/pages/debug.js | |
add: graphs et rushs
Diffstat (limited to 'rushs/eplace/src/pages/debug.js')
| -rw-r--r-- | rushs/eplace/src/pages/debug.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/rushs/eplace/src/pages/debug.js b/rushs/eplace/src/pages/debug.js new file mode 100644 index 0000000..e2da5f4 --- /dev/null +++ b/rushs/eplace/src/pages/debug.js @@ -0,0 +1,34 @@ +import $ from "jquery"; +import debugHtml from "../components/debug.html"; + +function refreshLocalStorage() { + $("#token").text(localStorage.getItem("token") ?? "N/A"); + $("#refresh_token").text(localStorage.getItem("refresh_token") ?? "N/A"); +} + +if (import.meta.env.MODE === "debug") { + $.get(debugHtml, function (response) { + $("body").html(response); + refreshLocalStorage(); + }).fail(function (xhr, status, error) { + console.error("Error fetching debug HTML:", error); + }); + + $(document).on("click", "#errorBtn", function () { + // Make a call to VITE_URL/tests/error using your own api call function + }); + + $(document).on("click", "#expiredTokenBtn", function () { + // Make a call to VITE_URL/tests/expired using your own api call function + }); + + $(document).on("click", "#deleteTokenBtn", function () { + localStorage.removeItem("token"); + refreshLocalStorage(); + }); + + $(document).on("click", "#deleteRefreshTokenBtn", function () { + localStorage.removeItem("refresh_token"); + refreshLocalStorage(); + }); +} |
