diff options
Diffstat (limited to 'cmd/web/index.go')
| -rw-r--r-- | cmd/web/index.go | 58 |
1 files changed, 54 insertions, 4 deletions
diff --git a/cmd/web/index.go b/cmd/web/index.go index a4a91c2..87f9e25 100644 --- a/cmd/web/index.go +++ b/cmd/web/index.go @@ -20,11 +20,14 @@ var ( <body> <nav> <a href="/">Home</a> + {{ if .Local }} <div style="display: block; float: right;"> <a href="/quit">Shutdown Server / Quit</a> </div> + {{ end }} </nav> +{{ if .Local }} <h2>Library: {{.Lib.Folder}}</h2> {{ if .Info.Running }} @@ -39,6 +42,42 @@ Error {{.Info.Error}} Downloading from: {{.Info.Url}} {{ end }} </pre></code> +<h3>About</h3> +<p> +The steam exporter is designed to let you export your steam games, either to +another local hard drive or another computer on the network. +</p> +<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. +</p> +<p> +<a href="/steam-export-web.exe"> + You can download this application from this UI as well here. +</a> +</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> +</p> +{{ else }} +<h2>Remote Steam library access</h2> + +<a href="/steam-export-web.exe"> + If you need this program to install the games click here. +</a> + +<p> +Right click and copy the link address to paste into your local machine +if you do not wish to store the archive or have enough space for it on +your drive. +</p> +{{ end }} + <p> Installed games: @@ -54,6 +93,7 @@ an external hard drive {{ end }} </ul> +{{ if .Local }} Delete a game: ( Type out exact name, case sensitive ) <form action="/delete" method="POST"> @@ -80,7 +120,7 @@ Change library path <input type="text" name="path" /> <input type="submit" value="Update"> </form> - +{{ end }} <h3>Version information</h3> <pre><code>{{.Version}}</pre></code> @@ -97,10 +137,20 @@ func index(w http.ResponseWriter, r *http.Request) { err := Templ.ExecuteTemplate(w, "index", struct { - Lib *steam.Library - Info *statusInfo + Lib *steam.Library + Info *statusInfo + Local bool + HostIP string + Port string Version string - }{Lib, status.s, Version}) + }{ + Lib, + status.s, + isLocal(r.RemoteAddr), + getHostIP(), + getPort(), + Version, + }) if err != nil { Logger.Printf("While Rendering template: %s", err) } |
