Skip to content

Commit

Permalink
hoho! fix the wrong typo >w<
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicezki committed Oct 17, 2023
1 parent 7da1e48 commit 6304336
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions main-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ARMMane{
}

this.elements = {
"mode" : ["btn", "form", "ui", "screen", "template","text"],
"mode" : ["btn", "form", "ui", "screen", "template","text","icon"],
"screen" : {
"errorloading" : this.querySel(".scr-errload"),
"loading" : this.querySel(".scr-loading"),
Expand Down Expand Up @@ -84,6 +84,7 @@ class ARMMane{
"settingbox2" : this.querySel(".settingbox-2"),
"settingbox3" : this.querySel(".settingbox-3"),
"settingbox4" : this.querySel(".settingbox-4"),
"log_progress" : this.querySel(".log-progress"),
},
"btn" : {
"conn_connectsrv" : this.querySel(".btn-connectsrv"),
Expand Down Expand Up @@ -125,6 +126,12 @@ class ARMMane{
"cconf_title_3" : this.querySel(".cconf-title-3").querySelector("div > h2"),
"cconf_title_4" : this.querySel(".cconf-title-4").querySelector("div > h2"),
"prediction_class" : this.querySel(".prediction-class").querySelector("div > h2"),
"log_title" : this.querySel(".log-title").querySelector("div > h2"),
"log_subtitle" : this.querySel(".log-subtitle").querySelector("div > h5"),
"log-number" : this.querySel(".log-number").querySelector("div > h1"),
},
"icon" : {
"log_icon" : this.querySel(".log-icon").querySelector("div > i"),
}
}

Expand Down Expand Up @@ -442,6 +449,36 @@ class ARMMane{
}



/**
* The logSet function is used to set the log title, subtitle and number.
*
*
* @param title Change the title text of the log
* @param subtitle Change the text of the subtitle of the log
* @param number Change the number of progress bar and text of the log
*/
logSet(title="", subtitle="", number=""){
if(title != ""){
this.changeText("log_title", title);
}
if(subtitle != ""){
this.changeText("log_subtitle", subtitle);
}
if(number != ""){
this.changeText("log-number", number);
this.changeProgress(number);
}
// Icon will change based on the title text
//If title contain "ERROR" then change icon to exclamation-triangle
if(title.includes("ERROR")){
this.changeIcon("log_icon", "exclamation-triangle");
this.changeColor("log_icon", "#B11D1D");
}
}





/**
Expand Down Expand Up @@ -727,6 +764,7 @@ class ARMMane{
}

}



/**
Expand Down Expand Up @@ -824,7 +862,7 @@ class ARMMane{
this.elements["ui"]["livepreview"].querySelector("img").addEventListener("error", () => {
// Try to reconnect
this.elements["ui"]["livepreview"].querySelector("img").src = this.appStatus["server"]["fullURL"] + "/stream/video2";
retryCount++;
retryVideoStreamCount++;
});
}else{
this.consoleLog("「ARMMANE」 Cannot connect to video stream", "ERROR");
Expand Down

0 comments on commit 6304336

Please sign in to comment.