issue #1 console.log대신 에러의 경우, console.error로 변경.

This commit is contained in:
Paul Kim
2023-02-13 21:22:11 +09:00
parent 322ec2c5f7
commit 50ba8a0d1e
3 changed files with 110 additions and 79 deletions

View File

@@ -109,11 +109,12 @@ HotelTV.api = (function() {
"put_order_roomservice": __apifxn_get_base_url() + "/api/" + _api_ver + "/assets/" + _dev_familly + "/" + _serial_num + "/requests/roomService/orders", "put_order_roomservice": __apifxn_get_base_url() + "/api/" + _api_ver + "/assets/" + _dev_familly + "/" + _serial_num + "/requests/roomService/orders",
/* Events */ /* Events */
"update_event": __apifxn_get_base_url() + "/api/" + _api_ver + "/assets/" + _dev_familly + "/" + _serial_num + "/event", "update_event": __apifxn_get_base_url() + "/api/" + _api_ver + "/assets/" + _dev_familly + "/" + _serial_num + "/event",
/* Status */
"set_device_status": __apifxn_get_base_url() + "/api/" + _api_ver + "/assets/" + _dev_familly + "/" + _serial_num + "/state",
/* /*
"get_emergency": __apifxn_get_base_url() + "/api/" + _api_ver + "/settops/" + _serial_num + "/emergency", "get_emergency": __apifxn_get_base_url() + "/api/" + _api_ver + "/settops/" + _serial_num + "/emergency",
"set_message_status": __apifxn_get_base_url() + "/api/" + _api_ver + "/settops/" + _serial_num + "/messages", "set_message_status": __apifxn_get_base_url() + "/api/" + _api_ver + "/settops/" + _serial_num + "/messages",
"set_device_status": __apifxn_get_base_url() + "/api/" + _api_ver + "/settops/" + _serial_num + "/state",
"set_device_opmode": __apifxn_get_base_url() + "/api/" + _api_ver + "/settops/" + _serial_num + "/bbdoors/opmode", "set_device_opmode": __apifxn_get_base_url() + "/api/" + _api_ver + "/settops/" + _serial_num + "/bbdoors/opmode",
*/ */
} }
@@ -215,7 +216,7 @@ HotelTV.api = (function() {
__apifxn_init({ 'dev_familly': model, 'serial_num': serial, 'svr_ip': ip, 'svr_port': port, 'api_ver': HotelTV.state.token.version, "license": HotelTV.state.token.license, "apikey": HotelTV.state.token.apikey, "registered": HotelTV.state.token.registered, "exist": HotelTV.state.token.exist, "firstBoot": HotelTV.state.token.firstBoot }); __apifxn_init({ 'dev_familly': model, 'serial_num': serial, 'svr_ip': ip, 'svr_port': port, 'api_ver': HotelTV.state.token.version, "license": HotelTV.state.token.license, "apikey": HotelTV.state.token.apikey, "registered": HotelTV.state.token.registered, "exist": HotelTV.state.token.exist, "firstBoot": HotelTV.state.token.firstBoot });
resolve(0); resolve(0);
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
} }
@@ -238,7 +239,7 @@ HotelTV.api = (function() {
__apifxn_CallCmsApi("GET", dl_url, "DownloadData", null).then(_result => { __apifxn_CallCmsApi("GET", dl_url, "DownloadData", null).then(_result => {
resolve(_result.data); resolve(_result.data);
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -257,7 +258,7 @@ HotelTV.api = (function() {
__apifxn_CallCmsApi("GET", sz_api_url, "GetTranslation", null).then(_result => { __apifxn_CallCmsApi("GET", sz_api_url, "GetTranslation", null).then(_result => {
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -270,7 +271,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -283,7 +284,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -296,7 +297,7 @@ HotelTV.api = (function() {
///console.log(`Success::>${_result.data}`); ///console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -309,7 +310,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -322,7 +323,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -335,7 +336,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -347,7 +348,7 @@ HotelTV.api = (function() {
__apifxn_CallCmsApi("GET", sz_api_url, "GetFlight", null).then(_result => { __apifxn_CallCmsApi("GET", sz_api_url, "GetFlight", null).then(_result => {
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -360,7 +361,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -373,7 +374,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -386,7 +387,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -399,7 +400,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -417,7 +418,7 @@ HotelTV.api = (function() {
resolve(null); resolve(null);
} }
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -434,7 +435,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -451,7 +452,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -468,7 +469,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -485,7 +486,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -501,7 +502,7 @@ HotelTV.api = (function() {
__apifxn_CallCmsApi((_item_id) ? "POST" : "GET", sz_api_url, "GetAmenityOrders", _item_id).then(_result => { __apifxn_CallCmsApi((_item_id) ? "POST" : "GET", sz_api_url, "GetAmenityOrders", _item_id).then(_result => {
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -518,7 +519,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -535,7 +536,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -552,7 +553,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -569,7 +570,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -586,7 +587,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -602,7 +603,7 @@ HotelTV.api = (function() {
__apifxn_CallCmsApi((_item_id) ? "POST" : "GET", sz_api_url, "GetRoomserviceOrders", _item_id).then(_result => { __apifxn_CallCmsApi((_item_id) ? "POST" : "GET", sz_api_url, "GetRoomserviceOrders", _item_id).then(_result => {
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -619,7 +620,7 @@ HotelTV.api = (function() {
//console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data)); resolve(JSON.parse(_result.data));
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
reject(_error.reason); reject(_error.reason);
}); });
}); });
@@ -642,7 +643,7 @@ HotelTV.api = (function() {
__apifxn_CallCmsApi("POST", sz_api_url, "UpdateEvent", _json_event).then(_result => { __apifxn_CallCmsApi("POST", sz_api_url, "UpdateEvent", _json_event).then(_result => {
console.log(`Success::>${_result.data}`); console.log(`Success::>${_result.data}`);
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
}); });
}, },
@@ -741,10 +742,10 @@ HotelTV.api = (function() {
_json_report.uptime.string = _fxn_sec2Date(_json_report.uptime.second); _json_report.uptime.string = _fxn_sec2Date(_json_report.uptime.second);
let sz_api_url = __apifxn_get_api_url("set_device_status"); let sz_api_url = __apifxn_get_api_url("set_device_status");
__apifxn_CallCmsApi("POST", sz_api_url, "SetDeviceStatus", _json_report).then(_result => { __apifxn_CallCmsApi("PATCH", sz_api_url, "SetDeviceStatus", _json_report).then(_result => {
console.log(`Success::>${_result.data}`); //console.log(`Success::>${_result.data}`);
}).catch(_error => { }).catch(_error => {
console.log(`Failure::>${_error.reason}`); console.error(`Failure::>${_error.reason}`);
}); });
}, },
} }

View File

@@ -238,7 +238,7 @@ HotelTV.Init = async function() {
"timeout": _tmval, "timeout": _tmval,
"cb_disp": function() { "cb_disp": function() {
_tmval -= 1; _tmval -= 1;
console.log("time..." + _tmval); //console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") { if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000); $('.error #countdown').fadeIn(1000);
} }
@@ -259,7 +259,7 @@ HotelTV.Init = async function() {
"timeout": _tmval, "timeout": _tmval,
"cb_disp": function() { "cb_disp": function() {
_tmval -= 1; _tmval -= 1;
console.log("time..." + _tmval); //console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") { if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000); $('.error #countdown').fadeIn(1000);
} }
@@ -282,7 +282,7 @@ HotelTV.Init = async function() {
"timeout": _tmval, "timeout": _tmval,
"cb_disp": function() { "cb_disp": function() {
_tmval -= 1; _tmval -= 1;
console.log("time..." + _tmval); //console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") { if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000); $('.error #countdown').fadeIn(1000);
} }
@@ -305,7 +305,7 @@ HotelTV.Init = async function() {
"timeout": _tmval, "timeout": _tmval,
"cb_disp": function() { "cb_disp": function() {
_tmval -= 1; _tmval -= 1;
console.log("time..." + _tmval); //console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") { if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000); $('.error #countdown').fadeIn(1000);
} }
@@ -328,7 +328,7 @@ HotelTV.Init = async function() {
"timeout": _tmval, "timeout": _tmval,
"cb_disp": function() { "cb_disp": function() {
_tmval -= 1; _tmval -= 1;
console.log("time..." + _tmval); //console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") { if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000); $('.error #countdown').fadeIn(1000);
} }
@@ -343,13 +343,13 @@ HotelTV.Init = async function() {
try { try {
HotelTV.weather = await HotelTV.api.GetWeather(); HotelTV.weather = await HotelTV.api.GetWeather();
} catch (_error) { } catch (_error) {
console.log("Display Error page for get Weather info"); console.error("Display Error page for get Weather info");
} }
try { try {
HotelTV.flight = await HotelTV.api.GetFlight(); HotelTV.flight = await HotelTV.api.GetFlight();
} catch (_error) { } catch (_error) {
console.log("Display Error page for get flight info"); console.error("Display Error page for get flight info");
} }
try { try {
@@ -363,7 +363,7 @@ HotelTV.Init = async function() {
"timeout": _tmval, "timeout": _tmval,
"cb_disp": function() { "cb_disp": function() {
_tmval -= 1; _tmval -= 1;
console.log("time..." + _tmval); //console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") { if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000); $('.error #countdown').fadeIn(1000);
} }
@@ -378,19 +378,19 @@ HotelTV.Init = async function() {
try { try {
HotelTV.news = await HotelTV.api.GetNews(); HotelTV.news = await HotelTV.api.GetNews();
} catch (_error) { } catch (_error) {
console.log("Display Error page for get news info"); console.error("Display Error page for get news info");
} }
try { try {
HotelTV.message = await HotelTV.api.GetMessage(); HotelTV.message = await HotelTV.api.GetMessage();
} catch (_error) { } catch (_error) {
console.log("Display Error page for get news info"); console.error("Display Error page for get news info");
} }
try { try {
HotelTV.translation = await HotelTV.api.GetTranslation(); HotelTV.translation = await HotelTV.api.GetTranslation();
} catch (_error) { } catch (_error) {
console.log("Display Error page for get translation info"); console.error("Display Error page for get translation info");
} }
@@ -422,7 +422,7 @@ HotelTV.Init = async function() {
} }
} }
} else { } else {
console.log("Display Error page for invalid license type."); console.error("Display Error page for invalid license type.");
} }
console.log("Initialization:: Done"); console.log("Initialization:: Done");
HotelTV.ui_utils.SetBusy(false); HotelTV.ui_utils.SetBusy(false);
@@ -445,13 +445,13 @@ HotelTV.LoadWelCome = async function() {
HotelTV.services = await HotelTV.api.GetServiceInfo(); HotelTV.services = await HotelTV.api.GetServiceInfo();
sessionStorage.setItem("services", JSON.stringify(HotelTV.services)); sessionStorage.setItem("services", JSON.stringify(HotelTV.services));
} catch (_error) { } catch (_error) {
console.log("Display Error page for get service info"); console.error("Display Error page for get service info");
} }
//HotelTV.translation = await JSON.parse(sessionStorage.getItem("translation")); //HotelTV.translation = await JSON.parse(sessionStorage.getItem("translation"));
try { try {
HotelTV.translation = await HotelTV.api.GetTranslation(); HotelTV.translation = await HotelTV.api.GetTranslation();
} catch (_error) { } catch (_error) {
console.log("Display Error page for get translation info"); console.error("Display Error page for get translation info");
} }
@@ -501,39 +501,39 @@ HotelTV.LoadAppFull = async function() {
try { try {
HotelTV.epg = await HotelTV.api.GetEpg(); HotelTV.epg = await HotelTV.api.GetEpg();
} catch (_error) { } catch (_error) {
console.log("Display Error page for get epg info"); console.error("Display Error page for get epg info");
} }
try { try {
HotelTV.carts.amenity = await HotelTV.api.GetAmenityCarts(null); HotelTV.carts.amenity = await HotelTV.api.GetAmenityCarts(null);
} catch (_error) { } catch (_error) {
console.log("Display Error page for get amenity carts info"); console.error("Display Error page for get amenity carts info");
} }
try { try {
HotelTV.carts.roomservice = await HotelTV.api.GetRoomserviceCarts(); HotelTV.carts.roomservice = await HotelTV.api.GetRoomserviceCarts();
} catch (_error) { } catch (_error) {
console.log("Display Error page for get roomservicec carts info"); console.error("Display Error page for get roomservicec carts info");
} }
try { try {
HotelTV.orders.amenity = await HotelTV.api.GetAmenityOrders(null); HotelTV.orders.amenity = await HotelTV.api.GetAmenityOrders(null);
} catch (_error) { } catch (_error) {
console.log("Display Error page for get amenity order info"); console.error("Display Error page for get amenity order info");
} }
try { try {
HotelTV.orders.roomservice = await HotelTV.api.GetRoomserviceOrders(null); HotelTV.orders.roomservice = await HotelTV.api.GetRoomserviceOrders(null);
} catch (_error) { } catch (_error) {
console.log("Display Error page for get roomservice order info"); console.error("Display Error page for get roomservice order info");
} }
try { try {
HotelTV.translation = await HotelTV.api.GetTranslation(); HotelTV.translation = await HotelTV.api.GetTranslation();
} catch (_error) { } catch (_error) {
console.log("Display Error page for get translation info"); console.error("Display Error page for get translation info");
} }
//HotelTV.translation = await JSON.parse(sessionStorage.getItem("translation")); //HotelTV.translation = await JSON.parse(sessionStorage.getItem("translation"));
@@ -568,7 +568,7 @@ HotelTV.LoadAppFull = async function() {
} }
} }
} catch (_error) { } catch (_error) {
console.log("Display Error page for get siApp Auth"); console.error("Display Error page for get siApp Auth");
} }
} }
}, 5000); }, 5000);
@@ -622,16 +622,16 @@ HotelTV.LoadAppFull = async function() {
// } // }
// if (recvMsg.event == "update_report") { if (recvMsg.event == "update_report") {
// HotelTV.hcap.GetUptime(); HotelTV.hcap.GetUptime();
// HotelTV.hcap.GetDeviceUsage().then(_usage => { HotelTV.hcap.GetDeviceUsage().then(_usage => {
// console.log(`USAGE::> CPU[${_usage.cpu}%] RAM[${_usage.mem}%]`); //console.log(`USAGE::> CPU[${_usage.cpu}%]`);
// //HotelTV.api.ReportBrief(HotelTV.devinfo, HotelTV.guestinfo, _usage); HotelTV.api.ReportBrief(HotelTV.devinfo, HotelTV.guestinfo, _usage);
// }); });
// } }
} }
} else { } else {
console.log('Your browser doesn\'t support web workers.') console.error('Your browser doesn\'t support web workers.')
} }
//STEP#07 MQTT Service //STEP#07 MQTT Service
@@ -654,7 +654,7 @@ HotelTV.LoadAppFull = async function() {
client.on('connect', function() { client.on('connect', function() {
client.subscribe(_mqttSvcInfo.topic, function(err) { client.subscribe(_mqttSvcInfo.topic, function(err) {
if (err) { if (err) {
console.log(`Fail to subscribe::TOPIC[${_mqttSvcInfo.topic}]`); console.error(`Fail to subscribe::TOPIC[${_mqttSvcInfo.topic}]`);
} else { } else {
console.log(`Success to subscribe::TOPIC[${_mqttSvcInfo.topic}]`); console.log(`Success to subscribe::TOPIC[${_mqttSvcInfo.topic}]`);
} }
@@ -670,7 +670,7 @@ HotelTV.LoadAppFull = async function() {
client.on('error', function(error) { client.on('error', function(error) {
// message is Buffer // message is Buffer
console.log(error.toString()); console.error(error.toString());
//client.end() //client.end()
}) })
} }

View File

@@ -25,6 +25,7 @@ HotelTV.ui_appfull = (function() {
var _hndl_tmrTvChnMngr = null; var _hndl_tmrTvChnMngr = null;
var _hndl_tmrUgMngr = null; var _hndl_tmrUgMngr = null;
var _hndl_tmrCtzThumbAni = null; var _hndl_tmrCtzThumbAni = null;
var _hndl_tmrCtzBgAni = null;
const _lastTm = { const _lastTm = {
'tvchannel_changed': null, 'tvchannel_changed': null,
'keyevt': null, 'keyevt': null,
@@ -3183,23 +3184,45 @@ HotelTV.ui_appfull = (function() {
let _ctzinfo = _program[_mmIdx].children[_smIdx].children; let _ctzinfo = _program[_mmIdx].children[_smIdx].children;
_state.menu.main[_mmIdx][_smIdx].cur = Object.keys(_ctzinfo)[event.page.index]; _state.menu.main[_mmIdx][_smIdx].cur = Object.keys(_ctzinfo)[event.page.index];
if (_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.interval > 0 && _ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.files[_state.lang].length > 1) { //if (_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.autoplay == true )
if (_hndl_tmrCtzThumbAni != null) { {
clearInterval(_hndl_tmrCtzThumbAni); if (_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.interval > 0 && _ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.files[_state.lang].length > 1) {
_hndl_tmrCtzThumbAni = null; if (_hndl_tmrCtzThumbAni != null) {
console.log("TMR(CTZ ANI)::>Destoried..."); clearInterval(_hndl_tmrCtzThumbAni);
} _hndl_tmrCtzThumbAni = null;
_hndl_tmrCtzThumbAni = setInterval(__uifxn_AppFull_Update_CtzThumbnail, Number(_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.interval) * 1000); console.log("TMR(CTZ ANI)::>Destoried...");
console.log("TMR::>Created..."); }
} else { _hndl_tmrCtzThumbAni = setInterval(__uifxn_AppFull_Update_CtzThumbnail, Number(_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.interval) * 1000);
if (_hndl_tmrCtzThumbAni != null) { console.log("TMR::>Created...");
clearInterval(_hndl_tmrCtzThumbAni); } else {
_hndl_tmrCtzThumbAni = null; if (_hndl_tmrCtzThumbAni != null) {
console.log("TMR(CTZ ANI)::>Destoried..."); clearInterval(_hndl_tmrCtzThumbAni);
_hndl_tmrCtzThumbAni = null;
console.log("TMR(CTZ ANI)::>Destoried...");
}
} }
} }
console.log("CTZ(GEN) IDX::>" + _state.menu.main[_mmIdx][_smIdx].cur);
if (_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].images.autoplay == true )
{
// if (_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.interval > 0 && _ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.files[_state.lang].length > 1) {
// if (_hndl_tmrCtzThumbAni != null) {
// clearInterval(_hndl_tmrCtzThumbAni);
// _hndl_tmrCtzThumbAni = null;
// console.log("TMR(CTZ ANI)::>Destoried...");
// }
// _hndl_tmrCtzThumbAni = setInterval(__uifxn_AppFull_Update_CtzThumbnail, Number(_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].thumbnails.interval) * 1000);
// console.log("TMR::>Created...");
// } else {
// if (_hndl_tmrCtzThumbAni != null) {
// clearInterval(_hndl_tmrCtzThumbAni);
// _hndl_tmrCtzThumbAni = null;
// console.log("TMR(CTZ ANI)::>Destoried...");
// }
// }
}
console.log("CTZ(GEN) IDX::>" + _state.menu.main[_mmIdx][_smIdx].cur);
HotelTV.api.ReportEvent([{'power': true, 'location':{'conId':_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].id}}]) HotelTV.api.ReportEvent([{'power': true, 'location':{'conId':_ctzinfo[_state.menu.main[_mmIdx][_smIdx].cur].id}}])
}); });
@@ -3400,11 +3423,18 @@ HotelTV.ui_appfull = (function() {
} }
} }
} else if (event.keyCode == 461) { } else if (event.keyCode == 461) {
// 컨텐트 폼의 백그라운드 에니메이션용 타이머 제거
if (_hndl_tmrCtzBgAni != null) {
clearInterval(_hndl_tmrCtzBgAni);
_hndl_tmrCtzBgAni = null;
console.log("TMR(CTZ ANI For Background)::>Destoried...");
}
// 컨텐트 폼의 썸네일 에니메이션용 타이머 제거 // 컨텐트 폼의 썸네일 에니메이션용 타이머 제거
if (_hndl_tmrCtzThumbAni != null) { if (_hndl_tmrCtzThumbAni != null) {
clearInterval(_hndl_tmrCtzThumbAni); clearInterval(_hndl_tmrCtzThumbAni);
_hndl_tmrCtzThumbAni = null; _hndl_tmrCtzThumbAni = null;
console.log("TMR(CTZ ANI)::>Destoried..."); console.log("TMR(CTZ ANI For Thumbnail)::>Destoried...");
} }
// 메인 메뉴로 귀환 // 메인 메뉴로 귀환