Jelajahi Sumber

#IQRV #comment 合并最新上线版本

gifur 3 tahun lalu
induk
melakukan
d44f2db3eb
42 mengubah file dengan 1312 tambahan dan 364 penghapusan
  1. 3 3
      CMakeLists.txt
  2. 1 2
      CMakeSettings.json
  3. 0 117
      ChangeLog
  4. 15 0
      ChangeLog.in
  5. 12 4
      Module/include/EventCode.h
  6. 111 32
      Module/mod_DeviceControl/DeviceControlFSM.cpp
  7. 0 1
      Module/mod_DeviceControl/DeviceControlFSM.h
  8. 211 5
      Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp
  9. 3 0
      Module/mod_ResourceWatcher/ResourceWatcherFSM.h
  10. 3 3
      Module/mod_cardissuer/CardIssuerFSM.cpp
  11. 96 7
      Module/mod_chromium/CModTools.cpp
  12. 7 0
      Module/mod_chromium/CModTools.h
  13. 45 4
      Module/mod_chromium/mod_chromium.cpp
  14. 2 0
      Module/mod_chromium/mod_chromium.h
  15. 16 39
      Module/mod_healthmanager/mod_healthmanager.cpp
  16. 35 16
      Module/mod_interactivecontrol/mod_interactivecontrol.cpp
  17. 1 0
      Module/mod_sipphone/Event.h
  18. 26 25
      Module/mod_sipphone/endpoint.cpp
  19. 23 6
      Module/mod_sipphone/endpoint.h
  20. 43 8
      Module/mod_sipphone/mod_sipphone.cpp
  21. 4 0
      Module/mod_sipphone/mod_sipphone.h
  22. 3 2
      Module/mod_sipphone/video_session.cpp
  23. 1 0
      Module/mod_sipphone/video_session.h
  24. 42 16
      Tool/guardian/guardian.cpp
  25. 5 1
      addin/cfg/ResourceWatcher.ini
  26. 1 0
      addin/packaging/DEBIAN/prerm
  27. 0 0
      addin/res/ManagerDesktop/Include/jQuery/js/emui-jquery.min.js
  28. 8 8
      addin/res/ManagerDesktop/css/emui-style.css
  29. TEMPAT SAMPAH
      addin/res/ManagerDesktop/images/radio_empty.png
  30. TEMPAT SAMPAH
      addin/res/ManagerDesktop/images/radio_empty_disabled.png
  31. TEMPAT SAMPAH
      addin/res/ManagerDesktop/images/radio_selected.png
  32. TEMPAT SAMPAH
      addin/res/ManagerDesktop/images/radio_selected_disabled.png
  33. 1 0
      addin/res/ManagerDesktop/js/menu.js
  34. 1 0
      addin/res/ManagerDesktop/js/page.js
  35. 109 0
      addin/res/ManagerDesktop/js/page/adv.js
  36. 148 18
      addin/res/ManagerDesktop/js/page/browser.js
  37. 1 30
      addin/res/ManagerDesktop/js/page/dns.js
  38. 2 2
      addin/res/ManagerDesktop/js/page/pinpad.js
  39. 36 0
      addin/res/ManagerDesktop/js/public.js
  40. 233 0
      addin/res/ManagerDesktop/prototype/adv.html
  41. 42 15
      addin/res/ManagerDesktop/prototype/browser.html
  42. 22 0
      addin/res/RunScript/shutdown_sogouservice_without_monitor.sh

+ 3 - 3
CMakeLists.txt

@@ -86,7 +86,7 @@ else()
 endif($ENV{PIPELINE_BUILD_ID})
 
 #Set the project version
-set(RAW_VERSION_STRING "0.1.5-dev1")
+set(RAW_VERSION_STRING "0.1.7-dev1")
 string(STRIP ${RAW_VERSION_STRING} RAW_VERSION_STRING)
 
 set(VERSION_REGEX "^.?([0-9]+)\\.([0-9]+)\\.([0-9]+)-?(.*)")
@@ -567,8 +567,8 @@ else(MSVC)
 				set(CPACK_GENERATOR "ZIP")
 				message(STATUS "set zip package file type")
 			else(FORMAT_UPDATE_PKG)
-				set(CPACK_GENERATOR "TGZ")
-				message(STATUS "set tgz package file type")
+				set(CPACK_GENERATOR "ZIP")
+				message(STATUS "set zip package file type for matching head bank publish")
 			endif(FORMAT_UPDATE_PKG)
 		endif()
 	endif(PACK_AS_DEB_PKG)

+ 1 - 2
CMakeSettings.json

@@ -37,8 +37,7 @@
       "cmakeCommandArgs": "-D BUILD_TESTING=OFF",
       "buildCommandArgs": "",
       "ctestCommandArgs": "-C Release",
-      "inheritEnvironments": [ "msvc_x86" ],
-      "variables": []
+      "inheritEnvironments": [ "msvc_x86" ]
     },
     {
       "name": "ARM64-GCC-Debug",

+ 0 - 117
ChangeLog

@@ -1,117 +0,0 @@
-## 更新记录
-
-## V0.1.3
-
-*上线时间:2021年12月2日*
-
-* 支持业务故障告警上送(陈良瑜)
-* 业务浏览器支持多Tab页面(陈纪林)
-* 添加搜狗输入法诊断信息打印(廖桂发)
-
-## V0.1.2
-
-* 修改编译脚本,直接生成更新安装包(廖桂发)
-* [mod_PinPad]密码键盘添加按键报错的报错日志(廖桂发)
-* T21HX401_运通卡改造相关上线(翟俊伟)
-* 优化媒体库,同步音量调节到信创版本(陈礼鹏)
-* [mod_Healthmanager]添加厂商信息告警上送(廖桂发)
-* [mod_Healthmanager]添加Gateway接口(廖桂发)
-* 框架支持UserCode字段传送到业务(廖桂发)
-
-## V0.1.1
-
-* 优化音频采集功能
-* 添加第一次开机启动告警
-* 添加CPU类型信息告警
-
-## V0.1.0
-
-* 实体集成终端安装功能上线
-* 修复业务提示音中断后后续不会再播放的缺陷
-
-## V0.0.12
-
-* [ResourceWatcher] 添加对搜狗输入法版本号和安装路径获取
-* [LocalMediaPlayer]优化实体出现Lost的异常问题
-
-## V0.0.11
-
-* [DeviceControl]简易离线桌面添加浏览器缓存清理操作
-* [DeviceControl]简易离线桌面添加搜狗输入法服务重启操作
-* [CardIssuser]调整回收箱满告警话术
-* [sipphone]连线过程音频设备增加告警信息
-* [sipphone]解决连线过程中音频引擎部分存在卡住问题
-* [ResourceWatcher] 启动时杀死dde-osd 进程,以此屏蔽右侧通知中心
-
-## V0.0.10
-* 升级告警状态上送(mod_UpgradeMgr/Run 实体合并4.9.0部分功能)(廖桂发)
-* 实体兼容上下摄像头根据设备名称识别(陈礼鹏)
-* 1031及以下版本支持恢复剪贴板(廖桂发)
-* 媒体优化图像渲染延迟问题(陈礼鹏)
-* 授权功能集不再更新指纹数据(翟俊伟)
-* 密码键盘添加验密告警码(廖桂发)
-* 物料维护乱码问题处理(廖桂发)
-* 密码键盘启动顺序前置(廖桂发)
-
-## V0.0.9
-
-* 填充终端系统信息上送字段(廖桂发)
-* 坐席连接创建和销毁添加告警日志(陈礼鹏)
-* 删除StructConfig文件夹,通过安装时从每个实体文件夹下拷贝到StructConfig,避免多份存留(廖桂发)
-
-## V0.0.8
-
-* 添加编译选项 UNDER_PRODUCT_ENV(廖桂发)
-* CommEntityUtili 公共文件添加 ShellExecute 接口用于获取Shell执行的返回内容(廖桂发)
-* 屏蔽掉TODO告警,污染日报数据(廖桂发)
-* 优化身份证实体读证期间的报错,徒增无效的告警(廖桂发)
-* 去除健康实体重复上送的终端信息,污染日报数据(廖桂发)
-* 媒体模块添加未释放文件关闭操作(陈礼鹏)
-
-## V0.0.7
-
-
-## V0.0.6
-
-* [Improve] 去除bin下面多余的文件(廖桂发,2021年8月20日)
-* T21FN361_(H)可视柜台国产化迁移改造功能优化迭代一期
-	* 可视柜台终端国产化媒体性能优化
-	* 业务浏览器支持特定字体渲染
-	* 高拍仪拍照限制大小
-	* 手势唤起常用功能菜单
-	* 修复试运行发现告警数据后台查看时乱码
-
-## V0.0.5-dev1
-* [Feature] 指纹比对后端项目 T21DR951
-* [Vendor] 科堡首次试运行版本
-
-## V0.0.4-dev1
-
-* 将依赖库的声明语句(Conan)全部迁移到 addin/cmake/DepencyConanFiles.cmake (廖桂发,何粤超,2021年5月10日)
-* 更新Module Other Tool 文件夹内容为 utf8,更新UOS的root.ini为UTF8,更新 DevAdapter/cmbsz 为utf8
-
-* 支持rvc/Audio的拷贝和打包(廖桂发,2020年12月30日)
-* 适应Jekins,添加WITH_CI_NUMBER宏标识(廖桂发,2020年12月22日)
-* 更新诗友给的CMPPrint.so(廖桂发,2020年12月11日)
-
-* 健康实体添加GPIO的启动,并修改Demo适配器保证接口调用成功(廖桂发,2020年12月8日)
-* 整合厂商的代码到码云和Conan,修改CMake脚本,做适应性改造(廖桂发,2020年12月8日)
-* 跟恒银要了GPIO的代码,因一期礼鹏的实体严重依赖GPIO,同时打开GPIO的编译(廖桂发,2020年12月8日)
-
-## V0.0.2-dev1
-
-* 所有要迁移改造的实体均添加到Module/CMakeLists.txt中,没达到100%的已注释(廖桂发,2020年12月2日)
-* 实体依赖无源码非外部厂商的共享库已经打包在`Misc/YYYY.MMDD.TT@LR04.02_ModuleDep/UOS`,新增需按照规则提交(廖桂发,2020年12月2日)
-
-* 添加 DevAdapter/res 文件夹,用于放置dep下的资源文件,如身份证的背景照片,该目录下的文件均会拷贝到dep下(廖桂发,2020年12月1日)
-* 添加5家厂商的测试 root.ini  文件并改动顶层CMakeLists.txt(廖桂发,2020年11月26日)
-* [cmake] 添加 PrecompiledHeader.cmake 用于 Windows 下预编译头文件(陈礼鹏,2020年11月14日)
-
-* 2020年9月16日:合并基于终端4.3.0的Module Other Tool 下的代码,以及DevAdapter部分的头文件
-* 基线分支为:[430_for_linux](http://mayun.itc.cmbchina.cn/QD_RemoteBankArea/LR04_RvcTerminal/tree/430_for_linux/)
-
-
-## V0.0.1-dev1
-
-* 2020-08-19: 将对框架的引用从全局引用的方式改成Target的方式调用
-

+ 15 - 0
ChangeLog.in

@@ -2,6 +2,21 @@
 
 *Last Built Day: @BUILD_DATE_STRING@*
 
+## V0.1.7
+
+* 全部更换为使用UOS自带浏览器打开业务页和广告页(廖桂发)
+* 支持通过本地维护界面控制广告的播放(陈礼鹏)
+* 支持通过本地维护界面清理浏览器缓存(廖桂发)
+* 调整CPU占用率和内存占用率的告警数据格式(陈纪林)
+
+## V0.1.6
+
+* 支持通过本地UOS浏览器打开业务页和广告页(廖桂发)
+* 临时下线播放广告功能(陈礼鹏),并在维护页面提供打开开关(廖桂发)
+* 细化CPU占用率和内存占用率高的进程信息(陈纪林)
+* 本地维护桌面优化重启搜狗输入法的操作(廖桂发)
+* 本地维护桌面添加对搜狗输入法版本的获取(廖桂发)
+
 ## V0.1.5
 
 * 浏览器固定打开首页和广告页(陈良瑜)

+ 12 - 4
Module/include/EventCode.h

@@ -618,6 +618,11 @@ ERR_ACCESSAUTH_SHA1_HASH}
 #define LOG_EVT_UI_STOPRECORDPREVIEW				0x30B00A02				//停止录像预览
 #define LOG_EVT_UI_STARTAFTERPREVIEWRECORD			0x30B00A03				//开始预览后录像
 #define LOG_EVT_UI_ADJUSTVIDEOECHOSIZE				0x30B00A04				//调整视频回显框大小
+
+#define LOG_EVT_OPEN_ADV_FROM_LOCAL_CONFIG	0x30B00B01		     //通过本地配置要求打开广告播放
+#define LOG_EVT_FORBIDDIEN_ADV_FROM_LOCAL_CONFIG	0x30B00B02 //通过本地配置要求关闭广告播放
+
+
 /*----End--InteractiveControl------------------------------*/
 #define IDCertificate_Public_Start                  	0x20190000
 #define LOG_EVT_IDCERTIFICATE_GREEN_ON					(IDCertificate_Public_Start + 1)
@@ -728,11 +733,11 @@ ERR_ACCESSAUTH_SHA1_HASH}
 #define LOG_EVT_USB_CONTROL_OP 0x21400003
 #define LOG_EVT_USB_LIGHT_ON 0x21400004
 #define LOG_EVT_USB_LIGHT_OFF 0x21400005
-#define LOG_DEVICECONTROL_BROWSER_CACHE_CLEAER 0x21400006
+//#define LOG_DEVICECONTROL_BROWSER_CACHE_CLEAER 0x21400006
 #define LOG_DEVICECONTROL_SOGOU_SCRIPTS_NOT_EXISTS 0x21400007
 #define LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_SUCC 0x21400008
 #define LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_FAILED 0x21400009
-
+#define LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_TIMEOUT 0x2140000A
 
 //#define LOG_ERR_DEVICECONTROL_RESTART 0x21480001
 
@@ -901,8 +906,11 @@ ERR_ACCESSAUTH_SHA1_HASH}
 #define	LOG_EVT_CHROMIUM_USE_CUSTOM_FULTURE_URL	0x40200010	//使用自定义的业务链接
 #define	LOG_EVT_CHROMIUM_DETECT_CUSTOM_FULTURE_URL_FROM_START	0x40200011
 #define	LOG_EVT_CHROMIUM_DETECT_CUSTOM_FULTURE_URL_FROM_CONFIG	0x40200012
