Просмотр исходного кода

Show restore short key to user

pull/8/head
Kristijan Mitrovic 4 лет назад
Родитель
Сommit
a09bf78fe8
2 измененных файлов: 17 добавлений и 9 удалений
  1. +7
    -4
      src/_store/networks.module.js
  2. +10
    -5
      src/account/NetworkPage.vue

+ 7
- 4
src/_store/networks.module.js Просмотреть файл

@@ -22,7 +22,8 @@ const state = {
networkNodes: null,
deletedNetwork: null,
networkKeysRequested: null,
networkKeys: null
networkKeys: null,
restoreKey: null
};

const actions = {
@@ -221,13 +222,15 @@ const mutations = {
state.error = error;
},

restoreNetworkRequest(state, id) {
restoreNetworkRequest(state, networkId) {
state.loading.restoring = true;
state.restoreKey = null;
},
restoreNetworkSuccess(state, id) {
restoreNetworkSuccess(state, restoreNodeNotification) {
state.restoreKey = restoreNodeNotification.restoreKey;
state.loading.restoring = false;
},
restoreNetworkFailure(state, { id, error }) {
restoreNetworkFailure(state, { restoreNodeNotification, error }) {
state.loading.restoring = false;
state.error = error;
},


+ 10
- 5
src/account/NetworkPage.vue Просмотреть файл

@@ -97,10 +97,15 @@
</div>

<div v-if="networkNodes && networkNodes.length === 0">
<button @click="restoreNet()" class="btn btn-primary" :disabled="loading && loading.restoring">
{{ messages.button_label_restore }}
</button>
<img v-show="loading && loading.restoring" :src="loadingImgSrc" />
<div v-if="restoreKey" class="alert alert-success">
{{ messages.restore_key_label }} {{ restoreKey }}
</div>
<div v-else>
<button @click="restoreNet()" class="btn btn-primary" :disabled="loading && loading.restoring">
{{ messages.button_label_restore }}
</button>
<img v-show="loading && loading.restoring" :src="loadingImgSrc" />
</div>
{{ messages.button_description_restore }}
</div>
<div v-else v-html="messages.restore_not_possible_nodes_exist_html" />
@@ -153,7 +158,7 @@
computed: {
...mapState('networks', [
'network', 'newNodeNotification', 'networkStatuses', 'networkNodes', 'networkKeysRequested',
'deletedNetwork', 'networkKeys', 'loading'
'deletedNetwork', 'networkKeys', 'loading', 'restoreKey'
]),
...mapState('system', ['messages', 'configs']),
showSetupHelp () {


Загрузка…
Отмена
Сохранить