* Created Template->select_form() that builds a <select> form entry based on the old Web->build_select from v2.

* Finished config step 2's menus, including adding back the auto-updating network state form.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 7 years ago
parent 20d3f0e90b
commit 30f87cd7c4
  1. 163
      AN/Tools/Template.pm
  2. 256
      cgi-bin/home
  3. 21
      cgi-bin/words.xml
  4. 73
      html/skins/alteeve/main.css
  5. 171
      html/skins/alteeve/main.html

@ -13,6 +13,7 @@ my $THIS_FILE = "Template.pm";
### Methods;
# get
# select_form
# skin
=pod
@ -219,6 +220,168 @@ sub get
return($template);
}
=head2 select_form
This builds a <select/> form field for use when building forms in templates.
Parameters;
=head3 blank (optional, default C<< 0 >>)
By default, only the options passed are available in the select menu. If this is set to C<< 1 >>, then a blank entry will be inserted to the top of the select list.
=head3 class (optional)
This allows a custom CSS class to be used.
=head3 id (optional)
This is the ID to set. If this is not passed, the C<< name >> is used for the ID.
=head3 name (required)
This is the name of the select box.
=head3 options (required)
This is an array reference of options to put into the select box.
Example;
my $options = ["a", "b", "c"];
If you wanted to have a separate value passed to the form versus what is shown to the user, you can do so by using c<< <value>#!#<string> >>. In the case, C<< <string >> is what the user sees but C<< <value> >> is what is returned if that option is selected.
Example
my $options = ["MiB#!#Mibibyte", "GiB#!#Gibibyte"];
Would create a list where the user can choose between C<< Mibibyte >> or C<< Gibibyte >>, and the form would return C<< MiB >> or C<< GiB >>, respectively.
=head3 say_blank (optional)
If C<< blank >> is set, this can be a string to show in the place of the empty entry. This entry will use the C<< subtle_text >> CSS class and if it is selected, nothing is returned when the form is submitted.
=head3 selected (optional)
If this is set and if it matches one of the C<< options >> array values, then that option will be selected when the form is loaded.
=head3 sort (optional, default C<< 1 >>)
By default, the options array will be sorted alphabetically. If this is set to C<< 0 >>, then the order the options were entered into the array is used.
=cut
sub select_form
{
my $self = shift;
my $parameter = shift;
my $an = $self->parent;
my $debug = 3;
my $name = defined $parameter->{name} ? $parameter->{name} : "";
my $options = defined $parameter->{options} ? $parameter->{options} : "";
my $id = defined $parameter->{id} ? $parameter->{id} : $name;
my $sort = defined $parameter->{'sort'} ? $parameter->{'sort'} : 1; # Sort the entries?
my $class = defined $parameter->{class} ? $parameter->{class} : "";
my $blank = defined $parameter->{blank} ? $parameter->{blank} : 0; # Add a blank/null entry?
my $say_blank = defined $parameter->{say_blank} ? $parameter->{say_blank} : ""; # An optional, grayed-out string in the place of the "blank" option
my $selected = defined $parameter->{selected} ? $parameter->{selected} : ""; # Pre-select an option?
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
name => $name,
options => $options,
'sort' => $sort,
class => $class,
blank => $blank,
say_blank => $say_blank,
selected => $selected,
}});
# Lets start!
my $select = "<select name=\"$name\" id=\"$id\">\n";
if ($class)
{
$select = "<select name=\"$name\" id=\"$id\" class=\"$class\">\n";
}
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'select' => $select }});
# Insert a blank line.
if ($blank)
{
# If 'say_blank' is a string key, use it.
my $blank_string = "";
my $blank_class = "";
if ($say_blank)
{
$blank_string = $say_blank;
$blank_class = "class=\"subtle_text\"";
}
if ($selected eq "new")
{
$selected = "";
$select .= "<option value=\"\" $blank_class selected>$blank_string</option>\n";
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'select' => $select }});
}
else
{
$select .= "<option value=\"\" $blank_class>$blank_string</option>\n";
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'select' => $select }});
}
}
# TODO: This needs to be smarter... I shouldn't need two loops for sorted/not sorted.
if ($sort)
{
foreach my $entry (sort {$a cmp $b} @{$options})
{
next if not $entry;
if ($entry =~ /^(.*?)#!#(.*)$/)
{
my $value = $1;
my $description = $2;
$select .= "<option value=\"$value\">$description</option>\n";
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'select' => $select }});
}
else
{
$select .= "<option value=\"$entry\">$entry</option>\n";
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'select' => $select }});
}
}
}
else
{
foreach my $entry (@{$options})
{
next if not $entry;
if ($entry =~ /^(.*?)#!#(.*)$/)
{
my $value = $1;
my $description = $2;
$select .= "<option value=\"$value\">$description</option>\n";
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'select' => $select }});
}
else
{
$select .= "<option value=\"$entry\">$entry</option>\n";
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'select' => $select }});
}
}
}
# Was an entry selected?
if ($selected)
{
$select =~ s/value=\"$selected\">/value=\"$selected\" selected>/m;
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'select' => $select }});
}
# Done!
$select .= "</select>\n";
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'select' => $select }});
return($select);
}
=head2 skin
This sets or returns the active skin used when rendering web output.

