Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion css/spbc-settings.min.css

Large diffs are not rendered by default.

110 changes: 0 additions & 110 deletions css/src/spbc-settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -805,116 +805,6 @@ button#spbc_setting_get_key_auto:disabled {
flex-grow: 1;
}

/** Options overview traffic light - compact status bar (General Settings tab) */
.spbc_tab_fields_group--options-overview {
padding-left: 20px;
padding-right: 20px;
padding-bottom: 14px;
padding-top: 4px;
box-sizing: border-box;
}
.spbc-options-overview-traffic-light {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 10px 14px;
width: 100%;
max-width: 100%;
padding: 8px 30px 0px 4px;
margin-bottom: 0;
overflow: hidden;
box-sizing: border-box;
}
.spbc-options-overview-traffic-light__group {
flex: 1 1 140px;
min-width: 180px;
max-width: 100%;
padding-left: 0;
text-align: left;
}
.spbc-options-overview-traffic-light__subheading {
margin: 0 0 6px;
margin-left: 0px !important;
padding-left: 0;
font-size: 13px;
font-weight: 600;
line-height: 1.35;
color: #1d2327;
text-align: left;
word-wrap: break-word;
}
.spbc-options-overview-traffic-light__subheading a,
.spbc-options-overview-traffic-light__label a {
color: inherit;
text-decoration: none;
}
.spbc-options-overview-traffic-light__subheading a:hover,
.spbc-options-overview-traffic-light__label a:hover {
color: inherit;
text-decoration: none;
}
.spbc-options-overview-traffic-light__grid {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
max-width: 100%;
min-width: 0;
box-sizing: border-box;
}
.spbc-options-overview-traffic-light__item {
display: flex;
align-items: center;
gap: 4px;
font-size: 11px;
line-height: 1.1;
padding: 3px 8px;
margin: 1px 0;
border-radius: 4px;
border: 1px solid transparent;
min-width: 0;
width: 100%;
max-width: 250px;
overflow: hidden;
box-sizing: border-box;
}
.spbc-options-overview-traffic-light__item--on {
background: #e8f5e9;
border-color: #c8e6c9;
}
.spbc-options-overview-traffic-light__item--off {
background: #f5f5f5;
border-color: #eeeeee;
}
.spbc-options-overview-traffic-light__indicator {
flex-shrink: 0;
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #9e9e9e;
}
.spbc-options-overview-traffic-light__item--on .spbc-options-overview-traffic-light__indicator {
background-color: #2e7d32;
}
.spbc-options-overview-traffic-light__item--off .spbc-options-overview-traffic-light__indicator {
background-color: #bdbdbd;
}
.spbc-options-overview-traffic-light__label {
flex: 1 1 0%;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.spbc-options-overview-traffic-light__state {
flex-shrink: 0;
font-size: 10px;
color: #616161;
}
.spbc-options-overview-traffic-light__item--on .spbc-options-overview-traffic-light__state {
color: #2e7d32;
}

.spbc-quicknav--bar_wrapper {
display: flex;
flex-direction: column;
Expand Down
3 changes: 3 additions & 0 deletions inc/spbc-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ function spbct_get_tab_data()
case 'traffic_control':
wp_send_json(FirewallView::getReactData($data));
break;
case 'spbct_settings_overview':
wp_send_json(spbc_field_options_overview_traffic_light());
break;
default:
wp_send_json_error('Unknown tab');
}
Expand Down
42 changes: 1 addition & 41 deletions inc/spbc-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,6 @@ function spbc_settings__register()
),
),
),
'options_overview' => array(
'type' => 'section',
'title' => __('Feature Status', 'security-malware-firewall'),
'anchor' => 'options_overview',
'fields' => array(
'options_overview_traffic_light' => array(
'type' => 'plain',
'callback' => 'spbc_field_options_overview_traffic_light',
),
),
),
'apikey' => array(
'type' => 'section',
'title' => __('Access Key', 'security-malware-firewall'),
Expand Down Expand Up @@ -1734,7 +1723,6 @@ function spbc_field_options_overview_traffic_light()
{
global $spbc;

$settings_url = admin_url('options-general.php?page=spbc&spbc_tab=settings_general');
$groups = array(
array(
'title' => __('Authentication and Logging In', 'security-malware-firewall'),
Expand Down Expand Up @@ -1777,35 +1765,7 @@ function spbc_field_options_overview_traffic_light()
),
),
);

echo '<div class="spbc_wrapper_field spbc-options-overview-traffic-light">';
foreach ( $groups as $group ) {
$group_title = $group['title'];
$features = $group['features'];
echo '<div class="spbc-options-overview-traffic-light__group">';
if ( ! empty($group['anchor']) ) {
echo '<h4 class="spbc-options-overview-traffic-light__subheading"><a href="' . esc_url($settings_url . '#' . $group['anchor']) . '">' . esc_html($group_title) . '</a></h4>';
} else {
echo '<h4 class="spbc-options-overview-traffic-light__subheading">' . esc_html($group_title) . '</h4>';
}
echo '<div class="spbc-options-overview-traffic-light__grid">';
foreach ( $features as $feature ) {
$state_class = $feature['enabled'] ? 'spbc-options-overview-traffic-light__item--on' : 'spbc-options-overview-traffic-light__item--off';
$state_text = $feature['enabled'] ? __('On', 'security-malware-firewall') : __('Off', 'security-malware-firewall');
echo '<div class="spbc-options-overview-traffic-light__item ' . esc_attr($state_class) . '">';
echo '<span class="spbc-options-overview-traffic-light__indicator" aria-hidden="true"></span>';
if ( ! empty($feature['anchor']) ) {
echo '<span class="spbc-options-overview-traffic-light__label"><a href="' . esc_url($settings_url . '#' . $feature['anchor']) . '">' . esc_html($feature['label']) . '</a></span>';
} else {
echo '<span class="spbc-options-overview-traffic-light__label">' . esc_html($feature['label']) . '</span>';
}
echo '<span class="spbc-options-overview-traffic-light__state">' . esc_html($state_text) . '</span>';
echo '</div>';
}
echo '</div>';
echo '</div>';
}
echo '</div>';
return $groups;
}

/**
Expand Down
Loading
Loading