summaryrefslogtreecommitdiff
path: root/templates/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'templates/dashboard')
-rw-r--r--templates/dashboard/main.hamlet10
-rw-r--r--templates/dashboard/metarefresh.hamlet2
-rw-r--r--templates/dashboard/transfers.hamlet34
3 files changed, 46 insertions, 0 deletions
diff --git a/templates/dashboard/main.hamlet b/templates/dashboard/main.hamlet
new file mode 100644
index 000000000..aa780bdb2
--- /dev/null
+++ b/templates/dashboard/main.hamlet
@@ -0,0 +1,10 @@
+^{content}
+ $if warnNoScript
+ <noscript>
+ <div .navbar .navbar-fixed-bottom>
+ <div .navbar-inner>
+ <div .container>
+ Javascript is disabled; cannot update in real-time.
+ <div .btn-group>
+ <a .btn .btn-primary href="@{NoScriptAutoR}">Auto-refresh every 3 seconds #
+ <a .btn .btn-primary href="@{NoScriptR}">Manually refresh
diff --git a/templates/dashboard/metarefresh.hamlet b/templates/dashboard/metarefresh.hamlet
new file mode 100644
index 000000000..89a2e0b2c
--- /dev/null
+++ b/templates/dashboard/metarefresh.hamlet
@@ -0,0 +1,2 @@
+<noscript>
+ <meta http-equiv="refresh" content="#{show delayseconds}; URL=@{this}">
diff --git a/templates/dashboard/transfers.hamlet b/templates/dashboard/transfers.hamlet
new file mode 100644
index 000000000..1953f9a3c
--- /dev/null
+++ b/templates/dashboard/transfers.hamlet
@@ -0,0 +1,34 @@
+<div .span9 ##{ident}>
+ $if null transfers
+ $else
+ <h2>Transfers
+ $forall (transfer, info) <- transfers
+ $with percent <- maybe "unknown" (showPercentage 0) $ percentComplete transfer info
+ <div .row-fluid>
+ <div .span10>
+ <div .row-fluid>
+ <h3>
+ $maybe file <- associatedFile info
+ #{file}
+ $nothing
+ #{key2file $ transferKey transfer}
+ $case transferDirection transfer
+ $of Upload
+ &rarr;
+ $of Download
+ &larr;
+ <small>#{maybe "unknown" Remote.name $ transferRemote info}</small>
+ $with size <- maybe "unknown" (roughSize dataUnits True) $ keySize $ transferKey transfer
+ $if isJust $ startedTime info
+ <small .pull-right><b>#{percent} of #{size}</b></small>
+ $else
+ <small .pull-right>queued (#{size})</small>
+ <div .row-fluid>
+ <div .progress .progress-striped>
+ <div .bar style="width: #{percent};">
+ <div .btn-group .span2>
+ $if isrunning info
+ ^{actionButton (PauseTransferR transfer) Nothing "btn" "icon-pause"}
+ $else
+ ^{actionButton (StartTransferR transfer) Nothing "btn" "icon-play"}
+ ^{actionButton (CancelTransferR transfer) Nothing "btn" "icon-remove"}