diff --git a/.idea/libraries/fasterxml_jackson_core_databind.xml b/.idea/libraries/fasterxml_jackson_core_databind.xml
new file mode 100644
index 0000000..89ea02e
--- /dev/null
+++ b/.idea/libraries/fasterxml_jackson_core_databind.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/fasterxml_jackson_module_kotlin.xml b/.idea/libraries/fasterxml_jackson_module_kotlin.xml
new file mode 100644
index 0000000..ef4f2f3
--- /dev/null
+++ b/.idea/libraries/fasterxml_jackson_module_kotlin.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/slf4j_simple.xml b/.idea/libraries/slf4j_simple.xml
new file mode 100644
index 0000000..06b1109
--- /dev/null
+++ b/.idea/libraries/slf4j_simple.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/tools_jackson_core_databind.xml b/.idea/libraries/tools_jackson_core_databind.xml
new file mode 100644
index 0000000..7cca5ce
--- /dev/null
+++ b/.idea/libraries/tools_jackson_core_databind.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/tools_jackson_module_kotlin.xml b/.idea/libraries/tools_jackson_module_kotlin.xml
new file mode 100644
index 0000000..e52274e
--- /dev/null
+++ b/.idea/libraries/tools_jackson_module_kotlin.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FarmToAAS.iml b/FarmToAAS.iml
index 19726ed..2c8a374 100644
--- a/FarmToAAS.iml
+++ b/FarmToAAS.iml
@@ -16,5 +16,8 @@
+
+
+
\ No newline at end of file
diff --git a/config.properties b/config.properties
new file mode 100644
index 0000000..85459ca
--- /dev/null
+++ b/config.properties
@@ -0,0 +1,18 @@
+#Configuration saved on 2026-01-21T17:17:53.684082100
+#Wed Jan 21 17:17:53 WIB 2026
+activemq_brokerurl=tcp\://localhost\:61616
+activemq_password=admin
+activemq_queuename=TEST.QUEUE
+activemq_username=admin
+mysql_aas1=jdbc\:mysql\://192.168.10.10\:3306/aas
+mysql_aas1_password=admin
+mysql_aas1_username=admin
+mysql_aas2=jdbc\:mysql\://192.168.10.11\:3306/aas
+mysql_aas2_password=admin
+mysql_aas2_username=admin
+mysql_aas3=\ jdbc\:mysql\://192.168.10.12\:3306/aas
+mysql_aas3_password=admin
+mysql_aas3_username=admin
+webpassword=admin
+webport=7000
+webusername=admin
diff --git a/html/assets/js/home.js b/html/assets/js/home.js
new file mode 100644
index 0000000..e873aea
--- /dev/null
+++ b/html/assets/js/home.js
@@ -0,0 +1,15 @@
+$(document).ready(function() {
+ // Your code here
+ console.log("home.js is loaded and ready.");
+ $('#logoutbtn').on('click', function() {
+ // Clear session storage on logout
+ fetch('/logout').then(() => {
+ window.location.href = '/login.html';
+ });
+ });
+});
+
+$(window).on('beforeunload', function() {
+ console.log("User is leaving home.html");
+ // Your cleanup code here
+});
\ No newline at end of file
diff --git a/html/assets/js/log.js b/html/assets/js/log.js
new file mode 100644
index 0000000..3dbbff4
--- /dev/null
+++ b/html/assets/js/log.js
@@ -0,0 +1,15 @@
+$(document).ready(function() {
+ // Your code here
+ console.log("log.js is loaded and ready.");
+ $('#logoutbtn').on('click', function() {
+ // Clear session storage on logout
+ fetch('/logout').then(() => {
+ window.location.href = '/login.html';
+ });
+ });
+});
+
+$(window).on('beforeunload', function() {
+ console.log("User is leaving log.html");
+ // Your cleanup code here
+});
\ No newline at end of file
diff --git a/html/assets/js/login.js b/html/assets/js/login.js
new file mode 100644
index 0000000..d13ba5e
--- /dev/null
+++ b/html/assets/js/login.js
@@ -0,0 +1,13 @@
+$(document).ready(function() {
+ // Your code here
+ console.log("login.js is loaded and ready.");
+ const params = new URLSearchParams(window.location.search);
+ if (params.get("error")) {
+ alert("Login failed. Please try again.");
+ }
+});
+
+$(window).on('beforeunload', function() {
+ console.log("User is leaving login.html");
+ // Your cleanup code here
+});
\ No newline at end of file
diff --git a/html/assets/js/script.js b/html/assets/js/script.js
new file mode 100644
index 0000000..42cbd22
--- /dev/null
+++ b/html/assets/js/script.js
@@ -0,0 +1,77 @@
+/**
+ * Checks if a string is valid (not null and not empty)
+ * @param {string} str
+ * @returns true if valid, false otherwise
+ */
+function ValidString(str) {
+ if (str) {
+ if (str.length > 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * Performs a POST request to the specified URL with the given data.
+ * @param {string} url Service endpoint URL
+ * @param {object} data Data to be sent in the request body
+ * @param {function} onSuccess callback for successful response
+ * @param {function} onError callback for error response
+ */
+function Post(url, data, onSuccess, onError) {
+ fetch(url, {
+ method: "POST",
+ body: JSON.stringify(data)
+ }).then(response => {
+ if (response.ok) {
+ return response.json();
+ } else {
+ let str = `POST request to ${url} failed. Status: ${response.statusText}`;
+ throw new Error(str);
+ }
+ }).then(data => {
+ if (onSuccess) {
+ onSuccess(data);
+ }
+ }).catch(error => {
+ if (ValidString(error.message)) {
+ if (onError) {
+ onError(error.message);
+ } else {
+ console.error(error.message);
+ }
+ } else console.log("An unknown error occurred during POST request.");
+
+ });
+}
+
+/**
+ * Performs a GET request to the specified URL.
+ * @param {string} url Service endpoint URL
+ * @param {function} onSuccess callback for successful response
+ * @param {function} onError callback for error response
+ */
+function Get(url, onSuccess, onError) {
+ fetch(url).then(response => {
+ if (response.ok) {
+ return response.json();
+ } else {
+ let str = `GET request to ${url} failed. Status: ${response.statusText}`;
+ throw new Error(str);
+ }
+ }).then(data => {
+ if (onSuccess) {
+ onSuccess(data);
+ }
+ }).catch(error => {
+ if (ValidString(error.message)) {
+ if (onError) {
+ onError(error.message);
+ } else {
+ console.error(error.message);
+ }
+ }
+ else console.log("An unknown error occurred during GET request.");
+ });
+}
\ No newline at end of file
diff --git a/html/assets/js/setting.js b/html/assets/js/setting.js
new file mode 100644
index 0000000..622d351
--- /dev/null
+++ b/html/assets/js/setting.js
@@ -0,0 +1,168 @@
+$(document).ready(function () {
+ // Your code here
+ console.log("setting.js is loaded and ready.");
+
+ loadSetting();
+
+ $('#logoutbtn').on('click', function () {
+ // Clear session storage on logout
+ fetch('/logout').then(() => {
+ window.location.href = '/login.html';
+ });
+ });
+
+ $('#savefarm').on('click', function () {
+ saveFarmParameter();
+ });
+
+ $('#saveaas').on('click', function () {
+ saveAASParameter();
+ });
+});
+
+$(window).on('beforeunload', function () {
+ console.log("User is leaving setting.html");
+ // Your cleanup code here
+});
+
+function loadSetting() {
+ Get("getSetting", function (data) {
+ if (data) {
+ if (data.farm) {
+ if (data.aas1) {
+ if (data.aas2) {
+ if (data.aas3) {
+ // all good
+ $('#brokerurl').val(data.farm.url);
+ $('#brokerusername').val(data.farm.username);
+ $('#brokerpassword').val(data.farm.password);
+ $('#brokerqueue').val(data.farm.queue);
+ $('#aas1url').val(data.aas1.url);
+ $('#aas1username').val(data.aas1.username);
+ $('#aas1password').val(data.aas1.password);
+ $('#aas2url').val(data.aas2.url);
+ $('#aas2username').val(data.aas2.username);
+ $('#aas2password').val(data.aas2.password);
+ $('#aas3url').val(data.aas3.url);
+ $('#aas3username').val(data.aas3.username);
+ $('#aas3password').val(data.aas3.password);
+ } else console.log("No AAS 3 data received");
+ } else console.log("No AAS 2 data received");
+ } else console.log("No AAS 1 data received");
+ } else console.log("No FARM data received");
+ } else console.log("No data received");
+
+ }, function (error) {
+ alert(error);
+ })
+
+}
+
+function saveFarmParameter() {
+ let url = $('#brokerurl').val();
+ let username = $('#brokerusername').val();
+ let password = $('#brokerpassword').val();
+ let queue = $('#brokerqueue').val();
+
+ if (ValidString(url) == false) {
+ alert("FARM Broker URL is required.");
+ return;
+ }
+ if (ValidString(username) == false) {
+ alert("FARM Broker Username is required.");
+ return;
+ }
+ if (ValidString(password) == false) {
+ alert("FARM Broker Password is required.");
+ return;
+ }
+ if (ValidString(queue) == false) {
+ alert("FARM Broker Queue is required.");
+ return;
+ }
+
+
+ Post("saveFARM", {
+ farm: {
+ url: url,
+ username: username,
+ password: password,
+ queue: queue
+ }
+
+ }, function (data) {
+ alert(data.message);
+ }, function (error) {
+ alert(error);
+ });
+
+}
+function saveAASParameter() {
+ let aas1URL = $('#aas1url').val();
+ let aas1username = $('#aas1username').val();
+ let aas1password = $('#aas1password').val();
+ let aas2URL = $('#aas2url').val();
+ let aas2username = $('#aas2username').val();
+ let aas2password = $('#aas2password').val();
+ let aas3URL = $('#aas3url').val();
+ let aas3username = $('#aas3username').val();
+ let aas3password = $('#aas3password').val();
+
+ if (ValidString(aas1URL) == false) {
+ alert("AAS1 URL is required.");
+ return;
+ }
+ if (ValidString(aas1username) == false) {
+ alert("AAS1 Username is required.");
+ return;
+ }
+ if (ValidString(aas1password) == false) {
+ alert("AAS1 Password is required.");
+ return;
+ }
+ if (ValidString(aas2URL) == false) {
+ alert("AAS2 URL is required.");
+ return;
+ }
+ if (ValidString(aas2username) == false) {
+ alert("AAS2 Username is required.");
+ return;
+ }
+ if (ValidString(aas2password) == false) {
+ alert("AAS2 Password is required.");
+ return;
+ }
+ if (ValidString(aas3URL) == false) {
+ alert("AAS3 URL is required.");
+ return;
+ }
+ if (ValidString(aas3username) == false) {
+ alert("AAS3 Username is required.");
+ return;
+ }
+ if (ValidString(aas3password) == false) {
+ alert("AAS3 Password is required.");
+ return;
+ }
+ Post("saveAAS", {
+ aas1: {
+ url: aas1URL,
+ username: aas1username,
+ password: aas1password
+ },
+ aas2: {
+ url: aas2URL,
+ username: aas2username,
+ password: aas2password
+ },
+ aas3: {
+ url: aas3URL,
+ username: aas3username,
+ password: aas3password
+ }
+ }, function (data) {
+ alert(data.message);
+ }, function (error) {
+ alert(error)
+ });
+}
\ No newline at end of file
diff --git a/html/home.html b/html/home.html
index fb9d987..8c5dc16 100644
--- a/html/home.html
+++ b/html/home.html
@@ -15,9 +15,9 @@
@@ -30,6 +30,8 @@
+
+