Revision 1c5142d2
Added by Carlos Eduardo Ramos about 15 years ago
usr/local/www/load_balancer_pool_edit.php | ||
---|---|---|
60 | 60 |
$pconfig['monitor'] = $a_pool[$id]['monitor']; |
61 | 61 |
} |
62 | 62 |
|
63 |
$changedesc = "Load Balancer: Pool: ";
|
|
63 |
$changedesc = gettext("Load Balancer: Pool:") . " ";
|
|
64 | 64 |
$changecount = 0; |
65 | 65 |
|
66 | 66 |
if ($_POST) { |
... | ... | |
71 | 71 |
|
72 | 72 |
/* input validation */ |
73 | 73 |
$reqdfields = explode(" ", "name port monitor servers"); |
74 |
$reqdfieldsn = explode(",", "Name,Port,Monitor,Server List");
|
|
74 |
$reqdfieldsn = array(gettext("Name"),gettext("Port"),gettext("Monitor"),gettext("Server List"));
|
|
75 | 75 |
|
76 | 76 |
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); |
77 | 77 |
|
78 | 78 |
/* Ensure that our pool names are unique */ |
79 | 79 |
for ($i=0; isset($config['load_balancer']['lbpool'][$i]); $i++) |
80 | 80 |
if (($_POST['name'] == $config['load_balancer']['lbpool'][$i]['name']) && ($i != $id)) |
81 |
$input_errors[] = "This pool name has already been used. Pool names must be unique.";
|
|
81 |
$input_errors[] = gettext("This pool name has already been used. Pool names must be unique.");
|
|
82 | 82 |
if (!is_port($_POST['port'])) |
83 |
$input_errors[] = "The port must be an integer between 1 and 65535.";
|
|
83 |
$input_errors[] = gettext("The port must be an integer between 1 and 65535.");
|
|
84 | 84 |
if (is_array($_POST['servers'])) { |
85 | 85 |
foreach($pconfig['servers'] as $svrent) { |
86 | 86 |
if (!is_ipaddr($svrent)) { |
87 |
$input_errors[] = "{$svrent} is not a valid IP address (in \"enabled\" list).";
|
|
87 |
$input_errors[] = sprintf(gettext("%s is not a valid IP address (in \"enabled\" list)."), $svrent);
|
|
88 | 88 |
} |
89 | 89 |
} |
90 | 90 |
} |
91 | 91 |
if (is_array($_POST['serversdisabled'])) { |
92 | 92 |
foreach($pconfig['serversdisabled'] as $svrent) { |
93 | 93 |
if (!is_ipaddr($svrent)) { |
94 |
$input_errors[] = "{$svrent} is not a valid IP address (in \"disabled\" list).";
|
|
94 |
$input_errors[] = sprintf(gettext("%s is not a valid IP address (in \"disabled\" list)."), $svrent);
|
|
95 | 95 |
} |
96 | 96 |
} |
97 | 97 |
} |
... | ... | |
100 | 100 |
$m[$config['load_balancer']['monitor_type'][$i]['name']] = $config['load_balancer']['monitor_type'][$i]; |
101 | 101 |
|
102 | 102 |
if (!isset($m[$_POST['monitor']])) |
103 |
$input_errors[] = "Invalid monitor chosen.";
|
|
103 |
$input_errors[] = gettext("Invalid monitor chosen.");
|
|
104 | 104 |
|
105 | 105 |
if (!$input_errors) { |
106 | 106 |
$poolent = array(); |
107 | 107 |
if(isset($id) && $a_pool[$id]) |
108 | 108 |
$poolent = $a_pool[$id]; |
109 | 109 |
if($poolent['name'] != "") |
110 |
$changedesc .= " modified '{$poolent['name']}' pool:";
|
|
110 |
$changedesc .= sprintf(gettext(" modified '%s' pool:"), $poolent['name']);
|
|
111 | 111 |
|
112 | 112 |
update_if_changed("name", $poolent['name'], $_POST['name']); |
113 | 113 |
update_if_changed("description", $poolent['desc'], $_POST['desc']); |
... | ... | |
137 | 137 |
} |
138 | 138 |
} |
139 | 139 |
|
140 |
$pgtitle = array("Services", "Load Balancer","Pool","Edit");
|
|
140 |
$pgtitle = array(gettext("Services"), gettext("Load Balancer"),gettext("Pool"),gettext("Edit"));
|
|
141 | 141 |
#$statusurl = "status_lb_vs.php"; |
142 | 142 |
$statusurl = "status_lb_pool.php"; |
143 | 143 |
$logurl = "diag_logs_relayd.php"; |
... | ... | |
162 | 162 |
<form action="load_balancer_pool_edit.php" method="post" name="iform" id="iform"> |
163 | 163 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
164 | 164 |
<tr> |
165 |
<td colspan="2" valign="top" class="listtopic">Add/edit Load Balancer - Pool entry</td>
|
|
165 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("Add/edit Load Balancer - Pool entry"); ?></td>
|
|
166 | 166 |
</tr> |
167 | 167 |
<tr align="left"> |
168 |
<td width="22%" valign="top" class="vncellreq">Name</td>
|
|
168 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Name"); ?></td>
|
|
169 | 169 |
<td width="78%" class="vtable" colspan="2"> |
170 | 170 |
<input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"{$pconfig['name']}\"";?> size="16" maxlength="16"> |
171 | 171 |
</td> |
172 | 172 |
</tr> |
173 | 173 |
<tr align="left"> |
174 |
<td width="22%" valign="top" class="vncellreq">Description</td>
|
|
174 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Description"); ?></td>
|
|
175 | 175 |
<td width="78%" class="vtable" colspan="2"> |
176 | 176 |
<input name="desc" type="text" <?if(isset($pconfig['desc'])) echo "value=\"{$pconfig['desc']}\"";?>size="64"> |
177 | 177 |
</td> |
178 | 178 |
</tr> |
179 | 179 |
|
180 | 180 |
<tr align="left"> |
181 |
<td width="22%" valign="top" id="monitorport_text" class="vncellreq">Port</td>
|
|
181 |
<td width="22%" valign="top" id="monitorport_text" class="vncellreq"><?=gettext("Port"); ?></td>
|
|
182 | 182 |
<td width="78%" class="vtable" colspan="2"> |
183 | 183 |
<input name="port" type="text" <?if(isset($pconfig['port'])) echo "value=\"{$pconfig['port']}\"";?> size="16" maxlength="16"><br> |
184 |
<div id="monitorport_desc">This is the port your servers are listening on.</div>
|
|
184 |
<div id="monitorport_desc"><?=gettext("This is the port your servers are listening on"); ?>.</div>
|
|
185 | 185 |
</td> |
186 | 186 |
</tr> |
187 | 187 |
<tr> |
188 | 188 |
<td> </td> |
189 | 189 |
</tr> |
190 | 190 |
<tr> |
191 |
<td colspan="2" valign="top" class="listtopic">Add item to pool</td>
|
|
191 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("Add item to pool"); ?></td>
|
|
192 | 192 |
</tr> |
193 | 193 |
<tr align="left"> |
194 |
<td width="22%" valign="top" class="vncellreq">Monitor</td>
|
|
194 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Monitor"); ?></td>
|
|
195 | 195 |
<td width="78%" class="vtable" colspan="2"> |
196 | 196 |
<?php if(count($config['load_balancer']['monitor_type'])): ?> |
197 | 197 |
<select id="monitor" name="monitor"> |
... | ... | |
206 | 206 |
} |
207 | 207 |
?> |
208 | 208 |
<?php else: ?> |
209 |
<b>NOTE:</b> Please add a monitor IP address on the monitors tab if you wish to use this feature.
|
|
209 |
<b><?=gettext("NOTE"); ?>:</b> <?=gettext("Please add a monitor IP address on the monitors tab if you wish to use this feature"); ?>.
|
|
210 | 210 |
<?php endif; ?> |
211 | 211 |
</select> |
212 | 212 |
</td> |
213 | 213 |
</tr> |
214 | 214 |
<tr align="left"> |
215 |
<td width="22%" valign="top" class="vncellreq">Server IP Address</td>
|
|
215 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server IP Address"); ?></td>
|
|
216 | 216 |
<td width="78%" class="vtable" colspan="2"> |
217 | 217 |
<input name="ipaddr" type="text" size="16" style="float: left;"> |
218 |
<input class="formbtn" type="button" name="button1" value="Add to pool" onclick="AddServerToPool(document.iform);"><br>
|
|
218 |
<input class="formbtn" type="button" name="button1" value="<?=gettext("Add to pool"); ?>" onclick="AddServerToPool(document.iform);"><br>
|
|
219 | 219 |
</td> |
220 | 220 |
</tr> |
221 | 221 |
<tr> |
222 | 222 |
<td> </td> |
223 | 223 |
</tr> |
224 | 224 |
<tr> |
225 |
<td colspan="2" valign="top" class="listtopic">Current Pool Members</td>
|
|
225 |
<td colspan="2" valign="top" class="listtopic"><?=gettext("Current Pool Members"); ?></td>
|
|
226 | 226 |
</tr> |
227 | 227 |
<tr> |
228 |
<td width="22%" valign="top" class="vncellreq">Members</td>
|
|
228 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Members"); ?></td>
|
|
229 | 229 |
<td width="78%" class="vtable" colspan="2" valign="top"> |
230 | 230 |
<table> |
231 | 231 |
<tbody> |
232 | 232 |
<tr> |
233 | 233 |
<td> |
234 | 234 |
<center> |
235 |
<b>Pool Disabled</b>
|
|
235 |
<b><?=gettext("Pool Disabled"); ?></b>
|
|
236 | 236 |
<p/> |
237 | 237 |
<select id="serversDisabledSelect" name="serversdisabled[]" multiple="true" size="5"> |
238 | 238 |
|
... | ... | |
245 | 245 |
echo "</select>"; |
246 | 246 |
?> |
247 | 247 |
<p/> |
248 |
<input class="formbtn" type="button" name="removeDisabled" value="Remove" onclick="RemoveServerFromPool(document.iform, 'serversdisabled[]');" />
|
|
248 |
<input class="formbtn" type="button" name="removeDisabled" value="<?=gettext("Remove"); ?>" onclick="RemoveServerFromPool(document.iform, 'serversdisabled[]');" />
|
|
249 | 249 |
</td> |
250 | 250 |
|
251 | 251 |
<td valign="middle"> |
... | ... | |
255 | 255 |
|
256 | 256 |
<td> |
257 | 257 |
<center> |
258 |
<b>Enabled (default)</b>
|
|
258 |
<b><?=gettext("Enabled (default)"); ?></b>
|
|
259 | 259 |
<p/> |
260 | 260 |
<select id="serversSelect" name="servers[]" multiple="true" size="5"> |
261 | 261 |
|
... | ... | |
268 | 268 |
echo "</select>"; |
269 | 269 |
?> |
270 | 270 |
<p/> |
271 |
<input class="formbtn" type="button" name="removeEnabled" value="Remove" onclick="RemoveServerFromPool(document.iform, 'servers[]');" />
|
|
271 |
<input class="formbtn" type="button" name="removeEnabled" value="<?=gettext("Remove"); ?>" onclick="RemoveServerFromPool(document.iform, 'servers[]');" />
|
|
272 | 272 |
</td> |
273 | 273 |
</tr> |
274 | 274 |
</tbody> |
... | ... | |
279 | 279 |
<td width="22%" valign="top"> </td> |
280 | 280 |
<td width="78%"> |
281 | 281 |
<br/> |
282 |
<input name="Submit" type="submit" class="formbtn" value="Save" onClick="AllServers('serversSelect', true); AllServers('serversDisabledSelect', true);">
|
|
283 |
<input type="button" class="formbtn" value="Cancel" onclick="history.back()">
|
|
282 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onClick="AllServers('serversSelect', true); AllServers('serversDisabledSelect', true);">
|
|
283 |
<input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()">
|
|
284 | 284 |
<?php if (isset($id) && $a_pool[$id] && $_GET['act'] != 'dup'): ?> |
285 | 285 |
<input name="id" type="hidden" value="<?=$id;?>"> |
286 | 286 |
<?php endif; ?> |
Also available in: Unified diff
Implement gettext() calls on load_balancer_pool_edit.php