accel: add poke routing

This commit is contained in:
Liam Fitzgerald 2024-06-04 12:15:27 -04:00 committed by SuperCoolYun
parent 3ca2ccab47
commit 4ba42f9043
9 changed files with 102 additions and 37 deletions

View File

@ -5,7 +5,7 @@
|= =bowl:neo
|^ ^- manx
::
;div.fr.trans-root.grow
;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']"
@ -22,41 +22,71 @@
==
;div.fc.border
;+ conf-header
;div.fc.p2
::
;+ deps
;form.fr.js.hf
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=add-dep"
=hx-swap "none"
=hx-target "#conf-spinner .loading"
=hx-target-400 "#error-add-{id}"
=hx-indicator "#conf-spinner"
=row (scow %ud +:x)
=col (scow %ud +:y)
;div.fc.grow.basis-half.wf
;div.fr
;input
=type "text"
=placeholder "name"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
=name "name"
;
==
;input
=type "text"
=placeholder "/{(scow %p our.bowl)}/demo/cell/5"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
=name "pith"
;
==
;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"
; Add dep
; Route poke
==
==
==
;div.fc.p2
::
;+ deps
;form.fr.js.hf
=hx-post "/neo/hawk{(en-tape:pith:neo here.bowl)}?stud=add-dep"
=hx-swap "none"
=hx-target "#conf-spinner .loading"
=hx-target-400 "#error-add-{id}"
=hx-indicator "#conf-spinner"
=row (scow %ud +:x)
=col (scow %ud +:y)
;div.fc.grow.basis-half.wf
;div.fr
;input
=type "text"
=placeholder "name"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
=name "name"
;
==
;input
=type "text"
=placeholder "/{(scow %p our.bowl)}/demo/cell/5"
=autocomplete "off"
=oninput "this.setAttribute('value', this.value);"
=name "pith"
;
==
==
;button
=type "submit"
; Add dep
==
;+ (spinner "conf")
==
;+ (spinner "conf")
==
==
==

View File

@ -97,6 +97,7 @@
border-collapse: collapse;
width: 100%;
grid-area: table;
overflow-y: auto;
}
.scroll-none {
overflow-x: auto;
@ -108,7 +109,7 @@
}
.accel-top {
display: grid;
grid-template-rows: 1fr min(auto, 300px);
grid-template-rows: 1fr 1fr;
grid-template-columns: 1fr;
grid-template-areas:
"table"

View File

@ -0,0 +1,12 @@
/@ node
/@ add-poke
/- manx-utils
:- [%node %$ %add-poke]
|= nod=node
~& nod/nod
^- add-poke
=/ mu ~(. manx-utils nod)
:- (pave:neo (rash (vol:mu "pith") stap))
`@tas`(rash (vol:mu "stud") ;~(pfix cen sym)) :: XX fix

View File

@ -57,7 +57,14 @@
++ poke
|= [=stud:neo vax=vase]
^- (quip card:neo pail:neo)
`(produce bowl)
=/ new=pail:neo (produce bowl)
?: =(new pail)
`pail
:_ pail
%+ turn ~(tap by poke.conf)
|= [=pith:neo =stud:neo]
[pith %poke [stud q.pail]]
::
++ init
|= pal=(unit pail:neo)
`(produce bowl)
@ -67,7 +74,7 @@
^- kook:neo
|%
++ state pro/%accel-conf
++ poke (sy %hoon %add-dep %accel-conf %ack ~)
++ poke (sy %hoon %add-dep %del-dep %accel-conf %ack %add-poke %del-poke ~)
++ kids *kids:neo
++ deps *deps:neo
++ form
@ -78,11 +85,14 @@
|= [=stud:neo vax=vase]
^- (quip card:neo pail:neo)
=+ !<(conf=accel-conf q.pail)
%- (slog leaf/"have {<stud>}," (sell vax) ~)
=. conf
?+ stud !!
%hoon conf(ready |, hoon !<(@t vax))
%add-dep conf(ready |, crew (~(put by crew.conf) !<([term pith] vax)))
%add-dep conf(ready |, crew (~(del by crew.conf) !<(term vax)))
%del-dep conf(ready |, crew (~(del by crew.conf) !<(term vax)))
%del-poke conf(ready |, poke (~(del by poke.conf) !<(pith:neo vax)))
%add-poke conf(ready |, poke (~(put by poke.conf) !<([pith:neo stud:neo] vax)))
%accel-conf !<(accel-conf vax)
%ack conf(ready &)
==

View File

@ -29,7 +29,7 @@
:+ ~ %y
%- ~(gas by *lads:neo)
:~ :- &
`lash:neo`[pro/%htmx ~]
`lash:neo`[any/~ ~]
==
==
::

View File

@ -1,4 +1,5 @@
$: hoon=_'~'
=crew:neo
ready=_|
poke=(map pith:neo stud:neo)
==

View File

@ -0,0 +1 @@
,[=pith:neo =stud:neo]

View File

@ -0,0 +1 @@
,pith:neo

View File

@ -0,0 +1,9 @@
/@ node
/@ del-poke
/- manx-utils
:- [%node %$ %del-poke]
|= nod=node
^- del-poke
=/ mu ~(. manx-utils nod)
(pave:neo (rash (vol:mu "pith") stap))