From fbf8036d72a6b14fbb5c44957cb5d532772884b7 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Tue, 11 Mar 2014 09:32:28 +0100 Subject: [PATCH] [CLEANUP] Major structure overhaul for dashboard --- .../dashboard/account_data/_workers.tpl | 15 ++++ .../default.tpl} | 17 +---- .../templates/bootstrap/dashboard/default.tpl | 13 ++-- .../dashboard/{js_api.tpl => js/api.tpl} | 0 .../{js_static.tpl => js/static.tpl} | 0 .../bootstrap/dashboard/network_info.tpl | 15 ---- .../_with_price_graph.tpl} | 0 .../_without_price_graph.tpl} | 0 .../{overview.tpl => overview/default.tpl} | 5 +- .../bootstrap/dashboard/payout_estimates.tpl | 36 --------- .../bootstrap/dashboard/round_shares.tpl | 19 ----- .../round_statistics/prop/_content.tpl | 26 +++++++ .../round_statistics/prop/_footer.tpl | 19 +++++ .../round_statistics/prop/_header.tpl | 19 +++++ .../round_statistics/prop/default.tpl | 16 ++++ .../bootstrap/dashboard/round_stats.tpl | 76 ------------------- .../bootstrap/dashboard/system_stats.tpl | 39 ---------- .../templates/bootstrap/dashboard/workers.tpl | 23 ------ 18 files changed, 108 insertions(+), 230 deletions(-) create mode 100644 public/templates/bootstrap/dashboard/account_data/_workers.tpl rename public/templates/bootstrap/dashboard/{account_data.tpl => account_data/default.tpl} (79%) rename public/templates/bootstrap/dashboard/{js_api.tpl => js/api.tpl} (100%) rename public/templates/bootstrap/dashboard/{js_static.tpl => js/static.tpl} (100%) delete mode 100644 public/templates/bootstrap/dashboard/network_info.tpl rename public/templates/bootstrap/dashboard/{overview_price.tpl => overview/_with_price_graph.tpl} (100%) rename public/templates/bootstrap/dashboard/{overview_no_price.tpl => overview/_without_price_graph.tpl} (100%) rename public/templates/bootstrap/dashboard/{overview.tpl => overview/default.tpl} (72%) delete mode 100644 public/templates/bootstrap/dashboard/payout_estimates.tpl delete mode 100644 public/templates/bootstrap/dashboard/round_shares.tpl create mode 100644 public/templates/bootstrap/dashboard/round_statistics/prop/_content.tpl create mode 100644 public/templates/bootstrap/dashboard/round_statistics/prop/_footer.tpl create mode 100644 public/templates/bootstrap/dashboard/round_statistics/prop/_header.tpl create mode 100644 public/templates/bootstrap/dashboard/round_statistics/prop/default.tpl delete mode 100644 public/templates/bootstrap/dashboard/round_stats.tpl delete mode 100644 public/templates/bootstrap/dashboard/system_stats.tpl delete mode 100644 public/templates/bootstrap/dashboard/workers.tpl diff --git a/public/templates/bootstrap/dashboard/account_data/_workers.tpl b/public/templates/bootstrap/dashboard/account_data/_workers.tpl new file mode 100644 index 00000000..4e3887d1 --- /dev/null +++ b/public/templates/bootstrap/dashboard/account_data/_workers.tpl @@ -0,0 +1,15 @@ + {if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API} + + + + + + + + + + + + +
WorkerHashrateDifficulty
No worker information available
+ {/if} diff --git a/public/templates/bootstrap/dashboard/account_data.tpl b/public/templates/bootstrap/dashboard/account_data/default.tpl similarity index 79% rename from public/templates/bootstrap/dashboard/account_data.tpl rename to public/templates/bootstrap/dashboard/account_data/default.tpl index 332265e3..7ca9e0c2 100644 --- a/public/templates/bootstrap/dashboard/account_data.tpl +++ b/public/templates/bootstrap/dashboard/account_data/default.tpl @@ -41,21 +41,8 @@ - {if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API} - - - - - - - - - - - - -
WorkerHashrateDifficulty
No worker information available
- {/if} + {* Load our worker information template for live-updates on worker status *} + {include file="dashboard/account_data/_workers.tpl"} diff --git a/public/templates/bootstrap/dashboard/default.tpl b/public/templates/bootstrap/dashboard/default.tpl index 866a031c..2dcfa521 100644 --- a/public/templates/bootstrap/dashboard/default.tpl +++ b/public/templates/bootstrap/dashboard/default.tpl @@ -1,12 +1,15 @@ {if $smarty.session.AUTHENTICATED|default}
- {include file="dashboard/overview.tpl"} - {include file="dashboard/round_stats.tpl"} - {include file="dashboard/account_data.tpl"} + {* Load our payout system so we can load some payout specific templates *} + {assign var=PAYOUT_SYSTEM value=$GLOBAL.config.payout_system} + {include file="dashboard/overview/default.tpl"} + {include file="dashboard/round_statistics/$PAYOUT_SYSTEM/default.tpl"} + {include file="dashboard/account_data/default.tpl"}
+ {* Include our JS libraries, we allow a live updating JS and a static one *} {if !$DISABLED_DASHBOARD and !$DISABLED_DASHBOARD_API} - {include file="dashboard/js_api.tpl"} + {include file="dashboard/js/api.tpl"} {else} - {include file="dashboard/js_static.tpl"} + {include file="dashboard/js/static.tpl"} {/if} {/if} diff --git a/public/templates/bootstrap/dashboard/js_api.tpl b/public/templates/bootstrap/dashboard/js/api.tpl similarity index 100% rename from public/templates/bootstrap/dashboard/js_api.tpl rename to public/templates/bootstrap/dashboard/js/api.tpl diff --git a/public/templates/bootstrap/dashboard/js_static.tpl b/public/templates/bootstrap/dashboard/js/static.tpl similarity index 100% rename from public/templates/bootstrap/dashboard/js_static.tpl rename to public/templates/bootstrap/dashboard/js/static.tpl diff --git a/public/templates/bootstrap/dashboard/network_info.tpl b/public/templates/bootstrap/dashboard/network_info.tpl deleted file mode 100644 index 17d14d17..00000000 --- a/public/templates/bootstrap/dashboard/network_info.tpl +++ /dev/null @@ -1,15 +0,0 @@ - - Network Info - - - Difficulty - {$NETWORK.difficulty|number_format:"8"} - Est Next Difficulty - {$NETWORK.EstNextDifficulty|number_format:"8"} (Change in {$NETWORK.BlocksUntilDiffChange} Blocks) - - - Est. Avg. Time per Block - {$NETWORK.EstTimePerBlock|seconds_to_words} - Current Block - {$NETWORK.block} - diff --git a/public/templates/bootstrap/dashboard/overview_price.tpl b/public/templates/bootstrap/dashboard/overview/_with_price_graph.tpl similarity index 100% rename from public/templates/bootstrap/dashboard/overview_price.tpl rename to public/templates/bootstrap/dashboard/overview/_with_price_graph.tpl diff --git a/public/templates/bootstrap/dashboard/overview_no_price.tpl b/public/templates/bootstrap/dashboard/overview/_without_price_graph.tpl similarity index 100% rename from public/templates/bootstrap/dashboard/overview_no_price.tpl rename to public/templates/bootstrap/dashboard/overview/_without_price_graph.tpl diff --git a/public/templates/bootstrap/dashboard/overview.tpl b/public/templates/bootstrap/dashboard/overview/default.tpl similarity index 72% rename from public/templates/bootstrap/dashboard/overview.tpl rename to public/templates/bootstrap/dashboard/overview/default.tpl index e8c2245e..5280f13d 100644 --- a/public/templates/bootstrap/dashboard/overview.tpl +++ b/public/templates/bootstrap/dashboard/overview/default.tpl @@ -5,10 +5,11 @@
+ {* Depending on the price option we need to load a different template so it aligns properly *} {if $GLOBAL.config.price.enabled} - {include file="dashboard/overview_price.tpl"} + {include file="dashboard/overview/_with_price_graph.tpl"} {else} - {include file="dashboard/overview_no_price.tpl"} + {include file="dashboard/overview/_without_price_graph.tpl"} {/if}
diff --git a/public/templates/bootstrap/dashboard/payout_estimates.tpl b/public/templates/bootstrap/dashboard/payout_estimates.tpl deleted file mode 100644 index 9c72688f..00000000 --- a/public/templates/bootstrap/dashboard/payout_estimates.tpl +++ /dev/null @@ -1,36 +0,0 @@ - - {$GLOBAL.config.currency} Estimates - -{if $GLOBAL.config.payout_system != 'pps'} - - Block - {$GLOBAL.userdata.estimates.block|number_format:"8"} - Fees - {$GLOBAL.userdata.estimates.fee|number_format:"8"} - - - Donation - {$GLOBAL.userdata.estimates.donation|number_format:"8"} - Payout - {$GLOBAL.userdata.estimates.payout|number_format:"8"} - -{else} - - in 1 hour - {$GLOBAL.userdata.estimates.hours1|number_format:"8"} - in 24 hours - {($GLOBAL.userdata.estimates.hours24)|number_format:"8"} - - - in 7 days - {($GLOBAL.userdata.estimates.days7)|number_format:"8"} - in 14 days - {($GLOBAL.userdata.estimates.days14)|number_format:"8"} - - -{/if} diff --git a/public/templates/bootstrap/dashboard/round_shares.tpl b/public/templates/bootstrap/dashboard/round_shares.tpl deleted file mode 100644 index b085157a..00000000 --- a/public/templates/bootstrap/dashboard/round_shares.tpl +++ /dev/null @@ -1,19 +0,0 @@ - - Round Shares - - - Est. Shares - {$ESTIMATES.shares|number_format} (done: {$ESTIMATES.percent}%) - - - Pool Valid - {$GLOBAL.roundshares.valid|number_format} - Your Valid - {$GLOBAL.userdata.shares.valid|number_format} - - - Pool Invalid - {$GLOBAL.roundshares.invalid|number_format} {if $GLOBAL.roundshares.valid > 0}({($GLOBAL.roundshares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100)|number_format:"2"}%){else}(0.00%){/if} - Your Invalid - {$GLOBAL.userdata.shares.invalid|number_format} {if $GLOBAL.userdata.shares.valid > 0}({($GLOBAL.userdata.shares.invalid / ($GLOBAL.userdata.shares.valid + $GLOBAL.userdata.shares.invalid) * 100)|number_format:"2"}%){else}(0.00%){/if} - diff --git a/public/templates/bootstrap/dashboard/round_statistics/prop/_content.tpl b/public/templates/bootstrap/dashboard/round_statistics/prop/_content.tpl new file mode 100644 index 00000000..b59261fa --- /dev/null +++ b/public/templates/bootstrap/dashboard/round_statistics/prop/_content.tpl @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + +

