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:
Anatolios Laskaris 2023-08-14 14:36:03 +03:00 committed by GitHub
parent ab6485cbdf
commit 204f7f3be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 294 additions and 35576 deletions

2
.gitignore vendored
View File

@ -7,4 +7,4 @@ bundle
.storybook/explorer.js
src/_aqua
src/_aqua

46
compile-aqua.mjs Normal file
View 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' });

View File

@ -1,35 +1,40 @@
<!DOCTYPE html>
<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>
<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">
<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">
<!--
<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
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'
async></script>
<title>Fluence Network Dashboard</title>
</head>
<script
src="https://cdn.jsdelivr.net/npm/@fluencelabs/js-client.web.standalone@0.13.7/dist/js-client.min.js"
async
></script>
<title>Fluence Network Dashboard</title>
</head>
<body>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6ZTQKE1D4L"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-6ZTQKE1D4L');
</script>
<script id="env" type="application/json" src="/env/env.json"></script>
<div id="root"></div>
</body>
</html>
<body>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-6ZTQKE1D4L"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'G-6ZTQKE1D4L');
</script>
<script id="env" type="application/json" src="/env/env.json"></script>
<div id="root"></div>
</body>
</html>

35735
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,8 +10,7 @@
"build": "npm run compile-aqua && webpack",
"prod": "npm run compile-aqua && webpack -p --mode production",
"analyse": "elm-analyse -s -p 3001 -o",
"compile-aqua": "fluence aqua --js -i ./aqua/ -o ./src/_aqua",
"watch-aqua": "fluence aqua --js -w -i ./aqua/ -o ./src/_aqua",
"compile-aqua": "node ./compile-aqua.mjs",
"uie": "elm-live src_storybook/Explorer.elm --open --dir=.storybook --start-page=index.html -- --output=.storybook/explorer.js --debug"
},
"nodemonConfig": {
@ -31,18 +30,18 @@
},
"homepage": "https://github.com/fluencelabs/fluence-admin#readme",
"dependencies": {
"@fluencelabs/js-client.api": "0.11.3",
"@fluencelabs/fluence-network-environment": "1.0.14",
"@fluencelabs/fluence-network-environment": "1.1.2",
"@fluencelabs/js-client.api": "0.11.6",
"css-spinners": "^1.0.1",
"multiaddr": "^10.0.1",
"tachyons": "^4.12.0",
"yup": "^0.32.9"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@fluencelabs/cli": "0.2.41",
"@fluencelabs/aqua-lib": "0.3.3",
"@types/yup": "^0.29.11",
"@fluencelabs/aqua-api": "^0.11.7",
"@fluencelabs/aqua-lib": "^0.6.0",
"babel-loader": "^8.1.0",
"chokidar-cli": "^2.1.0",
"clean-webpack-plugin": "^3.0.0",
@ -60,9 +59,9 @@
"google-closure-compiler": "^20200920.0.0",
"html-webpack-plugin": "^4.5.0",
"mini-css-extract-plugin": "^0.11.2",
"sass": "1.58.3",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"resolve-url-loader": "^3.1.1",
"sass": "1.58.3",
"sass-loader": "^10.0.2",
"source-map-loader": "^1.0.0",
"style-loader": "^1.2.1",

View File

@ -20,16 +20,16 @@ import './main.css';
// eslint-disable-next-line import/no-extraneous-dependencies
import log from 'loglevel';
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 { Elm } from './Main.elm';
import * as serviceWorker from './serviceWorker';
import { interfaceInfo, peerInfo } from './types';
import { askAllAndSend, getAll } from './_aqua/app';
const defaultNetworkName = 'testNet + kras';
const defaultNetworkName = 'kras';
const relays = [...kras, ...stage];
const relays = [...kras];
const defaultEnv = {
relays,
@ -65,7 +65,7 @@ async function initEnvironment() {
try {
const script = document.getElementById('env');
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;
}
@ -226,8 +226,7 @@ function genFlags(peerId, relays, relayIdx) {
window.collectedData.serviceBlueprints.add(service.blueprint_id);
let blueprint = window.collectedData.blueprints.get(service.blueprint_id);
for (let prefixedHash of blueprint.dependencies) {
let moduleHash = prefixedHash.split(':')[1];
for (let moduleHash of blueprint.dependencies) {
window.collectedData.serviceModules.add(moduleHash);
let module = window.collectedData.modules.get(moduleHash);