Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple stacks per network in Dashboard #3162

Merged
merged 73 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
dd42122
Support es6 build
0oM4R Jul 17, 2024
4d57afa
Refactor: update events make the error optional and support log with …
0oM4R Jul 17, 2024
be6736e
- Refactor
0oM4R Jul 18, 2024
1607559
Feat: Add serviceURLManager
0oM4R Jul 18, 2024
648533c
Revert: playground/config.js
0oM4R Jul 18, 2024
035f4d5
Refactor: remove sesstion from RMBOptions it will be handled internally
0oM4R Jul 18, 2024
aadf52a
Refactor: update service monitor example
0oM4R Jul 18, 2024
1b49c5e
Refactor: Rename service url manager options
0oM4R Jul 18, 2024
eb94229
Refactor: make tfchainMonitor consotractor takes an optional param
0oM4R Jul 18, 2024
c81f714
Example: add serviceURlManager Example
0oM4R Jul 18, 2024
25b29c4
Fix: remove error on getting Url before intialization and make it ret…
0oM4R Jul 18, 2024
1dd5d71
Chore: RMB handle error event
0oM4R Jul 18, 2024
aa6b6cf
Example: add template type to support silent
0oM4R Jul 18, 2024
6dde916
Chore:
0oM4R Jul 21, 2024
1542e47
Chore:
0oM4R Jul 21, 2024
ff29b60
chore: export new services
0oM4R Jul 23, 2024
d57c608
Chore: make tfchain url optional
0oM4R Jul 23, 2024
6477140
chore: change stats url to api/summary
0oM4R Jul 23, 2024
9768212
feat: Support array of stacks in build env
0oM4R Jul 24, 2024
add65d2
fix: prevent indexedDB error
0oM4R Jul 24, 2024
8f25d52
fix: change dist path to public
0oM4R Jul 24, 2024
aecfbd9
feat:
0oM4R Jul 24, 2024
ea1aa4d
Style: Add monitor result style
0oM4R Jul 24, 2024
3aae3ff
chore
0oM4R Jul 24, 2024
5359ef2
feat:
0oM4R Jul 24, 2024
0aaa9d2
chore: add checks to prevent accessing undefined functions in RMB con…
0oM4R Jul 24, 2024
2aac3f8
Merge branch 'development_monitoring__stacks' of github.com:threefold…
0oM4R Jul 24, 2024
c637c35
Merge branch 'development' of github.com:threefoldtech/tfgrid-sdk-ts …
0oM4R Jul 28, 2024
76bdbc4
chore: validate rmb connectivity though gridproxy health endpoint
0oM4R Jul 28, 2024
e0c1edb
chore: add error handling to isAlive
0oM4R Jul 28, 2024
f2f4e36
chore: support timeout, and log errors using events
0oM4R Jul 28, 2024
89ef80c
chore: support timeout
0oM4R Jul 28, 2024
6840d69
Merge branch 'development_monitoring__stacks' of github.com:threefold…
0oM4R Jul 28, 2024
edfdf83
chore: support RMB
0oM4R Jul 28, 2024
7276bbd
chore: support RMB
0oM4R Jul 28, 2024
c4cdbb7
refactor: support increasing timeout
0oM4R Jul 28, 2024
de7dde6
fix: return status object instade of throwing error
0oM4R Jul 29, 2024
d120598
refactor:
0oM4R Jul 29, 2024
c167f87
Refactor: use /health endpoint in tfchain monitor
0oM4R Jul 29, 2024
c31bf47
Merge branch 'development_monitoring__stacks_ui' of github.com:threef…
0oM4R Jul 29, 2024
616aad5
Merge branch 'development_monitoring__stacks' of github.com:threefold…
0oM4R Jul 29, 2024
638fcde
refactor: remove logs line
0oM4R Jul 29, 2024
2e74129
feat: isAlive can take new url
0oM4R Jul 30, 2024
5d6b683
Feat: ping url in parallel
0oM4R Jul 30, 2024
889190d
Docs: update example
0oM4R Jul 30, 2024
be4fbb2
Refactor: retry logic moved to all stacks, to avoid delay
0oM4R Jul 31, 2024
fc7754c
Merge branch 'development_monitoring__stacks' of github.com:threefold…
0oM4R Jul 31, 2024
b5827ea
refactor: enahnce logs
0oM4R Jul 31, 2024
43f10de
docs: update urls in example
0oM4R Jul 31, 2024
5150a1c
Merge branches 'development_monitoring__stacks_ui' and 'development_m…
0oM4R Jul 31, 2024
47e0195
Chore: remove disconnect logic
0oM4R Aug 1, 2024
addcd18
chore: Remove IDisconnectHandler interface
0oM4R Aug 1, 2024
18b0a1b
Chore: update monitoring example
0oM4R Aug 1, 2024
9d4f08d
chore: Update the service url on success
0oM4R Aug 1, 2024
0e79191
Merge branch 'development_monitoring__stacks' of github.com:threefold…
0oM4R Aug 1, 2024
ab6a52a
Merge branch 'development' of github.com:threefoldtech/tfgrid-sdk-ts …
0oM4R Aug 1, 2024
d601138
Refactor: remove update function and replace it with setter
0oM4R Aug 8, 2024
acf62e2
reslove some Codacy issues
0oM4R Aug 8, 2024
3a9bec5
Merge branch 'development_monitoring__stacks' of github.com:threefold…
0oM4R Aug 8, 2024
9987ccc
WIP: reslove some Codacy issues
0oM4R Aug 8, 2024
d8218c9
WIP: reslove some Codacy issues
0oM4R Aug 8, 2024
fc3a003
Refactor: add ServiceBase class
0oM4R Aug 8, 2024
5016e50
chore: predefine the timeout error
0oM4R Aug 8, 2024
e75e2b1
Merge branch 'development_monitoring__stacks' of github.com:threefold…
0oM4R Aug 8, 2024
c1239c6
Merge branch 'development_monitoring__stacks' of github.com:threefold…
0oM4R Aug 13, 2024
b0ebc53
Merge branch 'development_monitoring__stacks_ui' of github.com:threef…
0oM4R Aug 13, 2024
19745d9
Merge branch 'development' of github.com:threefoldtech/tfgrid-sdk-ts …
0oM4R Aug 13, 2024
5d82ed9
Chore: add docstring and remove debug lines
0oM4R Aug 13, 2024
fad94be
Chore: fix codacy issue
0oM4R Aug 13, 2024
4e502f4
Chore: fix codacy issue
0oM4R Aug 14, 2024
e9e7414
Merge branch 'development' of github.com:threefoldtech/tfgrid-sdk-ts …
0oM4R Aug 18, 2024
faf59b1
Docs: add stacks support docs
0oM4R Aug 18, 2024
c64d797
chore: remove debug line
0oM4R Aug 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/playground/docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ bash ../scripts/build-env.sh
- SENTRY_DSN
- ENABLE_TELEMETRY

