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

v1.2.3-rc #713

Merged
merged 22 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
89c76f4
fix: remove rex profits from balance breakdown
donnyquixotic Apr 11, 2023
e71243b
Merge pull request #688 from telosnetwork/bugfix/rex-profits
karynemayer Apr 17, 2023
fa62460
Updating EOS theme
jaegerfe May 10, 2023
5f2f135
Updating EOS logos
jaegerfe May 10, 2023
2687c1c
Updating default theme
jaegerfe May 11, 2023
a8d6eb6
Merge branch 'master' of https://github.com/telosnetwork/open-block-e…
donnyquixotic May 14, 2023
63dfeda
Updating font on Vote for blocks
jaegerfe May 23, 2023
ce92505
Updating Jugnle theme
jaegerfe May 30, 2023
d607fe2
Adding permission waits
Viterbo Jun 8, 2023
498e2f9
Includes action name when sending actions
karynemayer May 31, 2023
889403e
chore: bumpversion
donnyquixotic Jun 9, 2023
9a1715e
removing v-html
Viterbo Jun 13, 2023
d665444
Updating icons and fixing icons resizing
jaegerfe Jun 13, 2023
68710a0
Merge pull request #712 from telosnetwork/703-keys-tab-not-displaying…
ezra-sg Jun 15, 2023
37b3dcd
Large logos maintaining their proportions
karynemayer Jun 15, 2023
58421e7
Merge pull request #698 from telosnetwork/theme_updates
karynemayer Jun 15, 2023
ec5f38b
Refactoring multichain sidemenu to a selector component
jaegerfe May 4, 2023
f0445a0
Removing extra margin
jaegerfe May 4, 2023
4760be6
Fixing layout issues
jaegerfe May 4, 2023
5fa14cf
Fixing auth issues when multichain is enabled
jaegerfe May 25, 2023
2665ba9
Fixing tests.
jaegerfe May 31, 2023
0b1dd5c
Merge pull request #692 from telosnetwork/new_multichain_selector
karynemayer Jun 15, 2023
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
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ APP_NAME=OBE
# default network
CHAIN_NAME=telos-testnet

# enable sidebar to switch chains
#SHOW_SIDEBAR=true
# enable selector on header to switch chains
#SHOW_MULTICHAIN_SELECTOR=true

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "open-block-explorer",
"version": "1.2.2",
"version": "1.2.3",
"description": "..",
"productName": "Telos Block Explorer",
"author": "DonaldPeat <don@caleos.io>",
Expand Down
Binary file modified public/chains/eos/eos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/chains/eos/eos_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/chains/eos/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/chains/jungle/eos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/chains/jungle/eos_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/chains/jungle/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/chains/ux/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/chains/ux/logo_lg.png
Binary file not shown.
Binary file removed public/chains/ux/logo_sm.jpeg
Binary file not shown.
Binary file added public/chains/ux/logo_sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 0 additions & 26 deletions public/chains/ux/logo_sm.svg

This file was deleted.