@ -26,6 +26,24 @@ $an->Words->read({file => $an->data->{path}{directories}{'cgi-bin'}."/words.xml"
# Turn off buffering so that the pinwheel will display while waiting for the SSH call(s) to complete.
$| = 1;
### Setup some variables.
$an->data->{form}{error_massage} = "&nbsp;";
## Network stuff... The second octet auto-increments to handle N-number of netowrks. As such, we need to use
## a wider spread between the BCNs, SNs and IFNs than we had in v2.
# BCN starts at 10.(0+n)/16
$an->data->{'default'}{bcn}{subnet} = "10.0.0.0";
$an->data->{'default'}{bcn}{netmask} = "255.255.0.0";
$an->data->{'default'}{bcn}{pdu_octet3} = "1";
$an->data->{'default'}{bcn}{ups_octet3} = "2";
$an->data->{'default'}{bcn}{switch_octet3} = "3";
$an->data->{'default'}{bcn}{striker_octet3} = "4";
# SN starts at 10.(40+n)/16
$an->data->{'default'}{sn}{subnet} = "10.40.0.0";
$an->data->{'default'}{sn}{netmask} = "255.255.0.0";
# IFN starts at 10.(80+)/16
$an->data->{'default'}{ifn}{subnet} = "10.80.0.0";
$an->data->{'default'}{ifn}{netmask} = "255.255.0.0";
# Read in any CGI variables, if needed.
$an->Get->cgi();
@ -65,7 +83,7 @@ my $template = $an->Template->get({file => "main.html", name => "master", variab
header => $header,
skin_url => $an->data->{path}{urls}{skins}."/".$an->Template->skin,
left_top_bar => "&nbsp;",
center_top_bar => "&nbsp;",
center_top_bar => $an->data->{form}{error_massage},
right_top_bar => $buttons,
center_body => $body,
left_bottom_bar => "&nbsp;",
@ -101,29 +119,118 @@ sub config_step2
interface_count => $interface_count,
}});
my $interface_options = [];
foreach my $interface (sort {$a cmp $b} keys %{$an->data->{interfaces}})
{
my $this_mac = $an->data->{interfaces}{$interface}{mac};
push @{$interface_options}, $this_mac;
}
my $problem = 0;
my $interface_form = "";
if ($interface_count < $required_interfaces_for_single)
my $cgi = "";
if ($interface_count >= $required_interfaces_for_bonds)
{
# Build the error message.
my $say_message = $an->Words->string({key => "striker_error_0001", variables => {
interface_count => $interface_count,
required_interfaces_for_single => $required_interfaces_for_single,
}});
### Show the bonded ifaces form.
# BCN
my $bcn_count = $an->data->{cgi}{bcn_count}{value} ? $an->data->{cgi}{bcn_count}{value} : 1;
foreach my $bcn (1..$bcn_count)
{
my $this_bcn_key = "bcn".$bcn;
my $this_ip_key = "bcn".$bcn."_ip";
my $this_subnet_key = "bcn".$bcn."_subnet";
my $this_iface1_key = "bcn".$bcn."_iface1_mac";
my $this_iface2_key = "bcn".$bcn."_iface2_mac";
$cgi .= $this_ip_key.",".$this_subnet_key.",".$this_iface1_key.",".$this_iface2_key.",";
my $this_ip = generate_ip($an, "bcn", 1, $an->data->{cgi}{sequence}{value});
my $this_ip_class = $an->data->{cgi}{$this_ip_key}{alert} ? "input_alert" : "input_clear";
my $this_subnet_class = $an->data->{cgi}{$this_subnet_key}{alert} ? "input_alert" : "input_clear";
my $this_iface1_class = $an->data->{cgi}{$this_iface1_key}{alert} ? "input_alert" : "input_clear";
my $this_iface2_class = $an->data->{cgi}{$this_iface2_key}{alert} ? "input_alert" : "input_clear";
# Build the interface select boxes...
my $this_iface1_form = $an->Template->select_form({
name => $this_iface1_key,
options => $interface_options,
blank => 1,
selected => defined $an->data->{cgi}{$this_iface1_key}{value} ? $an->data->{cgi}{$this_iface1_key}{value} : "",
class => $an->data->{cgi}{$this_iface1_key}{alert} ? "input_alert" : "input_clear",
});
my $this_iface2_form = $an->Template->select_form({
name => $this_iface2_key,
options => $interface_options,
blank => 1,
selected => defined $an->data->{cgi}{$this_iface2_key}{value} ? $an->data->{cgi}{$this_iface2_key}{value} : "",
class => $an->data->{cgi}{$this_iface2_key}{alert} ? "input_alert" : "input_clear",
});
# Assemble the form
$interface_form .= $an->Template->get({file => "main.html", name => "bonded_interface_form", variables => {
field => $an->Words->string({key => "striker_0018", variables => { number => $bcn }}),
description => "#!string!striker_0019!#",
ip_key => $this_ip_key,
ip_value => defined $an->data->{cgi}{$this_ip_key}{value} ? $an->data->{cgi}{$this_ip_key}{value} : $this_ip,
ip_class => $this_ip_class,
subnet_key => $this_subnet_key,
subnet_value => defined $an->data->{cgi}{$this_subnet_key}{value} ? $an->data->{cgi}{$this_subnet_key}{value} : $an->data->{'default'}{bcn}{netmask},
subnet_class => $this_subnet_class,
iface1_select => $this_iface1_form,
iface2_select => $this_iface2_form,
}});
}
# Not enough interfaces found.
$problem = 1;
$interface_form = $an->Template->get({file => "main.html", name => "error_message", variables => { error_message => $say_message }});
}
elsif ($interface_count >= $required_interfaces_for_bonds)
{
# Show the bonded ifaces form.
my $ifn_count = $an->data->{cgi}{ifn_count}{value} ? $an->data->{cgi}{ifn_count}{value} : 1;
foreach my $ifn (1..$ifn_count)
{
my $this_ifn_key = "ifn".$ifn;
my $this_ip_key = "ifn".$ifn."_ip";
my $this_subnet_key = "ifn".$ifn."_subnet";
my $this_iface1_key = "ifn".$ifn."_iface1_mac";
my $this_iface2_key = "ifn".$ifn."_iface2_mac";
$cgi .= $this_ip_key.",".$this_subnet_key.",".$this_iface1_key.",".$this_iface2_key.",";
my $this_ip = generate_ip($an, "ifn", 1, $an->data->{cgi}{sequence}{value});
my $this_ip_class = $an->data->{cgi}{$this_ip_key}{alert} ? "input_alert" : "input_clear";
my $this_subnet_class = $an->data->{cgi}{$this_subnet_key}{alert} ? "input_alert" : "input_clear";
my $this_iface1_class = $an->data->{cgi}{$this_iface1_key}{alert} ? "input_alert" : "input_clear";
my $this_iface2_class = $an->data->{cgi}{$this_iface2_key}{alert} ? "input_alert" : "input_clear";
# Build the interface select boxes...
my $this_iface1_form = $an->Template->select_form({
name => $this_iface1_key,
options => $interface_options,
blank => 1,
selected => defined $an->data->{cgi}{$this_iface1_key}{value} ? $an->data->{cgi}{$this_iface1_key}{value} : "",
class => $an->data->{cgi}{$this_iface1_key}{alert} ? "input_alert" : "input_clear",
});
my $this_iface2_form = $an->Template->select_form({
name => $this_iface2_key,
options => $interface_options,
blank => 1,
selected => defined $an->data->{cgi}{$this_iface2_key}{value} ? $an->data->{cgi}{$this_iface2_key}{value} : "",
class => $an->data->{cgi}{$this_iface2_key}{alert} ? "input_alert" : "input_clear",
});
# Assemble the form
$interface_form .= $an->Template->get({file => "main.html", name => "bonded_interface_form", variables => {
field => $an->Words->string({key => "striker_0022", variables => { number => $ifn }}),
description => "#!string!striker_0023!#",
ip_key => $this_ip_key,
ip_value => defined $an->data->{cgi}{$this_ip_key}{value} ? $an->data->{cgi}{$this_ip_key}{value} : $this_ip,
ip_class => $this_ip_class,
subnet_key => $this_subnet_key,
subnet_value => defined $an->data->{cgi}{$this_subnet_key}{value} ? $an->data->{cgi}{$this_subnet_key}{value} : $an->data->{'default'}{ifn}{netmask},
subnet_class => $this_subnet_class,
iface1_select => $this_iface1_form,
iface2_select => $this_iface2_form,
}});
}
}
else
{
# Show the single iface per network form.
### Show the single iface per network form.
}
# Hostname
my $say_default_hostname = $an->data->{cgi}{prefix}{value}."-striker0".$an->data->{cgi}{sequence}{value}.".".$an->data->{cgi}{domain}{value};
my $hostname_class = $an->data->{cgi}{hostname}{alert} ? "input_alert" : "input_clear";
my $say_hostname = $an->Template->get({file => "main.html", name => "input_text_form", variables => {
@ -136,6 +243,36 @@ sub config_step2
extra => "",
}});
# Admin user
my $say_default_striker_user = "striker";
my $striker_user_class = $an->data->{cgi}{striker_user}{alert} ? "input_alert" : "input_clear";
my $say_striker_user = $an->Template->get({file => "main.html", name => "input_text_form", variables => {
name => "striker_user",
id => "striker_user",
field => "#!string!striker_0031!#",
description => "#!string!striker_0032!#",
value => defined $an->data->{cgi}{striker_user}{value} ? $an->data->{cgi}{striker_user}{value} : $say_default_striker_user,
class => $striker_user_class,
extra => "",
}});
# Password
my $say_default_striker_password = "";
my $striker_password_class = $an->data->{cgi}{striker_password}{alert} ? "input_alert" : "input_clear";
my $say_striker_password = $an->Template->get({file => "main.html", name => "input_text_form", variables => {
name => "striker_password",
id => "striker_password",
field => "#!string!striker_0033!#",
description => "#!string!striker_0034!#",
value => defined $an->data->{cgi}{striker_password}{value} ? $an->data->{cgi}{striker_password}{value} : $say_default_striker_password,
class => $striker_password_class,
extra => "",
}});
# Get the table that shows the current interface states.
my $interface_states = get_network_details_form($an);
# Store the previous CGI variables and display the new fields.
my $step2_body = $an->Template->get({file => "main.html", name => "config_step2", variables => {
step1_welcome_title_id => "",
step1_welcome_message_id => "",
@ -145,8 +282,11 @@ sub config_step2
sequence => $an->data->{cgi}{sequence}{value},
ifn_count => $an->data->{cgi}{ifn_count}{value},
interface_form => $interface_form,
interface_states => $interface_states,
striker_user_form => $say_striker_user,
striker_password_form => $say_striker_password,
hostname_form => $say_hostname,
cgi_list => "hostname",
cgi_list => $cgi."hostname,striker_user,striker_password",
}});
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { step2_body => $step2_body }});
@ -199,6 +339,31 @@ sub sanity_check_step1
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { sane => $sane, "cgi::ifn_count::alert" => $an->data->{cgi}{ifn_count}{alert} }});
}
# Make sure we have enough interfaces.
get_network_details($an);
my $required_interfaces_for_single = 1 + $an->data->{cgi}{ifn_count}{value};
my $interface_count = keys %{$an->data->{interfaces}};
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
required_interfaces_for_single => $required_interfaces_for_single,
interface_count => $interface_count,
}});
if ($interface_count < $required_interfaces_for_single)
{
# Build the error message.
my $say_message = $an->Words->string({key => "striker_error_0001", variables => {
interface_count => $interface_count,
required_interfaces_for_single => $required_interfaces_for_single,
}});
# Not enough interfaces found.
$an->data->{form}{error_massage} = $an->Template->get({file => "main.html", name => "error_message", variables => { error_message => $say_message }});
# We're not sane
$an->data->{cgi}{ifn_count}{alert} = 1;
$sane = 0;
}
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { sane => $sane }});
return($sane);
}
@ -324,7 +489,7 @@ sub get_network_details
speed => $data->{interface}{$interface}{speed},
'link' => $data->{interface}{$interface}{'link'}
};
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
"interfaces::${interface}::mac" => $an->data->{interfaces}{$interface}{mac},
"interfaces::${interface}::speed" => $an->data->{interfaces}{$interface}{speed},
"interfaces::${interface}::link" => $an->data->{interfaces}{$interface}{'link'},
@ -382,3 +547,60 @@ sub get_network_details_form
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { network => $network }});
return($network);
}
# This is a rudimentary function for generating default Striker IPs.
sub generate_ip
{
my ($an, $network, $network_sequence, $device_sequence) = @_;
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
network => $network,
network_sequence => $network_sequence,
device_sequence => $device_sequence,
}});
# An empty string is returned if we can't make a sane guess at what should be set.
my $ip = "";
# The subnet's second octet will be '+X' where 'X' is the sequence.
my $default_ip = $an->data->{'default'}{$network}{subnet};
my $default_netmark = $an->data->{'default'}{$network}{netmask};
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
default_ip => $default_ip,
default_netmark => $default_netmark,
}});
if (($an->Validate->is_ipv4({ip => $default_ip})) && ($an->Validate->is_ipv4({ip => $default_netmark})))
{
# Valid values.
my ($ip_octet1, $ip_octet2, $ip_octet3, $ip_octet4) = (split/\./, $default_ip);
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
ip_octet1 => $ip_octet1,
ip_octet2 => $ip_octet2,
ip_octet3 => $ip_octet3,
ip_octet4 => $ip_octet4,
}});
if ($default_netmark eq "255.255.0.0")
{
# We can work with this.
$ip_octet2 += $network_sequence;
$ip_octet3 = $an->data->{'default'}{bcn}{striker_octet3};
$ip_octet4 = $device_sequence;
$ip = $ip_octet1.".".$ip_octet2.".".$ip_octet3.".".$ip_octet4;
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"s1:ip_octet2" => $ip_octet2,
"s2:ip_octet3" => $ip_octet3,
"s3:ip_octet4" => $ip_octet4,
"s4:ip" => $ip,
}});
}
}
else
{
# Something wrong with our defaults.
$ip = "#!error!#";
}
$an->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { ip => $ip }});
return($ip);
}

