From 99a33ced4f9dc25537dfc3504340266038ccd726 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 22 Jul 2019 16:24:24 -0400 Subject: [PATCH] Added form tag UI element and other changes. --- views/adminServerStats.html | 571 ++++++++++++++------------- views/ui/f6/form-end.html | 5 + views/ui/f6/form-start.html | 38 ++ views/ui/f6/miscContainer-end.html | 7 + views/ui/f6/miscContainer-start.html | 7 + views/ui/f6/submit.html | 21 + 6 files changed, 372 insertions(+), 277 deletions(-) create mode 100644 views/ui/f6/form-end.html create mode 100644 views/ui/f6/form-start.html create mode 100644 views/ui/f6/miscContainer-end.html create mode 100644 views/ui/f6/miscContainer-start.html create mode 100644 views/ui/f6/submit.html diff --git a/views/adminServerStats.html b/views/adminServerStats.html index 89a7cf2..e0d04e5 100755 --- a/views/adminServerStats.html +++ b/views/adminServerStats.html @@ -26,13 +26,13 @@ background-color: #0568B3 !important; color: white; } - .section { + .usage-section { font-weight: bold; text-align: center; font-size: 1.4rem; clear: both; padding: 1rem; - border-top: 1px solid black; + margin-top: 2rem; } .sortBy { @@ -72,329 +72,346 @@ {else}

Please contact your system administrator for assistance.

{/if} + {else}

Gaslight Media Server Usage

- {if !$haveStats} -

This application has not been configured. Please ask Gaslight Media this for your Website.

-

Error: {$connectError}

- {else} + {if !$haveStats} +

This application has not been configured. Please ask Gaslight Media this for your Website.

+

Error: {$connectError}

+ {else} - {if apply_filters('glm-serverstats-is-provider', false)} -
Service Provider Section
+ {if apply_filters('glm-serverstats-is-provider', false)} +
Service Provider Section
- {* Grid Start *} + {* Form Start *} {$ui = [ - 'sectionColor' => '#ffE', - 'nowrap' => true - ]} - {include file="ui/f6/grid-start.html"} - -
- - - + 'action' => "{$thisUrl}?page={$thisPage}&selected_site={$selectedSite}", + 'method' => 'POST', + 'validate' => true, + 'validateFocusMsg' => true + ]} + {include file="ui/f6/form-start.html"} + + + + + + {* Grid Start *} + {$ui = [ + 'sectionColor' => '#ffE', + 'nowrap' => true + ]} + {include file="ui/f6/grid-start.html"} {* Section Start *} - {$ui = [ - 'title' => 'Site Selection' - ]} - {include file="ui/f6/section-start.html"} - - Sort By: - Site Name - Traffic: - Total for Month   - Percent of target   - Storage: - Maximum for Month   - Percent of target   -

-
-
                                                   ----------------- Traffic -------------   --------------- Storage --------------
-
Website                                            Last Month       Target     % of Target   Last Month      Target     % of Target
-
- {foreach $websites as $site} -
{if $site.name == $selectedSite}{/if}{$site.name|string_format:"%-50s"} {$site.data_total|string_format:"%6.1f"} GB   {$site.target|string_format:"%8.1f"} GB      $threshold}style="color: red;"{/if}>{$site.target_percent|string_format:"%6.0f"}%      {$site.storage|string_format:"%6.1f"} GB   {$site.disk_target|string_format:"%8.1f"} GB       $threshold}style="color: red;"{/if}>{$site.disk_target_percent|string_format:"%6.0f"}%
- {/foreach} + {$ui = [ + 'title' => 'Site Selection' + ]} + {include file="ui/f6/section-start.html"} + + {* Misc Container Start *} + {include file="ui/f6/miscContainer-start.html"} + + Sort By: + Site Name + Traffic: + Total for Month   + Percent of target   + Storage: + Maximum for Month   + Percent of target   +
+
                                                   ----------------- Traffic -------------   --------------- Storage --------------
+
Website                                            Last Month       Target     % of Target   Last Month      Target     % of Target
+ +

Click on a site above to display settings and charts.

+
-

Click on a site above to display settings and charts.

