oxen-electron-gui-wallet/src/components/footer.vue
Mikunj Varsani 018d08371d
UI upgrade (#155)
* followed upgrade instructions on quasar site

* followed upgrade instructions on quasar site

* debug messages now show

* Fix template error mode undefined

* building and working, UI broken, need to move to new quasar components

* move collapsible to expansion-item

* moving over components to quasar v1+

* items to labels

* items and item side to quasar v1

* fix label typo

* item main to item label

* q-section to q-item-section

* popover to menu

* modals to v1 quasar

* Remove debug lines, use new dialog methods

* move static folder up a dir and rename to public. Change paths accordingly

* Exit modal fixed with v1 quasar

* UI fixes for v1 quasar

* remove link styles

* some field updates

* Fix more fields and modals for v1

* more fields updated

* more fields changed over

* wallet settings modals

* Fix password confirm dialog issue w/ refactor

* begin generalising a copy component

* Receive item looking better

* Index view vixed for v1 quasar

* fix export/import keys modal

* tx styles and some others

* bunch of small style changes

* Fix date display on restore page

* completed upgrade to v1 quasar (I think)

* lns list fixed, stake buttons fixed

* fix favourite checkbox with v1 quasar

* Address book fixes

* Fix the context menus

* clean up

* remove mixin from copyicon

* Fix webpack

* fix QR code view on address detail page

* Fix welcome stepper and default to blink

* Fix some style issues

* radio buttons w/ white circles

* clean up

* sn style fixes, and other fixes

* style fixes and unlock bug fixed

* fix daemon typo

* Fix some style things

* fix button colour

Co-authored-by: Kyle Zsembery <zsembery.kyle@gmail.com>
2020-08-31 15:26:06 +10:00

87 lines
2.9 KiB
Vue

<template>
<q-footer class="status-footer">
<div class="status-line row items-center">
<div class="status row items-center">
<span>{{ $t("footer.status") }}:</span>
<span class="status-text" :class="[status]">{{ $t(`footer.${status}`) }}</span>
</div>
<div class="row">
<template v-if="config_daemon.type !== 'remote'">
<div>Daemon: {{ daemon.info.height_without_bootstrap }} / {{ target_height }} ({{ daemon_local_pct }}%)</div>
</template>
<template v-if="config_daemon.type !== 'local'">
<div>{{ $t("footer.remote") }}: {{ daemon.info.height }}</div>
</template>
<div>{{ $t("footer.wallet") }}: {{ wallet.info.height }} / {{ target_height }} ({{ wallet_pct }}%)</div>
</div>
</div>
<div class="status-bars" :class="[status]">
<div :style="{ width: daemon_pct + '%' }"></div>
<div :style="{ width: wallet_pct + '%' }"></div>
</div>
</q-footer>
</template>
<script>
import { mapState } from "vuex";
export default {
name: "StatusFooter",
data() {
return {};
},
computed: mapState({
config: state => state.gateway.app.config,
daemon: state => state.gateway.daemon,
wallet: state => state.gateway.wallet,
config_daemon() {
return this.config.daemons[this.config.app.net_type];
},
target_height() {
if (this.config_daemon.type === "local") return Math.max(this.daemon.info.height, this.daemon.info.target_height);
else return this.daemon.info.height;
},
daemon_pct() {
if (this.config_daemon.type === "local") return this.daemon_local_pct;
return 0;
},
daemon_local_pct() {
if (this.config_daemon.type === "remote") return 0;
let pct = ((100 * this.daemon.info.height_without_bootstrap) / this.target_height).toFixed(1);
if (pct == 100.0 && this.daemon.info.height_without_bootstrap < this.target_height) return 99.9;
else return pct;
},
wallet_pct() {
let pct = ((100 * this.wallet.info.height) / this.target_height).toFixed(1);
if (pct == 100.0 && this.wallet.info.height < this.target_height) return 99.9;
else return pct;
},
status() {
if (this.config_daemon.type === "local") {
if (this.daemon.info.height_without_bootstrap < this.target_height) {
return "syncing";
} else if (this.wallet.info.height < this.target_height - 1 && this.wallet.info.height != 0) {
return "scanning";
} else {
return "ready";
}
} else {
if (this.wallet.info.height < this.target_height - 1 && this.wallet.info.height != 0) {
return "scanning";
} else if (
this.config_daemon.type === "local_remote" &&
this.daemon.info.height_without_bootstrap < this.target_height
) {
return "syncing";
} else {
return "ready";
}
}
}
})
};
</script>
<style lang="scss"></style>