Web Interface For Lite Argus Control modules
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.

100 lines
2.7 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. function updateDashBoardItemLayout( id, x, y ){
  3. Ext.Ajax.request({
  4. url: '/lib/controller/updateDashBoardItems.php',
  5. params: {
  6. SITE: <?=$SiteID;?>,
  7. UID: <?=$UserID;?>,
  8. SID: '<?=$Session;?>',
  9. PANEL: id,
  10. X: x,
  11. Y: y
  12. },
  13. success: function( response, opts ){
  14. //var data = Ext.decode(response.responseText);
  15. //var tPanel = Ext.getCmp('main_portal');
  16. //tPanel.removeAll(true);
  17. //for( i=0; i < data.length; i++) tPanel.add( data[i] );
  18. //tPanel.doLayout();
  19. },
  20. failure: failureAJAXFunction
  21. });
  22. };
  23. function initMonitoring(){
  24. if( tlInterval!= null ){
  25. window.clearInterval( tlInterval );
  26. tlInterval = null;
  27. timelineObj = null;
  28. };
  29. Ext.Ajax.request({
  30. url: '/lib/controller/getDashBoardItems.php',
  31. params: {
  32. SITE: <?=$SiteID;?>,
  33. UID: <?=$UserID;?>,
  34. SID: '<?=$Session;?>'
  35. },
  36. success: function( response, opts ){
  37. var data = Ext.decode(response.responseText);
  38. Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>' );
  39. Ext.getCmp('main_content').removeAll(true);
  40. Ext.getCmp('main_content').add({
  41. xtype: 'portal',
  42. id: 'main_portal',
  43. frame: false,
  44. border: false,
  45. items:{
  46. html: ''
  47. },
  48. listeners:{
  49. drop: function( a ){
  50. updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
  51. }
  52. }
  53. });
  54. Ext.getCmp('main_content').doLayout();
  55. var tPanel = Ext.getCmp('main_portal');
  56. tPanel.removeAll(true);
  57. nodeDashboardStatuses = new Array();
  58. for( i=0; i < data.length; i++) tPanel.add( data[i] );
  59. tPanel.doLayout();
  60. $('img[data-enlargeable]').addClass('img-enlargeable').click(function() {
  61. var src = $(this).attr('src');
  62. var modal;
  63. function removeModal() {
  64. modal.remove();
  65. $('body').off('keyup.modal-close');
  66. }
  67. modal = $('<div>').css({
  68. background: 'RGBA(0,0,0,.5) url(' + src + ') no-repeat center',
  69. backgroundSize: 'contain',
  70. width: '100%',
  71. height: '100%',
  72. position: 'fixed',
  73. zIndex: '10000',
  74. top: '0',
  75. left: '0',
  76. cursor: 'zoom-out'
  77. }).click(function() {
  78. removeModal();
  79. }).appendTo('body');
  80. //handling ESC
  81. $('body').on('keyup.modal-close', function(e) {
  82. if (e.key === 'Escape') {
  83. removeModal();
  84. }
  85. });
  86. });
  87. tlInterval = window.setInterval( fetchSiteStatus, 333, selectedSite );
  88. },
  89. failure: failureAJAXFunction
  90. });
  91. //var tPanel = Ext.getCmp('main_content');
  92. //tPanel.removeAll( true );
  93. //tPanel.add({
  94. // xtype: 'panel',
  95. // html: 'KOKO'
  96. //});
  97. //tPanel.doLayout();
  98. };