Skip to content

Commit 7f439e2

Browse files
committed
Get rid of add and register dialogs. Use direct calls instead with the common result dialog for outputs.
1 parent ac2a91c commit 7f439e2

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/pages/Index.vue

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
<div class="col-md col-sm-12 col-xs-12 text-right">
1616
<div row items-center justify-end>
17-
<q-btn outline color="vgreen" icon="fas fa-user-plus" class="q-mt-sm q-mx-xs" @click="addNodeDialog = true" v-if="identity.account_name && !identity.account_added" label="Add" >
17+
<q-btn outline color="vgreen" icon="fas fa-user-plus" class="q-mt-sm q-mx-xs" @click="addNode()" v-if="identity.account_name && !identity.account_added" label="Add" >
1818
<q-tooltip content-class="bg-vgreen text-vdark" content-style="font-size: 16px" :offset="[10, 10]">Add the node</q-tooltip>
1919
</q-btn>
2020
<q-btn disabled outline color="vgreen" icon="fas fa-user-plus" class="q-mt-sm q-mx-xs" v-if="identity.account_name && identity.account_added" label="Added" />
2121

22-
<q-btn outline color="vgreen" icon="fas fa-address-card" class="q-mt-sm q-mx-xs text-vgrey" @click="registerNodeDialog = true" v-if="identity.account_name && !identity.account_registered" label="Register" >
22+
<q-btn outline color="vgreen" icon="fas fa-address-card" class="q-mt-sm q-mx-xs text-vgrey" @click="registerNode()" v-if="identity.account_name && !identity.account_registered" label="Register" >
2323
<q-tooltip content-class="bg-vgreen text-vdark" content-style="font-size: 16px" :offset="[10, 10]">Register the node</q-tooltip>
2424
</q-btn>
2525
<q-btn disabled outline color="vgreen" icon="fas fa-address-card" class="q-mt-sm q-mx-xs text-vgrey" v-if="identity.account_name && identity.account_registered" label="Registered" />
@@ -250,7 +250,7 @@
250250
</q-card>
251251
</q-dialog>
252252
<!-- Add node dialog -->
253-
<q-dialog v-model="addNodeDialog">
253+
<!-- <q-dialog v-model="addNodeDialog">
254254
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey">
255255
<q-card-section>
256256
<div class="text-h6">Add the node into the distribution contract</div>
@@ -266,9 +266,9 @@
266266
<q-btn flat label="Add" color="vblack" @click=addNode />
267267
</q-card-actions>
268268
</q-card>
269-
</q-dialog>
269+
</q-dialog> -->
270270
<!-- register node dialog -->
271-
<q-dialog v-model="registerNodeDialog">
271+
<!-- <q-dialog v-model="registerNodeDialog">
272272
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey">
273273
<q-card-section>
274274
<div class="text-h6">Register the node into the voting contract</div>
@@ -284,7 +284,7 @@
284284
<q-btn flat label="Register" color="vblack" @click=registerNode />
285285
</q-card-actions>
286286
</q-card>
287-
</q-dialog>
287+
</q-dialog> -->
288288
<!-- Private key update dialog -->
289289
<q-dialog v-model="privateDialog" @show="$refs.input.focus()">
290290
<q-card style="min-width: 50vw; max-width: 70vw;" class="bg-vgrey">
@@ -433,10 +433,10 @@ export default {
433433
nodes: [],
434434
voting_list: [],
435435
privateDialog: false,
436-
addNodeDialog: false,
437-
addNodeMessage: '',
438-
registerNodeDialog: false,
439-
registerNodeMessage: '',
436+
// addNodeDialog: false,
437+
// addNodeMessage: '',
438+
// registerNodeDialog: false,
439+
// registerNodeMessage: '',
440440
errorDialog: false,
441441
errorMessage: '',
442442
resultDialog: false,
@@ -773,8 +773,9 @@ export default {
773773
blocksBehind: 3,
774774
expireSeconds: 30
775775
})
776-
this.addNodeMessage = 'Transaction executed successfully!\n\n'
777-
this.addNodeMessage += JSON.stringify(result, null, 2)
776+
this.resultMessage = 'Transaction executed successfully!\n\n'
777+
this.resultMessage += JSON.stringify(result, null, 2)
778+
this.resultDialog = true
778779
this.refresh()
779780
} catch (error) {
780781
this.errorMessage = error
@@ -806,8 +807,9 @@ export default {
806807
blocksBehind: 3,
807808
expireSeconds: 30
808809
})
809-
this.registerNodeMessage = 'Transaction executed successfully!\n\n'
810-
this.registerNodeMessage += JSON.stringify(result, null, 2)
810+
this.resultMessage = 'Transaction executed successfully!\n\n'
811+
this.resultMessage += JSON.stringify(result, null, 2)
812+
this.resultDialog = true
811813
this.refresh()
812814
} catch (error) {
813815
this.errorMessage = error

0 commit comments

Comments
 (0)