Commit c8cae6e2 authored by Janis Streib's avatar Janis Streib 🦉
Browse files

ADD: minimal db result viewer

parent 80d8fdfe
Pipeline #117228 passed with stages
in 6 minutes and 12 seconds
......@@ -113,6 +113,7 @@ export default {
new: TransactionUtil.remove_empty_data(this.object_functions[this.object_function].parameters, new_params),
old: this.old_data
}
ta.show_result = this.show_result
ta.old_uuid = this.old_uuid
ta.uuid = uuidv4()
ta.object_fq_name = this.object_fq_name
......@@ -212,6 +213,11 @@ export default {
default() {
return null
}
},
show_result: {
default() {
return false
}
}
},
computed: {
......
......@@ -166,6 +166,15 @@
</b-alert>
<b-form-file :state="import_valid" accept="application/json" v-model="import_file"></b-form-file>
</b-modal>
<b-modal ok-only id="ta_results" title="Transaktionsergebnis" size="lg">
<pre>
{{ visible_results[visible_ta_res_index] }}
</pre>
<b-button-group class="d-flex" align="center">
<b-button @click="visible_ta_res_index--" :disabled="visible_ta_res_index === 0">Vorherige</b-button>
<b-button @click="visible_ta_res_index++" :disabled="visible_ta_res_index === (visible_results.length-1)">Nächste</b-button>
</b-button-group>
</b-modal>
</b-overlay>
</template>
......@@ -235,14 +244,26 @@ export default {
this.move(val.moved.oldIndex, val.moved.newIndex)
},
async executeTa() {
this.visible_results = []
this.visible_ta_res_index = 0
await this.$store.dispatch('executeTransaction')
if (this.$store.state.transaction_result.type !== 'error') {
this.$store.commit('reloadRouterComp')
this.$store.state.transaction_result.ta_list.forEach((item, index) => {
if (item.show_result) {
this.visible_results.push(this.$store.state.transaction_result.result[index])
}
})
if (this.visible_results.length > 0) {
this.$bvModal.show('ta_results')
}
}
}
},
data() {
return {
visible_results: [],
visible_ta_res_index: 0,
import_file: null,
import_valid: null,
edit_elem: {
......
......@@ -225,7 +225,6 @@ async function init() {
try {
const res = await WAPITransactionSerice.execute(state.netdb_axios_config, api_list)
window.console.debug(res)
state.ta_list = []
state.undo_redo_new_mutaion = true
state.undone = []
state.done = []
......@@ -234,8 +233,11 @@ async function init() {
window.localStorage.removeItem('undo_redo_new_mutation')
window.localStorage.removeItem('ta_list')
state.transaction_result = {
type: 'success'
type: 'success',
result: res.data,
ta_list: state.ta_list
}
state.ta_list = []
} catch (e) {
window.console.debug(e.response)
state.transaction_result = {
......
......@@ -353,6 +353,7 @@
</template>
<DBEditor object_fq_name="cntl.wapi_auth" modal_id="token_editor" :object_function="db_editor_function"
:old_data="db_editor_old_data"
:show_result="db_editor_function === 'create'"
:presets="db_editor_presets"
:non_optionals_order="['login_name', 'description', 'expiration_date', 'do_refresh_token']"
></DBEditor>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment