[add] server

This commit is contained in:
Andy Bunce 2025-10-18 22:59:51 +01:00
parent 1a6be470ee
commit 41d9e081b5
19 changed files with 88 additions and 693 deletions

View file

@ -56,8 +56,10 @@ State is held in [websocket attributes](https://docs.basex.org/main/WebSocket_Fu
|Name|Use|
|----|---|
|client|the client initialize message|
|id|wsid|
|connectTime|dateTime of connection|
|initialized|set true after client sends initialized message|
|client|the client initialize message|
|files|A map whose keys are open uris, values are maps (doctype-> attribute name where doctype is stored| |
|file-{uuid}|name of websocket attribute containing the textDocument|
|parse-{uuid}|name of websocket attribute containing parse tree XML|

View file

@ -1,37 +0,0 @@
module namespace joba = 'app/jobs';
declare variable $joba:names:=("id","type","state","user","duration","time","start");
(:
id: job ID
type: type of the job (command, query, REST, RESTXQ, etc.)
state: current state of the job: scheduled, queued, running, cached
user: user who started the job
duration: evaluation time (included if a job is running or if the result was cached)
start: next start of job (included if a job will be executed repeatedly)
time: time when job was registered
:)
declare function joba:jobs()
as element(job)*
{
job:list()[. ne job:current()] ! job:list-details(.)
};
declare function joba:table($jobs as element(job)*,$names as xs:string+)
as element(table)
{
<table class="table">
<thead>
<tr>{$names!<th>{ . }</th>}</tr>
</thead>
<tbody>
{for $j in $jobs
return <tr>
{for $n in $names
let $val:= $j/@*[name() eq $n]
return <td>{$val/string()}</td>
}
</tr>}
</tbody>
</table>
};

View file

@ -0,0 +1,19 @@
module namespace wsa = 'app/sockets';
import module namespace ws="http://basex.org/modules/ws";
declare function wsa:wsids()
as xs:string*
{
ws:ids()
};
declare %rest:path('/app/api/sockets')
function wsa:list()
as element(ul)
{
<ul>{
wsa:wsids()!<li><a href="/app/sockets/{.}">{.}</a></li>
}</ul>
};

View file

@ -3,7 +3,7 @@
:)
module namespace app = 'app/common';
import module namespace cm = "app/cm" at "common.xqm";
import module namespace wsa = 'app/sockets' at "api-sockets.xqm";
(:~
: Redirects to the start page.
@ -50,9 +50,25 @@ function app:home() as item()* {
declare %rest:path('/app/sockets')
function app:profile() {
cm:htmx2("sockets.htm", map{})
declare %rest:path('/app/socket')
function app:sockets() {
cm:htmx2("sockets.htm", map{"sockets": wsa:wsids()=>reverse()
,"count":count( wsa:wsids())
})
};
declare %rest:path('/app/socket/{$wsid}')
function app:socket($wsid) {
let $files:=ws:get($wsid,"files")
let $file:= $files($files=>map:keys()=>head())
let $doc:=ws:get($wsid,$file?textDocument)
return cm:htmx2("socket.htm", map{
"wsid": $wsid,
"connectTime": ws:get($wsid,"connectTime"),
"files": map:keys($files),
"file1": json:serialize($file, { 'format': 'w3', 'indent': 'no' }),
"doc": json:serialize($doc, { 'format': 'w3', 'indent': 'no' })
})
};
declare %rest:path('/app/dev')
@ -60,21 +76,3 @@ function app:dev() {
cm:htmx2("dev/home.htm", map{})
};
declare %rest:path('/app/notifications')
function app:notifications() {
cm:htmx2("notifications.htm", map{})
};
declare %rest:path('/app/components')
function app:components() {
cm:htmx2("components.htm", map{})
};
declare %rest:path('/app/tweets')
function app:tweets() {
cm:htmx2("tweets.htm", map{})
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -1,58 +0,0 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title>Components</title>
</head>
<body>
<div layout:fragment="content">
<h2>Components (test page) <a href="/app/static/index.html" target="wc">wc</a></h2>
<p>You have no direct messages
<sl-copy-button value="copy text is easy {Date().now}" copy-label="Click to copy"
success-label="Text copied!" error-label="Whoops, your browser doesn't support this!"></sl-copy-button>
</p>
<sl-tree selection="multiple">
<sl-tree-item lazy="lazy" onsl-lazy-load='{updateLazy}'>Available Trees</sl-tree-item>
</sl-tree>
<script type="module">
const lazyItem = document.querySelector('sl-tree-item[lazy]');
lazyItem.addEventListener('sl-lazy-load', () => {
// Simulate asynchronous loading
setTimeout(() => {
const subItems = ['Birch', 'Cedar', 'Maple', 'Pine'];
for (const item of subItems) {
const treeItem = document.createElement('sl-tree-item');
treeItem.innerText = item;
lazyItem.append(treeItem);
}
// Disable lazy mode once the content has been loaded
lazyItem.lazy = false;
}, 1000);
});
</script>
<hr />
<sl-carousel navigation="navigation" pagination="pagination" slides-per-page="6" slides-per-move="6">
<sl-carousel-item style="background: var(--sl-color-red-200);">Slide 1</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-orange-200);">Slide 2</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-yellow-200);">Slide 3</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-green-200);">Slide 4</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-blue-200);">Slide 5</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-violet-200);">Slide 6</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-red-200);">Slide 21</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-orange-200);">Slide 22</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-yellow-200);">Slide 23</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-green-200);">Slide 24</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-blue-200);">Slide 25</sl-carousel-item>
<sl-carousel-item style="background: var(--sl-color-violet-200);">Slide 26</sl-carousel-item>
</sl-carousel>
<hr />
</div>
</body>
</html>

