|
@@ -7,13 +7,20 @@ function load_table_black_rank() {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+var goodColor = [];
|
|
|
+var badColor = [];
|
|
|
+var userIDs = [];
|
|
|
+var schedulepass = 0, schedulefail = 0, schedulestack = 0;
|
|
|
+var todayotherpass = 0, todayotherfail = 0, todayotherstack = 0;
|
|
|
var lastTimeHistory = "";
|
|
|
+var histoires = [];
|
|
|
|
|
|
function history_success(obj, sta) {
|
|
|
- var history = first_parse(this, obj);
|
|
|
+ var histoire = first_parse(this, obj);
|
|
|
var i, j, t;
|
|
|
- console.log(" history : ");
|
|
|
- console.log(history);
|
|
|
+ console.log(" histoire : ");
|
|
|
+ console.log(histoire);
|
|
|
if (this.url.indexOf("type=1") >= 0) {
|
|
|
t = 1;
|
|
|
} else if (this.url.indexOf("type=2") >= 0) {
|
|
@@ -24,15 +31,16 @@ function history_success(obj, sta) {
|
|
|
t = 0;
|
|
|
return;
|
|
|
}
|
|
|
+ histoires[t] = histoire;
|
|
|
if (t === 2 || t === 3) {
|
|
|
hispass[t] = 0;
|
|
|
hisfail[t] = 0;
|
|
|
hisstack[t] = 0;
|
|
|
hisrate[t] = 0;
|
|
|
- for (i = 0; i < history.length - 1; i++) { //除了今日
|
|
|
- hispass[t] = history[i].passNum + hispass[t];
|
|
|
- hisfail[t] = history[i].failNum + hisfail[t];
|
|
|
- hisstack[t] = history[i].avgDue + hisstack[t];
|
|
|
+ for (i = 0; i < histoire.length - 1; i++) { //除了今日
|
|
|
+ hispass[t] = histoire[i].passNum + hispass[t];
|
|
|
+ hisfail[t] = histoire[i].failNum + hisfail[t];
|
|
|
+ hisstack[t] = histoire[i].avgDue + hisstack[t];
|
|
|
}
|
|
|
orighispass[t] = hispass[t];
|
|
|
orighisfail[t] = hisfail[t];
|
|
@@ -42,15 +50,15 @@ function history_success(obj, sta) {
|
|
|
hisstack[t] += hisstack[0];
|
|
|
hisrate[t] = get_factor(hispass[t], hisfail[t]);
|
|
|
} else if (t === 1) {
|
|
|
- hispass[1] = history[0].passNum;
|
|
|
- hisfail[1] = history[0].failNum;
|
|
|
- hisstack[1] = history[0].avgDue;
|
|
|
+ hispass[1] = histoire[0].passNum;
|
|
|
+ hisfail[1] = histoire[0].failNum;
|
|
|
+ hisstack[1] = histoire[0].avgDue;
|
|
|
hisrate[t] = get_factor(hispass[1], hisfail[1]);
|
|
|
}
|
|
|
|
|
|
- todayotherpass = history[history.length - 1].passNum;
|
|
|
- todayotherfail = history[history.length - 1].failNum;
|
|
|
- todayotherstack = history[history.length - 1].avgDue;
|
|
|
+ todayotherpass = histoire[histoire.length - 1].passNum;
|
|
|
+ todayotherfail = histoire[histoire.length - 1].failNum;
|
|
|
+ todayotherstack = histoire[histoire.length - 1].avgDue;
|
|
|
|
|
|
update_all_history();
|
|
|
}
|
|
@@ -188,11 +196,19 @@ function getSpotHtml2(htmlbody, i) {
|
|
|
return htmlbody;
|
|
|
}
|
|
|
htmlbody += "<tr>";
|
|
|
- htmlbody += `<tr style="background-color: ${badColor[i]}">
|
|
|
+ if(typeof badColor[i] === "undefined"){
|
|
|
+ htmlbody += `<tr style="background-color: ${badColor[i]}">
|
|
|
+ <td>${badid[i]}</td>
|
|
|
+ <td>${badpass[i]}</td>
|
|
|
+ <td>${badfailrate[i] + '%'}</td>
|
|
|
+ </tr>`;
|
|
|
+ }else {
|
|
|
+ htmlbody += `<tr style="background-color: ${badColor[i]}">
|
|
|
<td>${badid[i]}</td>
|
|
|
<td>${badpass[i]}</td>
|
|
|
<td>${badfailrate[i] + '%'}</td>
|
|
|
</tr>`;
|
|
|
+ }
|
|
|
htmlbody += "</tr>";
|
|
|
return htmlbody;
|
|
|
}
|