Merge branch 'develop' of https://github.com/pandorafms/pandorafms into develop

This commit is contained in:
Alejandro Gallardo Escobar 2015-07-03 12:45:45 +02:00
commit c0320fd160
8 changed files with 51 additions and 46 deletions

View File

@ -20,36 +20,37 @@ $FREEP = floor($FREEP);
my $freemem=`cat /proc/meminfo | grep 'MemFree' | awk '{ print \$2 } '`;
my $cached=`cat /proc/meminfo | grep '^Cached:' | awk '{ print \$2 } '`;
my $cachedswap=`cat /proc/meminfo | grep '^SwapCached:' | awk '{ print \$2 }'`;
my $total_meminfo=`cat /proc/meminfo | grep 'MemTotal:' | awk '{ print \$2 }'`;
my $available=$freemem+$cached+$cachedwap;
my $available_percent = floor(($available / $TOTAL)*100);
my $available_percent = floor(($available / $total_meminfo)*100);
print "<module>\n";
print "<name>FreeMemory</name>\n";
print "<type>generic_data</type>\n";
print "<description>Free memory %. Note most linux use 99% of available memory by default, check Availablememory module for more accurate information on available physical memory on system</description>\n";
print "<unit>%</unit>\n";
print "<min_critical>0</min_critical>\n";
print "<max_critical>2</max_critical>\n";
print "<data>$FREEP</data>\n";
print "<name><![CDATA[FreeMemory]]></name>\n";
print "<type><![CDATA[generic_data]]></type>\n";
print "<description><![CDATA[Free memory %. Note most linux use 99% of available memory by default, check Availablememory module for more accurate information on available physical memory on system]]></description>\n";
print "<unit><![CDATA[%]]></unit>\n";
print "<min_critical><![CDATA[0]]></min_critical>\n";
print "<max_critical><![CDATA[2]]></max_critical>\n";
print "<data><![CDATA[$FREEP]]></data>\n";
print "</module>\n";
print "<module>\n";
print "<name>FreeSwap</name>\n";
print "<type>generic_data</type>\n";
print "<description>Free Swap %</description>\n";
print "<unit>%</unit>\n";
print "<min_critical>0</min_critical>\n";
print "<max_critical>5</max_critical>\n";
print "<data>$SFREE</data>\n";
print "<name><![CDATA[FreeSwap]]></name>\n";
print "<type><![CDATA[generic_data]]></type>\n";
print "<description><![CDATA[Free Swap %]]></description>\n";
print "<unit><![CDATA[%]]></unit>\n";
print "<min_critical><![CDATA[0]]></min_critical>\n";
print "<max_critical><![CDATA[5]]></max_critical>\n";
print "<data><![CDATA[$SFREE]]></data>\n";
print "</module>\n";
print "<module>\n";
print "<name>AvailableMemory</name>\n";
print "<type>generic_data</type>\n";
print "<description>Available Physical Memory % (Free+Cached+CachedSwap)</description>\n";
print "<unit>%</unit>\n";
print "<min_critical>0</min_critical>\n";
print "<max_critical>10</max_critical>\n";
print "<data>$available_percent</data>\n";
print "<name><![CDATA[AvailableMemory]]></name>\n";
print "<type><![CDATA[generic_data]]></type>\n";
print "<description><![CDATA[Available Physical Memory % (Free+Cached+CachedSwap)]]></description>\n";
print "<unit><![CDATA[%]]></unit>\n";
print "<min_critical><![CDATA[0]]></min_critical>\n";
print "<max_critical><![CDATA[10]]></max_critical>\n";
print "<data><![CDATA[$available_percent]]></data>\n";
print "</module>\n";

View File

@ -311,7 +311,10 @@ if (check_acl ($config['id_user'], 0, "PM")) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions';
if ($extmenu["name"] == 'Cron jobs')
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'extensions';
else
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions';
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["extension"] = true;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["enterprise"] = $extension['enterprise'];
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;

View File