View file

@ -1,56 +0,0 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title>Jobs home</title>
</head>
<body>
<div layout:fragment="content" class="container-fluid">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Job</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a href="/app/jobs/_" class="nav-link">List</a>
</li>
</ul>
</div>
</nav>
<div class="row">
<div class="col-sm-9 mb-3 mb-sm-0">
<div class="card ">
<div class="card-body">
<h5 class="card-title">Something <span th:text="${count}" />
,covers: <span th:text="${covers}" /></h5>
<ul th:each="pdf: ${pdfs}">
<li th:text="${pdf.slug}">aaa</li>
</ul>
</div>
</div>
</div>
<div class="col-sm-3 mb-3 mb-sm-0">
<div class="card">
<div class="card-body">
<h5 class="card-title">Job tasks</h5>
</div>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
</div>
</body>
</html>

View file

@ -1,28 +0,0 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title>Jobs</title>
</head>
<body>
<div layout:fragment="content" class="container-fluid">
<div class="d-flex ">
<sl-breadcrumb class="flex-grow-1" >
<sl-breadcrumb-item href="/app/jobs">Jobs home</sl-breadcrumb-item>
<sl-breadcrumb-item>jobs <span class="badge bg-secondary">4</span></sl-breadcrumb-item>
</sl-breadcrumb>
<sl-switch id="job-refresh" checked="checked" >Refresh</sl-switch>
</div>
<h2>Jobs</h2>
<hr />
<div hx-get="/app/jobs/table" hx-trigger="every 1s [htmx.find('#job-refresh').checked]" >
Nothing Yet!
</div>
</div>
</body>
</html>

View file