-
-
+#define	LOG_EVT_CHROMIUM_DETECT_MAIN_URL_EMPTY	0x40200013
+#define	LOG_EVT_CHROMIUM_OPEN_MAIN_URL	0x40200014
+#define	LOG_EVT_CHROMIUM_OPEN_MAIN_WITH_UOS 0x40200015
+#define	LOG_EVT_CHROMIUM_OPEN_AD_WITH_UOS 0x40200016
+#define	LOG_EVT_CHROMIUM_BROWSER_CACHE_CLEAER 0x40200017
 
 #define EVENT_RESTART_SHELL      0x50300001  // 重启Shell
 #define EVENT_RESTART_MACHINE     0x50300002  // 重启终端

+ 111 - 32
Module/mod_DeviceControl/DeviceControlFSM.cpp

@@ -4,6 +4,7 @@
 #include "EventCode.h"
 #include "fileutil.h"
 #include "toolkit.h"
+#include "osutil.h"
 #include "CommEntityUtil.hpp"
 
 #if defined(RVC_OS_WIN)
@@ -123,7 +124,6 @@ ErrorCodeEnum CDeviceControlFSM::OnInit()
         }
     }
 
-    DoBrowserCacheClearJob();
     //DoRestartSogouServicesJob();
 
     return Error_Succeed;
@@ -161,36 +161,6 @@ ErrorCodeEnum CDeviceControlFSM::InitializeTokenLib()
 #endif //RVC_OS_WIN
 }
 
