diff --git a/README.md b/README.md index 0fabb95..e1661a1 100644 --- a/README.md +++ b/README.md @@ -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| diff --git a/webapp/lsp-manager/api-jobs.xqm b/webapp/lsp-manager/api-jobs.xqm deleted file mode 100644 index 9eaaa58..0000000 --- a/webapp/lsp-manager/api-jobs.xqm +++ /dev/null @@ -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) -{ - - - {$names!} - - - {for $j in $jobs - return - {for $n in $names - let $val:= $j/@*[name() eq $n] - return - } - } - -
{ . }
{$val/string()}
- -}; \ No newline at end of file diff --git a/webapp/lsp-manager/api-sockets.xqm b/webapp/lsp-manager/api-sockets.xqm new file mode 100644 index 0000000..8b5d2d7 --- /dev/null +++ b/webapp/lsp-manager/api-sockets.xqm @@ -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) +{ + + +}; \ No newline at end of file diff --git a/webapp/lsp-manager/app.xqm b/webapp/lsp-manager/app.xqm index ce75122..3d2d264 100644 --- a/webapp/lsp-manager/app.xqm +++ b/webapp/lsp-manager/app.xqm @@ -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{}) -}; - - - diff --git a/webapp/lsp-manager/static/favicon.png b/webapp/lsp-manager/static/favicon.png new file mode 100644 index 0000000..41b0e9a Binary files /dev/null and b/webapp/lsp-manager/static/favicon.png differ diff --git a/webapp/lsp-manager/views/components.htm b/webapp/lsp-manager/views/components.htm deleted file mode 100644 index 67702c2..0000000 --- a/webapp/lsp-manager/views/components.htm +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Components - - - -
-

Components (test page) wc

-

You have no direct messages - -

- - Available Trees - - -
- - Slide 1 - Slide 2 - Slide 3 - Slide 4 - Slide 5 - Slide 6 - Slide 21 - Slide 22 - Slide 23 - Slide 24 - Slide 25 - Slide 26 - - -
-
- - - \ No newline at end of file diff --git a/webapp/lsp-manager/views/job/home.htm b/webapp/lsp-manager/views/job/home.htm deleted file mode 100644 index b40c99f..0000000 --- a/webapp/lsp-manager/views/job/home.htm +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Jobs home - - - -
- - - -
-
-
-
-
Something - ,covers:
-
    -
  • aaa
  • -
-
-
-
-
-
-
-
Job tasks
- - - -
-

Last updated 3 mins ago

-
-
-
-
- - - \ No newline at end of file diff --git a/webapp/lsp-manager/views/job/list.htm b/webapp/lsp-manager/views/job/list.htm deleted file mode 100644 index e31942c..0000000 --- a/webapp/lsp-manager/views/job/list.htm +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Jobs - - - -
-
- - Jobs home - jobs 4 - - Refresh -
- -

Jobs

-
-
- Nothing Yet! -
- -
- - - \ No newline at end of file diff --git a/webapp/lsp-manager/views/layout.htm b/webapp/lsp-manager/views/layout.htm index a7c8160..d6da21f 100644 --- a/webapp/lsp-manager/views/layout.htm +++ b/webapp/lsp-manager/views/layout.htm @@ -19,20 +19,10 @@ /> LSP manager - - - - - - - + - - + @@ -40,84 +30,21 @@
-
- -
- -
- + diff --git a/webapp/lsp-manager/views/notifications.htm b/webapp/lsp-manager/views/notifications.htm deleted file mode 100644 index 93238a5..0000000 --- a/webapp/lsp-manager/views/notifications.htm +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Notifications - - - -
-

Notifications

-
- - - \ No newline at end of file diff --git a/webapp/lsp-manager/views/pdf/home.htm b/webapp/lsp-manager/views/pdf/home.htm deleted file mode 100644 index 94ed1ae..0000000 --- a/webapp/lsp-manager/views/pdf/home.htm +++ /dev/null @@ -1,78 +0,0 @@ - - - - - PDF home - - - -
- - - -
-
-
-
-
PDF slugs - ,covers:
-
    -
  • aaa
  • -
