|
|
@@ -251,9 +251,20 @@ function _slider_change(name) {
|
|
|
if (name == "configuration.volume") {
|
|
|
var val = document.getElementById("ui_configuration_volume").value;
|
|
|
_process_volume(val);
|
|
|
+
|
|
|
+ ivol = Math.floor(val*100.0);
|
|
|
+ _api_request("volume", {"volume":ivol},
|
|
|
+ function(inp) { console.log("volume api set ok:", inp); },
|
|
|
+ function(inp) { console.log("volume api set fail:", inp); });
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function _volume_test() {
|
|
|
+ _api_request("say", {"message":"testing 1, 2, 3"},
|
|
|
+ function(inp) { console.log("volume test ok:", inp); },
|
|
|
+ function(inp) { console.log("volume test fail:", inp); });
|
|
|
+}
|
|
|
+
|
|
|
//------------
|
|
|
|
|
|
function _clear_ui_driver() {
|
|
|
@@ -968,14 +979,12 @@ function _configuration() {
|
|
|
}
|
|
|
|
|
|
function _reset() {
|
|
|
-
|
|
|
_switch_ui('ui_login');
|
|
|
g_ctx.driver_login_state = "driver";
|
|
|
_clear_ui_driver();
|
|
|
_clear_ui_paddle();
|
|
|
|
|
|
location.reload(true);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function _reboot() {
|
|
|
@@ -986,24 +995,38 @@ function _reboot() {
|
|
|
}
|
|
|
|
|
|
function _custom0() {
|
|
|
- _switch_ui('ui_login');
|
|
|
- g_ctx.driver_login_state = "driver";
|
|
|
- _clear_ui_driver();
|
|
|
- _clear_ui_paddle();
|
|
|
+ _api_request("interfaceupdown", {"interface":"eth0", "state":"up"}, function(inp) { console.log("custom0 ok:", inp); }, function(inp) { console.log("custom0 error:", inp); });
|
|
|
}
|
|
|
|
|
|
function _custom1() {
|
|
|
- _switch_ui('ui_login');
|
|
|
- g_ctx.driver_login_state = "driver";
|
|
|
- _clear_ui_driver();
|
|
|
- _clear_ui_paddle();
|
|
|
+ _api_request("interfaceupdown", {"interface":"eth0", "state":"up"}, function(inp) { console.log("custom1 ok:", inp); }, function(inp) { console.log("custom1 error:", inp); });
|
|
|
+}
|
|
|
+
|
|
|
+function _update_diagnostic_window(_msg) {
|
|
|
+ var ele = document.getElementById("ui_diagnostic_view");
|
|
|
+ ele.innerHTML = _msg;
|
|
|
}
|
|
|
|
|
|
function _custom2() {
|
|
|
- _switch_ui('ui_login');
|
|
|
- g_ctx.driver_login_state = "driver";
|
|
|
- _clear_ui_driver();
|
|
|
- _clear_ui_paddle();
|
|
|
+ _api_request("interfaceinfo", {"interface":"eth0"}, _update_diagnostic_window, function(inp) { console.log("custom2 error:", inp); });
|
|
|
+}
|
|
|
+
|
|
|
+function _custom3() {
|
|
|
+ _api_request("say", {"message":"speech test"}, function(inp) { console.log("custom3 ok:", inp); }, function(inp) { console.log("custom3 error:", inp); });
|
|
|
+}
|
|
|
+
|
|
|
+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();
|
|
|
}
|
|
|
|
|
|
//------------
|
|
|
@@ -1025,9 +1048,14 @@ function init() {
|
|
|
document.getElementById('ui_diagnostic_custom1').onclick = _custom1;
|
|
|
document.getElementById('ui_diagnostic_custom2').onclick = _custom2;
|
|
|
|
|
|
+ document.getElementById('ui_diagnostic_custom3').onclick = _custom3;
|
|
|
+ document.getElementById('ui_diagnostic_custom4').onclick = _custom4;
|
|
|
+ document.getElementById('ui_diagnostic_custom5').onclick = _custom5;
|
|
|
+
|
|
|
// configuration
|
|
|
//
|
|
|
document.getElementById('ui_configuration_back').onclick = _mainscreen;
|
|
|
+ document.getElementById('ui_configuration_volumetest').onclick = _volume_test;
|
|
|
|
|
|
|
|
|
// login
|