From 8a298a29c443a58b842a73193e26adbc1e8282af Mon Sep 17 00:00:00 2001 From: rdkartono Date: Wed, 18 Dec 2024 13:32:17 +0700 Subject: [PATCH] tambah html log 18/12/2024 --- WebContentt/public/assets/js/app.js | 9 ++++++++ WebContentt/public/index.html | 32 ++++++++++++++++++++++++----- src/Webpage/WebServer.java | 18 +++------------- 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/WebContentt/public/assets/js/app.js b/WebContentt/public/assets/js/app.js index 9de4577..3d2e71e 100644 --- a/WebContentt/public/assets/js/app.js +++ b/WebContentt/public/assets/js/app.js @@ -104,6 +104,15 @@ function hangupClick(){ }); } +function clearDialNumber(){ + $('#dialNumber').val(''); +} + +function appendDialNumber(number){ + console.log('Append number: '+number); + $('#dialNumber').val($('#dialNumber').val()+number); +} + function settingload(){ console.log("Setting loaded"); if (socket && socket.connected) { diff --git a/WebContentt/public/index.html b/WebContentt/public/index.html index 7ece44a..fd538dc 100644 --- a/WebContentt/public/index.html +++ b/WebContentt/public/index.html @@ -80,18 +80,40 @@
-
+

Dial To

-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Webpage/WebServer.java b/src/Webpage/WebServer.java index b92a785..438db04 100644 --- a/src/Webpage/WebServer.java +++ b/src/Webpage/WebServer.java @@ -65,11 +65,7 @@ public class WebServer { ctx.sessionAttribute("username", null); ctx.redirect("/login.html"); }); - app.before("/setting", ctx -> { - if (!Objects.equals(ctx.sessionAttribute("username"), webusername)){ - ctx.redirect("/login.html"); - } - }); + app.get("/setting", ctx -> { if (Objects.equals(ctx.sessionAttribute("username"), webusername)) { AllSetting allSetting = new AllSetting(new LoginSetting(webusername, webpassword), new SipSetting( @@ -91,11 +87,7 @@ public class WebServer { ctx.redirect("/login.html"); } }); - app.before("/logindata", ctx -> { - if (!Objects.equals(ctx.sessionAttribute("username"), webusername)){ - ctx.redirect("/login.html"); - } - }); + app.post("/logindata", ctx -> { if (Objects.equals(ctx.sessionAttribute("username"), webusername)){ LoginSetting value = gson.fromJson(ctx.body(), LoginSetting.class); @@ -116,11 +108,7 @@ public class WebServer { } }); - app.before("/sipdata", ctx -> { - if (!Objects.equals(ctx.sessionAttribute("username"), webusername)){ - ctx.redirect("/login.html"); - } - }); + app.post("/sipdata", ctx -> { if (Objects.equals(ctx.sessionAttribute("username"), webusername)){ SipSetting value = gson.fromJson(ctx.body(), SipSetting.class);