Merge pull request #317 from xmujay/20130505_monitor
server_status_monitor.php refactor, split long function into small ones:
This commit is contained in:
commit
d8a828199e
@ -467,78 +467,8 @@ exit;
|
||||
*/
|
||||
function getPrintMonitorHtml($ServerStatusData)
|
||||
{
|
||||
$retval = '<div class="tabLinks">';
|
||||
$retval .= '<a href="#pauseCharts">';
|
||||
$retval .= PMA_Util::getImage('play.png') . __('Start Monitor');
|
||||
$retval .= '</a>';
|
||||
$retval .= '<a href="#settingsPopup" class="popupLink">';
|
||||
$retval .= PMA_Util::getImage('s_cog.png') . __('Settings');
|
||||
$retval .= '</a>';
|
||||
if (! PMA_DRIZZLE) {
|
||||
$retval .= '<a href="#monitorInstructionsDialog">';
|
||||
$retval .= PMA_Util::getImage('b_help.png') . __('Instructions/Setup');
|
||||
}
|
||||
$retval .= '<a href="#endChartEditMode" style="display:none;">';
|
||||
$retval .= PMA_Util::getImage('s_okay.png');
|
||||
$retval .= __('Done rearranging/editing charts');
|
||||
$retval .= '</a>';
|
||||
$retval .= '</div>';
|
||||
|
||||
$retval .= '<div class="popupContent settingsPopup">';
|
||||
$retval .= '<a href="#addNewChart">';
|
||||
$retval .= PMA_Util::getImage('b_chart.png') . __('Add chart');
|
||||
$retval .= '</a>';
|
||||
//$retval .= '<a href="#rearrangeCharts">';
|
||||
//$retval .= PMA_Util::getImage('b_tblops.png') . __('Rearrange/edit charts');
|
||||
//$retval .= '</a>';
|
||||
$retval .= '<div class="clearfloat paddingtop"></div>';
|
||||
$retval .= '<div class="floatleft">';
|
||||
$retval .= __('Refresh rate') . '<br />';
|
||||
$retval .= PMA_getRefreshList(
|
||||
'gridChartRefresh',
|
||||
5,
|
||||
Array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200)
|
||||
);
|
||||
$retval .= '<br />';
|
||||
$retval .= '</div>';
|
||||
$retval .= '<div class="floatleft">';
|
||||
$retval .= __('Chart columns');
|
||||
$retval .= '<br />';
|
||||
$retval .= '<select name="chartColumns">';
|
||||
$retval .= '<option>1</option>';
|
||||
$retval .= '<option>2</option>';
|
||||
$retval .= '<option>3</option>';
|
||||
$retval .= '<option>4</option>';
|
||||
$retval .= '<option>5</option>';
|
||||
$retval .= '<option>6</option>';
|
||||
$retval .= '<option>7</option>';
|
||||
$retval .= '<option>8</option>';
|
||||
$retval .= '<option>9</option>';
|
||||
$retval .= '<option>10</option>';
|
||||
$retval .= '</select>';
|
||||
$retval .= '</div>';
|
||||
$retval .= '<div class="clearfloat paddingtop">';
|
||||
$retval .= '<b>' . __('Chart arrangement') . '</b> ';
|
||||
$retval .= PMA_Util::showHint(
|
||||
__(
|
||||
'The arrangement of the charts is stored to the browsers local storage. '
|
||||
. 'You may want to export it if you have a complicated set up.'
|
||||
)
|
||||
);
|
||||
$retval .= '<br/>';
|
||||
$retval .= '<a class="ajax" href="#importMonitorConfig">';
|
||||
$retval .= __('Import');
|
||||
$retval .= '</a>';
|
||||
$retval .= ' ';
|
||||
$retval .= '<a class="disableAjax" href="#exportMonitorConfig">';
|
||||
$retval .= __('Export');
|
||||
$retval .= '</a>';
|
||||
$retval .= ' ';
|
||||
$retval .= '<a href="#clearMonitorConfig">';
|
||||
$retval .= __('Reset to default');
|
||||
$retval .= '</a>';
|
||||
$retval .= '</div>';
|
||||
$retval .= '</div>';
|
||||
$retval = getTabLinksHtml();
|
||||
$retval .= getPopContentHtml();
|
||||
|
||||
$retval .= '<div id="monitorInstructionsDialog" title="';
|
||||
$retval .= __('Monitor Instructions') . '" style="display:none;">';
|
||||
@ -753,4 +683,101 @@ function PMA_getRefreshList($name,
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints html with Tab Links
|
||||
*
|
||||
* @param null
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getTabLinksHtml()
|
||||
{
|
||||
$retval = '<div class="tabLinks">';
|
||||
$retval .= '<a href="#pauseCharts">';
|
||||
$retval .= PMA_Util::getImage('play.png') . __('Start Monitor');
|
||||
$retval .= '</a>';
|
||||
$retval .= '<a href="#settingsPopup" class="popupLink">';
|
||||
$retval .= PMA_Util::getImage('s_cog.png') . __('Settings');
|
||||
$retval .= '</a>';
|
||||
if (! PMA_DRIZZLE) {
|
||||
$retval .= '<a href="#monitorInstructionsDialog">';
|
||||
$retval .= PMA_Util::getImage('b_help.png') . __('Instructions/Setup');
|
||||
}
|
||||
$retval .= '<a href="#endChartEditMode" style="display:none;">';
|
||||
$retval .= PMA_Util::getImage('s_okay.png');
|
||||
$retval .= __('Done rearranging/editing charts');
|
||||
$retval .= '</a>';
|
||||
$retval .= '</div>';
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints html with Pop Content
|
||||
*
|
||||
* @param null
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getPopContentHtml()
|
||||
{
|
||||
$retval = '<div class="popupContent settingsPopup">';
|
||||
$retval .= '<a href="#addNewChart">';
|
||||
$retval .= PMA_Util::getImage('b_chart.png') . __('Add chart');
|
||||
$retval .= '</a>';
|
||||
//$retval .= '<a href="#rearrangeCharts">';
|
||||
//$retval .= PMA_Util::getImage('b_tblops.png') . __('Rearrange/edit charts');
|
||||
//$retval .= '</a>';
|
||||
$retval .= '<div class="clearfloat paddingtop"></div>';
|
||||
$retval .= '<div class="floatleft">';
|
||||
$retval .= __('Refresh rate') . '<br />';
|
||||
$retval .= PMA_getRefreshList(
|
||||
'gridChartRefresh',
|
||||
5,
|
||||
Array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200)
|
||||
);
|
||||
$retval .= '<br />';
|
||||
$retval .= '</div>';
|
||||
$retval .= '<div class="floatleft">';
|
||||
$retval .= __('Chart columns');
|
||||
$retval .= '<br />';
|
||||
$retval .= '<select name="chartColumns">';
|
||||
$retval .= '<option>1</option>';
|
||||
$retval .= '<option>2</option>';
|
||||
$retval .= '<option>3</option>';
|
||||
$retval .= '<option>4</option>';
|
||||
$retval .= '<option>5</option>';
|
||||
$retval .= '<option>6</option>';
|
||||
$retval .= '<option>7</option>';
|
||||
$retval .= '<option>8</option>';
|
||||
$retval .= '<option>9</option>';
|
||||
$retval .= '<option>10</option>';
|
||||
$retval .= '</select>';
|
||||
$retval .= '</div>';
|
||||
$retval .= '<div class="clearfloat paddingtop">';
|
||||
$retval .= '<b>' . __('Chart arrangement') . '</b> ';
|
||||
$retval .= PMA_Util::showHint(
|
||||
__(
|
||||
'The arrangement of the charts is stored to the browsers local storage. '
|
||||
. 'You may want to export it if you have a complicated set up.'
|
||||
)
|
||||
);
|
||||
$retval .= '<br/>';
|
||||
$retval .= '<a class="ajax" href="#importMonitorConfig">';
|
||||
$retval .= __('Import');
|
||||
$retval .= '</a>';
|
||||
$retval .= ' ';
|
||||
$retval .= '<a class="disableAjax" href="#exportMonitorConfig">';
|
||||
$retval .= __('Export');
|
||||
$retval .= '</a>';
|
||||
$retval .= ' ';
|
||||
$retval .= '<a href="#clearMonitorConfig">';
|
||||
$retval .= __('Reset to default');
|
||||
$retval .= '</a>';
|
||||
$retval .= '</div>';
|
||||
$retval .= '</div>';
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user