Skip to content

Commit 4c68662

Browse files
author
Kristan Kenney
committed
Refactor HTML code
Corrected indents, incorrect form tags, removed un-necessary comments
1 parent 2bbf70e commit 4c68662

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+752
-908
lines changed

web/templates/admin/add_db.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
</div>
1010
</div>
1111
<div class="l-separator"></div>
12-
<!-- /.l-separator -->
1312

1413
<div class="l-center animated fadeIn">
1514
<?php
@@ -160,7 +159,6 @@
160159
<option value=armscii8 <?php if ((!empty($v_charset)) && ( $v_charset == 'armscii8')) echo 'selected';?> >armscii8</option>
161160
<option value=utf8 <?php if ((!empty($v_charset)) && ( $v_charset == 'utf8')) echo 'selected';?> <?php if (empty($v_charset)) echo 'selected';?> >utf8</option>
162161
<option value=utf8mb4 <?php if ((!empty($v_charset)) && ( $v_charset == 'utf8mb4')) echo 'selected';?> >utf8mb4</option>
163-
164162
<option value=ucs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'ucs2')) echo 'selected';?> >ucs2</option>
165163
<option value=cp866 <?php if ((!empty($v_charset)) && ( $v_charset == 'cp866')) echo 'selected';?> >cp866</option>
166164
<option value=keybcs2 <?php if ((!empty($v_charset)) && ( $v_charset == 'keybcs2')) echo 'selected';?> >keybcs2</option>
@@ -197,6 +195,6 @@
197195
</div>
198196

199197
<script>
200-
GLOBAL.DB_USER_PREFIX = <?=json_encode($user.'_')?>;
201-
GLOBAL.DB_DBNAME_PREFIX = <?=json_encode($user.'_')?>;
198+
GLOBAL.DB_USER_PREFIX = <?=json_encode($user.'_')?>;
199+
GLOBAL.DB_DBNAME_PREFIX = <?=json_encode($user.'_')?>;
202200
</script>

web/templates/admin/add_dns.html

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
</div>
1111

1212
<div class="l-separator"></div>
13-
<!-- /.l-separator -->
1413

1514
<div class="l-center animated fadeIn">
1615
<?php
@@ -126,66 +125,64 @@
126125
<span class="remove-ns additional-control delete"><?=__('delete')?></span>
127126
</td>
128127
</tr>
129-
<? if($v_ns3)
128+
<? if($v_ns3)
130129
echo '<tr>
131-
<td>
132-
<input type="text" size="20" class="vst-input" name="v_ns3" value="'.htmlentities(trim($v_ns3, "'")).'">
133-
<span class="remove-ns additional-control delete">'.__('delete').'</span>
134-
</td>
135-
</tr>';
130+
<td>
131+
<input type="text" size="20" class="vst-input" name="v_ns3" value="'.htmlentities(trim($v_ns3, "'")).'">
132+
<span class="remove-ns additional-control delete">'.__('delete').'</span>
133+
</td>
134+
</tr>';
136135

137-
if($v_ns4)
138-
echo '<tr>
139-
<td>
140-
<input type="text" size="20" class="vst-input" name="v_ns4" value="'.htmlentities(trim($v_ns4, "'")).'">
141-
<span class="remove-ns additional-control delete">'.__('delete').'</span>
142-
</td>
143-
</tr>';
136+
if($v_ns4)
137+
echo '<tr>
138+
<td>
139+
<input type="text" size="20" class="vst-input" name="v_ns4" value="'.htmlentities(trim($v_ns4, "'")).'">
140+
<span class="remove-ns additional-control delete">'.__('delete').'</span>
141+
</td>
142+
</tr>';
144143