@ -228,7 +228,7 @@ if (isset($data)) {
echo "<form method='post' action='index.php?sec=".$sec."&sec2=godmode/modules/manage_nc_groups'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table ($table);
echo "<div style='padding-bottom: 10px; text-align: right; width:" . $table->width . "'>";
echo "<div style='padding-left: 10px; float: right;'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo "</div>";
echo "</form>";
@ -239,7 +239,7 @@ else {
echo '<form method="post">';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<div class="" style="float:right">';
html_print_input_hidden ('new', 1);
html_print_submit_button (__('Create'), 'crt', false, 'class="sub next"');
echo '</div>';

View File

@ -603,7 +603,7 @@ if (isset($data)) {
"&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure=".$pure."'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table ($table);
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
echo "<div style='float: right; margin-left: 5px;'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo "</div>";
echo "</form>";
@ -613,7 +613,7 @@ else {
}
echo '<form method="post" action="' . $url . '">';
echo '<div class="action-buttons" style="width: ' . $table->width . '">';
echo '<div class="" style="float:right;">';
html_print_input_hidden ('new_component', 1);
html_print_select (array(
2 => __('Create a new network component'),

View File

@ -214,7 +214,7 @@ if (!empty ($table->data)) {
echo '<form method="post" action="index.php?sec=gmodules&amp;sec2=godmode/modules/manage_network_templates">';
html_print_input_hidden('multiple_delete', 1);
html_print_table ($table);
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
echo "<div style='padding-left: 5px; float: right; '>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo "</div>";
echo "</form>";
@ -224,7 +224,7 @@ else {
}
echo '<form method="post" action="index.php?sec=gmodules&amp;sec2=godmode/modules/manage_network_templates_form">';
echo '<div style="width: '.$table->width.'" class="action-buttons">';
echo '<div style="float:right;" class="">';
html_print_submit_button (__('Create'), "crt", '', 'class="sub next"');
echo '</div></form>';

View File

@ -264,14 +264,15 @@ if (($create != "") OR ($view != "")) {
$table->colspan['plugin_desc'][1] = 3;
$table->data['plugin_desc'] = $data;
if (!defined("METACONSOLE")) {
echo '<br>';
echo '<table class="databox" style="margin: 0 auto; width: 100%;"><tr><td>';
}
//if (!defined("METACONSOLE")) {
//echo '<br>';
//echo '<table class="databox" style="margin: 0 auto; width: 100%;"><tr><td>';
//}
$table->width = '100%';
$table->class = 'databox filters';
if (defined("METACONSOLE")) {
$table->width = '100%';
$table->class = 'databox data';
$table->head[0] = __('General');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
@ -279,7 +280,7 @@ if (($create != "") OR ($view != "")) {
html_print_table($table);
}
else {
echo '<fieldset style="width:96%"><legend>' . __('General') . '</legend>';
echo '<fieldset><legend>' . __('General') . '</legend>';
html_print_table($table);
echo '</fieldset>';
}
@ -332,9 +333,9 @@ if (($create != "") OR ($view != "")) {
$data[1] = '<div id="command_preview" style="font-style:italic"></div>';
$table->data['plugin_preview'] = $data;
$table->width = '100%';
$table->class = 'databox filters';
if (defined("METACONSOLE")) {
$table->width = '100%';
$table->class = 'databox data';
$table->head[0] = __('Command');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
@ -342,7 +343,7 @@ if (($create != "") OR ($view != "")) {
html_print_table($table);
}
else {
echo '<fieldset style="width:96%"><legend>' . __('Command') . '</legend>';
echo '<fieldset><legend>' . __('Command') . '</legend>';
html_print_table($table);
echo '</fieldset>';
}
@ -481,16 +482,14 @@ if (($create != "") OR ($view != "")) {
html_print_table($table);
}
else {
echo '<fieldset style="width:96%">' .
echo '<fieldset>' .
'<legend>' . __('Parameters macros') .ui_print_help_icon ('macros', true) . '</legend>';
html_print_table($table);
echo '</fieldset>';
}
if (defined("METACONSOLE"))
echo '<table width="100%">';
else
echo '<table width="98%">';
echo '<table width="100%">';
echo '<tr><td align="right">';
if ($create != "") {
@ -505,8 +504,6 @@ if (($create != "") OR ($view != "")) {
if (defined("METACONSOLE"))
echo '</td></tr>';
else
echo '</td></tr></table>';
enterprise_hook('close_meta_frame');
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 471 B

View File

@ -3017,6 +3017,10 @@ table#policy_modules td * {
vertical-align: middle;
}
.databox.data td>input[type="checkbox"] {
margin: 0px;
}
.databox_color td{
padding-left: 10px;
}