@ -19,20 +19,10 @@
/>
<title>LSP manager</title>
<link rel="icon" href="/app/static/favicon.png" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" media="(prefers-color-scheme:light)"
href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.0/cdn/themes/light.css" />
<link rel="stylesheet" media="(prefers-color-scheme:dark)"
href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.15.0/cdn/themes/dark.css"
onload="document.documentElement.classList.add('sl-theme-dark');" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.1/cdn/shoelace.js"></script>
<link rel="stylesheet" href="https://unpkg.com/missing.css@1.2.0" />
<link rel="stylesheet" href="/app/static/styles.css" />
<script defer="defer" src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script defer="defer" src="/app/static/htmx/2.0.4/htmx.min.js"></script>
<script defer="defer" src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.bundle.min.js" integrity="sha256-y3ibfOyBqlgBd+GzwFYQEVOZdNJD06HeDXihongBXKs=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.7/dist/htmx.js" integrity="sha384-yWakaGAFicqusuwOYEmoRjLNOC+6OFsdmwC2lbGQaRELtuVEqNzt11c2J711DeCZ" crossorigin="anonymous"></script>
<script defer="defer" src="/app/static/script.js"></script>
@ -40,84 +30,21 @@
<body hx-boost="true" hx-indicator="#indicator" data-bs-theme="light" >
<div class='App'>
<header id="header">
<header id="header" class="navbar">
<nav class="navbar navbar-expand-lg ">
<div class="container-fluid">
<a class="navbar-brand" href="/app">LSP manager</a>
<sl-icon id="indicator" class="htmx-indicator" src="/app/static/loader.svg" ></sl-icon>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/app/home">Home</a>
<nav >
<ul role="list">
<li >
<a class="active" aria-current="page" href="/app/home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/app/sockets">connections </a>
</li>
<li class="nav-item">
<a class="nav-link" href="/app/jobs">jobs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/app/dev">dev</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/app/tweets">tweets</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/app/components">components</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/app/test">test</a>
</li>
<li class="nav-item">
<sl-input placeholder="search..." clearable="clearable" aria-label="Search">
<sl-icon name="search" slot="prefix"></sl-icon>
</sl-input>
<li >
<a href="/app/socket">connections </a>
</li>
</ul>
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link " href="/app/profile">
<sl-avatar label="User avatar" style="--size: 2.0rem;"></sl-avatar>
</a>
</li>
<li class="nav-item">
<a class="nav-link " href="/app/notifications">
<sl-avatar label="User avatar" style="--size: 2.0rem;">
<sl-icon slot="icon" name="bell"></sl-icon>
</sl-avatar>
</a>
</li>
</ul>
<sl-dropdown>
<sl-avatar slot="trigger" label="theme" style="--size: 2.0rem;">
<sl-icon slot="icon" name="circle-half"></sl-icon>
</sl-avatar>
<sl-menu>
<sl-menu-item> <sl-icon slot="prefix" name="sun-fill"></sl-icon>Light</sl-menu-item>
<sl-menu-item> <sl-icon slot="prefix" name="moon-fill"></sl-icon>Dark</sl-menu-item>
<sl-divider></sl-divider>
<sl-menu-item type="checkbox" checked="checked"> <sl-icon slot="prefix"
name="circle-half"></sl-icon>System</sl-menu-item>
</sl-menu>
</sl-dropdown>
</div>
</div>
</nav>
</header>
@ -126,31 +53,15 @@
</main>
<footer id="footer">
<button onclick="toast('Hi. '+new Date())">toast</button>
<sl-alert>hi</sl-alert>
LoggedIn: ??
<button type="button" class="btn btn-primary" id="liveToastBtn">Show live toast</button>
<sl-tooltip>
<div id="server-timing" slot="content"/>
<sl-icon name="stopwatch"></sl-icon>
</sl-tooltip>
</footer>
</div>
<!-- bootstrap toast -->
<div class="position-fixed bottom-0 end-0 p-3">
<div id="toast" class="toast align-items-center text-white bg-success border-0" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="me-auto">Bootstrap</strong>
<small>? mins ago</small>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div id="toast-body" class="toast-body">detail here</div>
</div>
</div>
</body>

View file

@ -1,15 +0,0 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title>Notifications</title>
</head>
<body>
<div layout:fragment="content" class="container-fluid">
<h1>Notifications</h1>
</div>
</body>
</html>

