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.

357 lines
12 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. $UID = intval( $CUser->Data['id'] );
  4. $ACCESS = intval( $CUser->Data['access'] );
  5. if( $UID > 1 ){
  6. ob_start();
  7. $QS="SELECT * FROM system_props LIMIT 1";
  8. $RV = $DATABASE->Query( $QS );
  9. if( count( $RV ) ){
  10. $AP_DATA = $RV[0];
  11. if( $AP_DATA['version_string'] == '' ) $AP_DATA['version_string'] = $Labels->GetLabel('APP_IS_NOT_RUNING');
  12. if( $AP_DATA['hw_info'] == '' ) $AP_DATA['hw_info'] = $Labels->GetLabel('APP_IS_NOT_RUNING');
  13. if( $AP_DATA['os_info'] == '' ) $AP_DATA['os_info'] = $Labels->GetLabel('APP_IS_NOT_RUNING');
  14. } else {
  15. $AP_DATA = array(
  16. 'anchor_lat'=>0,
  17. 'anchor_lon'=>0,
  18. 'anchor_alt'=>0,
  19. 'type'=>0,
  20. 'version_string'=>$Labels->GetLabel('APP_IS_NOT_RUNING'),
  21. 'os_info'=>$Labels->GetLabel('APP_IS_NOT_RUNING'),
  22. 'hw_info'=>$Labels->GetLabel('APP_IS_NOT_RUNING')
  23. );
  24. };
  25. if(isset( $_POST['TYP'] )) $T = intval( $_POST['TYP'] ); else $T = 0;
  26. $build = $AP_DATA['version_string'];//getServerProp( 11 );
  27. //if( $build == '' ) $build = $AP_DATA['version_string'];
  28. //if( $build == '' ) $build = $Labels->GetLabel('APP_IS_NOT_RUNING');
  29. $os_info = $AP_DATA['os_info'];//getServerProp( 12 );
  30. //if( $os_info == '' ) $os_info = $Labels->GetLabel('APP_IS_NOT_RUNING');
  31. $hw_info = $AP_DATA['hw_info']; //getServerProp( 13 );
  32. //if( $hw_info == '' ) $hw_info = $Labels->GetLabel('APP_IS_NOT_RUNING');
  33. $BASIC_CONTENT=<<<DATA_BOUNDARY
  34. {
  35. xtype: 'tabpanel',
  36. frame: false,
  37. id: 'node_settings_content',
  38. border: false,
  39. activeTab: {$T},
  40. items: [{
  41. xtype: 'panel',
  42. id: 'gi_tab',
  43. title: "{$Labels->GetLabel('_GENERAL_NFO_')}",
  44. layout: 'hbox',
  45. items:[{
  46. xtype: 'panel',
  47. flex: 1,
  48. height: PanelH-15,
  49. autoScroll: false,
  50. html: '<table width="100%" height="100%" border=0><tr><td height="290px" align="center" valign="middle"><div class="server_img_set"></div></td></tr><tr><td height="100px"><table width="100%" border=0><tr><td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut0_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut0_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut0_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue0">0</text><text x="50%" y="50%" class="chart-label">CPU</text></g></svg></td><td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut1_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut1_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut1_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue1">0</text><text x="50%" y="50%" class="chart-label">MEM</text></g></svg></td><td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut2_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut2_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut2_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue2">0</text><text x="50%" y="50%" class="chart-label">DISK</text></g></svg></td><td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut3_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut3_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut3_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue3">0</text><text x="50%" y="50%" class="chart-label">TEMP</text></g></svg></td></tr></table></td></tr><tr><td valign="top"><div class="setEd_infoPanel" id="INFO_SPS"><div class="sideInfo_item" id="SW_INFO">{$build}</div><div class="sideInfo_item" id="OS_INFO">{$os_info}</div><div class="sideInfo_item" id="HW_INFO">{$hw_info}</div></div></td></tr><tr><td height="60%">&nbsp;</td></tr></table>'
  51. },{
  52. xtype: 'panel',
  53. id: '_ed_small',
  54. flex: 1,
  55. height: PanelH-15,
  56. autoScroll: false,
  57. items:[ %%CTX_ACCESS_4%% %%CTX_ACCESS_5%% %%CTX_ACCESS_6%% ]
  58. }]
  59. } %%TAB_CTX%%% ],
  60. listeners:{
  61. tabchange: function( tp, t ){
  62. switch( t.getId() ){
  63. case 'gi_tab': {
  64. content_lvl3=0;
  65. serverStatusUpdater();
  66. break;
  67. };
  68. case 'res_tab': {
  69. //content_lvl3=1;
  70. stopStatusUpdater();
  71. //loadRessources();
  72. break;
  73. };
  74. case 'mod_tab':{
  75. //content_lvl3=2;
  76. stopStatusUpdater();
  77. //loadModules();
  78. break;
  79. };
  80. case 'flt_tab':{
  81. //content_lvl3=3;
  82. stopStatusUpdater();
  83. //loadFilters();
  84. break;
  85. };
  86. };
  87. updateUserContent();
  88. },
  89. afterrender: function(){
  90. settingsAreChanged = false;
  91. }
  92. },
  93. updateSettings: function(){
  94. alert('Update Settings');
  95. }
  96. }
  97. DATA_BOUNDARY;
  98. $MAIN_A_4=<<<DATA_BOUNDARY
  99. {
  100. xtype: 'panel',
  101. baseCls:'servopInfo_item00',
  102. id: 'servopPanel01',
  103. items:[{
  104. xtype: 'panel',
  105. frame: false,
  106. border: false,
  107. unstyled: true,
  108. html: "<p>{$Labels->GetLabel('_SERV_RESTART_DESC_')}</p><br/>"
  109. },{
  110. xtype: 'button',
  111. lazyRender: true,
  112. iconCls: 'srv_op_restart',
  113. text: "{$Labels->GetLabel('_SERV_RESTART_OP_')}",
  114. id: 'tbtn_sop01',
  115. scale: 'large',
  116. width: '95%',
  117. disabled: true,
  118. handler: function( bt ){
  119. Ext.Msg.show({
  120. title:"{$Labels->GetLabel('_SERV_RESTART_QT_')}",
  121. msg: "{$Labels->GetLabel('_SERV_RESTART_QM_')}",
  122. buttons: Ext.Msg.YESNO,
  123. width: 400,
  124. icon: Ext.MessageBox.INFO,
  125. fn: function(btn, text){
  126. if( btn == 'yes' ){
  127. disableServOps();
  128. doDeviceOperation( 1, 250,'', true );
  129. };
  130. }
  131. });
  132. }
  133. }]
  134. },{
  135. xtype: 'spacer',
  136. height: 8
  137. }
  138. DATA_BOUNDARY;
  139. $MAIN_A_5=<<<DATA_BOUNDARY
  140. ,{
  141. xtype: 'panel',
  142. baseCls:'servopInfo_item10',
  143. id: 'servopPanel02',
  144. items:[{
  145. xtype: 'panel',
  146. frame: false,
  147. border: false,
  148. unstyled: true,
  149. html: "<p>{$Labels->GetLabel('_SERV_HW_DET_DESC_')}</p><br/>"
  150. },{
  151. xtype: 'button',
  152. iconCls: 'srv_op_hw_init',
  153. text: "{$Labels->GetLabel('_SERV_HW_DET_OP_')}",
  154. id: 'tbtn_sop02',
  155. scale: 'large',
  156. width: '95%',
  157. disabled: true,
  158. handler: function( bt ){
  159. Ext.Msg.show({
  160. title:"{$Labels->GetLabel('_SERV_HW_DET_QT_')}",
  161. msg: "{$Labels->GetLabel('_SERV_HW_DET_QM_')}",
  162. buttons: Ext.Msg.YESNO,
  163. width: 400,
  164. icon: Ext.MessageBox.INFO,
  165. fn: function(btn, text){
  166. if( btn == 'yes' ){
  167. disableServOps();
  168. doDeviceOperation( 1, 251,'', true );
  169. };
  170. }
  171. });
  172. }
  173. }]
  174. },{
  175. xtype: 'spacer',
  176. height: 8
  177. }
  178. DATA_BOUNDARY;
  179. $MAIN_A_6=<<<DATA_BOUNDARY
  180. ,{
  181. xtype: 'panel',
  182. baseCls:'servopInfo_item20',
  183. id: 'servopPanel03',
  184. items:[{
  185. xtype: 'panel',
  186. frame: false,
  187. border: false,
  188. unstyled: true,
  189. html: "<p>{$Labels->GetLabel('_SERV_OSRESET_DESC_')}</p><br/>"
  190. },{
  191. xtype: 'button',
  192. iconCls: 'srv_op_power_cycle',
  193. text: "{$Labels->GetLabel('_SERV_OSRESET_OP_')}",
  194. id: 'tbtn_sop03',
  195. scale: 'large',
  196. width: '95%',
  197. disabled: true,
  198. handler: function( bt ){
  199. Ext.Msg.show({
  200. title: "{$Labels->GetLabel('_SERV_OSRESET_QT_')}",
  201. msg: "{$Labels->GetLabel('_SERV_OSRESET_QM_')}",
  202. buttons: Ext.Msg.YESNO,
  203. width: 400,
  204. icon: Ext.MessageBox.WARNING,
  205. fn: function(btn, text){
  206. if( btn == 'yes' ){
  207. cleanupChangeNotifier();
  208. } else {
  209. loadEditor = false;
  210. };
  211. }
  212. });
  213. }
  214. }]
  215. },{
  216. xtype: 'spacer',
  217. height: 8
  218. },{
  219. xtype: 'panel',
  220. baseCls:'servopInfo_item30',
  221. id: 'servopPanel04',
  222. items:[{
  223. xtype: 'panel',
  224. frame: false,
  225. border: false,
  226. unstyled: true,
  227. html: "<p>{$Labels->GetLabel('_SERV_FACTORY_DESC_')}</p><br/>"
  228. },{
  229. xtype: 'button',
  230. iconCls: 'srv_op_factory_reset',
  231. text: "{$Labels->GetLabel('_SERV_FACTORY_OP_')}",
  232. id: 'tbtn_sop04',
  233. scale: 'large',
  234. width: '95%',
  235. disabled: true,
  236. handler: function( bt ){
  237. Ext.Msg.show({
  238. title: "{$Labels->GetLabel('_SERV_FACTORY_QT_')}",
  239. msg: "{$Labels->GetLabel('_SERV_FACTORY_QM_')}",
  240. buttons: Ext.Msg.YESNO,
  241. width: 400,
  242. icon: Ext.MessageBox.ERROR,
  243. fn: function(btn, text){
  244. if( btn == 'yes' ){
  245. disableServOps();
  246. doDeviceOperation( 1, 254,'', true );
  247. };
  248. }
  249. });
  250. }
  251. }]
  252. }
  253. DATA_BOUNDARY;
  254. $TAB_CTX=<<<DATA_BOUNDARY
  255. ,{
  256. xtype: 'panel',
  257. title: "{$Labels->GetLabel( '_RESOURCES_' )}",
  258. id: 'res_tab',
  259. layout: 'hbox',
  260. items:[{
  261. xtype: 'panel',
  262. id: 'resources_container',
  263. flex: 1,
  264. height: PanelH-15,
  265. autoScroll: 'auto',
  266. tbar:[{
  267. text: "{$Labels->GetLabel( '_ADD_REMOTE_UART_' )}",
  268. handler: function(){} //addEthernet2Uart
  269. }],
  270. items:[]
  271. },{
  272. xtype: 'panel',
  273. id: 'res_ed_small',
  274. flex: 1,
  275. height: PanelH-15,
  276. layout: 'fit',
  277. items:[{
  278. html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
  279. }]
  280. }]
  281. },{
  282. xtype: 'panel',
  283. title: "{$Labels->GetLabel( '_SERVER_MODULES_' )}",
  284. id: 'mod_tab',
  285. layout: 'hbox',
  286. items:[{
  287. xtype: 'panel',
  288. id: 'modules_container',
  289. flex: 1,
  290. height: PanelH-15,
  291. autoScroll: 'auto',
  292. tbar:[{
  293. text: "{$Labels->GetLabel( '_ADD_MODULE_' )}",
  294. handler: addModule
  295. }],
  296. items:[]
  297. },{
  298. xtype: 'panel',
  299. id: 'mod_ed_small',
  300. flex: 1,
  301. height: PanelH-15,
  302. layout: 'fit',
  303. items:[{
  304. html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
  305. }]
  306. }]
  307. },{
  308. xtype: 'panel',
  309. title: "{$Labels->GetLabel( '_TARGET_FILTERS_' )}",
  310. id: 'flt_tab',
  311. layout: 'hbox',
  312. items:[{
  313. xtype: 'panel',
  314. id: 'filters_container',
  315. flex: 1,
  316. height: PanelH-15,
  317. autoScroll: 'auto',
  318. tbar:[{
  319. text: "{$Labels->GetLabel( '_ADD_FILTER_' )}",
  320. handler: addFilter
  321. }],
  322. items:[]
  323. },{
  324. xtype: 'panel',
  325. id: 'flt_ed_small',
  326. flex: 1,
  327. height: PanelH-15,
  328. layout: 'fit',
  329. items:[{
  330. html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
  331. }]
  332. }]
  333. }
  334. DATA_BOUNDARY;
  335. if( $CUser->Data['access'] < 6 ){
  336. $TAB_CTX = '';
  337. $MAIN_A_6 = '';
  338. if( $CUser->Data['access'] < 5 ){
  339. $MAIN_A_5 = '';
  340. if( $CUser->Data['access'] < 4 ){
  341. $MAIN_A_4 = '';
  342. };
  343. };
  344. };
  345. $Data['content'] = $BASIC_CONTENT;
  346. $Data['content'] = str_ireplace( '%%CTX_ACCESS_4%%', $MAIN_A_4, $Data['content'] );
  347. $Data['content'] = str_ireplace( '%%CTX_ACCESS_5%%', $MAIN_A_5, $Data['content'] );
  348. $Data['content'] = str_ireplace( '%%CTX_ACCESS_6%%', $MAIN_A_6, $Data['content'] );
  349. $Data['content'] = str_ireplace( '%%TAB_CTX%%%', $TAB_CTX, $Data['content'] );
  350. $Data['messages'] = ob_get_clean();
  351. } else {
  352. header('location: /');
  353. exit();
  354. };
  355. echo json_encode( $Data );
  356. ?>