mirror of
https://github.com/fluencelabs/dashboard
synced 2024-12-04 15:20:21 +00:00
fix: Fix dashboard
* Bump js-client * Temp deploy dev on prod * Fix * Fix * Bump fcli * Fix * F * update js-client.web.standalone * bump node.js for dev as well * compile differently * update multiaddr * install old multiaddr explicitly * remove openssl-legacy * return parameter name * downgrade * use kras compatible versions * remove prefix * Cleanup --------- Co-authored-by: Artsiom Shamsutdzinau <shamsartem@gmail.com>
This commit is contained in:
parent
ab6485cbdf
commit
204f7f3be9
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,4 +7,4 @@ bundle
|
|||||||
|
|
||||||
.storybook/explorer.js
|
.storybook/explorer.js
|
||||||
|
|
||||||
src/_aqua
|
src/_aqua
|
||||||
|
46
compile-aqua.mjs
Normal file
46
compile-aqua.mjs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
import { join } from 'path';
|
||||||
|
import { AquaConfig, Aqua, Path } from './node_modules/@fluencelabs/aqua-api/aqua-api.js';
|
||||||
|
import { mkdir, writeFile } from 'fs/promises';
|
||||||
|
|
||||||
|
function getConfig({
|
||||||
|
constants = [],
|
||||||
|
logLevel = 'info',
|
||||||
|
noRelay = false,
|
||||||
|
noXor = false,
|
||||||
|
targetType = 'air',
|
||||||
|
tracing = false,
|
||||||
|
}) {
|
||||||
|
return new AquaConfig(
|
||||||
|
logLevel,
|
||||||
|
constants,
|
||||||
|
noXor,
|
||||||
|
noRelay,
|
||||||
|
{
|
||||||
|
ts: 'typescript',
|
||||||
|
js: 'javascript',
|
||||||
|
air: 'air',
|
||||||
|
}[targetType],
|
||||||
|
tracing,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function compileFromPath({ filePath, ...commonArgs }) {
|
||||||
|
const config = getConfig(commonArgs);
|
||||||
|
const { imports = [] } = commonArgs;
|
||||||
|
return Aqua.compile(new Path(filePath), imports, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
const { generatedSources } = await compileFromPath({
|
||||||
|
targetType: 'js',
|
||||||
|
filePath: join('aqua', 'app.aqua'),
|
||||||
|
imports: ['node_modules'],
|
||||||
|
});
|
||||||
|
|
||||||
|
const targetDir = join('src', '_aqua');
|
||||||
|
|
||||||
|
await mkdir(targetDir, { recursive: true });
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
await writeFile(join(targetDir, 'app.js'), generatedSources[0].jsSource, { encoding: 'utf8' });
|
61
index.html
61
index.html
@ -1,35 +1,40 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<link rel="favicon" type="image/ico" href="images/favicon.ico" />
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@200;400;500&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
|
||||||
<head>
|
<meta charset="utf-8" />
|
||||||
<link rel="favicon" type="image/ico" href="images/favicon.ico" />
|
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@200;400;500&display=swap" rel="stylesheet">
|
<meta name="theme-color" content="#000000" />
|
||||||
|
<!--
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<meta name="theme-color" content="#000000">
|
|
||||||
<!--
|
|
||||||
manifest.json provides metadata used when your web app is added to the
|
manifest.json provides metadata used when your web app is added to the
|
||||||
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||||
-->
|
-->
|
||||||
<script src='https://cdn.jsdelivr.net/npm/@fluencelabs/js-client.web.standalone@0.13.3/dist/js-client.min.js'
|
<script
|
||||||
async></script>
|
src="https://cdn.jsdelivr.net/npm/@fluencelabs/js-client.web.standalone@0.13.7/dist/js-client.min.js"
|
||||||
<title>Fluence Network Dashboard</title>
|
async
|
||||||
</head>
|
></script>
|
||||||
|
<title>Fluence Network Dashboard</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6ZTQKE1D4L"></script>
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6ZTQKE1D4L"></script>
|
||||||
<script>
|
<script>
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag() { dataLayer.push(arguments); }
|
function gtag() {
|
||||||
gtag('js', new Date());
|
dataLayer.push(arguments);
|
||||||
gtag('config', 'G-6ZTQKE1D4L');
|
}
|
||||||
</script>
|
gtag('js', new Date());
|
||||||
<script id="env" type="application/json" src="/env/env.json"></script>
|
gtag('config', 'G-6ZTQKE1D4L');
|
||||||
<div id="root"></div>
|
</script>
|
||||||
</body>
|
<script id="env" type="application/json" src="/env/env.json"></script>
|
||||||
|
<div id="root"></div>
|
||||||
</html>
|
</body>
|
||||||
|
</html>
|
||||||
|
35735
package-lock.json
generated
35735
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -10,8 +10,7 @@
|
|||||||
"build": "npm run compile-aqua && webpack",
|
"build": "npm run compile-aqua && webpack",
|
||||||
"prod": "npm run compile-aqua && webpack -p --mode production",
|
"prod": "npm run compile-aqua && webpack -p --mode production",
|
||||||
"analyse": "elm-analyse -s -p 3001 -o",
|
"analyse": "elm-analyse -s -p 3001 -o",
|
||||||
"compile-aqua": "fluence aqua --js -i ./aqua/ -o ./src/_aqua",
|
"compile-aqua": "node ./compile-aqua.mjs",
|
||||||
"watch-aqua": "fluence aqua --js -w -i ./aqua/ -o ./src/_aqua",
|
|
||||||
"uie": "elm-live src_storybook/Explorer.elm --open --dir=.storybook --start-page=index.html -- --output=.storybook/explorer.js --debug"
|
"uie": "elm-live src_storybook/Explorer.elm --open --dir=.storybook --start-page=index.html -- --output=.storybook/explorer.js --debug"
|
||||||
},
|
},
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
@ -31,18 +30,18 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/fluencelabs/fluence-admin#readme",
|
"homepage": "https://github.com/fluencelabs/fluence-admin#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/js-client.api": "0.11.3",
|
"@fluencelabs/fluence-network-environment": "1.1.2",
|
||||||
"@fluencelabs/fluence-network-environment": "1.0.14",
|
"@fluencelabs/js-client.api": "0.11.6",
|
||||||
"css-spinners": "^1.0.1",
|
"css-spinners": "^1.0.1",
|
||||||
|
"multiaddr": "^10.0.1",
|
||||||
"tachyons": "^4.12.0",
|
"tachyons": "^4.12.0",
|
||||||
"yup": "^0.32.9"
|
"yup": "^0.32.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.11.6",
|
"@babel/core": "^7.11.6",
|
||||||
"@babel/preset-env": "^7.11.5",
|
"@babel/preset-env": "^7.11.5",
|
||||||
"@fluencelabs/cli": "0.2.41",
|
"@fluencelabs/aqua-api": "^0.11.7",
|
||||||
"@fluencelabs/aqua-lib": "0.3.3",
|
"@fluencelabs/aqua-lib": "^0.6.0",
|
||||||
"@types/yup": "^0.29.11",
|
|
||||||
"babel-loader": "^8.1.0",
|
"babel-loader": "^8.1.0",
|
||||||
"chokidar-cli": "^2.1.0",
|
"chokidar-cli": "^2.1.0",
|
||||||
"clean-webpack-plugin": "^3.0.0",
|
"clean-webpack-plugin": "^3.0.0",
|
||||||
@ -60,9 +59,9 @@
|
|||||||
"google-closure-compiler": "^20200920.0.0",
|
"google-closure-compiler": "^20200920.0.0",
|
||||||
"html-webpack-plugin": "^4.5.0",
|
"html-webpack-plugin": "^4.5.0",
|
||||||
"mini-css-extract-plugin": "^0.11.2",
|
"mini-css-extract-plugin": "^0.11.2",
|
||||||
"sass": "1.58.3",
|
|
||||||
"optimize-css-assets-webpack-plugin": "^5.0.4",
|
"optimize-css-assets-webpack-plugin": "^5.0.4",
|
||||||
"resolve-url-loader": "^3.1.1",
|
"resolve-url-loader": "^3.1.1",
|
||||||
|
"sass": "1.58.3",
|
||||||
"sass-loader": "^10.0.2",
|
"sass-loader": "^10.0.2",
|
||||||
"source-map-loader": "^1.0.0",
|
"source-map-loader": "^1.0.0",
|
||||||
"style-loader": "^1.2.1",
|
"style-loader": "^1.2.1",
|
||||||
|
11
src/index.js
11
src/index.js
@ -20,16 +20,16 @@ import './main.css';
|
|||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
import log from 'loglevel';
|
import log from 'loglevel';
|
||||||
import Multiaddr from 'multiaddr';
|
import Multiaddr from 'multiaddr';
|
||||||
import { stage, kras, testNet } from '@fluencelabs/fluence-network-environment';
|
import { kras } from '@fluencelabs/fluence-network-environment';
|
||||||
import { Fluence } from '@fluencelabs/js-client.api';
|
import { Fluence } from '@fluencelabs/js-client.api';
|
||||||
import { Elm } from './Main.elm';
|
import { Elm } from './Main.elm';
|
||||||
import * as serviceWorker from './serviceWorker';
|
import * as serviceWorker from './serviceWorker';
|
||||||
import { interfaceInfo, peerInfo } from './types';
|
import { interfaceInfo, peerInfo } from './types';
|
||||||
import { askAllAndSend, getAll } from './_aqua/app';
|
import { askAllAndSend, getAll } from './_aqua/app';
|
||||||
|
|
||||||
const defaultNetworkName = 'testNet + kras';
|
const defaultNetworkName = 'kras';
|
||||||
|
|
||||||
const relays = [...kras, ...stage];
|
const relays = [...kras];
|
||||||
|
|
||||||
const defaultEnv = {
|
const defaultEnv = {
|
||||||
relays,
|
relays,
|
||||||
@ -65,7 +65,7 @@ async function initEnvironment() {
|
|||||||
try {
|
try {
|
||||||
const script = document.getElementById('env');
|
const script = document.getElementById('env');
|
||||||
if (!script) {
|
if (!script) {
|
||||||
console.log("Couldn't load environment, falling back to default (${defaultNetworkName})");
|
console.log(`Couldn't load environment, falling back to default (${defaultNetworkName})`);
|
||||||
return defaultEnv;
|
return defaultEnv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,8 +226,7 @@ function genFlags(peerId, relays, relayIdx) {
|
|||||||
window.collectedData.serviceBlueprints.add(service.blueprint_id);
|
window.collectedData.serviceBlueprints.add(service.blueprint_id);
|
||||||
|
|
||||||
let blueprint = window.collectedData.blueprints.get(service.blueprint_id);
|
let blueprint = window.collectedData.blueprints.get(service.blueprint_id);
|
||||||
for (let prefixedHash of blueprint.dependencies) {
|
for (let moduleHash of blueprint.dependencies) {
|
||||||
let moduleHash = prefixedHash.split(':')[1];
|
|
||||||
window.collectedData.serviceModules.add(moduleHash);
|
window.collectedData.serviceModules.add(moduleHash);
|
||||||
|
|
||||||
let module = window.collectedData.modules.get(moduleHash);
|
let module = window.collectedData.modules.get(moduleHash);
|
||||||
|
Loading…
Reference in New Issue
Block a user