View file

@ -1,78 +0,0 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title>PDF home</title>
</head>
<body>
<div layout:fragment="content" class="container-fluid">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">PDF</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a href="/app/pdfs/_" class="nav-link">List</a>
</li>
<li class="nav-item">
<a href="/app/pdfs/settings" class="nav-link">Settings</a>
</li>
</ul>
</div>
</nav>
<div class="row">
<div class="col-sm-9 mb-3 mb-sm-0">
<div class="card ">
<div class="card-body">
<h5 class="card-title">PDF slugs <span th:text="${count}" />
,covers: <span th:text="${covers}" /></h5>
<ul th:each="pdf: ${pdfs}">
<li th:text="${pdf.slug}">aaa</li>
</ul>
</div>
</div>
</div>
<div class="col-sm-3 mb-3 mb-sm-0">
<div class="card">
<div class="card-body">
<h5 class="card-title">PDF tasks</h5>
<form layout="column items:start gap">
<div class="row mb-3">
<button name="action" value="delete" hx-confirm="Delete all covers?" hx-post="/app/pdfs"
hx-target="#aresponse">
Delete covers
</button>
<span id="aresponse" />
</div>
<hr />
<div class="row mb-3">
update covers
<button name="action" value="update" hx-confirm="create all covers?" hx-post="/app/pdfs"
hx-target="#bresponse">
update covers
</button>
<span id="bresponse" />
</div>
</form>
</div>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
</div>
</body>
</html>

View file

@ -1,16 +0,0 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title>PDF-view</title>
</head>
<body>
<div layout:fragment="content">
<iframe th:src="@{/pdfs/_/{id}/raw}" src="/pdfs/_/{id}/raw" allowScripts="true"
style="width:100%;height:80vh;overflow:clip;"></iframe>
</div>
</body>
</html>

View file

@ -1,60 +0,0 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title>PDF</title>
</head>
<body>
<div layout:fragment="content" class="container-fluid">
<sl-breadcrumb>
<sl-breadcrumb-item href="/app/pdfs">PDF</sl-breadcrumb-item>
<sl-breadcrumb-item href="/app/pdfs/_">list </sl-breadcrumb-item>
<sl-breadcrumb-item><span th:text="${id}">#</span></sl-breadcrumb-item>
</sl-breadcrumb>
<div class="card-group">
<div class="card">
<img th:src="@{/pdfs/_/{id}/cover}" src="" class="card-img-top object-fit-contain" alt="Image of cover page."
style="height: 75vh;" />
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional
content. This card has even longer content than the first to show that equal height action.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Tasks</h5>
<div class="card-text">
<div class="btn-group-vertical" role="group" aria-label="Button group with nested dropdown">
<button type="button" class="btn btn-primary">1</button>
<button type="button" class="btn btn-primary">2</button>
<div class="btn-group" role="group">
<button id="btnGroupDrop1" type="button" class="btn btn-primary dropdown-toggle"
data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</button>
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop1">
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
</ul>
</div>
</div>
</div>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
</div>
</body>
</html>

View file

