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.

342 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. contentView.l[3] = {v:0,p:''};
  65. serverStatusUpdater();
  66. break;
  67. };
  68. case 'media_settings_tab': {
  69. stopStatusUpdater();
  70. loadMediaSettings();
  71. break;
  72. };
  73. case 'application_settings_tab':{
  74. stopStatusUpdater();
  75. loadApplicationSettings();
  76. break;
  77. };
  78. case 'history_settings_tab':{
  79. stopStatusUpdater();
  80. loadHistorySettings();
  81. break;
  82. };
  83. };
  84. updateUserContent();
  85. },
  86. afterrender: function(){
  87. settingsAreChanged = false;
  88. }
  89. },
  90. updateSettings: function(){
  91. alert('Update Settings');
  92. }
  93. }
  94. DATA_BOUNDARY;
  95. $MAIN_A_4=<<<DATA_BOUNDARY
  96. {
  97. xtype: 'panel',
  98. baseCls:'servopInfo_item00',
  99. id: 'servopPanel01',
  100. items:[{
  101. xtype: 'panel',
  102. frame: false,
  103. border: false,
  104. unstyled: true,
  105. html: "<p>{$Labels->GetLabel('_SERV_RESTART_DESC_')}</p><br/>"
  106. },{
  107. xtype: 'button',
  108. lazyRender: true,
  109. iconCls: 'srv_op_restart',
  110. text: "{$Labels->GetLabel('_SERV_RESTART_OP_')}",
  111. id: 'tbtn_sop01',
  112. scale: 'large',
  113. width: '95%',
  114. disabled: true,
  115. handler: function( bt ){
  116. Ext.Msg.show({
  117. title:"{$Labels->GetLabel('_SERV_RESTART_QT_')}",
  118. msg: "{$Labels->GetLabel('_SERV_RESTART_QM_')}",
  119. buttons: Ext.Msg.YESNO,
  120. width: 400,
  121. icon: Ext.MessageBox.INFO,
  122. fn: function(btn, text){
  123. if( btn == 'yes' ){
  124. disableServOps();
  125. doApplicationOperation( 1, 250,'', true );
  126. };
  127. }
  128. });
  129. }
  130. }]
  131. },{
  132. xtype: 'spacer',
  133. height: 8
  134. }
  135. DATA_BOUNDARY;
  136. $MAIN_A_5=<<<DATA_BOUNDARY
  137. ,{
  138. xtype: 'panel',
  139. baseCls:'servopInfo_item10',
  140. id: 'servopPanel02',
  141. items:[{
  142. xtype: 'panel',
  143. frame: false,
  144. border: false,
  145. unstyled: true,
  146. html: "<p>{$Labels->GetLabel('_SERV_HW_DET_DESC_')}</p><br/>"
  147. },{
  148. xtype: 'button',
  149. iconCls: 'srv_op_hw_init',
  150. text: "{$Labels->GetLabel('_SERV_HW_DET_OP_')}",
  151. id: 'tbtn_sop02',
  152. scale: 'large',
  153. width: '95%',
  154. disabled: true,
  155. handler: function( bt ){
  156. Ext.Msg.show({
  157. title:"{$Labels->GetLabel('_SERV_HW_DET_QT_')}",
  158. msg: "{$Labels->GetLabel('_SERV_HW_DET_QM_')}",
  159. buttons: Ext.Msg.YESNO,
  160. width: 400,
  161. icon: Ext.MessageBox.INFO,
  162. fn: function(btn, text){
  163. if( btn == 'yes' ){
  164. disableServOps();
  165. doDeviceOperation( 1, 251,'', true );
  166. };
  167. }
  168. });
  169. }
  170. }]
  171. },{
  172. xtype: 'spacer',
  173. height: 8
  174. }
  175. DATA_BOUNDARY;
  176. $MAIN_A_6=<<<DATA_BOUNDARY
  177. ,{
  178. xtype: 'panel',
  179. baseCls:'servopInfo_item20',
  180. id: 'servopPanel03',
  181. items:[{
  182. xtype: 'panel',
  183. frame: false,
  184. border: false,
  185. unstyled: true,
  186. html: "<p>{$Labels->GetLabel('_SERV_OSRESET_DESC_')}</p><br/>"
  187. },{
  188. xtype: 'button',
  189. iconCls: 'srv_op_power_cycle',
  190. text: "{$Labels->GetLabel('_SERV_OSRESET_OP_')}",
  191. id: 'tbtn_sop03',
  192. scale: 'large',
  193. width: '95%',
  194. disabled: true,
  195. handler: function( bt ){
  196. Ext.Msg.show({
  197. title: "{$Labels->GetLabel('_SERV_OSRESET_QT_')}",
  198. msg: "{$Labels->GetLabel('_SERV_OSRESET_QM_')}",
  199. buttons: Ext.Msg.YESNO,
  200. width: 400,
  201. icon: Ext.MessageBox.WARNING,
  202. fn: function(btn, text){
  203. if( btn == 'yes' ){
  204. cleanupChangeNotifier();
  205. } else {
  206. loadEditor = false;
  207. };
  208. }
  209. });
  210. }
  211. }]
  212. },{
  213. xtype: 'spacer',
  214. height: 8
  215. },{
  216. xtype: 'panel',
  217. baseCls:'servopInfo_item30',
  218. id: 'servopPanel04',
  219. items:[{
  220. xtype: 'panel',
  221. frame: false,
  222. border: false,
  223. unstyled: true,
  224. html: "<p>{$Labels->GetLabel('_SERV_FACTORY_DESC_')}</p><br/>"
  225. },{
  226. xtype: 'button',
  227. iconCls: 'srv_op_factory_reset',
  228. text: "{$Labels->GetLabel('_SERV_FACTORY_OP_')}",
  229. id: 'tbtn_sop04',
  230. scale: 'large',
  231. width: '95%',
  232. disabled: true,
  233. handler: function( bt ){
  234. Ext.Msg.show({
  235. title: "{$Labels->GetLabel('_SERV_FACTORY_QT_')}",
  236. msg: "{$Labels->GetLabel('_SERV_FACTORY_QM_')}",
  237. buttons: Ext.Msg.YESNO,
  238. width: 400,
  239. icon: Ext.MessageBox.ERROR,
  240. fn: function(btn, text){
  241. if( btn == 'yes' ){
  242. disableServOps();
  243. doDeviceOperation( 1, 254,'', true );
  244. };
  245. }
  246. });
  247. }
  248. }]
  249. }
  250. DATA_BOUNDARY;
  251. $TAB_CTX=<<<DATA_BOUNDARY
  252. ,{
  253. xtype: 'panel',
  254. id: 'media_settings_tab',
  255. title: "{$Labels->GetLabel( '_LBL_MEDIA_SETTINGS_' )}",
  256. layout: 'hbox',
  257. items:[{
  258. xtype: 'panel',
  259. id: 'media_settings_container',
  260. flex: 1,
  261. height: PanelH-15,
  262. autoScroll: 'auto',
  263. items:[]
  264. },{
  265. xtype: 'panel',
  266. id: 'encoder_op_small',
  267. flex: 1,
  268. height: PanelH-15,
  269. layout: 'fit',
  270. items:[{
  271. html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
  272. }]
  273. }]
  274. },{
  275. xtype: 'panel',
  276. title: "{$Labels->GetLabel( '_APPLICA_MNGMNT_' )}",
  277. id: 'application_settings_tab',
  278. layout: 'hbox',
  279. items:[{
  280. xtype: 'panel',
  281. id: 'application_settings_container',
  282. flex: 1,
  283. height: PanelH-15,
  284. autoScroll: 'auto',
  285. items:[]
  286. },{
  287. xtype: 'panel',
  288. id: 'application_op_small',
  289. flex: 1,
  290. height: PanelH-15,
  291. layout: 'fit',
  292. items:[{
  293. html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
  294. }]
  295. }]
  296. },{
  297. xtype: 'panel',
  298. title: "{$Labels->GetLabel( '_REPORT_STORAGE_' )}",
  299. id: 'history_settings_tab',
  300. layout: 'hbox',
  301. items:[{
  302. xtype: 'panel',
  303. id: 'history_settings_container',
  304. flex: 1,
  305. height: PanelH-15,
  306. autoScroll: 'auto',
  307. items:[]
  308. },{
  309. xtype: 'panel',
  310. id: 'history_op_small',
  311. flex: 1,
  312. height: PanelH-15,
  313. layout: 'fit',
  314. items:[{
  315. html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>"
  316. }]
  317. }]
  318. }
  319. DATA_BOUNDARY;
  320. if( $CUser->Data['access'] < 6 ){
  321. $TAB_CTX = '';
  322. $MAIN_A_6 = '';
  323. if( $CUser->Data['access'] < 5 ){
  324. $MAIN_A_5 = '';
  325. if( $CUser->Data['access'] < 4 ){
  326. $MAIN_A_4 = '';
  327. };
  328. };
  329. };
  330. $Data['content'] = $BASIC_CONTENT;
  331. $Data['content'] = str_ireplace( '%%CTX_ACCESS_4%%', $MAIN_A_4, $Data['content'] );
  332. $Data['content'] = str_ireplace( '%%CTX_ACCESS_5%%', $MAIN_A_5, $Data['content'] );
  333. $Data['content'] = str_ireplace( '%%CTX_ACCESS_6%%', $MAIN_A_6, $Data['content'] );
  334. $Data['content'] = str_ireplace( '%%TAB_CTX%%%', $TAB_CTX, $Data['content'] );
  335. $Data['messages'] = ob_get_clean();
  336. } else {
  337. header('location: /');
  338. exit();
  339. };
  340. echo json_encode( $Data );
  341. ?>