responsive

This commit is contained in:
Roland Gruber 2019-09-27 17:16:16 +02:00
parent 302acfa2d9
commit 807925d9a7
2 changed files with 31 additions and 38 deletions

View File

@ -453,12 +453,13 @@ class quota extends baseModule {
* @return htmlElement HTML meta data * @return htmlElement HTML meta data
*/ */
function display_html_attributes() { function display_html_attributes() {
$return = new htmlTable(); $return = new htmlResponsiveRow();
$return->setCSSClasses(array('maxrow'));
try { try {
$this->initQuotas(); $this->initQuotas();
} }
catch (LAMException $e) { catch (LAMException $e) {
$return->addElement(new htmlStatusMessage('ERROR', $e->getTitle(), $e->getMessage())); $return->add(new htmlStatusMessage('ERROR', $e->getTitle(), $e->getMessage()), 12);
return $return; return $return;
} }
if (!is_array($this->quota)) { if (!is_array($this->quota)) {
@ -481,55 +482,47 @@ class quota extends baseModule {
if (isset($serverDescriptions[$server])) { if (isset($serverDescriptions[$server])) {
$title = $serverDescriptions[$server] . " (" . $server . ")"; $title = $serverDescriptions[$server] . " (" . $server . ")";
} }
$return->addElement(new htmlSubTitle($title), true); $return->add(new htmlSubTitle($title), 12);
$return->addElement(new htmlOutputText(' ' . _('Mountpoint') . ' ', false));
$return->addElement(new htmlOutputText(' ' . _('Used blocks') . ' ', false)); $titles = array(
$return->addElement(new htmlOutputText(' ' . _('Soft block limit') . ' ', false)); _('Mountpoint'), _('Used blocks'), _('Soft block limit'), _('Hard block limit'), _('Grace block period'),
$return->addElement(new htmlOutputText(' ' . _('Hard block limit') . ' ', false)); _('Used inodes'), _('Soft inode limit'), _('Hard inode limit'), _('Grace inode period')
$return->addElement(new htmlOutputText(' ' . _('Grace block period') . ' ', false)); );
$return->addElement(new htmlOutputText(' ' . _('Used inodes') . ' ', false)); $data = array(
$return->addElement(new htmlOutputText(' ' . _('Soft inode limit') . ' ', false)); array(
$return->addElement(new htmlOutputText(' ' . _('Hard inode limit') . ' ', false)); new htmlHelpLink('Mountpoint'), new htmlHelpLink('UsedBlocks'), new htmlHelpLink('SoftBlockLimit'),
$return->addElement(new htmlOutputText(' ' . _('Grace inode period') . ' ', false)); new htmlHelpLink('HardBlockLimit'), new htmlHelpLink('GraceBlockPeriod'), new htmlHelpLink('UsedInodes'),
$return->addNewLine(); new htmlHelpLink('SoftInodeLimit'), new htmlHelpLink('HardInodeLimit'), new htmlHelpLink('GraceInodePeriod')
$return->addElement(new htmlHelpLink('Mountpoint')); )
$return->addElement(new htmlHelpLink('UsedBlocks')); );
$return->addElement(new htmlHelpLink('SoftBlockLimit'));
$return->addElement(new htmlHelpLink('HardBlockLimit'));
$return->addElement(new htmlHelpLink('GraceBlockPeriod'));
$return->addElement(new htmlHelpLink('UsedInodes'));
$return->addElement(new htmlHelpLink('SoftInodeLimit'));
$return->addElement(new htmlHelpLink('HardInodeLimit'));
$return->addElement(new htmlHelpLink('GraceInodePeriod'));
$return->addNewLine();
$i=0; $i=0;
// loop for every mointpoint with enabled quotas // loop for every mointpoint with enabled quotas
while (isset($this->quota[$server][$i][0])) { while (isset($this->quota[$server][$i][0])) {
$return->addElement(new htmlOutputText($this->quota[$server][$i][0])); $dataRow = array();
$return->addElement(new htmlOutputText($this->quota[$server][$i][1])); $dataRow[] = new htmlOutputText($this->quota[$server][$i][0]);
$dataRow[] = new htmlOutputText($this->quota[$server][$i][1]);
$sbLimitInput = new htmlInputField($i . '_2_' . $id, $this->quota[$server][$i][2]); $sbLimitInput = new htmlInputField($i . '_2_' . $id, $this->quota[$server][$i][2]);
$sbLimitInput->setFieldSize(12);
$sbLimitInput->setFieldMaxLength(20); $sbLimitInput->setFieldMaxLength(20);
$return->addElement($sbLimitInput); $dataRow[] = $sbLimitInput;
$hbLimit = new htmlInputField($i . '_3_' . $id, $this->quota[$server][$i][3]); $hbLimit = new htmlInputField($i . '_3_' . $id, $this->quota[$server][$i][3]);
$hbLimit->setFieldSize(12);
$hbLimit->setFieldMaxLength(20); $hbLimit->setFieldMaxLength(20);
$return->addElement($hbLimit); $dataRow[] = $hbLimit;
$return->addElement(new htmlOutputText($this->quota[$server][$i][4])); $dataRow[] = new htmlOutputText($this->quota[$server][$i][4]);
$return->addElement(new htmlOutputText($this->quota[$server][$i][5])); $dataRow[] = new htmlOutputText($this->quota[$server][$i][5]);
$siLimit = new htmlInputField($i . '_6_' . $id, $this->quota[$server][$i][6]); $siLimit = new htmlInputField($i . '_6_' . $id, $this->quota[$server][$i][6]);
$siLimit->setFieldMaxLength(20); $siLimit->setFieldMaxLength(20);
$siLimit->setFieldSize(12); $dataRow[] = $siLimit;
$return->addElement($siLimit);
$hiLimit = new htmlInputField($i . '_7_' . $id, $this->quota[$server][$i][7]); $hiLimit = new htmlInputField($i . '_7_' . $id, $this->quota[$server][$i][7]);
$hiLimit->setFieldMaxLength(20); $hiLimit->setFieldMaxLength(20);
$hiLimit->setFieldSize(12); $dataRow[] = $hiLimit;
$return->addElement($hiLimit); $dataRow[] = new htmlOutputText($this->quota[$server][$i][8]);
$return->addElement(new htmlOutputText($this->quota[$server][$i][8])); $data[] = $dataRow;
$return->addNewLine();
$i++; $i++;
} }
$table = new htmlResponsiveTable($titles, $data);
$table->setWidths(array('20%', '5%', '10%', '10%', '5%', '5%', '10%', '10%', '5%'));
$return->add($table, 12);
} }
return $return; return $return;
} }

View File

@ -71,7 +71,7 @@ table.padding5 td {
} }
.maxrow { .maxrow {
max-width: none; max-width: none !important;
} }
.module-content-row>.row { .module-content-row>.row {