diff options
Diffstat (limited to 'cmd/web/templates')
| -rw-r--r-- | cmd/web/templates/index.html | 45 |
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> |