145-
if($v_ns5)
146-
echo '<tr>
147-
<td>
148-
<input type="text" size="20" class="vst-input" name="v_ns5" value="'.htmlentities(trim($v_ns5, "'")).'">
149-
<span class="remove-ns additional-control delete">'.__('delete').'</span>
150-
</td>
151-
</tr>';
144+
if($v_ns5)
145+
echo '<tr>
146+
<td>
147+
<input type="text" size="20" class="vst-input" name="v_ns5" value="'.htmlentities(trim($v_ns5, "'")).'">
148+
<span class="remove-ns additional-control delete">'.__('delete').'</span>
149+
</td>
150+
</tr>';
152151

153-
if($v_ns6)
154-
echo '<tr>
155-
<td>
156-
<input type="text" size="20" class="vst-input" name="v_ns6" value="'.htmlentities(trim($v_ns6, "'")).'">
157-
<span class="remove-ns additional-control delete">'.__('delete').'</span>
158-
</td>
159-
</tr>';
152+
if($v_ns6)
153+
echo '<tr>
154+
<td>
155+
<input type="text" size="20" class="vst-input" name="v_ns6" value="'.htmlentities(trim($v_ns6, "'")).'">
156+
<span class="remove-ns additional-control delete">'.__('delete').'</span>
157+
</td>
158+
</tr>';
160159

161-
if($v_ns7)
162-
echo '<tr>
163-
<td>
164-
<input type="text" size="20" class="vst-input" name="v_ns7" value="'.htmlentities(trim($v_ns7, "'")).'">
165-
<span class="remove-ns additional-control delete">'.__('delete').'</span>
166-
</td>
167-
</tr>';
160+
if($v_ns7)
161+
echo '<tr>
162+
<td>
163+
<input type="text" size="20" class="vst-input" name="v_ns7" value="'.htmlentities(trim($v_ns7, "'")).'">
164+
<span class="remove-ns additional-control delete">'.__('delete').'</span>
165+
</td>
166+
</tr>';
168167

169-
if($v_ns8)
170-
echo '<tr>
171-
<td>
172-
<input type="text" size="20" class="vst-input" name="v_ns8" value="'.htmlentities(trim($v_ns8, "'")).'">
173-
<span class="remove-ns additional-control delete">'.__('delete').'</span>
174-
</td>
175-
</tr>';
176-
?>
168+
if($v_ns8)
169+
echo '<tr>
170+
<td>
171+
<input type="text" size="20" class="vst-input" name="v_ns8" value="'.htmlentities(trim($v_ns8, "'")).'">
172+
<span class="remove-ns additional-control delete">'.__('delete').'</span>
173+
</td>
174+
</tr>';
175+
?>
177176
<tr class="add-ns" <? if($v_ns8) echo 'style="display:none;"'; ?> >
178177
<td class="step-top-small">
179178
<span class="add-ns-button additional-control add"><?=__('Add one more Name Server')?></span>
180179
</td>
181180
</tr>
182-
183181
</table>
184182
</td>
185183
</tr>
186184
</table>
187-
<table class="data-col2">
188-
</table>
185+
<table class="data-col2"></table>
189186
</td>
190187
</tr>
191188
</table>

web/templates/admin/add_dns_rec.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
</div>
1111

1212
<div class="l-separator"></div>
13-
<!-- /.l-separator -->
1413

1514
<div class="l-center animated fadeIn">
1615

@@ -140,5 +139,5 @@
140139
</div>
141140

142141
<script>
143-
GLOBAL.DNS_REC_PREFIX = <?=json_encode($_GET['domain'])?>;
142+
GLOBAL.DNS_REC_PREFIX = <?=json_encode($_GET['domain'])?>;
144143
</script>

web/templates/admin/add_firewall.html

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
</div>
1111

1212
<div class="l-separator"></div>
13-
<!-- /.l-separator -->
1413

