Browse Source

IPV6: Manual merge after update from upstream

web\templates\pages\list_web.php
asmcc 2 years ago
parent
commit
b518767076
1 changed files with 194 additions and 124 deletions
  1. 194 124
      web/templates/pages/list_web.php

+ 194 - 124
web/templates/pages/list_web.php

@@ -12,10 +12,10 @@
 			<div class="toolbar-sorting">
 				<button class="toolbar-sorting-toggle js-toggle-sorting-menu" type="button" title="<?= _("Sort items") ?>">
 					<?= _("Sort by") ?>:
-					<b>
+					<span class="u-text-bold">
 						<?php if ($_SESSION['userSortOrder'] === 'name') { $label = ('Name'); } else { $label = _('Date'); } ?>
 						<?=$label?> <i class="fas fa-arrow-down-a-z"></i>
-					</b>
+					</span>
 				</button>
 				<ul class="toolbar-sorting-menu animate__animated animate__fadeIn js-sorting-menu u-hidden">
 					<li data-entity="sort-bandwidth" data-sort-as-int="1">
@@ -66,197 +66,267 @@
 </div>
 <!-- End toolbar -->
 
-<div class="container units">
+<div class="container">
 
-	<!-- Table header -->
-	<div class="header units-header">
-		<div class="l-unit__col l-unit__col--right">
-			<div class="clearfix l-unit__stat-col--left super-compact">
+	<div class="units-table js-units-container">
+		<div class="units-table-header">
+			<div class="units-table-cell">
 				<input type="checkbox" class="js-toggle-all-checkbox" title="<?= _("Select all") ?>" <?= $display_mode ?>>
 			</div>
-			<div class="clearfix l-unit__stat-col--left wide-3"><b><?= _("Name") ?></b></div>
-			<div class="clearfix l-unit__stat-col--left compact-4 u-text-right"><b>&nbsp;</b></div>
-			<div class="clearfix l-unit__stat-col--left u-text-center"><b><?= _("IPV4 address") ?></b></div>
-			<div class="clearfix l-unit__stat-col--left u-text-center"><b><?= _("IPV6 address") ?></b></div>
-			<div class="clearfix l-unit__stat-col--left u-text-center"><b><?= _("Disk") ?></b></div>
-			<div class="clearfix l-unit__stat-col--left u-text-center compact"><b><?= _("Bandwidth") ?></b></div>
-			<div class="clearfix l-unit__stat-col--left u-text-center"><b><?= _("SSL") ?></b></div>
-			<div class="clearfix l-unit__stat-col--left u-text-center compact"><b><?= _("Statistics") ?></b></div>
+			<div class="units-table-cell"><?= _("Name") ?></div>
+			<div class="units-table-cell"></div>
+			<div class="units-table-cell"><?= _("IPV4 Address") ?></div>
+			<div class="units-table-cell"><?= _("IPV6 Address") ?></div>
+			<div class="units-table-cell"><?= _("Disk") ?></div>
+			<div class="units-table-cell"><?= _("Bandwidth") ?></div>
+			<div class="units-table-cell"><?= _("SSL") ?></div>
+			<div class="units-table-cell"><?= _("Statistics") ?></div>
 		</div>
-	</div>
 
