update TWA Management v0.0.1

This commit is contained in:
2025-11-05 10:08:06 +07:00
parent d4e91c7960
commit b4b191f829
73 changed files with 2249 additions and 418 deletions

View File

@ -0,0 +1,4 @@
window.L1000 = function () {
}
window.AScript.set("1000", true);

View File

@ -0,0 +1,26 @@
import AWizard from "/js/libs/js-AWizard.js";
window.L10001 = function () {
Waves.attach('.btn-effect', ['waves-float']);
Waves.init({ duration: 1000, delay: 200 });
var wrd1 = new AWizard(document.querySelector(".AWizard"));
const forget = document.getElementById("forgetPass");
const btnCB = document.querySelectorAll(".btnCB");
const navSignUp = document.getElementById("navSignUp")
forget.addEventListener("click", (e) => {
wrd1.nextPage(1);
});
btnCB.forEach((el) => {
el.addEventListener("click", (e) => {
ComeBack(e, wrd1);
});
});
navSignUp.addEventListener("click", (e) => {
wrd1.nextPage(2);
});
}
function ComeBack(e, wrd) {
wrd.nextPage(0);
}
window.AScript.set("10001", true);

View File

@ -38,9 +38,15 @@ const tmp = `<div class="slider-scrollbar" data-scrollbar>
</div>
</div>
<div class="form-group d-f f-c">
<label for="pathServer">Controller Name</label>
<label for="controllerName">Controller Name</label>
<div class="input-group">
<input id="pathServer" type="text" placeholder="Controller Name" validation-isEmpty />
<input id="controllerName" type="text" placeholder="Controller Name" validation-isEmpty />
</div>
</div>
<div class="form-group d-f f-c">
<label for="storageName">Storage Name</label>
<div class="input-group">
<input id="storageName" type="text" placeholder="Storage Name" validation-isEmpty />
</div>
</div>
<div class="form-group d-f f-c">
@ -103,9 +109,9 @@ const tmp = `<div class="slider-scrollbar" data-scrollbar>
</div>
</div>
<div class="form-group d-f f-c">
<label for="expiredDate">SharePoint Path</label>
<label for="sharepointPath">SharePoint Path</label>
<div class="input-group">
<input id="expiredDate" type="password" placeholder="Client ID" validation-isEmpty />
<input id="sharepointPath" type="text" placeholder="Client ID" validation-isEmpty />
</div>
</div>
</div>
@ -140,7 +146,7 @@ const tmp = `<div class="slider-scrollbar" data-scrollbar>
<div class="form-group d-f f-c">
<label for="clientID">OS Platform</label>
<div class="input-group">
<input id="osName" data-id="osPlatform" type="text" placeholder="OS Platform" validation-isEmpty />
<input id="osPlatform" data-id="osPlatform" type="text" placeholder="OS Platform" validation-isEmpty />
</div>
</div>
<div class="form-group d-f f-c">
@ -158,7 +164,7 @@ const tmp = `<div class="slider-scrollbar" data-scrollbar>
<div class="form-group d-f f-c">
<label for="clientID">OS Architecture</label>
<div class="input-group">
<input id="osKernel" data-id="osArch" type="text" placeholder="OS Architecture" validation-isEmpty />
<input id="osArch" data-id="osArch" type="text" placeholder="OS Architecture" validation-isEmpty />
</div>
</div>
<div class="form-group d-f f-c">
@ -203,30 +209,51 @@ const tmp = `<div class="slider-scrollbar" data-scrollbar>
<h5 class="mb-2">Server Authenicator</h4>
</div>
<div class="form-group d-f f-c">
<label for="clientID">IP Server</label>
<label for="idToken">Token ID</label>
<div class="input-group">
<input id="clientID" type="text" placeholder="Client ID" validation-isEmpty />
<input id="idToken" type="text" placeholder="Token ID" validation-isEmpty />
</div>
</div>
<div class="form-group d-f f-c">
<label for="clientID">Machine ID</label>
<label for="vToken">Token Value</label>
<div class="input-group">
<input id="clientID" type="text" placeholder="Client ID" validation-isEmpty />
<input id="vToken" type="password" placeholder="Token Value" validation-isEmpty />
</div>
</div>
<div class="form-group d-f f-c">
<label for="clientID">OS Version</label>
<label for="idRefreshToken">Refresh Token ID</label>
<div class="input-group">
<input id="clientID" type="text" placeholder="Client ID" validation-isEmpty />
<input id="idRefreshToken" type="text" placeholder="Refresh Token ID" validation-isEmpty />
</div>
</div>
<div class="form-group d-f f-c">
<label for="clientID">Proccessor ID</label>
<label for="refreshTokenValue">Refresh Token Value</label>
<div class="input-group">
<input id="clientID" type="text" placeholder="Client ID" validation-isEmpty />
<input id="refreshTokenValue" type="password" placeholder="Refresh Token Value" validation-isEmpty />
</div>
</div>
</div>
<div class="tabcontent">
<div class="form-group">
<h5 class="mb-2">Storage Data Summary</h4>
</div>
<div class="form-group mb-0 d-f">
<label>Storage Server Type</label>
<span class="ml-2"></span>
</div>
<div class="form-group mb-0 d-f">
<label>Controller Name</label>
<span class="ml-2"></span>
</div>
<div class="form-group mb-0 d-f">
<label>Storage Name</label>
<span class="ml-2"></span>
</div>
<div class="form-group mb-0 d-f">
<label>Validation Domains</label>
<span class="ml-2"></span>
</div>
</div>
</div>
</div>
<div class="tabcontent">
@ -262,24 +289,99 @@ window.L6101 = function () {
var ov = new AOverlay(document.body);
ov.createOverlay();
const $v = id => (document.getElementById(id)?.value ?? '').trim();
var ele1 = new ASpinButton(document.getElementById("totalSize"));
var ele2 = new AMultiTag(document.getElementById("listStorage"));
var slider = new AModal(tmp);
slider.createModal("CustomForm", "slider-right");
var Scrollbar = window.Scrollbar;
Scrollbar.init(slider.CustomContainer.querySelector(".slider-scrollbar"), window.scroll_options);
const mScroll = Scrollbar.init(slider.CustomContainer.querySelector(".slider-scrollbar"), window.scroll_options);
slider.overlay.isCloseOverlay(true);
var tabs = new ATab(slider.CustomContainer.querySelector(".atabs"), slider.CustomContainer.querySelector(".StorageTabs"));
var wrd1 = new AWizard(slider.CustomContainer.querySelector(".AWizard"));
var as = new ASelect(slider.CustomContainer.querySelectorAll(".aselect"));
window.testV = as;
var asIdType = as.get(0);
wrd1.on("onBeforeBack", (evt) => {
mScroll.scrollTo(0, 0);
});
wrd1.on("onAfterNext", (evt) => {
if (evt.indexPage > 0) {
if (as.get(0).isLockElement() || as.get(1).isLockElement()) {
return;
}
switch (asIdType.getSelectedItem().vSearch) {
case "Microsoft Cloud":
break;
case "Physical Server":
if (evt.indexPage > 3) {
(async () => {
const fd = new FormData();
fd.append('StorageTypeID', asIdType.getSelectedItem()?.id ?? '');
fd.append('ControllerName', $v('controllerName'));
fd.append('StorageName', $v('storageName'));
fd.append('IpPublic', $v('ipPublic'));
fd.append('IpPrivatev4', $v('ipPrivatev4'));
fd.append('IpPrivatev6', $v('ipPrivatev6'));
fd.append('OsName', $v('osName'));
fd.append('OsPlatform', $v('osPlatform'));
fd.append('OsVersion', $v('osVersion'));
fd.append('OsKernel', $v('osKernel'));
fd.append('OsArch', $v('osArch'));
fd.append('BiosSN', $v('biosSerial'));
fd.append('BiosVendor', $v('biosVender'));
fd.append('BiosUUID', $v('biosUUID'));
const i = 0;
as.get(1).multiSelectedItem.forEach((item) => {
fd.append(`ValidationDomains[${i}].IdValidationDomain`, item.getAttribute("data-value"));
});
fd.append('SocketN', $v('socketN'));
fd.append('CpuName', $v('cpuName'));
fd.append('TotalRam', $v('totalRam'));
fd.append('TokenID', $v('idToken'));
fd.append('TokenValue', $v('vToken'));
fd.append('RTokenID', $v('idRefreshToken'));
fd.append('RTokenValue', $v('refreshTokenValue'))
const response = await fetch("/Storage/SetStorageData", {
method: 'POST',
body: fd
});
})();
}
break;
}
}
});
wrd1.on("onBeforeNext", (evt) => {
mScroll.scrollTo(0, 0);
if (evt.indexPage == 0) {
if (asIdType.isLockElement() && asVD.isLockElement()) {
if (as.get(0).isLockElement() || as.get(1).isLockElement()) {
wrd1.isStopNextPage = true;
return;
} else {
wrd1.isStopNextPage = false;
}
let flag = false;
if ($v('controllerName').length == 0) {
flag = true;
}
if ($v('storageName').length == 0) {
flag = true;
}
if (as.get(1).multiSelectedItem.length == 0) {
flag = true;
}
if (flag) {
wrd1.isStopNextPage = true;
return;
} else {
@ -289,9 +391,11 @@ window.L6101 = function () {
case "Microsoft Cloud":
wrd1.showPage(1);
wrd1.hidePage(2);
wrd1.hidePage(3);
break;
case "Physical Server":
wrd1.showPage(2);
wrd1.showPage(3);
wrd1.hidePage(1);
let promise = new Promise(async function (resolve, reject) {
const response = await fetch(`/Storage/GetSysInfo`, {
@ -305,10 +409,43 @@ window.L6101 = function () {
const autoF = new AAutoFill(document.querySelector(".awStorageConnector"));
autoF.fill(data);
}
});
});
break;
}
}e
} else if (evt.indexPage == 1)
{
}
else if (evt.indexPage == 2) {
(async () => {
const response = await fetch(`/Storage/GenerationAccessToken`, {
method: 'GET',
headers: {
'Accept': 'application/json'
}
});
const data = await response.json();
if (data) {
document.getElementById("idToken").value = data.idToken;
document.getElementById("vToken").value = data.tokenValue;
}
})();
(async () => {
const response = await fetch(`/Storage/GenerationAccessToken`, {
method: 'GET',
headers: {
'Accept': 'application/json'
}
});
const data = await response.json();
if (data) {
document.getElementById("idRefreshToken").value = data.idToken;
document.getElementById("refreshTokenValue").value = data.tokenValue;
}
})();
}
}, true);
var asVD = as.get(1);
@ -321,6 +458,7 @@ window.L6101 = function () {
let promise = new Promise(function (resolve, reject) {
const xhr = new XMLHttpRequest();
xhr.open("GET", window.GetAbsoluteURL("/Storage/GetTypeStorage"));
xhr.setRequestHeader('Accept', 'application/json; charset=UTF-8');
var f = function (ev) {
if (ev.currentTarget.readyState == 4) {
if (ev.currentTarget.status == 200) {
@ -344,6 +482,7 @@ window.L6101 = function () {
let promise1 = new Promise(function (resolve, reject) {
const xhr = new XMLHttpRequest();
xhr.open("GET", window.GetAbsoluteURL("/Storage/GetValidationDomain"));
xhr.setRequestHeader('Accept', 'application/json; charset=UTF-8');
var f = function (ev) {
if (ev.currentTarget.readyState == 4) {
if (ev.currentTarget.status == 200) {
@ -374,7 +513,7 @@ window.L6101 = function () {
asAddStorage.on("click_btAddStorage", (e) => {
const xhr = new XMLHttpRequest();
xhr.open("POST", "/Storage/AddStorageServer");
xhr.setRequestHeader('Content-type', 'application/json; charset=UTF-8');
xhr.setRequestHeader('Accept', 'application/json; charset=UTF-8');
var data = {
"Name": document.getElementById("inpType").value
};

View File

@ -14,6 +14,7 @@ class AsyncLayout extends ALayout {
super.dispose();
}
renderMenu() {
console.log("ÁDASD");
this.isLoaded = true;
var asyncStyleSheets = [
'https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap',

View File

@ -0,0 +1,39 @@
import ALayout from '/js/libs/js-ALayout.js'
class LoginLayout extends ALayout {
constructor() {
super();
this.isLoaded = false;
}
dispose() {
this.isLoaded = false;
window.app.removeSytemEventParent(window.app.lName);
window.app.removeCustomEventParent(window.app.lName);
super.dispose();
}
renderMenu() {
this.isLoaded = true;
var asyncStyleSheets = [
'https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap',
'/css/atg-font/atg-admin-font.css',
'/css/atg-lib/waves.min.css',
'/css/pages/login.css'
];
window.app.loadCSS(asyncStyleSheets);
window.app.initNavs("Login");
var sOption = {
damping: (window.getOS() == "Android") ? .06 : .04,
thumbMinSize: 25,
renderByPixel: true,
alwaysShowTracks: true,
continuousScrolling: true
};
window.Scrollbar.use(window.OverscrollPlugin);
window.app.initScrollBar();
}
}
window.ALayout.set("Login", new LoginLayout());
window.AScript.set("asyncLoginLayout", true);