@ -1,53 +0,0 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title>Pdfs</title>
</head>
<body>
<div layout:fragment="content" class="container-fluid">
<sl-breadcrumb>
<sl-breadcrumb-item href="/app/pdfs">PDF</sl-breadcrumb-item>
<sl-breadcrumb-item>list (<span th:text="${count}">#</span>)</sl-breadcrumb-item>
</sl-breadcrumb>
<div style="display:flex;flex-wrap:wrap;flex-direction:row;gap:10px;">
<sl-card th:each="pdf: ${pdfs}" class="card-overview">
<div slot="header">
<sl-tooltip>
<div th:text="${pdf.slug}" slot="content">path</div>
<sl-badge th:text="${pdf.index}">{pdf.index}</sl-badge>
</sl-tooltip>
<sl-copy-button value="" th:value="${pdf.slug}" copy-label="copy PDF path">
</sl-copy-button>
<a th:href="@{/pdfs/_/{pdf.id}/raw}" href="/app/pdfs/_/{pdf.id}/details"><small>{pdf}</small></a>
<sl-button-group label="History">
<sl-icon-button name="file-earmark-pdf" label="Settings"
th:href="@{/pdfs/_/{pdf.id}/view}" href="/app/pdfs/_/{pdf.id}/view"></sl-icon-button>
</sl-button-group>
</div>
<div>
<a th:href="@{/pdfs/_/{pdf.id}}" href="/pdfs/_/{pdf.id}" class="holder center">
<img th:src="@{/pdfs/_/{pdf.id}/cover}" src="" class="img-thumbnail object-fit-contain" loading="lazy"
alt="Image of cover page." style="width:200px;height: 300px;"/>
</a>
</div>
<div slot="footer">
<div>
slug:<br /><small th:text="${pdf.id}">{pdf.id}</small><br />
</div>
</div>
</sl-card>
</div>
</div>
</body>
</html>

View file

@ -1,97 +0,0 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title>Settings</title>
</head>
<body>
<div class="container-fluid" layout:fragment="content">
<sl-breadcrumb>
<sl-breadcrumb-item href="/app/pdfs">PDF</sl-breadcrumb-item>
<sl-breadcrumb-item>settings</sl-breadcrumb-item>
</sl-breadcrumb>
<form method="post" action="/app/pdfs/settings" layout="column items:start gap" class="input-validation-required container">
<fieldset>
<legend>Settings</legend>
<div class="row mb-3">
<label for="inputdp" class="col-sm-2 col-form-label text-end">dataPath</label>
<div class="col-sm-8">
<sl-input id="inputdp" name="dataPath"
clearable="clearable" filled="filled" required="required" value="{settings.dataPath}"
th:value="${ settings.dataPath }"
help-text="Root folder on server containing data files e.g.'/data/'"></sl-input>
<div th:text="${error.dataPath}" class='error-message'></div>
</div>
</div>
<hr />
<div class="row mb-3 ">
<label for="inputdrop" class="col-sm-2 col-form-label text-end">drop</label>
<div class="col-sm-8">
<sl-input id="inputdrop" name="drop"
clearable="clearable" filled="filled"
value="{settings.drop}" th:value="${ settings.drop }" help-text="optional sub-folder of dataPath e.g. drop-01e/"></sl-input>
<div th:text="${error.drop}" class='error-message'></div>
</div>
</div>
<hr />
<div class="row mb-3">
<label for="selectam" class="col-sm-2 col-form-label text-end">Animation</label>
<div class="col-sm-8">
<sl-select id="selectam" name="animation" value="{settings.animation}" th:value="${ settings.animation }"
filled="filled" help-text="Animation for page transistions.">
<sl-option value="">None</sl-option>
<sl-option value="fade">Fade</sl-option>
<sl-option value="slide-fade">slide-fade</sl-option>
<sl-option value="bounce">bounce</sl-option>
</sl-select>
<div class='error-message'></div>
</div>
</div>
<hr />
</fieldset>
<div class="mx-auto" style="width: 600px;">
<sl-button type="submit" variant="primary">Save</sl-button>
<sl-button type="reset">Reset to default values</sl-button>
</div>
</form>
</div>
<style>
.errors {
background-color: red;
}
.label-on-left {
--label-width: 8rem;
--gap-width: 1rem;
}
.label-on-left+.label-on-left {
margin-top: var(--sl-spacing-medium);
}
.label-on-left::part(form-control) {
display: grid;
grid: auto / var(--label-width) 1fr;
gap: var(--sl-spacing-3x-small) var(--gap-width);
align-items: center;
}
.label-on-left::part(form-control-label) {
text-align: right;
}
.label-on-left::part(form-control-help-text) {
grid-column-start: 2;
}
</style>
</body>
</html>

View file

@ -0,0 +1,24 @@
<!DOCTYPE HTML5>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout.htm}">
<head>
<title th:text="${wsid}">socket</title>
</head>
<body>
<div layout:fragment="content" class='ProfileIndex'>
<h2><span th:text="${wsid}">#</span> @ <span th:text="${connectTime}">#</span></h2>
<ul>
<li th:each="file: ${files}">
<a th:href="@{~/app/socket/{soc}}" href="#socket"><small th:text="${soc}">socket</small></a>
<span th:text="${file}">soc</span>
</li>
</ul>
<hr />
<div th:text="${file1}">doc</div>
<div th:text="${doc}">doc</div>
</div>
</body>
</html>

