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.

314 lines
7.2 KiB

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