App download indicator.

This commit is contained in:
2020-06-08 16:10:00 -05:00
parent d3772602c6
commit dccd61c0c9
7 changed files with 108 additions and 47 deletions
+8 -11
View File
@@ -3,8 +3,6 @@
# NOTE: Set CONFIG_FILE to swap out this config file.
#
# TODO(burdon): Set defaults.
app:
title: 'Console'
org': 'DxOS'
@@ -24,20 +22,19 @@ system:
services:
app:
prefix: '/app'
server: 'http://127.0.0.1:5999'
server: 'https://xbox.local'
wns:
server: 'https://node1.dxos.network/wns/api'
webui: 'https://node1.dxos.network/wns/webui'
server: 'https://xbox.local/dxos/wns/api'
webui: 'https://xbox.local/dxos/wns/webui'
signal:
server: 'http://127.0.0.1:4000'
api: 'http://127.0.0.1:4000'
server: 'wss://xbox.local/dxos/signal'
api: 'https://xbox.local/dxos/signal/status'
ipfs:
server: '/ip4/127.0.0.1/tcp/5001'
gateway: '/ip4//127.0.0.1:8888/ipfs/'
webui: 'http://127.0.0.1:5001/webui'
server: 'https://xbox.local/dxos/ipfs/api'
gateway: 'https://xbox.local/dxos/ipfs/gateway'
wellknown:
endpoint: 'http://127.0.0.1:9000/.well-known/dxos'
endpoint: 'https://xbox.local/.well-known/dxos'
+24 -2
View File
@@ -21,14 +21,36 @@ export const ipfsResolvers = {
// NOTE: Hangs if server not running.
const ipfs = new IpfsHttpClient(config.services.ipfs.server);
const id = await ipfs.id();
const version = await ipfs.version();
const status = await ipfs.id();
const peers = await ipfs.swarm.peers();
const stats = await ipfs.stats.repo();
// Do not expose the repo path.
delete stats['repoPath'];
const refs = [];
for await (const ref of ipfs.refs.local()) {
if (ref.err) {
log(ref.err);
} else {
refs.push(ref.ref);
}
}
return {
timestamp: new Date().toUTCString(),
json: JSON.stringify({
id,
version,
status
repo: {
stats
},
refs: {
local: refs
},
swarm: {
peers
}
})
};
}