Skip to content

Commit

Permalink
Merge pull request #823 from telosnetwork/hotfix/system-account-page
Browse files Browse the repository at this point in the history
remove hardcoded search result
  • Loading branch information
donnyquixotic authored Dec 14, 2023
2 parents 7a0b02c + 020a0c4 commit 02970ee
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
8 changes: 3 additions & 5 deletions src/components/AccountCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export default defineComponent({
const createTransaction = ref<string>('');
const creatingAccount = ref('');
const system_account = ref('eosio');
const system_null = ref('eosio.null');
const isLoading = ref<boolean>(true);
const tokensLoading = ref<boolean>(true);
Expand Down Expand Up @@ -178,7 +177,7 @@ export default defineComponent({
const loadResources = () => {
let ramDenominator;
if (props.account !== system_account.value && props.account !== system_null.value) {
if (props.account !== system_account.value) {
// display max resource unit value for readability
const ramMaxNumber = Number(accountData.value.ram_quota);
const ramUnitResult = determineUnit(ramMaxNumber);
Expand Down Expand Up @@ -327,7 +326,7 @@ export default defineComponent({
return total;
};
const fixDec = (val: number): number => parseFloat(val.toFixed(3));
const fixDec = (val: number): number => Math.abs(parseFloat(val.toFixed(3)));
const loadSystemToken = (): void => {
if (token.value.symbol === '') {
Expand Down Expand Up @@ -445,7 +444,6 @@ export default defineComponent({
rexDeposits,
none,
system_account,
system_null,
radius,
availableTokens,
createTime,
Expand Down Expand Up @@ -519,7 +517,7 @@ export default defineComponent({
</div>
<q-space/>
</div>
<div v-if="account !== system_account && account !== system_null" class="resources">
<div v-if="account !== system_account" class="resources">
<PercentCircle
v-if="!accountPageSettings.hideCpuInfo"
:radius="radius"
Expand Down
8 changes: 3 additions & 5 deletions src/components/AccountSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,11 @@ export default defineComponent({
};
const accounts = await api.getTableByScope(request);
// because the get table by scope for userres does not include eosio system or null accounts
// get table by scope for userres does not include system account
if (value.includes('eosio')) {
accounts.push(...[{
accounts.unshift({
payer: 'eosio',
} as TableByScope, {
payer: 'eosio.null',
} as TableByScope]);
} as TableByScope);
}
if (accounts.length > 0) {
Expand Down
10 changes: 4 additions & 6 deletions src/components/HeaderSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default defineComponent({
isLoading.value = false;
};
const onInput = debounce(fetchData, 100);
const onInput = debounce(fetchData, 200);
watch(inputValue, onInput);
Expand All @@ -53,13 +53,11 @@ export default defineComponent({
};
const accounts = await api.getTableByScope(request);
// because the get table by scope for userres does not include eosio system or null accounts
// get table by scope for userres does not include system account
if (value.includes('eosio')) {
accounts.unshift(...[{
accounts.unshift({
payer: 'eosio',
} as TableByScope, {
payer: 'eosio.null',
} as TableByScope]);
} as TableByScope);
}
if (accounts.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PercentCircle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default defineComponent({
const fractionUnits = computed(
() => `${fraction.value}${unit.value}/${total.value}${unit.value}`,
);
const available = computed(() => (total.value - fraction.value).toFixed(3));
const available = computed(() => Math.abs(total.value - fraction.value).toFixed(3));
const dashArray = computed(() => {
if (Number.isNaN(formatResourcePercent.value)) {
return '0';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProposalAuthorization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default defineComponent({
});
if (accounts.length > 0) {
// because the get table by scope for userres does not include eosio account
// get table by scope for userres does not include system account
if ('eosio'.includes(value)) {
actorsOptions.value.push('eosio');
}
Expand Down

0 comments on commit 02970ee

Please sign in to comment.