- The use can provide a single URL or multiple URLs separated with a comma, for `GRAPHQL_URL, GRIDPROXY_URL, SUBSTRATE_URL, ACTIVATION_SERVICE_URL, RELAY_DOMAIN, STATS_URL`, If the user provides multiple URLs, it will be considered as a priority list, which means the dashboard will try to connect over the first URL in the list; if it fails, it will move to the next one, and so on.

- The backend payments are done with stellar so you need to decide which network of stellar you want to connect to

```bash
Expand Down
7 changes: 6 additions & 1 deletion packages/playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@
});
</script>
<img class="logo_load" src="/images/logo_text.png" alt="logo" />
<span class="app-loader-msg">Loading dashboard. Please wait...</span>
<span class="app-loader-msg active">Loading dashboard. Please wait...</span>
<span class="app-monitor-msg"></span>
<div class="app-monitor-container">
<ul class="app-monitor-status">
</ul>
</div>
<button class="app-loader-refresh">Refresh</button>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@threefold/graphql_client": "2.5.0",
"@threefold/grid_client": "2.5.0",
"@threefold/gridproxy_client": "2.5.0",
"@threefold/monitoring": "2.5.0",
"@threefold/types": "2.5.0",
"@types/ip": "^1.1.3",
"@types/md5": "^2.3.5",
Expand Down
15 changes: 9 additions & 6 deletions packages/playground/public/config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
window.env = {
NETWORK: "dev",
GRAPHQL_URL: "https://graphql.dev.grid.tf/graphql",
GRIDPROXY_URL: "https://gridproxy.dev.grid.tf",
SUBSTRATE_URL: "wss://tfchain.dev.grid.tf/ws",
ACTIVATION_SERVICE_URL: "https://activation.dev.grid.tf/activation/activate",
RELAY_DOMAIN: "wss://relay.dev.grid.tf",
GRAPHQL_STACKS: ["https://graphql.dev.grid.tf/graphql", "https://graphql.02.dev.grid.tf/graphql"],
GRIDPROXY_STACKS: ["https://gridproxy.dev.grid.tf", "https://gridproxy.02.dev.grid.tf"],
SUBSTRATE_STACKS: ["wss://tfchain.dev.grid.tf/ws", "wss://tfchain.02.dev.grid.tf/ws"],
ACTIVATION_SERVICE_STACKS: [
"https://activation.dev.grid.tf/activation/activate",
"https://activation.02.dev.grid.tf/activation/activate",
],
RELAY_STACKS: ["wss://relay.dev.grid.tf", "wss://relay.02.dev.grid.tf"],
BRIDGE_TFT_ADDRESS: "GDHJP6TF3UXYXTNEZ2P36J5FH7W4BJJQ4AYYAXC66I2Q2AH5B6O6BCFG",
STELLAR_NETWORK: "test",
STELLAR_HORIZON_URL: "https://horizon-testnet.stellar.org",
TFT_ASSET_ISSUER: "GA47YZA3PKFUZMPLQ3B5F2E3CJIB57TGGU7SPCQT2WAEYKN766PWIMB3",
MINTING_URL: "https://alpha.minting.tfchain.grid.tf",
STATS_URL: "https://stats.dev.grid.tf",
STATS_STACKS: ["https://stats.dev.grid.tf", "https://stats.02.dev.grid.tf"],
TIMEOUT: +"10000",
PAGE_SIZE: +"20",
MANUAL_URL: "https://www.manual.grid.tf",
Expand Down
62 changes: 60 additions & 2 deletions packages/playground/public/loader/loader.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,54 @@
margin-top: 30vh;
}

.app-monitor-container {
flex-direction: column;
align-items: center;
margin-top: 20px;
display: none;
border: 1px solid #fff;
border-radius: 5px;
padding: 5px 25px;
}

.app-monitor-container.active {
display: flex;
}

.app-monitor-status {
text-align: left;
color: #fff;
margin: 0;
font-family: sans-serif;
max-width: 500px;
line-height: 1;
}

.service-name {
color: #fff;
width: 100px;
padding: 2px 0;
font-family: sans-serif;
line-height: 1;
font-weight: bold;
text-align: left;
}

.service-status {
display: inline;
font-family: sans-serif;
line-height: 1;
font-weight: bold;
font-size: x-large;
}

.service-reachable {
color: rgb(var(--v-theme-success, "76, 175, 80"));
}

.service-unreachable {
color: rgb(207 102 121);
}
.app-loader-logo {
max-width: 100%;
display: block;
Expand Down Expand Up @@ -86,7 +134,9 @@
}
}

.app-loader-msg {
.app-loader-msg,
.app-monitor-msg {
display: none;
color: #fff;
margin: 0;
margin-top: 20px;
Expand All @@ -96,6 +146,14 @@
text-align: center;
}

.app-monitor-msg {
display: none;
}

.app-loader-msg.active,
.app-monitor-msg.active {
display: block;
}
.app-loader-refresh {
border: none;
outline: none;
Expand Down Expand Up @@ -134,4 +192,4 @@

.app-loader-refresh:focus {
box-shadow: 0 0 0 2px rgba(115, 221, 195, 0.5);
}
}
28 changes: 28 additions & 0 deletions packages/playground/public/loader/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ const msgElement = document.querySelector(".app-loader-msg");
/** @type { HTMLButtonElement} */
const refreshBtn = document.querySelector(".app-loader-refresh");

/** @type { HTMLDivElement } */
const monitor = document.querySelector(".app-monitor-container");

/** @type { HTMLUListElement} */
const monitorList = document.querySelector(".app-monitor-status");

const slowConnectionTime = 60 * 1000;
const noConnectionTime = 120 * 1000;
const appLoaderContainerTime = 0.3 * 1000;
Expand Down Expand Up @@ -58,3 +64,25 @@ window.$$appLoader = () => {
}
}, welcomeMsgTime);
};
window.$$showMonitorError = urls => {
if (msgElement) msgElement.classList.remove("active");

if (monitor) monitor.classList.add("active");

const monitorMsgElement = document.querySelector(".app-monitor-msg");
if (monitorMsgElement) {
monitorMsgElement.classList.add("active");
monitorMsgElement.textContent = "Can't reach some services on provided stacks, Please try again";
}

if (monitorList) {
monitorList.innerHTML = Object.entries(urls).map(createElement).join(" ");
}
refreshBtn && refreshBtn.classList.add("active");
};

function createElement([serviceName, serviceStatus]) {
return `<li><div style="display:flex"><p class="service-name">${serviceName}</p> <p class="service-status service-${
serviceStatus !== null ? "reachable" : "unreachable"
}">${serviceStatus !== null ? "&#10003;" : "&#10007;"}</p></div></li>`;
}
77 changes: 46 additions & 31 deletions packages/playground/scripts/build-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,46 @@ STELLAR_ENV_Vars=(

case $MODE in
"dev")
GRAPHQL_URL="${GRAPHQL_URL:-https://graphql.dev.grid.tf/graphql}"
GRIDPROXY_URL="${GRIDPROXY_URL:-https://gridproxy.dev.grid.tf}"
SUBSTRATE_URL="${SUBSTRATE_URL:-wss://tfchain.dev.grid.tf/ws}"
ACTIVATION_SERVICE_URL="${ACTIVATION_SERVICE_URL:-https://activation.dev.grid.tf/activation/activate}"
RELAY_DOMAIN="${RELAY_DOMAIN:-wss://relay.dev.grid.tf}"
GRAPHQL_URL="${GRAPHQL_URL:-"https://graphql.dev.grid.tf/graphql,https://graphql.02.dev.grid.tf/graphql"}"
GRIDPROXY_URL="${GRIDPROXY_URL:-"https://gridproxy.dev.grid.tf,https://gridproxy.02.dev.grid.tf"}"
SUBSTRATE_URL="${SUBSTRATE_URL:-"wss://tfchain.dev.grid.tf/ws,wss://tfchain.02.dev.grid.tf/ws"}"
ACTIVATION_SERVICE_URL="${ACTIVATION_SERVICE_URL:-"https://activation.dev.grid.tf/activation/activate,https://activation.02.dev.grid.tf/activation/activate"}"
RELAY_DOMAIN="${RELAY_DOMAIN:-"wss://relay.dev.grid.tf,wss://relay.02.dev.grid.tf"}"
BRIDGE_TFT_ADDRESS="${BRIDGE_TFT_ADDRESS:-GDHJP6TF3UXYXTNEZ2P36J5FH7W4BJJQ4AYYAXC66I2Q2AH5B6O6BCFG}"
STATS_URL="${STATS_URL:-https://stats.dev.grid.tf}"
STATS_URL="${STATS_URL:-"https://stats.dev.grid.tf,https://stats.02.dev.grid.tf"}"
STELLAR_NETWORK="${STELLAR_NETWORK:-test}"
SENTRY_DSN="https://[email protected]/2"
;;
"qa")
GRAPHQL_URL="${GRAPHQL_URL:-https://graphql.qa.grid.tf/graphql}"
GRIDPROXY_URL="${GRIDPROXY_URL:-https://gridproxy.qa.grid.tf}"
SUBSTRATE_URL="${SUBSTRATE_URL:-wss://tfchain.qa.grid.tf/ws}"
ACTIVATION_SERVICE_URL="${ACTIVATION_SERVICE_URL:-https://activation.qa.grid.tf/activation/activate}"
RELAY_DOMAIN="${RELAY_DOMAIN:-wss://relay.qa.grid.tf}"
GRAPHQL_URL="${GRAPHQL_URL:-"https://graphql.qa.grid.tf/graphql,https://graphql.02.qa.grid.tf/graphql"}"
GRIDPROXY_URL="${GRIDPROXY_URL:-"https://gridproxy.qa.grid.tf,https://gridproxy.02.qa.grid.tf"}"
SUBSTRATE_URL="${SUBSTRATE_URL:-"wss://tfchain.qa.grid.tf/ws,wss://tfchain.02.qa.grid.tf/ws"}"
ACTIVATION_SERVICE_URL="${ACTIVATION_SERVICE_URL:-"https://activation.qa.grid.tf/activation/activate,https://activation.02.qa.grid.tf/activation/activate"}"
RELAY_DOMAIN="${RELAY_DOMAIN:-"wss://relay.qa.grid.tf,wss://relay.02.qa.grid.tf"}"
BRIDGE_TFT_ADDRESS="${BRIDGE_TFT_ADDRESS:-GAQH7XXFBRWXT2SBK6AHPOLXDCLXVFAKFSOJIRMRNCDINWKHGI6UYVKM}"
STATS_URL="${STATS_URL:-https://stats.qa.grid.tf}"
STATS_URL="${STATS_URL:-"https://stats.qa.grid.tf,https://stats.02.qa.grid.tf"}"
STELLAR_NETWORK="${STELLAR_NETWORK:-test}"
SENTRY_DSN="https://[email protected]/2"
;;
"test")
GRAPHQL_URL="${GRAPHQL_URL:-https://graphql.test.grid.tf/graphql}"
GRIDPROXY_URL="${GRIDPROXY_URL:-https://gridproxy.test.grid.tf}"
SUBSTRATE_URL="${SUBSTRATE_URL:-wss://tfchain.test.grid.tf/ws}"
ACTIVATION_SERVICE_URL="${ACTIVATION_SERVICE_URL:-https://activation.test.grid.tf/activation/activate}"
RELAY_DOMAIN="${RELAY_DOMAIN:-wss://relay.test.grid.tf}"
GRAPHQL_URL="${GRAPHQL_URL:-"https://graphql.test.grid.tf/graphql,https://graphql.02.test.grid.tf/graphql"}"
GRIDPROXY_URL="${GRIDPROXY_URL:-"https://gridproxy.test.grid.tf,https://gridproxy.02.test.grid.tf"}"
SUBSTRATE_URL="${SUBSTRATE_URL:-"wss://tfchain.test.grid.tf/ws,wss://tfchain.02.test.grid.tf/ws"}"
ACTIVATION_SERVICE_URL="${ACTIVATION_SERVICE_URL:-"https://activation.test.grid.tf/activation/activate,https://activation.02.test.grid.tf/activation/activate"}"
RELAY_DOMAIN="${RELAY_DOMAIN:-"wss://relay.test.grid.tf,wss://relay.02.test.grid.tf"}"
BRIDGE_TFT_ADDRESS="${BRIDGE_TFT_ADDRESS:-GA2CWNBUHX7NZ3B5GR4I23FMU7VY5RPA77IUJTIXTTTGKYSKDSV6LUA4}"
STATS_URL="${STATS_URL:-https://stats.test.grid.tf}"
STATS_URL="${STATS_URL:-"https://stats.test.grid.tf,https://stats.02.test.grid.tf"}"
STELLAR_NETWORK="${STELLAR_NETWORK:-main}"
SENTRY_DSN="https://[email protected]/2"
;;
"main")
GRAPHQL_URL="${GRAPHQL_URL:-https://graphql.grid.tf/graphql}"
GRIDPROXY_URL="${GRIDPROXY_URL:-https://gridproxy.grid.tf}"
SUBSTRATE_URL="${SUBSTRATE_URL:-wss://tfchain.grid.tf/ws}"
ACTIVATION_SERVICE_URL="${ACTIVATION_SERVICE_URL:-https://activation.grid.tf/activation/activate}"
RELAY_DOMAIN="${RELAY_DOMAIN:-wss://relay.grid.tf}"
GRAPHQL_URL="${GRAPHQL_URL:-"https://graphql.grid.tf/graphql,https://graphql.02.grid.tf/graphql"}"
GRIDPROXY_URL="${GRIDPROXY_URL:-"https://gridproxy.grid.tf,https://gridproxy.02.grid.tf"}"
SUBSTRATE_URL="${SUBSTRATE_URL:-"wss://tfchain.grid.tf/ws,wss://tfchain.02.grid.tf/ws"}"
ACTIVATION_SERVICE_URL="${ACTIVATION_SERVICE_URL:-"https://activation.grid.tf/activation/activate,https://activation.02.grid.tf/activation/activate"}"
RELAY_DOMAIN="${RELAY_DOMAIN:-"wss://relay.grid.tf,wss://relay.02.grid.tf"}"
BRIDGE_TFT_ADDRESS="${BRIDGE_TFT_ADDRESS:-GBNOTAYUMXVO5QDYWYO2SOCOYIJ3XFIP65GKOQN7H65ZZSO6BK4SLWSC}"
STATS_URL="${STATS_URL:-https://stats.grid.tf}"
STATS_URL="${STATS_URL:-"https://stats.grid.tf,https://stats.02.grid.tf"}"
STELLAR_NETWORK="${STELLAR_NETWORK:-main}"
SENTRY_DSN="https://[email protected]/2"
;;
Expand All @@ -81,20 +81,35 @@ case $STELLAR_NETWORK in
;;
esac

