Merge branch 'ipc-redux' into m/stateless-forward
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f18a8670a53dc7fe0a3660c639a46e7c9d900ebd235d41e78ceb5af6807ff1ad
|
||||
size 11350224
|
||||
oid sha256:29a948ebcf5d82577b3d1271cb8d0c6cf1fa8b63a324ad2ef43e73ad5dcfe62c
|
||||
size 4846052
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ac18ec9cb1035466d9aef16371738ea80f2b1d13206afb44a8ba37e0a1db812b
|
||||
size 1265214
|
||||
oid sha256:6c9cec5d3dd639a82b1b867375225e6becb9f234338ef0a4cb2626ae72ba8944
|
||||
size 1265620
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ab1e700ae005ffc73f14deaf1ae4263d378032499c9d63ec77a28187f08a4989
|
||||
size 13709878
|
||||
oid sha256:541c253fc41f0010a8d1e5d3ac30b12f83a850a5e0b73ce88eafa2dbf1b536a4
|
||||
size 17689765
|
||||
|
@ -13,7 +13,6 @@ let
|
||||
murmur3-src = deps.murmur3.src;
|
||||
scrypt-src = deps.scrypt.src;
|
||||
secp256k1-src = deps.secp256k1.src;
|
||||
sni-src = deps.sni.src;
|
||||
softfloat3-src = deps.softfloat3.src;
|
||||
uv-src = deps.uv.src;
|
||||
};
|
||||
|
@ -5,7 +5,6 @@ rec {
|
||||
murmur3 = import ./deps/murmur3/cross.nix { inherit crossenv; };
|
||||
uv = import ./deps/uv/cross.nix { inherit crossenv; };
|
||||
ed25519 = import ./deps/ed25519/cross.nix { inherit crossenv; };
|
||||
sni = import ./deps/sni/cross.nix { inherit crossenv; };
|
||||
scrypt = import ./deps/scrypt/cross.nix { inherit crossenv; };
|
||||
softfloat3 = import ./deps/softfloat3/cross.nix { inherit crossenv; };
|
||||
secp256k1 = import ./deps/secp256k1/cross.nix { inherit crossenv; };
|
||||
|
@ -20,7 +20,7 @@ let
|
||||
|
||||
vendor =
|
||||
with deps;
|
||||
[ argon2 ed25519 h2o murmur3 scrypt secp256k1 sni softfloat3 uv ent ge-additions ivory-header ca-header ];
|
||||
[ argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ent ge-additions ivory-header ca-header ];
|
||||
|
||||
in
|
||||
|
||||
|
@ -5,7 +5,6 @@ rec {
|
||||
murmur3 = import ./murmur3 { inherit pkgs; };
|
||||
uv = import ./uv { inherit pkgs; };
|
||||
ed25519 = import ./ed25519 { inherit pkgs; };
|
||||
sni = import ./sni { inherit pkgs; };
|
||||
scrypt = import ./scrypt { inherit pkgs; };
|
||||
softfloat3 = import ./softfloat3 { inherit pkgs; };
|
||||
secp256k1 = import ./secp256k1 { inherit pkgs; };
|
||||
|
@ -1,13 +0,0 @@
|
||||
source $stdenv/setup
|
||||
|
||||
CFLAGS="-O3 -Wall -ffast-math -Wno-unused-const-variable"
|
||||
|
||||
echo $CC $CFLAGS -c $src/src/tls.c -o tls.o
|
||||
$CC $CFLAGS -c $src/src/tls.c -o tls.o
|
||||
|
||||
echo $AR rcs libsni.a tls.o
|
||||
$AR rcs libsni.a tls.o
|
||||
|
||||
mkdir -p $out/{lib,include}
|
||||
cp libsni.a $out/lib/
|
||||
cp $src/src/tls.h $out/include/
|
@ -1,18 +0,0 @@
|
||||
{ crossenv }:
|
||||
|
||||
crossenv.make_derivation rec {
|
||||
name = "sni";
|
||||
builder = ./builder.sh;
|
||||
|
||||
CC = "${crossenv.host}-gcc";
|
||||
AR = "${crossenv.host}-ar";
|
||||
|
||||
src = crossenv.nixpkgs.fetchFromGitHub {
|
||||
owner = "urbit";
|
||||
repo = "sniproxy";
|
||||
rev = "173beb88ee62bddd13874ca04ab338cdec704928";
|
||||
sha256 = "1ib6p7vhpvbg6d5a2aimppsb09kjg4px4vlw5h3ys9zf9c1if5z4";
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.stdenv.mkDerivation rec {
|
||||
name = "sni";
|
||||
builder = ./builder.sh;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "urbit";
|
||||
repo = "sniproxy";
|
||||
rev = "173beb88ee62bddd13874ca04ab338cdec704928";
|
||||
sha256 = "1ib6p7vhpvbg6d5a2aimppsb09kjg4px4vlw5h3ys9zf9c1if5z4";
|
||||
};
|
||||
}
|
@ -2,6 +2,21 @@ source $setup
|
||||
|
||||
tar -xf $src
|
||||
|
||||
cd libsigsegv-$version
|
||||
patch -p1 << 'HEREDOC'
|
||||
--- a/src/fault-linux-i386.h 2020-06-25 23:46:02.099235491 +0000
|
||||
+++ b/src/fault-linux-i386.h 2020-06-25 23:45:48.679156892 +0000
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "fault-posix-ucontext.h"
|
||||
|
||||
+#define HAVE_STACKVMA 0
|
||||
#if defined __x86_64__
|
||||
/* 64 bit registers */
|
||||
|
||||
HEREDOC
|
||||
cd ..
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
|
@ -7,13 +7,13 @@ chmod -R u+rw ./pier
|
||||
|
||||
$URBIT -d ./pier
|
||||
|
||||
cleanup () {
|
||||
shutdown () {
|
||||
if [ -e ./pier/.vere.lock ]
|
||||
then kill $(< ./pier/.vere.lock) || true;
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
trap shutdown EXIT
|
||||
|
||||
# update pill strategy to ensure correct staging
|
||||
#
|
||||
@ -75,6 +75,8 @@ herb ./pier -p hood -d "+hood/unmount %stage"
|
||||
|
||||
herb ./pier -P solid.pill -d '+solid /=stage=/sys, =dub &'
|
||||
|
||||
herb ./pier -p hood -d '+hood/exit' || true
|
||||
|
||||
mv solid.pill $out
|
||||
|
||||
set +x
|
||||
|
@ -21,7 +21,7 @@ let
|
||||
mkUrbit = { debug }:
|
||||
import ./urbit {
|
||||
inherit pkgs ent debug ge-additions libaes_siv;
|
||||
inherit (deps) argon2 murmur3 uv ed25519 sni scrypt softfloat3;
|
||||
inherit (deps) argon2 murmur3 uv ed25519 scrypt softfloat3;
|
||||
inherit (deps) secp256k1 h2o ivory-header ca-header;
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
pkgs,
|
||||
debug,
|
||||
argon2, ed25519, ent, ge-additions, libaes_siv, h2o, murmur3, scrypt, secp256k1, sni, softfloat3, uv, ivory-header, ca-header
|
||||
argon2, ed25519, ent, ge-additions, libaes_siv, h2o, murmur3, scrypt, secp256k1, softfloat3, uv, ivory-header, ca-header
|
||||
}:
|
||||
|
||||
let
|
||||
@ -16,12 +16,17 @@ let
|
||||
exe = ''${meta.bin} ${pkgs.lib.strings.concatStringsSep " " meta.flags}'';
|
||||
};
|
||||
|
||||
sigseg =
|
||||
pkgs.libsigsegv.overrideAttrs (oldAttrs: rec {
|
||||
patches = [ ./libsigsegv_fix.patch ];
|
||||
});
|
||||
|
||||
deps =
|
||||
with pkgs;
|
||||
[ curl gmp libsigsegv openssl zlib lmdb ];
|
||||
[ curl gmp sigseg openssl zlib lmdb ];
|
||||
|
||||
vendor =
|
||||
[ argon2 softfloat3 ed25519 ent ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 sni ivory-header ca-header ];
|
||||
[ argon2 softfloat3 ed25519 ent ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ];
|
||||
|
||||
urbit = pkgs.stdenv.mkDerivation {
|
||||
inherit name meta;
|
||||
|
10
nix/pkgs/urbit/libsigsegv_fix.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- a/src/fault-linux-i386.h 2020-06-25 23:46:02.099235491 +0000
|
||||
+++ b/src/fault-linux-i386.h 2020-06-25 23:45:48.679156892 +0000
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "fault-posix-ucontext.h"
|
||||
|
||||
+#define HAVE_STACKVMA 0
|
||||
#if defined __x86_64__
|
||||
/* 64 bit registers */
|
||||
|
@ -16,7 +16,7 @@ let
|
||||
|
||||
vendor =
|
||||
with deps;
|
||||
[ argon2 softfloat3 ed25519 ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 sni ivory-header ca-header ];
|
||||
[ argon2 softfloat3 ed25519 ge-additions libaes_siv h2o scrypt uv murmur3 secp256k1 ivory-header ca-header ];
|
||||
|
||||
in
|
||||
|
||||
|
@ -12,5 +12,5 @@ import ./default.nix {
|
||||
inherit (tlon)
|
||||
ent ge-additions libaes_siv;
|
||||
inherit (deps)
|
||||
argon2 ed25519 h2o murmur3 scrypt secp256k1 sni softfloat3 uv ivory-header ca-header;
|
||||
argon2 ed25519 h2o murmur3 scrypt secp256k1 softfloat3 uv ivory-header ca-header;
|
||||
}
|
||||
|
@ -87,7 +87,8 @@
|
||||
^- (list (list card))
|
||||
%+ turn ~(tap in keys) generate-cards
|
||||
==
|
||||
[loaded-cards.upgraded-state this(state upgraded-state)]
|
||||
:_ this(state upgraded-state)
|
||||
loaded-cards.upgraded-state
|
||||
::
|
||||
++ generate-cards
|
||||
|= old-chat=path
|
||||
@ -381,6 +382,7 @@
|
||||
:* [%give %kick ~[[%mailbox path.act]] ~]
|
||||
[%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
|
||||
(pull-wire u.ship [%mailbox path.act])
|
||||
(pull-wire u.ship [%store path.act])
|
||||
(pull-backlog-subscriptions u.ship path.act)
|
||||
==
|
||||
==
|
||||
|
@ -13,12 +13,6 @@
|
||||
+$ state-zero [%0 =inbox:store]
|
||||
+$ state-one [%1 =inbox:store]
|
||||
+$ state-two [%2 =inbox:store]
|
||||
::
|
||||
+$ diff
|
||||
$% [%chat-initial inbox:store]
|
||||
[%chat-configs configs:store]
|
||||
[%chat-update update:store]
|
||||
==
|
||||
--
|
||||
::
|
||||
=| state-two
|
||||
@ -70,8 +64,7 @@
|
||||
=/ cards=(list card)
|
||||
?+ path (on-watch:def path)
|
||||
[%keys ~] (give %chat-update !>([%keys ~(key by inbox)]))
|
||||
[%all ~] (give %chat-initial !>(inbox))
|
||||
[%configs ~] (give %chat-configs !>((inbox-to-configs:store inbox)))
|
||||
[%all ~] (give %chat-update !>([%initial inbox]))
|
||||
[%updates ~] ~
|
||||
[%mailbox @ *]
|
||||
?> (~(has by inbox) t.path)
|
||||
@ -92,7 +85,6 @@
|
||||
^- (unit (unit cage))
|
||||
?+ path (on-peek:def path)
|
||||
[%x %all ~] ``noun+!>(inbox)
|
||||
[%x %configs ~] ``noun+!>((inbox-to-configs:store inbox))
|
||||
[%x %keys ~] ``noun+!>(~(key by inbox))
|
||||
[%x %envelopes *] (peek-x-envelopes:cc t.t.path)
|
||||
[%x %mailbox *]
|
||||
@ -274,7 +266,6 @@
|
||||
(update-subscribers [%mailbox pax] upd)
|
||||
?. |(|(=(%read -.upd) =(%message -.upd)) =(%messages -.upd))
|
||||
~
|
||||
(update-subscribers /configs upd)
|
||||
?. |(=(%create -.upd) =(%delete -.upd))
|
||||
~
|
||||
(update-subscribers /keys upd)
|
||||
|
@ -14,51 +14,24 @@
|
||||
/+ *server, default-agent, verb, dbug,
|
||||
store=chat-store,
|
||||
view=chat-view
|
||||
/= index
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/chat/index
|
||||
/| /html/
|
||||
/~ ~
|
||||
==
|
||||
/= tile-js
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/chat/js/tile
|
||||
/| /js/
|
||||
/~ ~
|
||||
==
|
||||
/= script
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/chat/js/index
|
||||
/| /js/
|
||||
/~ ~
|
||||
==
|
||||
/= style
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/chat/css/index
|
||||
/| /css/
|
||||
/~ ~
|
||||
==
|
||||
/= chat-png
|
||||
/^ (map knot @)
|
||||
/: /===/app/chat/img /_ /png/
|
||||
::
|
||||
~% %chat-view-top ..is ~
|
||||
|%
|
||||
+$ card card:agent:gall
|
||||
::
|
||||
+$ poke
|
||||
$% [%launch-action [@tas path @t]]
|
||||
[%chat-action action:store]
|
||||
[%group-action group-action]
|
||||
[%chat-hook-action action:hook]
|
||||
[%permission-hook-action permission-hook-action]
|
||||
[%permission-group-hook-action permission-group-hook-action]
|
||||
+$ versioned-state
|
||||
$% state-0
|
||||
==
|
||||
::
|
||||
+$ state-0
|
||||
$: %0
|
||||
~
|
||||
==
|
||||
::
|
||||
+$ card card:agent:gall
|
||||
--
|
||||
::
|
||||
=| state-0
|
||||
=* state -
|
||||
::
|
||||
%+ verb |
|
||||
%- agent:dbug
|
||||
^- agent:gall
|
||||
@ -72,12 +45,15 @@
|
||||
::
|
||||
++ on-init
|
||||
^- (quip card _this)
|
||||
=/ launcha [%launch-action !>([%add %chat-view /configs '/~chat/js/tile.js'])]
|
||||
:_ this
|
||||
:~ [%pass /updates %agent [our.bol %chat-store] %watch /updates]
|
||||
[%pass / %arvo %e %connect [~ /'~chat'] %chat-view]
|
||||
[%pass /chat-view %agent [our.bol %launch] %poke launcha]
|
||||
:~ :* %pass /srv %agent [our.bol %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~chat' /app/landscape %.n])
|
||||
==
|
||||
[%pass / %arvo %e %connect [~ /'chat-view'] %chat-view]
|
||||
[%pass /updates %agent [our.bol %chat-store] %watch /updates]
|
||||
==
|
||||
::
|
||||
++ on-poke
|
||||
~/ %chat-view-poke
|
||||
|= [=mark =vase]
|
||||
@ -112,14 +88,12 @@
|
||||
:: create inbox with 20 messages max per mailbox and send that along
|
||||
:: then quit the subscription
|
||||
:_ this
|
||||
[%give %fact ~ %json !>((inbox:enjs:store truncated-inbox-scry))]~
|
||||
?: =(/configs path)
|
||||
[[%give %fact ~ %json !>(*json)]~ this]
|
||||
[%give %fact ~ %json !>((update:enjs:store [%initial truncated-inbox]))]~
|
||||
(on-watch:def path)
|
||||
::
|
||||
++ message-limit 20
|
||||
::
|
||||
++ truncated-inbox-scry
|
||||
++ truncated-inbox
|
||||
^- inbox:store
|
||||
=/ =inbox:store
|
||||
.^(inbox:store %gx /=chat-store/(scot %da now.bol)/all/noun)
|
||||
@ -133,7 +107,7 @@
|
||||
~/ %chat-view-agent
|
||||
|= [=wire =sign:agent:gall]
|
||||
^- (quip card _this)
|
||||
?+ -.sign (on-agent:def wire sign)
|
||||
?+ -.sign (on-agent:def wire sign)
|
||||
%kick
|
||||
:_ this
|
||||
[%pass / %agent [our.bol %chat-store] %watch /updates]~
|
||||
@ -150,12 +124,24 @@
|
||||
~/ %chat-view-arvo
|
||||
|= [=wire =sign-arvo]
|
||||
^- (quip card _this)
|
||||
?. ?=(%bound +<.sign-arvo)
|
||||
(on-arvo:def wire sign-arvo)
|
||||
[~ this]
|
||||
?: ?=(%bound +<.sign-arvo) [~ this]
|
||||
(on-arvo:def wire sign-arvo)
|
||||
::
|
||||
++ on-save !>(state)
|
||||
++ on-load
|
||||
|= old-vase=vase
|
||||
^- (quip card _this)
|
||||
=/ old ((soft state-0) q.old-vase)
|
||||
?^ old [~ this]
|
||||
:_ this(state [%0 ~])
|
||||
:~ [%pass / %arvo %e %disconnect [~ /'~chat']]
|
||||
[%pass / %arvo %e %connect [~ /'chat-view'] %chat-view]
|
||||
:* %pass /srv %agent [our.bol %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~chat' /app/landscape %.n])
|
||||
==
|
||||
==
|
||||
::
|
||||
++ on-save on-save:def
|
||||
++ on-load on-load:def
|
||||
++ on-leave on-leave:def
|
||||
++ on-peek on-peek:def
|
||||
++ on-fail on-fail:def
|
||||
@ -170,18 +156,7 @@
|
||||
^- simple-payload:http
|
||||
=+ url=(parse-request-line url.request.inbound-request)
|
||||
?+ site.url not-found:gen
|
||||
[%'~chat' %css %index ~] (css-response:gen style)
|
||||
[%'~chat' %js %tile ~] (js-response:gen tile-js)
|
||||
[%'~chat' %js %index ~] (js-response:gen script)
|
||||
::
|
||||
[%'~chat' %img @t *]
|
||||
=/ name=@t i.t.t.site.url
|
||||
=/ img (~(get by chat-png) name)
|
||||
?~ img
|
||||
not-found:gen
|
||||
(png-response:gen (as-octs:mimes:html u.img))
|
||||
::
|
||||
[%'~chat' %paginate @t @t *]
|
||||
[%'chat-view' %paginate @t @t *]
|
||||
=/ start (need (rush i.t.t.site.url dem))
|
||||
=/ end (need (rush i.t.t.t.site.url dem))
|
||||
=/ pax t.t.t.t.site.url
|
||||
@ -190,8 +165,6 @@
|
||||
%- json-to-octs
|
||||
%- update:enjs:store
|
||||
[%messages pax start end envelopes]
|
||||
::
|
||||
[%'~chat' *] (html-response:gen index)
|
||||
==
|
||||
::
|
||||
++ poke-json
|
||||
@ -488,11 +461,7 @@
|
||||
++ diff-chat-update
|
||||
|= upd=update:store
|
||||
^- (list card)
|
||||
=/ updates-json (update:enjs:store upd)
|
||||
=/ configs-json (configs:enjs:store configs-scry)
|
||||
:~ [%give %fact ~[/primary] %json !>(updates-json)]
|
||||
[%give %fact ~[/configs] %json !>(configs-json)]
|
||||
==
|
||||
[%give %fact ~[/primary] %json !>((update:enjs:store upd))]~
|
||||
::
|
||||
:: +utilities
|
||||
::
|
||||
@ -535,10 +504,6 @@
|
||||
^- (list envelope:store)
|
||||
(scry-for (list envelope:store) %chat-store [%envelopes pax])
|
||||
::
|
||||
++ configs-scry
|
||||
^- configs:store
|
||||
(scry-for configs:store %chat-store /configs)
|
||||
::
|
||||
++ group-scry
|
||||
|= pax=path
|
||||
^- (unit group)
|
||||
|
@ -1,11 +1,6 @@
|
||||
:: clock: deprecated, should be removed
|
||||
::
|
||||
/+ *server, default-agent, verb, dbug
|
||||
/= tile-js
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/clock/js/tile
|
||||
/| /js/
|
||||
/~ ~
|
||||
==
|
||||
=, format
|
||||
::
|
||||
|%
|
||||
@ -25,96 +20,19 @@
|
||||
+* this .
|
||||
def ~(. (default-agent this %|) bowl)
|
||||
::
|
||||
++ on-init
|
||||
^- (quip card:agent:gall _this)
|
||||
=/ launcha
|
||||
[%launch-action !>([%add %clock /clocktile '/~clock/js/tile.js'])]
|
||||
:_ this
|
||||
:~ [%pass / %arvo %e %connect [~ /'~clock'] %clock]
|
||||
[%pass /clock %agent [our.bowl %launch] %poke launcha]
|
||||
==
|
||||
:: bootstrapping to get %goad started OTA
|
||||
::
|
||||
++ on-init on-init:def
|
||||
++ on-save !>(%3)
|
||||
++ on-load
|
||||
|= old-state=vase
|
||||
^- (quip card _this)
|
||||
=/ old !<(?(~ %1 %2 %3) old-state)
|
||||
=^ cards this
|
||||
?: ?=(%3 old)
|
||||
`this
|
||||
?: ?=(%2 old)
|
||||
:: ensure launch is set up to listen to us correctly
|
||||
::
|
||||
=/ launcha
|
||||
[%launch-action !>([%add %clock /clocktile '/~clock/js/tile.js'])]
|
||||
:_ this
|
||||
[%pass /clock %agent [our.bowl %launch] %poke launcha]~
|
||||
:_ this :_ ~
|
||||
[%pass /behn %arvo %b %wait +(now.bowl)]
|
||||
::
|
||||
[cards this]
|
||||
::
|
||||
++ on-poke
|
||||
|= [=mark =vase]
|
||||
^- (quip card:agent:gall _this)
|
||||
|^
|
||||
?: ?=(%json mark)
|
||||
(poke-json !<(json vase))
|
||||
?. ?=(%handle-http-request mark)
|
||||
(on-poke:def mark vase)
|
||||
=+ !<([eyre-id=@ta =inbound-request:eyre] vase)
|
||||
:_ this
|
||||
%+ give-simple-payload:app eyre-id
|
||||
%+ require-authorization:app inbound-request
|
||||
|= =inbound-request:eyre
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
=/ back-path (flop site.request-line)
|
||||
=/ name=@t
|
||||
=/ back-path (flop site.request-line)
|
||||
?~ back-path
|
||||
''
|
||||
i.back-path
|
||||
::
|
||||
?~ back-path
|
||||
not-found:gen
|
||||
?: =(name 'tile')
|
||||
(js-response:gen tile-js)
|
||||
not-found:gen
|
||||
::
|
||||
++ poke-json
|
||||
|= jon=json
|
||||
^- (quip card:agent:gall _this)
|
||||
=. data.state jon
|
||||
:_ this
|
||||
[%give %fact ~[/clocktile] %json !>(jon)]~
|
||||
--
|
||||
::
|
||||
++ on-watch
|
||||
|= =path
|
||||
^- (quip card:agent:gall _this)
|
||||
?: ?=([%http-response *] path)
|
||||
`this
|
||||
?. =(/clocktile path)
|
||||
(on-watch:def path)
|
||||
[[%give %fact ~ %json !>(data.state)]~ this]
|
||||
[%pass / %arvo %e %disconnect [~ /'~clock']]~
|
||||
::
|
||||
++ on-poke on-poke:def
|
||||
++ on-watch on-watch:def
|
||||
++ on-leave on-leave:def
|
||||
++ on-peek on-peek:def
|
||||
++ on-agent on-agent:def
|
||||
++ on-arvo
|
||||
|= [=wire =sign-arvo]
|
||||
^- (quip card:agent:gall _this)
|
||||
?: ?=(%wake +<.sign-arvo)
|
||||
?^ error.sign-arvo
|
||||
:_ this :_ ~
|
||||
[%pass /dill %arvo %d %flog %crud %clock-fail u.error.sign-arvo]
|
||||
:_ this :_ ~
|
||||
[%pass /gall %arvo %g %goad | `%hood]
|
||||
::
|
||||
?. ?=(%bound +<.sign-arvo)
|
||||
(on-arvo:def wire sign-arvo)
|
||||
[~ this]
|
||||
::
|
||||
++ on-arvo on-arvo:def
|
||||
++ on-fail on-fail:def
|
||||
--
|
||||
|
@ -137,7 +137,7 @@
|
||||
^- (list card)
|
||||
:: local
|
||||
?: (team:title our.bol src.bol)
|
||||
?. (~(has by synced) path) ~
|
||||
?. |(=(path /~/default) (~(has by synced) path)) ~
|
||||
=/ shp ?:(=(path /~/default) our.bol (~(got by synced) path))
|
||||
=/ appl ?:(=(shp our.bol) %contact-store %contact-hook)
|
||||
[%pass / %agent [shp appl] %poke %contact-action !>(act)]~
|
||||
|
@ -84,7 +84,7 @@
|
||||
|^
|
||||
=/ cards=(list card)
|
||||
?+ path (on-watch:def path)
|
||||
[%all ~] (give %contact-update !>([%rolodex rolodex]))
|
||||
[%all ~] (give %contact-update !>([%initial rolodex]))
|
||||
[%updates ~] ~
|
||||
[%contacts @ *]
|
||||
%+ give %contact-update
|
||||
|
@ -10,41 +10,19 @@
|
||||
*permission-group-hook,
|
||||
*permission-hook
|
||||
/+ *server, *contact-json, default-agent, dbug
|
||||
/= index
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/contacts/index
|
||||
/| /html/
|
||||
/~ ~
|
||||
==
|
||||
/= tile-js
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/contacts/js/tile
|
||||
/| /js/
|
||||
/~ ~
|
||||
==
|
||||
/= script
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/contacts/js/index
|
||||
/| /js/
|
||||
/~ ~
|
||||
==
|
||||
/= style
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/contacts/css/index
|
||||
/| /css/
|
||||
/~ ~
|
||||
==
|
||||
/= contact-png
|
||||
/^ (map knot @)
|
||||
/: /===/app/contacts/img /_ /png/
|
||||
::
|
||||
|%
|
||||
+$ versioned-state
|
||||
$% state-0
|
||||
==
|
||||
::
|
||||
+$ state-0
|
||||
$: %0
|
||||
~
|
||||
==
|
||||
::
|
||||
+$ card card:agent:gall
|
||||
--
|
||||
=| state-0
|
||||
=* state -
|
||||
::
|
||||
%- agent:dbug
|
||||
@ -60,15 +38,31 @@
|
||||
^- (quip card _this)
|
||||
:_ this
|
||||
:~ [%pass /updates %agent [our.bowl %contact-store] %watch /updates]
|
||||
[%pass / %arvo %e %connect [~ /'~groups'] %contact-view]
|
||||
(contact-poke:cc [%create /~/default])
|
||||
(group-poke:cc [%bundle /~/default])
|
||||
(contact-poke:cc [%add /~/default our.bowl *contact])
|
||||
(group-poke:cc [%add [our.bowl ~ ~] /~/default])
|
||||
:* %pass /srv %agent [our.bol %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~groups' /app/landscape %.n])
|
||||
==
|
||||
==
|
||||
::
|
||||
++ on-save !>(state)
|
||||
++ on-load
|
||||
|= old-vase=vase
|
||||
^- (quip card _this)
|
||||
=/ old ((soft state-0) q.old-vase)
|
||||
?^ old [~ this]
|
||||
:_ this(state [%0 ~])
|
||||
:~ [%pass / %arvo %e %disconnect [~ /'~groups']]
|
||||
[%pass / %arvo %e %connect [~ /'contact-view'] %contact-view]
|
||||
:* %pass /srv %agent [our.bol %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~groups' /app/landscape %.n])
|
||||
==
|
||||
==
|
||||
::
|
||||
++ on-save on-save:def
|
||||
++ on-load on-load:def
|
||||
++ on-poke
|
||||
|= [=mark =vase]
|
||||
^- (quip card _this)
|
||||
@ -92,7 +86,7 @@
|
||||
?> (team:title our.bowl src.bowl)
|
||||
?: ?=([%http-response *] path) [~ this]
|
||||
?. =(/primary path) (on-watch:def path)
|
||||
[[%give %fact ~ %json !>((rolodex-to-json all-scry:cc))]~ this]
|
||||
[[%give %fact ~ %json !>((update-to-json [%initial all-scry:cc]))]~ this]
|
||||
::
|
||||
++ on-agent
|
||||
|= [=wire =sign:agent:gall]
|
||||
@ -173,15 +167,7 @@
|
||||
''
|
||||
i.back-path
|
||||
?+ site.url not-found:gen
|
||||
[%'~groups' %css %index ~] (css-response:gen style)
|
||||
[%'~groups' %js %index ~] (js-response:gen script)
|
||||
[%'~groups' %js %tile ~] (js-response:gen tile-js)
|
||||
[%'~groups' %img *]
|
||||
(png-response:gen (as-octs:mimes:html (~(got by contact-png) `@ta`name)))
|
||||
::
|
||||
:: avatar images
|
||||
::
|
||||
[%'~groups' %avatar @ *]
|
||||
[%'contact-view' @ *]
|
||||
=/ =path (flop t.t.site.url)
|
||||
?~ path not-found:gen
|
||||
=/ contact (contact-scry `^path`(snoc (flop t.path) name))
|
||||
@ -194,8 +180,6 @@
|
||||
=/ content-type ['content-type' content-type.u.avatar.u.contact]
|
||||
[[200 [content-type max-3-days ~]] `octs.u.avatar.u.contact]
|
||||
==
|
||||
::
|
||||
[%'~groups' *] (html-response:gen index)
|
||||
==
|
||||
::
|
||||
:: +utilities
|
||||
|
Before Width: | Height: | Size: 880 B |
Before Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 951 B |
@ -1,18 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Groups</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
|
||||
<link rel="stylesheet" href="/~groups/css/index.css" />
|
||||
<link rel="icon" type="image/png" href="/~launch/img/Favicon.png">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root" />
|
||||
<script src="/~channel/channel.js"></script>
|
||||
<script src="/~modulo/session.js"></script>
|
||||
<script src="/~groups/js/index.js"></script>
|
||||
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.12.min.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -767,7 +767,7 @@
|
||||
++ v-behn
|
||||
|%
|
||||
++ timers
|
||||
(scry ,(list [date=@da =duct]) %bx %$ /debug/timers)
|
||||
(scry ,(list [date=@da =duct]) %b %timers ~)
|
||||
--
|
||||
::
|
||||
:: clay
|
||||
|
217
pkg/arvo/app/file-server.hoon
Normal file
@ -0,0 +1,217 @@
|
||||
/- srv=file-server
|
||||
/+ *server, default-agent, verb, dbug
|
||||
|%
|
||||
+$ card card:agent:gall
|
||||
+$ versioned-state
|
||||
$% state-zero
|
||||
==
|
||||
::
|
||||
+$ serving (map url-base=path [clay-base=path public=?])
|
||||
+$ state-zero
|
||||
$: %0
|
||||
=configuration:srv
|
||||
=serving
|
||||
==
|
||||
--
|
||||
::
|
||||
%+ verb |
|
||||
%- agent:dbug
|
||||
::
|
||||
=| state-zero
|
||||
=* state -
|
||||
^- agent:gall
|
||||
|_ =bowl:gall
|
||||
+* this .
|
||||
def ~(. (default-agent this %|) bowl)
|
||||
::
|
||||
++ on-init
|
||||
^- (quip card _this)
|
||||
|^
|
||||
:_ %_ this
|
||||
serving
|
||||
%- ~(gas by *^serving)
|
||||
%+ turn
|
||||
^- (list path)
|
||||
[/ /'~landscape' ~]
|
||||
|=(pax=path [pax [/app/landscape %.n]])
|
||||
==
|
||||
:~ (connect /)
|
||||
(connect /'~landscape')
|
||||
==
|
||||
::
|
||||
++ connect
|
||||
|= =path
|
||||
^- card
|
||||
[%pass path %arvo %e %connect [~ path] %file-server]
|
||||
--
|
||||
::
|
||||
++ on-save !>(state)
|
||||
++ on-load
|
||||
|= old-vase=vase
|
||||
^- (quip card _this)
|
||||
[~ this(state !<(state-zero old-vase))]
|
||||
::
|
||||
++ on-poke
|
||||
|= [=mark =vase]
|
||||
^- (quip card _this)
|
||||
|^
|
||||
?> (team:title our.bowl src.bowl)
|
||||
?+ mark (on-poke:def mark vase)
|
||||
%file-server-action (file-server-action !<(action:srv vase))
|
||||
%handle-http-request
|
||||
=+ !<([id=@ta req=inbound-request:eyre] vase)
|
||||
:_ this
|
||||
%+ give-simple-payload:app id
|
||||
(handle-http-request req)
|
||||
==
|
||||
::
|
||||
++ file-server-action
|
||||
|= act=action:srv
|
||||
^- (quip card _this)
|
||||
|^
|
||||
?- -.act
|
||||
%serve-dir
|
||||
=* url-base url-base.act
|
||||
?: (~(has by serving) url-base)
|
||||
~|("url already bound to {<(~(got by serving) url-base.act)>}" !!)
|
||||
:- [%pass url-base %arvo %e %connect [~ url-base] %file-server]~
|
||||
this(serving (~(put by serving) url-base [clay-base.act public.act]))
|
||||
::
|
||||
%unserve-dir
|
||||
:- [%pass url-base.act %arvo %e %disconnect [~ url-base.act]]~
|
||||
this(serving (~(del by serving) url-base.act))
|
||||
::
|
||||
%toggle-permission
|
||||
?. (~(has by serving) url-base.act)
|
||||
~|("url is not bound" !!)
|
||||
=/ [clay-base=path public=?] (~(got by serving) url-base.act)
|
||||
:- ~
|
||||
this(serving (~(put by serving) url-base.act [clay-base !public]))
|
||||
::
|
||||
%set-landscape-homepage-prefix
|
||||
=. landscape-homepage-prefix.configuration prefix.act
|
||||
:_ this
|
||||
(give [%configuration configuration])
|
||||
==
|
||||
::
|
||||
++ give
|
||||
|= =update:srv
|
||||
^- (list card)
|
||||
[%give %fact [/all]~ [%file-server-update !>(update)]]~
|
||||
--
|
||||
::
|
||||
++ handle-http-request
|
||||
|= =inbound-request:eyre
|
||||
^- simple-payload:http
|
||||
|^
|
||||
=* req request.inbound-request
|
||||
=* headers header-list.req
|
||||
=/ req-line (parse-request-line url.req)
|
||||
?. =(method.req %'GET') not-found:gen
|
||||
=? req-line ?=(~ ext.req-line)
|
||||
[[[~ %html] ~['index']] args.req-line]
|
||||
?> ?=(^ ext.req-line)
|
||||
?~ site.req-line
|
||||
not-found:gen
|
||||
=* url-prefix landscape-homepage-prefix.configuration
|
||||
?. ?| ?=(~ url-prefix)
|
||||
=(u.url-prefix i.site.req-line)
|
||||
==
|
||||
not-found:gen
|
||||
::
|
||||
?: ?=([%'~landscape' %js %session ~] site.req-line)
|
||||
%+ require-authorization-simple:app
|
||||
inbound-request
|
||||
%- js-response:gen
|
||||
(as-octt:mimes:html "window.ship = '{+:(scow %p our.bowl)}';")
|
||||
::
|
||||
=/ [payload=simple-payload:http public=?] (get-file req-line)
|
||||
?: public payload
|
||||
(require-authorization-simple:app inbound-request payload)
|
||||
::
|
||||
++ get-file
|
||||
|= req-line=request-line
|
||||
^- [simple-payload:http ?]
|
||||
=/ pax=path (snoc site.req-line (need ext.req-line))
|
||||
=/ clay-path=(unit [path ?]) (get-clay-path pax)
|
||||
?~ clay-path [not-found:gen %.n]
|
||||
=/ scry-path
|
||||
:* (scot %p our.bowl)
|
||||
q.byk.bowl
|
||||
(scot %da now.bowl)
|
||||
-.u.clay-path
|
||||
==
|
||||
?. .^(? %cu scry-path) [not-found:gen %.n]
|
||||
=/ file (as-octs:mimes:html .^(@ %cx scry-path))
|
||||
:_ +.u.clay-path
|
||||
?+ ext.req-line not-found:gen
|
||||
[~ %html] (html-response:gen file)
|
||||
[~ %js] (js-response:gen file)
|
||||
[~ %css] (css-response:gen file)
|
||||
[~ %png] (png-response:gen file)
|
||||
==
|
||||
::
|
||||
++ get-clay-path
|
||||
|= pax=path
|
||||
^- (unit [path ?])
|
||||
=/ first-try (match-clay-path pax (~(del by serving) /))
|
||||
?^ first-try first-try
|
||||
=/ root (~(get by serving) /)
|
||||
?~ root ~
|
||||
(match-clay-path pax (~(gas by *^serving) [[/ u.root] ~]))
|
||||
::
|
||||
++ match-clay-path
|
||||
|= [pax=path =^serving]
|
||||
^- (unit [path ?])
|
||||
%- ~(rep by serving)
|
||||
|= [[url-base=path clay-base=path public=?] out=(unit [path ?])]
|
||||
?^ out out
|
||||
=/ suf (get-suffix url-base pax)
|
||||
?~ suf ~
|
||||
`[(weld clay-base u.suf) public]
|
||||
::
|
||||
++ get-suffix
|
||||
|= [a=path b=path]
|
||||
^- (unit path)
|
||||
?: (gth (lent a) (lent b)) ~
|
||||
|-
|
||||
?~ a `b
|
||||
?~ b ~
|
||||
?. =(i.a i.b) ~
|
||||
%= $
|
||||
a t.a
|
||||
b t.b
|
||||
==
|
||||
--
|
||||
--
|
||||
::
|
||||
++ on-watch
|
||||
|= =path
|
||||
^- (quip card _this)
|
||||
|^
|
||||
?> (team:title our.bowl src.bowl)
|
||||
?+ path (on-watch:def path)
|
||||
[%http-response *] [~ this]
|
||||
[%all ~] [(give [%configuration configuration]) this]
|
||||
==
|
||||
::
|
||||
++ give
|
||||
|= =update:srv
|
||||
^- (list card)
|
||||
[%give %fact ~ [%file-server-update !>(update)]]~
|
||||
--
|
||||
::
|
||||
++ on-arvo
|
||||
|= [=wire sign=sign-arvo]
|
||||
^- (quip card _this)
|
||||
?+ +<.sign (on-arvo:def wire sign)
|
||||
%bound
|
||||
?: accepted.sign [~ this]
|
||||
[~ this(serving (~(del by serving) path.binding.sign))]
|
||||
==
|
||||
::
|
||||
++ on-leave on-leave:def
|
||||
++ on-peek on-peek:def
|
||||
++ on-agent on-agent:def
|
||||
++ on-fail on-fail:def
|
||||
--
|
@ -160,9 +160,10 @@
|
||||
|= diff=group-update
|
||||
^- (quip card _state)
|
||||
?- -.diff
|
||||
%keys [~ state]
|
||||
%path [~ state]
|
||||
%bundle [~ state]
|
||||
%initial [~ state]
|
||||
%keys [~ state]
|
||||
%path [~ state]
|
||||
%bundle [~ state]
|
||||
%add [(update-subscribers [%group pax.diff] diff) state]
|
||||
%remove [(update-subscribers [%group pax.diff] diff) state]
|
||||
::
|
||||
@ -176,8 +177,9 @@
|
||||
|= diff=group-update
|
||||
^- (quip card _state)
|
||||
?- -.diff
|
||||
%keys [~ state]
|
||||
%bundle [~ state]
|
||||
%initial [~ state]
|
||||
%keys [~ state]
|
||||
%bundle [~ state]
|
||||
%path
|
||||
:_ state
|
||||
?~ pax.diff ~
|
||||
|
@ -14,10 +14,7 @@
|
||||
=groups
|
||||
==
|
||||
::
|
||||
+$ diff
|
||||
$% [%group-update group-update]
|
||||
[%group-initial groups]
|
||||
==
|
||||
+$ diff [%group-update group-update]
|
||||
--
|
||||
::
|
||||
=| state-zero
|
||||
@ -56,7 +53,7 @@
|
||||
|^
|
||||
=/ cards=(list card)
|
||||
?+ path (on-watch:def path)
|
||||
[%all ~] (give %group-initial !>(groups))
|
||||
[%all ~] (give %group-update !>([%initial groups]))
|
||||
[%updates ~] ~
|
||||
[%keys ~] (give %group-update !>([%keys ~(key by groups)]))
|
||||
[%group *]
|
||||
|
@ -43,9 +43,9 @@
|
||||
!:
|
||||
=> |% ::
|
||||
++ hood-old :: unified old-state
|
||||
{?($1 $2 $3 $4 $5) lac/(map @tas hood-part-old)}
|
||||
{?($1 $2 $3 $4 $5 $6) lac/(map @tas hood-part-old)}
|
||||
++ hood-1 :: unified state
|
||||
{$5 lac/(map @tas hood-part)} ::
|
||||
{$6 lac/(map @tas hood-part)} ::
|
||||
++ hood-good :: extract specific
|
||||
=+ hed=$:hood-head
|
||||
|@ ++ $
|
||||
@ -140,7 +140,7 @@
|
||||
`..on-init
|
||||
::
|
||||
++ on-save
|
||||
!>([%5 lac])
|
||||
!>([%6 lac])
|
||||
::
|
||||
++ on-load
|
||||
|= =old-state=vase
|
||||
@ -152,7 +152,8 @@
|
||||
%2 ((wrap on-load):from-drum:(help hid) %2)
|
||||
%3 ((wrap on-load):from-drum:(help hid) %3)
|
||||
%4 ((wrap on-load):from-drum:(help hid) %4)
|
||||
%5 `lac
|
||||
%5 ((wrap on-load):from-drum:(help hid) %5)
|
||||
%6 `lac
|
||||
==
|
||||
[cards ..on-init]
|
||||
::
|
||||
|
@ -44,8 +44,8 @@
|
||||
^- (quip card _this)
|
||||
=/ cards=(list card)
|
||||
?+ path (on-watch:def path)
|
||||
[%all ~] [%give %fact ~ %invite-initial !>(invites)]~
|
||||
[%updates ~] ~
|
||||
[%all ~] [%give %fact ~ %invite-update !>([%initial invites])]~
|
||||
[%updates ~] ~
|
||||
[%invitatory *]
|
||||
=/ inv=invitatory (~(got by invites) t.path)
|
||||
[%give %fact ~ %invite-update !>([%invitatory inv])]~
|
||||
|
@ -1,74 +0,0 @@
|
||||
:: invite-view: provide a json interface to invite-store
|
||||
::
|
||||
:: accepts subscriptions at the /primary path.
|
||||
:: passes through all invites and their updates.
|
||||
:: only accepts subcriptions from the host's team.
|
||||
::
|
||||
::TODO could maybe use /lib/proxy-hook, be renamed invite-proxy-hook
|
||||
::
|
||||
/+ *invite-json, default-agent, dbug
|
||||
::
|
||||
|%
|
||||
+$ card card:agent:gall
|
||||
--
|
||||
::
|
||||
=>
|
||||
|%
|
||||
++ watch-updates
|
||||
|= our=ship
|
||||
^- card
|
||||
[%pass /store %agent [our %invite-store] %watch /updates]
|
||||
--
|
||||
::
|
||||
%- agent:dbug
|
||||
^- agent:gall
|
||||
|_ =bowl:gall
|
||||
+* this .
|
||||
def ~(. (default-agent this %|) bowl)
|
||||
::
|
||||
++ on-init
|
||||
^- (quip card _this)
|
||||
[[(watch-updates our.bowl)]~ this]
|
||||
::
|
||||
++ on-save on-save:def
|
||||
++ on-load
|
||||
|= old=vase
|
||||
^- (quip card _this)
|
||||
[~ this]
|
||||
::
|
||||
++ on-watch
|
||||
|= =path
|
||||
^- (quip card _this)
|
||||
?> (team:title our.bowl src.bowl)
|
||||
?. =(/primary path)
|
||||
(on-watch:def path)
|
||||
:_ this
|
||||
=/ =invites
|
||||
.^(invites %gx /=invite-store/(scot %da now.bowl)/all/noun)
|
||||
[%give %fact ~ %json !>((invites-to-json invites))]~
|
||||
::
|
||||
++ on-agent
|
||||
|= [=wire =sign:agent:gall]
|
||||
^- (quip card _this)
|
||||
:_ this
|
||||
?- -.sign
|
||||
%poke-ack ~|([dap.bowl %unexpected-poke-ack] !!)
|
||||
%watch-ack ~
|
||||
%kick [(watch-updates our.bowl)]~
|
||||
::
|
||||
%fact
|
||||
~| [dap.bowl %unexpected-fact-mark p.cage.sign]
|
||||
?> ?=(%invite-update p.cage.sign)
|
||||
:~ :*
|
||||
%give %fact
|
||||
~[/primary] %json
|
||||
!>((update-to-json !<(invite-update q.cage.sign)))
|
||||
== ==
|
||||
==
|
||||
::
|
||||
++ on-poke on-poke:def
|
||||
++ on-peek on-peek:def
|
||||
++ on-leave on-leave:def
|
||||
++ on-arvo on-arvo:def
|
||||
++ on-fail on-fail:def
|
||||
--
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 453 B After Width: | Height: | Size: 453 B |
Before Width: | Height: | Size: 611 B After Width: | Height: | Size: 611 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 865 B After Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
pkg/arvo/app/landscape/img/Links.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1010 B After Width: | Height: | Size: 1010 B |
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 951 B After Width: | Height: | Size: 951 B |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@ -1,31 +1,29 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Chat</title>
|
||||
<title>OS1</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-touch-fullscreen" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
||||
<link rel="apple-touch-icon" href="/~chat/img/touch_icon.png">
|
||||
<link rel="stylesheet" href="/~chat/css/index.css" />
|
||||
<link rel="icon" type="image/png" href="/~launch/img/Favicon.png">
|
||||
<link rel="apple-touch-icon" href="/~landscape/img/touch_icon.png">
|
||||
<link rel="icon" type="image/png" href="/~landscape/img/Favicon.png">
|
||||
<link rel="manifest"
|
||||
href='data:application/manifest+json,{
|
||||
"name": "Chat",
|
||||
"short_name": "Chat",
|
||||
"description": "A%20Chat%20application%20for%20your%20Urbit%20ship.",
|
||||
"name": "OS1",
|
||||
"short_name": "OS1",
|
||||
"description": "An%20interface%20to%20your%20Urbit.",
|
||||
"display": "standalone",
|
||||
"background_color": "%23FFFFFF",
|
||||
"theme_color": "%23000000"}' />
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"/>
|
||||
<script src="/~channel/channel.js"></script>
|
||||
<script src="/~modulo/session.js"></script>
|
||||
<script src="/~chat/js/index.js"></script>
|
||||
<script src="/~landscape/js/channel.js"></script>
|
||||
<script src="/~landscape/js/session.js"></script>
|
||||
<script src="/~landscape/js/index.js"></script>
|
||||
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.12.min.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -126,6 +126,9 @@ class Channel {
|
||||
id,
|
||||
action: "delete"
|
||||
}]));
|
||||
if (this.eventSource) {
|
||||
this.eventSource.close();
|
||||
}
|
||||
}
|
||||
|
||||
// unsubscribe to a specific subscription
|
||||
@ -227,5 +230,6 @@ class Channel {
|
||||
nextId() {
|
||||
return this.requestId++;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
window.channel = Channel;
|
351
pkg/arvo/app/landscape/js/index.js
Normal file
@ -1,230 +1,177 @@
|
||||
/- launch
|
||||
/+ *server, default-agent, dbug
|
||||
::
|
||||
/= index
|
||||
/^ $-([json marl] manx)
|
||||
/: /===/app/launch/index /!noun/
|
||||
/= script
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/launch/js/index
|
||||
/| /js/
|
||||
/~ ~
|
||||
==
|
||||
/= channel-js
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/launch/js/channel
|
||||
/| /js/
|
||||
/~ ~
|
||||
==
|
||||
/= style
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/launch/css/index
|
||||
/| /css/
|
||||
/~ ~
|
||||
==
|
||||
/= launch-png
|
||||
/^ (map knot @)
|
||||
/: /===/app/launch/img /_ /png/
|
||||
::
|
||||
/+ store=launch-store, default-agent, dbug
|
||||
|%
|
||||
+$ card card:agent:gall
|
||||
+$ versioned-state
|
||||
$% [%0 state-zero]
|
||||
[%1 state-two]
|
||||
[%2 state-two]
|
||||
[%3 state-two]
|
||||
$% [%0 *]
|
||||
[%1 *]
|
||||
[%2 *]
|
||||
[%3 *]
|
||||
[%4 state-zero]
|
||||
==
|
||||
::
|
||||
+$ state-zero
|
||||
$: tiles=(set tile:launch)
|
||||
data=tile-data:launch
|
||||
path-to-tile=(map path @tas)
|
||||
==
|
||||
+$ state-two
|
||||
$: tiles=(set tile:launch)
|
||||
data=tile-data:launch
|
||||
path-to-tile=(map path @tas)
|
||||
$: =tiles:store
|
||||
=tile-ordering:store
|
||||
first-time=?
|
||||
==
|
||||
::
|
||||
+$ card card:agent:gall
|
||||
++ launch-who
|
||||
|= =desk
|
||||
[%pass /who %arvo %e %serve [~ /who] desk /gen/who/hoon ~]
|
||||
--
|
||||
::
|
||||
=| [%3 state-two]
|
||||
=| [%4 state-zero]
|
||||
=* state -
|
||||
%- agent:dbug
|
||||
^- agent:gall
|
||||
|_ bol=bowl:gall
|
||||
|_ =bowl:gall
|
||||
+* this .
|
||||
def ~(. (default-agent this %|) bol)
|
||||
def ~(. (default-agent this %|) bowl)
|
||||
::
|
||||
++ on-init
|
||||
^- (quip card _this)
|
||||
:_ this(state *[%3 state-two])
|
||||
:~ (launch-who q.byk.bol)
|
||||
[%pass / %arvo %e %connect [~ /] %launch]
|
||||
==
|
||||
=/ new-state *state-zero
|
||||
=. new-state
|
||||
%_ new-state
|
||||
tiles
|
||||
%- ~(gas by *tiles:store)
|
||||
%+ turn `(list term)`[%chat %publish %links %weather %clock %dojo ~]
|
||||
|= =term
|
||||
:- term
|
||||
^- tile:store
|
||||
?+ term [[%custom ~] %.y]
|
||||
%chat [[%basic 'Chat' '/~landscape/img/Chat.png' '/~chat'] %.y]
|
||||
%links [[%basic 'Links' '/~landscape/img/Links.png' '/~link'] %.y]
|
||||
%dojo [[%basic 'Dojo' '/~landscape/img/Dojo.png' '/~dojo'] %.y]
|
||||
%publish
|
||||
[[%basic 'Publish' '/~landscape/img/Publish.png' '/~publish'] %.y]
|
||||
==
|
||||
tile-ordering [%chat %publish %links %weather %clock %dojo ~]
|
||||
==
|
||||
[~ this(state [%4 new-state])]
|
||||
::
|
||||
++ on-save !>(state)
|
||||
::
|
||||
++ on-load
|
||||
|= old=vase
|
||||
^- (quip card _this)
|
||||
=/ old-state !<(versioned-state old)
|
||||
=| cards=(list card)
|
||||
|-
|
||||
?- -.old-state
|
||||
%0
|
||||
$(old-state [%1 tiles data path-to-tile %.n]:old-state)
|
||||
::
|
||||
%1
|
||||
=/ new-state=state-two
|
||||
=, old-state
|
||||
:* (~(del in tiles) [%contact-view /primary])
|
||||
(~(del by data) %contact-view)
|
||||
(~(del by path-to-tile) /primary)
|
||||
first-time
|
||||
?: ?=(%4 -.old-state)
|
||||
:- [%pass / %arvo %e %disconnect [~ /]]~
|
||||
this(state old-state)
|
||||
=/ new-state *state-zero
|
||||
=. new-state
|
||||
%_ new-state
|
||||
tiles
|
||||
%- ~(gas by *tiles:store)
|
||||
%+ turn `(list term)`[%chat %publish %links %weather %clock %dojo ~]
|
||||
|= =term
|
||||
:- term
|
||||
^- tile:store
|
||||
?+ term [[%custom ~] %.y]
|
||||
%chat [[%basic 'Chat' '/~landscape/img/Chat.png' '/~chat'] %.y]
|
||||
%links [[%basic 'Links' '/~landscape/img/Links.png' '/~link'] %.y]
|
||||
%dojo [[%basic 'Dojo' '/~landscape/img/Dojo.png' '/~dojo'] %.y]
|
||||
%publish
|
||||
[[%basic 'Publish' '/~landscape/img/Publish.png' '/~publish'] %.y]
|
||||
==
|
||||
$(old-state [%2 new-state])
|
||||
::
|
||||
%2
|
||||
$(old-state [%3 +.old-state], cards [(launch-who q.byk.bol) cards])
|
||||
::
|
||||
%3
|
||||
[(flop cards) this(state old-state)]
|
||||
==
|
||||
tile-ordering [%chat %publish %links %weather %clock %dojo ~]
|
||||
==
|
||||
:_ this(state [%4 new-state])
|
||||
%+ welp
|
||||
:~ [%pass / %arvo %e %disconnect [~ /]]
|
||||
:* %pass /srv %agent [our.bowl %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir / /app/landscape %.n])
|
||||
==
|
||||
==
|
||||
%+ turn ~(tap by wex.bowl)
|
||||
|= [[=wire =ship =term] *]
|
||||
^- card
|
||||
[%pass wire %agent [ship term] %leave ~]
|
||||
::
|
||||
++ on-poke
|
||||
|= [mar=mark vas=vase]
|
||||
|= [=mark =vase]
|
||||
^- (quip card _this)
|
||||
?+ mar (on-poke:def mar vas)
|
||||
%json
|
||||
?> (team:title our.bol src.bol)
|
||||
=/ jon !<(json vas)
|
||||
:- ~
|
||||
?. =(jon [%s 'disable welcome message'])
|
||||
this
|
||||
this(first-time %.n)
|
||||
|^
|
||||
?> (team:title our.bowl src.bowl)
|
||||
=^ cards state
|
||||
?+ mark (on-poke:def mark vase)
|
||||
%launch-action (poke-action !<(action:store vase))
|
||||
==
|
||||
[cards this]
|
||||
::
|
||||
%launch-action
|
||||
=/ act !<(action:launch vas)
|
||||
?- -.act
|
||||
++ poke-action
|
||||
|= =action:store
|
||||
^- (quip card _state)
|
||||
?- -.action
|
||||
%add
|
||||
=/ beforedata (~(get by data) name.act)
|
||||
=/ newdata
|
||||
?~ beforedata
|
||||
(~(put by data) name.act [*json url.act])
|
||||
(~(put by data) name.act [jon.u.beforedata url.act])
|
||||
=/ new-tile `tile:launch`[`@tas`name.act `path`subscribe.act]
|
||||
:- [%pass subscribe.act %agent [our.bol name.act] %watch subscribe.act]~
|
||||
%= this
|
||||
tiles (~(put in tiles) new-tile)
|
||||
data newdata
|
||||
path-to-tile (~(put by path-to-tile) subscribe.act name.act)
|
||||
?< (~(has by tiles) name.action)
|
||||
:- (give [/all /keys ~] action)
|
||||
%_ state
|
||||
tiles (~(put by tiles) name.action tile.action)
|
||||
tile-ordering (snoc tile-ordering name.action)
|
||||
==
|
||||
::
|
||||
::
|
||||
%remove
|
||||
:- [%pass subscribe.act %agent [our.bol name.act] %leave ~]~
|
||||
%= this
|
||||
tiles (~(del in tiles) [name.act subscribe.act])
|
||||
data (~(del by data) name.act)
|
||||
path-to-tile (~(del by path-to-tile) subscribe.act)
|
||||
:- (give [/all /keys ~] action)
|
||||
%_ state
|
||||
tiles (~(del by tiles) name.action)
|
||||
tile-ordering
|
||||
%+ skip tile-ordering
|
||||
|=(=term =(term name.action))
|
||||
==
|
||||
::
|
||||
%change-order
|
||||
?> =(~(key by tiles) (silt tile-ordering.action))
|
||||
:- (give [/all]~ action)
|
||||
state(tile-ordering tile-ordering.action)
|
||||
::
|
||||
%change-is-shown
|
||||
=/ =tile:store (~(got by tiles) name.action)
|
||||
?. =(is-shown.tile is-shown.action) [~ state]
|
||||
=. is-shown.tile is-shown.action
|
||||
:- (give [/all]~ action)
|
||||
state(tiles (~(put by tiles) name.action tile))
|
||||
::
|
||||
%change-first-time
|
||||
:- (give [/all]~ action)
|
||||
state(first-time first-time.action)
|
||||
==
|
||||
::
|
||||
%handle-http-request
|
||||
=+ !<([eyre-id=@ta =inbound-request:eyre] vas)
|
||||
:_ this
|
||||
%+ give-simple-payload:app eyre-id
|
||||
%+ require-authorization:app inbound-request
|
||||
|= =inbound-request:eyre
|
||||
^- simple-payload:http
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
=/ name=@t
|
||||
=/ back-path (flop site.request-line)
|
||||
?~ back-path
|
||||
''
|
||||
i.back-path
|
||||
?+ site.request-line
|
||||
not-found:gen
|
||||
::
|
||||
[~ ~]
|
||||
=/ hym=manx
|
||||
%+ index
|
||||
[%b first-time]
|
||||
^- marl
|
||||
%+ turn ~(tap by data)
|
||||
|= [key=@tas [jon=json url=@t]]
|
||||
^- manx
|
||||
;script@"{(trip url)}";
|
||||
(manx-response:gen hym)
|
||||
::
|
||||
[%'~launch' %css %index ~] :: styling
|
||||
(css-response:gen style)
|
||||
::
|
||||
[%'~launch' %js %index ~] :: javascript
|
||||
(js-response:gen script)
|
||||
::
|
||||
[%'~launch' %img *] :: images
|
||||
=/ img=(unit @) (~(get by launch-png) `@ta`name)
|
||||
?~ img
|
||||
not-found:gen
|
||||
(png-response:gen (as-octs:mimes:html u.img))
|
||||
::
|
||||
[%'~modulo' %session ~]
|
||||
=/ session-js
|
||||
%- as-octt:mimes:html
|
||||
;: weld
|
||||
"window.ship = '{+:(scow %p our.bol)}';"
|
||||
"window.urb = new Channel();"
|
||||
==
|
||||
(js-response:gen session-js)
|
||||
::
|
||||
[%'~channel' %channel ~]
|
||||
(js-response:gen channel-js)
|
||||
==
|
||||
==
|
||||
++ give
|
||||
|= [paths=(list path) =update:store]
|
||||
^- (list card)
|
||||
[%give %fact paths [%launch-update !>(update)]]~
|
||||
--
|
||||
::
|
||||
++ on-watch
|
||||
|= pax=path
|
||||
|= =path
|
||||
^- (quip card _this)
|
||||
?: ?=([%http-response *] pax)
|
||||
[~ this]
|
||||
?. ?=([%main *] pax)
|
||||
(on-watch:def pax)
|
||||
=/ data=json
|
||||
%- pairs:enjs:format
|
||||
%+ turn ~(tap by data)
|
||||
|= [key=@tas [jon=json url=@t]]
|
||||
[key jon]
|
||||
:_ this
|
||||
[%give %fact ~ %json !>(data)]~
|
||||
::
|
||||
++ on-leave on-leave:def
|
||||
++ on-peek on-peek:def
|
||||
++ on-fail on-fail:def
|
||||
++ on-agent
|
||||
|= [wir=wire sin=sign:agent:gall]
|
||||
^- (quip card _this)
|
||||
?. ?=(%fact -.sin)
|
||||
(on-agent:def wir sin)
|
||||
?. ?=(%json p.cage.sin)
|
||||
(on-agent:def wir sin)
|
||||
|^
|
||||
?> (team:title our.bowl src.bowl)
|
||||
=/ cards=(list card)
|
||||
?+ path (on-watch:def path)
|
||||
[%all ~] (give [%initial tiles tile-ordering first-time])
|
||||
[%keys ~] (give [%keys ~(key by tiles)])
|
||||
==
|
||||
[cards this]
|
||||
::
|
||||
=/ jon=json !<(json q.cage.sin)
|
||||
=/ name=@tas (~(got by path-to-tile) wir)
|
||||
=/ dat=(unit [json url=@t]) (~(get by data) name)
|
||||
?~ dat [~ this]
|
||||
:_ this(data (~(put by data) name [jon url.u.dat]))
|
||||
[%give %fact ~[/main] %json !>((frond:enjs:format name jon))]~
|
||||
++ give
|
||||
|= =update:store
|
||||
^- (list card)
|
||||
[%give %fact ~ [%launch-update !>(update)]]~
|
||||
--
|
||||
::
|
||||
++ on-peek
|
||||
|= =path
|
||||
^- (unit (unit cage))
|
||||
?+ path (on-peek:def path)
|
||||
[%x %keys ~] ``noun+!>(~(key by tiles))
|
||||
==
|
||||
::
|
||||
++ on-arvo
|
||||
|= [wir=wire sin=sign-arvo]
|
||||
^- (quip card:agent:gall _this)
|
||||
?. ?=(%bound +<.sin)
|
||||
(on-arvo:def wir sin)
|
||||
[~ this]
|
||||
?: ?=(%bound +<.sin) [~ this]
|
||||
(on-arvo:def wir sin)
|
||||
::
|
||||
++ on-agent on-agent:def
|
||||
++ on-leave on-leave:def
|
||||
++ on-fail on-fail:def
|
||||
--
|
||||
|
Before Width: | Height: | Size: 255 B |
@ -1,20 +0,0 @@
|
||||
|= [startup=json scripts=marl]
|
||||
;html
|
||||
;head
|
||||
;title: Home
|
||||
;meta(charset "utf-8");
|
||||
;meta
|
||||
=name "viewport"
|
||||
=content "width=device-width, initial-scale=1, shrink-to-fit=no";
|
||||
;link(rel "stylesheet", href "/~launch/css/index.css");
|
||||
;link(rel "icon", type "image/png", href "/~launch/img/Favicon.png");
|
||||
==
|
||||
;body
|
||||
;div#root;
|
||||
;script@"/~channel/channel.js";
|
||||
;script@"/~modulo/session.js";
|
||||
;* scripts
|
||||
;script@"/~launch/js/index.js";
|
||||
;script: window.startupMessage = {(en-json:html startup)}
|
||||
==
|
||||
==
|
@ -338,7 +338,6 @@
|
||||
=* mark p.cage.sign
|
||||
=* vase q.cage.sign
|
||||
?+ mark ~|([dap.bowl %unexpected-mark mark] !!)
|
||||
%group-initial [~ state] ::NOTE initial handled using metadata
|
||||
%group-update (handle-group-update !<(group-update:group-store vase))
|
||||
==
|
||||
==
|
||||
@ -346,6 +345,7 @@
|
||||
++ handle-group-update
|
||||
|= upd=group-update:group-store
|
||||
^- (quip card _state)
|
||||
:: NOTE initial handled using metadata
|
||||
?. ?=(?(%path %add %remove) -.upd)
|
||||
[~ state]
|
||||
=/ socs=(list app-path)
|
||||
|
@ -19,15 +19,24 @@
|
||||
~% %link-view-top ..is ~
|
||||
::
|
||||
|%
|
||||
+$ versioned-state
|
||||
$% state-0
|
||||
state-1
|
||||
==
|
||||
+$ state-0
|
||||
$: %0
|
||||
~
|
||||
==
|
||||
::
|
||||
+$ state-1
|
||||
$: %1
|
||||
~
|
||||
==
|
||||
::
|
||||
+$ card card:agent:gall
|
||||
--
|
||||
::
|
||||
=| state-0
|
||||
=| state-1
|
||||
=* state -
|
||||
::
|
||||
%+ verb |
|
||||
@ -42,27 +51,36 @@
|
||||
++ on-init
|
||||
^- (quip card _this)
|
||||
:_ this
|
||||
:~ [%pass /connect %arvo %e %connect [~ /'~link'] dap.bowl]
|
||||
[%pass /submissions %agent [our.bowl %link-store] %watch /submissions]
|
||||
:~ [%pass /submissions %agent [our.bowl %link-store] %watch /submissions]
|
||||
[%pass /discussions %agent [our.bowl %link-store] %watch /discussions]
|
||||
[%pass /seen %agent [our.bowl %link-store] %watch /seen]
|
||||
::
|
||||
=+ [%add dap.bowl /tile '/~link/js/tile.js']
|
||||
[%pass /launch %agent [our.bowl %launch] %poke %launch-action !>(-)]
|
||||
::
|
||||
=+ [%invite-action !>([%create /link])]
|
||||
[%pass /invitatory/create %agent [our.bowl %invite-store] %poke -]
|
||||
::
|
||||
=+ /invitatory/link
|
||||
[%pass - %agent [our.bowl %invite-store] %watch -]
|
||||
:* %pass /srv %agent [our.bowl %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~link' /app/landscape %.n])
|
||||
==
|
||||
==
|
||||
::
|
||||
++ on-save !>(state)
|
||||
::
|
||||
++ on-load
|
||||
|= old=vase
|
||||
|= old-vase=vase
|
||||
^- (quip card _this)
|
||||
[~ this(state !<(state-0 old))]
|
||||
=/ old !<(versioned-state old-vase)
|
||||
?- -.old
|
||||
%1 [~ this]
|
||||
%0
|
||||
:_ this(state [%1 ~])
|
||||
:- [%pass /connect %arvo %e %disconnect [~ /'~link']]
|
||||
:~ :* %pass /srv %agent [our.bowl %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~link' /app/landscape %.n])
|
||||
== ==
|
||||
==
|
||||
::
|
||||
++ on-poke
|
||||
|= [=mark =vase]
|
||||
@ -70,12 +88,6 @@
|
||||
?> (team:title our.bowl src.bowl)
|
||||
:_ this
|
||||
?+ mark (on-poke:def mark vase)
|
||||
%handle-http-request
|
||||
=+ !<([eyre-id=@ta =inbound-request:eyre] vase)
|
||||
%+ give-simple-payload:app eyre-id
|
||||
%+ require-authorization:app inbound-request
|
||||
handle-http-request:do
|
||||
::
|
||||
%link-action
|
||||
[(handle-action:do !<(action vase)) ~]
|
||||
::
|
||||
@ -86,9 +98,7 @@
|
||||
++ on-watch
|
||||
|= =path
|
||||
^- (quip card _this)
|
||||
?: ?| ?=([%http-response *] path)
|
||||
?=([%json %seen ~] path)
|
||||
==
|
||||
?: ?=([%json %seen ~] path)
|
||||
[~ this]
|
||||
?: ?=([%tile ~] path)
|
||||
:_ this
|
||||
@ -185,63 +195,6 @@
|
||||
'pageNumber'^(numb page-number)
|
||||
'page'^a+(turn page item-to-json)
|
||||
==
|
||||
::
|
||||
++ handle-http-request
|
||||
|= =inbound-request:eyre
|
||||
^- simple-payload:http
|
||||
?. =(src.bowl our.bowl)
|
||||
[[403 ~] ~]
|
||||
:: request-line: parsed url + params
|
||||
::
|
||||
=/ =request-line
|
||||
%- parse-request-line
|
||||
url.request.inbound-request
|
||||
=* req-head header-list.request.inbound-request
|
||||
?+ method.request.inbound-request not-found:gen
|
||||
%'GET'
|
||||
(handle-get req-head request-line)
|
||||
==
|
||||
::
|
||||
++ handle-get
|
||||
|= [request-headers=header-list:http =request-line]
|
||||
^- simple-payload:http
|
||||
:: try to load file from clay
|
||||
::
|
||||
?~ ext.request-line
|
||||
:: for extension-less requests, always just serve the index.html.
|
||||
:: that way the js can load and figure out how to deal with that route.
|
||||
::
|
||||
$(request-line [[`%html ~[%'~link' 'index']] args.request-line])
|
||||
=/ file=(unit octs)
|
||||
?. ?=([%'~link' *] site.request-line) ~
|
||||
(get-file-at /app/link [t.site u.ext]:request-line)
|
||||
?~ file not-found:gen
|
||||
?+ u.ext.request-line not-found:gen
|
||||
%html (html-response:gen u.file)
|
||||
%js (js-response:gen u.file)
|
||||
%css (css-response:gen u.file)
|
||||
%png (png-response:gen u.file)
|
||||
==
|
||||
::
|
||||
++ get-file-at
|
||||
|= [base=path file=path ext=@ta]
|
||||
^- (unit octs)
|
||||
:: only expose html, css and js files for now
|
||||
::
|
||||
?. ?=(?(%html %css %js %png) ext)
|
||||
~
|
||||
=/ =path
|
||||
:* (scot %p our.bowl)
|
||||
q.byk.bowl
|
||||
(scot %da now.bowl)
|
||||
(snoc (weld base file) ext)
|
||||
==
|
||||
?. .^(? %cu path)
|
||||
~
|
||||
%- some
|
||||
%- as-octs:mimes:html
|
||||
.^(@ %cx path)
|
||||
::
|
||||
++ do-poke
|
||||
|= [app=term =mark =vase]
|
||||
^- card
|
||||
|
Before Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 951 B |
@ -1,20 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Links</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<link rel="stylesheet" href="/~link/css/index.css" />
|
||||
<link rel="icon" type="image/png" href="/~launch/img/Favicon.png">
|
||||
</head>
|
||||
|
||||
<body class="w-100 h-100">
|
||||
<div id="root" class="w-100 h-100">
|
||||
</div>
|
||||
<script src="/~channel/channel.js"></script>
|
||||
<script src="/~modulo/session.js"></script>
|
||||
<script src="/~link/js/index.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -145,6 +145,7 @@
|
||||
|= diff=group-update
|
||||
^- (quip card _state)
|
||||
?- -.diff
|
||||
%initial [~ state]
|
||||
%keys [~ state]
|
||||
%bundle [~ state]
|
||||
::
|
||||
|
@ -189,6 +189,7 @@
|
||||
|= diff=permission-update
|
||||
^- (quip card _state)
|
||||
?- -.diff
|
||||
%initial [~ state]
|
||||
%create [~ state]
|
||||
%add (change-local-permission %add [path who]:diff)
|
||||
%remove (change-local-permission %remove [path who]:diff)
|
||||
@ -231,6 +232,7 @@
|
||||
|= diff=permission-update
|
||||
^- (quip card _state)
|
||||
?- -.diff
|
||||
%initial [~ state]
|
||||
?(%create %add %remove)
|
||||
(change-foreign-permission path.diff diff)
|
||||
::
|
||||
|
@ -51,8 +51,8 @@
|
||||
|^
|
||||
=/ cards=(list card)
|
||||
?+ path (on-watch:def path)
|
||||
[%all ~] (give %permission-initial !>(permissions))
|
||||
[%updates ~] ~
|
||||
[%all ~] (give %permission-update !>([%initial permissions]))
|
||||
[%updates ~] ~
|
||||
[%permission @ *]
|
||||
=/ =vase !>([%create t.path (~(got by permissions) t.path)])
|
||||
(give %permission-update vase)
|
||||
@ -95,6 +95,7 @@
|
||||
^- (quip card _state)
|
||||
?> (team:title our.bol src.bol)
|
||||
?- -.action
|
||||
%initial [~ state]
|
||||
%add (handle-add action)
|
||||
%remove (handle-remove action)
|
||||
%create (handle-create action)
|
||||
|
@ -1,4 +1,3 @@
|
||||
::
|
||||
/- *publish,
|
||||
*group-store,
|
||||
*group-hook,
|
||||
@ -11,35 +10,6 @@
|
||||
*rw-security
|
||||
/+ *server, *publish, cram, default-agent, dbug
|
||||
::
|
||||
/= index
|
||||
/^ $-(json manx)
|
||||
/: /===/app/publish/index /!noun/
|
||||
::
|
||||
/= js
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/| /: /===/app/publish/js/index /js/
|
||||
/~ ~
|
||||
==
|
||||
::
|
||||
/= css
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/| /: /===/app/publish/css/index /css/
|
||||
/~ ~
|
||||
==
|
||||
::
|
||||
/= tile-js
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/| /: /===/app/publish/js/tile /js/
|
||||
/~ ~
|
||||
==
|
||||
::
|
||||
/= images
|
||||
/^ (map knot @)
|
||||
/: /===/app/publish/img /_ /png/
|
||||
::
|
||||
~% %publish ..is ~
|
||||
|%
|
||||
+$ card card:agent:gall
|
||||
@ -99,11 +69,9 @@
|
||||
::
|
||||
++ on-init
|
||||
^- (quip card _this)
|
||||
=/ lac [%add %publish /publishtile '/~publish/tile.js']
|
||||
=/ rav [%sing %t [%da now.bol] /app/publish/notebooks]
|
||||
:_ this
|
||||
:~ [%pass /bind %arvo %e %connect [~ /'~publish'] %publish]
|
||||
[%pass /tile %agent [our.bol %launch] %poke %launch-action !>(lac)]
|
||||
:~ [%pass /view-bind %arvo %e %connect [~ /'publish-view'] %publish]
|
||||
[%pass /read/paths %arvo %c %warp our.bol q.byk.bol `rav]
|
||||
[%pass /permissions %agent [our.bol %permission-store] %watch /updates]
|
||||
(invite-poke:main [%create /publish])
|
||||
@ -113,6 +81,10 @@
|
||||
:* %pass / %agent [our.bol %invite-store] %poke %invite-action
|
||||
!>([%create /publish])
|
||||
==
|
||||
:* %pass /srv %agent [our.bol %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~publish' /app/landscape %.n])
|
||||
==
|
||||
==
|
||||
::
|
||||
++ on-save !>(state)
|
||||
@ -127,8 +99,6 @@
|
||||
?: ?=(%| -.old-state)
|
||||
=/ zero !<(state-zero old)
|
||||
=/ rav [%next %t [%da now.bol] /app/publish/notebooks]
|
||||
=/ tile-json
|
||||
(frond:enjs:format %notifications (numb:enjs:format 0))
|
||||
=/ init-cards=(list card)
|
||||
:~ [%pass /read/paths %arvo %c %warp our.bol q.byk.bol `rav]
|
||||
:* %pass /permissions %agent [our.bol %permission-store] %watch
|
||||
@ -138,7 +108,12 @@
|
||||
:* %pass /invites %agent [our.bol %invite-store] %watch
|
||||
/invitatory/publish
|
||||
==
|
||||
[%give %fact [/publishtile]~ %json !>(tile-json)]
|
||||
[%pass /bind %arvo %e %disconnect [~ /'~publish']]
|
||||
[%pass /view-bind %arvo %e %connect [~ /'publish-view'] %publish]
|
||||
:* %pass /srv %agent [our.bol %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~publish' /app/landscape %.n])
|
||||
==
|
||||
==
|
||||
=+ ^- [kick-cards=(list card) old-subs=(jug @tas @p)] kick-subs
|
||||
=/ inv-scry-pax
|
||||
@ -200,7 +175,14 @@
|
||||
==
|
||||
::
|
||||
%3
|
||||
[cards this(state p.old-state)]
|
||||
:_ this(state p.old-state)
|
||||
%+ welp cards
|
||||
:~ [%pass /bind %arvo %e %disconnect [~ /'~publish']]
|
||||
[%pass /view-bind %arvo %e %connect [~ /'publish-view'] %publish]
|
||||
:* %pass /srving %agent [our.bol %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~publish' /app/landscape %.n])
|
||||
== ==
|
||||
==
|
||||
::
|
||||
++ convert-comment-2-3
|
||||
@ -361,19 +343,11 @@
|
||||
^- (quip card _this)
|
||||
?+ pax (on-watch:def pax)
|
||||
[%http-response *] [~ this]
|
||||
::
|
||||
[%primary ~] [~ this]
|
||||
[%notebook @ ~]
|
||||
=^ cards state
|
||||
(watch-notebook:main pax)
|
||||
[cards this]
|
||||
::
|
||||
[%primary ~] [~ this]
|
||||
::
|
||||
[%publishtile ~]
|
||||
=/ jon=json
|
||||
(frond:enjs:format %notifications (numb:enjs:format tile-num))
|
||||
:_ this
|
||||
[%give %fact ~ %json !>(jon)]~
|
||||
==
|
||||
::
|
||||
++ on-leave on-leave:def
|
||||
@ -381,7 +355,6 @@
|
||||
|= pax=path
|
||||
^- (unit (unit cage))
|
||||
?+ pax (on-peek:def pax)
|
||||
::
|
||||
[%t %limbo ~]
|
||||
:^ ~ ~ %noun
|
||||
!> ^- (list path)
|
||||
@ -535,6 +508,9 @@
|
||||
::
|
||||
[%bind ~]
|
||||
[~ this]
|
||||
::
|
||||
[%view-bind ~]
|
||||
[~ this]
|
||||
==
|
||||
::
|
||||
++ on-fail on-fail:def
|
||||
@ -919,40 +895,20 @@
|
||||
[~ state]
|
||||
::
|
||||
%delete
|
||||
=/ scry-pax
|
||||
/(scot %p our.bol)/invite-store/(scot %da now.bol)/invitatory/publish/noun
|
||||
=/ inv=(unit invitatory) .^((unit invitatory) %gx scry-pax)
|
||||
?~ inv
|
||||
[~ state]
|
||||
=. tile-num (sub tile-num ~(wyt by u.inv))
|
||||
=/ jon=json (frond:enjs:format %notifications (numb:enjs:format tile-num))
|
||||
:_ state
|
||||
[%give %fact [/publishtile]~ %json !>(jon)]~
|
||||
[~ state]
|
||||
::
|
||||
%invite
|
||||
=. tile-num +(tile-num)
|
||||
=/ jon=json (frond:enjs:format %notifications (numb:enjs:format tile-num))
|
||||
:_ state
|
||||
[%give %fact [/publishtile]~ %json !>(jon)]~
|
||||
[~ state]
|
||||
::
|
||||
%decline
|
||||
=? tile-num (gth tile-num 0)
|
||||
(dec tile-num)
|
||||
=/ jon=json (frond:enjs:format %notifications (numb:enjs:format tile-num))
|
||||
:_ state
|
||||
[%give %fact [/publishtile]~ %json !>(jon)]~
|
||||
[~ state]
|
||||
::
|
||||
%accepted
|
||||
?> ?=([%notebook @ ~] path.invite.upd)
|
||||
=/ book i.t.path.invite.upd
|
||||
=/ wir=wire /subscribe/(scot %p ship.invite.upd)/[book]
|
||||
=? tile-num (gth tile-num 0)
|
||||
(dec tile-num)
|
||||
=/ jon=json (frond:enjs:format %notifications (numb:enjs:format tile-num))
|
||||
:_ state
|
||||
:~ [%pass wir %agent [ship.invite.upd %publish] %watch path.invite.upd]
|
||||
[%give %fact [/publishtile]~ %json !>(jon)]
|
||||
==
|
||||
[%pass wir %agent [ship.invite.upd %publish] %watch path.invite.upd]~
|
||||
==
|
||||
::
|
||||
++ watch-notebook
|
||||
@ -1720,12 +1676,8 @@
|
||||
=. read.u.not %.y
|
||||
=. notes.u.book (~(put by notes.u.book) note.act u.not)
|
||||
=. books (~(put by books) [who.act book.act] u.book)
|
||||
=/ jon=json
|
||||
(frond:enjs:format %notifications (numb:enjs:format tile-num))
|
||||
:_ state
|
||||
:~ [%give %fact [/primary]~ %publish-primary-delta !>(act)]
|
||||
[%give %fact [/publishtile]~ %json !>(jon)]
|
||||
==
|
||||
[%give %fact [/primary]~ %publish-primary-delta !>(act)]~
|
||||
:: %groupify
|
||||
::
|
||||
%groupify
|
||||
@ -1849,11 +1801,7 @@
|
||||
:~ [%give %fact [/notebook/[book-name]]~ %publish-notebook-delta !>(del)]
|
||||
[%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
||||
==
|
||||
=/ jon=json
|
||||
(frond:enjs:format %notifications (numb:enjs:format tile-num))
|
||||
:~ [%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
||||
[%give %fact [/publishtile]~ %json !>(jon)]
|
||||
==
|
||||
[%give %fact [/primary]~ %publish-primary-delta !>(del)]~
|
||||
::
|
||||
++ metadata-poke
|
||||
|= act=metadata-action
|
||||
@ -1945,7 +1893,6 @@
|
||||
^- (quip card _state)
|
||||
?- -.del
|
||||
%add-book
|
||||
=. tile-num (add tile-num (get-unread data.del))
|
||||
?: =(our.bol host.del)
|
||||
=^ cards state
|
||||
(emit-updates-and-state host.del book.del data.del del sty)
|
||||
@ -1978,8 +1925,6 @@
|
||||
?~ book
|
||||
[~ sty]
|
||||
=. read.data.del =(our.bol author.data.del)
|
||||
=? tile-num.sty !read.data.del
|
||||
+(tile-num.sty)
|
||||
=. notes.u.book (~(put by notes.u.book) note.del data.del)
|
||||
(emit-updates-and-state host.del book.del u.book del sty)
|
||||
::
|
||||
@ -2075,15 +2020,8 @@
|
||||
?~ book [~ sty]
|
||||
:_ sty(books (~(del by books.sty) host.del book.del))
|
||||
?. =(our.bol host.del)
|
||||
=. tile-num
|
||||
%+ sub tile-num
|
||||
(get-unread (~(got by books) host.del book.del))
|
||||
=/ jon=json
|
||||
(frond:enjs:format %notifications (numb:enjs:format tile-num.sty))
|
||||
%+ welp
|
||||
:~ [%give %fact [/primary]~ %publish-primary-delta !>(del)]
|
||||
[%give %fact [/publishtile]~ %json !>(jon)]
|
||||
==
|
||||
[%give %fact [/primary]~ %publish-primary-delta !>(del)]~
|
||||
?: (is-managed writers.u.book) ~
|
||||
[(metadata-hook-poke [%remove writers.u.book])]~
|
||||
%- zing
|
||||
@ -2104,8 +2042,6 @@
|
||||
=/ not=(unit note) (~(get by notes.u.book) note.del)
|
||||
?~ not
|
||||
[~ sty]
|
||||
=? tile-num &(!read.u.not (gth tile-num 0))
|
||||
(dec tile-num)
|
||||
=. notes.u.book (~(del by notes.u.book) note.del)
|
||||
(emit-updates-and-state host.del book.del u.book del sty)
|
||||
::
|
||||
@ -2191,35 +2127,18 @@
|
||||
|= req=inbound-request:eyre
|
||||
^- simple-payload:http
|
||||
=/ url (parse-request-line url.request.req)
|
||||
?+ url
|
||||
not-found:gen
|
||||
::
|
||||
[[[~ %png] [%'~publish' @t ~]] ~]
|
||||
=/ filename=@t i.t.site.url
|
||||
=/ img=(unit @t) (~(get by images) filename)
|
||||
?~ img
|
||||
not-found:gen
|
||||
(png-response:gen (as-octs:mimes:html u.img))
|
||||
::
|
||||
[[[~ %css] [%'~publish' %index ~]] ~]
|
||||
(css-response:gen css)
|
||||
::
|
||||
[[[~ %js] [%'~publish' %index ~]] ~]
|
||||
(js-response:gen js)
|
||||
::
|
||||
[[[~ %js] [%'~publish' %tile ~]] ~]
|
||||
(js-response:gen tile-js)
|
||||
?+ url not-found:gen
|
||||
::
|
||||
:: pagination endpoints
|
||||
::
|
||||
:: all notebooks, short form
|
||||
[[[~ %json] [%'~publish' %notebooks ~]] ~]
|
||||
[[[~ %json] [%'publish-view' %notebooks ~]] ~]
|
||||
%- json-response:gen
|
||||
%- json-to-octs
|
||||
(notebooks-map:enjs our.bol books)
|
||||
::
|
||||
:: notes pagination
|
||||
[[[~ %json] [%'~publish' %notes @ @ @ @ ~]] ~]
|
||||
[[[~ %json] [%'publish-view' %notes @ @ @ @ ~]] ~]
|
||||
=/ host=(unit @p) (slaw %p i.t.t.site.url)
|
||||
?~ host
|
||||
not-found:gen
|
||||
@ -2239,7 +2158,7 @@
|
||||
(notes-page:enjs notes.u.book u.start u.length)
|
||||
::
|
||||
:: comments pagination
|
||||
[[[~ %json] [%'~publish' %comments @ @ @ @ @ ~]] ~]
|
||||
[[[~ %json] [%'publish-view' %comments @ @ @ @ @ ~]] ~]
|
||||
=/ host=(unit @p) (slaw %p i.t.t.site.url)
|
||||
?~ host
|
||||
not-found:gen
|
||||
@ -2262,94 +2181,35 @@
|
||||
(comments-page:enjs comments.u.note u.start u.length)
|
||||
::
|
||||
:: single notebook with initial 50 notes in short form, as json
|
||||
[[[~ %json] [%'~publish' @ @ ~]] ~]
|
||||
[[[~ %json] [%'publish-view' @ @ ~]] ~]
|
||||
=, enjs:format
|
||||
=/ host=(unit @p) (slaw %p i.t.site.url)
|
||||
?~ host
|
||||
not-found:gen
|
||||
?~ host not-found:gen
|
||||
=/ book-name i.t.t.site.url
|
||||
=/ book=(unit notebook) (~(get by books) u.host book-name)
|
||||
?~ book
|
||||
not-found:gen
|
||||
?~ book not-found:gen
|
||||
=/ notebook-json (notebook-full:enjs u.host book-name u.book)
|
||||
?> ?=(%o -.notebook-json)
|
||||
=. p.notebook-json
|
||||
(~(uni by p.notebook-json) (notes-page:enjs notes.u.book 0 50))
|
||||
=. p.notebook-json
|
||||
(~(put by p.notebook-json) %subscribers (get-subscribers-json book-name))
|
||||
=/ jon=json (pairs notebook+notebook-json ~)
|
||||
(json-response:gen (json-to-octs jon))
|
||||
(json-response:gen (json-to-octs (pairs notebook+notebook-json ~)))
|
||||
::
|
||||
:: single note, with initial 50 comments, as json
|
||||
[[[~ %json] [%'~publish' @ @ @ ~]] ~]
|
||||
[[[~ %json] [%'publish-view' @ @ @ ~]] ~]
|
||||
=, enjs:format
|
||||
=/ host=(unit @p) (slaw %p i.t.site.url)
|
||||
?~ host
|
||||
not-found:gen
|
||||
?~ host not-found:gen
|
||||
=/ book-name i.t.t.site.url
|
||||
=/ book=(unit notebook) (~(get by books) u.host book-name)
|
||||
?~ book
|
||||
not-found:gen
|
||||
?~ book not-found:gen
|
||||
=/ note-name i.t.t.t.site.url
|
||||
=/ note=(unit note) (~(get by notes.u.book) note-name)
|
||||
?~ note
|
||||
not-found:gen
|
||||
=/ jon=json o+(note-presentation:enjs u.book note-name u.note)
|
||||
?~ note not-found:gen
|
||||
=/ jon=json
|
||||
o+(note-presentation:enjs u.book note-name u.note)
|
||||
(json-response:gen (json-to-octs jon))
|
||||
::
|
||||
:: presentation endpoints
|
||||
::
|
||||
:: all notebooks, short form, wrapped in html
|
||||
[[~ [%'~publish' ?(~ [%join *] [%new ~])]] ~]
|
||||
=, enjs:format
|
||||
=/ jon=json (pairs notebooks+(notebooks-map:enjs our.bol books) ~)
|
||||
(manx-response:gen (index jon))
|
||||
::
|
||||
:: single notebook, with initial 50 notes in short form, wrapped in html
|
||||
[[~ [%'~publish' %notebook @ @ *]] ~]
|
||||
=/ host=(unit @p) (slaw %p i.t.t.site.url)
|
||||
?~ host
|
||||
not-found:gen
|
||||
=/ book-name i.t.t.t.site.url
|
||||
=/ book-json=(unit json) (get-notebook-json u.host book-name)
|
||||
?~ book-json
|
||||
not-found:gen
|
||||
(manx-response:gen (index u.book-json))
|
||||
::
|
||||
:: single notebook, with initial 50 notes in short form, wrapped in html
|
||||
[[~ [%'~publish' %popout %notebook @ @ *]] ~]
|
||||
=/ host=(unit @p) (slaw %p i.t.t.t.site.url)
|
||||
?~ host
|
||||
not-found:gen
|
||||
=/ book-name i.t.t.t.t.site.url
|
||||
=/ book-json=(unit json) (get-notebook-json u.host book-name)
|
||||
?~ book-json
|
||||
not-found:gen
|
||||
(manx-response:gen (index u.book-json))
|
||||
::
|
||||
:: single note, with initial 50 comments, wrapped in html
|
||||
[[~ [%'~publish' %note @ @ @ *]] ~]
|
||||
=/ host=(unit @p) (slaw %p i.t.t.site.url)
|
||||
?~ host
|
||||
not-found:gen
|
||||
=/ book-name i.t.t.t.site.url
|
||||
=/ note-name i.t.t.t.t.site.url
|
||||
=/ note-json=(unit json) (get-note-json u.host book-name note-name)
|
||||
?~ note-json
|
||||
not-found:gen
|
||||
(manx-response:gen (index u.note-json))
|
||||
::
|
||||
:: single note, with initial 50 comments, wrapped in html
|
||||
[[~ [%'~publish' %popout %note @ @ @ *]] ~]
|
||||
=/ host=(unit @p) (slaw %p i.t.t.t.site.url)
|
||||
?~ host
|
||||
not-found:gen
|
||||
=/ book-name i.t.t.t.t.site.url
|
||||
=/ note-name i.t.t.t.t.t.site.url
|
||||
=/ note-json=(unit json) (get-note-json u.host book-name note-name)
|
||||
?~ note-json
|
||||
not-found:gen
|
||||
(manx-response:gen (index u.note-json))
|
||||
==
|
||||
::
|
||||
--
|
||||
|
Before Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 951 B |
@ -1,22 +0,0 @@
|
||||
|= inject=json
|
||||
^- manx
|
||||
;html
|
||||
::
|
||||
;head
|
||||
;title: Publish
|
||||
;meta(charset "utf-8");
|
||||
;meta
|
||||
=name "viewport"
|
||||
=content "width=device-width, initial-scale=1, shrink-to-fit=no";
|
||||
;link(rel "stylesheet", href "/~publish/index.css");
|
||||
;link(rel "icon", type "image/png", href "/~launch/img/Favicon.png");
|
||||
;script@"/~channel/channel.js";
|
||||
;script@"/~modulo/session.js";
|
||||
;script: window.injectedState = {(en-json:html inject)}
|
||||
==
|
||||
::
|
||||
;body
|
||||
;div#root.w-100.h-100;
|
||||
;script@"/~publish/index.js";
|
||||
==
|
||||
==
|
@ -3,43 +3,17 @@
|
||||
:: Relays sole-effects to subscribers and forwards sole-action pokes
|
||||
::
|
||||
/- sole
|
||||
/+ *server, *soto, default-agent
|
||||
/= index
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/soto/index
|
||||
/| /html/
|
||||
/~ ~
|
||||
==
|
||||
/= tile-js
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/soto/js/tile
|
||||
/| /js/
|
||||
/~ ~
|
||||
==
|
||||
/= script
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/soto/js/index
|
||||
/| /js/
|
||||
/~ ~
|
||||
==
|
||||
/= style
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/: /===/app/soto/css/index
|
||||
/| /css/
|
||||
/~ ~
|
||||
==
|
||||
/= soto-png
|
||||
/^ (map knot @)
|
||||
/: /===/app/soto/img /_ /png/
|
||||
::
|
||||
/+ *soto, default-agent
|
||||
|%
|
||||
+$ card card:agent:gall
|
||||
+$ state-zero ~
|
||||
::
|
||||
+$ versioned-state
|
||||
$@ state-null
|
||||
state-zero
|
||||
::
|
||||
+$ state-null ~
|
||||
::
|
||||
+$ state-zero [%0 ~]
|
||||
--
|
||||
=| state-zero
|
||||
=* state -
|
||||
@ -52,65 +26,32 @@
|
||||
::
|
||||
++ on-init
|
||||
:_ this
|
||||
:~ [%pass /bind/soto %arvo %e %connect [~ /'~dojo'] %soto]
|
||||
:* %pass /launch/soto %agent [our.bol %launch] %poke
|
||||
%launch-action !>([%add %soto /sototile '/~dojo/js/tile.js'])
|
||||
==
|
||||
:_ ~
|
||||
:* %pass /srv %agent [our.bol %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~dojo' /app/landscape %.n])
|
||||
==
|
||||
++ on-save !>(state)
|
||||
::
|
||||
++ on-load
|
||||
|= old=vase
|
||||
[~ this(state !<(state-zero old))]
|
||||
::
|
||||
++ on-poke
|
||||
|= [mar=mark vas=vase]
|
||||
^- (quip card _this)
|
||||
?> (team:title our.bol src.bol)
|
||||
?. ?=(%handle-http-request mar)
|
||||
(on-poke:def mar vas)
|
||||
=+ !<([id=@ta req=inbound-request:eyre] vas)
|
||||
:_ this
|
||||
%+ give-simple-payload:app id
|
||||
%+ require-authorization:app req
|
||||
|= =inbound-request:eyre
|
||||
^- simple-payload:http
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
?+ request-line
|
||||
not-found:gen
|
||||
:: main page
|
||||
::
|
||||
[[~ [%'~dojo' *]] *]
|
||||
(html-response:gen index)
|
||||
:: main js
|
||||
::
|
||||
[[[~ %js] [%'~dojo' %js %index ~]] ~]
|
||||
(js-response:gen script)
|
||||
:: tile js
|
||||
::
|
||||
[[[~ %js] [%'~dojo' %js %tile ~]] ~]
|
||||
(js-response:gen tile-js)
|
||||
:: styling
|
||||
::
|
||||
[[[~ %css] [%'~dojo' %css %index ~]] ~]
|
||||
(css-response:gen style)
|
||||
:: images
|
||||
::
|
||||
[[[~ %png] [%'~dojo' %img @t ~]] ~]
|
||||
=/ filename=@t i.t.t.site.request-line
|
||||
=/ img (~(get by soto-png) filename)
|
||||
?~ img
|
||||
not-found:gen
|
||||
(png-response:gen (as-octs:mimes:html u.img))
|
||||
|= old-vase=vase
|
||||
=/ old
|
||||
!<(versioned-state old-vase)
|
||||
?^ old
|
||||
[~ this(state old)]
|
||||
:_ this(state [%0 ~])
|
||||
:~ [%pass /bind/soto %arvo %e %disconnect [~ /'~dojo']]
|
||||
:* %pass /srv %agent [our.bol %file-server]
|
||||
%poke %file-server-action
|
||||
!>([%serve-dir /'~dojo' /app/landscape %.n])
|
||||
==
|
||||
==
|
||||
::
|
||||
++ on-poke on-poke:def
|
||||
++ on-watch
|
||||
|= pax=path
|
||||
^- (quip card _this)
|
||||
?+ pax (on-watch:def pax)
|
||||
[%http-response *]
|
||||
[~ this]
|
||||
::
|
||||
?+ pax (on-watch:def pax)
|
||||
[%sototile ~]
|
||||
:_ this
|
||||
[%give %fact ~ %json !>(~)]~
|
||||
|
Before Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 1.5 KiB |