Browse Source

#IQRV #comment [WrongPage] 错误页添加通过UPS重启的按钮和关闭页面的按钮

gifur 4 years ago
parent
commit
9fa3712d6c

+ 4 - 1
addin/cfg/SpShell.ini

@@ -19,4 +19,7 @@ CmdLine=./res/RunScript/startInit.sh
 
 [startChromium]
 Type=1
-CmdLine=Chromium	http://55.14.95.131:8100/
+CmdLine=Chromium	http://55.14.95.131:8100/
+
+[QuickShortcut]
+CmdLine=./res/RunScript/startSettings.sh

+ 15 - 6
addin/res/ManagerDesktop/css/ininPsd.css

@@ -1,4 +1,4 @@
-@charset "utf-8";html{background-color:#fff;}
+@charset "utf-8";html{background-color:#fff;}
 body,ul,ol,dl,dd,h1,h2,h3,h4,h5,h6,figure,form,fieldset,legend,input,textarea,button,p,blockquote,th,td,pre,xmp{margin:0;padding:0}
 body,input,textarea,button,select,pre,xmp,tt,code,kbd,samp{line-height:1.5;font-family:'HYQiHei 55S',sans-serif}
 h1,h2,h3,h4,h5,h6,small,big,input,textarea,button,select{font-size:100%;outline: none;}
@@ -254,10 +254,19 @@ nav ul li:nth-child(4)::before{
 	background: url('../images/off.png');
 	background-size: cover;
 }
-nav ul li:nth-child(5)::before{
-	background: url('../images/min.png');
-	background-size: cover;
-}
+	nav ul li:nth-child(5)::before {
+		background: url('../images/off.png');
+		background-size: cover;
+	}
+	nav ul li:nth-child(6)::before {
+		background: url('../images/min.png');
+		background-size: cover;
+	}
+	nav ul li:nth-child(7)::before {
+		background: url('../images/cloxe.png');
+		background-size: cover;
+	}
+
 .imgDiv{
 	text-align: center;
 }
@@ -365,6 +374,6 @@ nav ul li:nth-child(5)::before{
 	margin-left: 25px;
 }
 
-#resetPsd, #minimize{
+#resetPsd, #minimize, #upsoff, #closethis {
 	display: none;
 }

+ 5 - 3
addin/res/ManagerDesktop/errPage.html

@@ -29,9 +29,11 @@
 			<ul>
 				<li class="fz_24" id="resetPsd" onclick="resetRSA()">	重置密钥 </li>
 				<li class="fz_24" onclick="RebootShell()">	重启应用 </li>
-				<li class="fz_24" onclick="RebootComputer()">	重启计算机 </li>
-				<li class="fz_24" onclick="PowerOff()">	关机 </li>
-				<li class="fz_24" id="minimize" onclick="Minimize()">	最小化 </li>
+				<li class="fz_24" id="reboot" onclick="RebootComputer()">	重启计算机 </li>
+				<li class="fz_24" id="poweroff" onclick="PowerOff()"> 关机 </li>
+				<li class="fz_24" id="upsoff" onclick="UPSOff()"> 关机(UPS) </li>
+				<li class="fz_24" id="minimize" onclick="Minimize()"> 最小化 </li>
+				<li class="fz_24" id="closethis" onclick="ClosePage()"> 关闭页面 </li>
 			</ul>
 		</nav>
 

BIN
addin/res/ManagerDesktop/images/cloxe.png


BIN
addin/res/ManagerDesktop/images/quick-configure.png


+ 6 - 1
addin/res/ManagerDesktop/js/entityService.js

@@ -332,7 +332,8 @@ var DeviceService= {
     _eventCode:{
         rebootshell : 0x401000F1,
         rebootcomputer : 0x401000F5,
-        poweroff : 0x401000F6
+        poweroff: 0x401000F6,
+        upsoff: 0x401000F7
     },
   
     //重启终端应用
@@ -346,6 +347,10 @@ var DeviceService= {
     //关闭计算机
     PowerOff:function() {
         WebSocketBase.logSpEvent(this._eventCode.poweroff, 2, '');
+    },
+        //通过UPS关闭计算机,适合非24小时开机下班场景
+    PowerOffThroughUPS: function () {
+        WebSocketBase.logSpEvent(this._eventCode.upsoff, 2, '');
     }
 };
 

+ 42 - 6
addin/res/ManagerDesktop/js/errPage.js

@@ -59,7 +59,14 @@ function showErrTips(){
 
   if(Object.keys(Request).indexOf('showmin')>0 && Request['showmin'] ==1){
     $("#minimize").css({'display':'flex'})
-  }
+    }
+
+    if (Object.keys(Request).indexOf('showclose') > 0 && Request['showclose'] == 1) {
+        $("#reboot").css({ 'display': 'none' })
+        $("#poweroff").css({ 'display': 'none' })
+        $("#upsoff").css({ 'display': 'flex' })
+        $("#closethis").css({ 'display': 'flex' })
+    }
   
   
   switch(reason)
@@ -101,7 +108,12 @@ function showErrTips(){
       var errcode =Request['errcode'];
       SuspensionTxt = errmsg;
       PromptTxt = errcode;
-      break;
+          break;
+      case "QuickConfig":
+          SuspensionTxt = "快捷配置页面(试运行特供)";
+          PromptTxt = "仅供试运行设备临时使用,该功能后续由维护桌面提供";
+          document.getElementById("AuthFailBg").src = "./images/quick-configure.png";
+          break;
       default:
         var errmsg = Request['errmsg'];
         var errcode =Request['errcode'];
@@ -163,6 +175,13 @@ function PowerOff(){
   ModalStyleErr('确认关闭计算机?')
 }
 
+//关机(UPS)
+function UPSOff() {
+    logEvent("UPSOff");
+    btnType = 'UPSOff'
+    ModalStyleErr('确认通过UPS关闭计算机?(关机后请在5分钟内拔离插座电源线)')
+}
+
 // modal显示设置
 function ModalStyleErr(tips){
 	$('#modalBoxErr').fadeIn('slow')
@@ -172,12 +191,24 @@ function ModalStyleErr(tips){
 // modal 确定事件
 function clickSure(){
   if(!btnType)return false;
-  exitTipsColck()
   switch(btnType)
   {
-    case 'RebootShell': DeviceService.RebootShell(); break;
-    case 'RebootComputer': DeviceService.RebootComputer();break
-    case 'PowerOff': DeviceService.PowerOff(); break;
+      case 'RebootShell':
+          exitTipsColck();
+          DeviceService.RebootShell();
+          break;
+      case 'RebootComputer':
+          exitTipsColck();
+          DeviceService.RebootComputer();
+          break;
+      case 'PowerOff':
+          exitTipsColck();
+          DeviceService.PowerOff();
+          break;
+      case 'UPSOff':
+          exitTipsColck();
+          DeviceService.PowerOffThroughUPS();
+          break;
   }
   $('#modalBoxErr').fadeOut('slow')
 }
@@ -210,6 +241,11 @@ function Minimize(){
   sendRequest(req); 
 }
 
+// 最小化
+function ClosePage() {
+    open(location, '_self').close();
+}
+
 
 function closeModalErr(){
   $('#modalBoxErr').fadeOut('slow')

+ 12 - 0
addin/res/RunScript/startSettings.sh

@@ -0,0 +1,12 @@
+#!/bin/sh
+bindir="${PWD}/bin" 
+echo "1"$bindir
+versiondir=${PWD} 
+echo "2"$versiondir
+cefpath="${bindir}/Chromium/cefclient"
+echo "3"$cefpath
+urlpath="${versiondir}/res/ManagerDesktop/errPage.html?reason=QuickConfig&errmsg=empty&showlimit=1&showclose=1"
+echo "4"$urlpath
+cmdpath="${cefpath} --url=file:///${urlpath}  --no-sandbox --hide-controls --always-on-top --logextend=errPage"
+echo "5"$cmdpath
+exec ${cmdpath}