Round Shares

Valid

Invalid

Efficiency

My Shares

+

{$GLOBAL.userdata.shares.valid|number_format}

{$GLOBAL.userdata.shares.invalid|number_format}

+

{if $GLOBAL.userdata.shares.valid > 0}{(100 - ($GLOBAL.userdata.shares.invalid / ($GLOBAL.userdata.shares.valid + $GLOBAL.userdata.shares.invalid) * 100))|number_format:"2"}%{else}0.00%{/if}

+

Pool Shares

{$GLOBAL.roundshares.valid|number_format}

{$GLOBAL.roundshares.invalid|number_format}

+

{if $GLOBAL.roundshares.valid > 0}{(100 - ($GLOBAL.roundshares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100))|number_format:"2"}%{else}0.00%{/if}

+

diff --git a/public/templates/bootstrap/dashboard/round_statistics/prop/_footer.tpl b/public/templates/bootstrap/dashboard/round_statistics/prop/_footer.tpl new file mode 100644 index 00000000..13fce496 --- /dev/null +++ b/public/templates/bootstrap/dashboard/round_statistics/prop/_footer.tpl @@ -0,0 +1,19 @@ + diff --git a/public/templates/bootstrap/dashboard/round_statistics/prop/_header.tpl b/public/templates/bootstrap/dashboard/round_statistics/prop/_header.tpl new file mode 100644 index 00000000..5e1d2b05 --- /dev/null +++ b/public/templates/bootstrap/dashboard/round_statistics/prop/_header.tpl @@ -0,0 +1,19 @@ + diff --git a/public/templates/bootstrap/dashboard/round_statistics/prop/default.tpl b/public/templates/bootstrap/dashboard/round_statistics/prop/default.tpl new file mode 100644 index 00000000..cef97314 --- /dev/null +++ b/public/templates/bootstrap/dashboard/round_statistics/prop/default.tpl @@ -0,0 +1,16 @@ +
+
+
+

