From 30b820abee5c6ce839b4bff30f8825fe68d82631 Mon Sep 17 00:00:00 2001 From: Redume Date: Sun, 23 Oct 2022 15:27:45 +0300 Subject: [PATCH] rewritten from net/http to fiber, changed port from 8080, 4662 to one 3000 --- web/static/scripts/createLabel.js | 2 +- web/static/scripts/switch.js | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/web/static/scripts/createLabel.js b/web/static/scripts/createLabel.js index f95d0dd..805eeba 100644 --- a/web/static/scripts/createLabel.js +++ b/web/static/scripts/createLabel.js @@ -1,7 +1,7 @@ let button = document.querySelector("#createLabelButton"); button.addEventListener("click", function() { $.ajax({ - url: "http://localhost:8080/api/create/label", + url: "http://localhost:3000/api/create/label", type: "POST", success: function(data) { if(data.status) { diff --git a/web/static/scripts/switch.js b/web/static/scripts/switch.js index ed174ce..07af127 100644 --- a/web/static/scripts/switch.js +++ b/web/static/scripts/switch.js @@ -6,9 +6,10 @@ $(document).ready(async function() { const $wallpaperSwitchTogglerName = $("#settings_autoSetWallpaperTogglerName"); $.ajax({ - url: "http://localhost:8080/api/get/settings", + url: "http://localhost:3000/api/get/settings", type: "GET", success: function(data) { + console.log(data); if (data["wallpaper"] === 1) { $wallpaperSwitch.attr("checked", "true"); $wallpaperSwitchTogglerName.text("On"); @@ -22,12 +23,12 @@ $(document).ready(async function() { $wallpaperSwitch.click(async function() { $.ajax({ - url: "http://localhost:8080/api/get/settings", + url: "http://localhost:3000/api/get/settings", type: "GET", success: function (data) { if (data["wallpaper"] === 1) { $.ajax({ - url: "http://localhost:8080/api/update/settings", + url: "http://localhost:3000/api/update/settings", type: "POST", data: { "wallpaper": 0, @@ -45,7 +46,7 @@ $(document).ready(async function() { }); } else { $.ajax({ - url: "http://localhost:8080/api/update/settings", + url: "http://localhost:3000/api/update/settings", type: "POST", data: { "wallpaper": 1, @@ -69,12 +70,12 @@ $(document).ready(async function() { $startupSwitch.click(async function() { $.ajax({ - url: "http://localhost:8080/api/get/settings", + url: "http://localhost:3000/api/get/settings", type: "GET", success: function (data) { if (data["startup"] === 1) { $.ajax({ - url: "http://localhost:8080/api/update/settings", + url: "http://localhost:3000/api/update/settings", type: "POST", data: { "startup": 0, @@ -94,7 +95,7 @@ $(document).ready(async function() { }); } else { $.ajax({ - url: "http://localhost:8080/api/update/settings", + url: "http://localhost:3000/api/update/settings", type: "POST", data: { "startup": 1, @@ -127,7 +128,7 @@ function toast(message) { function editStartup(i) { return $.ajax({ - url: "http://localhost:8080/api/update/startup", + url: "http://localhost:3000/api/update/startup", type: "POST", data: { "startup": i