Browse Source

test für runtime variables

pull/1/head
Georg Spar 1 year ago
parent
commit
51551f0aa7
  1. 12
      components/Bought.vue
  2. 2
      components/Evaluated.vue
  3. 5
      nuxt.config.ts
  4. 1
      todo.md

12
components/Bought.vue

@ -87,6 +87,8 @@ import { useDialog } from "primevue/usedialog";
import UpdPhoto from "./UpdPhoto.vue";
import Upditemext from "./Upditemext.vue";
const config = useRuntimeConfig();
console.log (config.public.apiHostname);
interface cItemB {
id: number;
@ -107,7 +109,7 @@ let imgurl = ref();
const imgref = ref();
//imgref.value='1679468897186c75b5379eb6691871da30ef18b98a_1.jpg';
const {data: itemsb } = await awaitItemsb();
const {data: typen } = await useFetch('http://ubodroid-2:8081/api/v1/typ');
const {data: typen } = await useFetch(config.public.apiHostname + 'api/v1/typ');
async function openDetail(id) {
await navigateTo({
@ -122,7 +124,7 @@ async function openDetail(id) {
};
async function awaitItemsb() {
const res = await useFetch('http://ubodroid-2:8081/api/v1/itb');
const res = await useFetch(config.public.apiHostname + 'api/v1/itb');
let r: any;
@ -144,7 +146,7 @@ async function openEval(id: number) {
}
async function openFrontview(iid: number) {
const itemb = await useFetch('http://ubodroid-2:8081/api/v1/itb/'+iid);
const itemb = await useFetch(config.public.apiHostname + 'api/v1/itb/'+iid);
let itb: cItemB;
console.log(itemb.data.value);
itb = itemb.data.value;
@ -175,7 +177,7 @@ async function doUpdate(t: cItemB) {
fd.append('abmessungenid', t.abmessungen.id.toString());
fd.append('frontviewid', t.frontviewid.toString());
console.log('fd = ', fd);
await $fetch('http://ubodroid-2:8081/api/v1/itb/'+t.id,{
await $fetch(config.public.apiHostname + 'api/v1/itb/'+t.id,{
method: 'PUT',
body: fd
});
@ -205,7 +207,7 @@ const onNew = () => {
fd.append('abmessungenid', t.abmessungenid.toString());
fd.append('frontviewid', t.frontviewid.toString());
console.log('fd = ', fd);
await $fetch('http://ubodroid-2:8081/api/v1/itb',{
await $fetch(config.public.apiHostname + 'api/v1/itb',{
method: 'POST',
body: fd
});

2
components/Evaluated.vue

@ -13,7 +13,7 @@
<img class="w-9 sm:w-16rem xl:w-10rem shadow-2 block xl:block mx-auto border-round" :src="slotProps.data.frontview.imgurl" :alt="slotProps.data.kurzbeschreibung" />
<div class="flex flex-column sm:flex-row justify-content-between align-items-center xl:align-items-start flex-1 gap-4">
<div class="flex flex-column align-items-center sm:align-items-start gap-3">
<div class="text-2xl font-bold text-900">{{ slotProps.data.itemb.kurzbeschreibung }}</div>
<div class="text-2xl font-bold text-900">{{ slotProps.data.genehmigt }}</div>
<div class="flex align-items-center gap-3">
<span class="flex align-items-center gap-2">
<i class="pi pi-tag"></i>

5
nuxt.config.ts

@ -11,4 +11,9 @@ export default defineNuxtConfig({
build: {
transpile: ['primevue']
},
runtimeConfig:{
public: {
apiHostname: ''
}
}
})

1
todo.md

@ -1,4 +1,3 @@
* Feld frontview bei itemb und itemext einführen
* Ergänzung der API um die Felder, die für die Detailbetrachtung und das Speichern notwendig sind
* localhost anstelle des Rechnernamens vor dem Container-Test einfügen
*
Loading…
Cancel
Save