* Filtered out 'delay' and 'plug' options from Striker->get_fence_data()'s options parsing.

* Cleaned up striker's display of fence agent data.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 5 years ago
parent 83d6cff4af
commit d3bb350668
  1. 1
      Anvil/Tools/Get.pm
  2. 3
      Anvil/Tools/Striker.pm
  3. 10
      cgi-bin/striker
  4. 8
      html/skins/alteeve/anvil.html
  5. 6
      html/skins/alteeve/main.css
  6. 10
      notes

@ -771,6 +771,7 @@ sub switches
} }
} }
} }
# Clean up the initial space added to 'raw'. # Clean up the initial space added to 'raw'.
if ($anvil->data->{switches}{raw}) if ($anvil->data->{switches}{raw})
{ {

@ -156,10 +156,11 @@ sub get_fence_data
{ {
# We ignore some parameters that are not useful parameters in our case. # We ignore some parameters that are not useful parameters in our case.
my $name = $hash_ref->{name}; my $name = $hash_ref->{name};
next if $name eq "delay";
next if $name eq "help"; next if $name eq "help";
next if $name eq "version"; next if $name eq "version";
next if $name eq "delay";
next if $name eq "separator"; next if $name eq "separator";
next if $name eq "plug";
next if $name =~ /snmp(.*?)_path/; next if $name =~ /snmp(.*?)_path/;
my $unique = exists $hash_ref->{unique} ? $hash_ref->{unique} : 0; my $unique = exists $hash_ref->{unique} ? $hash_ref->{unique} : 0;

@ -1592,6 +1592,7 @@ sub process_fences
}}); }});
# Set the cgi variable to the default, if not already set. # Set the cgi variable to the default, if not already set.
$anvil->data->{cgi}{$option_key}{alert} = "" if not defined $anvil->data->{cgi}{$option_key}{alert};
$anvil->data->{cgi}{$option_key}{value} = $default if not defined $anvil->data->{cgi}{$option_key}{value}; $anvil->data->{cgi}{$option_key}{value} = $default if not defined $anvil->data->{cgi}{$option_key}{value};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"cgi::".$option_key."::value" => $anvil->data->{cgi}{$option_key}{value}, "cgi::".$option_key."::value" => $anvil->data->{cgi}{$option_key}{value},
@ -1614,12 +1615,13 @@ sub process_fences
blank => $required ? 0 : 1, blank => $required ? 0 : 1,
'sort' => 1, 'sort' => 1,
selected => $anvil->data->{cgi}{$option_key}{value}, selected => $anvil->data->{cgi}{$option_key}{value},
class => $required ? "input_required" : "input_clear", class => $anvil->data->{cgi}{$option_key}{alert} ? "input_alert" : "input_clear",
}); });
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { select_options => $select_options }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { select_options => $select_options }});
# Build the entry # Build the entry
my $select_form .= $anvil->Template->get({file => "anvil.html", name => "fence-agent-option-entry", variables => { my $select_form .= $anvil->Template->get({file => "anvil.html", name => "fence-agent-option-entry", variables => {
name_class => $required ? "say_required" : "",
name => $name, name => $name,
option => $select_options, option => $select_options,
description => $description, description => $description,
@ -1634,9 +1636,10 @@ sub process_fences
# Build the entry # Build the entry
my $checkbox_form .= $anvil->Template->get({file => "anvil.html", name => "fence-agent-checkbox-entry", variables => { my $checkbox_form .= $anvil->Template->get({file => "anvil.html", name => "fence-agent-checkbox-entry", variables => {
name => $name, name => $name,
name_class => $required ? "say_required" : "",
checkbox_name => $option_key, checkbox_name => $option_key,
checkbox_checked => $anvil->data->{cgi}{$option_key}{value} ? "checked" : "", checkbox_checked => $anvil->data->{cgi}{$option_key}{value} ? "checked" : "",
description => $description, description => $description,
}}); }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { checkbox_form => $checkbox_form }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { checkbox_form => $checkbox_form }});
@ -1652,7 +1655,8 @@ sub process_fences
key => $option_key, key => $option_key,
value => $anvil->data->{cgi}{$option_key}{value}, value => $anvil->data->{cgi}{$option_key}{value},
'default' => $default, 'default' => $default,
class => $required ? "input_required" : "input_clear",, name_class => $required ? "say_required" : "",
input_class => $anvil->data->{cgi}{$option_key}{alert} ? "input_alert" : "input_clear",
description => $description, description => $description,
}}); }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { string_options => $string_options }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { string_options => $string_options }});

@ -135,7 +135,7 @@
<!-- start fence-agent-option-entry --> <!-- start fence-agent-option-entry -->
<tr> <tr>
<td> <td class="#!variable!name_class!#">
#!variable!name!# &nbsp; #!variable!name!# &nbsp;
</td> </td>
<td> <td>
@ -149,7 +149,7 @@
<!-- start fence-agent-checkbox-entry --> <!-- start fence-agent-checkbox-entry -->
<tr> <tr>
<td> <td class="#!variable!name_class!#">
#!variable!name!# &nbsp; #!variable!name!# &nbsp;
</td> </td>
<td> <td>
@ -163,11 +163,11 @@
<!-- start fence-agent-input-entry --> <!-- start fence-agent-input-entry -->
<tr> <tr>
<td> <td class="#!variable!name_class!#">
#!variable!name!# &nbsp; #!variable!name!# &nbsp;
</td> </td>
<td> <td>
<input type="text" name="#!variable!key!#" id="#!variable!key!#" value="#!variable!value!#" placeholder="#!variable!default!#" class="#!variable!class!#"> <input type="text" name="#!variable!key!#" id="#!variable!key!#" value="#!variable!value!#" placeholder="#!variable!default!#" class="#!variable!input_class!#">
</td> </td>
<td> <td>
&nbsp; #!variable!description!# &nbsp; #!variable!description!#

@ -198,12 +198,12 @@ input[type=text].input_alert, input[type=number].input_alert, select.input_alert
border: 1px solid #ff3f3f; border: 1px solid #ff3f3f;
} }
input[type=text].input_required, input[type=number].input_required, select.input_required { .input_required {
border: 1px solid #7f7fff; color: 1px solid #3ed688;
} }
.say_required { .say_required {
color: #7f7fff; color: #3ed688;
} }
input[type=text].input_clear, input[type=number].input_clear, select.input_clear { input[type=text].input_clear, input[type=number].input_clear, select.input_clear {

10
notes

@ -1351,4 +1351,14 @@ Striker Version: 2.0.7
</config> </config>
# Attach a network interface:
virsh attach-interface win2019_test bridge ifn_bridge1 --live --model virtio
# Detach a network interface:
virsh detach-interface win2019_test bridge --mac 52:54:00:ee:b5:1d
# Change the MTU of a device;
ip link set <dev> mtu 9000
# Change the MTU of an interface in windows (not tested yet - http://networking.nitecruzr.net/2007/11/setting-mtu-in-windows-vista.html)
netsh interface ipv4 set subinterface "Local Area Connection" mtu=nnnn store=persistent

Loading…
Cancel
Save