Commit e3c2bb6d authored by Robert-K's avatar Robert-K
Browse files

UPD: Refactored due to API changes

parent 03db3f45
......@@ -92,8 +92,8 @@
placeholder="Beschreibung"
/>
</b-form-group>
<div v-if="new_token.delete_date != null">
<b-form-group label="Ablaufdatum:" label-for="input-token-create-delete_date" class="mb-0">
<div v-if="new_token.expiration_date != null">
<b-form-group label="Ablaufdatum:" label-for="input-token-create-expiration_date" class="mb-0">
<VueCtkDateTimePicker
:inline="!isMobile()"
format="DD-MM-YYYY HH:mm"
......@@ -103,17 +103,17 @@
noLabel
no-keyboard
noClearButton
id="input-token-create-delete_date"
id="input-token-create-expiration_date"
color="#007BFF"
button-color="#007BFF"
v-model="new_token.delete_date"/>
v-model="new_token.expiration_date"/>
</b-form-group>
<b-button block variant="outline-secondary" @click="new_token.delete_date = null">
<b-button block variant="outline-secondary" @click="new_token.expiration_date = null">
Ablaufdatum entfernen
</b-button>
</div>
<b-button block variant="outline-secondary" v-else
@click="new_token.delete_date = formatDate(getDate30DaysAhead())">
@click="new_token.expiration_date = formatDate(getDate30DaysAhead())">
Ablaufdatum hinzufügen
</b-button>
</b-form>
......@@ -162,8 +162,8 @@
/>
</b-form-group>
</b-form>
<div v-if="new_token.delete_date != null">
<b-form-group label="Ablaufdatum:" label-for="input-token-edit-delete_date" class="mb-0">
<div v-if="new_token.expiration_date != null">
<b-form-group label="Ablaufdatum:" label-for="input-token-edit-expiration_date" class="mb-0">
<VueCtkDateTimePicker
:inline="!isMobile()"
format="DD-MM-YYYY HH:mm"
......@@ -173,17 +173,17 @@
noLabel
no-keyboard
noClearButton
id="input-token-edit-delete_date"
id="input-token-edit-expiration_date"
color="#007BFF"
button-color="#007BFF"
v-model="new_token.delete_date"/>
v-model="new_token.expiration_date"/>
</b-form-group>
<b-button block variant="outline-secondary" @click="new_token.delete_date = null">
<b-button block variant="outline-secondary" @click="new_token.expiration_date = null">
Ablaufdatum entfernen
</b-button>
</div>
<b-button block variant="outline-secondary" v-else
@click="new_token.delete_date = formatDate(getDate30DaysAhead())">
@click="new_token.expiration_date = formatDate(getDate30DaysAhead())">
Ablaufdatum hinzufügen
</b-button>
<template v-slot:modal-footer="{cancel, ok}">
......@@ -308,12 +308,12 @@
parent_login_name: null,
description: '',
login_name: '',
delete_date: null
expiration_date: null
},
new_token: {
description: '',
login_name: '',
delete_date: null
expiration_date: null
},
filter_text: "",
token_list_fields: [
......@@ -323,7 +323,7 @@
sortable: false
},
{
key: 'delete_date',
key: 'expiration_date',
label: "Ablaufdatum",
formatter: this.formatDate, // TODO: show expired tokens in red
sortable: true
......@@ -386,14 +386,14 @@
showModalEditToken(token) {
this.new_token.description = token.description
this.new_token.login_name = token.login_name
this.new_token.delete_date = token.delete_date != null ? this.formatDate(token.delete_date) : null
this.new_token.expiration_date = token.expiration_date != null ? this.formatDate(token.expiration_date) : null
this.new_token.pk = token.pk
this.show_modal_alert = false
this.$bvModal.show('modal-edit-token')
},
showModalCreateToken(login_name) {
this.new_token.description = ''
this.new_token.delete_date = null
this.new_token.expiration_date = null
this.new_token.login_name = login_name
this.show_modal_alert = false
this.$bvModal.show('modal-create-token')
......@@ -401,12 +401,12 @@
resetAccountData() {
this.new_account.description = ''
this.new_account.login_name = ''
this.new_account.delete_date = null
this.new_account.expiration_date = null
},
resetTokenData() {
this.new_token.description = ''
this.new_token.login_name = ''
this.new_token.delete_date = null
this.new_token.expiration_date = null
},
createAccount() {
AccountService.create(this.$store.state.netdb_axios_config, {
......@@ -452,7 +452,7 @@
TokenService.create(this.$store.state.netdb_axios_config, {
description_new: this.new_token.description,
login_name_new: this.new_token.login_name,
delete_date_new: this.new_token.delete_date
expiration_date_new: this.new_token.expiration_date
}).then(response => {
this.$bvModal.hide('modal-create-token')
this.token = response.data[0][0].token
......@@ -468,7 +468,7 @@
description_new: this.new_token.description,
pk_old: this.new_token.pk,
do_refresh_token_new: true,
delete_date_new: this.new_token.delete_date
expiration_date_new: this.new_token.expiration_date
}).then(() => {
this.$bvModal.hide('modal-edit-token')
this.fetchData()
......
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