-
-
- {if $selectedSite} + {if $selectedSite} -
- Send usage E-mail for site selected above -   Display usage E-mail for site selected above -
> +
+ Send usage E-mail for site selected above +   Display usage E-mail for site selected above +
- {/if} + {/if} + + {include file="ui/f6/miscContainer-end.html"} {include file="ui/f6/section-end.html"} {* Section Start *} + {$ui = [ + 'title' => 'Settings for Selected Site' + ]} + {include file="ui/f6/section-start.html"} + + {* target *} {$ui = [ - 'title' => 'Settings for Selected Site' + 'field' => 'target', + 'value' => {$settings.target|string_format:"%.1f"}, + 'label' => 'Monthly Traffic Target', + 'required' => true, + 'placeholder' => 'i.e. 2.000 for 2 Gigabytes' ]} - {include file="ui/f6/section-start.html"} + {include file="ui/f6/text.html"} {* disk_target *} - {$ui = [ - 'field' => 'disk_target', - 'value' => {$settings.target|string_format:"%.1f"}, - 'label' => 'Monthly Traffic Target', - 'required' => true - ]} - {include file="ui/f6/text.html"} - - - {* disk_target *} - {$ui = [ - 'field' => 'disk_target', - 'value' => {$settings.disk_target|string_format:"%.1f"}, - 'label' => 'Disk Space Used Target', - 'required' => true, - 'placeholder' => 'i.e. 2.000 for 2 Gigabytes' - ]} - {include file="ui/f6/text.html"} + {$ui = [ + 'field' => 'disk_target', + 'value' => {$settings.disk_target|string_format:"%.1f"}, + 'label' => 'Disk Space Used Target', + 'required' => true, + 'placeholder' => 'i.e. 2.000 for 2 Gigabytes' + ]} + {include file="ui/f6/text.html"} - {* disk_target *} - {$ui = [ - 'field' => 'cust_contact', - 'value' => {$settings.cust_contact}, - 'label' => 'Customer Contact E-Mail', - 'required' => true - ]} - {include file="ui/f6/text.html"} + {* cust_contact *} + {$ui = [ + 'field' => 'cust_contact', + 'value' => {$settings.cust_contact}, + 'label' => 'Customer Contact E-Mail', + 'required' => true + ]} + {include file="ui/f6/text.html"} {include file="ui/f6/section-end.html"} {* Section Start *} - {$ui = [ - 'title' => 'Global Settings' - ]} - {include file="ui/f6/section-start.html"} + {$ui = [ + 'title' => 'Global Settings' + ]} + {include file="ui/f6/section-start.html"} {* Reporting Threshold *} - {$ui = [ - 'field' => 'threshold', - 'value' => {$threshold|string_format:"%.0f"}, - 'label' => 'Reporting Threshold %', - 'required' => true, - 'min' => 0, - 'max' => 200, - 'width' => 5, - 'helpText' => 'Percentage above which target percentage should be highlighted in red and site contacts will receive E-Mail reports.' - ]} - {include file="ui/f6/number.html"} + {$ui = [ + 'field' => 'threshold', + 'value' => {$threshold|string_format:"%.0f"}, + 'label' => 'Reporting Threshold %', + 'required' => true, + 'min' => 0, + 'max' => 200, + 'width' => 5, + 'helpText' => 'Percentage above which target percentage should be highlighted in red and site contacts will receive E-Mail reports.' + ]} + {include file="ui/f6/number.html"} {include file="ui/f6/section-end.html"} - {/if} - - - - - - - {include file="ui/f6/grid-end.html"} - - {/if} - - -
Customer Section
- - -
-
- Explanation of Usage and Graphs -   Print Page - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Traffic - The data sent and received by this Web site. - Traffic is displayed below in Megabytes or Gigabytes. - A byte is roughly equivalent to one character, a Megabyte is roughly one Million characters, - and a Gigabyte is roughtly one Trillion characters. -
Incoming - Requests from a user for Web pages or other data sent to the Website including any - uploaded images or files. -
Outgoing - Data sent to users of your site including all Web pages, images, and files requested - by the user. Note that this line may be covered by the Total (blue) line where they are the same. -
Total - Total of all incoming and outgoing data. This is the value that is compared to the - the Target data traffic for billing purposes. -
Traffic Target - The maximum total monthly traffic expected for your Website. - You are billed based on this target. If your "Total" traffic regularly exceeds this, you will be contacted - to discuss increasing this target. This value is represented by the dotted line on the - "Monthly Traffic" graph. -
Disk Space Used   - The greatest amount of server disk space consumed by this Web site and all associated data during the measurement period. - Disk Space Used is displayed in Gigabytes. -
Disk Space Target - The maximum disk storage space your Website is expected to use. - You are billed for data storage based on this target. If the "Disk Space Used" regularly exceeds this, you will be contacted - to discuss increasing this target. This value is represented by the dotted line on the - "Monthly Disk Space Used" graph. -
-
- - -
- + {* Submit Button *} + {$ui = [ + 'class' => 'primary', + 'label' => 'Update Site Settings', + 'submit' => true + ]} + {include file="ui/f6/submit.html"} + + {include file="ui/f6/grid-end.html"} + + {include file="ui/f6/form-end.html"} + + {/if} {* /is provider *} + +
Customer Section
+ + +
+
+ Explanation of Usage and Graphs +   Print Page + +
+ - + + + - - + - - - + + + - - - + - - - + + + - - - - - {$serverStats.lastMonth.data_total|string_format:"%.3f"} Gigabytes + + - - {$serverStats.trafficDiff.percent|string_format:"%.0f"}% - + + + - - {$serverStats.trafficDiff.diskPercent|string_format:"%.0f"}% -
 TrafficTarget% of TargetStoragetarget% of Target