8 changes: 5 additions & 3 deletions src/boot/ual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,14 @@ function getMainChain() {
const authenticators: Authenticator[] = [];

export const getAuthenticators = () => {
// we initialize the authenticators inside this function on demand
if (authenticators.length === 0) {
// we initialize the authenticators inside this function on demand
// UAL is not looking at the chain when checking the localstorage for an already logged in account
// A quick fix is to add the chain in appName until we move forward with WharfKit
const mainChain = getMainChain();
authenticators.push(new Anchor([mainChain], { appName: process.env.APP_NAME })),
authenticators.push(new Anchor([mainChain], { appName: `${process.env.APP_NAME}_${mainChain.chainId}` })),
authenticators.push(new CleosAuthenticator([mainChain], {
appName: process.env.APP_NAME,
appName: `${process.env.APP_NAME}_${mainChain.chainId}`,
loginHandler,
signHandler: signHandlerForMainChain,
}));
Expand Down
23 changes: 4 additions & 19 deletions src/components/AccountCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ export default defineComponent({
};

const loadBalances = async () => {
const { staked, profits } = await getRexBalance();
const total = await getRexBalance();
rexDeposits.value = await getRexFund();
rexStaked.value = staked;
rexProfits.value = profits;
rexStaked.value = total;
};

const loadResources = () => {
Expand Down Expand Up @@ -254,14 +253,11 @@ export default defineComponent({

const rexBal = ((await api.getTableRows(paramsrexbal)) as RexbalRows)
.rows[0];

const totalRexBalance =
rexBal?.rex_balance
? Number(rexBal.rex_balance.split(' ')[0])
: 0;
const staked =
rexBal?.vote_stake
? Number(rexBal.vote_stake.split(' ')[0])
: 0;

const paramsrexpool = {
code: 'eosio',
Expand All @@ -279,12 +275,7 @@ export default defineComponent({
const tlosRexRatio = totalRex > 0 ? totalLendable / totalRex : 1;

const total = totalRex > 0 ? tlosRexRatio * totalRexBalance : 0.0;
const profits = total - staked;
return {
total,
profits,
staked,
};
return total;
};

const fixDec = (val: number): number => parseFloat(val.toFixed(3));
Expand Down Expand Up @@ -349,7 +340,6 @@ export default defineComponent({
totalTokens.value = '--';
stakedResources.value = delegatedByOthers.value = 0;
rexStaked.value = 0;
rexProfits.value = 0;
rexDeposits.value = 0;
};

Expand Down Expand Up @@ -395,7 +385,6 @@ export default defineComponent({
totalValueString,
rex,
rexStaked,
rexProfits,
rexDeposits,
none,
system_account,
Expand Down Expand Up @@ -560,10 +549,6 @@ export default defineComponent({
<td class="text-left">REX staked (includes savings)</td>
<td class="text-right">{{ formatAsset(rexStaked) }}</td>
</tr>
<tr>
<td class="text-left">REX profits</td>
<td class="text-right">{{ formatAsset(rexProfits) }}</td>
</tr>
<tr>
<td class="text-left">REX liquid deposits</td>
<td class="text-right">{{ formatAsset(rexDeposits) }}</td>
Expand Down
113 changes: 72 additions & 41 deletions src/components/ChainsSidebar.vue → src/components/ChainsMenu.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<script lang="ts">
import { computed, ref, onMounted } from 'vue';
import { computed, defineComponent, onMounted, ref } from 'vue';
import ConfigManager from 'src/config/ConfigManager';
import { Chain } from 'src/types/Chain';
import { useStore } from 'src/store';
import { getAuthenticators } from 'src/boot/ual';

const configMgr = ConfigManager.get();

export default {
name: 'ChainsSidebar',
export default defineComponent({
name: 'ChainsMenu',
setup() {
const menuOpened = ref(false);
const store = useStore();
const account = computed(() => store.state.account);

const menuIcon = computed(() => menuOpened.value ? 'expand_less' : 'expand_more');
const mainnets = computed(() => sortChainsUsingName(configMgr.getMainnets()));
const testnets = computed(() => sortChainsUsingName(configMgr.getTestnets()));

Expand All @@ -21,6 +28,19 @@ export default {
return localStorage.getItem(ConfigManager.CHAIN_LOCAL_STORAGE) === chain.getName();
}

const logout = async (): Promise<void> => {
const wallet = localStorage.getItem('autoLogin');
const authenticator = getAuthenticators().find(
auth => auth.getName() === wallet,
);
try {
authenticator && (await authenticator.logout());
} catch (error) {
console.error('Authenticator logout error', error);
}
void store.dispatch('account/logout');
};

function chainSelected(chain: Chain) {
if (isSelected(chain)) {
return;
Expand All @@ -30,6 +50,11 @@ export default {
ConfigManager.CHAIN_LOCAL_STORAGE,
chain.getName(),
);

if (account.value) {
void logout();
}

location.reload();
}

Expand All @@ -43,30 +68,23 @@ export default {
});

return {
miniState: ref(true),
menuOpened,
menuIcon,
mainnets,
testnets,
chainSelected,
isSelected,
};
},
};
});
</script>

<template>

<q-drawer
show-if-above
:mini="miniState"
mini-to-overlay
:width="175"
:breakpoint="500"
bordered
@mouseover="miniState = false"
@mouseout="miniState = true"
>
<q-scroll-area class="fit">
<q-btn v-if="testnets.length > 0 || mainnets.length > 0" flat class="chain-button">
<q-icon :name="menuIcon" size="md" />
<q-menu v-model="menuOpened">
<q-list>
<div v-if="mainnets.length > 0" class="section-title">MAINNETS</div>
<q-item
v-for="(chain, index) in mainnets"
:key="`mainnet-${index}`"
Expand All @@ -79,7 +97,8 @@ export default {
<div class="q-pl-md">{{ chain.getDisplay() }}</div>
</q-item-section>
</q-item>
<q-separator class="separator"/>
<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}`"
Expand All @@ -90,45 +109,57 @@ export default {
>
<div class="testnet-logo-container">
<img class="sidebar-logo sidebar-logo--testnet" :src="chain.getSmallLogoPath()">
<div class="testnet-text">Testnet</div>
<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>
</q-scroll-area>
</q-drawer>

</q-menu>
</q-btn>
</template>

<style lang="sass" scoped>
.chain-button
padding: 0px 4px

.q-item
&:hover, &.selected
background-color: var(--q-color-sidebar-selected)
padding-left: 4px
padding-top: 4px
&:hover, &.selected
background-color: var(--q-color-sidebar-selected)
padding-left: 16px
padding-top: 8px
width: 170px

.q-list
padding-bottom: 8px
padding-top: 8px

.separator
margin-top: .5rem
margin-bottom: .5rem
margin-left: 5px
min-height: 5px
min-width: 0
width: calc(100% - 10px)
background: var(--q-color-sidebar-selected)
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: 48px
max-width: 48px
object-fit: contain
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: 48px
width: 48px
height: 32px
width: 32px

.testnet-text, .sidebar-logo--testnet
position: absolute
Expand All @@ -140,7 +171,7 @@ export default {

.testnet-text
color: white
font-size: 12px
font-size: 6px
width: min-content
height: min-content
padding: 0 2px
Expand Down
Loading