|
|
<?php require_once('../ajax_asm.php'); $UID = intval( $CUser->Data['id'] ); $ACCESS = intval( $CUser->Data['access'] ); if( $UID > 1 ){ ob_start(); $QS="SELECT * FROM system_props LIMIT 1"; $RV = $DATABASE->Query( $QS ); if( count( $RV ) ){ $AP_DATA = $RV[0]; if( $AP_DATA['version_string'] == '' ) $AP_DATA['version_string'] = $Labels->GetLabel('APP_IS_NOT_RUNING'); if( $AP_DATA['hw_info'] == '' ) $AP_DATA['hw_info'] = $Labels->GetLabel('APP_IS_NOT_RUNING'); if( $AP_DATA['os_info'] == '' ) $AP_DATA['os_info'] = $Labels->GetLabel('APP_IS_NOT_RUNING'); } else { $AP_DATA = array( 'anchor_lat'=>0, 'anchor_lon'=>0, 'anchor_alt'=>0, 'type'=>0, 'version_string'=>$Labels->GetLabel('APP_IS_NOT_RUNING'), 'os_info'=>$Labels->GetLabel('APP_IS_NOT_RUNING'), 'hw_info'=>$Labels->GetLabel('APP_IS_NOT_RUNING') ); }; if(isset( $_POST['TYP'] )) $T = intval( $_POST['TYP'] ); else $T = 0; $build = $AP_DATA['version_string'];//getServerProp( 11 );
//if( $build == '' ) $build = $AP_DATA['version_string'];
//if( $build == '' ) $build = $Labels->GetLabel('APP_IS_NOT_RUNING');
$os_info = $AP_DATA['os_info'];//getServerProp( 12 );
//if( $os_info == '' ) $os_info = $Labels->GetLabel('APP_IS_NOT_RUNING');
$hw_info = $AP_DATA['hw_info']; //getServerProp( 13 );
//if( $hw_info == '' ) $hw_info = $Labels->GetLabel('APP_IS_NOT_RUNING');
$BASIC_CONTENT=<<<DATA_BOUNDARY{ xtype: 'tabpanel', frame: false, id: 'node_settings_content', border: false, activeTab: {$T}, items: [{ xtype: 'panel', id: 'gi_tab', title: "{$Labels->GetLabel('_GENERAL_NFO_')}", layout: 'hbox', items:[{ xtype: 'panel', flex: 1, height: PanelH-15, autoScroll: false, 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%"> </td></tr></table>' },{ xtype: 'panel', id: '_ed_small', flex: 1, height: PanelH-15, autoScroll: false, items:[ %%CTX_ACCESS_4%% %%CTX_ACCESS_5%% %%CTX_ACCESS_6%% ] }] } %%TAB_CTX%%% ], listeners:{ tabchange: function( tp, t ){ switch( t.getId() ){ case 'gi_tab': { contentView.l[3] = {v:0,p:''}; serverStatusUpdater(); break; }; case 'media_settings_tab': { stopStatusUpdater(); loadMediaSettings(); break; }; case 'application_settings_tab':{ stopStatusUpdater(); loadApplicationSettings(); break; }; case 'history_settings_tab':{ stopStatusUpdater(); loadHistorySettings(); break; }; }; updateUserContent(); }, afterrender: function(){ settingsAreChanged = false; } }, updateSettings: function(){ alert('Update Settings'); }} DATA_BOUNDARY; $MAIN_A_4=<<<DATA_BOUNDARY{ xtype: 'panel', baseCls:'servopInfo_item00', id: 'servopPanel01', items:[{ xtype: 'panel', frame: false, border: false, unstyled: true, html: "<p>{$Labels->GetLabel('_SERV_RESTART_DESC_')}</p><br/>" },{ xtype: 'button', lazyRender: true, iconCls: 'srv_op_restart', text: "{$Labels->GetLabel('_SERV_RESTART_OP_')}", id: 'tbtn_sop01', scale: 'large', width: '95%', disabled: true, handler: function( bt ){ Ext.Msg.show({ title:"{$Labels->GetLabel('_SERV_RESTART_QT_')}", msg: "{$Labels->GetLabel('_SERV_RESTART_QM_')}", buttons: Ext.Msg.YESNO, width: 400, icon: Ext.MessageBox.INFO, fn: function(btn, text){ if( btn == 'yes' ){ disableServOps(); doApplicationOperation( 1, 250,'', true ); }; } }); } }]},{ xtype: 'spacer', height: 8}DATA_BOUNDARY; $MAIN_A_5=<<<DATA_BOUNDARY,{ xtype: 'panel', baseCls:'servopInfo_item10', id: 'servopPanel02', items:[{ xtype: 'panel', frame: false, border: false, unstyled: true, html: "<p>{$Labels->GetLabel('_SERV_HW_DET_DESC_')}</p><br/>" },{ xtype: 'button', iconCls: 'srv_op_hw_init', text: "{$Labels->GetLabel('_SERV_HW_DET_OP_')}", id: 'tbtn_sop02', scale: 'large', width: '95%', disabled: true, handler: function( bt ){ Ext.Msg.show({ title:"{$Labels->GetLabel('_SERV_HW_DET_QT_')}", msg: "{$Labels->GetLabel('_SERV_HW_DET_QM_')}", buttons: Ext.Msg.YESNO, width: 400, icon: Ext.MessageBox.INFO, fn: function(btn, text){ if( btn == 'yes' ){ disableServOps(); doDeviceOperation( 1, 251,'', true ); }; } }); } }]},{ xtype: 'spacer', height: 8}DATA_BOUNDARY; $MAIN_A_6=<<<DATA_BOUNDARY,{ xtype: 'panel', baseCls:'servopInfo_item20', id: 'servopPanel03', items:[{ xtype: 'panel', frame: false, border: false, unstyled: true, html: "<p>{$Labels->GetLabel('_SERV_OSRESET_DESC_')}</p><br/>" },{ xtype: 'button', iconCls: 'srv_op_power_cycle', text: "{$Labels->GetLabel('_SERV_OSRESET_OP_')}", id: 'tbtn_sop03', scale: 'large', width: '95%', disabled: true, handler: function( bt ){ Ext.Msg.show({ title: "{$Labels->GetLabel('_SERV_OSRESET_QT_')}", msg: "{$Labels->GetLabel('_SERV_OSRESET_QM_')}", buttons: Ext.Msg.YESNO, width: 400, icon: Ext.MessageBox.WARNING, fn: function(btn, text){ if( btn == 'yes' ){ cleanupChangeNotifier(); } else { loadEditor = false; }; } }); } }]},{ xtype: 'spacer', height: 8},{ xtype: 'panel', baseCls:'servopInfo_item30', id: 'servopPanel04', items:[{ xtype: 'panel', frame: false, border: false, unstyled: true, html: "<p>{$Labels->GetLabel('_SERV_FACTORY_DESC_')}</p><br/>" },{ xtype: 'button', iconCls: 'srv_op_factory_reset', text: "{$Labels->GetLabel('_SERV_FACTORY_OP_')}", id: 'tbtn_sop04', scale: 'large', width: '95%', disabled: true, handler: function( bt ){ Ext.Msg.show({ title: "{$Labels->GetLabel('_SERV_FACTORY_QT_')}", msg: "{$Labels->GetLabel('_SERV_FACTORY_QM_')}", buttons: Ext.Msg.YESNO, width: 400, icon: Ext.MessageBox.ERROR, fn: function(btn, text){ if( btn == 'yes' ){ disableServOps(); doDeviceOperation( 1, 254,'', true ); }; } }); } }]}DATA_BOUNDARY; $TAB_CTX=<<<DATA_BOUNDARY,{ xtype: 'panel', id: 'media_settings_tab', title: "{$Labels->GetLabel( '_LBL_MEDIA_SETTINGS_' )}", layout: 'hbox', items:[{ xtype: 'panel', id: 'media_settings_container', flex: 1, height: PanelH-15, autoScroll: 'auto', items:[] },{ xtype: 'panel', id: 'encoder_op_small', flex: 1, height: PanelH-15, layout: 'fit', items:[{ html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>" }] }]},{ xtype: 'panel', title: "{$Labels->GetLabel( '_APPLICA_MNGMNT_' )}", id: 'application_settings_tab', layout: 'hbox', items:[{ xtype: 'panel', id: 'application_settings_container', flex: 1, height: PanelH-15, autoScroll: 'auto', items:[] },{ xtype: 'panel', id: 'application_op_small', flex: 1, height: PanelH-15, layout: 'fit', items:[{ html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>" }] }]},{ xtype: 'panel', title: "{$Labels->GetLabel( '_REPORT_STORAGE_' )}", id: 'history_settings_tab', layout: 'hbox', items:[{ xtype: 'panel', id: 'history_settings_container', flex: 1, height: PanelH-15, autoScroll: 'auto', items:[] },{ xtype: 'panel', id: 'history_op_small', flex: 1, height: PanelH-15, layout: 'fit', items:[{ html: "<div class='setEd_infoPanel' id='NUNU'>{$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_')}</div>" }] }]}DATA_BOUNDARY; if( $CUser->Data['access'] < 6 ){ $TAB_CTX = ''; $MAIN_A_6 = ''; if( $CUser->Data['access'] < 5 ){ $MAIN_A_5 = ''; if( $CUser->Data['access'] < 4 ){ $MAIN_A_4 = ''; }; }; }; $Data['content'] = $BASIC_CONTENT; $Data['content'] = str_ireplace( '%%CTX_ACCESS_4%%', $MAIN_A_4, $Data['content'] ); $Data['content'] = str_ireplace( '%%CTX_ACCESS_5%%', $MAIN_A_5, $Data['content'] ); $Data['content'] = str_ireplace( '%%CTX_ACCESS_6%%', $MAIN_A_6, $Data['content'] ); $Data['content'] = str_ireplace( '%%TAB_CTX%%%', $TAB_CTX, $Data['content'] ); $Data['messages'] = ob_get_clean(); } else { header('location: /'); exit(); }; echo json_encode( $Data );?>
|