Traffic + The data sent and received by this Web site. + Traffic is displayed below in Megabytes or Gigabytes. + A byte is roughly equivalent to one character, a Megabyte is roughly one Million characters, + and a Gigabyte is roughtly one Trillion characters. +
Yesterday: - {$serverStats.yesterday.data_total|string_format:"%.3f"} Megabytes
+
Incoming + Requests from a user for Web pages or other data sent to the Website including any + uploaded images or files.    - {$serverStats.yesterday.storage|string_format:"%.3f"} Gigabytes +
Outgoing + Data sent to users of your site including all Web pages, images, and files requested + by the user. Note that this line may be covered by the Total (blue) line where they are the same.  
This Month: - {$serverStats.thisMonth.data_total|string_format:"%.3f"} Gigabytes
+
Total + Total of all incoming and outgoing data. This is the value that is compared to the + the Target data traffic for billing purposes.    - {$serverStats.thisMonth.storage|string_format:"%.3f"} Gigabytes +
Traffic Target + The maximum total monthly traffic expected for your Website. + You are billed based on this target. If your "Total" traffic regularly exceeds this, you will be contacted + to discuss increasing this target. This value is represented by the dotted line on the + "Monthly Traffic" graph.   
Last Month: Disk Space Used   + The greatest amount of server disk space consumed by this Web site and all associated data during the measurement period. + Disk Space Used is displayed in Gigabytes. {$target|string_format:"%.1f"} Gigabytes - {$serverStats.lastMonth.storage*1000|string_format:"%.1f"} Gigabytes +
Disk Space Target + The maximum disk storage space your Website is expected to use. + You are billed for data storage based on this target. If the "Disk Space Used" regularly exceeds this, you will be contacted + to discuss increasing this target. This value is represented by the dotted line on the + "Monthly Disk Space Used" graph. {$diskTarget|string_format:"%.3f"} Gigabytes
- -

- Color Key: Target, Storage, Incoming, Outgoing, Total
-

-
- -
-
- Monthly traffic totals for the past year. The dotted line is our current/planned billing level. -
-
+ + +
+ + -
-
- Montlhy maximum disk space used for past year. The dotted line is our current/planned billing level. +
+ + + + + + + + + + + + + + + + + + + + + + + + {$serverStats.lastMonth.data_total|string_format:"%.3f"} Gigabytes + + + {$serverStats.trafficDiff.percent|string_format:"%.0f"}% + + + {$serverStats.trafficDiff.diskPercent|string_format:"%.0f"}% + +
 TrafficTarget% of TargetStoragetarget% of Target