1514
<div class="l-center animated fadeIn">
1615
<?php
@@ -79,8 +78,6 @@
7978
</select>
8079
</td>
8180
</tr>
82-
83-
8481
<tr>
8582
<td class="vst-text input-label">
8683
<?php print __('Port');?> <span class="optional">(<?php print __('ranges are acceptable');?>)</span>
@@ -114,15 +111,12 @@
114111
<input type="text" size="20" class="vst-input" name="v_comment" maxlength="255" value="<?=htmlentities(trim($v_comment, "'"))?>">
115112
</td>
116113
</tr>
117-
118-
</table>
119-
<table class="data-col2">
120114
</table>
115+
<table class="data-col2"></table>
121116
</td>
122117
</tr>
123118
</table>
124-
</from>
125-
119+
</form>
126120
</div>
127121

128122
<script>

web/templates/admin/add_firewall_banlist.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
</div>
1111

1212
<div class="l-separator"></div>
13-
<!-- /.l-separator -->
1413

1514
<div class="l-center animated fadeIn">
1615
<?php
@@ -88,5 +87,5 @@
8887
</td>
8988
</tr>
9089
</table>
91-
</from>
90+
</form>
9291
</div>

web/templates/admin/add_firewall_ipset.html

Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
</div>
1111

1212
<div class="l-separator"></div>
13-
<!-- /.l-separator -->
1413

1514
<div class="l-center animated fadeIn">
1615
<?php
@@ -101,91 +100,91 @@
101100
</select>
102101
</td>
103102
</tr>
104-
105-
</table>
106-
<table class="data-col2">
107103
</table>
104+
<table class="data-col2"></table>
108105
</td>
109106
</tr>
110107
</table>
111108
</form>
112-
113109
</div>
114110

