feat: preview

This commit is contained in:
2026-04-01 10:13:14 +02:00
parent 8776459ffb
commit 0316e50233
13 changed files with 590 additions and 538 deletions

View File

@@ -11,7 +11,6 @@ from __future__ import annotations
import re
import shlex
from typing import Sequence
from uframe.errors import ParseError
from uframe.ir import (
@@ -594,6 +593,18 @@ component resources(cpu, mem)
component peer_status(name, state)
status "$name" $state
component info_box(title, content)
box light "$title"
text "$content"
component alert_box(title, content)
box heavy "$title"
color f00
text "$content"
component metric(label, value, max, width)
gauge "$label" $value $max $width
''',
"std/status-bar": '''\
component status_bar(label, value, max)
@@ -601,6 +612,13 @@ component status_bar(label, value, max)
component status_item(name, state)
status "$name" $state
component status_row(name1, state1, name2, state2)
row 2
col 28
status "$name1" $state1
col 28
status "$name2" $state2
''',
"std/nav": '''\
component nav_link(label, dest)
@@ -608,6 +626,36 @@ component nav_link(label, dest)
component nav_divider()
divider light
component nav_bar(label1, dest1, label2, dest2)
row 2
col 28
link "$label1" "$dest1"
col 28
link "$label2" "$dest2"
''',
"std/network": '''\
component route_table(title)
table "$title"
component peer_list(title)
heading 2 "$title"
component traffic(label_in, vals_in, label_out, vals_out)
sparkline "$label_in" "$vals_in" 20
sparkline "$label_out" "$vals_out" 20
''',
"std/form": '''\
component search_form(name, action)
form "$name"
field "query" 30 "Search..."
button "Search" "$action"
component login_form(action)
form "login"
field "username" 24 "Username"
password "password" 24 "Password"
button "Login" "$action"
''',
}