Yesterday: + {$serverStats.yesterday.data_total|string_format:"%.3f"} Megabytes
+
   + {$serverStats.yesterday.storage|string_format:"%.3f"} Gigabytes +  
This Month: + {$serverStats.thisMonth.data_total|string_format:"%.3f"} Gigabytes
+
   + {$serverStats.thisMonth.storage|string_format:"%.3f"} Gigabytes +   
Last Month: {$target|string_format:"%.1f"} Gigabytes + {$serverStats.lastMonth.storage*1000|string_format:"%.1f"} Gigabytes + {$diskTarget|string_format:"%.3f"} Gigabytes
+ +

+ Color Key: Target, Storage, Incoming, Outgoing, Total
+

+
+ +
+
+ Monthly traffic totals for the past year. The dotted line is our current/planned billing level. +
+
-
-
-
-
- Detail traffic for past 24 hours. +
+
+ Montlhy maximum disk space used for past year. The dotted line is our current/planned billing level. +
+
-
-
-
-
- Daily traffic for past two months. +
+
+ Detail traffic for past 24 hours. +
+
-
-
-
-
-
-
+
+
+ Daily traffic for past two months. +
+
+
+ +
+ + + + {/if} {* /!$haveStats *} @@ -461,8 +478,8 @@ }); - {/if} -{/if} + +{/if} {* /!$connected *} {include file='footer.html'} diff --git a/views/ui/f6/form-end.html b/views/ui/f6/form-end.html new file mode 100644 index 0000000..608a1a2 --- /dev/null +++ b/views/ui/f6/form-end.html @@ -0,0 +1,5 @@ +{* + Foundation 6 UI - Form End + +*} + diff --git a/views/ui/f6/form-start.html b/views/ui/f6/form-start.html new file mode 100644 index 0000000..b1ec936 --- /dev/null +++ b/views/ui/f6/form-start.html @@ -0,0 +1,38 @@ +{* + Foundation 6 UI - Form Start + + {$ui = [ + 'action' => string Required URL + 'method' => string Required Method "POST" or "GET" + 'id' => string Form id + 'File' => boolean If including file upload set to true + 'validate' => boolean If true, include Abide Form Validation + 'validateFocusMsg' => boolean If true focuses on validateMessage on error + 'validateID' => string Unique text that will be added to the validate message container to ensure that it is unique + 'validateMessage' => string Message to show when validattion error, If not provided will use "There are some errors in your form." + ]} +*} +{$validateMessage = "There are some errors in your form."} +{if !empty($ui.validate)}{$validateMessage = $ui.validateMessage}{/if} + +
+ {if !empty($ui.validate)} + + {if !empty(validateFocusMsg)} + + {/if} + {/if} + diff --git a/views/ui/f6/miscContainer-end.html b/views/ui/f6/miscContainer-end.html new file mode 100644 index 0000000..df34286 --- /dev/null +++ b/views/ui/f6/miscContainer-end.html @@ -0,0 +1,7 @@ +{* + Foundation 6 - Misc Container End + + Used to end teh contain for other content in an form using UI F6. +*} + + diff --git a/views/ui/f6/miscContainer-start.html b/views/ui/f6/miscContainer-start.html new file mode 100644 index 0000000..4677ec3 --- /dev/null +++ b/views/ui/f6/miscContainer-start.html @@ -0,0 +1,7 @@ +{* + Foundation 6 - Misc Container Start + + Used to contain other content in an form using UI F6. +*} + +
diff --git a/views/ui/f6/submit.html b/views/ui/f6/submit.html new file mode 100644 index 0000000..1dbfd56 --- /dev/null +++ b/views/ui/f6/submit.html @@ -0,0 +1,21 @@ +{* + Foundation 6 - Submit Button + + {$ui = [ + 'class' => string Required One of "primary", "secondary", "alert", "success", and "warning" and any addtional desired classes + 'label' => string Required Label text for this field, + 'submit' => boolean True if this is a submit button + 'id' => string Optional ID for this button + 'small' => boolean True to select a small button + ]} +*} + +
+ +
-- 2.17.1