|
@@ -359,12 +359,6 @@ namespace Chromium {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("can not open centerSetting, maybe fault");
|
|
|
}
|
|
|
|
|
|
- CSimpleString translatePath;
|
|
|
- GetFunction()->GetPath("Cfg", translatePath);
|
|
|
- translatePath.Append(CSimpleStringA(SPLIT_SLASH_STR) + "UserCodeToMsgTip.ini");
|
|
|
-
|
|
|
- InitTranslateFile(translatePath.GetData());
|
|
|
-
|
|
|
if (m_withMagic)
|
|
|
{
|
|
|
std::string magicStr = CModTools::get_mutable_instance().getMagicStr();
|
|
@@ -589,6 +583,12 @@ namespace Chromium {
|
|
|
if (ErrorCodeEnum::Error_Succeed == GetFunction()->GetSysVar("TerminalStage", t_terminalState))
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("OnPreStart TerminalStage:%s", t_terminalState.GetData());
|
|
|
+ CAutoArray<CSimpleStringA> strErrorCodeArr;
|
|
|
+ CAutoArray<CSimpleStringA> strDescriptionArr;
|
|
|
+ CAutoArray<CSimpleStringA> strRemarkArr;
|
|
|
+ auto ret = GetFunction()->GetPrivilegeFunction()->GetVTMErrMsgArr(strErrorCodeArr, strDescriptionArr, strRemarkArr);
|
|
|
+ if (Error_Succeed == ret)
|
|
|
+ InitUserCodeToMsgTip(strErrorCodeArr, strDescriptionArr, strRemarkArr);
|
|
|
startWithCfg();//属于chromium重启或者其他情况,已经初始化好配置
|
|
|
}
|
|
|
else
|
|
@@ -758,43 +758,41 @@ namespace Chromium {
|
|
|
const CAutoArray<DWORD>& Param, const char* pszEntityName, const char* pszModuleName, const char* pszMessage, const linkContext& pLinkInfo)
|
|
|
{
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("OnLog %x from entity %s, msg : %s", dwUserCode, NULL == pszEntityName ? "" : pszEntityName, NULL == pszMessage ? "" : pszMessage);
|
|
|
- if (Event_VtmLoader_GetConfig_Suc == dwUserCode || Event_VtmLoader_GetConfig_Fail == dwUserCode)
|
|
|
+ switch (dwUserCode)
|
|
|
{
|
|
|
+ case Event_VtmLoader_GetConfig_Suc:
|
|
|
+ case Event_VtmLoader_GetConfig_Fail:
|
|
|
refreshLogLevel();//后置后需要刷新log level,因为chromium是先启动的实体
|
|
|
startWithCfg();
|
|
|
- }
|
|
|
+ break;
|
|
|
+ case Event_VtmLoader_GetVTMERRMSG_Suc:
|
|
|
+ /*
|
|
|
+ CSimpleString translatePath;
|
|
|
+ GetFunction()->GetPath("Cfg", translatePath);
|
|
|
+ translatePath.Append(CSimpleStringA(SPLIT_SLASH_STR) + "UserCodeToMsgTip.ini");
|
|
|
|
|
|
-#if (defined _WIN32 || defined _WIN64)
|
|
|
- //No Log_Notify
|
|
|
-#else
|
|
|
- if (Log_Notify == eLogType)
|
|
|
- {
|
|
|
- try {
|
|
|
- cJSON* pJson = cJSON_Parse(pszMessage);
|
|
|
- auto notifyReason = cJSON_GetObjectItem(pJson, "reason")->valuestring;
|
|
|
- auto notifymsg = cJSON_GetObjectItem(pJson, "errmsg")->valuestring;
|
|
|
- auto notiryRebootTime = cJSON_GetObjectItem(pJson, "rebootTime")->valuestring;
|
|
|
- auto notifyPool = m_pWsServer->getNotifyPool();
|
|
|
- if (notifyPool.size() > 0)
|
|
|
- {
|
|
|
- for (auto it : notifyPool)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Log_Notify err, notifyPool to %d, %d", it.first, it.second);
|
|
|
- m_pWsServer->do_send_notifyMsg(it.first, it.second, notifyReason, notifymsg, notiryRebootTime, dwSysError, dwUserCode);
|
|
|
- }
|
|
|
- }
|
|
|
+ InitTranslateFile(translatePath.GetData());
|
|
|
+ */
|
|
|
+ if (!GetFunction()->HasPrivilege())
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("no privilege");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ {
|
|
|
+ CAutoArray<CSimpleStringA> strErrorCodeArr;
|
|
|
+ CAutoArray<CSimpleStringA> strDescriptionArr;
|
|
|
+ CAutoArray<CSimpleStringA> strRemarkArr;
|
|
|
+ auto ret = GetFunction()->GetPrivilegeFunction()->GetVTMErrMsgArr(strErrorCodeArr, strDescriptionArr, strRemarkArr);
|
|
|
+ if (Error_Succeed == ret)
|
|
|
+ InitUserCodeToMsgTip(strErrorCodeArr, strDescriptionArr, strRemarkArr);
|
|
|
else
|
|
|
- {
|
|
|
- auto openRet = CModTools::get_mutable_instance().StartChromiumBrowser(ERR_PAGE_REASON::ErrNotify, { m_sysInfo.strTerminalID.GetData(), generateTimeStr() }, { notifyReason, notifymsg, notiryRebootTime, dwSysError, dwUserCode });
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Log_Notify err, open page %s, %d", Error_Succeed == openRet.first ? "success" : "fail", openRet.second);
|
|
|
- }
|
|
|
- }
|
|
|
- catch (std::exception& e) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Log_Notify err, %s", e.what());
|
|
|
+ LogWarn(Severity_Low, Error_Debug, LOG_WARN_CHROMIUM_VTMUSERMSG_ERR, CSimpleStringA::Format("GetVTMErrMsgArr err:%d", ret));
|
|
|
}
|
|
|
- return;
|
|
|
- }
|
|
|
-#endif
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|