Commit 20832c55 authored by janis.streib's avatar janis.streib 🦉
Browse files

FIX: correct represnetation of uncheck checkboxes in data-editor

parent cccbceb6
Pipeline #112096 passed with stages
in 8 minutes and 39 seconds
......@@ -13,6 +13,7 @@
type="number"
:name="attribute_name" :disabled="input_reducer instanceof Boolean && !input_reducer"
></b-form-input>
<input type="hidden" :name="attribute_name" v-if="object_attribute.data_type=='boolean'" :value="false"/>
<b-checkbox :checked="attribute_preset || false" :name="attribute_name"
v-if="object_attribute.data_type=='boolean'"
:disabled="input_reducer instanceof Boolean && !input_reducer"></b-checkbox>
......
......@@ -30,6 +30,7 @@ import {
faSignOutAlt,
faUser,
faEye,
faEyeSlash,
faLink,
faQuestion,
faTimes
......@@ -83,6 +84,7 @@ library.add(
faPaperPlane,
faOpenid,
faEye,
faEyeSlash,
faLink,
faQuestion,
faTimes
......
......@@ -60,19 +60,21 @@
</b-tooltip>
</template>
<template v-slot:cell(wpa_key)="data">
<span v-if="data.item.wpa_key !== null">
<b-button block :id="'show-wpa-key-' + bcd.name + '-' + data.index" variant="primary">
<font-awesome-icon :icon="['fas','eye']"/>
</b-button>
<b-popover :target="'show-wpa-key-' + bcd.name + '-' + data.index"
triggers="focus" custom-class="popover-wide">
<CopyField :text="data.item.wpa_key" code/>
</b-popover>
</b-popover></span>
<span v-else class="text-center"><p><font-awesome-icon :icon="['fas', 'eye-slash']"></font-awesome-icon></p></span>
</template>
<template v-slot:cell(last_login_date)="data">
{{ formatDate(data.item.last_login_date) }}
</template>
<template v-slot:cell(mac_addr)="data">
<code>{{data.item.mac_addr}}</code>
<code>{{ data.item.mac_addr }}</code>
</template>
<template v-slot:cell(buttons)="data">
<b-button-group class="fullwidth">
......@@ -120,8 +122,8 @@ import CopyField from '@/components/CopyField'
export default {
name: 'macauth',
components: { CopyField, DBEditor, Loading },
data () {
components: {CopyField, DBEditor, Loading},
data() {
return {
db_editor_object_function: 'create',
db_editor_old_data: {},
......@@ -160,7 +162,7 @@ export default {
}
},
computed: {
filtered_bcds () {
filtered_bcds() {
if (this.bcds == null) {
return null
}
......@@ -169,41 +171,41 @@ export default {
}
return this.bcds.filter(bcd => {
return bcd.name.toLowerCase().includes(this.filter_text.toLowerCase()) ||
(bcd.description != null && bcd.description.toLowerCase().includes(this.filter_text.toLowerCase()))
(bcd.description != null && bcd.description.toLowerCase().includes(this.filter_text.toLowerCase()))
})
}
},
created () {
created() {
this.fetchData()
},
methods: {
fetchData () {
fetchData() {
MACAuth.list(this.$store.state.netdb_axios_config, {}).then((response) => {
this.clients_by_bcd = ApiUtil.dict_of_lists_by_value_of_array(response.data[0], 'bcd_name')
this.bcds = response.data[1]
})
},
formatDate (value) {
formatDate(value) {
if (value == null) {
return 'N/A'
}
return new Date(Date.parse(value)).toLocaleString('de-DE')
},
createClient (bcd) {
createClient(bcd) {
this.db_editor_object_function = 'create'
this.db_editor_old_data = {}
this.db_editor_presets = { bcd_name: bcd.name }
this.db_editor_presets = {bcd_name: bcd.name}
this.db_editor_object_title = null
this.$root.$emit('bv::show::modal', 'dbeditor_macauth')
},
editClient (item) {
editClient(item) {
this.db_editor_object_function = 'update'
this.db_editor_old_data = item
this.db_editor_presets = item
this.db_editor_object_title = item.mac_addr + ' in BCD ' + item.bcd_name
this.$root.$emit('bv::show::modal', 'dbeditor_macauth')
},
deleteClient (item) {
deleteClient(item) {
const ta = transactionutil.generateDeleteElement('macauth.client', MACAuthService.deleteParamsList(), item, item.mac_addr + ' in BCD ' + item.bcd_name)
this.$store.commit('addTransactionElement', ta)
this.$emit('commited', ta)
......
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