Small improvements

- Removed fake favicon in favor of 204
- Improved table actions (mobile)
This commit is contained in:
adro 2022-02-22 10:34:45 +01:00
parent e171a7fa09
commit 68845fc715
3 changed files with 24 additions and 19 deletions

View File

@ -24,19 +24,21 @@
<td>{{$d.Alias}}</td> <td>{{$d.Alias}}</td>
<td>{{$d.MAC}}</td> <td>{{$d.MAC}}</td>
<td>{{$d.IP}}</td> <td>{{$d.IP}}</td>
<td class="actions"> <td>
<form action="/wake" method="post"> <div class="actions">
<input type="text" name="Alias" value="{{$d.Alias}}" hidden> <form action="/wake" method="post">
<input type="text" name="MAC" value="{{$d.MAC}}" hidden> <input type="text" name="Alias" value="{{$d.Alias}}" hidden>
<input type="text" name="IP" value="{{$d.IP}}" hidden> <input type="text" name="MAC" value="{{$d.MAC}}" hidden>
<input type="submit" value="Wake"> <input type="text" name="IP" value="{{$d.IP}}" hidden>
</form> <input type="submit" value="Wake">
<form action="/remove" method="post"> </form>
<input type="text" name="Alias" value="{{$d.Alias}}" hidden> <form action="/remove" method="post">
<input type="text" name="MAC" value="{{$d.MAC}}" hidden> <input type="text" name="Alias" value="{{$d.Alias}}" hidden>
<input type="text" name="IP" value="{{$d.IP}}" hidden> <input type="text" name="MAC" value="{{$d.MAC}}" hidden>
<input type="submit" value="Remove"> <input type="text" name="IP" value="{{$d.IP}}" hidden>
</form> <input type="submit" value="Remove">
</form>
</div>
</td> </td>
</tr> </tr>
{{end}} {{end}}
@ -63,10 +65,9 @@
} }
.actions { .actions {
text-align: center; flex-flow: row wrap;
} justify-content: center;
padding: 0;
.actions > form { gap: 0.5rem;
display: contents;
} }
</style> </style>

View File

@ -5,7 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Small web server to send Wake-on-LAN requests to its local network"> <meta name="description" content="Small web server to send Wake-on-LAN requests to its local network">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon" href="data:,">
<link rel="stylesheet" href="/style.css"> <link rel="stylesheet" href="/style.css">
<title>{{ .Title }} - miniwol</title> <title>{{ .Title }} - miniwol</title>
</head> </head>

View File

@ -28,6 +28,7 @@ func Run() error {
e.GET("/", index) e.GET("/", index)
e.GET("/style.css", style) e.GET("/style.css", style)
e.GET("/favicon.ico", favicon)
e.POST("/auth", auth) e.POST("/auth", auth)
e.POST("/deauth", withAuth(deauth)) e.POST("/deauth", withAuth(deauth))
e.POST("/add", withAuth(add)) e.POST("/add", withAuth(add))
@ -76,3 +77,7 @@ func style(c echo.Context) error {
} }
return c.Blob(200, "text/css", styleData) return c.Blob(200, "text/css", styleData)
} }
func favicon(c echo.Context) error {
return c.NoContent(204)
}