115111
<script>
116-
var country_iplists = [
117-
{name: "[ipv4] Country Romania", source:"http://ipverse.net/ipblocks/data/countries/ro.zone"},
118-
{name: "[ipv4] Country Germany", source:"http://ipverse.net/ipblocks/data/countries/de.zone"},
119-
{name: "[ipv4] Country Switzerland", source:"http://ipverse.net/ipblocks/data/countries/ch.zone"},
120-
{name: "[ipv4] Country France", source:"http://ipverse.net/ipblocks/data/countries/fr.zone"},
121-
{name: "[ipv4] Country Ukraine", source:"http://ipverse.net/ipblocks/data/countries/ua.zone"},
122-
{name: "[ipv4] Country Russia", source:"http://ipverse.net/ipblocks/data/countries/ru.zone"},
123-
{name: "[ipv4] Country Spain", source:"http://ipverse.net/ipblocks/data/countries/es.zone"},
124-
{name: "[ipv4] Country United Kingdom", source:"http://ipverse.net/ipblocks/data/countries/gb.zone"},
125-
{name: "[ipv4] Country United States", source:"http://ipverse.net/ipblocks/data/countries/us.zone"},
126-
{name: "[ipv4] Country China", source:"http://ipverse.net/ipblocks/data/countries/cn.zone"},
127-
{name: "[ipv4] Country India", source:"http://ipverse.net/ipblocks/data/countries/in.zone"},
128-
{name: "[ipv4] Country Canada", source:"http://ipverse.net/ipblocks/data/countries/ca.zone"},
129-
{name: "[ipv4] Country Netherlands", source:"http://ipverse.net/ipblocks/data/countries/nl.zone"},
130-
/*
131-
{name: "[ipv6] Country Romania", source:"http://ipverse.net/ipblocks/data/countries/ro-ipv6.zone"},
132-
{name: "[ipv6] Country Germany", source:"http://ipverse.net/ipblocks/data/countries/de-ipv6.zone"},
133-
{name: "[ipv6] Country Switzerland", source:"http://ipverse.net/ipblocks/data/countries/ch-ipv6.zone"},
134-
{name: "[ipv6] Country France", source:"http://ipverse.net/ipblocks/data/countries/fr-ipv6.zone"},
135-
{name: "[ipv6] Country Ukraine", source:"http://ipverse.net/ipblocks/data/countries/ua-ipv6.zone"},
136-
{name: "[ipv6] Country Russia", source:"http://ipverse.net/ipblocks/data/countries/ru-ipv6.zone"},
137-
{name: "[ipv6] Country Spain", source:"http://ipverse.net/ipblocks/data/countries/es-ipv6.zone"},
138-
{name: "[ipv6] Country United Kingdom", source:"http://ipverse.net/ipblocks/data/countries/gb-ipv6.zone"},
139-
{name: "[ipv6] Country United States", source:"http://ipverse.net/ipblocks/data/countries/us-ipv6.zone"},
140-
{name: "[ipv6] Country China", source:"http://ipverse.net/ipblocks/data/countries/cn-ipv6.zone"},
141-
{name: "[ipv6] Country India", source:"http://ipverse.net/ipblocks/data/countries/in-ipv6.zone"},
142-
{name: "[ipv6] Country Canada", source:"http://ipverse.net/ipblocks/data/countries/ca-ipv6.zone"},
143-
{name: "[ipv6] Country Netherlands", source:"http://ipverse.net/ipblocks/data/countries/nl-ipv6.zone"},
144-
*/
145-
];
112+
var country_iplists = [
113+
// Define IPv4 country lists
114+
{name: "[IPv4] Country - Canada", source:"http://ipverse.net/ipblocks/data/countries/ca.zone"},
115+
{name: "[IPv4] Country - China", source:"http://ipverse.net/ipblocks/data/countries/cn.zone"},
116+
{name: "[IPv4] Country - France", source:"http://ipverse.net/ipblocks/data/countries/fr.zone"},
117+
{name: "[IPv4] Country - Germany", source:"http://ipverse.net/ipblocks/data/countries/de.zone"},
118+
{name: "[IPv4] Country - India", source:"http://ipverse.net/ipblocks/data/countries/in.zone"},
119+
{name: "[IPv4] Country - Netherlands", source:"http://ipverse.net/ipblocks/data/countries/nl.zone"},
120+
{name: "[IPv4] Country - Romania", source:"http://ipverse.net/ipblocks/data/countries/ro.zone"},
121+
{name: "[IPv4] Country - Russia", source:"http://ipverse.net/ipblocks/data/countries/ru.zone"},
122+
{name: "[IPv4] Country - Spain", source:"http://ipverse.net/ipblocks/data/countries/es.zone"},
123+
{name: "[IPv4] Country - Switzerland", source:"http://ipverse.net/ipblocks/data/countries/ch.zone"},
124+
{name: "[IPv4] Country - Ukraine", source:"http://ipverse.net/ipblocks/data/countries/ua.zone"},
125+
{name: "[IPv4] Country - United Kingdom", source:"http://ipverse.net/ipblocks/data/countries/gb.zone"},
126+
{name: "[IPv4] Country - United States", source:"http://ipverse.net/ipblocks/data/countries/us.zone"},
146127

147-
var blacklist_iplists = [
148-
{name: "[ipv4] Blacklist Script", source:"script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.sh"},
149-
/*
150-
{name: "[ipv6] Blacklist Script", source:"script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.ipv6.sh"},
151-
*/
152-
];
128+
// Define IPv6 country lists
129+
/*
130+
{name: "[IPv6] Country - China", source:"http://ipverse.net/ipblocks/data/countries/cn-ipv6.zone"},
131+
{name: "[IPv6] Country - Canada", source:"http://ipverse.net/ipblocks/data/countries/ca-ipv6.zone"},
132+
{name: "[IPv6] Country - France", source:"http://ipverse.net/ipblocks/data/countries/fr-ipv6.zone"},
133+
{name: "[IPv6] Country - Germany", source:"http://ipverse.net/ipblocks/data/countries/de-ipv6.zone"},
134+
{name: "[IPv6] Country - India", source:"http://ipverse.net/ipblocks/data/countries/in-ipv6.zone"},
135+
{name: "[IPv6] Country - Netherlands", source:"http://ipverse.net/ipblocks/data/countries/nl-ipv6.zone"},
136+
{name: "[IPv6] Country - Romania", source:"http://ipverse.net/ipblocks/data/countries/ro-ipv6.zone"},
137+
{name: "[IPv6] Country - Russia", source:"http://ipverse.net/ipblocks/data/countries/ru-ipv6.zone"},
138+
{name: "[IPv6] Country - Spain", source:"http://ipverse.net/ipblocks/data/countries/es-ipv6.zone"},
139+
{name: "[IPv6] Country - Switzerland", source:"http://ipverse.net/ipblocks/data/countries/ch-ipv6.zone"},
140+
{name: "[IPv6] Country - Ukraine", source:"http://ipverse.net/ipblocks/data/countries/ua-ipv6.zone"},
141+
{name: "[IPv6] Country - United Kingdom", source:"http://ipverse.net/ipblocks/data/countries/gb-ipv6.zone"},
142+
{name: "[IPv6] Country - United States", source:"http://ipverse.net/ipblocks/data/countries/us-ipv6.zone"},
143+
*/
144+
];
153145

