123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- function browserGenPage() {
- var page = '<div id="browser_page" style="display: block;">\
- <div class="maintitle">\
- <div>业务浏览器设置</div>\
- <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 class="control-label" style="margin-top: 8px;"> </div>\
- <div class="controls"><button class="btn_normal_long"\
- 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;"> </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;"> </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>\
- </div>\
- <div id="browser_activation_content" class="page_prompt_info page_scenes_info_text hide">\
- </div>\
- </div></div>';
- $("#rightpagearea").prepend(page);
- if (typeof browserRenderPage == "function") {
- beforeRenderPage("browser");
- browserRenderPage();
- afterRenderPage("browser");
- }
- }
- var browserController = (function() {
- function updateBrowserCacheClearFlag() {
- let req = new Request();
- req.configType = 3; //RunConfig
- req.section = 'Browser';
- req.option = true; //Write
- req.key = 'CacheClear';
- req.reserved1 = 0;
- req.reserved2 = 0;
- req.reserved3 = 'true';
- req.reserved4 = '';
- utilStartSubmitDialog();
- RVC.DeviceControlEntityCtrl.ReadConfigValue(req, function(ret) {
- utilStopSubmitDialog();
- if (ret.errorCode === 0) {
- utilStartAlertDialog("清理指令已下发,请重启应用以进行浏览器缓存清理。");
- } else {
- RVC.DeviceControlEntityCtrl.commErrorCallback(ret);
- }
- });
- }
- function restartSogouSrvRestartFlag() {
- let req = new Request();
- req.configType = 3; //RunConfig
- req.section = 'Browser';
- req.option = true; //Write
- req.key = 'SogouRestart';
- req.reserved1 = 0;
- req.reserved2 = 0;
- req.reserved3 = 'true';
- req.reserved4 = '';
- utilStartSubmitDialog();
- RVC.DeviceControlEntityCtrl.ReadConfigValue(req, function(ret) {
- utilStopSubmitDialog();
- if (ret.errorCode === 0) {
- utilStartAlertDialog("重启指令已下发,请重启应用以执行该操作。");
- } else {
- RVC.DeviceControlEntityCtrl.commErrorCallback(ret);
- }
- });
- }
- function FetchSogouInputInfo() {
- let req = new Request();
- req.configType = 0;
- req.section = 'SougouInput';
- req.option = false;
- req.key = 'Snapshot';
- req.reserved1 = 0;
- req.reserved2 = 0;
- req.reserved3 = '';
- req.reserved4 = '';
- utilStartSubmitDialog();
- RVC.DeviceControlEntityCtrl.ReadConfigValue(req, function(ret) {
- utilStopSubmitDialog();
- if (ret.errorCode === 0) {
- let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
- if(result.reserved3 === '') {
- utilStartAlertDialog("操作成功!");
- } else {
- utilStartAlertDialog(result.reserved3);
- }
- } else {
- RVC.DeviceControlEntityCtrl.commErrorCallback(ret);
- }
- });
- }
- function saveButtonHandle() {
- updateBrowserCacheClearFlag();
- }
- function initPage() {
- $(document).on('click', '#browser_btn_save', saveButtonHandle);
- $(document).on('click', '#browser_sogou_btn_restart', restartSogouSrvRestartFlag);
- $(document).on('click', '#browser_sogou_btn_fetch', FetchSogouInputInfo);
-
- }
- var fistTime = true;
- function init() {
- if (fistTime) {
- fistTime = false;
- }
- initPage();
- }
-
- return { init: init };
- }());
- window.browserRenderPage = function () {
- browserController.init();
- };
|