|
|
|
@ -5,34 +5,19 @@
|
|
|
|
|
|
|
|
|
|
<b-form-group |
|
|
|
|
id="ip-g-1" |
|
|
|
|
label="Name:" |
|
|
|
|
label-for="name" |
|
|
|
|
description="Name des Zertifikat-Typs:" |
|
|
|
|
label="Bezeichnung:" |
|
|
|
|
label-for="bezeichnung" |
|
|
|
|
description="Bezeichnung des Kleidungs-Typs:" |
|
|
|
|
> |
|
|
|
|
<b-form-input |
|
|
|
|
id="name" |
|
|
|
|
v-model="form.name" |
|
|
|
|
id="bezeichnung" |
|
|
|
|
v-model="form.bezeichnung" |
|
|
|
|
required |
|
|
|
|
placeholder="Name eingeben" |
|
|
|
|
placeholder="Bezeichnung eingeben" |
|
|
|
|
size="50" |
|
|
|
|
> |
|
|
|
|
</b-form-input> |
|
|
|
|
</b-form-group> |
|
|
|
|
<b-form-group |
|
|
|
|
id="ip-g-2" |
|
|
|
|
label="Laufzeit (in Tagen):" |
|
|
|
|
label-for="laufzeit" |
|
|
|
|
description="Laufzeit des Zertifikats:" |
|
|
|
|
> |
|
|
|
|
<b-form-input |
|
|
|
|
id="laufzeit" |
|
|
|
|
v-model="form.laufzeit" |
|
|
|
|
required |
|
|
|
|
placeholder="Laufzeit eingeben" |
|
|
|
|
size="50" |
|
|
|
|
> |
|
|
|
|
</b-form-input> |
|
|
|
|
</b-form-group> |
|
|
|
|
|
|
|
|
|
<b-button variant="primary" @click="onSubmit()">Neu eintragen</b-button> |
|
|
|
|
<b-button variant="secondary" @click="onUpdate()">Aktualisieren</b-button> |
|
|
|
@ -56,8 +41,7 @@
|
|
|
|
|
certs: [], |
|
|
|
|
form:{ |
|
|
|
|
id: "", |
|
|
|
|
name: "", |
|
|
|
|
laufzeit: 0, |
|
|
|
|
bezeichnung: "", |
|
|
|
|
}, |
|
|
|
|
fields: [ |
|
|
|
|
{ |
|
|
|
@ -65,11 +49,7 @@
|
|
|
|
|
sortable: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
key: 'name', |
|
|
|
|
sortable: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
key: 'laufzeit', |
|
|
|
|
key: 'bezeichnung', |
|
|
|
|
sortable: true |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
@ -88,14 +68,14 @@
|
|
|
|
|
async fetch() { |
|
|
|
|
console.log("fetching..."); |
|
|
|
|
this.certs = await fetch( |
|
|
|
|
'http://localhost:8081/api/typ' |
|
|
|
|
'http://ubodroid-2:8080/api/v1/typ' |
|
|
|
|
).then(res => res.json()) |
|
|
|
|
}, |
|
|
|
|
async onSubmit() { |
|
|
|
|
// event.preventDefault(); |
|
|
|
|
this.form.id = ""; |
|
|
|
|
console.log("submitting..."); |
|
|
|
|
await this.$http.$post('http://localhost:3000/api/typ', this.form); |
|
|
|
|
await this.$http.$post('http://ubodroid-2:8080/api/v1/typ', this.form); |
|
|
|
|
// return result; |
|
|
|
|
// this.subm(this.form); |
|
|
|
|
this.fetch(); |
|
|
|
@ -107,7 +87,7 @@
|
|
|
|
|
console.log("updating..."); |
|
|
|
|
console.log("Laufzeit: ", this.form.laufzeit) |
|
|
|
|
console.log(this.form); |
|
|
|
|
await this.$http.$put('http://localhost:3000/api/typ/'+this.form.id, this.form); |
|
|
|
|
await this.$http.$put('http://ubodroid-2:8080/api/v1/typ/'+this.form.id, this.form); |
|
|
|
|
// return result; |
|
|
|
|
// this.subm(this.form); |
|
|
|
|
this.fetch(); |
|
|
|
@ -117,7 +97,7 @@
|
|
|
|
|
async onDelete() { |
|
|
|
|
// event.preventDefault(); |
|
|
|
|
console.log("updating..."); |
|
|
|
|
await this.$http.$delete('http://localhost:3000/api/typ/'+this.form.id); |
|
|
|
|
await this.$http.$delete('http://ubodroid-2:8080/api/v1/typ/'+this.form.id); |
|
|
|
|
// return result; |
|
|
|
|
// this.subm(this.form); |
|
|
|
|
this.fetch(); |
|
|
|
@ -127,17 +107,15 @@
|
|
|
|
|
|
|
|
|
|
onReset(event) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
this.form.name = ''; |
|
|
|
|
this.form.laufzeit = 0; |
|
|
|
|
this.form.bezeichnung = ''; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
onFill(item) { |
|
|
|
|
// alert(JSON.stringify(item)); |
|
|
|
|
if(item.length !== 0) { |
|
|
|
|
this.form.name = item[0].name; |
|
|
|
|
this.form.bezeichnung = item[0].bezeichnung; |
|
|
|
|
this.form.id = item[0].id; |
|
|
|
|
this.form.laufzeit = parseInt(item[0].laufzeit); |
|
|
|
|
console.log(JSON.stringify(item[0].name)); |
|
|
|
|
console.log(JSON.stringify(item[0].bezeichnung)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|