diff --git a/WebServer/bin/code/Antifurto.class b/WebServer/bin/code/Antifurto.class index 2d50f3e97e83e64d9c35dbbe6a3b2423e363dca2..f871b0867c473ce9730206f1a112d9068e1b7959 100644 Binary files a/WebServer/bin/code/Antifurto.class and b/WebServer/bin/code/Antifurto.class differ diff --git a/WebServer/bin/code/Helper.class b/WebServer/bin/code/Helper.class index 86dd7fc9a55e63a13e62aff94e8acf0d1ca252a9..bb0f1d6d7685bd3bb13df1db55da9a7b001bf1c3 100644 Binary files a/WebServer/bin/code/Helper.class and b/WebServer/bin/code/Helper.class differ diff --git a/WebServer/bin/code/Home.class b/WebServer/bin/code/Home.class index 44c26f24d03ef7539af8342c18b034c37078b5bc..e33c4154fd4f5d657f6be2e6480fa51815499a38 100644 Binary files a/WebServer/bin/code/Home.class and b/WebServer/bin/code/Home.class differ diff --git a/WebServer/bin/code/ImageRes.class b/WebServer/bin/code/ImageRes.class index 12a6728d9101478be3e3e6c556121a979fe80536..e931cad64e34e10c8a3445078606353f133a0f6f 100644 Binary files a/WebServer/bin/code/ImageRes.class and b/WebServer/bin/code/ImageRes.class differ diff --git a/WebServer/bin/code/KeyCloak.class b/WebServer/bin/code/KeyCloak.class index 6f98feed0e88e3ed476034a0abdd62e15c8380dc..89645808b1d7a66be97a203a13c4813798474fbf 100644 Binary files a/WebServer/bin/code/KeyCloak.class and b/WebServer/bin/code/KeyCloak.class differ diff --git a/WebServer/bin/code/Luci.class b/WebServer/bin/code/Luci.class index bf3fe5916909439c9cdd89daec200754559bb898..66ed0d2ba7c80cf7a72091952eb6039a0ffbd35a 100644 Binary files a/WebServer/bin/code/Luci.class and b/WebServer/bin/code/Luci.class differ diff --git a/WebServer/bin/code/MissingPage.class b/WebServer/bin/code/MissingPage.class index 42e50527a873cc37cd9eae6f17674b384ec80a8e..22370e28580b139b3ff860fe5f3a479108e7f23d 100644 Binary files a/WebServer/bin/code/MissingPage.class and b/WebServer/bin/code/MissingPage.class differ diff --git a/WebServer/bin/code/Resources.class b/WebServer/bin/code/Resources.class index 9b9406a88bd155158e7a8363dbd3fec2e5daad1e..b45b5330a8226b0a8fe5878b1687b46735b21398 100644 Binary files a/WebServer/bin/code/Resources.class and b/WebServer/bin/code/Resources.class differ diff --git a/WebServer/bin/code/Server.class b/WebServer/bin/code/Server.class index f8d51543157c6a911b93c8b6ffcfe507b7334403..7c809cd5b2ee119705a01d9ff601d928a28fe102 100644 Binary files a/WebServer/bin/code/Server.class and b/WebServer/bin/code/Server.class differ diff --git a/webapp/public/js/authentication/app.js b/webapp/public/js/authentication/app.js index e8edfdc63e166ecd0f0a295cae954d6741ae791c..be5ece815171b80536b3c24ecadcb8347a56fa3d 100644 --- a/webapp/public/js/authentication/app.js +++ b/webapp/public/js/authentication/app.js @@ -2,11 +2,11 @@ import {createRowDomain} from '../templates/domains-template.js'; import { getToken, logoutKeycloak } from './script.js'; import {createNewUser, createNewService, createControlServices} from '../templates/create-new-domain-template.js'; +import RequestToDomain from './requests-to-domain.js'; class App { - constructor(myDomains, requestsToDomain) { + constructor(myDomains) { // this.myDomains = myDomains; - this.requestsToDomain = requestsToDomain; this.showAllDomains(myDomains); this.fillModal(); this.performLogout(); @@ -27,10 +27,10 @@ class App { container.insertBefore(tr, plusRow); if(domainObject.admin) { const toggle = tr.querySelector('.toggle-button'); - this.statoDomainToggle(domainObject, toggle, this.requestsToDomain); + this.statoDomainToggle(domainObject, toggle); const deleteDomain = tr.querySelector('.fa-trash'); deleteDomain.addEventListener('click', async () => { - const resultDelete = await this.requestsToDomain.deleteDomain(domainObject); + const resultDelete = await RequestToDomain.deleteDomain(domainObject); if(resultDelete) { container.removeChild(tr); } @@ -42,14 +42,14 @@ class App { } - statoDomainToggle(domain, toggle, requestsToDomain) { + statoDomainToggle(domain, toggle) { toggle.addEventListener('click', async (event) => { event.preventDefault(); const stop = toggle.classList.contains('active'); const linkDomain = toggle.parentElement.parentElement.previousElementSibling.querySelector('a'); if(stop) { // toggle attiva. Se clicco richiedo che il dominio sia fermato - const resultStop = await requestsToDomain.stopDomain(domain); + const resultStop = await RequestToDomain.stopDomain(domain); if(resultStop) { toggle.classList.remove('active'); linkDomain.setAttribute('href','#'); @@ -59,11 +59,11 @@ class App { } } else { - const resultStart = await requestsToDomain.startDomain(domain); + const resultStart = await RequestToDomain.startDomain(domain); if(resultStart) { toggle.classList.add('active'); linkDomain.setAttribute('href','/secured/home/'); - + } else { throw new Error('Impossibile far partire il dominio, provare piu\' tardi'); @@ -74,7 +74,7 @@ class App { async fillModal() { - const allServices = await this.requestsToDomain.getAllServices(); + const allServices = await RequestToDomain.getAllServices(); const div = document.createElement('div'); div.id = "checkbox-div"; div.classList.add('pt-4'); @@ -221,7 +221,7 @@ class App { }; cancelForm.click(); - const resultInstall = await this.requestsToDomain.createNewDomain(json); + const resultInstall = await RequestToDomain.createNewDomain(json); if(resultInstall) { const domainCreated = { nome: domainName, diff --git a/webapp/public/js/authentication/script.js b/webapp/public/js/authentication/script.js index b69214899409fd1d6cfa0bfb8f2b918a2c67f9f9..f754ebe2684ed0a2368adb6ef5014c43f39c5ae4 100644 --- a/webapp/public/js/authentication/script.js +++ b/webapp/public/js/authentication/script.js @@ -37,8 +37,8 @@ else if(uri.includes("#")){ if(token !== null) { expirationTime = moment().add(token.expires_in,'s'); sessionStorage.setItem("expirationTime", expirationTime.toJSON()); - const requestsToDomain = new RequestToDomain(); - const myDomains = await requestsToDomain.getMyDomains(); + + const myDomains = await RequestToDomain.getMyDomains(); // const myDomains = [{nome: "casa1", stato:"on", admin: true}, // {nome: "casa2", stato:"off", admin: false}, // {nome: "casa3", stato:"off", admin: true}, @@ -49,7 +49,7 @@ else if(uri.includes("#")){ // {nome: "casa4", stato:"on", admin: false} // ]; - const app = new App(myDomains, requestsToDomain); + const app = new App(myDomains); } } } else if(uri.includes('/secured/home/')) {