aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/templates/index.html
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2021-04-03 13:09:45 -0400
committerMitchell Riedstra <mitch@riedstra.dev>2021-04-03 13:09:45 -0400
commit1fcb5ee549fa7ba4b7bfa7e62c15dbb8a01c38b5 (patch)
treea7030830b9df35ec761d34a48453ba9108e673dc /cmd/web/templates/index.html
parentae22addfc7984a147aeb80ab14c6b2833a7dc4b2 (diff)
downloadsteam-export-1fcb5ee549fa7ba4b7bfa7e62c15dbb8a01c38b5.tar.gz
steam-export-1fcb5ee549fa7ba4b7bfa7e62c15dbb8a01c38b5.tar.xz
Some changes to make supporting a demo environment easier. Docker compose demo.
Diffstat (limited to 'cmd/web/templates/index.html')
-rw-r--r--cmd/web/templates/index.html45
1 files changed, 40 insertions, 5 deletions
diff --git a/cmd/web/templates/index.html b/cmd/web/templates/index.html
index eaaf722..6f015af 100644
--- a/cmd/web/templates/index.html
+++ b/cmd/web/templates/index.html
@@ -26,15 +26,24 @@
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav me-auto mb-2 mb-md-0">
<li class="nav-item">
+ {{ if .Demo }}
+ <span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip"
+ data-bs-placement="bottom" title="Disabled for demo">
+ <a class="nav-link disabled" aria-current="page" href="#">
+ Download
+ </a>
+ </span>
+ {{ else }}
<a class="nav-link" aria-current="page"
href="/steam-export-web.exe">
Download
</a>
+ {{ end }}
</li>
<li class="nav-item">
<a href="#"
id="shareLink"
- data-clipboard-text="http://{{$.HostIP}}:{{$.Port}}/"
+ data-clipboard-text="{{$.ShareLink}}"
class="nav-link">
Copy Share link
</a>
@@ -69,9 +78,11 @@
Version
</a>
</li>
+ {{if .Demo}}{{else}}
<li class="nav-item">
<a class="nav-link" href="/quit">Shutdown Server/Quit</a>
</li>
+ {{end}}
{{ end }}
</ul>
</div>
@@ -114,28 +125,37 @@
<p>
It also allows you to import games from across the network as well if you
provide an HTTP url from which to download the game file as exported
- from this application.
+ from this application. {{ if .Demo }}Downloads are however disabled for the
+ demo.{{end}}
</p>
<p>
+ {{ if .Demo }}
+ You would normally be able to download the application from here, but it's
+ disabled for the demo. See
+ <a href="https://git.riedstra.dev/mitch/steam-export/about/">here</a> for more info.
+ {{ else }}
<a href="/steam-export-web.exe">
You can download this application from this UI as well here.
</a>
+ {{ end }}
</p>
<p>
You can give people this link to view the library remotely and download
games from your computer:
<br /><br />
- <a href="http://{{.HostIP}}:{{.Port}}/">http://{{.HostIP}}:{{.Port}}/</a>
+ <a href="{{.ShareLink}}">{{.ShareLink}}</a>
</p>
{{ else }}
<h2>Remote Steam library access</h2>
<p>
+ {{ if .Demo }}{{ else }}
<a href="/steam-export-web.exe">
If you need this program to install the games click here.
</a>
+ {{ end }}
</p>
{{ end }}
@@ -167,8 +187,15 @@
<td>{{$key}}</td>
<td>{{$val.GetSize}}</td>
<td>
+ {{if $.Demo}}
+ <span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip"
+ data-bs-placement="left" title="Disabled for demo">
+ <a href="#" class="btn btn-secondary disabled">Download</a>
+ </span>
+ {{ else }}
<a href="/download/{{$key}}" class="btn btn-secondary">Download</a>
- <button data-clipboard-text="http://{{$.HostIP}}:{{$.Port}}/download/{{$key}}" class="btn btn-primary">Copy link</button>
+ {{ end }}
+ <button data-clipboard-text="{{$.ShareLink}}download/{{$key}}" class="btn btn-primary">Copy link</button>
<button data-bs-target="#delete{{$val.Slug}}Modal" data-bs-toggle="modal" class="btn btn-danger">Delete</button>
</td>
</tr>
@@ -357,7 +384,8 @@
</div> <!-- /container -->
-<script src="static/js/bootstrap.min.js"></script>
+<!-- <script src="static/js/bootstrap.min.js"></script> -->
+<script src="static/js/bootstrap.bundle.min.js"></script>
<script src="static/js/clipboard.min.js"></script>
<script src="static/js/tablesort/tablesort.min.js"></script>
<script src="static/js/tablesort/sorts/tablesort.filesize.min.js"></script>
@@ -415,4 +443,11 @@ toast.show()
}
}
</script>
+<script>
+ var tooltipTriggerList =
+ [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
+ var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
+ return new bootstrap.Tooltip(tooltipTriggerEl)
+ })
+</script>
</body>