|
|
@@ -229,6 +229,8 @@ function _switch_ui(to) {
|
|
|
var _x = _calculate_ui_main_status_width_height();
|
|
|
g_ctx.status_text_h = _x.n_height;
|
|
|
g_ctx.status_text_w = _x.n_width;
|
|
|
+
|
|
|
+ console.log(g_ctx.status_text_h, g_ctx.status_text_w);
|
|
|
}
|
|
|
|
|
|
if ((to == "ui_main") ||
|
|
|
@@ -848,8 +850,9 @@ function _main_message_replace(msg, bg_color, text_color) {
|
|
|
var n = lines.length;
|
|
|
lines = lines.slice(n - g_ctx.status_text_h);
|
|
|
}
|
|
|
+
|
|
|
for (var i=0; i<lines.length; i++) {
|
|
|
- lines[i] = lines[i].slice(0,g_ctx.status_text_w);
|
|
|
+ lines[i] = lines[i].slice(0,g_ctx.status_text_w-1);
|
|
|
}
|
|
|
|
|
|
var idx = lines.length-1;
|
|
|
@@ -859,7 +862,7 @@ function _main_message_replace(msg, bg_color, text_color) {
|
|
|
|
|
|
var html_lines = [];
|
|
|
for (var i=0; i<lines.length; i++) {
|
|
|
- html_lines.push(lines[i].slice(0,g_ctx.status_text_w));
|
|
|
+ html_lines.push(lines[i].slice(0,g_ctx.status_text_w-1));
|
|
|
|
|
|
if (html_lines[i].match(/ACCEPT/)) {
|
|
|
html_lines[i] = "<div class='textrow accept'>" + html_lines[i] + "</div>";
|
|
|
@@ -882,8 +885,6 @@ function _main_message_replace(msg, bg_color, text_color) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- g_ctx.status_text = lines.join("\n");
|
|
|
-
|
|
|
g_ctx.status_text = lines.join("\n");
|
|
|
g_ctx.status_html_text = html_lines.join("<br>");
|
|
|
ele.innerHTML = g_ctx.status_html_text;
|
|
|
@@ -923,6 +924,11 @@ function _main_message_add(msg, bg_color, text_color) {
|
|
|
var n = lines.length;
|
|
|
lines = lines.slice(n - g_ctx.status_text_h);
|
|
|
}
|
|
|
+
|
|
|
+ for (var i=0; i<lines.length; i++) {
|
|
|
+ lines[i] = lines[i].slice(0,g_ctx.status_text_w-1);
|
|
|
+ }
|
|
|
+
|
|
|
for (var i=0; i<lines.length; i++) {
|
|
|
html_lines.push(lines[i].slice(0,g_ctx.status_text_w-1));
|
|
|
|
|
|
@@ -1165,6 +1171,9 @@ function _reset() {
|
|
|
}
|
|
|
|
|
|
function _reboot() {
|
|
|
+
|
|
|
+ _api_request("custom", {"function":"reboot"});
|
|
|
+
|
|
|
_switch_ui('ui_login');
|
|
|
g_ctx.driver_login_state = "driver";
|
|
|
_clear_ui_driver();
|
|
|
@@ -1172,11 +1181,11 @@ function _reboot() {
|
|
|
}
|
|
|
|
|
|
function _custom0() {
|
|
|
- _api_request("interfaceupdown", {"interface":"eth0", "state":"up"}, function(inp) { console.log("custom0 ok:", inp); }, function(inp) { console.log("custom0 error:", inp); });
|
|
|
+ _api_request("interfaceupdown", {"interface":"eth0", "state":"up"});
|
|
|
}
|
|
|
|
|
|
function _custom1() {
|
|
|
- _api_request("interfaceupdown", {"interface":"eth0", "state":"down"}, function(inp) { console.log("custom1 ok:", inp); }, function(inp) { console.log("custom1 error:", inp); });
|
|
|
+ _api_request("interfaceupdown", {"interface":"eth0", "state":"down"});
|
|
|
}
|
|
|
|
|
|
function _update_diagnostic_window(_msg) {
|
|
|
@@ -1185,25 +1194,17 @@ function _update_diagnostic_window(_msg) {
|
|
|
}
|
|
|
|
|
|
function _custom2() {
|
|
|
- _api_request("interfaceinfo", {"interface":"eth0"}, _update_diagnostic_window, function(inp) { console.log("custom2 error:", inp); });
|
|
|
+ _api_request("interfaceinfo", {"interface":"eth0"}, _update_diagnostic_window);
|
|
|
}
|
|
|
|
|
|
function _custom3() {
|
|
|
- _api_request("say", {"message":"speech test"}, function(inp) { console.log("custom3 ok:", inp); }, function(inp) { console.log("custom3 error:", inp); });
|
|
|
+ _api_request("say", {"message":"speech test"});
|
|
|
}
|
|
|
|
|
|
function _custom4() {
|
|
|
- //_switch_ui('ui_login');
|
|
|
- //g_ctx.driver_login_state = "driver";
|
|
|
- //_clear_ui_driver();
|
|
|
- //_clear_ui_paddle();
|
|
|
}
|
|
|
|
|
|
function _custom5() {
|
|
|
- //_switch_ui('ui_login');
|
|
|
- //g_ctx.driver_login_state = "driver";
|
|
|
- //_clear_ui_driver();
|
|
|
- //_clear_ui_paddle();
|
|
|
}
|
|
|
|
|
|
//------------
|