parss_array(){
local service_urls=$1
toString=($(echo "$service_urls" | tr ',' "\n"))
for item in "${toString[@]}"; do
quoted_string+="'$item' "
done

# add single quate to each elament
quoted_string=${quoted_string// /,}

# remove trailing comma
echo "${quoted_string%?}"

}

configs="
window.env = {
NETWORK: '$MODE',
GRAPHQL_URL: '$GRAPHQL_URL',
GRIDPROXY_URL: '$GRIDPROXY_URL',
SUBSTRATE_URL: '$SUBSTRATE_URL',
ACTIVATION_SERVICE_URL: '$ACTIVATION_SERVICE_URL',
RELAY_DOMAIN: '$RELAY_DOMAIN',
GRAPHQL_STACKS: "[$(parss_array "$GRAPHQL_URL")]",
GRIDPROXY_STACKS: "[$(parss_array "$GRIDPROXY_URL")]",
SUBSTRATE_STACKS: "[$(parss_array "$SUBSTRATE_URL")]",
ACTIVATION_SERVICE_STACKS: "[$(parss_array "$ACTIVATION_SERVICE_URL")]",
RELAY_STACKS: "[$(parss_array "$RELAY_DOMAIN")]",
BRIDGE_TFT_ADDRESS: '$BRIDGE_TFT_ADDRESS',
STELLAR_NETWORK: '$STELLAR_NETWORK',
STELLAR_HORIZON_URL: '$STELLAR_HORIZON_URL',
TFT_ASSET_ISSUER: '$TFT_ASSET_ISSUER',
MINTING_URL: '$MINTING_URL',
STATS_URL: '$STATS_URL',
STATS_STACKS: "[$(parss_array "$STATS_URL")]",
TIMEOUT: +'$TIMEOUT',
PAGE_SIZE: +'$PAGE_SIZE',
MANUAL_URL: '$MANUAL_URL',
Expand All @@ -104,7 +119,7 @@ window.env = {
"

# decide the config file path
[ -d dist ] && file="dist/config.js" || file="config.js"
[ -d public ] && file="public/config.js" || file="config.js"

# override the content of the config file & echo the result
echo $configs > $file
Expand Down
26 changes: 26 additions & 0 deletions packages/playground/src/Monitor.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<template v-if="!loadingApp">
<App />
</template>
</template>

<script lang="ts">
import { defineAsyncComponent, onMounted, ref } from "vue";

import { setGlobalEnv } from "./config";
export default {
name: "AppMonitor",
components: {
App: defineAsyncComponent(() => import("./App.vue")),
},
setup() {
const loadingApp = ref(true);
onMounted(async () => {
if (await setGlobalEnv()) {
loadingApp.value = false;
}
});
return { loadingApp };
},
};
</script>
1 change: 0 additions & 1 deletion packages/playground/src/clients/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import TFGridGqlClient from "@threefold/graphql_client";
import GridProxyClient from "@threefold/gridproxy_client";
import { QueryClient } from "@threefold/tfchain_client";

const gqlClient = new TFGridGqlClient(window.env.GRAPHQL_URL);
const gridProxyClient = new GridProxyClient(window.env.GRIDPROXY_URL);
const queryClient = new QueryClient(window.env.SUBSTRATE_URL);
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/src/components/logger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export default {
let _interceptorQueue: LI[] = [];

async function interceptMessage(instance: LI) {
if (connectDB.value.error) {
if (connectDB.value.error ) {
_interceptorQueue.push(instance);
return;
}
Expand Down
Loading
Loading