improve accel ref management

This commit is contained in:
Will Hanlen 2024-06-13 13:04:08 +02:00
parent 9b5c222843
commit a3785c8311
6 changed files with 82 additions and 148 deletions

View File

@ -1,5 +1,6 @@
/@ accel-conf
/@ htmx
/- feather-icons
:- [%accel-conf %$ %htmx]
|= conf=accel-conf
|= =bowl:neo
@ -51,6 +52,7 @@
;form.fc.grow
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=hoon"
=hx-trigger "input changed delay:0.4s from:find textarea"
=hx-on-htmx-after-request "$(this).closest('.top').find('.refresher').emit('accel-refresh');"
=hx-swap "none"
;textarea
=class "p2 bd1 br1 scroll-x pre mono wf grow"
@ -69,135 +71,45 @@
==
++ ref
;div
=morph-no-swap ""
;+ add-dep
;+ deps
==
++ old
;div.fc.trans-root.grow
;form.fc.grow
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=hoon"
=hx-trigger "input changed delay:0.4s from:[name='text'], input changed delay:0.4s from:[name='a']"
=hx-swap "none"
=hx-target "#code-spinner .loading"
=hx-target-400 "#error-code-{id}"
=hx-indicator "#code-spinner"
=row (scow %ud +:x)
=col (scow %ud +:y)
;div.fc.border.grow.basis-half.wf
;+ code-input
;+ (spinner "code")
==
==
;div.fc.border
;+ conf-header
;div.fr
;div.fc.p2
;form.fr.js.hf
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=add-poke"
=hx-swap "none"
=hx-indicator "#code-spinner"
=hx-target "#code-spinner .loading"
;input
=type "text"
=placeholder "/{(scow %p our.bowl)}/shrub/to/poke"
=name "pith"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
;
==
;input
=type "text"
=placeholder "%some-type"
=name "stud"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
;
==
;button
=type "submit"
; Route poke
==
==
==
;div.fc.p2
::
;+ deps
==
==
==
==
++ id
^- tape
%- zing
%+ turn (pout (tail here.bowl))
|= smeg=@ta
%+ weld "--"
(trip smeg)
::
++ x (rear `pith`(snip (snip here.bowl)))
++ y (rear `pith`(snip here.bowl))
++ spinner
|= =tape
;div.b1.loader.p1.s-2.f2
=id (welp tape "-spinner")
;span.loaded: saved
;span.loading: ---
==
++ conf-header
=/ pit=tape (en-tape:pith:neo (snoc (snip here.bowl) %out))
;div.b1.border.fr.jb
;span.p1.mono.s-1: {pit}
;button.br1.border.b1.hover
=style "padding: 4px 8px;"
=type "button"
=pith pit
=onclick "navigator.clipboard.writeText(this.getAttribute('pith'));"
; copy path
==
==
++ code-input
;textarea#input.wf.p2.pre.mono.grow
=name "text"
=placeholder "code"
=spellcheck "false"
=value (trip hoon.conf)
=oninput "this.setAttribute('value', this.value);"
; {(trip hoon.conf)}
==
++ deps
^- manx
?: =(~ crew.conf)
;div.fr: no deps
;div.fr.p2.f3: no deps
;div.fc.g2.p2
;*
%+ turn ~(tap by crew.conf)
|= [=term =pith:neo]
=/ tap (trip term)
;div.fr.g3.ac
;button.bd1.br1.p-1.b1.hover
=hx-post "/neo/sky{(en-tape:pith:neo here.bowl)}?stud=del-dep"
; delete
;label.hidden
=name "name"
=value tap
;
;button.bd1.br1.p-1.b1.hover.loader
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=del-dep"
=hx-swap "outerHTML"
=hx-target "find .loading"
=tap tap
;span.loaded: delete
;span.loading
;+ loading.feather-icons
==
==
;div.f3
=name "name"
; {tap}
==
;div.mono: {(en-tape:pith:neo pith)}
==
==
++ add-dep
;form.fr.js.hf
;form.fr.js.hf.g2
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=add-dep"
=hx-swap "none"
=hx-swap "outerHTML"
=hx-target "find .loading"
=morph-no-swap ""
=row (scow %ud +:x)
=col (scow %ud +:y)
;div.fr.g1
;input.p-1.br1.bd1
=type "text"
=placeholder "name"
@ -216,19 +128,13 @@
=name "pith"
;
==
==
;button.br1.bd1.b1.hover.p-1
;button.br1.bd1.b1.hover.p-1.loader
=type "submit"
; add dep
;span.loaded: add dep
;span.loading
;+ loading.feather-icons
==
==
++ error
|= =tang
;div.pre.mono.p2
;*
%+ turn (scag 25 tang)
|= =tank
;span: {(of-wall:format (~(win re tank) 0 80))}
==
++ script
;script

