Project

General

Profile

« Previous | Next » 

Revision 35c1ebd0

Added by Marcos M 8 months ago

Also show system aliases when listing all aliases

View differences:

src/usr/local/www/firewall_aliases.php
93 93

  
94 94
display_top_tabs($tab_array);
95 95

  
96
/* Show system aliases. */
97
if ($tab == 'all'):
98
	?>
99
	<div class="panel panel-default">
100
		<div class="panel-heading"><h2 class="panel-title"><?=gettext('System Aliases')?></h2></div>
101
		<div class="panel-body"><div class="table-responsive">
102
			<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
103
				<thead>
104
					<tr>
105
						<th><?=gettext("Name")?></th>
106
						<th><?=gettext("Type")?></th>
107
						<th><?=gettext("Description")?></th>
108
						<th><?=gettext("Values")?></th>
109
					</tr>
110
				</thead>
111
				<tbody>
112
	<?php
113
	$system_aliases = get_reserved_table_names();
114
	foreach ($system_aliases as $alias):
115
	?>
116
					<tr>
117
						<td>
118
							<?=htmlspecialchars($alias['name'])?>
119
						</td>
120
						<td>
121
							<?=htmlspecialchars($alias_types[$alias['type']])?>
122
						</td>
123
						<td>
124
							<?=htmlspecialchars($alias['descr'])?>&nbsp;
125
						</td>
126
						<td>
127
		<?php
128
		if ($alias["url"]) {
129
			echo htmlspecialchars($alias["url"]);
130
		} elseif (is_array($alias["aliasurl"])) {
131
			$aliasurls = implode(", ", array_slice($alias["aliasurl"], 0, 10));
132
			echo htmlspecialchars($aliasurls);
133
			if (is_array($aliasurls) && (count($aliasurls) > 10)) {
134
				echo "&hellip;";
135
			}
136
		} elseif (!empty($alias['address'])) {
137
			$tmpaddr = explode(" ", $alias['address']);
138
			if ($alias['type'] == 'host') {
139
				$tmpaddr = array_map('alias_idn_to_utf8', $tmpaddr);
140
			}
141
			echo htmlspecialchars(implode(", ", array_slice($tmpaddr, 0, 10)));
142
			if (count($tmpaddr) > 10) {
143
				echo '&hellip;';
144
			}
145
		} else {
146
			?>
147
							<span style="font-style:italic;"><?=gettext('Values set dynamically.')?>
148
			<?php
149
		}
150
		?>
151
						</td>
152
					</tr>
153
	<?php
154
	endforeach;
155
	?>
156
				</tbody>
157
			</table>
158
		</div></div>
159
	</div>
160
	<?
161
endif;
96 162
?>
97 163

  
98 164
<div class="panel panel-default">

Also available in: Unified diff