+ Round statistics +

+
+ {assign var=PAYOUT_SYSTEM value=$GLOBAL.config.payout_system} + {include file="dashboard/round_statistics/$PAYOUT_SYSTEM/_header.tpl"} + {include file="dashboard/round_statistics/$PAYOUT_SYSTEM/_content.tpl"} + {include file="dashboard/round_statistics/$PAYOUT_SYSTEM/_footer.tpl"} + +
+
diff --git a/public/templates/bootstrap/dashboard/round_stats.tpl b/public/templates/bootstrap/dashboard/round_stats.tpl deleted file mode 100644 index cbc1f28a..00000000 --- a/public/templates/bootstrap/dashboard/round_stats.tpl +++ /dev/null @@ -1,76 +0,0 @@ -
-
-
-

- Round statistics -

-
- - - - - - - - - - - - - - - - - - - - - -

Round Shares

Valid

Invalid

Efficiency

My Shares

-

{$GLOBAL.userdata.shares.valid|number_format}

{$GLOBAL.userdata.shares.invalid|number_format}

-

{if $GLOBAL.userdata.shares.valid > 0}{(100 - ($GLOBAL.userdata.shares.invalid / ($GLOBAL.userdata.shares.valid + $GLOBAL.userdata.shares.invalid) * 100))|number_format:"2"}%{else}0.00%{/if}

