You've already forked gun-manager-frontend
Never gonna make you cry
This commit is contained in:
@@ -15,4 +15,8 @@ export default defineComponent({})
|
|||||||
body {
|
body {
|
||||||
font-family: var(--font-family);
|
font-family: var(--font-family);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.svg-inline--fa{
|
||||||
|
top: 40% !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<h3 class="text-lg font-bold">
|
<h3 class="text-lg font-bold">
|
||||||
Images
|
Images
|
||||||
</h3>
|
</h3>
|
||||||
<div style="border-top: 1px rgba(123,123,123,0.4) solid; border-bottom: 1px rgba(123,123,123,0.4) solid;"
|
<div
|
||||||
class="p-5 mt-4 flex justify-evenly" v-for="photo in gun.photos">
|
class="p-5 mt-4 flex justify-evenly" v-for="photo in gun.photos">
|
||||||
<div>
|
<div>
|
||||||
<Image preview zoomInDisabled zoomOutDisabled>
|
<Image preview zoomInDisabled zoomOutDisabled>
|
||||||
@@ -21,8 +21,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</Image>
|
</Image>
|
||||||
</div>
|
</div>
|
||||||
<div @click="deletePhoto(photo.id)">
|
<div>
|
||||||
<i style="color: red;" class="fa-regular fa-2x fa-trash"></i>
|
<Button @click="deletePhoto(photo.id)">
|
||||||
|
<i style="color: red;" class="fa-regular fa-2x fa-trash mr-5"></i> Delete Photo
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,7 +4,14 @@
|
|||||||
Gun List
|
Gun List
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
<DataTable class="p-datatable-sm" :value="guns">
|
<span class="p-input-icon-left w-full">
|
||||||
|
<i class="fa-regular fa-magnifying-glass"></i>
|
||||||
|
<InputText v-model="filters.global.value" class="w-full mb-3" placeholder="Search"/>
|
||||||
|
</span>
|
||||||
|
<DataTable
|
||||||
|
:globalFilterFields="['make', 'model']"
|
||||||
|
:loading="loading"
|
||||||
|
filterDisplay="row" v-model:filters="filters" class="p-datatable-sm" :value="guns">
|
||||||
<Column sortable field="id" header="ID"></Column>
|
<Column sortable field="id" header="ID"></Column>
|
||||||
<Column sortable field="make" header="Make"></Column>
|
<Column sortable field="make" header="Make"></Column>
|
||||||
<Column sortable field="model" header="Model"></Column>
|
<Column sortable field="model" header="Model"></Column>
|
||||||
@@ -35,14 +42,24 @@ import {defineComponent} from "vue";
|
|||||||
import {Guns} from "../types/guns";
|
import {Guns} from "../types/guns";
|
||||||
import {Response} from "../types/Response";
|
import {Response} from "../types/Response";
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import {DataTableFilterMeta, DataTableFilterMetaData} from "primevue/datatable";
|
||||||
|
|
||||||
interface Data {
|
interface Data {
|
||||||
guns: Array<Guns>
|
guns: Array<Guns>
|
||||||
|
filters: DataTableFilterMeta
|
||||||
|
loading: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
data: (): Data => ({
|
data: (): Data => ({
|
||||||
guns: []
|
guns: [],
|
||||||
|
loading: false,
|
||||||
|
filters: {
|
||||||
|
global: {
|
||||||
|
value: "",
|
||||||
|
matchMode: "contains"
|
||||||
|
} as DataTableFilterMetaData
|
||||||
|
} as DataTableFilterMeta
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
total() {
|
total() {
|
||||||
@@ -56,10 +73,14 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.loading = true
|
||||||
axios.get(import.meta.env.VITE_API + '/gun')
|
axios.get(import.meta.env.VITE_API + '/gun')
|
||||||
.then((r: Response<Array<Guns>>) => {
|
.then((r: Response<Array<Guns>>) => {
|
||||||
this.guns = r.data.payload
|
this.guns = r.data.payload
|
||||||
})
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user