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.

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