feat(ui): replace configuration editors with graphical forms
CI / javascript-check (push) Successful in 14s
CI / container-policy (push) Successful in 4s
CI / python-tests (push) Successful in 1m48s
CI / container-verify (push) Skipped
CI / container-publish (push) Successful in 49s

This commit is contained in:
BartelLuis
2026-09-14 21:52:39 +02:00
parent 9a6dea34c4
commit 7b979e6243
22 changed files with 1603 additions and 81 deletions
+9 -3
View File
@@ -7,6 +7,7 @@ from http.cookiejar import CookieJar
import json
import os
from pathlib import Path
import re
import secrets
import socket
import ssl
@@ -77,13 +78,18 @@ def main():
form = urllib.parse.urlencode({"username":"smoke-admin","password":password}).encode()
with opener.open(urllib.request.Request(base+"/auth/login",data=form,headers={"Origin":base}),timeout=5) as response:
assert response.status == 200
assert b"/static/app.js" in response.read()
page = response.read()
assert b"/static/app.js" in page
with request("/api/v1/me") as response:
csrf = json.load(response)["csrf_token"]
with request("/api/v1/hosts",{"fqdn":"smoke.example.net","site":"isolated-test","management_ip":"192.0.2.11/24","identities":[{"kind":"serial","value":"SMOKE-ONLY"}]},csrf) as response:
host_id = json.load(response)["id"]
with opener.open(base+"/static/app.js",timeout=5) as response:
assert response.status == 200 and len(response.read())>1000
assets = set(re.findall(rb'(?:src|href)="(/static/[^\"]+)"', page))
assert b"/static/installation-form.js" in assets
assert b"/static/module-forms.js" in assets
for asset in assets:
with opener.open(base+asset.decode(),timeout=5) as response:
assert response.status == 200 and response.read(), asset
process.terminate()
process.wait(timeout=15)
process = start()