diff --git a/.gitignore b/.gitignore
index ff01139..0a54eec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@ node_modules
dist
bundle
.cache
+
+.storybook/explorer.js
\ No newline at end of file
diff --git a/.storybook/index.html b/.storybook/index.html
new file mode 100644
index 0000000..b2cfc27
--- /dev/null
+++ b/.storybook/index.html
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Elm Ui Explorer
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.storybook/main.css b/.storybook/main.css
new file mode 100644
index 0000000..b119672
--- /dev/null
+++ b/.storybook/main.css
@@ -0,0 +1,72 @@
+/*
+ elm-hot creates an additional div wrapper around the app to make HMR possible.
+ This could break styling in development mode if you are using Elm UI.
+
+ More context in the issue:
+ https://github.com/halfzebra/create-elm-app/issues/320
+*/
+[data-elm-hot="true"] {
+ height: inherit;
+}
+
+html { font-size: 87.5%; }
+
+body {
+ font-family: 'Roboto Mono', monospace;
+ background-color: #F4F4F4;
+ font-size: 1rem;
+}
+
+h1 {
+ font-family: 'Roboto Mono', monospace;
+}
+
+.element-box {
+ border-width: 2px;
+}
+
+.element-box:hover {
+ border-color: #E11E5A;
+}
+
+.fluence-red {
+ color: #E11E5A;
+}
+
+.table-red-row:hover {
+ background-color: #FFF8F8;
+}
+
+.gray-font {
+ color: #7d7d7d;
+}
+
+.gray-font2 {
+ color: #898989;
+}
+
+.lucida {
+ font-family: 'Lucida Grande', Lucida, Tahoma, Verdana, Arial, sans-serif;
+}
+
+.lucida-in {
+ font-family: 'Lucida Grande', Lucida, Tahoma, Verdana, Arial, sans-serif;
+ color: black;
+}
+
+.welcome-text {
+ line-height: 20px;
+}
+
+.medium-roboto {
+ font-weight: 500;
+
+}
+
+.light-shadow {
+ box-shadow: 0px 1px 3px 1px rgba( 0, 0, 0, 0.1 );
+}
+
+.one-edge-shadow {
+ box-shadow: 0px 1px 6px 1px rgba( 0, 0, 0, 0.1 );
+}
\ No newline at end of file
diff --git a/aqua/app.aqua b/aqua/app.aqua
index c3a926d..896f810 100644
--- a/aqua/app.aqua
+++ b/aqua/app.aqua
@@ -1,31 +1,40 @@
import "@fluencelabs/aqua-lib/builtin.aqua"
-service DashboardEvent("event"):
- peers_discovered()
- all_info(peer: PeerId, ident: Info, services: []Service, blueprints: []Blueprint, modules: []Module)
+alias PeerInfoCb: PeerId, Info, []Service, []Blueprint, []Module -> ()
+alias ServiceInterfaceCb: PeerId, string, Interface -> ()
-func askAllAndSend(peer: PeerId):
+func collectServiceInterfaces(peer: PeerId, services: []Service, collectServiceInterface: ServiceInterfaceCb):
+ for srv <- services par:
+ on peer:
+ iface <- Srv.get_interface(srv.id)
+ collectServiceInterface(peer, srv.id, iface)
+
+func askAllAndSend(peer: PeerId, collectPeerInfo: PeerInfoCb, collectServiceInterface: ServiceInterfaceCb):
on peer:
ident <- Peer.identify()
blueprints <- Dist.list_blueprints()
modules <- Dist.list_modules()
services <- Srv.list()
- DashboardEvent.all_info(peer, ident, services, blueprints, modules)
+ collectPeerInfo(peer, ident, services, blueprints, modules)
+ collectServiceInterfaces(peer, services, collectServiceInterface)
-func findAndAskNeighboursSchema(relayPeerId: PeerId, clientId: PeerId):
+
+func findAndAskNeighboursSchema(relayPeerId: PeerId, clientId: PeerId, collectPeerInfo: PeerInfoCb, collectServiceInterface: ServiceInterfaceCb):
on relayPeerId:
neighbors <- Kademlia.neighborhood(clientId, false)
for n <- neighbors par:
on n:
neighbors2 <- Kademlia.neighborhood(clientId, false)
- for n2 <- neighbors2:
- askAllAndSend(n2)
+ for n2 <- neighbors2 par:
+ askAllAndSend(n2, collectPeerInfo, collectServiceInterface)
-func getAll(relayPeerId: PeerId, knownPeers: []PeerId):
- askAllAndSend(relayPeerId)
+func getAll(relayPeerId: PeerId, knownPeers: []PeerId, collectPeerInfo: PeerInfoCb, collectServiceInterface: ServiceInterfaceCb):
+ -- co askAllAndSend(relayPeerId, collectPeerInfo, collectServiceInterface)
- par for peer <- knownPeers par:
- askAllAndSend(peer)
-
- par findAndAskNeighboursSchema(relayPeerId, %init_peer_id%)
+ -- in order to temporarily reduce the number of particles sent to client
+ -- we gather data from the known peers only.
+ -- Known peers are explicitly represent the whole network atm
+ for peer <- knownPeers par:
+ askAllAndSend(peer, collectPeerInfo, collectServiceInterface)
+ -- co findAndAskNeighboursSchema(relayPeerId, %init_peer_id%, collectPeerInfo, collectServiceInterface)
diff --git a/elm.json b/elm.json
index 3eeb3de..4ac9d28 100644
--- a/elm.json
+++ b/elm.json
@@ -1,6 +1,9 @@
{
"type": "application",
- "source-directories": ["src"],
+ "source-directories": [
+ "src",
+ "src_storybook"
+ ],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
@@ -12,17 +15,30 @@
"elm/html": "1.0.0",
"elm/json": "1.1.3",
"elm/url": "1.0.0",
+ "elm-community/dict-extra": "2.4.0",
"elm-community/intdict": "3.0.0",
"elm-community/list-extra": "8.2.4",
"elm-community/maybe-extra": "5.2.0",
+ "elm-community/string-extra": "4.0.1",
+ "kalutheo/elm-ui-explorer": "9.0.0",
"lukewestby/elm-string-interpolate": "1.0.4"
},
"indirect": {
+ "1602/elm-feather": "2.3.4",
+ "NoRedInk/datetimepicker-legacy": "1.0.4",
+ "avh4/elm-debug-controls": "2.2.1",
+ "elm/parser": "1.1.0",
"elm/random": "1.0.0",
"elm/regex": "1.0.0",
+ "elm/svg": "1.0.1",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2",
- "elm-explorations/test": "1.2.2"
+ "elm-explorations/markdown": "1.0.0",
+ "elm-explorations/test": "1.2.2",
+ "justinmimbs/date": "3.2.1",
+ "justinmimbs/time-extra": "1.1.0",
+ "rtfeldman/elm-css": "16.1.1",
+ "rtfeldman/elm-hex": "1.0.0"
}
},
"test-dependencies": {
diff --git a/index.html b/index.html
index ac0dd34..c8913cc 100644
--- a/index.html
+++ b/index.html
@@ -24,7 +24,7 @@
gtag('js', new Date());
gtag('config', 'G-6ZTQKE1D4L');
-
+