-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #765 from telosnetwork/develop
v1.2.6-rc
- Loading branch information
Showing
50 changed files
with
828 additions
and
433 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "open-block-explorer", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"description": "..", | ||
"productName": "Telos Block Explorer", | ||
"author": "DonaldPeat <[email protected]>", | ||
|
@@ -9,8 +9,8 @@ | |
"dev": "quasar dev", | ||
"build": "quasar clean && quasar build", | ||
"lint": "eslint --ext .js,.ts,.vue ./", | ||
"test": "jest --coverage", | ||
"test:coverage": "quasar serve test/jest/coverage/lcov-report/ --port 8788" | ||
"test": "jest", | ||
"test:coverage": "jest --coverage" | ||
}, | ||
"dependencies": { | ||
"@greymass/eosio": "^0.6.8", | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,150 @@ | ||
<script lang="ts"> | ||
import { computed, defineComponent } from 'vue'; | ||
import ConfigManager from 'src/config/ConfigManager'; | ||
import { Chain } from 'src/types/Chain'; | ||
import { useRoute, useRouter } from 'vue-router'; | ||
const configMgr = ConfigManager.get(); | ||
export default defineComponent({ | ||
name: 'ChainsSelector', | ||
props: { | ||
onChainSelected: { | ||
type: Function, | ||
required: false, | ||
}, | ||
isChainSelected: { | ||
type: Function, | ||
required: false, | ||
default: () => false, | ||
}, | ||
}, | ||
setup(props) { | ||
const route = useRoute(); | ||
const router = useRouter(); | ||
const mainnets = computed(() => sortChainsUsingName(configMgr.getMainnets())); | ||
const testnets = computed(() => sortChainsUsingName(configMgr.getTestnets())); | ||
function sortChainsUsingName(chains: Chain[]): Chain[] { | ||
return chains.sort( | ||
(chain1, chain2) => chain1.getName().localeCompare(chain2.getName()), | ||
); | ||
} | ||
function chainSelected(chain: Chain) { | ||
if (props.isChainSelected(chain)) { | ||
return; | ||
} | ||
void router.push({ | ||
path: route.path, | ||
query: { network: chain.getName() }, | ||
}); | ||
props.onChainSelected(chain); | ||
} | ||
return { | ||
mainnets, | ||
testnets, | ||
chainSelected, | ||
}; | ||
}, | ||
}); | ||
</script> | ||
|
||
<template> | ||
<q-list> | ||
<div v-if="mainnets.length > 0" class="section-title">MAINNETS</div> | ||
<q-item | ||
v-for="(chain, index) in mainnets" | ||
:key="`mainnet-${index}`" | ||
v-ripple | ||
:class="{ selected: isChainSelected(chain) }" | ||
clickable | ||
@click="chainSelected(chain)" | ||
><img class="sidebar-logo" :src="chain.getSmallLogoPath()"> | ||
<q-item-section> | ||
<div class="q-pl-md">{{ chain.getDisplay() }}</div> | ||
</q-item-section> | ||
</q-item> | ||
<q-separator v-if="testnets.length > 0 && mainnets.length > 0" class="separator"/> | ||
<div v-if="testnets.length > 0" class="section-title">TESTNETS</div> | ||
<q-item | ||
v-for="(chain, index) in testnets" | ||
:key="`testnet-${index}`" | ||
v-ripple | ||
:class="{ selected: isChainSelected(chain) }" | ||
clickable | ||
@click="chainSelected(chain)" | ||
> | ||
<div class="testnet-logo-container"> | ||
<img class="sidebar-logo sidebar-logo--testnet" :src="chain.getSmallLogoPath()"> | ||
<div class="testnet-text">TESTNET</div> | ||
</div> | ||
<q-item-section> | ||
<div class="q-pl-md">{{ chain.getDisplay() }}</div> | ||
</q-item-section> | ||
</q-item> | ||
</q-list> | ||
</template> | ||
|
||
<style lang="sass" scoped> | ||
.chain-button | ||
padding: 0px 4px | ||
.q-item | ||
&:hover, &.selected | ||
background-color: var(--q-color-sidebar-selected) | ||
padding-left: 16px | ||
padding-top: 8px | ||
width: auto | ||
.q-list | ||
padding-bottom: 8px | ||
padding-top: 8px | ||
.separator | ||
margin-top: .5rem | ||
margin-bottom: .5rem | ||
min-height: 1px | ||
min-width: 0 | ||
width: 100% | ||
background: var(--q-color-sidebar-selected) | ||
.sidebar-logo | ||
height: auto | ||
width: auto | ||
max-height: 32px | ||
max-width: 32px | ||
object-fit: contain | ||
.section-title | ||
padding-left: 16px | ||
padding-top: 8px | ||
padding-bottom: 8px | ||
font-size: 10px | ||
.testnet-logo-container | ||
position: relative | ||
height: 32px | ||
width: 32px | ||
.testnet-text, .sidebar-logo--testnet | ||
position: absolute | ||
margin: auto | ||
top: 0 | ||
right: 0 | ||
bottom: 0 | ||
left: 0 | ||
.testnet-text | ||
color: white | ||
font-size: 6px | ||
width: min-content | ||
height: min-content | ||
padding: 0 2px | ||
border-radius: 2px | ||
background-color: rgba(black, 0.6) | ||
</style> |
Oops, something went wrong.