-	<!-- Begin web domain list item loop -->
-	<?php
-		foreach ($data as $key => $value) {
+		<!-- Begin web domain list item loop -->
+		<?php
+			foreach ($data as $key => $value) {
 				++$i;
 				if ($data[$key]['SUSPENDED'] == 'yes') {
-						$status = 'suspended';
-						$spnd_action = 'unsuspend';
-						$spnd_action_title = _('Unsuspend');
-						$spnd_icon = 'fa-play';
-						$spnd_confirmation = _('Are you sure you want to unsuspend domain %s?');
+					$status = 'suspended';
+					$spnd_action = 'unsuspend';
+					$spnd_action_title = _('Unsuspend');
+					$spnd_icon = 'fa-play';
+					$spnd_icon_class = 'icon-green';
+					$spnd_confirmation = _('Are you sure you want to unsuspend domain %s?');
 				} else {
-						$status = 'active';
-						$spnd_action = 'suspend';
-						$spnd_action_title = _('Suspend');
-						$spnd_icon = 'fa-pause';
-						$spnd_confirmation = _('Are you sure you want to suspend domain %s?');
+					$status = 'active';
+					$spnd_action = 'suspend';
+					$spnd_action_title = _('Suspend');
+					$spnd_icon = 'fa-pause';
+					$spnd_icon_class = 'icon-highlight';
+					$spnd_confirmation = _('Are you sure you want to suspend domain %s?');
 				}
 				if (!empty($data[$key]['SSL_HOME'])) {
-						if ($data[$key]['SSL_HOME'] == 'same') {
-								$ssl_home = 'public_html';
-						} else {
-								$ssl_home = 'public_shtml';
-						}
+					if ($data[$key]['SSL_HOME'] == 'same') {
+						$ssl_home = 'public_html';
+					} else {
+						$ssl_home = 'public_shtml';
+					}
 				} else {
-						$ssl_home = '';
+					$ssl_home = '';
 				}
 				$web_stats='no';
 				if (!empty($data[$key]['STATS'])) {
-						$web_stats=$data[$key]['STATS'];
+					$web_stats=$data[$key]['STATS'];
 				}
 				$ftp_user='no';
 				if (!empty($data[$key]['FTP_USER'])) {
-						$ftp_user=$data[$key]['FTP_USER'];
-
+					$ftp_user=$data[$key]['FTP_USER'];
 				}
 				if (strlen($ftp_user) > 24 ) {
-						$ftp_user = str_replace(':', ', ', $ftp_user);
-						$ftp_user = substr($ftp_user, 0, 24);
-						$ftp_user = trim($ftp_user, ":");
-						$ftp_user = str_replace(':', ', ', $ftp_user);
-						$ftp_user = $ftp_user.", ...";
+					$ftp_user = str_replace(':', ', ', $ftp_user);
+					$ftp_user = substr($ftp_user, 0, 24);
+					$ftp_user = trim($ftp_user, ":");
+					$ftp_user = str_replace(':', ', ', $ftp_user);
+					$ftp_user = $ftp_user.", ...";
 				} else {
-						$ftp_user = str_replace(':', ', ', $ftp_user);
+					$ftp_user = str_replace(':', ', ', $ftp_user);
 				}
 
 				$backend_support='no';
 				if (!empty($data[$key]['BACKEND'])) {
-						$backend_support='yes';
+					$backend_support='yes';
 				}
 
 				$proxy_support='no';
 				if (!empty($data[$key]['PROXY'])) {
-						$proxy_support='yes';
+					$proxy_support='yes';
 				}
 				if (strlen($data[$key]['PROXY_EXT']) > 24 ) {
-						$proxy_ext_title = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
-						$proxy_ext = substr($data[$key]['PROXY_EXT'], 0, 24);
-						$proxy_ext = trim($proxy_ext, ",");
-						$proxy_ext = str_replace(',', ', ', $proxy_ext);
-						$proxy_ext = $proxy_ext.", ...";
+					$proxy_ext_title = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
+					$proxy_ext = substr($data[$key]['PROXY_EXT'], 0, 24);
+					$proxy_ext = trim($proxy_ext, ",");
+					$proxy_ext = str_replace(',', ', ', $proxy_ext);
+					$proxy_ext = $proxy_ext.", ...";
 				} else {
-						$proxy_ext_title = '';
-						$proxy_ext = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
+					$proxy_ext_title = '';
+					$proxy_ext = str_replace(',', ', ', $data[$key]['PROXY_EXT']);
 				}
 				if ($data[$key]['SUSPENDED'] === 'yes') {
 					if ($data[$key]['SSL'] == 'no') {
 						$icon_ssl = 'fas fa-circle-xmark';
+						$title_ssl = _('Disabled');
 					}
 					if ($data[$key]['SSL'] == 'yes') {
 						$icon_ssl = 'fas fa-circle-check';
+						$title_ssl = _('Enabled');
 					}
 					if ($web_stats == 'no') {
 						$icon_webstats = 'fas fa-circle-xmark';
+						$title_webstats = _('Disabled');
 					} else {
 						$icon_webstats = 'fas fa-circle-check';
+						$title_webstats = _('Enabled');
 					}
 				} else {
 					if ($data[$key]['SSL'] == 'no') {
 						$icon_ssl = 'fas fa-circle-xmark icon-red';
+						$title_ssl = _('Disabled');
 					}
 					if ($data[$key]['SSL'] == 'yes') {
 						$icon_ssl = 'fas fa-circle-check icon-green';
+						$title_ssl = _('Enabled');
 					}
 					if ($web_stats == 'no') {
 						$icon_webstats = 'fas fa-circle-xmark icon-red';
+						$title_webstats = _('Disabled');
 					} else {
 						$icon_webstats = 'fas fa-circle-check icon-green';
+						$title_webstats = _('Enabled');
 					}
 				}
 			?>
-			<div class="l-unit <?php if ($data[$key]['SUSPENDED'] == 'yes') echo 'l-unit--suspended'; ?> animate__animated animate__fadeIn js-unit"
+			<div class="units-table-row <?php if ($data[$key]['SUSPENDED'] == 'yes') echo 'disabled'; ?> animate__animated animate__fadeIn js-unit"
 				data-sort-ip="<?=str_replace('.', '', $data[$key]['IP'])?>"
 				data-sort-date="<?=strtotime($data[$key]['DATE'].' '.$data[$key]['TIME'])?>"
 				data-sort-name="<?=$key?>"
 				data-sort-bandwidth="<?=$data[$key]['U_BANDWIDTH']?>"
 				data-sort-disk="<?=$data[$key]['U_DISK']?>">
-				<div class="l-unit__col l-unit__col--right">
-					<div class="clearfix l-unit__stat-col--left super-compact">
-						<input id="check<?=$i?>" class="js-unit-checkbox" type="checkbox" title="<?= _("Select") ?>" name="domain[]" value="<?=$key?>" <?=$display_mode;?>>
+				<div class="units-table-cell">
+					<div>
+						<input id="check<?= $i ?>" class="js-unit-checkbox" type="checkbox" title="<?= _("Select") ?>" name="domain[]" value="<?= $key ?>" <?= $display_mode ?>>
+						<label for="check<?= $i ?>" class="u-hide-desktop"><?= _("Select") ?></label>
 					</div>
-					<div class="clearfix l-unit__stat-col--left wide-3 truncate">
-						<b>
-							<?php if ($read_only === 'true') {?>
-								<?=$key?>
-							<?php } else {
-								$aliases = explode(',', $data[$key]['ALIAS']);
-								$alias_new = array();
-								foreach($aliases as $alias){
-									if($alias != 'www.'.$key){
-										$alias_new[] = trim($alias);
-									}
-								}
-								?>
-								<a href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?= _("Edit Domain") ?>: <?=$key?>"><?=$key?><?php if( !empty($alias_new) && !empty($data[$key]['ALIAS']) ){ echo " <span class=\"hint\">(".implode(',',$alias_new).")"; } ?></a>
+				</div>
+				<div class="units-table-cell u-text-bold">
+					<span class="u-hide-desktop"><?= _("Name") ?>:</span>
+					<?php if ($read_only === 'true') {?>
+						<?=$key?>
+					<?php } else {
+						$aliases = explode(',', $data[$key]['ALIAS']);
+						$alias_new = array();
+						foreach($aliases as $alias){
+							if($alias != 'www.'.$key){
+								$alias_new[] = trim($alias);
+							}
+						}
+						?>
+						<a href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?= _("Edit Domain") ?>: <?=$key?>">
+							<?= $key ?>
+							<?php if (!empty($alias_new) && !empty($data[$key]['ALIAS'])) {
+								echo " <span class=\"hint\">(".implode(',',$alias_new).")";
+							} ?>
+						</a>
+					<?php } ?>
+				</div>
+				<div class="units-table-cell">
+					<ul class="units-table-row-actions">
+						<?php if (!empty($data[$key]['STATS'])) { ?>
+							<li class="units-table-row-action shortcut-w" data-key-action="href">
+								<a
+									class="units-table-row-action-link"
+									href="http://<?=$key?>/vstats/"
+									target="_blank"
+									rel="noopener"
+									title="<?= _("Statistics") ?>"
+								>
+									<i class="fas fa-chart-bar icon-maroon"></i>
+									<span class="u-hide-desktop"><?= _("Statistics") ?></span>
+								</a>
+							</li>
+						<?php } ?>
+						<li class="units-table-row-action" data-key-action="href">
+							<a
+								class="units-table-row-action-link"
+								href="http://<?=$key?>/"
+								target="_blank"
+								rel="noopener"
+								title="<?= _("Visit") ?>"
+							>
+								<i class="fas fa-square-up-right icon-lightblue"></i>
+								<span class="u-hide-desktop"><?= _("Visit") ?></span>
+							</a>
+						</li>
+						<?php if ($read_only !== "true") { ?>
+							<?php if ($data[$key]['SUSPENDED'] == 'no') { ?>
+								<li class="units-table-row-action shortcut-enter" data-key-action="href">
+									<a
+										class="units-table-row-action-link"
+										href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>"
+										title="<?= _("Edit Domain") ?>"
+									>
+										<i class="fas fa-pencil icon-orange"></i>
+										<span class="u-hide-desktop"><?= _("Edit Domain") ?></span>
+									</a>
+								</li>
 							<?php } ?>
-						</b>
-					</div>
-					<!-- START QUICK ACTION TOOLBAR AREA -->
-					<div class="clearfix l-unit__stat-col--left compact-4 u-text-right">
-						<div class="l-unit-toolbar__col l-unit-toolbar__col--right u-noselect">
-							<div class="actions-panel clearfix">
-								<?php if (!empty($data[$key]['STATS'])) { ?>
-									<div class="actions-panel__col actions-panel__logs shortcut-w" data-key-action="href"><a href="http://<?=$key?>/vstats/" rel="noopener" target="_blank" rel="noopener" title="<?= _("Statistics") ?>"><i class="fas fa-chart-bar icon-maroon icon-dim"></i></a></div>
-								<?php } ?>
-									<div class="actions-panel__col actions-panel__view" data-key-action="href"><a href="http://<?=$key?>/" rel="noopener" target="_blank"><i class="fas fa-square-up-right icon-lightblue icon-dim"></i></a></div>
-								<?php if ($read_only === 'true') {?>
-									<!-- Restrict ability to edit, delete, or suspend web domains when impersonating the 'admin' account -->
-									&nbsp;
-								<?php } else { ?>
-									<?php if ($data[$key]['SUSPENDED'] == 'no') {?>
-										<div class="actions-panel__col actions-panel__edit shortcut-enter" data-key-action="href"><a href="/edit/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?= _("Edit Domain") ?>"><i class="fas fa-pencil icon-orange icon-dim"></i></a></div>
-									<?php } ?>
-									<div class="actions-panel__col actions-panel__logs shortcut-l" data-key-action="href"><a href="/list/web-log/?domain=<?=$key?>&type=access#" title="<?= _("Access Log") ?>"><i class="fas fa-binoculars icon-purple icon-dim"></i></a></div>
-									<div class="actions-panel__col actions-panel__suspend shortcut-s" data-key-action="js">
-										<a
-											class="data-controls js-confirm-action"
-											href="/<?=$spnd_action?>/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>"
-											data-confirm-title="<?= $spnd_action_title ?>"
-											data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
-										>
-											<i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i>
-										</a>
-									</div>
-									<div class="actions-panel__col actions-panel__delete shortcut-delete" data-key-action="js">
-										<a
-											class="data-controls js-confirm-action"
-											href="/delete/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>"
-											data-confirm-title="<?= _("Delete") ?>"
-											data-confirm-message="<?= sprintf(_('Are you sure you want to delete domain %s?'), $key) ?>"
-										>
-											<i class="fas fa-trash icon-red icon-dim"></i>
-										</a>
-									</div>
-								<?php } ?>
-							</div>
-						</div>
-					</div>
-					<!-- END QUICK ACTION TOOLBAR AREA -->
-					<div class="clearfix l-unit__stat-col--left u-text-center"><?=empty($ips[$data[$key]['IP']]['NAT']) ? (empty($data[$key]['IP']) ? "&nbsp;" : $data[$key]['IP']) : "{$ips[$data[$key]['IP']]['NAT']}"; ?></div>
-					<div class="clearfix l-unit__stat-col--left u-text-center"><?=empty($ips[$data[$key]['IP6']]) ? "&nbsp;" : $data[$key]['IP6']; ?></div>
-					<div class="clearfix l-unit__stat-col--left u-text-center"><b><?=humanize_usage_size($data[$key]['U_DISK'])?></b> <span class="u-text-small"><?=humanize_usage_measure($data[$key]['U_DISK'])?></span></div>
-					<div class="clearfix l-unit__stat-col--left u-text-center compact"><b><?=humanize_usage_size($data[$key]['U_BANDWIDTH'])?></b> <span class="u-text-small"><?=humanize_usage_measure($data[$key]['U_BANDWIDTH'])?></span></div>
-					<div class="clearfix l-unit__stat-col--left u-text-center">
-						<i class="fas <?=$icon_ssl;?>"></i>
-					</div>
-					<div class="clearfix l-unit__stat-col--left u-text-center compact">
-						<i class="fas <?=$icon_webstats;?>"></i>
-					</div>
+							<li class="units-table-row-action shortcut-l" data-key-action="href">
+								<a
+									class="units-table-row-action-link"
+									href="/list/web-log/?domain=<?=$key?>&type=access#"
+									title="<?= _("Access Log") ?>"
+								>
+									<i class="fas fa-binoculars icon-purple"></i>
+									<span class="u-hide-desktop"><?= _("Access Log") ?></span>
+								</a>
+							</li>
+							<li class="units-table-row-action shortcut-s" data-key-action="js">
+								<a
+									class="units-table-row-action-link data-controls js-confirm-action"
+									href="/<?= $spnd_action ?>/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>"
+									title="<?= $spnd_action_title ?>"
+									data-confirm-title="<?= $spnd_action_title ?>"
+									data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
+								>
+									<i class="fas <?= $spnd_icon ?> <?= $spnd_icon_class ?>"></i>
+									<span class="u-hide-desktop"><?= $spnd_action_title ?></span>
+								</a>
+							</li>
+							<li class="units-table-row-action shortcut-delete" data-key-action="js">
+								<a
+									class="units-table-row-action-link data-controls js-confirm-action"
+									href="/delete/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>"
+									title="<?= _("Delete") ?>"
+									data-confirm-title="<?= _("Delete") ?>"
+									data-confirm-message="<?= sprintf(_('Are you sure you want to delete domain %s?'), $key) ?>"
+								>
+									<i class="fas fa-trash icon-red"></i>
+									<span class="u-hide-desktop"><?= _("Delete") ?></span>
+								</a>
+							</li>
+						<?php } ?>
+					</ul>
+				</div>
+				<div class="units-table-cell">
+					<span class="u-hide-desktop u-text-bold"><?= _("IP Address") ?>:</span>
+					<?= empty($ips[$data[$key]['IP']]['NAT']) ? $data[$key]['IP'] : "{$ips[$data[$key]['IP']]['NAT']}"; ?>
+				</div>
+				<div class="units-table-cell">
+					<span class="u-hide-desktop u-text-bold"><?= _("Disk") ?>:</span>
+					<span class="u-text-bold">
+						<?= humanize_usage_size($data[$key]['U_DISK']) ?>
+					</span>
+					<span class="u-text-small">
+						<?= humanize_usage_measure($data[$key]['U_DISK']) ?>
+					</span>
+				</div>
+				<div class="units-table-cell">
+					<span class="u-hide-desktop u-text-bold"><?= _("Bandwidth") ?>:</span>
+					<span class="u-text-bold">
+						<?= humanize_usage_size($data[$key]['U_BANDWIDTH']) ?>
+					</span>
+					<span class="u-text-small">
+						<?= humanize_usage_measure($data[$key]['U_BANDWIDTH']) ?>
+					</span>
+				</div>
+				<div class="units-table-cell">
+					<span class="u-hide-desktop u-text-bold"><?= _("SSL") ?>:</span>
+					<i class="fas <?= $icon_ssl ?>" title="<?= $title_ssl ?>"></i>
+				</div>
+				<div class="units-table-cell">
+					<span class="u-hide-desktop u-text-bold"><?= _("Statistics") ?>:</span>
+					<i class="fas <?= $icon_webstats ?>" title="<?= $title_webstats ?>"></i>
 				</div>
 			</div>
 		<?php } ?>
 	</div>
+
 </div>
 
 <footer class="app-footer">