Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

283 lines
6.3 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
5 years ago
​
​
5 years ago
5 years ago
​
​
​
​
​
5 years ago
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
6 years ago
​
6 years ago
6 years ago
​
​
​
​
​
6 years ago
6 years ago
​
​
​
6 years ago
6 years ago
6 years ago
6 years ago
​
​
​
6 years ago
6 years ago
6 years ago
​
​
​
​
6 years ago
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
6 years ago
​
6 years ago
​
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
6 years ago
​
​
​
​
​
​
​
6 years ago
​
6 years ago
​
​
​
​
​
​
5 years ago
5 years ago
​
​
​
​
5 years ago
​
​
​
​
​
5 years ago
​
6 years ago
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
6 years ago
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var winW = <?=intval($CUser->Data['width']);?>;
  3. var winH = <?=intval($CUser->Data['height']);?>;
  4. var PanelH = winH-90;
  5. var SelectedSite = <?=$SiteID;?>;
  6. var SettingsLidar3D = null;
  7. var SelectedNodeID = 0;
  8. var ServerPID = -1;
  9. var SoundEnable = <?=intval($CUser->Data['sound_enable']);?>;
  10. var sndBeep = new Howl({
  11. src: [
  12. '/style/assets/audio/beep-07a.mp3',
  13. '/style/assets/audio/beep-07a.wav'
  14. ],
  15. loop: false,
  16. volume: 0.99,
  17. onend: function() {
  18. console.log('Finished!');
  19. }
  20. });
  21. var sndExcl = new Howl({
  22. src: [
  23. '/style/assets/audio/button-42.mp3',
  24. '/style/assets/audio/button-42.wav'
  25. ],
  26. loop: false,
  27. volume: 0.99
  28. });
  29. function playSound( t ){
  30. if( SoundEnable ){
  31. switch( t ){
  32. case 1:{
  33. sndBeep.play();
  34. break;
  35. };
  36. default:{
  37. sndExcl.play();
  38. };
  39. };
  40. };
  41. };
  42. function doRefresh(){
  43. window.location="/?t="+123;
  44. };
  45. function doLogout(){
  46. //window.location = '/login.php?UID=1';
  47. };
  48. //https://www.javascripttutorial.net/web-apis/javascript-notification/
  49. //https://developers.google.com/web/updates/2015/03/push-notifications-on-the-open-web
  50. function failureAJAXFunction( responce, opts ){
  51. if( tlInterval!= null ){
  52. window.clearInterval( tlInterval );
  53. tlInterval = null;
  54. //timelineObj = null;
  55. };
  56. playSound();
  57. Ext.Msg.show({
  58. title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
  59. msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
  60. buttons: Ext.Msg.OK,
  61. icon: Ext.MessageBox.INFO
  62. });
  63. doLogout();
  64. };
  65. function updateUserScreenResolution( x, y ){
  66. Ext.Ajax.request({
  67. url: '/lib/controller/updateUserSettings.php',
  68. params: {
  69. SAID: SelectedSite,
  70. UID: <?=$UserID;?>,
  71. SID: '<?=$Session;?>',
  72. SSS: 15,
  73. WID: x,
  74. HEI: y
  75. },
  76. success: function( response, opts ){
  77. doRefresh();
  78. },
  79. failure: failureAJAXFunction
  80. });
  81. };
  82. function removeAllFromSite(){
  83. Ext.Ajax.request({
  84. url: '/lib/controller/resetAllSettings.php',
  85. params: {
  86. SAID: SelectedSite,
  87. UID: <?=$UserID;?>,
  88. SID: '<?=$Session;?>'
  89. },
  90. success: function( response, opts ){
  91. doRefresh();
  92. },
  93. failure: failureAJAXFunction
  94. });
  95. };
  96. function doCheckWindowSize(){
  97. if (parseInt(navigator.appVersion)>3) {
  98. if (navigator.appName=="Netscape") {
  99. winW2 = window.innerWidth;
  100. winH2 = window.innerHeight;
  101. if ( winH2<700 ) winH2=700;
  102. };
  103. if (navigator.appName.indexOf("Microsoft")!=-1) {
  104. winW2 = document.body.offsetWidth;
  105. winH2 = document.body.offsetHeight;
  106. if ( winH2<700 ) winH2=700;
  107. };
  108. };
  109. if ( winW2 != winW || winH2!=winH ){
  110. updateUserScreenResolution( winW2, winH2 );
  111. };
  112. };
  113. var NotificationStack = null;
  114. Ext.onReady(function(){
  115. doCheckWindowSize();
  116. NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
  117. //window.onresize = doCheckWindowSize;
  118. Ext.QuickTips.init();
  119. var viewport = new Ext.Viewport({
  120. id: 'main_viewport',
  121. layout:'border',
  122. items: [{
  123. xtype: 'panel',
  124. region: 'north',
  125. baseCls: 'x-plain',
  126. height: 50,
  127. items:[{
  128. xtype: 'panel',
  129. id:'top',
  130. baseCls: 'x-plain',
  131. html: '<p style="padding:10px;zcolor:#556677;font-size:24px;"><img src="/style/img/logo32.png">&nbsp;<?=$Labels->GetLabel('_APP_TITLE_');?></p>'
  132. }]
  133. },{
  134. xtype: 'panel',
  135. id:'btns',
  136. region:'west',
  137. bsaseCls:'x-plain',
  138. title: '<?=$Labels->GetLabel('_SEC_SYSTEM_');?>',
  139. collapsible: true,
  140. split:true,
  141. width:150,
  142. minWidth: 100,
  143. maxWidth: 250,
  144. layout:'accordion',
  145. margins: '5 0 5 5',
  146. cmargins:'5 5 5 5',
  147. layoutConfig:{
  148. animate:true
  149. },
  150. items: [{
  151. title: '<?=$Labels->GetLabel('_DASHBOARD_');?>',
  152. layout: 'vbox',
  153. height: 120,
  154. pack: 'center',
  155. align : 'strech',
  156. items:[{
  157. xtype: 'button',
  158. width: '100%',
  159. id:'go_home',
  160. text: '<?=$Labels->GetLabel('_GO_HOME_');?>',
  161. handler: function( b, e ){
  162. loadDashBoard();
  163. }
  164. },{
  165. xtype: 'button',
  166. width: '100%',
  167. id:'go_monitor',
  168. text: '<?=$Labels->GetLabel('_EVT_MONITOR_');?>',
  169. handler: function( b, e ){
  170. loadTimeLine();
  171. }
  172. },{
  173. xtype: 'button',
  174. width: '100%',
  175. id:'go_out',
  176. text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
  177. handler: doLogout
  178. }]
  179. },{
  180. title: '<?=$Labels->GetLabel('_SYS_SETTINGS_');?>',
  181. layout: 'vbox',
  182. height: 120,
  183. pack: 'center',
  184. align : 'strech',
  185. items:[{
  186. xtype: 'button',
  187. width: '100%',
  188. id:'sys_edit',
  189. text: '<?=$Labels->GetLabel('_EDT_CONNECTIONS_');?>',
  190. handler: function( b, e ){
  191. loadSystemEditor();
  192. }
  193. },{
  194. xtype: 'button',
  195. width: '100%',
  196. id:'map_edit',
  197. text: '<?=$Labels->GetLabel('_EDT_LOCATIONS_');?>',
  198. handler: function( b, e ){
  199. loadLocationEditor();
  200. }
  201. },{
  202. xtype: 'button',
  203. width: '100%',
  204. id:'logout',
  205. text: '<?=$Labels->GetLabel('_CLEAR_SITE_');?>',
  206. handler: removeAllFromSite
  207. }]
  208. },{
  209. title: '<?=$Labels->GetLabel('_PROF_SETTINGS_');?>',
  210. html: '<p>Panel content!</p>'
  211. }
  212. <?php
  213. if( $CUser->Data['access'] > 5 ){
  214. ?>,{
  215. title: '<?=$Labels->GetLabel('_ADM_SETTINGS_');?>',
  216. items:[{
  217. xtype: 'button',
  218. width: '100%',
  219. id:'adm_acc',
  220. text: '<?=$Labels->GetLabel("_USERS_MNGMT_");?>',
  221. handler: function( b, e ){
  222. loadUserEditor();
  223. }
  224. },{
  225. xtype: 'button',
  226. width: '100%',
  227. id:'adm_acclog',
  228. text: '<?=$Labels->GetLabel('_ACC_LOG_');?>',
  229. handler: function( b, e ){
  230. loadAccessLog();
  231. }
  232. },{
  233. xtype: 'button',
  234. width: '100%',
  235. id:'adm_servlog',
  236. text: '<?=$Labels->GetLabel('_SERV_LOG_');?>',
  237. handler: function( b, e ){
  238. loadServerLog();
  239. }
  240. }]
  241. }
  242. <?php
  243. };
  244. ?>
  245. ]
  246. },{
  247. xtype: 'panel',
  248. region:'center',
  249. margins: '5 5 5 0',
  250. id: 'main_content',
  251. title: '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>',
  252. items:[{
  253. xtype: 'portal',
  254. id: 'main_portal',
  255. frame: false,
  256. border: false,
  257. items:{
  258. html: '<p style="padding:10px;color:#556677;font-size:11px;"><center><img src="/style/img/logo.png"></center></p>'
  259. },
  260. listeners:{
  261. drop: function( a ){
  262. updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
  263. }
  264. }
  265. }]
  266. }]
  267. });
  268. loadDashBoard();
  269. });