@@ -667,6 +667,39 @@ HotelTV.hal = (function() {
|
||||
__hcapfxn_Reboot();
|
||||
},
|
||||
|
||||
GetNetworkStatus: function() {
|
||||
return new Promise((resolve, reject) => {
|
||||
hcap.network.getNetworkInformation({
|
||||
"onSuccess" : function(s) {
|
||||
console.log("onSuccess : network_mode = " + s.network_mode +
|
||||
"\n ssid = " + s.ssid +
|
||||
"\n eth_speed = " + s.eth_speed +
|
||||
"\n eth_duplex = " + s.eth_duplex +
|
||||
"\n local_network_available = " + s.local_network_available +
|
||||
"\n internet_available = " + s.internet_available +
|
||||
"\n wifi_mode = " + s.wifi_mode +
|
||||
"\n wireless_security_type = " + s.wireless_security_type +
|
||||
"\n wifi_pass_key = " + s.wifi_pass_key +
|
||||
"\n using_dhcp = " + s.using_dhcp +
|
||||
"\n ip_address = " + s.ip_address +
|
||||
"\n subnet_mask = " + s.subnet_mask +
|
||||
"\n gateway = " + s.gateway +
|
||||
"\n dns1_address = " + s.dns1_address +
|
||||
"\n dns2_address = " + s.dns2_address +
|
||||
"\n dns_dhcp = " + s.dns_dhcp +
|
||||
"\n ethernet_plugged = " + s.ethernet_plugged +
|
||||
"\n wifi_plugged = " + s.wifi_plugged +
|
||||
"\n dhcp_state = " + s.dhcp_state);
|
||||
resolve({ "error": false, "info": s });
|
||||
},
|
||||
"onFailure" : function(f) {
|
||||
console.log("onFailure : errorMessage = " + f.errorMessage);
|
||||
resolve({ "error": true, "info": null });
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
GetDevInfo: function() {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -212,11 +212,57 @@ HotelTV.Init = async function() {
|
||||
|
||||
//STEP#03::> Get Device Info
|
||||
HotelTV.ui_utils.SetBusy(true);
|
||||
|
||||
const __ifxn_showFatalErr_Network = function() {
|
||||
let _tmval = 10;
|
||||
setTimeout(HotelTV.hal.Reboot, 10000);
|
||||
HotelTV.ui_utils.SetBusy(false);
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.error.get-devinfo",
|
||||
"SYSTEM ERROR",
|
||||
"Network is un-available.\r\nplease contact your system administrator.", {
|
||||
"timeout": _tmval,
|
||||
"cb_disp": function() {
|
||||
_tmval -= 1;
|
||||
console.log("time..." + _tmval);
|
||||
if ($('.error #countdown').css("display") == "none") {
|
||||
$('.error #countdown').fadeIn(1000);
|
||||
}
|
||||
$('.error #countdown #message').text(`System will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": null
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
//
|
||||
let __netStatus = await HotelTV.hal.GetNetworkStatus();
|
||||
if ( __netStatus.info==null || __netStatus.error==true ){
|
||||
console.info("aa");
|
||||
__ifxn_showFatalErr_Network();
|
||||
return;
|
||||
} else {
|
||||
console.info("bb");
|
||||
if ( __netStatus.info.ip_address=="0.0.0.0" || __netStatus.info.gateway=="0.0.0.0" ) {
|
||||
console.info("Fatall.......");
|
||||
__ifxn_showFatalErr_Network();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch ( _err ) {
|
||||
console.info("cc");
|
||||
__ifxn_showFatalErr_Network();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
try {
|
||||
await HotelTV.hal.GetDevInfo();
|
||||
//await HotelTV.hal.ShowDevInfo();
|
||||
} catch (_error) {
|
||||
let _tmval = 50;
|
||||
setTimeout(HotelTV.hal.Reboot, 49000);
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.error.get-devinfo",
|
||||
"SYSTEM ERROR",
|
||||
@@ -230,9 +276,7 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
$('.error #countdown #message').text(`System will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -244,6 +288,7 @@ HotelTV.Init = async function() {
|
||||
HotelTV.state['registration'] = await HotelTV.api.CheckRegistration();
|
||||
} catch (_error) {
|
||||
let _tmval = 50;
|
||||
setTimeout(HotelTV.hal.Reboot, 49000);
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.error.check-registration",
|
||||
"SYSTEM ERROR",
|
||||
@@ -257,9 +302,7 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -278,6 +321,7 @@ HotelTV.Init = async function() {
|
||||
HotelTV.ui_utils.SetBusy(false);
|
||||
|
||||
let _tmval = 20;
|
||||
setTimeout(HotelTV.hal.Reboot, 20000);
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.info.change-configuration",
|
||||
"SYSTEM INFO",
|
||||
@@ -291,14 +335,13 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
$('.error #countdown #message').text(`System will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
});
|
||||
return;
|
||||
}
|
||||
} catch (_error) {
|
||||
let _tmval = 50;
|
||||
setTimeout(HotelTV.hal.Reboot, 49000);
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.set-devinfo",
|
||||
"SYSTEM ERROR",
|
||||
@@ -312,9 +355,7 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -322,6 +363,7 @@ HotelTV.Init = async function() {
|
||||
HotelTV.hotelinfo = await HotelTV.api.GetHotelInfo();
|
||||
} catch (_error) {
|
||||
let _tmval = 50;
|
||||
setTimeout(HotelTV.hal.Reboot, 49000);
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.error.get-hotelinfo",
|
||||
"SYSTEM ERROR",
|
||||
@@ -335,9 +377,7 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
});
|
||||
}
|
||||
// state[theme_root] 정의
|
||||
@@ -351,6 +391,7 @@ HotelTV.Init = async function() {
|
||||
HotelTV.guestinfo = await HotelTV.api.GetGuestInfo();
|
||||
} catch (_error) {
|
||||
let _tmval = 50;
|
||||
setTimeout(HotelTV.hal.Reboot, 49000);
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.error.get-guestinfo",
|
||||
"SYSTEM ERROR",
|
||||
@@ -364,9 +405,7 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -374,6 +413,7 @@ HotelTV.Init = async function() {
|
||||
HotelTV.opening = await HotelTV.api.GetOpeningCtz();
|
||||
} catch (_error) {
|
||||
let _tmval = 50;
|
||||
setTimeout(HotelTV.hal.Reboot, 49000);
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.error.get-openingctzinfo",
|
||||
"SYSTEM ERROR",
|
||||
@@ -387,9 +427,7 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -409,6 +447,7 @@ HotelTV.Init = async function() {
|
||||
HotelTV.widget = await HotelTV.api.GetWidgetCtz();
|
||||
} catch (_error) {
|
||||
let _tmval = 50;
|
||||
setTimeout(HotelTV.hal.Reboot, 49000);
|
||||
//console.log("Display Error page for get widget info");
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.error.get-widget",
|
||||
@@ -423,9 +462,7 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -433,6 +470,7 @@ HotelTV.Init = async function() {
|
||||
HotelTV.tvguide = await HotelTV.api.GetProgramCtz();
|
||||
} catch (_error) {
|
||||
let _tmval = 50;
|
||||
setTimeout(HotelTV.hal.Reboot, 49000);
|
||||
//console.log("Display Error page for get tvguide info");
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.error.get-tvguideinfo",
|
||||
@@ -447,9 +485,7 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -516,6 +552,7 @@ HotelTV.Init = async function() {
|
||||
}
|
||||
} else {
|
||||
let _tmval = 60;
|
||||
setTimeout(HotelTV.hal.Reboot, 59000);
|
||||
HotelTV.ui_utils.ShowErrMsg(true,
|
||||
"system.error.unregistered-device",
|
||||
"SYSTEM ERROR",
|
||||
@@ -529,17 +566,14 @@ HotelTV.Init = async function() {
|
||||
$('.error #countdown').fadeIn(1000);
|
||||
}
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot`);
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
}
|
||||
"cb_eoe": null
|
||||
}
|
||||
);
|
||||
}
|
||||
console.log("Initialization:: Done");
|
||||
HotelTV.ui_utils.SetBusy(false);
|
||||
|
||||
SpatialNavigation.init();
|
||||
//SpatialNavigation.init();
|
||||
};
|
||||
|
||||
HotelTV.LoadWelCome = async function() {
|
||||
|
||||
@@ -7532,6 +7532,7 @@ HotelTV.ui_appfull = (function() {
|
||||
let _state = HotelTV.state;
|
||||
let _trTbl = HotelTV.translation;
|
||||
|
||||
setTimeout(HotelTV.hal.Reboot, 12000);
|
||||
HotelTV.ui_utils.ShowSysNoticeMsg(true,
|
||||
"notice",
|
||||
"SYSTEM NOTICE",
|
||||
@@ -7546,7 +7547,6 @@ HotelTV.ui_appfull = (function() {
|
||||
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
|
||||
}
|
||||
});
|
||||
@@ -7555,6 +7555,7 @@ HotelTV.ui_appfull = (function() {
|
||||
let _state = HotelTV.state;
|
||||
let _trTbl = HotelTV.translation;
|
||||
|
||||
setTimeout(HotelTV.hal.Reboot, 12000);
|
||||
HotelTV.ui_utils.ShowSysNoticeMsg(true,
|
||||
"notice",
|
||||
"SYSTEM NOTICE",
|
||||
@@ -7569,7 +7570,6 @@ HotelTV.ui_appfull = (function() {
|
||||
$('.error #countdown #message').text(`System will be restart in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
|
||||
}
|
||||
});
|
||||
@@ -7578,6 +7578,8 @@ HotelTV.ui_appfull = (function() {
|
||||
let _state = HotelTV.state;
|
||||
let _trTbl = HotelTV.translation;
|
||||
|
||||
setTimeout(HotelTV.hal.Reboot, 32000);
|
||||
|
||||
HotelTV.ui_utils.ShowSysNoticeMsg(true,
|
||||
"notice",
|
||||
"SYSTEM NOTICE",
|
||||
@@ -7592,8 +7594,6 @@ HotelTV.ui_appfull = (function() {
|
||||
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
//setTimeout(HotelTV.hal.PwrOff, 500);
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
|
||||
}
|
||||
});
|
||||
@@ -7603,7 +7603,7 @@ HotelTV.ui_appfull = (function() {
|
||||
let _tmval = 30;
|
||||
let _state = HotelTV.state;
|
||||
let _trTbl = HotelTV.translation;
|
||||
|
||||
setTimeout(HotelTV.hal.Reboot, 32000);
|
||||
HotelTV.ui_utils.ShowSysNoticeMsg(true,
|
||||
"notice",
|
||||
"SYSTEM NOTICE",
|
||||
@@ -7618,7 +7618,6 @@ HotelTV.ui_appfull = (function() {
|
||||
$('.error #countdown #message').text(`System will be restart in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
|
||||
}
|
||||
});
|
||||
|
||||
@@ -478,7 +478,7 @@ HotelTV.ui_welcome = (function() {
|
||||
let _tmval = 10;
|
||||
let _state = HotelTV.state;
|
||||
let _trTbl = HotelTV.translation;
|
||||
|
||||
setTimeout(HotelTV.hal.Reboot, 12000);
|
||||
HotelTV.ui_utils.ShowSysNoticeMsg(true,
|
||||
"notice",
|
||||
"SYSTEM NOTICE",
|
||||
@@ -493,7 +493,6 @@ HotelTV.ui_welcome = (function() {
|
||||
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
|
||||
}
|
||||
});
|
||||
@@ -501,7 +500,7 @@ HotelTV.ui_welcome = (function() {
|
||||
let _tmval = 10;
|
||||
let _state = HotelTV.state;
|
||||
let _trTbl = HotelTV.translation;
|
||||
|
||||
setTimeout(HotelTV.hal.Reboot, 12000);
|
||||
HotelTV.ui_utils.ShowSysNoticeMsg(true,
|
||||
"notice",
|
||||
"SYSTEM NOTICE",
|
||||
@@ -516,7 +515,6 @@ HotelTV.ui_welcome = (function() {
|
||||
$('.error #countdown #message').text(`System will be restart in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
|
||||
}
|
||||
});
|
||||
@@ -524,7 +522,7 @@ HotelTV.ui_welcome = (function() {
|
||||
let _tmval = 30;
|
||||
let _state = HotelTV.state;
|
||||
let _trTbl = HotelTV.translation;
|
||||
|
||||
setTimeout(HotelTV.hal.Reboot, 32000);
|
||||
HotelTV.ui_utils.ShowSysNoticeMsg(true,
|
||||
"notice",
|
||||
"SYSTEM NOTICE",
|
||||
@@ -539,8 +537,6 @@ HotelTV.ui_welcome = (function() {
|
||||
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
//setTimeout(HotelTV.hal.PwrOff, 500);
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
|
||||
}
|
||||
});
|
||||
@@ -550,7 +546,7 @@ HotelTV.ui_welcome = (function() {
|
||||
let _tmval = 30;
|
||||
let _state = HotelTV.state;
|
||||
let _trTbl = HotelTV.translation;
|
||||
|
||||
setTimeout(HotelTV.hal.Reboot, 32000);
|
||||
HotelTV.ui_utils.ShowSysNoticeMsg(true,
|
||||
"notice",
|
||||
"SYSTEM NOTICE",
|
||||
@@ -565,7 +561,6 @@ HotelTV.ui_welcome = (function() {
|
||||
$('.error #countdown #message').text(`System will be restart in ${_tmval} second...`);
|
||||
},
|
||||
"cb_eoe": function() {
|
||||
setTimeout(HotelTV.hal.Reboot, 500);
|
||||
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user