-void CDeviceControlFSM::DoBrowserCacheClearJob()
-{
-    LOG_FUNCTION();
-
-    CSmartPointer<IConfigInfo> spConfig;
-    ErrorCodeEnum err = GetEntityBase()->GetFunction()->OpenConfig(Config_Run, spConfig);
-    CSimpleStringA str(true);
-    err = spConfig->ReadConfigValue("Browser", "CacheClear", str);
-    if (str.Compare("true", true) == 0) {
-
-        CSimpleStringA strCachePath;
-        GetEntityBase()->GetFunction()->GetPath("Temp", strCachePath);
-        if (!strCachePath.IsNullOrEmpty()) {
-            strCachePath += SPLIT_SLASH_STR;
-            strCachePath += "cefCache";
-
-            Dbg("browser cache path: %s", strCachePath.GetData());
-
-            if (ExistsDirA(strCachePath)) {
-                RemoveDirRecursiveA(strCachePath);
-                LogWarn(Severity_Middle, Error_Debug, LOG_DEVICECONTROL_BROWSER_CACHE_CLEAER, "clear chromium browser cache.");
-            }
-
-            if (!ExistsDirA(strCachePath)) {
-                spConfig->WriteConfigValue("Browser", "CacheClear", NULL);
-            }
-        }
-    }
-}
-
 void CDeviceControlFSM::DoRestartSogouServicesJob()
 {
     LOG_FUNCTION();
@@ -221,10 +191,119 @@ ErrorCodeEnum CDeviceControlFSM::RestartSogouServices()
     std::string shutdown_service(shellScriptPath.GetData());
     shutdown_service += "shutdown_sogouservice.sh";
 
+    std::string shutdown_service_without_monitor(shellScriptPath.GetData());
+    shutdown_service_without_monitor += "shutdown_sogouservice_without_monitor.sh";
+
     const BOOL s1 = ExistsFileA(startup_service.c_str());
     const BOOL s2 = ExistsFileA(shutdown_service.c_str());
+    const BOOL s3 = ExistsFileA(shutdown_service_without_monitor.c_str());
+
+    if (s3) {
+        Dbg("to shutdown sogou service except monitor...");
+        char* relate_processes[3] = { "sogouImeWebSrv", "sogouImeService", "sogoumonitor.sh" };
+        int count = 4;
+        alive_process_info old_processes[4];
+        memset(old_processes, 0, sizeof(old_processes));
+        osutil_detect_unique_app(relate_processes, array_size(relate_processes), &count, old_processes);
+
+        int sogouImeWebSrv_PID(0), sogouImeServicePID(0);
+
+        bool monitor_exist(false), other_exists(false);
+
+        /** 因为接口暂时获取不了命令行的内容,只能暂时将此接口置为成功 [Gifur@2022110]*/
+        monitor_exist = true;
+
+        for (int i = 0; i < count; ++i) {
+            if (strcmp(old_processes[i].name, relate_processes[2]) == 0) {
+                monitor_exist = true;
+            } else {
+                other_exists = true;
+            }
+            if (strcmp(old_processes[i].name, relate_processes[0]) == 0) {
+                sogouImeWebSrv_PID = old_processes[i].pid;
+            } else if (strcmp(old_processes[i].name, relate_processes[1]) == 0) {
+                sogouImeServicePID = old_processes[i].pid;
+            }
+        }
+
+        if (!monitor_exist) {
+            return Error_InvalidState;
+        } else if(!other_exists){
+            return Error_NotExist;
+        } else {
+
+            std::string succStr, errStr;
+            std::string runStr("bash ");
+            runStr += shutdown_service_without_monitor;
+            if (!SP::Module::Util::ShelllExecute(runStr, succStr, errStr)) {
+                LogWarn(Severity_Middle, Error_Unexpect, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_FAILED,
+                        CSimpleStringA::Format("%s: %s, %s", shutdown_service_without_monitor.c_str(), succStr.c_str(), errStr.c_str()));
+                return Error_Unexpect;
+            } else {
+                Dbg("execute {%s} suc: %s", shutdown_service_without_monitor.c_str(), succStr.c_str());
+
+                /**等待服务进程退出 */
+                Sleep(300);
+
+                /** Sogou的监护服务每隔5s会检测搜狗服务是否存在,否则会重启,为什么不自己重启,因为搜狗服务得跑在普通用户权限下 [Gifur@20211230]*/
+                const DWORD defaultInterval = 3000;
+                const int maxtIntervalTimes(3);
+                int intervalTimes(0);
+
+                char* relate_processes2[2] = { "sogouImeWebSrv", "sogouImeService" };
+                
+                bool succ_flag(false);
+                int sogouImeWebSrv_newPID(0), sogouImeService_newPID(0);
+
+                int count2 = 3;
+                alive_process_info new_processes[3];
+                memset(new_processes, 0, sizeof(new_processes));
+                osutil_detect_unique_app(relate_processes2, array_size(relate_processes2), &count2, new_processes);
+
+                do {
+
+                    if (count2 == 2/*normal process count*/) {
+                        int exit_flag(0);
+                        for (int i = 0; i < count2; ++i) {
+                            if (strcmp(new_processes[i].name, relate_processes2[0]) == 0 && sogouImeWebSrv_PID != new_processes[i].pid) {
+                                sogouImeWebSrv_newPID = new_processes[i].pid;
+                                exit_flag += 1;
+                            } else if (strcmp(new_processes[i].name, relate_processes2[1]) == 0 && sogouImeServicePID != new_processes[i].pid) {
+                                exit_flag += 1;
+                                sogouImeService_newPID = new_processes[i].pid;
+                            }
+                        }
+
+                        if (exit_flag == 2) {
+                            succ_flag = true;
+                            break;
+                        }
+                    }
+
+                    if (++intervalTimes >= maxtIntervalTimes) {
+                        break;
+                    }
+
+                    Sleep(defaultInterval);
+                    count2 = 3;
+                    memset(new_processes, 0, sizeof(new_processes));
+                    osutil_detect_unique_app(relate_processes2, array_size(relate_processes2), &count2, new_processes);
+
+                } while (true);
+
+                if (succ_flag) {
+                    LogWarn(Severity_Middle, Error_Debug, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_SUCC,
+                            CSimpleStringA::Format("auto restart sogou services succ: WebSrv pid: %u, Service pid: %u", sogouImeWebSrv_newPID, sogouImeService_newPID));
+                    result = Error_Succeed;
+                } else {
+                    LogWarn(Severity_Middle, Error_TimeOut, LOG_DEVICECONTROL_SOGOU_SCRIPTS_EXECUTE_TIMEOUT, "wait sogou auto restart timeout");
+                    result = Error_TimeOut;
+                }
+            }
+        }
+    }
 
-    if (s1 && s2) {
+    else if (s1 && s2) {
 
         do {
             std::string succStr, errStr;

+ 0 - 1
Module/mod_DeviceControl/DeviceControlFSM.h

@@ -153,7 +153,6 @@ public:
 	ErrorCodeEnum InitializeTokenLib();
 	ErrorCodeEnum RestartSogouServices();
 private:
-	void DoBrowserCacheClearJob();
 	void DoRestartSogouServicesJob();
 	
 

+ 211 - 5
Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp

@@ -3907,6 +3907,196 @@ void ResourceWatcherFSM::UploadSysVersionInfo(UINT & ver)
     LogWarn(Severity_Middle, Error_Hardware, LOG_RESOURCEWATCHER_SYSTEMINFO, ret.second.c_str());
 }
 
+string ResourceWatcherFSM::CPUProcessStatus()
+{
+    CSmartPointer<IEntityFunction> spFunction = this->GetEntityBase()->GetFunction();
+    CSmartPointer<IConfigInfo> spConfig;
+    ErrorCodeEnum erroCode = Error_Unexpect;
+    spFunction->OpenConfig(Config_Software, spConfig);
+    int cpuTop = 0;
+    erroCode = spConfig->ReadConfigValueInt("TOPProcess", "cpu", cpuTop);
+    
+    if (cpuTop == 0)
+    {
+        return "";
+    }
+
+    map<string, string> nameProcess;
+
+    CSystemRunInfo runInfo = { 0 };
+    GetEntityBase()->GetFunction()->GetSystemRunInfo(runInfo);
+
+    for (int i = 0; i < runInfo.strRunningEntityNames.GetCount(); i++)
+    {
+        string entityName = runInfo.strRunningEntityNames[i].GetData();
+        CEntityRunInfo entityInfo = { 0 };
+        GetEntityBase()->GetFunction()->GetEntityRunInfo(entityName.c_str(), entityInfo);
+        //Dbg("No. %d Current run entity : %s, procesID = %d !", i + 1, entityName, entityInfo.dwProcessID);
+        nameProcess[to_string(entityInfo.dwProcessID)] = entityName;
+    }
+
+    //cout << "---------CPU----------" << endl;
+    int cpu_num = sysconf(_SC_NPROCESSORS_CONF);
+    //cout << "cpu number = " << cpu_num << endl;
+
+    FILE* fp;
+    char buffer[2048];
+    string cmd = "ps c -eo pid,%cpu,command | sort -k2 -rn | head -" + to_string(cpuTop);
+    fp = popen(cmd.c_str(), "r");
+    int i = 0;
+
+    string s;
+    string str[3];
+
+    //cpu
+    Dbg("CPU TOP %d PROCESS!", cpuTop);
+    string topMessage = "";
+    while (i < cpuTop)
+    {
+        fgets(buffer, sizeof(buffer), fp);
+
+        s = buffer;
+        istringstream is(s);
+        is >> str[0] >> str[1] >> str[2];
+
+
+        double temp;
+        stringstream ss1;
+        ss1 << str[1];
+        ss1 >> temp;
+        temp = temp / cpu_num;
+
+        //stringstream tss;
+        
+
+        /*stringstream ss2;
+        ss2 << temp;
+        ss2 >> str[1];*/
+
+        stringstream ss2;
+        ss2 << std::setiosflags(std::ios::fixed) << std::setprecision(2) << temp;
+        str[1] = ss2.str();
+
+        //printf("%s", s.c_str());
+        if (nameProcess.find(str[0]) != nameProcess.end())
+        {
+            str[2] = nameProcess[str[0]];
+        }
+
+        //cout << str[0] << ", " << str[1] << "%, " << str[2] << endl;
+        //cout << s;
+
+        //Dbg("Process id = %s, CPU usage = %s, Process Name = %s. ", str[0].c_str(), (str[1] + "%").c_str() , str[2].c_str());
+        topMessage = topMessage + "\"" + str[2] + "\"" + ":\"" + str[1] + "%\"";
+        if (i != cpuTop - 1)
+        {
+            topMessage += ",";
+        }
+
+        ++i;
+    }
+    topMessage += "}";
+    //Dbg("%s", topMessage.c_str());
+    /*LogWarn(Severity_Low, Error_Resource, LOG_EVT_RESOURCE_MEMORY_TOO_HIGH,
+        CSimpleStringA::Format("%s", topMessage.c_str())
+    );*/
+    pclose(fp);
+    return topMessage;
+}
+
+string ResourceWatcherFSM::MemoryProcessStatus()
+{
+    CSmartPointer<IEntityFunction> spFunction = this->GetEntityBase()->GetFunction();
+    CSmartPointer<IConfigInfo> spConfig;
+    ErrorCodeEnum erroCode = Error_Unexpect;
+    spFunction->OpenConfig(Config_Software, spConfig);
+    int memTop = 0;
+    erroCode = spConfig->ReadConfigValueInt("TOPProcess", "mem", memTop);
+
+    if (memTop == 0)
+    {
+        return "";
+    }
+
+    map<string, string> nameProcess;
+
+    CSystemRunInfo runInfo = { 0 };
+    GetEntityBase()->GetFunction()->GetSystemRunInfo(runInfo);
+
+    for (int i = 0; i < runInfo.strRunningEntityNames.GetCount(); i++)
+    {
+        string entityName = runInfo.strRunningEntityNames[i].GetData();
+        CEntityRunInfo entityInfo = { 0 };
+        GetEntityBase()->GetFunction()->GetEntityRunInfo(entityName.c_str(), entityInfo);
+        //Dbg("No. %d Current run entity : %s, procesID = %d !", i + 1, entityName, entityInfo.dwProcessID);
+        nameProcess[to_string(entityInfo.dwProcessID)] = entityName;
+    }
+
+    FILE* fp;
+    char buffer[2048];
+    string cmd = "ps c -eo pid,%mem,rss,command | sort -k3 -rn | head -" + to_string(memTop);
+    fp = popen(cmd.c_str(), "r");
+    int i = 0;
+
+    string s;
+    string str[4];
+
+    //cout << "---------MEMORY----------" << endl;    
+
+    //mem
+    Dbg("MEM TOP %d PROCESS!", memTop);
+    string topMessage = "";
+    while (i < memTop)
+    {
+        fgets(buffer, sizeof(buffer), fp);
+
+        s = buffer;
+        istringstream is(s);
+        is >> str[0] >> str[1] >> str[2] >> str[3];
+
+
+        double temp;
+        stringstream ss1;
+        ss1 << str[2];
+        ss1 >> temp;
+        temp = temp / (1024 * 1024);
+
+       /* stringstream ss2;
+        ss2 << temp;
+        ss2 >> str[2];*/
+        //printf("%s", s.c_str());
+        stringstream ss2;
+        ss2 << std::setiosflags(std::ios::fixed) << std::setprecision(2) << temp;
+        str[2] = ss2.str();
+
+        if (nameProcess.find(str[0]) != nameProcess.end())
+        {
+            str[3] = nameProcess[str[0]];
+        }
+
+        //cout << str[0] << ", " << str[1] << ", " << str[2] << " GB," << str[3] << endl;
+        //Dbg("Process id = %s, Memory usage = %s, Memory size = %s, Process Name = %s. ", 
+                //str[0].c_str(), (str[1] + "%").c_str(), (str[2] + " GB").c_str(), str[3].c_str());
+         //topMessage = topMessage + "\"" + str[3] + "\"" + ":" + "\"" + str[1] + "%|" + str[2] + " GByte\"";
+         topMessage = topMessage + "\"" + str[3] + "\"" + ":" + "\"" + str[1] + "%\"";
+         
+         if (i != memTop - 1)
+         {
+             topMessage += ",";
+         }
+        //cout << s;
+
+        ++i;
+    }
+    topMessage += "}";
+    //Dbg("%s", topMessage.c_str());
+   /* LogWarn(Severity_Low, Error_Resource, LOG_EVT_RESOURCE_CPU_TOO_HIGH,
+        CSimpleStringA::Format("%s", topMessage.c_str())
+    );*/
+    pclose(fp);
+    return topMessage;
+}
+
 void ResourceWatcherFSM::HardwareInfoTimer(void* pData)
 {
     GetSystemCPUStatus();
@@ -3962,9 +4152,15 @@ void ResourceWatcherFSM::GetSystemCPUStatus()
     if (cUsedRate < 0.8) {
         //Dbg("[CPU] used rate: %.1lf%%.", cUsedRate * 100);
     } else {
-        LogWarn(Severity_Low, Error_Resource, LOG_EVT_RESOURCE_CPU_TOO_HIGH,
+        /*LogWarn(Severity_Low, Error_Resource, LOG_EVT_RESOURCE_CPU_TOO_HIGH,
                 CSimpleStringA::Format("CPU TOO HIGH! [CPU] used rate: %.1lf%%.", cUsedRate * 100)
-        );
+        );*/
+        stringstream tss;
+        tss << std::setiosflags(std::ios::fixed) << std::setprecision(2) << cUsedRate * 100;
+
+        string warn = "{ \"total_used\":\"" + tss.str() + "%\"," + CPUProcessStatus();
+        Dbg("%s", warn.c_str());
+        LogWarn(Severity_Low, Error_Resource, LOG_EVT_RESOURCE_CPU_TOO_HIGH, CSimpleStringA::Format("%s", warn.c_str()));
     }
 
 }
@@ -4004,10 +4200,20 @@ void ResourceWatcherFSM::GetSystemMemoryStatus()
     if (mUsedRate < 0.8) {
         //Dbg("[Memory] total: %s, free: %s, available: %s, [Memory] used rate: %.1lf%%.", szResult, szResult2, szResult3, mUsedRate * 100);
     } else {
-        LogWarn(Severity_Low, Error_Resource, LOG_EVT_RESOURCE_MEMORY_TOO_HIGH,
+        /*LogWarn(Severity_Low, Error_Resource, LOG_EVT_RESOURCE_MEMORY_TOO_HIGH,
                 CSimpleStringA::Format("MEMORY TOO HIGH! -- [Memory] total: %s, free: %s, available: %s, [Memory] used rate: %.1lf%%.",
                                        szResult, szResult2, szResult3, mUsedRate * 100)
-        );
+        );*/
+        char usedResult[DEFAULT_OUTPUT_FORMAT_SIZE];
+        ByteSprintf(usedResult, (double)(memInfo->memTotal) * 1024 * mUsedRate, 'G');
+
+        stringstream ss1;
+        ss1 << std::setiosflags(std::ios::fixed) << std::setprecision(2) << mUsedRate * 100;
+
+        string warn = "{ \"total\":\"" + string(szResult) + "\"," + 
+            "\"used\":\"" + ss1.str() + "%\"," + MemoryProcessStatus();
+        Dbg("%s", warn.c_str());
+        LogWarn(Severity_Low, Error_Resource, LOG_EVT_RESOURCE_MEMORY_TOO_HIGH, CSimpleStringA::Format("%s", warn.c_str()));
     }
 }
 
@@ -4309,7 +4515,7 @@ void ResourceWatcherFSM::ConfirmDNSConfigHasSet()
         SP::Utility::replaceInPlace(a, "\n", "|");
         LogWarn(Severity_Low, Error_Unexpect, LOG_RESOURCEWATCHER_DNS_INFO_UPLOAD,
                 CSimpleStringA::Format("%s $$ %s|%s", a.c_str(), m_strDefaultDns.GetData(), m_strBackupDns.GetData()));
-        SetLocalDNSWithNetworkManager(dns1, dns2);
+        //SetLocalDNSWithNetworkManager(dns1, dns2);
     } while (false);
     return;
 

+ 3 - 0
Module/mod_ResourceWatcher/ResourceWatcherFSM.h

@@ -476,6 +476,9 @@ public:
 	UINT GetSystemDisplayVersion(CSimpleStringA& strVersion);
 	void UploadSysVersionInfo(UINT& ver);
 
+	string CPUProcessStatus();
+	string MemoryProcessStatus();
+
 	void HardwareInfoTimer(void* pData);
 
 	BOOL ReadCPUInfo(CPUInfo* cpu);

+ 3 - 3
Module/mod_cardissuer/CardIssuerFSM.cpp

@@ -410,7 +410,7 @@ unsigned int CCardIssuerFSM::s2_on_event(FSMEvent* pEvt)
 				pGMEE->ctx->Ans.reserved1[i] = 0;
 				pGMEE->ctx->Ans.reserved2[i] = "";
 			}
-			Dbg("%s,%d,%d,%d", (const char*)pGMEE->ctx->Ans.CardBoxNo[i],
+			Dbg("GetMaterialEx: %d: CardBoxNo:%s,CardInit:%d, Mixed:%d, Remains:%d",i, (const char*)pGMEE->ctx->Ans.CardBoxNo[i],
 				pGMEE->ctx->Ans.CardInit[i],
 				pGMEE->ctx->Ans.mixed[i],
 				pGMEE->ctx->Ans.remains[i]);
@@ -2712,8 +2712,8 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerService_Issue_Req, CardI
 	FSMSetIssueFlag(1);
 	//move card to holder
 	errCode = m_pCardIssuer->MoveCard(CI_MOVECARD_FROM_HOPPER,m_currentHopper);
-	
-	Dbg("move card result %d.",errCode);
+	Dbg("move card result %d, %s.", m_currentHopper, SpStrError(errCode));
+
 	if (errCode != Error_Succeed)
 	{
 		//LogErrMsg("Move card from hopper to position", errCode, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER, TRUE);

+ 96 - 7
Module/mod_chromium/CModTools.cpp

@@ -85,6 +85,7 @@ namespace Chromium {
 		notifyExist = breakdownExist = false;
 		m_magicStr = uuid4_generate(8);
 		m_withMin = false;
+		InitBrowserUseMode();
 	}
 
 
@@ -114,9 +115,18 @@ namespace Chromium {
 
 		return true;
 #else
-		boost::process::child child_process("sudo killall -9 cefclient");
-		child_process.wait();
-		DbgEx("run killAllChromium success");
+		do 
+		{
+            boost::process::child child_process("sudo killall -9 cefclient");
+            child_process.wait();
+		} while (false);
+		do 
+		{
+            boost::process::child child_process("sudo killall -9 uosbrowser");
+            child_process.wait();
+		} while (false);
+
+		DbgEx("run killAllChromium success ex");
 		return true;
 #endif
 	}
@@ -403,6 +413,38 @@ namespace Chromium {
 
 
 	std::string CModTools::generateAdCmd(std::string AdUrl) {
+
+        if (m_bUseUOSBrowser) {
+
+            CSimpleStringA strUOSBrowserPath("uos-browser ");
+            //CSimpleStringA strParams("--new-window  --window-position=1280,1024 --window-size=1920,1080");
+            CSimpleStringA strParams("--new-window --kiosk --window-position=1280,1024");
+
+            CSimpleStringA tempPath;
+            this->m_pEntity->GetFunction()->GetPath("Temp", tempPath);
+			CSimpleStringA cachePath(tempPath);
+
+            cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser_").Append((+ERR_PAGE_REASON::Ad)._to_string());
+            strParams.Append(" --disk-cache-dir=").Append(cachePath);
+			strParams.Append(" --disk-cache-size=").Append("2147483648"); //2G
+
+			CSimpleStringA usrDataPath(tempPath);
+			usrDataPath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowserConfig_").Append((+ERR_PAGE_REASON::Ad)._to_string());
+			strParams.Append(" --user-data-dir=").Append(usrDataPath);
+
+            //strParams.Append(" --app=\"");
+			strParams.Append(" ");
+            strParams.Append(AdUrl.c_str());
+            //strParams.Append("\"");
+
+            strUOSBrowserPath.Append(strParams);
+            DbgEx("cmdline : %s", strUOSBrowserPath.GetData());
+
+            LogWarn(Severity_High, Error_Unexpect, LOG_EVT_CHROMIUM_OPEN_AD_WITH_UOS, strUOSBrowserPath);
+            return strUOSBrowserPath.GetData();
+        }
+
+
 		CSimpleStringA strChromiumPath = GetCefHead(this->m_pEntity), strCmdLine = "";
 
 		strCmdLine.Append(strChromiumPath).Append(CEFCLIENT_NAME).Append(" --url=").Append(AdUrl.c_str());
@@ -427,6 +469,35 @@ namespace Chromium {
 
 	std::string CModTools::generateCefclientCmd(bool isExtend, std::string mainUrl)
 	{
+		if (m_bUseUOSBrowser && !isExtend) {
+
+			CSimpleStringA strUOSBrowserPath("uos-browser ");
+            CSimpleStringA strParams("--new-window --kiosk");
+
+            CSimpleStringA tempPath;
+            this->m_pEntity->GetFunction()->GetPath("Temp", tempPath);
+            CSimpleStringA cachePath(tempPath);
+
+            cachePath.Append(CSimpleStringA(SPLIT_SLASH_STR)).Append("UOSBrowser_").Append((+ERR_PAGE_REASON::Ad)._to_string());
+            strParams.Append(" --disk-cache-dir=").Append(cachePath);
+            strParams.Append(" --disk-cache-size=").Append("2147483648"); //2G
+
+            CSimpleStringA usrDataPath(tempPath);
+            usrDataPath.Append(SPLIT_SLASH_STR).Append("UOSBrowserConfig_")
+                .Append(isExtend ? (+ERR_PAGE_REASON::extend)._to_string() : (+ERR_PAGE_REASON::main)._to_string());
+            strParams.Append(" --user-data-dir=").Append(usrDataPath);
+
+			strParams.Append(" ");
+			strParams.Append(mainUrl.c_str());
+
+			strUOSBrowserPath.Append(strParams);
+
+            LogWarn(Severity_High, Error_Unexpect, LOG_EVT_CHROMIUM_OPEN_MAIN_WITH_UOS, strUOSBrowserPath);
+			DbgEx("cmdline : %s", strUOSBrowserPath.GetData());
+
+			return strUOSBrowserPath.GetData();
+		}
+
 		CSimpleStringA strChromiumPath = GetCefHead(this->m_pEntity), strCmdLine = "";
 		strCmdLine.Append(strChromiumPath).Append(CEFCLIENT_NAME).Append(" --url=").Append(mainUrl.c_str());
 
@@ -516,14 +587,19 @@ namespace Chromium {
 			if (0 == mainUrlRet.second.length())
 			{
 				DbgEx("StartChromiumBrowser get %s url failed!", reason._to_string());
+				LogWarn(Severity_High, Error_Unexpect, LOG_EVT_CHROMIUM_DETECT_MAIN_URL_EMPTY,
+						CSimpleStringA::Format("StartChromiumBrowser get %s url failed!", reason._to_string()));
 				return std::make_pair(Error_Unexpect, 0);
 			}
 
 			auto strCmdLine = generateMainCmd(mainUrlRet.second);
 
-			auto openCefRet = openCef(strCmdLine, true);//with guard
-			if (Error_Succeed == openCefRet.first)
-				return std::make_pair(Error_Succeed, openCefRet.second);
+			auto openCefRet = openCef(strCmdLine, !m_bUseUOSBrowser);//with guard
+			if (Error_Succeed == openCefRet.first) {
+                LogWarn(Severity_Middle, Error_Debug, LOG_EVT_CHROMIUM_OPEN_MAIN_URL,
+                        CSimpleStringA::Format("StartChromiumBrowser %s", mainUrlRet.second.c_str()));
+                return std::make_pair(Error_Succeed, openCefRet.second);
+			}
 		}
 		else if (reason._to_integral() == ERR_PAGE_REASON::extend)
 		{
@@ -876,7 +952,20 @@ namespace Chromium {
 		return false;
 	}
 
-	void CModTools::openCefByFreerdpGuardian(std::string cmdline)
+    void CModTools::InitBrowserUseMode()
+    {
+		if (m_pEntity != nullptr) {
+			CSmartPointer<IConfigInfo> spConfig;
+			m_pEntity->GetFunction()->OpenConfig(Config_Cache, spConfig);
+			CSimpleStringA value(true);
+			spConfig->ReadConfigValue("BusinessBrowserType", "FultureEx", value);
+            m_bUseUOSBrowser = (value.IsNullOrEmpty() || (value.Compare("1") != 0));
+		} else {
+			m_bUseUOSBrowser = true;
+		}
+    }
+
+    void CModTools::openCefByFreerdpGuardian(std::string cmdline)
 	{
 #if (defined _WIN32 || defined _WIN64)
 		while (true)

+ 7 - 0
Module/mod_chromium/CModTools.h

@@ -48,7 +48,12 @@ namespace Chromium {
 		std::string getMagicStr() { return m_magicStr; };
 		bool IsConfigWork()
 		{
+			/**  [Gifur@202216]*/
+#if (defined _WIN32 || defined _WIN64)
 			return m_UserMgrUrlNoSidebarStr.GetLength() > 0 && m_UserMgrUrlFultureStr.GetLength() > 0;
+#else
+			return m_UserMgrUrlFultureStr.GetLength() > 0;
+#endif
 		}
 	private:
 		std::pair<CSimpleStringA, int>  ReadConfig();	//读本地配置,已废弃
@@ -74,6 +79,7 @@ namespace Chromium {
 		void setLimitReason(const char* reason);
 		int StandardToStamp(const char* str_time, bool dateOnly);
 		bool CheckTradeRecord();
+		void InitBrowserUseMode();
 
 		bool findRestartCode(DWORD userCode);//if true, restart the terminal
 		DWORD spiltErrMsg(std::string errMsg);//split the errmsg to usercode
@@ -83,6 +89,7 @@ namespace Chromium {
 		CSimpleString m_UserMgrUrlStr, m_UserMgrUrlNoSidebarStr, m_UserMgrUrlNoSidebarMutiStr, m_UserMgrUrlFultureStr, m_UserMgrAdStr;
 		bool m_withMin, m_withClose;
 		std::string m_magicStr;
+		bool m_bUseUOSBrowser;
 	};
 
 	template<class T>

+ 45 - 4
Module/mod_chromium/mod_chromium.cpp

@@ -7,7 +7,7 @@
 #define SPLIT_SLASH_STR "\\"
 #else
 #include <signal.h>
-#include "path.h"
+#include "fileutil.h"
 #endif
 #include "baseEx.h"
 #include "CWebsocketServer.h"
@@ -173,6 +173,8 @@ namespace Chromium {
 			CModTools::get_mutable_instance().InitCModTools(this);
 			CModTools::get_mutable_instance().killAllChromium();
 
+			DoBrowserCacheClearJob();
+
 #if (defined _WIN32 || defined _WIN64)
 #else
 			CSimpleStringA strDbgPath;
@@ -201,8 +203,6 @@ namespace Chromium {
 				}).detach();
 #endif
 
-
-
 			GetFunction()->GetSystemStaticInfo(m_sysInfo);
 			if (!IsConfigMode()) {
 				CSmartPointer<IConfigInfo> spConfig;
@@ -732,7 +732,48 @@ namespace Chromium {
 		m_firstStartMain.unlock();
 	};
 
-	void CChromiumEntity::OnTaskTimerListener(void* pData)
+    void CChromiumEntity::DoBrowserCacheClearJob()
+    {
+        LOG_FUNCTION();
+
+        CSmartPointer<IConfigInfo> spConfig;
+        ErrorCodeEnum err = GetFunction()->OpenConfig(Config_Cache, spConfig);
+        CSimpleStringA str(true);
+        err = spConfig->ReadConfigValue("Browser", "CacheClear", str);
+        if (str.Compare("true", true) == 0) {
+
+            BOOL bSucc(FALSE);
+            CSimpleStringA strCachePath;
+            GetFunction()->GetPath("Temp", strCachePath);
+            if (!strCachePath.IsNullOrEmpty()) {
+
+                bSucc = TRUE;
+
+                const char* cacheDirs[] = { "cefCache", "cefCache_Ad", "cefCache_breakdown","cefCache_ErrNotify", "cefCache_main"
+                    , "UOSBrowser_Ad", "UOSBrowser_main"
+					, "UOSBrowserConfig_Ad", "UOSBrowserConfig_main" };
+				const int cacheDirsLength = 9;
+
+                for (int i = 0; i < cacheDirsLength; ++i) {
+                    CSimpleStringA strcefCachePath(strCachePath);
+                    strcefCachePath += SPLIT_SLASH_STR;
+                    strcefCachePath += cacheDirs[i];
+
+                    if (ExistsDirA(strcefCachePath)) {
+                        RemoveDirRecursiveA(strcefCachePath);
+                        LogWarn(Severity_Middle, Error_Debug, LOG_EVT_CHROMIUM_BROWSER_CACHE_CLEAER,
+                                CSimpleStringA::Format("clear chromium browser cache: %s", strcefCachePath.GetData()));
+                    }
+                }
+            }
+
+            if (bSucc) {
+                spConfig->WriteConfigValue("Browser", "CacheClear", NULL);
+            }
+        }
+    }
+
+    void CChromiumEntity::OnTaskTimerListener(void* pData)
 	{
 		static int max_restartTime = 3;
 		DbgEx("OnTaskTimerListener");

+ 2 - 0
Module/mod_chromium/mod_chromium.h

@@ -150,6 +150,8 @@ namespace Chromium {
 
 		void checkUrlStartTime();
 
+		void DoBrowserCacheClearJob();
+
 		void OnPreStart_Init(CAutoArray<CSimpleStringA>& strArgs, CSmartPointer<ITransactionContext>& pTransactionContext);
 		bool OnPreStart_socketStart(CAutoArray<CSimpleStringA>& strArgs, CSmartPointer<ITransactionContext>& pTransactionContext);
 		bool OnPreStart_register(CAutoArray<CSimpleStringA>& strArgs, CSmartPointer<ITransactionContext>& pTransactionContext);

+ 16 - 39
Module/mod_healthmanager/mod_healthmanager.cpp

@@ -1083,48 +1083,21 @@ void CHealthManagerEntity::OnCheckTimeTimeout()
 	}
 	GetFunction()->ResetTimer(HEALTHMANAGER_TIMER_ID, HEALTHMANAGER_TIMER_INTERVAL);
 }
+
 #if defined(RVC_OS_LINUX)
 bool FindGuardianPid(pid_t &pid)
 {
-	FILE* pstr;
-	char cmd[128], buff[512];
-	pid_t pID;
-	int pidnum;
-	char* name = "bin/guardian";
-	char* p = NULL;
-	int ret = 3;
-	memset(cmd, 0, sizeof(cmd));
-	sprintf(cmd, "ps -ef|grep %s|grep -v grep", name);
-	pstr = popen(cmd, "r");
-	if (pstr == NULL)
-	{
-		Dbg("(linux)can't find guardian (pstr)");
-		return false;
-	}
-	memset(buff, 0, sizeof(buff));
-	fgets(buff, 512, pstr);
-	Dbg("%s\n", buff);
-	p = strtok(buff, " ");
-	p = strtok(NULL, " ");
-	pclose(pstr); //这句是否去掉,取决于当前系统中ps后,进程ID号是否是第一个字段
-	if (p == NULL)
-	{
-		Dbg("(linux)can't find guardian (p)");
-		return false;
-	}
-	if (strlen(p) == 0)
-	{
-		Dbg("(linux)can't find guardian (strlen(p))");
-		return false;
-	}
-	if ((pidnum = atoi(p)) == 0)
-	{
-		Dbg("(linux)can't find guardian (pid)");
-		return false;
-	}
-	Dbg("find guardian,pidnum: %d", pidnum);
-	pid = (pid_t)pidnum;
-	return pid;
+    char* relate_processes[] = { "guardian" };
+    int count = 1;
+    alive_process_info processes[1];
+    memset(processes, 0, sizeof(processes));
+
+    osutil_detect_unique_app(relate_processes, array_size(relate_processes), &count, processes);
+    if (count > 0) {
+		pid = processes[0].pid;
+		return true;
+    }
+	return false;
 }
 #endif //RVC_OS_LINUX
 int CHealthManagerEntity::CheckGuardianIsRun(bool bStart)
@@ -1163,6 +1136,7 @@ int CHealthManagerEntity::CheckGuardianIsRun(bool bStart)
 	Dbg("to check guardian is online.");
 	pid_t pID;
 	bool bFind = false;
+
 	bFind = FindGuardianPid(pID);
 	if (bFind)
 	{
@@ -1280,6 +1254,7 @@ bool CHealthManagerEntity::StartGuardian()
 	// Start the child process.
 	CSimpleStringA csBinPath;
 	ErrorCodeEnum Error = GetFunction()->GetPath("Bin", csBinPath);
+
 #ifdef RVC_OS_WIN
 
 	STARTUPINFO si;
@@ -1303,7 +1278,9 @@ bool CHealthManagerEntity::StartGuardian()
 	}
 	DWORD dwErr = GetLastError();
 	return true;
+
 #else
+
 	char app[MAX_PATH];
 	memset(app,0, sizeof(app));
 	tk_process_t* process = NULL;

+ 35 - 16
Module/mod_interactivecontrol/mod_interactivecontrol.cpp

@@ -212,6 +212,7 @@ public:
 	CITCtrlEntity() : m_pChannelClient(NULL), m_pPlayClient(NULL), m_bConnected(FALSE), m_bSalesRecording(FALSE),
 		m_bSurveilRecordAllowed(false), m_bSurveilRecording(FALSE), m_bSurveilRecordEchoing(FALSE),m_bSalesRecordPriorityEws(true),m_bSalesRecordUseEws(false)
 	{
+		m_bAdvOnFlag = false;
 	}
 	virtual ~CITCtrlEntity() {}
 	virtual const char *GetEntityName() const { return "InteractiveControl"; }
@@ -431,6 +432,36 @@ public:
 		
 		m_eDeviceType = RvcGetDeviceType();
 
+		CSmartPointer<IConfigInfo> spConfig;
+		SpIniMappingTable table;
+		ErrorCodeEnum Error1 = pFunc->OpenConfig(Config_CenterSetting, spConfig);
+		BOOL bSecondBranchAllowed = FALSE;
+		CSimpleStringA strSecondBranch("");
+		if (Error1 == Error_Succeed){
+			table.AddEntryBoolean("InteractiveControl", "SurveillanceRecordAllowed", m_bSurveilRecordAllowed, false);
+			table.AddEntryBoolean("InteractiveControl", "SalesRecordPriorityEws", m_bSalesRecordPriorityEws, true);
+			table.AddEntryInt("SurveillanceRecorder", "SecondBranchAllowed", bSecondBranchAllowed, FALSE);
+			table.AddEntryString("SurveillanceRecorder", "SecondBranchParams", strSecondBranch, "");
+			table.AddEntryBoolean("InteractiveControl", "AdvOnFlag", m_bAdvOnFlag, false);
+
+			table.Load(spConfig);
+		}
+
+		/** 以集中配置优先,在不打开广告的情况下,支持本地开广告 [Gifur@2022110]*/
+		if (!m_bAdvOnFlag) {
+			CSmartPointer<IConfigInfo> spCacheConfig;
+            pFunc->OpenConfig(Config_Cache, spCacheConfig);
+            int adOnSwitch(0);
+            spCacheConfig->ReadConfigValueInt("InteractiveControl", "AdvOnFlag", adOnSwitch);
+			if (adOnSwitch > 0) {
+				LogWarn(Severity_Middle, Error_Debug, LOG_EVT_OPEN_ADV_FROM_LOCAL_CONFIG, 
+				CSimpleStringA::Format("support open adv from local config: %d", adOnSwitch));
+				m_bAdvOnFlag = true;
+			}
+		}
+
+		Dbg("SalesRecordPriorityEws:[%d]",m_bSalesRecordPriorityEws);
+		Dbg("AdvOnFlag:[%s]", m_bAdvOnFlag ? "true" : "false");
 		if (eMobilePadType == m_eDeviceType|| IsSurpportContinuRecordType())
 		{
 			// 注册摄像头状态系统变量 add by ly 20160708
@@ -449,21 +480,6 @@ public:
 
 			if (eMobilePadType!=m_eDeviceType)
 			{
-				CSmartPointer<IConfigInfo> spConfig;
-				SpIniMappingTable table;
-				ErrorCodeEnum Error = pFunc->OpenConfig(Config_CenterSetting, spConfig);
-				BOOL bSecondBranchAllowed = FALSE;
-				CSimpleStringA strSecondBranch("");
-				if (Error == Error_Succeed)
-				{
-					table.AddEntryBoolean("InteractiveControl", "SurveillanceRecordAllowed", m_bSurveilRecordAllowed, false);
-					table.AddEntryBoolean("InteractiveControl", "SalesRecordPriorityEws", m_bSalesRecordPriorityEws, true);
-					table.AddEntryInt("SurveillanceRecorder", "SecondBranchAllowed", bSecondBranchAllowed, FALSE);
-					table.AddEntryString("SurveillanceRecorder", "SecondBranchParams", strSecondBranch, "");
-					table.Load(spConfig);
-				}
-
-				Dbg("SalesRecordPriorityEws:[%d]",m_bSalesRecordPriorityEws);
 
 				if (m_bSurveilRecordAllowed)
 				{
@@ -670,7 +686,9 @@ public:
 			if (pszValue)
 			{
 #ifdef RVC_OS_LINUX
-				AdverPlayManage(pszValue, pszOldValue);
+				if (m_bAdvOnFlag) {
+					AdverPlayManage(pszValue, pszOldValue);
+				}
 #endif
 				BcastCustomerState(pszValue, pszOldValue, pszEntityName);
 				Dbg("CustomerState change to %c",pszValue[0]);
@@ -1889,6 +1907,7 @@ public:
 	BOOL m_bSurveilRecordEchoing; // add by ly at 20161209
 	bool m_bSalesRecordPriorityEws;	  
 	bool m_bSalesRecordUseEws;
+	bool m_bAdvOnFlag;
 };
 
 void UIServiceSession::Handle_SetUIState(SpOnewayCallContext<UIService_SetUIState_Info>::Pointer ctx)

+ 1 - 0
Module/mod_sipphone/Event.h

@@ -86,6 +86,7 @@
 #define EVENT_MOD_SIP_REMOTE_VIDEO_RENDER_CREATE					0x30190032
 #define EVENT_MOD_SIP_LOCAL_VIDEO_RENDER_DESTROY					0x30190033
 #define EVENT_MOD_SIP_REMOTE_VIDEO_RENDER_DESTROY					0x30190034
+#define EVENT_MOD_SIP_OVERWRITE_FRESHVALUE	                 				0x30190036
 
 //audio engine error
 #define ERROR_MOD_SIP_APR_POOL_CREATE_FAILED						0x30190601  //内存分配失败,级别2

+ 26 - 25
Module/mod_sipphone/endpoint.cpp

@@ -295,6 +295,9 @@ static void endpoint_media_update_video(endpoint_call_t *call, media_desc_t *vid
 		int local_hwd_move = video_desc->param[i++];
 		int remote_hwd_move = video_desc->param[i++];
 
+		int local_fresh_time = video_desc->param[i++];
+		int remote_fresh_time = video_desc->param[i++];
+
 		video_session_conf_t video_conf = {0};
 		if (eMobilePadType == call->eDeviceType)
 		{
@@ -339,6 +342,7 @@ static void endpoint_media_update_video(endpoint_call_t *call, media_desc_t *vid
 		video_conf.video_echo_cb = cb;
 		video_conf.ilocal_wind_flags = VIDEOPLAYER_FLAG_PULL|VIDEOPLAYER_FLAG_CHECKTOP;
 		video_conf.iremote_wind_flags = VIDEOPLAYER_FLAG_PUSH|VIDEOPLAYER_FLAG_CHECKTOP;
+		video_conf.ilvideo_ft = local_fresh_time;
 		
 		if (video_conf.nCallType == MOBILETOPAD_CALLTYPE )  //如果与手机连接使用标准H264
 		{
@@ -1464,21 +1468,16 @@ int endpoint_call_hangup(endpoint_call_t *call)
 }
 
 
-int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, int remote_video_rtp, 
-	unsigned long local_ip, int local_video_rtp, 
-	int remote_width, int remote_height,
-	int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, 
-	int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy,
-	int local_move, int remote_move, video_session_callback_t* cb)
+int endpoint_call_start_video(endpoint_call_t* call, endpoint_call_param_t* pcallparam, video_session_callback_t* cb)
 {
 	char local_ip_str[128]={0};
 	char remtote_ip_str[128]={0};
 	LOG_FUNCTION();
 
-	translate_ipaddr_from_int(local_ip_str, 128, local_ip);
-	translate_ipaddr_from_int(remtote_ip_str, 128, remote_ip);
+	translate_ipaddr_from_int(local_ip_str, 128, pcallparam->local_ip);
+	translate_ipaddr_from_int(remtote_ip_str, 128, pcallparam->remote_ip);
 	
-	Dbg("Assist channel video local: %s:%d, remote_ip:%s:%d", local_ip_str, local_video_rtp, remtote_ip_str, remote_video_rtp);
+	Dbg("Assist channel video local: %s:%d, remote_ip:%s:%d", local_ip_str, pcallparam->local_port, remtote_ip_str, pcallparam->remote_port);
 	if (call) 
 	{
 		int i = 0;
@@ -1486,10 +1485,10 @@ int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, in
 		video_desc.media_dir = DIR_BOTH;
 		if (call->nCallType == NORMAL_CALLTYPE || call->nCallType == DOUBLERECORD_CALLTYPE)//如果是可视柜台模式,使用协助通道的协商结果
 		{
-			video_desc.local_ip = local_ip;
-			video_desc.local_port = local_video_rtp;
-			video_desc.remote_port = remote_video_rtp;
-			video_desc.remote_ip = remote_ip;
+			video_desc.local_ip = pcallparam->local_ip;
+			video_desc.local_port = pcallparam->local_port;
+			video_desc.remote_port = pcallparam->remote_port;
+			video_desc.remote_ip = pcallparam->remote_ip;
 		}
 		else //如果是非可视柜台模式,使用SDP协商的参数
 		{
@@ -1500,19 +1499,21 @@ int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, in
 			video_desc.remote_port = call->sdpvieo_desc.remote_rtp_port;
 			video_desc.remote_pt = call->sdpvieo_desc.remote_pt;
 		}
-		video_desc.param[i++] = local_view_x;
-		video_desc.param[i++] = local_view_y;
-		video_desc.param[i++] = local_view_cx;
-		video_desc.param[i++] = local_view_cy;
-		video_desc.param[i++] = remote_view_x;
-		video_desc.param[i++] = remote_view_y;
-		video_desc.param[i++] = remote_view_cx;
-		video_desc.param[i++] = remote_view_cy;
-		video_desc.param[i++] = remote_width;
-		video_desc.param[i++] = remote_height;
+		video_desc.param[i++] = pcallparam->local_view_x;
+		video_desc.param[i++] = pcallparam->local_view_y;
+		video_desc.param[i++] = pcallparam->local_view_cx;
+		video_desc.param[i++] = pcallparam->local_view_cy;
+		video_desc.param[i++] = pcallparam->remote_view_x;
+		video_desc.param[i++] = pcallparam->remote_view_y;
+		video_desc.param[i++] = pcallparam->remote_view_cx;
+		video_desc.param[i++] = pcallparam->remote_view_cy;
+		video_desc.param[i++] = pcallparam->remote_width;
+		video_desc.param[i++] = pcallparam->remote_height;
 		//add by clp 20190823
-		video_desc.param[i++] = local_move;
-		video_desc.param[i++] = remote_move;
+		video_desc.param[i++] = pcallparam->local_hwd_move;
+		video_desc.param[i++] = pcallparam->remote_hwd_move;
+		video_desc.param[i++] = pcallparam->local_fresh_time;
+		video_desc.param[i++] = pcallparam->remote_fresh_time;
 		endpoint_media_update_video(call, &video_desc, cb);
 
 		char str_local_ip[128]={0};

+ 23 - 6
Module/mod_sipphone/endpoint.h

@@ -62,6 +62,28 @@ typedef struct endpoint_conf_t {
 	volatile int *ref_Is_showRecordArea;
 }endpoint_conf_t;
 
+
+typedef struct endpoint_call_param_s {
+	unsigned long local_ip;
+	int local_port;
+	unsigned long remote_ip;
+	int remote_port;
+	int local_view_x;
+	int local_view_y;
+	int local_view_cx;
+	int local_view_cy;
+	int remote_view_x;
+	int remote_view_y;
+	int remote_view_cx;
+	int remote_view_cy;
+	int remote_width;
+	int remote_height;
+	int local_hwd_move;
+	int remote_hwd_move;
+	int local_fresh_time;
+	int remote_fresh_time;
+}endpoint_call_param_t;
+
 typedef struct endpoint_call_callback_t {
 	void (*on_call_state)(int state, const char *state_desc, const char *phase, void *user_data);
 	void *user_data;
@@ -111,12 +133,7 @@ int endpoint_call_hangup(endpoint_call_t *call);
 /*
 	add by chenlp 20190826  新增int local_move和int remote_move参数,分别用于设置本地和远端视频窗口是否支持移动
 */
-int endpoint_call_start_video(endpoint_call_t *call, unsigned long remote_ip, int remote_video_rtp, 
-	unsigned long local_ip, int local_video_rtp, 
-	int remote_width, int remote_height,
-	int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, 
-	int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy,
-	int local_move, int remote_move,video_session_callback_t* cb);
+int endpoint_call_start_video(endpoint_call_t *call, endpoint_call_param_t* pcallparam, video_session_callback_t* cb);
 
 
 int endpoint_call_stop_video(endpoint_call_t *call);

+ 43 - 8
Module/mod_sipphone/mod_sipphone.cpp

@@ -122,6 +122,7 @@ CSIPEntity::CSIPEntity() : m_pCurrentSession(NULL), m_state(INIT),m_iPickupPhone
 #endif
 	m_SipErrorCode = Error_Succeed;
 	memset((void*)&m_stVideoParam,0,sizeof(stVideoParam));
+	m_ilocalvideo_freshtime = 200;
 }
 
 
@@ -1744,6 +1745,20 @@ void CSIPEntity::Handle_AdjustVideoEchoEvent(const char* pszMessage)
 }
 
 
+void CSIPEntity::InitFreshTimeConfig()
+{
+    CSmartPointer<IConfigInfo> spCacheConfig;
+    GetFunction()->OpenConfig(Config_Cache, spCacheConfig);
+
+	int value(0);
+	spCacheConfig->ReadConfigValueInt("SIPPhone", "lfreshtime", value);
+	if (value > 0) {
+		LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_OVERWRITE_FRESHVALUE,
+				CSimpleStringA::Format("overwrite lfreshtime from global cache: %d", value));
+        m_ilocalvideo_freshtime = value;
+	}
+}
+
 ErrorCodeEnum CSIPEntity::LoadConfig(endpoint_conf_t *conf)
 {
 	CSmartPointer<IEntityFunction> spFunction = GetFunction();
@@ -1860,12 +1875,18 @@ ErrorCodeEnum CSIPEntity::LoadConfig(endpoint_conf_t *conf)
 			}
 			//DecideCameraCount(conf->camera_count);
 			DecideScreenCount(conf->screen_count);
+
+			if (m_ilocalvideo_freshtime > 500 || m_ilocalvideo_freshtime < 50) {
+				m_ilocalvideo_freshtime = 200;
+			}
 		}
 	}
+
+	InitFreshTimeConfig();
+
 	return Error;
 }
 
-
 //载入运行时配置
 ErrorCodeEnum CSIPEntity::LoadAudioRunConfig(int&nHandfreeout,int&nPickupout,int&nHandfreein,int&nPickupin)
 {
@@ -2175,6 +2196,7 @@ void CSIPPhoneSession::Handle_StartVideo( SpOnewayCallContext<PhoneService_Start
 	pCmd->remote_height = ctx->Info.remote_height;
 	pCmd->local_hwd_move = ctx->Info.local_hwd_move;
 	pCmd->remote_hwd_move = ctx->Info.remote_hwd_move;
+	pCmd->local_fresh_time = m_pEntity->m_ilocalvideo_freshtime;
 	//初始化窗口参数
 	//m_pEntity->m_stVideoParam.nWindowState = 0;
 	//m_pEntity->GetFunction()->SetTimer(1, m_pEntity, 1000);
@@ -2362,13 +2384,26 @@ void CSIPPhoneSession::control_video( ControlVideoCommand *pCmd )
 	{
 		if (pCmd->start) 
 		{
-			endpoint_call_start_video(m_pCall, 
-				pCmd->remote_ip, pCmd->remote_port,
-				pCmd->local_ip, pCmd->local_port,
-				pCmd->remote_width, pCmd->remote_height,
-				pCmd->local_view_x, pCmd->local_view_y, pCmd->local_view_cx, pCmd->local_view_cy,
-				pCmd->remote_view_x, pCmd->remote_view_y, pCmd->remote_view_cx, pCmd->remote_view_cy,
-				pCmd->local_hwd_move, pCmd->remote_hwd_move, &m_cb_video_box_move); 
+			endpoint_call_param_t callparam = { 0 };
+			callparam.remote_ip = pCmd->remote_ip;
+			callparam.remote_port = pCmd->remote_port;
+			callparam.local_ip = pCmd->local_ip;
+			callparam.local_port = pCmd->local_port;
+			callparam.remote_width = pCmd->remote_width;
+			callparam.remote_height = pCmd->remote_height;
+			callparam.local_view_x = pCmd->local_view_x;
+			callparam.local_view_y = pCmd->local_view_y;
+			callparam.local_view_cx = pCmd->local_view_cx;
+			callparam.local_view_cy = pCmd->local_view_cy;
+			callparam.remote_view_x = pCmd->remote_view_x;
+			callparam.remote_view_y = pCmd->remote_view_y;
+			callparam.remote_view_cx = pCmd->remote_view_cx;
+			callparam.remote_view_cy = pCmd->remote_view_cy;
+			callparam.local_hwd_move = pCmd->local_hwd_move;
+			callparam.remote_hwd_move = pCmd->remote_hwd_move;
+			callparam.local_fresh_time = pCmd->local_fresh_time;
+			callparam.remote_fresh_time = pCmd->remote_fresh_time;
+			endpoint_call_start_video(m_pCall, &callparam, &m_cb_video_box_move);
 		} 
 		else 
 		{

+ 4 - 0
Module/mod_sipphone/mod_sipphone.h

@@ -109,6 +109,8 @@ struct ControlVideoCommand
 	int remote_height;
 	int local_hwd_move;
 	int remote_hwd_move;
+	int local_fresh_time;
+	int remote_fresh_time;
 };
 
 struct HangupCallCommand
@@ -233,6 +235,7 @@ public:
 private:
 
 	ErrorCodeEnum LoadConfig(endpoint_conf_t *conf);
+	void InitFreshTimeConfig();
 	//载入运行时配置
 	ErrorCodeEnum LoadAudioRunConfig(int&nHandfreeout,int&nPickupout,int&nHandfreein,int&nPickupin);
 	//保存运行时
@@ -267,6 +270,7 @@ public:
 	volatile int m_bIsSalesRecord;			//add by ly@20180725
 	volatile int m_bEwsRecord;				//add by ly@2019/04/18
 	record_echo_location_t m_RecordVideoLocation;
+	int m_ilocalvideo_freshtime;
 
 private:
 	CServerSessionBase *m_pCurrentSession;

+ 3 - 2
Module/mod_sipphone/video_session.cpp

@@ -2219,7 +2219,8 @@ void* videorender_func(void* arg)
 	char str_remote_ip[MAX_PATH_SIZE] = { 0 };
 	translate_ipaddr_from_int(str_local_ip, MAX_PATH_SIZE, session->conf.local_rtp_ip);
 	translate_ipaddr_from_int(str_remote_ip, MAX_PATH_SIZE, session->conf.remote_rtp_ip);
-	Dbg("videorender_func local_pt: %d local_ip: %s local_rtp_port: %d.", session->conf.local_pt, str_local_ip, session->conf.local_rtp_port);
+	int ilocal_video_fresh_time = session->conf.ilvideo_ft;
+	Dbg("videorender_func local_pt: %d local_ip: %s local_rtp_port: %d, local video fresh time is %dms.", session->conf.local_pt, str_local_ip, session->conf.local_rtp_port, ilocal_video_fresh_time);
 	Dbg("videorender_func remote_pt: %d remote_ip: %s remote_rtp_port: %d.", session->conf.remote_pt, str_remote_ip, session->conf.remote_rtp_port);
 	Dbg("videorender_func rx_width: %d rx_height: %d.", session->conf.remote_video_width, session->conf.remote_video_height);
 	Dbg("%s:%d local(%d,%d,%d,%d) remote(%d,%d,%d,%d).", __FUNCTION__, __LINE__, session->conf.local_video_view_x, session->conf.local_video_view_y, session->conf.local_video_view_cx, session->conf.local_video_view_cy,
@@ -2274,7 +2275,7 @@ void* videorender_func(void* arg)
 		for (; ; ) {
 			struct timespec ts;
 			clock_gettime(CLOCK_REALTIME, &ts);
-			long unsec = ts.tv_nsec + (1000 * 1000 * 500);
+			long unsec = ts.tv_nsec + (1000 * 1000 * ilocal_video_fresh_time);
 			ts.tv_sec += (unsec / 1000000000);
 			ts.tv_nsec = (unsec % 1000000000);
 			if (0 != sem_timedwait(&session->ui_stop_sem, &ts) && (ETIMEDOUT == errno))

+ 1 - 0
Module/mod_sipphone/video_session.h

@@ -40,6 +40,7 @@ typedef struct video_session_conf_t
 	int mtu;
 	int video_quant; // 0-10
 	int bit_rate; // 256*1024
+	int ilvideo_ft;
 	DeviceTypeEnum eDeviceType;
 	CallingTypeEnum nCallType; 
 	int local_pt;	

+ 42 - 16
Tool/guardian/guardian.cpp

@@ -157,18 +157,30 @@ unsigned long long GetTickCountRVC() {
 void GetLocalTimeRVC(SYSTEMTIME& stTime)
 {
 #ifdef linux
-	struct tm* pst = NULL;
-	time_t t = time(NULL);
-	pst = localtime(&t);
-	stTime.wYear = pst->tm_year + 1900;
-	stTime.wMonth = pst->tm_mon + 1;//because the range of tm_mon is:0-11
-	stTime.wDay = pst->tm_mday;
-	stTime.wHour = pst->tm_hour;
-	stTime.wMinute = pst->tm_min;
-	stTime.wDayOfWeek = pst->tm_wday;
-	stTime.wSecond = pst->tm_sec;
-	stTime.wMilliseconds = 0;
-	//("oiltest,time:%d,%d,%d,%d", stTime.wYear, stTime.wHour, stTime.wMinute, stTime.wDayOfWeek);
+    time_t ct = 0;
+    struct tm* ltm = NULL;
+    WORD wMilliseconds = 0;
+	DWORD ticks = 0;
+    struct timespec ts;
+
+    ct = time(NULL);
+    ltm = localtime(&ct);
+	if (!clock_gettime(CLOCK_MONOTONIC_RAW, &ts)) {
+		ticks = (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
+		wMilliseconds = (WORD)(ticks % 1000);
+	}
+	memset(&stTime, 0, sizeof(SYSTEMTIME));
+
+    if (ltm) {
+		stTime.wYear = (WORD)(ltm->tm_year + 1900);
+        stTime.wMonth = (WORD)(ltm->tm_mon + 1);
+        stTime.wDayOfWeek = (WORD)ltm->tm_wday;
+        stTime.wDay = (WORD)ltm->tm_mday;
+        stTime.wHour = (WORD)ltm->tm_hour;
+        stTime.wMinute = (WORD)ltm->tm_min;
+        stTime.wSecond = (WORD)ltm->tm_sec;
+        stTime.wMilliseconds = wMilliseconds;
+    }
 #else
 	GetLocalTime(stTime);
 #endif
@@ -445,6 +457,7 @@ static bool IsSpPathType(const std::string& value)
     return true;
 }
 
+/** 移除跟版本目录相关的环境变量信息*/
 static std::string CutSpPathFromPathValue(const char* value)
 {
 	std::string path(value);
@@ -532,10 +545,19 @@ int FrameworkShutdown(bool bUpgrade=false,bool bRestart = true)
 		pos[strlen("/version")+1] = '\0';
 
 		ResetRelateEnviromentVars(tmp);
-
+		
 		char path[MAX_PATH] = { '\0' };
+		bool toResetCWD(false);
+
+		LogSingleMsg("to get current directory...");
 		GetCurrentDirectoryA(MAX_PATH, path);
-		SetCurrentDirectoryA(tmp);
+		LogSingleMsg(path);
+
+		if (strlen(path) <= 0 || strcmp(path, tmp) != 0) {
+			LogSingleMsg("to set current directory...");
+			SetCurrentDirectoryA(tmp);
+			toResetCWD = true;
+		}
 
 		strcat(tmp, "spexplorer.sh  --restart");
 		LogSingleMsg(tmp);
@@ -553,13 +575,17 @@ int FrameworkShutdown(bool bUpgrade=false,bool bRestart = true)
 			g_SpShellPID = GetSpshellProcID();
 			LogToFile(false, true, false, "get spshell proc id", NULL, g_SpShellPID);
 
-			SetCurrentDirectoryA(path);
+			if (toResetCWD) {
+				SetCurrentDirectoryA(path);
+			}
             return 0;
 		} else {
 			FREE(process);
 			LogSingleMsg("run spexplorer.sh scripts failed!");
 
-			SetCurrentDirectoryA(path);
+            if (toResetCWD) {
+                SetCurrentDirectoryA(path);
+            }
 			return -1;
 		}
 	}

+ 5 - 1
addin/cfg/ResourceWatcher.ini

@@ -35,4 +35,8 @@ dns1=99.12.23.78
 dns2=99.1.8.1
 
 [DDE]
-DisableOSD=1
+DisableOSD=1
+
+[TOPProcess]
+cpu=10
+mem=10

+ 1 - 0
addin/packaging/DEBIAN/prerm

@@ -6,6 +6,7 @@ if [ "$1" = "remove" ]; then
     killall -9 sphost > /dev/null 2>&1
     killall -9 guardian > /dev/null 2>&1
     killall -9 cefclient > /dev/null 2>&1
+    killall -9 uos-browser > /dev/null 2>&1
 fi
 
 exit 0

File diff ditekan karena terlalu besar
+ 0 - 0
addin/res/ManagerDesktop/Include/jQuery/js/emui-jquery.min.js


+ 8 - 8
addin/res/ManagerDesktop/css/emui-style.css

@@ -1438,8 +1438,8 @@ margin-right: 10px;
 overflow: hidden;
 cursor: pointer;
 background-repeat: no-repeat;
-background-image: url('../images/emui-icon.png?r=0.1517399082388049&_=2311627385677326');
-background-position: left -2150px;
+background-image: url('../images/radio_empty.png');
+background-position: left 0px;
 }
 .radio_btn_off_disabled {
 width: 20px;
@@ -1448,8 +1448,8 @@ margin-right: 10px;
 overflow: hidden;
 cursor: pointer;
 background-repeat: no-repeat;
-background-image: url('../images/emui-icon.png?r=0.1517399082388049&_=2311627385677326');
-background-position: left -2170px;
+background-image: url('../images/radio_empty_disabled.png');
+background-position: left 0px;
 }
 .radio_btn_on {
 width: 20px;
@@ -1458,8 +1458,8 @@ margin-right: 10px;
 overflow: hidden;
 cursor: pointer;
 background-repeat: no-repeat;
-background-image: url('../images/emui-icon.png?r=0.1517399082388049&_=2311627385677326');
-background-position: left -2190px;
+background-image: url('../images/radio_selected.png');
+background-position: left 0px;
 }
 .radio_btn_on_disabled {
 width: 20px;
@@ -1468,8 +1468,8 @@ margin-right: 10px;
 overflow: hidden;
 cursor: pointer;
 background-repeat: no-repeat;
-background-image: url('../images/emui-icon.png?r=0.1517399082388049&_=2311627385677326');
-background-position: left -2210px;
+background-image: url('../images/radio_selected_disabled.png');
+background-position: left 0px;
 }
 .login_btn_normal_long {
 width: 300px;

TEMPAT SAMPAH
addin/res/ManagerDesktop/images/radio_empty.png


TEMPAT SAMPAH
addin/res/ManagerDesktop/images/radio_empty_disabled.png


TEMPAT SAMPAH
addin/res/ManagerDesktop/images/radio_selected.png


TEMPAT SAMPAH
addin/res/ManagerDesktop/images/radio_selected_disabled.png


+ 1 - 0
addin/res/ManagerDesktop/js/menu.js

@@ -33,6 +33,7 @@ var gMenuDisplayName = {
     'camera':'摄像头',
     'volumn':'音量调节',
     'banquet':'坐席',
+    'adv':'广告管理',
     'basicinfo':'基本信息',
     'version':'版本',
     'vermanagement':'版本管理',

+ 1 - 0
addin/res/ManagerDesktop/js/page.js

@@ -43,6 +43,7 @@ $(document).ready(function () {
                 <camera>camera</camera> \
                 <volumn>volumn</volumn> \
                 <banquet>banquet</banquet> \
+                <adv>adv</adv> \
             </mediacontrol> \
             <advanceset> \
                 <basicinfo>basicinfo</basicinfo> \

+ 109 - 0
addin/res/ManagerDesktop/js/page/adv.js

@@ -0,0 +1,109 @@
+function advGenPage() {
+    var page = '<div id="adv_page" style="display: block;">\
+    <div class="maintitle">\
+        <div>广告播放</div>\
+        <div class="page_description_text">上屏广告播放管理</div>\
+    </div>\
+    <div id="advContent" class="hide" style="display: block;">\
+        <div id="adv_play_switch" class="clearboth" style="margin-top: 37px;">\
+            <div class="control-label" style="margin-top: 8px;"><span>是否播放广告</span></div>\
+            <div class="controls" style="margin-top:6px;">\
+                <div id="adv_play_or_not_switch" onclick="SwitchEx(this,RVC.MediaPlayerController.AdvSwitch)" class="switch_off"></div>\
+            </div>\
+        </div>\
+    </div>\
+    <div style="height:40px;">&nbsp;</div>\
+</div>';
+
+    $("#rightpagearea").prepend(page);
+    if (typeof advRenderPage == "function") {
+        beforeRenderPage("adv");
+        advRenderPage();
+        afterRenderPage("adv");
+    }
+}
+
+var advController = (function() {
+
+    function InitPlayAdvOrNot()
+    {
+        let req = new Request();
+        req.configType = 7; //GlobalCache
+        req.section = 'InteractiveControl';
+        req.option = false;
+        req.key = 'AdvOnFlag';
+        req.reserved1 = 0;
+        req.reserved2 = 0;
+        req.reserved3 = '';
+        req.reserved4 = '';
+
+        RVC.DeviceControlEntityCtrl.ReadConfigValue(req, function(ret) {
+
+            if (ret.errorCode === 0) {
+                let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
+                setSwitchState('adv_play_or_not_switch', (result.value === '1'));
+            } else {
+                setSwitchEnableState('adv_play_or_not_switch', false);
+            }
+        });
+    }
+
+    function RecordPlayAdvOrNot(toPlay)
+    {
+        let req = new Request();
+        req.configType = 7; //GlobalCache
+        req.section = 'InteractiveControl';
+        req.option = true; //Write
+        req.key = 'AdvOnFlag';
+        req.reserved1 = 0;
+        req.reserved2 = 0;
+        if(toPlay) {
+            req.reserved3 = '1';
+        } else {
+            req.reserved3 = '0';
+        }
+        req.reserved4 = '';
+        RVC.DeviceControlEntityCtrl.ReadConfigValue(req, function(ret) {
+            if (ret.errorCode === 0) {
+                utilShowToast('设置成功,重启应用后生效!');
+            } else {
+                utilStartAlertDialog("设置失败! ErrorCode: " + ErrorCodeStringfy(ret.errorCode));
+            }
+        });
+    }
+
+    RVC.MediaPlayerController = RVC.ObjController.extend({
+
+        AdvSwitch: function(widget) {
+            var thatWidget = widget;
+            var switchon = false;
+            var classlist = $(thatWidget).attr('class');
+            if (classlist.indexOf('switch_on') >= 0) {
+                switchon = true;
+            }
+            RecordPlayAdvOrNot(switchon);
+        }
+
+    });
+
+    function initPage() {
+        
+        InitPlayAdvOrNot();
+    }
+
+    var fistTime = true;
+
+    function init() {
+
+        if (fistTime) {
+            fistTime = false;
+        }
+        initPage();
+    }
+    
+    return { init: init };
+}());
+
+window.advRenderPage = function () {
+    advController.init();
+};

+ 148 - 18
addin/res/ManagerDesktop/js/page/browser.js

@@ -2,33 +2,59 @@ function browserGenPage() {
     var page = '<div id="browser_page" style="display: block;">\
     <div class="maintitle">\
         <div>业务浏览器设置</div>\
-        <div class="page_description_text">业务浏览器基于Chromium内核自主定制开发。\
+        <div class="page_description_text">业务浏览器基于Chromium内核开发。\
         </div>\
     </div>\
     <div id="browserContent">\
         <div id="browser_all_content">\
-            <div id="browser_prompt" class="page_prompt_info page_scenes_info_text hide" style="display: none;"></div>\
-            <div class="clearboth" id="browser_cache_btn_save_div" style="padding-top:50px">\
+            <div id="browser_prompt" class="page_prompt_info page_scenes_info_text hide"\
+                style="display: none;"></div>\
+            <div class="clearboth" id="browser_btn_save_div" style="padding-top:50px">\
                 <div class="control-label" style="margin-top: 8px;">&nbsp;</div>\
-                <div class="controls"><button class="btn_normal_long"\
-                        id="browser_btn_save">浏览器缓存清理</button></div>\
+                <div class="controls"><button class="btn_normal_long btn"\
+                    id="browser_btn_save">浏览器缓存清理</button></div>\
             </div>\
-            <div class="clearboth" id="browser_sogou_btn_save_div" style="padding-top:50px">\
-                <div class="control-label" style="margin-top: 8px;">&nbsp;</div>\
-                <div class="controls"><button class="btn_normal_long"\
-                        id="browser_sogou_btn_restart">重启搜狗输入法服务V2.0</button></div>\
+            <div class="clearboth" style="padding-top: 40px;">\
+            <div style="width: 170px; margin-right: 10px; margin-top: 8px;" class="control-label"\
+                lang-id="IDS_lan_ip_filter_mode">使用浏览器</div>\
+            <div class="controls" style="margin-top:7px;">\
+                <div class="pull-left">\
+                    <div onclick="radio(this)" name="browser_provider_radio" id="cefclient_browser"\
+                        class="radio_btn_off"></div>\
+                </div>\
+                <div class="pull-left" style="width:100px;">第三方</div>\
+                <div class="pull-left">\
+                    <div onclick="radio(this)" name="browser_provider_radio" id="uos_browser"\
+                        class="radio_btn_on"></div>\
+                </div>\
+                <div class="pull-left" style="padding-top:0px;">系统自带\
+                </div>\
+                </div>\
             </div>\
-            <div class="clearboth" id="browser_sogou_btn_fetch_div" style="padding-top:50px">\
+            <div class="clearboth" style="padding-top:20px"></div>\
+        </div>\
+        <div id="sogou_management_div" style="margin-top: 40px; padding-bottom: 20px; border-bottom: 1px solid rgb(243, 243, 243);">\
+            <div style="margin-top: 30px; font-size: 16px; "><span>Sogou输入法</span></div>\
+        </div>\
+        <div class="clearboth" id="browser_sogou_info_div" style="padding-top:20px">\
             <div class="control-label" style="margin-top: 8px;">&nbsp;</div>\
-            <div class="controls"><button class="btn_normal_long"\
-                    id="browser_sogou_btn_fetch">搜狗输入法信息快照</button></div>\
-            </div>\
-            <div class="clearboth" style="padding-top:70px"></div>\
+            <div class="controls"><span id="sogou_info_detail">无法获取输入法信息</span>\
             </div>\
+        </div>\
+        <div class="clearboth" id="browser_sogou_btn_save_div" style="padding-top:50px">\
+            <div class="control-label" style="margin-top: 8px;">&nbsp;</div>\
+            <div class="controls"><button class="btn_normal_long"\
+                    id="browser_sogou_btn_restart">重启搜狗输入法服务V3.0</button></div>\
+        </div>\
+        <div class="clearboth" id="browser_sogou_btn_fetch_div" style="padding-top:50px">\
+            <div class="control-label" style="margin-top: 8px;">&nbsp;</div>\
+            <div class="controls"><button class="btn_normal_long"\
+                 id="browser_sogou_btn_fetch">搜狗输入法信息快照</button></div>\
+        </div>\
     </div>\
     <div id="browser_activation_content" class="page_prompt_info page_scenes_info_text hide">\
     </div>\
-    </div></div>';
+</div>';
 
     $("#rightpagearea").prepend(page);
     if (typeof browserRenderPage == "function") {
@@ -40,9 +66,11 @@ function browserGenPage() {
 
 var browserController = (function() {
 
+    var gCurrentBrowserMode = '0';
+
     function updateBrowserCacheClearFlag() {
         let req = new Request();
-        req.configType = 3; //RunConfig
+        req.configType = 7; //GlobalCache
         req.section = 'Browser';
         req.option = true; //Write
         req.key = 'CacheClear';
@@ -54,7 +82,7 @@ var browserController = (function() {
         RVC.DeviceControlEntityCtrl.ReadConfigValue(req, function(ret) {
             utilStopSubmitDialog();
             if (ret.errorCode === 0) {
-                utilStartAlertDialog("清理指令已下发,请重启应用以行浏览器缓存清理。");
+                utilStartAlertDialog("清理指令已下发,请重启应用以行浏览器缓存清理。");
             } else {
                 RVC.DeviceControlEntityCtrl.commErrorCallback(ret);
             }
@@ -86,6 +114,7 @@ var browserController = (function() {
 
         let req = new Request();
         req.configType = 0;
+        req.timeout = 30000;
         req.section = 'SougouInput';
         req.option = false;
         req.key = 'SogouRestart';
@@ -133,7 +162,104 @@ var browserController = (function() {
 
     function saveButtonHandle() {
 
-        updateBrowserCacheClearFlag();
+        utilStartConfirmDialog("确认要清理浏览器缓存吗?", function() {
+            updateBrowserCacheClearFlag();
+        });
+    }
+
+    function saveBrowserTypeSelect(usingUOS, failCallback) {
+        let req = new Request();
+        req.configType = 7; //GlobalCache
+        req.section = 'BusinessBrowserType';
+        req.option = true;
+        req.key = 'FultureEx';
+        req.reserved1 = 0;
+        req.reserved2 = 0;
+        if(!usingUOS) {
+            req.reserved3 = '1';
+        } else {
+            req.reserved3 = '0';
+        }
+        req.reserved4 = '';
+        RVC.DeviceControlEntityCtrl.ReadConfigValue(req, function(ret) {
+            if (ret.errorCode === 0) {
+                utilShowToast('设置成功!请通过重启应用生效');
+            } else {
+                utilStartAlertDialog("设置失败! ErrorCode: " + ErrorCodeStringfy(ret.errorCode), function(){
+                    if(failCallback) {
+                        failCallback();
+                    }
+                });
+            }
+        });
+    }
+
+    function selectBrowserUseMode() {
+        $(document).on('click', "[name='browser_provider_radio']", function () {
+            if ($('#cefclient_browser').hasClass('radio_btn_on')) {
+                gCurrentBrowserMode = '0';
+                console.log("cefclient!");
+                saveBrowserTypeSelect(false);
+            } else {
+                gCurrentBrowserMode = '1';
+                console.log("uos!");
+                saveBrowserTypeSelect(true);
+            }
+        });
+    }
+
+    function initBrowserTypeSelect() {
+        let req = new Request();
+        req.configType = 7; //GlobalCache
+        req.section = 'BusinessBrowserType';
+        req.option = false;
+        req.key = 'FultureEx';
+        req.reserved1 = 0;
+        req.reserved2 = 0;
+        req.reserved3 = '';
+        req.reserved4 = '';
+        RVC.DeviceControlEntityCtrl.ReadConfigValue(req, function(ret) {
+            if (ret.errorCode === 0) {
+                let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
+                if(result.value === '1') {
+                    $('#cefclient_browser').addClass('radio_btn_on').removeClass('radio_btn_off');
+                    $('#uos_browser').addClass('radio_btn_off').removeClass('radio_btn_on');
+                } else {
+                    $('#uos_browser').addClass('radio_btn_on').removeClass('radio_btn_off');
+                    $('#cefclient_browser').addClass('radio_btn_off').removeClass('radio_btn_on');
+                }
+            } else {
+                $('#cefclient_browser').addClass('radio_btn_off_disabled').removeClass('radio_btn_on').removeClass('radio_btn_off');
+                $('#uos_browser').addClass('radio_btn_off_disabled').removeClass('radio_btn_on').removeClass('radio_btn_off');
+            }
+        });
+    }
+
+    function initSogouVersionInfo()
+    {
+        let req = new Request();
+        req.mode = 1;
+
+        RVC.ResourceWatcherEntity.GetThirdPartyInstallState(req, function(ret) {
+            if (ret.errorCode === 0) {
+                let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
+                if(result.status == 1) {
+                    const version = result.version;
+                    const path = result.path;
+                    const installTime = result.reserverd1;
+                    var value = "当前版本:" + version + "<br/>";
+                    value += "安装时间:" + installTime + "<br/>";
+                    console.log(value);
+                    $('#sogou_info_detail').html(value);
+                } else {
+                    var value = "输入法未安装或未启动!!";
+                    $('#sogou_info_detail').html(value);
+                }
+            } else {
+                var value = "获取输入法版本失败:" + ErrorCodeStringfy(ret.errorCode);
+                $('#sogou_info_detail').html(value);
+            }
+        });
     }
 
     function initPage() {
@@ -141,6 +267,10 @@ var browserController = (function() {
         $(document).on('click', '#browser_sogou_btn_restart', restartSogouSrv);
         $(document).on('click', '#browser_sogou_btn_fetch', FetchSogouInputInfo);
         
+        selectBrowserUseMode();
+        
+        initSogouVersionInfo();
+        initBrowserTypeSelect();
     }
 
     var fistTime = true;

+ 1 - 30
addin/res/ManagerDesktop/js/page/dns.js

@@ -49,40 +49,12 @@ function dnsGenPage() {
 
 var dnsController = (function() {
 
-    RVC.resourceWatcherEntity = RVC.EntityController.extend({
-        entityName: 'ResourceWatcher',
-        className: 'ResourceWatcherService',
-        methodID: {
-            UpdateDNS : 5,
-            GetNetworkInfo: 6
-        },
-        methodSignature: {
-            UpdateDNS : -943970884,
-            GetNetworkInfo: 1741482404
-        },
-
-        GetNetworkInfo: function(req, callback) {
-            this.webSocketInvokeEx(req, 
-                ({id:this.methodID.GetNetworkInfo, sig:this.methodSignature.GetNetworkInfo}),
-                 callback);
-        },
-        UpdateDNS: function(req, callback) {
-            req.entity = this.entityName;
-            req.class = this.className;
-            req.methodID = this.methodID.UpdateDNS;
-            req.signature = this.methodSignature.UpdateDNS;
-
-            this.webSocketInvoke(req, callback);
-
-        }
-    });
-
     function getLocalNetworkInfo() {
 
         let req = new Request();
         req.timeout = 10000;
         req.filter = 0;
-        RVC.resourceWatcherEntity.GetNetworkInfo(req, function(ret) {
+        RVC.ResourceWatcherEntity.GetNetworkInfo(req, function(ret) {
             if(ret.errorCode === 0) {
                 var chosen = ret.names.findIndex((item, idx) => {
                     return item == ret.current;
@@ -145,7 +117,6 @@ var dnsController = (function() {
 
         if (fistTime) {
             fistTime = false;
-            //RVC.resourceWatcherEntity.init();
             //bindEvents();
         }
         initPage();

+ 2 - 2
addin/res/ManagerDesktop/js/page/pinpad.js

@@ -11,7 +11,7 @@ function pinpadGenPage() {
             <div class="clearboth" id="pinpad_btn_save_div" style="padding-top:50px">\
                 <div class="control-label" style="margin-top: 8px;">&nbsp;</div>\
                 <div class="controls"><button class="btn_normal_long"\
-                        id="pinpad_btn_save">测试</button></div>\
+                        id="pinpad_btn_save">暂不支持</button></div>\
             </div>\
             <div class="clearboth" style="padding-top:70px"></div>\
             </div>\
@@ -194,7 +194,7 @@ var pinpadController = (function() {
     }
 
     function initPage() {
-        $(document).on('click', '#pinpad_btn_save', saveButtonHandle);
+       // $(document).on('click', '#pinpad_btn_save', saveButtonHandle);
     }
 
     var fistTime = true;

+ 36 - 0
addin/res/ManagerDesktop/js/public.js

@@ -2299,9 +2299,45 @@ $(function () {
         }
     });
 
+    RVC.ResourceWatcherEntity = RVC.EntityController.extend({
+        entityName: 'ResourceWatcher',
+        className: 'ResourceWatcherService',
+        methodID: {
+            UpdateDNS : 5,
+            GetNetworkInfo: 6,
+            GetThirdPartyInstallState:7
+        },
+        methodSignature: {
+            UpdateDNS : -943970884,
+            GetNetworkInfo: 1741482404,
+            GetThirdPartyInstallState:-15861483
+        },
+
+        GetNetworkInfo: function(req, callback) {
+            this.webSocketInvokeEx(req, 
+                ({id:this.methodID.GetNetworkInfo, sig:this.methodSignature.GetNetworkInfo}),
+                 callback);
+        },
+        UpdateDNS: function(req, callback) {
+            req.entity = this.entityName;
+            req.class = this.className;
+            req.methodID = this.methodID.UpdateDNS;
+            req.signature = this.methodSignature.UpdateDNS;
+
+            this.webSocketInvoke(req, callback);
+
+        },
+        GetThirdPartyInstallState: function(req, callback) {
+            this.webSocketInvokeEx(req, 
+                ({id:this.methodID.GetThirdPartyInstallState, sig:this.methodSignature.GetThirdPartyInstallState}),
+                 callback);
+        }
+    });
+
     RVC.DeviceControlEntityCtrl.init();
     RVC.HealthmanagerEntityCtrl.init();
     RVC.CenterSettingEntity.init();
+    RVC.ResourceWatcherEntity.init();
 });
 
 function quitThisPage() {

+ 233 - 0
addin/res/ManagerDesktop/prototype/adv.html

@@ -0,0 +1,233 @@
+<html id="html">
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>可视柜台终端管理</title>
+    <meta name="viewport"
+        content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+    <meta name="description" content="default">
+    <meta name="author" content="default">
+    <link type="text/css" rel="stylesheet" href="../css/emui-style.css">
+    <script type="text/javascript" src="../Include/LsyCookie.js"></script>
+    <script type="text/javascript" src="../js/errorCodeEnum.js"></script>
+    <script type="text/javascript" src="../js/common.js"></script>
+    <script type="text/javascript" src="../js/websocket.js"></script>
+    <script type="text/javascript" src="../js/webSocketBase.js"></script>
+    <script type="text/javascript" src="../js/entityMessage.js"></script>
+    <script type="text/javascript" src="../js/eventEmitter.js"></script>
+    <script type="text/javascript" src="../js/innerEventEmitter.js"></script>
+    <script type="text/javascript" src="../js/entityService.js"></script>
+    <script type="text/javascript" src="../Include/jQuery/js/emui-jquery.min.js"></script>
+    <script type="text/javascript" src="../js/public.js"></script>
+    <script type="text/javascript">
+        $(document).ready(function () {
+            var headerHeight = $(".header div.logo img").height();
+            $(".header").height(headerHeight);
+        });
+    </script>
+</head>
+
+<body style="display: block;">
+    <div id="preLoadEyeImg">
+        <div class="ic_guide_eye_open" style="opacity:0;height:0;margin:0"></div>
+        <div class="ic_eye_open" style="opacity:0;height:0;margin:0"></div>
+    </div>
+    <div>
+        <div class="headcontainer">
+            <div class="header" style="height: 38px;">
+                <div class="pull-left">
+                    <div class="logo pull-left"><img src="images/logo_cmb.png"> &nbsp;</div>
+                    <div class="pull-left devicename" id="deicename">&nbsp;</div>
+                </div>
+                <div id="header_right" class="pull-right">
+                    <table class="pull-right" cellpadding="0" cellspacing="0" frame="void" rules="none">
+                        <tbody>
+                            <tr>
+                                <td id="header_upgrade_info" style="width:52px;" align="center">
+                                    <div title="版本更新" style="position: relative;" class="ic_update_normal"
+                                        onclick="test();">
+                                    </div>
+                                </td>
+                                <td style="width:52px;" align="center" id="loginallowed_btn">
+                                    <div title="重启应用" class="ic_reboot"
+                                        onclick="RVC.HealthmanagerEntityCtrl.RestartApp();"></div>
+                                </td>
+                                <td style="width:52px;" align="center">
+                                    <div title="设备关机" class="ic_poweroff"
+                                        onclick="RVC.HealthmanagerEntityCtrl.PowerOffPC();"></div>
+                                </td>
+                                <td style="width:52px;border-left: 2px solid #A9A9A9;" align="center" id="quitpage_btn">
+                                    <div title="退出页面" class="ic_signout" onclick="quitThisPage();"></div>
+                                </td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+        </div>
+    </div>
+    <div class="clearboth"></div>
+    <div id="topmenucontainer" class="border_top border_bottom color_background_blue"
+        style="height:76px;font-size:18px;">
+        <table style="border-spacing:0px;border-collapse:collapse;width:1000px;margin:0 auto;left:0px;">
+            <tbody>
+                <tr>
+                    <td class="topmenu selectmenu" id="menu_home" onclick="selectPage('home')"><span id="ic_home_icon"
+                            style="display:inline-block;vertical-align: middle;margin-right:5px;"
+                            class="ic_home_selected">&nbsp;</span><span id="menu_top_home"
+                            style="display:inline-block;vertical-align: middle;" class="topmenu_selected">首页</span></td>
+                    <td class="topmenu color_Darkgray" id="menu_terminalmanagement"
+                        onclick="selectPage('terminalmanagement')">
+                        <span id="ic_terminalmanagement_icon"
+                            style="display:inline-block;vertical-align: middle;margin-right:5px;"
+                            class="ic_terminalmanagement">&nbsp;</span><span id="menu_top_terminalmanagement"
+                            style="display:inline-block;vertical-align: middle;" class="topmenu_normal">终端管理</span>
+                    </td>
+                    <td class="topmenu color_Darkgray" id="menu_networkmanagement"
+                        onclick="selectPage('networkmanagement')"><span id="ic_networkmanagement_icon"
+                            style="display:inline-block;vertical-align: middle;margin-right:5px;"
+                            class="ic_networkmanagement">&nbsp;</span><span id="menu_top_networkmanagement"
+                            style="display:inline-block;vertical-align: middle;" class="topmenu_normal">网络连接</span></td>
+                    <td class="topmenu color_Darkgray" id="menu_hardwareconfig" onclick="selectPage('hardwareconfig')">
+                        <span id="ic_hardwareconfig_icon"
+                            style="display:inline-block;vertical-align: middle;margin-right:5px;"
+                            class="ic_hardwareconfig">&nbsp;</span><span id="menu_top_hardwareconfig"
+                            style="display:inline-block;vertical-align: middle;" class="topmenu_normal">硬件管理</span></td>
+                    <td class="topmenu color_Darkgray" id="menu_mediacontrol" onclick="selectPage('mediacontrol')"><span
+                            id="ic_mediacontrol_icon"
+                            style="display:inline-block;vertical-align: middle;margin-right:5px;"
+                            class="ic_mediacontrol">&nbsp;</span><span id="menu_top_mediacontrol"
+                            style="display:inline-block;vertical-align: middle;" class="topmenu_normal">媒体控制</span></td>
+                    <td class="topmenu color_Darkgray" id="menu_advanceset" onclick="selectPage('advanceset')"><span
+                            id="ic_advanceset_icon"
+                            style="display:inline-block;vertical-align: middle;margin-right:5px;"
+                            class="ic_advanceset">&nbsp;</span><span id="menu_top_advanceset"
+                            style="display:inline-block;vertical-align: middle;" class="topmenu_normal">高级设置</span></td>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+    <div class="clearboth color_background_white">
+        <div class="bodycontainer">
+            <div id="leftmenuarea" class="leftmenuarea" style="padding-top: 20px; height: 802px;">
+                <div id="adv_childrens_menu">
+                    <div class="clearboth secondmenu selectmenu" id="menu_mobilenetwork"
+                        onclick="selectThirdPage('mobileconnection','mobilenetwork')">
+                        <div class="secondmenu_child">
+                            <div class="pull-left pointer" style="width: 200px;word-break: break-all;"
+                                lang-id="menu.mobilenetwork">终端配置</div>
+                            <div class="pull-right menu_arrow_open" id="menu_mobilenetwork_arrow"></div>
+                        </div>
+                    </div>
+                    <div id="mobilenetwork_childrens_menu" class="hide" style="display: block;">
+                        <div class="clearboth thirdleftmenu selectmenu" id="menu_mobileconnection"
+                            onclick="selectPage('mobileconnection')">
+                            <div class="pointer" lang-id="menu.mobileconnection">终端信息</div>
+                        </div>
+                        <div class="clearboth thirdleftmenu color_Darkgray" id="menu_mobilesearch"
+                            onclick="selectPage('mobilesearch')">
+                            <div class="pointer" lang-id="menu.mobilesearch">移动网络搜索</div>
+                        </div>
+                    </div>
+                    <div class="clearboth secondmenu color_Darkgray" id="menu_wifinetworks"
+                        onclick="selectThirdPage('wifinetworkssetting','wifinetworks')">
+                        <div class="secondmenu_child">
+                            <div class="pull-left pointer" style="width: 200px;word-break: break-all;"
+                                lang-id="menu.wifinetworks">WLAN 扩展</div>
+                            <div class="pull-right menu_arrow_close" id="menu_wifinetworks_arrow"></div>
+                        </div>
+                    </div>
+                    <div id="wifinetworks_childrens_menu" class="hide" style="display: none;">
+                        <div class="clearboth thirdleftmenu color_Darkgray" id="menu_wifinetworkssetting"
+                            onclick="selectPage('wifinetworkssetting')">
+                            <div class="pointer" lang-id="menu.wifinetworkssetting">WLAN 扩展设置</div>
+                        </div>
+                        <div class="clearboth thirdleftmenu color_Darkgray" id="menu_wifinetworksconnect"
+                            onclick="selectPage('wifinetworksconnect')">
+                            <div class="pointer" lang-id="menu.wifinetworksconnect">WLAN 扩展连接</div>
+                        </div>
+                        <div class="clearboth thirdleftmenu color_Darkgray" id="menu_wifinetworkswps"
+                            onclick="selectPage('wifinetworkswps')">
+                            <div class="pointer" lang-id="menu.wifinetworkswps">WLAN 扩展 WPS</div>
+                        </div>
+                    </div>
+                </div>
+                <div style="height:60px;">&nbsp;</div>
+            </div>
+            <div id="rightpagearea" class="rightpagearea margin-left-50" style="padding-top: 40px; width: 690px;">
+                <div id="adv_page" style="display: block;">
+                    <div class="maintitle">
+                        <div>广告播放</div>
+                        <div class="page_description_text">上屏广告播放管理</div>
+                    </div>
+                    <div id="advContent" class="hide" style="display: block;">
+                        <div id="adv_play_switch" class="clearboth" style="margin-top: 37px;">
+                            <div class="control-label" style="margin-top: 8px;"><span>是否播放广告</span></div>
+                            <div class="controls" style="margin-top:6px;">
+                                <div id="log_switch_cardissuer_switch" onclick="Switch(this)" class="switch_off"></div>
+                            </div>
+                        </div>
+                    </div>
+                    <div style="height:40px;">&nbsp;</div>
+                </div>
+            </div>
+            <div class="clearboth"></div>
+        </div>
+    </div>
+    <div class="clearboth"></div>
+    <div id="page_footer" style="height:80px;background-color:#F3F3F3;width:100%;" class="hide">
+        <div style="width:1150px;height:50px;margin:0 auto;background-color:#F3F3F3;">
+            <div class="clearboth footercontainer">
+                <div id="copyright">
+                    <table style="margin-top:5px; margin-bottom:12px" cellpadding="0" cellspacing="0" frame="void"
+                        rules="none" align="center">
+                        <tbody>
+                            <tr>
+                                <td class="padding-left-20">
+                                    <a id="help_href" href="#" rel="noopener noreferrer" target="_blank"
+                                        class="pull-left  padding-left-20 color_descroption_gray"
+                                        style="display: inline;">
+                                        <div class="pull-left footer-help" lang-id="footer.faqs">常见问题</div>
+                                    </a>
+                                </td>
+                                <td class="padding-left-20">
+                                    <div class="padding-left-20 border_left color_border_gray color_descroption_gray"
+                                        id="footer_copyright">©2021 招商银行 版权所有</div>
+                                </td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+        </div>
+    </div>
+    <div class="clearboth"></div>
+    <div id="submit_light" class="submit_white_content" style="display: none;"></div>
+    <div id="pwd_submit_light" class="pwd_submit_white_content"></div>
+    <div id="toast_location" class="toast_location hide">
+        <div class="toast_left pull-left"></div>
+        <div class="pull-left color_Darkgray" style="background-color:#DBDBDB;height:44px;font-size:14px;">
+            <div style="margin-top:14px;" id="toast_info"></div>
+        </div>
+        <div class="toast_right pull-left"></div>
+    </div>
+    <div id="confirm_light" class="submit_white_content hide" style="display: none;"></div>
+    <div id="submit_fade" class="submit_black_overlay hide" style="display: none;"></div>
+    <div id="emui_content_pop_win" class="pop_win hide">
+        <div class="adv_pop_win_top">
+            <div class="pull-left padding-left-30" id="emui_pop_win_title" lang-id="cbs.win.title"
+                style="font-size:16px;padding-top:25px;"></div>
+            <div class="pull-right btn_cancel padding-right-8" onclick="EMUI.popWinController.closeAll();"
+                style="margin-top:25px;"></div>
+        </div>
+        <div class="adv_pop_win_middle" style="min-height:100px;">
+            <div class="clearboth border_bottom margin-left-10" style="width:504px;"></div>
+            <div id="pop_win_content_area" class="pop_win_content" style="word-wrap:break-word;">&nbsp;</div>
+        </div>
+        <div class="adv_pop_win_bottom"></div>
+    </div>
+
+
+</body>
+
+</html>

+ 42 - 15
addin/res/ManagerDesktop/prototype/browser.html

@@ -92,7 +92,8 @@
                         <span id="ic_hardwareconfig_icon"
                             style="display:inline-block;vertical-align: middle;margin-right:5px;"
                             class="ic_hardwareconfig">&nbsp;</span><span id="menu_top_hardwareconfig"
-                            style="display:inline-block;vertical-align: middle;" class="topmenu_normal">硬件管理</span></td>
+                            style="display:inline-block;vertical-align: middle;" class="topmenu_normal">硬件管理</span>
+                    </td>
                     <td class="topmenu color_Darkgray" id="menu_mediacontrol" onclick="selectPage('mediacontrol')"><span
                             id="ic_mediacontrol_icon"
                             style="display:inline-block;vertical-align: middle;margin-right:5px;"
@@ -163,33 +164,59 @@
                     </div>
                     <div id="browserContent">
                         <div id="browser_all_content">
-                            <div id="browser_prompt" class="page_prompt_info page_scenes_info_text hide" style="display: none;"></div>
+                            <div id="browser_prompt" class="page_prompt_info page_scenes_info_text hide"
+                                style="display: none;"></div>
                             <div class="clearboth" id="browser_btn_save_div" style="padding-top:50px">
                                 <div class="control-label" style="margin-top: 8px;">&nbsp;</div>
                                 <div class="controls"><button class="btn_normal_long btn_disabled"
                                         id="browser_btn_save">浏览器缓存清理</button></div>
                             </div>
-                            <div class="clearboth" id="browser_sogou_btn_save_div" style="padding-top:50px">
-                                <div class="control-label" style="margin-top: 8px;">&nbsp;</div>
-                                <div class="controls"><button class="btn_normal_long"
-                                        id="browser_sogou_btn_restart">重启搜狗输入法服务(针对异常情况)</button></div>
-                            </div>
-                            <div class="clearboth" id="browser_sogou_btn_fetch_div" style="padding-top:50px">
-                                <div class="control-label" style="margin-top: 8px;">&nbsp;</div>
-                                <div class="controls"><button class="btn_normal_long"
-                                        id="browser_sogou_btn_fetch">搜狗输入法信息快照</button></div>
+                            <div class="clearboth" style="padding-top: 40px;">
+                                <div style="width: 170px; margin-right: 10px; margin-top: 8px;" class="control-label"
+                                    lang-id="IDS_lan_ip_filter_mode">使用浏览器</div>
+                                <div class="controls" style="margin-top:7px;">
+                                    <div class="pull-left">
+                                        <div onclick="radio(this)" name="browser_provider_radio" id="cefclient_browser"
+                                            class="radio_btn_on"></div>
+                                    </div>
+                                    <div class="pull-left" style="width:100px;">第三方</div>
+                                    <div class="pull-left">
+                                        <div onclick="radio(this)" name="browser_provider_radio" id="uos_browser"
+                                            class="radio_btn_off"></div>
+                                    </div>
+                                    <div class="pull-left" style="padding-top:0px;">系统自带
+                                    </div>
+                                </div>
                             </div>
-                            <div class="clearboth" style="padding-top:70px"></div>
+                            <div class="clearboth" style="padding-top:20px"></div>
+                        </div>
+                        <div id="sogou_management_div"
+                            style="margin-top: 40px; padding-bottom: 20px; border-bottom: 1px solid rgb(243, 243, 243);">
+                            <div style="margin-top: 30px; font-size: 16px; "><span>Sogou输入法</span></div>
+                        </div>
+                        <div class="clearboth" id="browser_sogou_info_div" style="padding-top:20px">
+                            <div class="control-label" style="margin-top: 8px;">&nbsp;</div>
+                            <div class="controls"><span id="sogou_info_detail">无法获取输入法信息</span>
                             </div>
+                        </div>
+                        <div class="clearboth" id="browser_sogou_btn_save_div" style="padding-top:50px">
+                            <div class="control-label" style="margin-top: 8px;">&nbsp;</div>
+                            <div class="controls"><button class="btn_normal_long"
+                                    id="browser_sogou_btn_restart">重启搜狗输入法服务V3.0</button></div>
+                        </div>
+                        <div class="clearboth" id="browser_sogou_btn_fetch_div" style="padding-top:50px">
+                            <div class="control-label" style="margin-top: 8px;">&nbsp;</div>
+                            <div class="controls"><button class="btn_normal_long"
+                                    id="browser_sogou_btn_fetch">搜狗输入法信息快照</button></div>
+                        </div>
                     </div>
                     <div id="browser_activation_content" class="page_prompt_info page_scenes_info_text hide">
                     </div>
-                    </div>
-                    <div style="height:40px;">&nbsp;</div>
                 </div>
             </div>
-            <div class="clearboth"></div>
         </div>
+        <div class="clearboth"></div>
+    </div>
     </div>
     <div class="clearboth"></div>
     <div id="page_footer" style="height:80px;background-color:#F3F3F3;width:100%;" class="hide">

+ 22 - 0
addin/res/RunScript/shutdown_sogouservice_without_monitor.sh

@@ -0,0 +1,22 @@
+#/bin/bash
+
+WEBSRV=sogouImeWebSrv
+ID=`ps -ef | grep "$WEBSRV" | grep -v "$0" | grep -v "grep" | awk '{print $2}'`
+for id in $ID
+do
+echo "[SOGOULOG] === $WEBSRV is running, Kill Service === "
+kill -9 $id
+echo "[SOGOULOG] === Kill sogouImeWebSrv Done === "
+done
+
+echo "[SOGOULOG] === Kill Service Start === "
+SOGOUIME=sogouImeService
+ID=`ps -ef | grep "$SOGOUIME" | grep -v "$0" | grep -v "grep" | awk '{print $2}'`
+for id in $ID
+do
+echo "[SOGOULOG] === $SOGOUIME is running, Kill Service === "
+kill -9 $id
+echo "[SOGOULOG] === Kill sogouImeService Done === "
+done
+
+echo "[SOGOULOG] === Kill Service Done === "

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini