|
178 | 178 |
|
179 | 179 | <template v-slot:action>
|
180 | 180 | <q-btn size="md" outline color="vgreen" label="Rules" class="q-mx-xs" v-on:click="rulesDialog=true" />
|
181 |
| - <q-btn size="md" outline color="vgreen" icon="fas fa-sync-alt" class="q-mx-xs" v-on:click=refresh /> |
| 181 | + <q-btn size="md" outline color="vgreen" icon="fas fa-sync-alt" class="q-mx-xs" :disabled="nodes.length && nodes.every(item => item.balance && item.account) ? false : true" v-on:click=refresh /> |
182 | 182 | </template>
|
183 | 183 | </q-banner>
|
184 | 184 | <q-scroll-area style="height: 300pt;">
|
@@ -783,14 +783,19 @@ export default {
|
783 | 783 | const eos = new this.$EosWrapper()
|
784 | 784 | this.running_nodes = this.nodes.length
|
785 | 785 | this.getRegisteredNodes()
|
786 |
| - for (var id in this.nodes) { |
787 |
| - // this.getAccountByKey(id, this.nodes[id].key) |
788 |
| - this.getAccountName(id, this.nodes[id].key, eos) |
| 786 | + if (this.nodes.length > 0) { |
| 787 | + for (var id in this.nodes) { |
| 788 | + // this.getAccountByKey(id, this.nodes[id].key) |
| 789 | + this.getAccountName(id, this.nodes[id].key, eos) |
| 790 | + } |
| 791 | + } else { |
| 792 | + this.$userError('Oops, too often refresh, please try later.', 'Get list of Nodes action') |
789 | 793 | }
|
790 | 794 | },
|
791 | 795 | async getNodes () {
|
792 | 796 | return new Promise(resolve => {
|
793 | 797 | this.$http.get(process.env.NODES_API + '/getConnectedNodes').then((result) => {
|
| 798 | + // TODO: Handler if the object is empty of has result: null or result: try later |
794 | 799 | for (var key in result.data) {
|
795 | 800 | if (result.data[key].includes('EOS')) {
|
796 | 801 | this.nodes.push({ id: key, key: result.data[key].trim(), account: '', vote: true })
|
|
0 commit comments