-
-
-
-
-
-
-
PDF tasks
- -
- -
- - -
- -
-
- update covers - - -
- -
- -
-

Last updated 3 mins ago

-
-
-
-
- - - \ No newline at end of file diff --git a/webapp/lsp-manager/views/pdf/item-iframe.htm b/webapp/lsp-manager/views/pdf/item-iframe.htm deleted file mode 100644 index 7e3cea2..0000000 --- a/webapp/lsp-manager/views/pdf/item-iframe.htm +++ /dev/null @@ -1,16 +0,0 @@ - - - - - PDF-view - - - -
- -
- - - \ No newline at end of file diff --git a/webapp/lsp-manager/views/pdf/item.htm b/webapp/lsp-manager/views/pdf/item.htm deleted file mode 100644 index f1b0b59..0000000 --- a/webapp/lsp-manager/views/pdf/item.htm +++ /dev/null @@ -1,60 +0,0 @@ - - - - - PDF - - - -
- - PDF - list - # - - -
-
- Image of cover page. - -
-
-
-
Card title
-

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.

-

Last updated 3 mins ago

-
-
- -
-
-
Tasks
-
-
- - - -
- - -
-
-
-

Last updated 3 mins ago

-
-
- -
-
- - - \ No newline at end of file diff --git a/webapp/lsp-manager/views/pdf/list.htm b/webapp/lsp-manager/views/pdf/list.htm deleted file mode 100644 index be60fff..0000000 --- a/webapp/lsp-manager/views/pdf/list.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Pdfs - - - -
- - PDF - list (#) - - -
- - - -
- -
path
- {pdf.index} -
- - - {pdf} - - - - -
-
- - Image of cover page. - -
-
- -
- slug:
{pdf.id}
-
-
-
- - -
-
- - - \ No newline at end of file diff --git a/webapp/lsp-manager/views/pdf/settings.htm b/webapp/lsp-manager/views/pdf/settings.htm deleted file mode 100644 index 168c1a3..0000000 --- a/webapp/lsp-manager/views/pdf/settings.htm +++ /dev/null @@ -1,97 +0,0 @@ - - - - - Settings - - - -
- - PDF - settings - -
-
- Settings -
- -
- -
-
-
- -
-
- - -
- -
-
-
-
- -
- - -
- - None - Fade - slide-fade - bounce - -
-
-
-
-
-
- Save - Reset to default values -
-
- -
- - - - - \ No newline at end of file diff --git a/webapp/lsp-manager/views/socket.htm b/webapp/lsp-manager/views/socket.htm new file mode 100644 index 0000000..2a1fbbf --- /dev/null +++ b/webapp/lsp-manager/views/socket.htm @@ -0,0 +1,24 @@ + + + + + socket + + + +
+

# @ #

+ +
+
doc
+
doc
+
+ + + \ No newline at end of file diff --git a/webapp/lsp-manager/views/sockets.htm b/webapp/lsp-manager/views/sockets.htm index 6285400..22ef05c 100644 --- a/webapp/lsp-manager/views/sockets.htm +++ b/webapp/lsp-manager/views/sockets.htm @@ -8,8 +8,13 @@
-

{uid} profile

-
+

Active sockets #

+
diff --git a/webapp/lsp-manager/views/tweets.htm b/webapp/lsp-manager/views/tweets.htm deleted file mode 100644 index bf3928f..0000000 --- a/webapp/lsp-manager/views/tweets.htm +++ /dev/null @@ -1,67 +0,0 @@ - - - - -Tweets - - -
-

Tweets

-
- -
- 2020-07-15T09:17:00-04:00 -
-
Another use case for 'this.context' I think might be valid: forms. They're too painful right now.
-
-
- -
- 2024-04-15T09:17:00-04:00
-
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
-
-
- -
52m52 minutes ago
-
new talks uploaded on our YouTube page - check them out http://bit.ly/1yoXSAO
-
- -
- - diff --git a/webapp/lsp/lsp-ws.xqm b/webapp/lsp/lsp-ws.xqm index ddf7389..942b902 100644 --- a/webapp/lsp/lsp-ws.xqm +++ b/webapp/lsp/lsp-ws.xqm @@ -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()) ) };