more optimizations, remove WTVIRC for now, upgrade test.js
This commit is contained in:
@@ -6,7 +6,7 @@ const request_path = request_headers.request_url.replace(service_name + ":/", ""
|
||||
const romtype = session_data.get("wtv-client-rom-type");
|
||||
const bootver = session_data.get("wtv-client-bootrom-version")
|
||||
|
||||
if ((romtype == "bf0app" || !romtype) && (bootver == "105" || !bootver)) {
|
||||
if ((romtype === "bf0app" || !romtype) && (bootver === "105" || !bootver)) {
|
||||
// assume old classic in flash mode, override user setting and send tellyscript
|
||||
// because it is required to proceed in flash mode
|
||||
bf0app_update = true;
|
||||
|
||||
@@ -15,7 +15,7 @@ let bf0app_update = true;
|
||||
if (request_headers.query.path) request_path = request_headers.query.path;
|
||||
else request_path = default_build_to_send;
|
||||
|
||||
if (session_data.get("wtv-client-rom-type") == "bf0app" && session_data.get("wtv-client-bootrom-version") == "105") {
|
||||
if (session_data.get("wtv-client-rom-type") === "bf0app" && session_data.get("wtv-client-bootrom-version") === "105") {
|
||||
// assume old classic in flash mode, override user setting and send tellyscript
|
||||
// because it is required to proceed in flash mode
|
||||
bf0app_update = true;
|
||||
|
||||
@@ -7,7 +7,7 @@ const request_path = request_headers.query.path;
|
||||
const romtype = session_data.get("wtv-client-rom-type");
|
||||
const bootver = session_data.get("wtv-client-bootrom-version");
|
||||
|
||||
if ((romtype == "bf0app" || !romtype) && (bootver == "105" || !bootver)) {
|
||||
if ((romtype === "bf0app" || !romtype) && (bootver === "105" || !bootver)) {
|
||||
// assume old classic in flash mode, override user setting and send tellyscript
|
||||
// because it is required to proceed in flash mode
|
||||
bf0app_update = true;
|
||||
|
||||
@@ -7,7 +7,7 @@ if (!request_headers.query.path) {
|
||||
headers = errpage[0];
|
||||
data = errpage[1];
|
||||
} else {
|
||||
if (request_headers.Referer == service_name + ":/lc2-download-complete?") {
|
||||
if (request_headers.Referer === service_name + ":/lc2-download-complete?") {
|
||||
headers = `200 OK
|
||||
Content-type: text/html
|
||||
minisrv-no-mail-count: true
|
||||
@@ -34,7 +34,7 @@ async function processLC2DownloadPage(flashrom_info, headers, numparts = null) {
|
||||
sendToClient(socket, headers, data);
|
||||
return false;
|
||||
}
|
||||
if (numparts != null) flashrom_info.part_count = parseInt(numparts);
|
||||
if (numparts !== null) flashrom_info.part_count = parseInt(numparts);
|
||||
if (!flashrom_info.part_count) flashrom_info.part_count = parseInt(flashrom_info.message.slice(flashrom_info.message.length - 4).replace(/\D/g, ''));
|
||||
if (parseInt(flashrom_info.part_number) >= 0 && flashrom_info.rompath && flashrom_info.next_rompath) {
|
||||
if (!flashrom_info.message && flashrom_info.is_bootrom) {
|
||||
@@ -129,7 +129,7 @@ Your ${session_data.getBoxName()} is being<br>updated automatically.
|
||||
<p> <font size=+1>
|
||||
This will take about ${downloadTime} minutes and<br>then you can use your ${session_data.getBoxName()} again.
|
||||
`;
|
||||
if (flashrom_info.is_bootrom && flashrom_info.part_number == (flashrom_info.part_count - 1)) {
|
||||
if (flashrom_info.is_bootrom && flashrom_info.part_number === (flashrom_info.part_count - 1)) {
|
||||
data += `<p>
|
||||
The system will pause for about 30 seconds at the end of this
|
||||
update. Please <strong>do not</strong> interrupt the system
|
||||
|
||||
@@ -3,7 +3,7 @@ const minisrv_service_file = true;
|
||||
if (request_headers.query.path) {
|
||||
let url = service_name + ":/get-lc2-page?path=" + encodeURIComponent(request_headers.query.path);
|
||||
const romtype = session_data.get("wtv-client-rom-type");
|
||||
if (romtype == "bf0app") {
|
||||
if (romtype === "bf0app") {
|
||||
url = "client:updateflash?ipaddr=" + minisrv_config.services[service_name].host + "&port=" + minisrv_config.services[service_name].port + "&path=" + encodeURIComponent(service_name + ":/" + request_headers.query.path);
|
||||
if (request_headers.query.numparts) url += encodeURIComponent("?numparts=" + request_headers.query.numparts);
|
||||
} else {
|
||||
|
||||
@@ -15,7 +15,7 @@ const bf0app_update = true;
|
||||
if (request_headers.query.path) request_path = request_headers.query.path;
|
||||
else request_path = default_build_to_send;
|
||||
|
||||
if (session_data.get("wtv-client-rom-type") == "bf0app" && session_data.get("wtv-client-bootrom-version") == "105") {
|
||||
if (session_data.get("wtv-client-rom-type") === "bf0app" && session_data.get("wtv-client-bootrom-version") === "105") {
|
||||
// assume old classic in flash mode, override user setting and send tellyscript
|
||||
// because it is required to proceed in flash mode
|
||||
session_data.set("bf0app_update", bf0app_update);
|
||||
|
||||
Reference in New Issue
Block a user