From eaf02771d767e4745572d9b00e71e138ee030e60 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Thu, 4 Mar 2021 17:54:03 -0500 Subject: Switch go go 1.16 and use Embed --- cmd/web/index.go | 121 ++----------------------------------------------------- 1 file changed, 4 insertions(+), 117 deletions(-) (limited to 'cmd/web/index.go') diff --git a/cmd/web/index.go b/cmd/web/index.go index 3121384..b90faf8 100644 --- a/cmd/web/index.go +++ b/cmd/web/index.go @@ -3,129 +3,16 @@ package main import ( "html/template" "net/http" + _ "embed" "riedstra.dev/mitch/steam-export/steam" ) var ( - Templ = template.Must(template.New("index").Parse(` - - - - - - - Steam Game index - - + //go:embed templates/index.html + indexTemplate string - - - -{{ if .Local }} - -

Library: {{.Lib.Folder}}

- -
- -
- -
-
- -

About

-

-The steam exporter is designed to let you export your steam games, either to -another local hard drive or another computer on the network. -

-

-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. -

-

- - You can download this application from this UI as well here. - -

- -

-You can give people this link to view the library remotely and download -games from your computer: -

-http://{{.HostIP}}:{{.Port}}/ -

-{{ else }} -

Remote Steam library access

- - - If you need this program to install the games click here. - - -

-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. -

-{{ end }} - -

-Installed games: - -Tip: You can right click and save link as to specify a save location, e.g. -an external hard drive -

- - - -{{ if .Local }} -Delete a game: ( Type out exact name, case sensitive ) - -
- - -
- -Install a game from a URL or local file path: - -
- - -
- -

-Note that You can also give someone a URL to install a game if they're running -this program, e.g.
-http://127.0.0.1:8899/install?uri=http://my-server-ip-or-hostname/download/My Game -

- - -Change library path -
- - -
-{{ end }} - -

Version information

-
{{.Version}}
- - -`)) + Templ = template.Must(template.New("index").Parse(indexTemplate)) ) func index(w http.ResponseWriter, r *http.Request) { -- cgit v1.2.3