-

Pool Shares

{$GLOBAL.roundshares.valid|number_format}

{$GLOBAL.roundshares.invalid|number_format}

-

{if $GLOBAL.roundshares.valid > 0}{(100 - ($GLOBAL.roundshares.invalid / ($GLOBAL.roundshares.valid + $GLOBAL.roundshares.invalid) * 100))|number_format:"2"}%{else}0.00%{/if}

-

- - -
-
diff --git a/public/templates/bootstrap/dashboard/system_stats.tpl b/public/templates/bootstrap/dashboard/system_stats.tpl deleted file mode 100644 index 1ad20c5c..00000000 --- a/public/templates/bootstrap/dashboard/system_stats.tpl +++ /dev/null @@ -1,39 +0,0 @@ -
-
-
-

Round Statistics

-
-
- - - {if $GLOBAL.config.payout_system == 'pplns'} - - - - - {elseif $GLOBAL.config.payout_system == 'pps'} - - - - - - - - - - - - - - - - - {/if} - {include file="dashboard/round_shares.tpl"} - {include file="dashboard/payout_estimates.tpl"} - {include file="dashboard/network_info.tpl"} - -
PPLNS Target{$GLOBAL.pplns.target}
Unpaid Shares{$GLOBAL.userdata.pps.unpaidshares}
Baseline PPS Rate{$GLOBAL.ppsvalue|number_format:"12"} {$GLOBAL.config.currency}
Pools PPS Rate{$GLOBAL.poolppsvalue|number_format:"12"} {$GLOBAL.config.currency}
PPS Difficulty{$GLOBAL.userdata.sharedifficulty|number_format:"2"}
-
-
-
diff --git a/public/templates/bootstrap/dashboard/workers.tpl b/public/templates/bootstrap/dashboard/workers.tpl deleted file mode 100644 index 599c25f8..00000000 --- a/public/templates/bootstrap/dashboard/workers.tpl +++ /dev/null @@ -1,23 +0,0 @@ -
-
-
-

Active Worker Information

-
-
- - - - - - - - - - - - - -
WorkerHashrateDifficulty
Loading worker information
-
-
-