View file

@ -8,8 +8,13 @@
<body>
<div layout:fragment="content" class='ProfileIndex'>
<h2>{uid} profile</h2>
<hr />
<h2>Active sockets <span th:text="${count}">#</span></h2>
<ul>
<li th:each="soc: ${sockets}">
<a th:href="@{~/app/socket/{soc}}" href="#socket"><small th:text="${soc}">socket</small></a>
<span th:text="${soc}">soc</span>
</li>
</ul>
<hr />
</div>
</body>

View file

@ -1,67 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout.htm}"
xmlns:th="http://www.thymeleaf.org" >
<head>
<title>Tweets</title>
</head>
<body>
<div layout:fragment="content" class='Home' >
<h2>Tweets</h2>
<div class='Tweet'>
<div class='Tweet-author'>
<a href="/app/profile/{uid}"
th:href="@{/profile/{uid}(uid='dan_abramov')}">Dan Abramov @dan_abramov</a>
</div>
<div class='Tweet-time'>
<sl-relative-time date="2020-07-15T09:17:00-04:00">2020-07-15T09:17:00-04:00</sl-relative-time>
</div>
<div class='Tweet-content'>Another use case for 'this.context' I think might be valid: forms. They're too painful right now.</div>
</div>
<div class='Tweet'>
<div class='Tweet-author'>
<a href="/app/profile/{uid}"
th:href="@{profile/{uid}(uid=afanasjevas)}"
>Eduardas Afanasjevas @afanasjevas</a>
</div>
<div class='Tweet-time'>
<sl-relative-time date="2024-04-15T09:17:00-04:00">2024-04-15T09:17:00-04:00</sl-relative-time></div>
<div class='Tweet-content'>I just published “What will Datasmoothie bring to the analytics startup landscape?” https://medium.com/@afanasjevas/what-will-datasmoothie-bring-to-the-analytics-startup-landscape-f7dab70d75c3?source=tw-81c4e81fe6f8-1427630532296</div>
</div>
<div class='Tweet'>
<div class='Tweet-author'>
<a href="/app/profile/{uid}"
th:href="@{profile/{uid}(uid=LNUGorg)}"
>LNUG @LNUGorg</a>
</div>
<div class='Tweet-time'>52m52 minutes ago</div>
<div class='Tweet-content'> new talks uploaded on our YouTube page - check them out http://bit.ly/1yoXSAO</div>
</div>
<style>
.Tweet {
border: 1px solid #eee;
border-radius: 3px;
padding: 10px;
border-bottom: none;
}
.Tweet:last-child {
border-bottom: 1px solid #eee;
}
.Tweet-author {
font-weight: bold;
display: inline-block;
}
.Tweet-time {
color: #888;
display: inline-block;
margin-left: 20px;
font-size: 12px;
}
</style>
</div>
</body>
</html>

View file

@ -20,6 +20,7 @@ function lsp-ws:connect() as empty-sequence() {
let $id:=ws:id()=>trace("CONNECT: ")
return (
ws:set($id, "id", $id),
ws:set($id, "connectTime", current-dateTime()),
ws:set($id, "initialized", false())
)
};