View File

@ -20,7 +20,6 @@
"""
;+ table
;+ dashboards
;+ refresher
;+ script
==
++ resizer
@ -127,8 +126,9 @@
?: =(0 n) ;div;
;div.fc.jc.ac.b0.p2.f3.s-2: {<n>}
++ dashboards
;div.b0.fc
;div.b0.fc.relative
=style "border-top: 1px solid var(--f2); max-height: 200px;"
;+ refresher
;*
%+ turn (gulf 0 (dec (mul rows cols)))
|= i=@
@ -146,7 +146,7 @@
++ dashboard
|= [x=@ y=@]
;div.grow.fr.af.js.hidden
=style "max-height: 200px;"
=style "max-height: 200px; max-width: 100%;"
=cell "{<x>}-{<y>}"
=morph-retain "class"
;+ (out x y)
@ -159,7 +159,7 @@
=. kids.kid [~ ~]
=. here.kid :(welp here.bowl pax /in)
=. deps.kid ~
;div.basis-half.bd1
;div.basis-half.shrink-0.bd1
=style "min-width: 350px;"
;+
?~ res=(~(get of:neo kids.bowl) (snoc pax %in))
@ -173,8 +173,8 @@
=. kids.kid [~ ~]
=. here.kid (welp here.bowl pax)
=. deps.kid ~
;div.basis-half.bd1.fc.g2
=style "min-width: 350px;"
;div.basis-half.shrink-0.bd1.fc.g2
=style "min-width: 350px; max-width:50%;"
;div.b0.fr.g2.ac.je.p-1.bd1
;div.s-1: {(en-tape:pith:neo (snip pax))}
;button.p-1.b1.hover.br1.bd1.s-2
@ -182,7 +182,7 @@
; copy full path
==
==
;div.p2.pre.mono.scroll-y.scroll-x
;div.p2.pre.grow.mono.scroll-y.scroll-x
;+
?~ res=(~(get of:neo kids.bowl) pax)
;div: none out - {<[x y]>}
@ -190,13 +190,19 @@
==
==
++ refresher
;div.hidden
;div.absolute
=style "top: 1em; left: 1em;"
;div.loader.refresher
=hx-get "{(en-tape:pith:neo :(weld /neo/hawk here.bowl))}?no-save"
=hx-trigger "every 3s"
=hx-trigger "every 7s, accel-refresh"
=hx-target "closest .top"
=hx-select ".top"
=hx-swap "morph"
;
;span.loaded;
;span.loading
;+ loading.feather-icons
==
==
==
++ script
;script

View File

@ -0,0 +1,12 @@
/@ add-dep
:- [%add-dep %$ %htmx]
|= dep=add-dep
|= =bowl:neo
;div
=hx-get "/neo/hawk{(en-tape:pith:neo here.bowl)}?no-save"
=hx-trigger "load"
=hx-swap "morph"
=hx-target "closest .accel-cell"
=hx-select ".accel-cell"
;
==

View File

@ -0,0 +1,12 @@
/@ del-dep
:- [%del-dep %$ %htmx]
|= dep=del-dep
|= =bowl:neo
;div
=hx-get "/neo/hawk{(en-tape:pith:neo here.bowl)}?no-save"
=hx-trigger "load"
=hx-swap "morph"
=hx-target "closest .accel-cell"
=hx-select ".accel-cell"
;
==

View File

@ -10,4 +10,3 @@
=/ name=term (vol:mu "name")
?> ((sane %tas) name)
[name pith]

View File

@ -5,7 +5,6 @@
|= nod=node
^- del-dep
=/ mu ~(. manx-utils nod)
=/ name=term (vol:mu "name")
=/ name=term (got:mu %tap)
?> ((sane %tas) name)
name