now filling the form with the fucking data. currently, unidentified

This commit is contained in:
benny
2024-06-20 19:00:42 +03:00
parent 212bfe0f02
commit 6844fe42bc
6 changed files with 279 additions and 47 deletions

View File

@@ -120,4 +120,46 @@ function convertHtml(dt){
function showContainer(className){
classShow = document.getElementsByClassName(className)[0];
classShow.style.display = classShow.style.display=="flex"?"none":"flex";
}
function runme(data){
alert(data)
}
async function fetchContent(uri) {
try {
const response = await fetch(uri);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const content = await response.text();
return content;
} catch (error) {
console.error(`There was a problem with the fetch operation: ${error.message}`);
}
}
function updateForm(uri, eid){
fetchContent(uri).then(content => {
switch(eid){
case "PackageIdentifier":{
document.getElementById("PackageIdentifier").value=content.Identifier
break
}
case "PackageVersion":{
document.getElementById("PackageVersion").value=content.Version
break
}
case "InstallerType":{
document.getElementById("InstallerType").value=content.Type
break
}
case "InstallerUrl":{
document.getElementById("InstallerUrl").value=content.Url
break
}
case "InstallerSha256":{
document.getElementById("InstallerSha256").value=content.Checksum
break
}
}
console.log(content)
})
}