-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple stacks per network in Dashboard (#3162)
* feat: Support array of stacks in build env * fix: change dist path to public in build env script * feat: - add Monitor elements in html - define services classes and showMonitorErrors - implement showMonitorErrors that change loader dom to show monitor results * chore: support defineAsyncComponent and use it for some components add setGlobalEnv that check all services stacks and set the available url in env * Docs: add stacks support docs
- Loading branch information
Showing
13 changed files
with
242 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
;; | ||
|
@@ -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', | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.