make Schedule icon reflect current schedule state

On firewall_rules.php, there is no indication whether a schedule-based
rule is active. This change to the schedule icon applies the same styles
that are applied to a disabled/enabled Pass rule icon (text-muted and
text-success).

The break added to the foreach loop is needed to retain reference to the
attached schedule for the filter_get_time_based_rule_status() call
This commit is contained in:
framer99 2018-09-28 13:14:18 -07:00 committed by Ad Schellevis
parent 26615835f3
commit c1c5ef115e

View File

@ -652,6 +652,7 @@ $( document ).ready(function() {
if ($schedule['name'] == $filterent['sched'])
{
$schedule_descr = (isset($schedule['descr'])) ? $schedule['descr'] : "";
break;
}
}
}
@ -661,7 +662,14 @@ $( document ).ready(function() {
</span>
<a href="/firewall_schedule_edit.php?name=<?=htmlspecialchars($filterent['sched']);?>"
title="<?= html_safe(gettext('Edit')) ?>" data-toggle="tooltip">
<i class="fa fa-calendar"></i>
<?php
if (filter_get_time_based_rule_status($schedule)):?>
<i class="fa fa-calendar text-success"></i>
<?php
else:?>
<i class="fa fa-calendar text-muted"></i>
<?php
endif;?>
</a>
<?php
endif;?>