154-
country_iplists.sort(function (a, b) {
155-
return a.name > b.name;
156-
});
146+
var blacklist_iplists = [
147+
{name: "[IPv4] Block Malicious IPs", source:"script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.sh"},
148+
/*
149+
{name: "[IPv6] Block Malicious IPs", source:"script:/usr/local/hestia/install/deb/firewall/ipset/blacklist.ipv6.sh"},
150+
*/
151+
];
157152

158-
blacklist_iplists.sort(function (a, b) {
159-
return a.name > b.name;
160-
});
153+
country_iplists.sort(function (a, b) {
154+
return a.name > b.name;
155+
});
161156

162-
$(function() {
163-
var targetelement = document.getElementById('datasource_list');
157+
blacklist_iplists.sort(function (a, b) {
158+
return a.name > b.name;
159+
});
164160

165-
// Blacklist
166-
var newEl = document.createElement("option");
167-
newEl.text="<?php print __('BLACKLIST') ?>";
168-
newEl.disabled=true;
169-
targetelement.appendChild(newEl);
161+
$(function() {
162+
var targetelement = document.getElementById('datasource_list');
170163

171-
blacklist_iplists.forEach(iplist => {
164+
// Blacklist
172165
var newEl = document.createElement("option");
173-
newEl.text=iplist.name;
174-
newEl.value=iplist.source;
166+
newEl.text="<?php print __('BLACKLIST') ?>";
167+
newEl.disabled=true;
175168
targetelement.appendChild(newEl);
176-
});
177169

178-
// IPVERSE
179-
var newEl = document.createElement("option");
180-
newEl.text="<?php print __('IPVERSE') ?>";
181-
newEl.disabled=true;
182-
targetelement.appendChild(newEl);
170+
blacklist_iplists.forEach(iplist => {
171+
var newEl = document.createElement("option");
172+
newEl.text=iplist.name;
173+
newEl.value=iplist.source;
174+
targetelement.appendChild(newEl);
175+
});
183176

184-
country_iplists.forEach(iplist => {
177+
// IPVERSE
185178
var newEl = document.createElement("option");
186-
newEl.text=iplist.name;
187-
newEl.value=iplist.source;
179+
newEl.text="<?php print __('IPVERSE') ?>";
180+
newEl.disabled=true;
188181
targetelement.appendChild(newEl);
182+
183+
country_iplists.forEach(iplist => {
184+
var newEl = document.createElement("option");
185+
newEl.text=iplist.name;
186+
newEl.value=iplist.source;
187+
targetelement.appendChild(newEl);
188+
});
189189
});
190-
});
191190
</script>

0 commit comments

Comments
 (0)