Skip to content

Commit

Permalink
feat: implement simple UI for the Image Service
Browse files Browse the repository at this point in the history
Fixes #18

The intention is to provide educational frontend so that people can get
comfortable using the Image Service by building the appropriate links.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Sep 14, 2023
1 parent cf73db9 commit 2f92d92
Show file tree
Hide file tree
Showing 22 changed files with 2,060 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2023-08-10T17:01:31Z by kres c620938.
# Generated on 2023-09-14T14:25:42Z by kres latest.

_out
node_modules/
7 changes: 6 additions & 1 deletion .kres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,9 @@ spec:
---
kind: auto.CI
spec:
provider: drone
provider: drone
---
kind: common.Build
spec:
ignoredPaths:
- node_modules/
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ require (
github.com/sigstore/cosign/v2 v2.2.0
github.com/stretchr/testify v1.8.4
go.uber.org/zap v1.25.0
golang.org/x/net v0.15.0
golang.org/x/sync v0.3.0
golang.org/x/sys v0.11.0
golang.org/x/sys v0.12.0
gopkg.in/yaml.v3 v3.0.1
)

Expand Down Expand Up @@ -286,13 +287,12 @@ require (
go.step.sm/crypto v0.35.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go4.org/netipx v0.0.0-20230728184502-ec4c8b891b28 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.11.0 // indirect
golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1616,8 +1616,8 @@ golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2Uz
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -1717,8 +1717,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -1857,17 +1857,17 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo=
golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1882,8 +1882,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
3 changes: 3 additions & 0 deletions internal/frontend/http/css/input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions internal/frontend/http/css/output.css

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added internal/frontend/http/favicons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added internal/frontend/http/favicons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added internal/frontend/http/favicons/favicon.ico
Binary file not shown.
12 changes: 12 additions & 0 deletions internal/frontend/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import (
"context"
"errors"
"fmt"
"io/fs"
"net/http"
"net/url"

"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/julienschmidt/httprouter"
"github.com/siderolabs/gen/ensure"
"github.com/siderolabs/gen/xerrors"
"go.uber.org/zap"
"golang.org/x/sync/singleflight"
Expand Down Expand Up @@ -97,6 +99,16 @@ func NewFrontend(logger *zap.Logger, flavorService *flvr.Service, assetBuilder *
frontend.router.GET("/versions", frontend.wrapper(frontend.handleVersions))
frontend.router.GET("/version/:version/extensions/official", frontend.wrapper(frontend.handleOfficialExtensions))

// UI
frontend.router.GET("/", frontend.wrapper(frontend.handleUI))
frontend.router.HEAD("/", frontend.wrapper(frontend.handleUI))
frontend.router.GET("/ui/flavor-config", frontend.wrapper(frontend.handleUIFlavorConfig))
frontend.router.GET("/ui/versions", frontend.wrapper(frontend.handleUIVersions))
frontend.router.POST("/ui/flavors", frontend.wrapper(frontend.handleUIFlavors))
frontend.router.ServeFiles("/css/*filepath", http.FS(ensure.Value(fs.Sub(cssFS, "css"))))
frontend.router.ServeFiles("/favicons/*filepath", http.FS(ensure.Value(fs.Sub(faviconsFS, "favicons"))))
frontend.router.ServeFiles("/js/*filepath", http.FS(ensure.Value(fs.Sub(jsFS, "js"))))

return frontend, nil
}

Expand Down
1 change: 1 addition & 0 deletions internal/frontend/http/js/htmx.min.js

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions internal/frontend/http/templates/flavor-config.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<div class="mb-6 text-sm">
System Extensions:
</div>

{{ range .Extensions }}
<div class="flex items-center mb-4">
<input
id="{{ .TaggedReference.RepositoryStr }}"
name="ext-{{ .TaggedReference.RepositoryStr }}"
type="checkbox"
value=""
hx-preserve
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
>
<label
for="{{ .TaggedReference.RepositoryStr }}"
class="ml-2 text-sm font-medium text-gray-900 dark:text-gray-300"
>
{{ .TaggedReference.RepositoryStr }} <span class="text-xs">({{ .TaggedReference.TagStr }})</span>
</label>
</div>
{{ end }}

<div class="mb-6">
<label
for="extra-args"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>
Extra kernel command line arguments:
</label>
<input
id="extra-args"
name="extra-args"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
hx-preserve
>
</div>

<div class="mb-6">
<button
type="button"
class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"
hx-post="/ui/flavors"
hx-target="#flavor"
>
Submit
</button>
</div>

<div id="flavor"></div>
85 changes: 85 additions & 0 deletions internal/frontend/http/templates/flavor.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<div class="mb-6">
Your image flavor ID is: <span class="font-mono bg-slate-200 dark:bg-slate-700 p-1">{{ .Flavor }}</span>
</div>

<div class="mb-6 font-mono bg-slate-200 dark:bg-slate-700 p-1 whitespace-pre">{{ .Marshaled }}</div>

<div class="mb-6 prose dark:prose-invert max-w-none">
<h2>Metal ISO</h2>
<dl>
{{ range $arch := .Architectures }}
<dt>{{ $arch }} ISO</dt>
<dd><a href="{{ $arch | printf "metal-%s.iso" | $.ImageBaseURL.JoinPath }}">{{ $arch | printf "metal-%s.iso" | $.ImageBaseURL.JoinPath }}</a></dd>
{{ end }}
</dl>
<h2>Installer Image</h2>
<p>
For the initial Talos install or upgrade use the following installer image:<br>
<span class="font-mono bg-slate-200 dark:bg-slate-700 p-1">{{ .InstallerImage }}</span>
</p>
<h2>PXE Boot (Metal)</h2>
<dl>
{{ range $arch := .Architectures }}
<dt>{{ $arch }} iPXE script</dt>
<dd>{{ $arch | printf "metal-%s" | $.PXEBaseURL.JoinPath }}</dd>
{{ end }}
</dl>
<h2>Disk Images</h2>
<h3>Metal</h3>
<dl>
{{ range $arch := .Architectures }}
<dt>{{ $arch }} metal disk image</dt>
<dd><a href="{{ $arch | printf "metal-%s.raw.xz" | $.ImageBaseURL.JoinPath }}">{{ $arch | printf "metal-%s.raw.xz" | $.ImageBaseURL.JoinPath }}</a></dd>
{{ end }}
</dl>
<h3>AWS</h3>
<dl>
{{ range $arch := .Architectures }}
<dt>{{ $arch }} AWS disk image</dt>
<dd><a href="{{ $arch | printf "aws-%s.raw.xz" | $.ImageBaseURL.JoinPath }}">{{ $arch | printf "aws-%s.raw.xz" | $.ImageBaseURL.JoinPath }}</a></dd>
{{ end }}
</dl>
<h3>GCP</h3>
<dl>
{{ range $arch := .Architectures }}
<dt>{{ $arch }} GCP disk image</dt>
<dd><a href="{{ $arch | printf "gcp-%s.raw.tar.gz" | $.ImageBaseURL.JoinPath }}">{{ $arch | printf "gcp-%s.raw.tar.gz" | $.ImageBaseURL.JoinPath }}</a></dd>
{{ end }}
</dl>
<h3>Azure</h3>
<dl>
{{ range $arch := .Architectures }}
<dt>{{ $arch }} Azure disk image</dt>
<dd><a href="{{ $arch | printf "azure-%s.vhd.xz" | $.ImageBaseURL.JoinPath }}">{{ $arch | printf "azure-%s.vhd.xz" | $.ImageBaseURL.JoinPath }}</a></dd>
{{ end }}
</dl>
<h3>Digital Ocean</h3>
<dl>
{{ range $arch := .Architectures }}
<dt>{{ $arch }} Digital Ocean disk image</dt>
<dd><a href="{{ $arch | printf "digital-ocean-%s.raw.gz" | $.ImageBaseURL.JoinPath }}">{{ $arch | printf "digital-ocean-%s.raw.gz" | $.ImageBaseURL.JoinPath }}</a></dd>
{{ end }}
</dl>
<h3>Hetzner Cloud</h3>
<dl>
{{ range $arch := .Architectures }}
<dt>{{ $arch }} Hetzner Cloud disk image</dt>
<dd><a href="{{ $arch | printf "hcloud-%s.raw.xz" | $.ImageBaseURL.JoinPath }}">{{ $arch | printf "hcloud-%s.raw.xz" | $.ImageBaseURL.JoinPath }}</a></dd>
{{ end }}
</dl>
<h3>Other</h3>
<p>Use the above URLs as a template replacing the last component with a matching path for your platform. See <a href="https://github.com/siderolabs/talos/releases/latest">Talos Linux release assets</a> for examples.</p>
<h2>SecureBoot</h2>
<p>Not fully supported yet, hang tight...</p>
<h2>Various Assets</h2>
<dl>
{{ range $arch := .Architectures }}
<dt>{{ $arch }} kernel</dt>
<dd><a href="{{ $arch | printf "kernel-%s" | $.ImageBaseURL.JoinPath }}">{{ $arch | printf "kernel-%s" | $.ImageBaseURL.JoinPath }}</a></dd>
{{ end }}
{{ range $arch := .Architectures }}
<dt>{{ $arch }} initramfs</dt>
<dd><a href="{{ $arch | printf "initramfs-%s.xz" | $.ImageBaseURL.JoinPath }}">{{ $arch | printf "initramfs-%s.xz" | $.ImageBaseURL.JoinPath }}</a></dd>
{{ end }}
</dl>
</div>
37 changes: 37 additions & 0 deletions internal/frontend/http/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Image Service</title>
<link rel="shortcut icon" href=/favicons/favicon.ico>
<link rel=apple-touch-icon href=/favicons/apple-touch-icon-180x180.png sizes=180x180>
<link rel=icon type=image/png href=/favicons/favicon-16x16.png sizes=16x16>
<link rel=icon type=image/png href=/favicons/favicon-32x32.png sizes=32x32>
<link rel=icon type=image/png href=/favicons/android-chrome-192x192.png sizes=192x192>
<link href="/css/output.css" rel="stylesheet" />
<script src="/js/htmx.min.js"></script>
</head>
<body class="dark:bg-gray-900 antialiased">
<main>
<div class="md:container md:mx-auto">
<div class="prose dark:prose-invert mt-4">
<h1>Talos Linux Image Service</h1>
<p>
Talos Linux Image Service by <a href="https://siderolabs.com/">Sidero Labs, Inc.</a> provides a way to download various boot assets for <a href="https://talos.dev/">Talos Linux</a>.
</p>
<p>
To learn more about the API of the Image Service and available image formats, please visit <a href="https://github.com/siderolabs/image-service">the GitHub repository</a>.
</p>
</div>
<div id="processing" class="htmx-indicator">
<svg aria-hidden="true" class="w-8 h-8 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
<path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
</svg>
<span class="sr-only">Loading...</span>
</div>
<form class="text-gray-900 dark:text-white" hx-trigger="load" hx-get="/ui/versions" hx-indicator="#processing">
</form>
</div>
</main>
</body>
</html>
18 changes: 18 additions & 0 deletions internal/frontend/http/templates/versions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h1 class="mb-4 mt-2 text-2xl font-bold">Create an image flavor</h1>
<div class="mb-6">
<label for="talos-version" class="block mb-2 text-sm font-medium">Choose Talos Version:</label>
<select
id="talos-version"
name="version"
class="w-64 bg-gray-50 border border-gray-300 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500"
hx-target="#flavor-config"
hx-get="/ui/flavor-config"
hx-params="version"
>
<option value="">Select a version</option>
{{ range .Versions }}
<option value="{{ . }}">{{ . }}</option>
{{ end }}
</select>
<fieldset class="mt-6" id="flavor-config"></fieldset>
</div>
Loading

0 comments on commit 2f92d92

Please sign in to comment.