@ -20,7 +20,7 @@ This is the AN::Tools master 'words' file.
<key name="brand_0005"><![CDATA[&copy; 2017 <a href="https://alteeve.com/" target="_new">Alteeve's Niche! Inc.</a>, Toronto, Ontario, Canada]]></key>
<key name="brand_0006"><![CDATA[<i>Anvil!</i>]]></key>
<key name="header_0001">Network Interfaces</key>
<key name="header_0001">Current Network Interfaces and States</key>
<key name="header_0002">MAC Address</key>
<key name="header_0003">Current Name</key>
<key name="header_0004">Link State</key>
@ -44,9 +44,26 @@ This is the AN::Tools master 'words' file.
<key name="striker_0015">IFN Count</key>
<key name="striker_0016">Host name</key>
<key name="striker_0017">This is the hostname for this Striker dashboard. Generally it is a good idea to stick with the default.</key>
<key name="striker_0018">Back-Channel Network link #!variable!number!#:</key>
<key name="striker_0019">This is where you configure the network to enable access this Back-Channel Network.</key>
<key name="striker_0020">Storage Network link #!variable!number!#:</key>
<key name="striker_0021">This is where you configure the network to enable access this Storage Network.</key>
<key name="striker_0022">Internet-Facing Network link #!variable!number!#:</key>
<key name="striker_0023">This is where you configure the network to enable access this Internet-Facing Network.</key>
<key name="striker_0024">IP Address</key>
<key name="striker_0025">Subnet</key>
<key name="striker_0026">Gateway</key>
<key name="striker_0027">DNS Server</key>
<key name="striker_0028">Network Interface</key>
<key name="striker_0029">Primary Interface</key>
<key name="striker_0030">Backup Interface</key>
<key name="striker_0031">Striker user name</key>
<key name="striker_0032">This is the user name that you will log into Striker as and the name of the user that owns the database.</key>
<key name="striker_0033">Striker password</key>
<key name="striker_0034"><![CDATA[This will be the password used to log into this Striker and connect to its database.<br /><b>NOTE</b>: This password needs to be stored in plain text. Do not use a password you use elsewhere.]]></key>
<!-- Errors -->
<key name="striker_error_0001">There are not enuogh network interfaces on this machine. You have: [#!variable!interface_count!#] interface(s), and you need at least: [#!variable!required_interfaces_for_single!#] interfaces to connect to the requested networks (one for Back-Channel and one for each Internet-Facing network).</key>
<key name="striker_error_0001">There are not enough network interfaces on this machine. You have: [#!variable!interface_count!#] interface(s), and you need at least: [#!variable!required_interfaces_for_single!#] interfaces to connect to the requested networks (one for Back-Channel and one for each Internet-Facing network).</key>
<!-- These are works and strings used by javascript/jqery -->
<key name="js_0001">Up</key>

@ -11,29 +11,47 @@ Colours;
*/
.error_message {
border: 3px solid #d02724;
border-left: 3px solid #d02724;
border-right: 3px solid #d02724;
background: #343434;
padding: 20px;
padding-top: 0.2em;
padding-left: 0.2em;
padding-right: 0.2em;
color: #ffdfdf;
}
input[type=text].input_clear, input[type=number].input_clear {
input[type=text].input_clear, input[type=number].input_clear, select.input_clear {
border: 1px solid #9ba0a5;
}
input[type=text].input_alert, input[type=number].input_alert {
input[type=text].input_alert, input[type=number].input_alert, select.input_alert {
border: 2px solid red;
}
input[type=text], input[type=number] {
width: 100%;
padding: 6px 10px;
margin: 2px 0;
display: inline-block;
border: 1px solid #9ba0a5;
border-radius: 2px;
box-sizing: border-box;
width: 100%;
padding: 6px 10px;
margin: 2px 0;
display: inline-block;
border: 1px solid #9ba0a5;
border-radius: 2px;
box-sizing: border-box;
background-color: #343434;
color: #f7f7f7;
}
select {
width: 100%;
/* padding: 6px 10px; */
margin: 2px 0;
display: inline-block;
border: 1px solid #9ba0a5;
border-radius: 2px;
box-sizing: border-box;
background-color: #343434;
color: #f7f7f7;
color: #f7f7f7;
font-family: 'Dejavu Sans Mono', 'Courier 10 pitch', monospace, Courier;
font-size: 1.1em;
}
body {
@ -43,6 +61,12 @@ body {
color: #f2f2f2;
}
table.data_table_nowrap {
border: 1px solid #8f8f8f;
border-radius: 4px;
white-space: nowrap;
}
table.data_table {
border: 1px solid #8f8f8f;
border-radius: 4px;
@ -74,11 +98,18 @@ td.column_row_value_fixed {
color: #f7f7f7;
font-family: 'Dejavu Sans Mono', Courier;
padding: 0.2em;
font-size: 0.9em;
}
td.column_row_value_fixed_centered {
text-align: center;
color: #f7f7f7;
font-family: 'Dejavu Sans Mono', Courier;
padding: 0.2em;
font-size: 0.9em;
}
.body_table {
width: 90%;
/* border: 0.1em solid blue; */
margin: auto;
top: 0;
position: absolute;
@ -97,6 +128,17 @@ td.column_row_value_fixed {
font-size: 1em;
}
.form_group_header1 {
text-align: left;
font-size: 1.1em;
font-weight: bold;
}
.form_group_header2 {
text-align: left;
font-size: 1.1em;
}
table {
border-spacing: 0;
border-collapse: collapse;
@ -122,6 +164,11 @@ td {
height: 2.5em;
}
.subtle_text {
color: #9D9D9D;
text-align: left;
}
.header {
text-align: center;
background: #343434;

@ -65,8 +65,10 @@
<input type="submit" name="next" id="next" value="#!string!striker_0013!#">
</td>
</tr>
<input type="hidden" name="step" id="step" value="step1">
<input type="hidden" name="cgi_list" id="cgi_list" value="next,step,#!variable!cgi_list!#">
<!-- NOTE: For now, we support only one BCN in the web UI, but the system will be ready for N-number later. -->
<input type="hidden" name="bcn_count" id="bcn_count" value="1">
<input type="hidden" name="step" id="step" value="step1">
<input type="hidden" name="cgi_list" id="cgi_list" value="next,bcn_count,step,#!variable!cgi_list!#">
</form>
</div>
</table>
@ -98,12 +100,27 @@
</tr>
<tr>
<td>
&nbsp;
</td>
</tr>
<tr>
<td>
#!variable!hostname_form!#
</td>
</tr>
<tr>
<td>
#!variable!striker_user_form!#
</td>
</tr>
<tr>
<td>
#!variable!striker_password_form!#
</td>
</tr>
</table>
</td>
<td width="25%" style="padding-left: 1em;">
<td width="25%" style="padding-left: 1em; vertical-align: top;">
<table class="data_table">
<tr>
<td class="column_header" colspan="2">
@ -161,6 +178,8 @@
</td>
</tr>
</table>
<br />
#!variable!interface_states!#
</td>
</tr>
<tr>
@ -178,7 +197,7 @@
<!-- end config_step2 -->
<!-- start error_message -->
<div class="error_message"> #!variable!error_message!# </div><br />
<div class="error_message"><span style="color: #ff3f7f;">*</span> #!variable!error_message!# </div>
<!-- end error_message -->
<!-- start select_form -->
@ -196,6 +215,100 @@
<input type="number" name="#!variable!name!#" id="#!variable!id!#" value="#!variable!value!#" placeholder="#!variable!field!#" class="#!variable!class!#" #!variable!extra!#>
<!-- end input_number_form -->
<!-- start bonded_interface_form -->
<table>
<tr>
<td colspan="5" class="form_group_header1">
#!variable!field!#
</td>
</tr>
<tr>
<td colspan="5" class="form_group_header2">
#!variable!description!#
</td>
</tr>
<tr>
<td>
#!string!striker_0024!#
</td>
<td>
<input type="text" name="#!variable!ip_key!#" id="#!variable!ip_key!#" value="#!variable!ip_value!#" placeholder="#!string!striker_0024!#" class="#!variable!ip_class!#">
</td>
<td>
&nbsp;
</td>
<td>
#!string!striker_0029!#
</td>
<td>
#!variable!iface1_select!#
</td>
</tr>
<tr>
<td>
#!string!striker_0025!#
</td>
<td>
<input type="text" name="#!variable!subnet_key!#" id="#!variable!subnet_key!#" value="#!variable!subnet_value!#" placeholder="#!string!striker_0025!#" class="#!variable!subnet_class!#">
</td>
<td>
&nbsp;
</td>
<td>
#!string!striker_0030!#
</td>
<td>
#!variable!iface2_select!#
</td>
</tr>
</table>
<!-- end bonded_interface_form -->
<!-- start network_header -->
<table id="network_status" class="data_table_nowrap">
<tr>
<td colspan="4" class="column_header">
#!string!header_0001!#
</td>
</tr>
<tr class="data_row">
<td class="column_row_name">
#!string!header_0002!#
</td>
<td class="column_row_name">
#!string!header_0003!#
</td>
<td id="network_link_state" data-up="#!string!js_0001!#" data-down="#!string!js_0002!#" class="column_row_name">
#!string!header_0004!#
</td>
<td id="network_link_speed" data-mbps="#!string!js_0003!#" class="column_row_name">
#!string!header_0005!#
</td>
</tr>
<!-- end network_header -->
<!-- start network_entry -->
<tr class="data_row">
<td class="column_row_value_fixed">
<span name="#!variable!mac_id!#" id="#!variable!mac_id!#">#!variable!mac!#</span>
</td>
<td class="column_row_value_fixed_centered">
<span name="#!variable!name_id!#" id="#!variable!name_id!#">#!variable!name!#</span>
</td>
<td class="column_row_value_fixed_centered">
<span name="#!variable!link_id!#" id="#!variable!link_id!#">#!variable!link!#</span>
</td>
<td class="column_row_value_fixed_centered">
<span name="#!variable!speed_id!#" id="#!variable!speed_id!#">#!variable!speed!#</span>
</td>
</tr>
<!-- end network_entry -->
<!-- start network_footer -->
<input type="hidden" name="interface_list" id="interface_list" value="#!variable!interface_list!#" />
</table>
<!-- end network_footer -->
<!-- start footer -->
<div onload="show_status()" class="footer">
#!string!brand_0005!#
@ -226,11 +339,6 @@
<body>
<table class="body_table">
<!-- <tr>
<td class="header" colspan="3">
<img src="#!data!skin::url!#/images/logo.png" class="logo">
</td>
</tr>-->
<tr>
<td class="header" width="5%">
<img src="#!data!skin::url!#/images/logo.png" class="logo">
@ -264,48 +372,3 @@
#!variable!footer!#
</html>
<!-- end master -->
<!-- start network_footer -->
<input type="hidden" name="interface_list" id="interface_list" value="#!variable!interface_list!#" />
</table>
<!-- end network_footer -->
<!-- start network_entry -->
<tr>
<td>
<span name="#!variable!mac_id!#" id="#!variable!mac_id!#">#!variable!mac!#</span>
</td>
<td>
<span name="#!variable!name_id!#" id="#!variable!name_id!#">#!variable!name!#</span>
</td>
<td>
<span name="#!variable!link_id!#" id="#!variable!link_id!#">#!variable!link!#</span>
</td>
<td>
<span name="#!variable!speed_id!#" id="#!variable!speed_id!#">#!variable!speed!#</span>
</td>
</tr>
<!-- end network_entry -->
<!-- start network_header -->
<table id="network_status">
<tr>
<td colspan="4">
#!string!header_0001!#
</td>
</tr>
<tr>
<td>
#!string!header_0002!#
</td>
<td>
#!string!header_0003!#
</td>
<td id="network_link_state" data-up="#!string!js_0001!#" data-down="#!string!js_0002!#">
#!string!header_0004!#
</td>
<td id="network_link_speed" data-mbps="#!string!js_0003!#">
#!string!header_0005!#
</td>
</tr>
<!-- end network_header -->

Loading…
Cancel
Save