diff --git a/desk/app/jam-desk.hoon b/desk/app/jam-desk.hoon index d61a519..3b5cc63 100644 --- a/desk/app/jam-desk.hoon +++ b/desk/app/jam-desk.hoon @@ -2,8 +2,12 @@ /+ webui, rudder, server, dbug, verb, default-agent, j=jam-desk :: import to force compilation during development -/= j- /mar/jam-desk-0 -/$ jam-to-mime %jam %mime +/= dj- /mar/deskjam +/= dp- /mar/deskpack-0 +/= jt- /ted/jam-desk-url +:: +/$ deskpack-0-to-mime %deskpack-0 %mime +/$ deskjam-to-deskpack-0 %deskjam %deskpack-0 :: |% +$ state-0 [%0 data] @@ -137,7 +141,7 @@ =/ =jam !<(jam result) :_ this :~ :* %pass / %agent [our dap]:bowl %poke - %jam-desk-action !>(stage-mapp+(cue-and-clam:jc jam)) + %jam-desk-action !>([%stage-mapp (deskjam-to-deskpack-0 jam)]) == == == :: @@ -147,15 +151,8 @@ |_ =bowl:gall ++ sour (scot %p our.bowl) ++ snow (scot %da now.bowl) -++ jam-mark %jam-desk-0 ++ desks .^((set desk) %cd /[sour]/base/[snow]) :: -:: ++ jam-to-mime -:: |= =beak -:: .^ $-(@ mime) %cf -:: (weld (en-beam beak(q %base) ~) /jam/mime) -:: == -:: ++ new-desk-card |= [=desk =mapp] ^- card @@ -200,18 +197,6 @@ :: ++ en-mapp |= [=desk files=(list path)] -:: ^- mapp -:: |^ -:: (~(gas by *mapp) (turn files mage)) -:: ++ mage -:: |= file=path -:: ^- (pair path page:clay) -:: :- file -:: ^- page:clay -:: :- (rear file) -:: ~| [%missing-source-file beak file] -:: .^(* %cx (weld (en-beam beak ~) file)) -:: -- ^- mapp =+ .^(=dome:clay %cv /[sour]/[desk]/[snow]) =/ commit=@ud ud:.^(cass:clay %cw /[sour]/[desk]/[snow]) @@ -239,9 +224,8 @@ ++ desk-to-mime |= =desk ^- mime - %- jam-to-mime - %- jam ^- (cask) - [jam-mark desk (en-mapp-full desk)] + %- deskpack-0-to-mime + [desk (en-mapp-full desk)] :: ++ file-args |= args=(list [k=@t v=@t]) @@ -254,9 +238,8 @@ ++ subdesk-to-mime |= [=desk files=(list path)] ^- mime - %- jam-to-mime - %- jam ^- (cask) - [jam-mark desk (en-mapp-part desk files)] + %- deskpack-0-to-mime + [desk (en-mapp-part desk files)] :: ++ simple-desk-jam |= [=eyre-id =desk] diff --git a/desk/lib/jam-desk.hoon b/desk/lib/jam-desk.hoon index a0c637d..86ef1f9 100644 --- a/desk/lib/jam-desk.hoon +++ b/desk/lib/jam-desk.hoon @@ -1,18 +1,9 @@ /- *jam-desk /+ multipart |_ [our=ship now=time] -++ en-beak |=(dap=term /(scot %p our)/[dap]/(scot %da now)) -++ jam-to-mime .^($-(@ mime) %cf (welp (en-beak %base) /jam/mime)) -++ desks .^((set desk) %cd (en-beak %base)) -:: -++ cue-and-clam - |= =jam - ^- [desk mapp] - =/ =(cask) ((cask) (cue jam)) - ?+ p.cask !! - %jam-desk-0 - (,[desk mapp] q.cask) - == +++ sour (scot %p our) +++ snow (scot %da now) +++ desks .^((set desk) %cd /[sour]/base/[snow]) :: list to unit :: ++ lint @@ -32,7 +23,7 @@ ?. =(key n) ~ [~ `mold`body:p] :: -++ desk-files |=(=desk .^((list path) %ct (en-beak desk))) +++ desk-files |=(=desk .^((list path) %ct /[sour]/[desk]/[snow])) :: ++ desk-axal |= =desk diff --git a/desk/lib/webui.hoon b/desk/lib/webui.hoon index 75067c0..4e7f6b3 100644 --- a/desk/lib/webui.hoon +++ b/desk/lib/webui.hoon @@ -1,5 +1,6 @@ /- *jam-desk /+ rudder, multipart, w=webui-pages, h=jam-desk +/$ deskjam-to-deskpack-0 %deskjam %deskpack-0 |% ++ path-to-term |= =path @@ -31,7 +32,7 @@ =/ args=(map @t @t) ?~(body ~ (frisk:rudder q.u.body)) ?~ url=(~(get by args) 'url') ~ - url-thread+u.url + [%url-thread u.url] =/ jam=(unit jam) %- lint:hc ^- (list jam) @@ -42,7 +43,7 @@ %file [~ `jam`body:p] == ?~ jam ~ - stage-mapp+(cue-and-clam:hc u.jam) + [%stage-mapp (deskjam-to-deskpack-0 u.jam)] :: ++ final %+ alert:rudder diff --git a/desk/lib/webui/pages/download.hoon b/desk/lib/webui/pages/download.hoon index 894fa53..63eed0f 100644 --- a/desk/lib/webui/pages/download.hoon +++ b/desk/lib/webui/pages/download.hoon @@ -39,7 +39,7 @@ ;td ;a/"/apps/jam-desk/download/{(trip desk)}" =id "download" - =download "{(trip desk)}.jam" + =download "{(trip desk)}.deskjam" =title "download this file" ; ⬇️ == diff --git a/desk/lib/webui/pages/index.hoon b/desk/lib/webui/pages/index.hoon index ef67879..9c6336e 100644 --- a/desk/lib/webui/pages/index.hoon +++ b/desk/lib/webui/pages/index.hoon @@ -35,7 +35,7 @@ ;input =type "file" =name "file" - =accept ".jam"; + =accept ".deskjam"; == ;td ;button diff --git a/desk/lib/webui/pages/subset.hoon b/desk/lib/webui/pages/subset.hoon index ba1bcf6..de279c1 100644 --- a/desk/lib/webui/pages/subset.hoon +++ b/desk/lib/webui/pages/subset.hoon @@ -28,7 +28,7 @@ Select files and folders to jam. == ;td - ;button(type "submit", download "{(trip desk)}.jam"): download + ;button(type "submit", download "{(trip desk)}.deskjam"): download == == ;* folder-hierarchy diff --git a/desk/mar/deskjam.hoon b/desk/mar/deskjam.hoon new file mode 100644 index 0000000..fd49f2f --- /dev/null +++ b/desk/mar/deskjam.hoon @@ -0,0 +1,16 @@ +=, mimes:html +|_ mud=@ +++ grow + |% + ++ noun mud + ++ jam mud + ++ mime [/application/octet-stream (as-octs mud)] + -- +++ grab + |% + ++ noun @ + ++ jam @ + ++ mime |=(mim=^mime q.q.mim) + -- +++ grad %mime +-- diff --git a/desk/mar/deskpack-0.hoon b/desk/mar/deskpack-0.hoon new file mode 100644 index 0000000..5f6bb98 --- /dev/null +++ b/desk/mar/deskpack-0.hoon @@ -0,0 +1,25 @@ +/- *jam-desk +=, mimes:html +|_ dp=deskpack +++ grow + |% + ++ noun dp + ++ deskjam jam + ++ jam (^jam [%deskpack-0 dp]) + ++ mime :- /application/octet-stream + (as-octs:mimes:html jam) + -- +++ grab + |% + ++ noun deskpack + ++ deskjam jam + ++ jam + |= mud=@ + =/ =(cask) ;;((cask) (cue mud)) + ?+ p.cask ~|([%unknown-deskjam-mark mark=p.cask] !!) + %deskpack-0 ;;(deskpack q.cask) + == + ++ mime |=(mim=^mime (jam q.q.mim)) + -- +++ grad %noun +-- diff --git a/desk/mar/jam-desk-0.hoon b/desk/mar/jam-desk-0.hoon deleted file mode 100644 index fcc0b04..0000000 --- a/desk/mar/jam-desk-0.hoon +++ /dev/null @@ -1,12 +0,0 @@ -/- *jam-desk -|_ [=desk =mapp] -++ grow - |% - ++ noun [desk mapp] - -- -++ grab - |% - ++ noun ,[^desk ^mapp] - -- -++ grad %noun --- diff --git a/desk/mar/jam.hoon b/desk/mar/jam.hoon index 672941f..7367dd9 100644 --- a/desk/mar/jam.hoon +++ b/desk/mar/jam.hoon @@ -10,8 +10,8 @@ ++ mime [/application/octet-stream (as-octs mud)] -- ++ grab - |% :: convert from - ++ noun @ :: clam from %noun + |% + ++ noun @ -- ++ grad %mime -- diff --git a/desk/sur/jam-desk.hoon b/desk/sur/jam-desk.hoon index 8179cb9..dd088e1 100644 --- a/desk/sur/jam-desk.hoon +++ b/desk/sur/jam-desk.hoon @@ -1,6 +1,7 @@ |% +$ data [=staged dest=(unit [mode=?(%n %m) =desk])] +$ mapp (map path page:clay) ++$ deskpack [desk mapp] +$ staged %- unit $: =stage=time