Projet

Général

Profil

« Précédent | Suivant » 

Révision 73a96698

Ajouté par Phil Davis il y a plus de 9 ans

Provide an edit button for static mapped entries

As suggested in forum https://forum.pfsense.org/index.php?topic=82883.msg0#new
Instead of a non-functioning red plus icon, show an edit icon for static mapped entries, and take the user to services_dhcp_edit page if it is clicked. IMHO this makes it much easier to correct things that are noticed when viewing the Status, DHCP Leases display.

Voir les différences:

usr/local/www/status_dhcp_leases.php
155 155
	/* walk the fields */
156 156
	$f = 0;
157 157
	$fcount = count($data);
158
	/* with less then 20 fields there is nothing useful */
158
	/* with less than 20 fields there is nothing useful */
159 159
	if($fcount < 20) {
160 160
		$i++;
161 161
		continue;
......
351 351
		if ($data['act'] == "static") {
352 352
			foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
353 353
				if(is_array($dhcpifconf['staticmap'])) {
354
					$staticmap_array_index = 0;
354 355
					foreach ($dhcpifconf['staticmap'] as $staticent) {
355 356
						if ($data['ip'] == $staticent['ipaddr']) {
356 357
							$data['if'] = $dhcpif;
357 358
							break;
358 359
						}
360
						$staticmap_array_index++;
359 361
					}
360 362
				}
361 363
				/* exit as soon as we have an interface */
......
404 406
			echo "<a href=\"services_dhcp_edit.php?if={$data['if']}&amp;mac={$data['mac']}&amp;hostname={$data['hostname']}\">";
405 407
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a static mapping for this MAC address") ."\" alt=\"add\" /></a>&nbsp;\n";
406 408
		} else {
407
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\" alt=\"add\" />&nbsp;\n";
409
			echo "<a href=\"services_dhcp_edit.php?if={$data['if']}&amp;id={$staticmap_array_index}\">";
410
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_e.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("edit the static mapping for this entry") ."\" alt=\"add\" />&nbsp;\n";
408 411
		}
409 412

  
410 413
		echo "<a href=\"services_wol_edit.php?if={$data['if']}&amp;mac={$data['mac']}&amp;descr={$data['hostname']}\">";

Formats disponibles : Unified diff