~emersion/drmdb

14fa5198d01d3be7741268ce81f4e54dd89875e4 — Simon Ser 6 months ago f599e46
Rename device.html to snapshot.html
3 files changed, 13 insertions(+), 8 deletions(-)

M public/devices.html
R public/{device.html => snapshot.html}
M server.go
M public/devices.html => public/devices.html +1 -1
@@ 18,7 18,7 @@
        {{range .Devices}}
        <tr>
            <td class="pre">
                <a href="/devices/{{.Key}}">{{.BusID}}</a>
                <a href="/snapshots/{{.Key}}">{{.BusID}}</a>
            </td>
            <td>{{.BusType}}</td>
            {{if .Vendor}}

R public/device.html => public/snapshot.html +5 -5
@@ 1,10 1,10 @@
{{template "head" "Device"}}
{{template "head" "Snapshot"}}

<h1>DRM database device</h1>
<h1>DRM database snapshot</h1>

<p>
	<span class="alt-formats">
		<a href="/devices/{{.Key}}.json">.json</a>
		<a href="/snapshots/{{.Key}}.json">.json</a>
	</span>
	<a href="/">Back to index</a>
</p>


@@ 14,7 14,7 @@
	<li><a href="#alt-devices">Other snapshots ({{len .AltDevices}})</a></li>
</ul>

<h2 id="tree">Latest snapshot</h2>
<h2 id="tree">Snapshot</h2>

{{define "formats"}}
<ul>


@@ 240,7 240,7 @@
		{{range .AltDevices}}
		<tr>
			<td class="pre">
				<a href="/devices/{{.Key}}">{{.Key}}</a>
				<a href="/snapshots/{{.Key}}">{{.Key}}</a>
			</td>
			<td>{{.Driver.Name}} {{.Driver.Version.String}}</td>
			{{if .Driver.Kernel.SysName}}

M server.go => server.go +7 -2
@@ 124,7 124,7 @@ func New() *echo.Echo {
			if key, err := db.Store(n); err != nil {
				fmt.Fprintf(c.Response(), "%s: error: %v\n", name, err)
			} else {
				u := "https://" + c.Request().Host + "/devices/" + key
				u := "https://" + c.Request().Host + "/snapshots/" + key
				fmt.Fprintf(c.Response(), "%s: data uploaded to %s\n", name, u)
				success = true
			}


@@ 206,6 206,11 @@ func New() *echo.Echo {
	})

	e.GET("/devices/:key", func(c echo.Context) error {
		key := c.Param("key")
		return c.Redirect(http.StatusFound, "/snapshots/" + key)
	})

	e.GET("/snapshots/:key", func(c echo.Context) error {
		type altDeviceData struct {
			Key    string
			Driver *drmtree.Driver


@@ 259,7 264,7 @@ func New() *echo.Echo {
				return !driverLess(a.Driver, b.Driver)
			})

			return c.Render(http.StatusOK, "device.html", struct {
			return c.Render(http.StatusOK, "snapshot.html", struct {
				Key          string
				Node         *drmtree.Node
				AltDevices   []altDeviceData