From a776eb3a368ceadbcc852079dbf16d3d69424753 Mon Sep 17 00:00:00 2001 From: bsilkyn Date: Thu, 18 Apr 2024 23:12:15 +0200 Subject: [PATCH 01/19] chore: added ability to upload docker images as an admin #334 --- frontend/src/assets/lang/app/en.json | 7 ++++++- frontend/src/assets/lang/app/nl.json | 7 ++++++- frontend/src/components/layout/admin/AdminSidebar.vue | 9 +++++++++ frontend/src/config/endpoints.ts | 3 +++ frontend/src/router/router.ts | 2 ++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/frontend/src/assets/lang/app/en.json b/frontend/src/assets/lang/app/en.json index c68e83c5..230ff37e 100644 --- a/frontend/src/assets/lang/app/en.json +++ b/frontend/src/assets/lang/app/en.json @@ -257,7 +257,12 @@ "teachers": { "title": "Teachers" }, - "teacher": "Teacher" + "teacher": "Teacher", + "catalog": "Catalog", + "docker_images": { + "title": "Docker images", + "name": "Name docker image" + } }, "primevue": { "startsWith": "Starts with", diff --git a/frontend/src/assets/lang/app/nl.json b/frontend/src/assets/lang/app/nl.json index a7ff3470..460a77be 100644 --- a/frontend/src/assets/lang/app/nl.json +++ b/frontend/src/assets/lang/app/nl.json @@ -257,7 +257,12 @@ "teachers": { "title": "Proffen" }, - "teacher": "Prof" + "teacher": "Prof", + "catalog": "Catalogus", + "docker_images": { + "title": "Docker images", + "name": "Naam docker image" + } }, "primevue": { "accept": "Ja", diff --git a/frontend/src/components/layout/admin/AdminSidebar.vue b/frontend/src/components/layout/admin/AdminSidebar.vue index 127e8186..4fe6101c 100644 --- a/frontend/src/components/layout/admin/AdminSidebar.vue +++ b/frontend/src/components/layout/admin/AdminSidebar.vue @@ -15,6 +15,15 @@ const items = ref([ }, ], }, + { + label: 'admin.catalog', + items: [ + { + label: 'admin.docker_images.title', + route: 'admin-docker_images', + }, + ], + }, ]); diff --git a/frontend/src/config/endpoints.ts b/frontend/src/config/endpoints.ts index ad8e8435..f7dcabf3 100644 --- a/frontend/src/config/endpoints.ts +++ b/frontend/src/config/endpoints.ts @@ -18,6 +18,9 @@ export const endpoints = { byTeacher: '/api/teachers/{teacherId}/courses/', byAssistant: '/api/assistants/{assistantId}/courses/', }, + dockerImages: { + index: '/api/docker-images/', + }, students: { index: '/api/students/', retrieve: '/api/students/{id}/', diff --git a/frontend/src/router/router.ts b/frontend/src/router/router.ts index 13db7315..e94865ea 100644 --- a/frontend/src/router/router.ts +++ b/frontend/src/router/router.ts @@ -21,6 +21,7 @@ import SubmissionView from '@/views/submissions/SubmissionView.vue'; import AdminView from '@/views/admin/AdminView.vue'; import UsersView from '@/views/admin/UsersView.vue'; import ProjectsView from '@/views/projects/ProjectsView.vue'; +import DockerImagesView from '@/views/admin/DockerImagesView.vue'; const routes: RouteRecordRaw[] = [ // Authentication @@ -151,6 +152,7 @@ const routes: RouteRecordRaw[] = [ children: [ { path: '', component: AdminView, name: 'admin' }, { path: 'users', component: UsersView, name: 'admin-users' }, + { path: 'docker_images', component: DockerImagesView, name: 'admin-docker_images' }, ], }, From ee700ef372767b3b69ef26b7a032a138cdcbdd82 Mon Sep 17 00:00:00 2001 From: bsilkyn Date: Thu, 18 Apr 2024 23:16:42 +0200 Subject: [PATCH 02/19] chore: actually add the actual view of admin panel to add docker images #334 --- frontend/src/types/DockerImage.ts | 9 +++ frontend/src/views/admin/DockerImagesView.vue | 56 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 frontend/src/types/DockerImage.ts create mode 100644 frontend/src/views/admin/DockerImagesView.vue diff --git a/frontend/src/types/DockerImage.ts b/frontend/src/types/DockerImage.ts new file mode 100644 index 00000000..5799efd1 --- /dev/null +++ b/frontend/src/types/DockerImage.ts @@ -0,0 +1,9 @@ +export class DockerImage { + constructor( + public id: string, + public name: string, + public file: string, // in the form of a uri + public publicStatus: string, + public owner: string, + ) {} +} diff --git a/frontend/src/views/admin/DockerImagesView.vue b/frontend/src/views/admin/DockerImagesView.vue new file mode 100644 index 00000000..8e3f77a4 --- /dev/null +++ b/frontend/src/views/admin/DockerImagesView.vue @@ -0,0 +1,56 @@ + + + + + From 04d1d7dfed6bb731584f30026771966237f83153 Mon Sep 17 00:00:00 2001 From: bsilkyn Date: Thu, 18 Apr 2024 23:21:58 +0200 Subject: [PATCH 03/19] chore: lint fixes #334 --- frontend/src/views/admin/DockerImagesView.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/admin/DockerImagesView.vue b/frontend/src/views/admin/DockerImagesView.vue index 8e3f77a4..7cb91f01 100644 --- a/frontend/src/views/admin/DockerImagesView.vue +++ b/frontend/src/views/admin/DockerImagesView.vue @@ -19,9 +19,9 @@ const upload = async (event: FileUploadUploaderEvent): Promise => { const files: File[] = event.files as File[]; const endpoint = endpoints.dockerImages.index; const data = { - 'file': files[0], - 'name': name.value, - } + file: files[0], + name: name.value, + }; await create(endpoint, data, response, Response.fromJSON, 'multipart/form-data'); name.value = ''; }; @@ -33,11 +33,7 @@ const upload = async (event: FileUploadUploaderEvent): Promise => {
{{ t('admin.docker_images.title') }}
- + Date: Thu, 18 Apr 2024 23:27:38 +0200 Subject: [PATCH 04/19] chore: rename url path and name to remove underscores #334 --- frontend/src/components/layout/admin/AdminSidebar.vue | 2 +- frontend/src/router/router.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/layout/admin/AdminSidebar.vue b/frontend/src/components/layout/admin/AdminSidebar.vue index 4fe6101c..729936f9 100644 --- a/frontend/src/components/layout/admin/AdminSidebar.vue +++ b/frontend/src/components/layout/admin/AdminSidebar.vue @@ -20,7 +20,7 @@ const items = ref([ items: [ { label: 'admin.docker_images.title', - route: 'admin-docker_images', + route: 'admin-dockerImages', }, ], }, diff --git a/frontend/src/router/router.ts b/frontend/src/router/router.ts index e94865ea..68955715 100644 --- a/frontend/src/router/router.ts +++ b/frontend/src/router/router.ts @@ -152,7 +152,7 @@ const routes: RouteRecordRaw[] = [ children: [ { path: '', component: AdminView, name: 'admin' }, { path: 'users', component: UsersView, name: 'admin-users' }, - { path: 'docker_images', component: DockerImagesView, name: 'admin-docker_images' }, + { path: 'docker-images', component: DockerImagesView, name: 'admin-dockerImages' }, ], }, From c74171d914de7ac49efcc0df65930cea5a01e3fd Mon Sep 17 00:00:00 2001 From: bsilkyn Date: Sat, 20 Apr 2024 22:15:58 +0200 Subject: [PATCH 05/19] chore: update translations and add public option docker image add admin panel #334 --- frontend/src/assets/lang/app/en.json | 5 ++- frontend/src/assets/lang/app/nl.json | 5 ++- frontend/src/views/admin/DockerImagesView.vue | 43 +++++++++++++------ 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/frontend/src/assets/lang/app/en.json b/frontend/src/assets/lang/app/en.json index 230ff37e..799bee45 100644 --- a/frontend/src/assets/lang/app/en.json +++ b/frontend/src/assets/lang/app/en.json @@ -231,6 +231,8 @@ "admin": { "title": "Admin", "keyword": "Keyword", + "list": "List", + "add": "Add", "search": { "search": "Search", "general": "Search by general keyword" @@ -261,7 +263,8 @@ "catalog": "Catalog", "docker_images": { "title": "Docker images", - "name": "Name docker image" + "name": "Name of docker image", + "public": "Public" } }, "primevue": { diff --git a/frontend/src/assets/lang/app/nl.json b/frontend/src/assets/lang/app/nl.json index 460a77be..ee55eb4d 100644 --- a/frontend/src/assets/lang/app/nl.json +++ b/frontend/src/assets/lang/app/nl.json @@ -231,6 +231,8 @@ "admin": { "title": "Beheerder", "keyword": "Trefwoord", + "list": "Lijst", + "add": "Voeg toe", "search": { "search": "Zoeken", "general": "Zoek op algemeen trefwoord" @@ -261,7 +263,8 @@ "catalog": "Catalogus", "docker_images": { "title": "Docker images", - "name": "Naam docker image" + "name": "Naam van docker image", + "public": "Publiek" } }, "primevue": { diff --git a/frontend/src/views/admin/DockerImagesView.vue b/frontend/src/views/admin/DockerImagesView.vue index 7cb91f01..c2315a56 100644 --- a/frontend/src/views/admin/DockerImagesView.vue +++ b/frontend/src/views/admin/DockerImagesView.vue @@ -1,6 +1,8 @@ @@ -43,19 +36,22 @@ const upload = async (event: FileUploadUploaderEvent): Promise => {
- +
- -
+ +
- +
Date: Thu, 25 Apr 2024 21:05:24 +0200 Subject: [PATCH 09/19] chore: add search endpoint in frontend + abstract the lazy data table #369 --- .../src/components/admin/LazyDataTable.vue | 86 +++++++++++++++++++ frontend/src/config/endpoints.ts | 1 + 2 files changed, 87 insertions(+) create mode 100644 frontend/src/components/admin/LazyDataTable.vue diff --git a/frontend/src/components/admin/LazyDataTable.vue b/frontend/src/components/admin/LazyDataTable.vue new file mode 100644 index 00000000..e54560e7 --- /dev/null +++ b/frontend/src/components/admin/LazyDataTable.vue @@ -0,0 +1,86 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/config/endpoints.ts b/frontend/src/config/endpoints.ts index f7dcabf3..300b3b96 100644 --- a/frontend/src/config/endpoints.ts +++ b/frontend/src/config/endpoints.ts @@ -20,6 +20,7 @@ export const endpoints = { }, dockerImages: { index: '/api/docker-images/', + search: '/api/docker-images/search', }, students: { index: '/api/students/', From 0917094c6a296bfa1ca26d506e32ec2c667f00fa Mon Sep 17 00:00:00 2001 From: bsilkyn Date: Thu, 25 Apr 2024 22:32:02 +0200 Subject: [PATCH 10/19] chore: fully fix abstract Lazy Paginator Data Table and adjust UsersView.vue --- .../src/components/admin/LazyDataTable.vue | 58 +++++++++---- frontend/src/views/admin/UsersView.vue | 87 +++---------------- 2 files changed, 54 insertions(+), 91 deletions(-) diff --git a/frontend/src/components/admin/LazyDataTable.vue b/frontend/src/components/admin/LazyDataTable.vue index e54560e7..79e0591b 100644 --- a/frontend/src/components/admin/LazyDataTable.vue +++ b/frontend/src/components/admin/LazyDataTable.vue @@ -1,52 +1,75 @@ diff --git a/frontend/src/views/admin/UsersView.vue b/frontend/src/views/admin/UsersView.vue index 0d97de75..3a35e1c6 100644 --- a/frontend/src/views/admin/UsersView.vue +++ b/frontend/src/views/admin/UsersView.vue @@ -11,14 +11,14 @@ import MultiSelect from 'primevue/multiselect'; import AdminLayout from '@/components/layout/admin/AdminLayout.vue'; import Title from '@/components/layout/Title.vue'; import Body from '@/components/layout/Body.vue'; -import { ref, onMounted, watch, computed } from 'vue'; +import LazyDataTable from '@/components/admin/LazyDataTable.vue'; +import { ref, onMounted, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useUser } from '@/composables/services/users.service.ts'; import { useStudents } from '@/composables/services/student.service.ts'; import { useAssistant } from '@/composables/services/assistant.service.ts'; import { useTeacher } from '@/composables/services/teacher.service.ts'; import { useFilter } from '@/composables/filters/filter.ts'; -import { usePaginator } from '@/composables/filters/paginator.ts'; import { roles, type Role, User } from '@/types/users/User.ts'; import { getUserFilters } from '@/types/filter/Filter.ts'; @@ -32,31 +32,10 @@ const { createStudent, deleteStudent } = useStudents(); const { createAssistant, deleteAssistant } = useAssistant(); const { createTeacher, deleteTeacher } = useTeacher(); const { filter, onFilter } = useFilter(getUserFilters(query)); -const { page, first, pageSize, onPaginate, resetPagination } = usePaginator(); onMounted(async () => { fillCreators(); fillDestroyers(); - - onPaginate(fetchUsers); - - watch( - filter, - () => { - loading.value = true; - }, - { deep: true }, - ); - - onFilter(fetchUsers); - - onFilter( - async () => { - await resetPagination([pagination]); - }, - 0, - false, - ); }); const creators = ref Promise>>({}); @@ -64,9 +43,7 @@ const createFunctions = ref Promise>>([createStudent, const destroyers = ref Promise>>({}); const destroyFunctions = ref Promise>>([deleteStudent, deleteAssistant, deleteTeacher]); -const loading = ref(false); -const selectedUsers = ref(); -const selectAll = ref(false); +const dataTable = ref() const editItem = ref(User.blankUser()); const popupEdit = ref(false); @@ -93,32 +70,6 @@ const fillDestroyers = (): void => { destroyers.value[role] = destroyFunctions.value[i - 1]; } }; -const fetchUsers = async (): Promise => { - loading.value = true; - await searchUsers(filter.value, page.value, pageSize.value).then(() => { - loading.value = false; - }); -}; -const onSelectAllChange = (event: DataTableSelectAllChangeEvent): void => { - selectAll.value = event.checked; - - if (selectAll.value) { - getUsers().then(() => { - selectAll.value = true; - selectedUsers.value = users.value; - }); - } else { - selectAll.value = false; - selectedUsers.value = []; - } -}; -const onRowSelect = (): void => { - selectAll.value = selectedUsers.value.length === (pagination.value?.count ?? 0); -}; -const onRowUnselect = (): void => { - selectAll.value = false; -}; - const showPopup = (data: any): void => { editItem.value = JSON.parse(JSON.stringify(data)); // I do this to get a deep copy of the role array popupEdit.value = true; @@ -169,7 +120,8 @@ const saveItem = async (): Promise => { // update admin status await toggleAdmin(editItem.value.id, editItem.value.is_staff); // update locally - await fetchUsers(); + console.log(dataTable.value); + await dataTable.value.fetch(); } else { // raise error TODO } @@ -184,25 +136,14 @@ const saveItem = async (): Promise => {
- + - +
From a28f92cc76ab4a53186961f74783c91005587a51 Mon Sep 17 00:00:00 2001 From: bsilkyn Date: Thu, 25 Apr 2024 22:52:06 +0200 Subject: [PATCH 11/19] chore: frontend listing of docker images #369 --- .../src/components/admin/LazyDataTable.vue | 2 + .../composables/services/docker.service.ts | 12 +++- frontend/src/types/filter/Filter.ts | 17 +++++- frontend/src/views/admin/DockerImagesView.vue | 58 +++++++++++++++---- frontend/src/views/admin/UsersView.vue | 2 - 5 files changed, 77 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/admin/LazyDataTable.vue b/frontend/src/components/admin/LazyDataTable.vue index 79e0591b..14c49b06 100644 --- a/frontend/src/components/admin/LazyDataTable.vue +++ b/frontend/src/components/admin/LazyDataTable.vue @@ -4,6 +4,7 @@ import { onMounted, watch, ref, defineExpose, toRef } from "vue"; import { PaginatorResponse } from '@/types/filter/Paginator.ts' import { usePaginator } from '@/composables/filters/paginator.ts'; import { Filter } from "@/types/filter/Filter.ts"; +import Column from "primevue/column"; /* Properties */ const props = defineProps<{ @@ -98,6 +99,7 @@ defineExpose({fetch}) +
diff --git a/frontend/src/composables/services/docker.service.ts b/frontend/src/composables/services/docker.service.ts index 869d6528..a15a785d 100644 --- a/frontend/src/composables/services/docker.service.ts +++ b/frontend/src/composables/services/docker.service.ts @@ -3,13 +3,15 @@ import { Response } from "@/types/Response.ts"; import { endpoints } from '@/config/endpoints.ts'; import { type Ref, ref } from "vue"; import { Filter } from "@/types/filter/Filter.ts"; -import { create, getPaginatedList } from "@/composables/services/helpers.ts"; +import {create, getList, getPaginatedList} from "@/composables/services/helpers.ts"; import {PaginatorResponse} from "@/types/filter/Paginator.ts"; interface DockerImagesState { pagination: Ref | null>; + dockerImages: Ref; response: Ref; + getDockerImages: () => Promise; searchDockerImages: (filters: Filter, page: number, pageSize: number) => Promise; createDockerImage: (dockerData: DockerImage, file: File) => Promise; } @@ -17,8 +19,14 @@ interface DockerImagesState { export function useDockerImages(): DockerImagesState { const pagination = ref | null>(null); + const dockerImages = ref(null); const response = ref(null); + async function getDockerImages(): Promise { + const endpoint = endpoints.dockerImages.index; + await getList(endpoint, dockerImages, DockerImage.fromJSON); + } + async function searchDockerImages(filters: Filter, page: number, pageSize: number): Promise { const endpoint = endpoints.dockerImages.search; await getPaginatedList(endpoint, filters, page, pageSize, pagination, DockerImage.fromJSON); @@ -41,8 +49,10 @@ export function useDockerImages(): DockerImagesState { return { pagination, + dockerImages, response, + getDockerImages, searchDockerImages, createDockerImage } diff --git a/frontend/src/types/filter/Filter.ts b/frontend/src/types/filter/Filter.ts index 10358711..1ffe8508 100644 --- a/frontend/src/types/filter/Filter.ts +++ b/frontend/src/types/filter/Filter.ts @@ -1,4 +1,4 @@ -import { type LocationQuery } from 'vue-router'; +import {type LocationQuery} from 'vue-router'; export type UserFilter = { id: string; @@ -14,6 +14,12 @@ export type CourseFilter = { years: string[]; } & Filter; +export type DockerImageFilter = { + id: string; + name: string; + owner: string; +} & Filter + export interface Filter { search: string; [key: string]: string | string[]; @@ -69,6 +75,15 @@ export function getCourseFilters(query: LocationQuery): CourseFilter { return filters; } +export function getDockerImageFilters(query:LocationQuery): DockerImageFilter { + return { + search: query.search?.toString() ?? '', + id: query.id?.toString() ?? '', + name: query.id?.toString() ?? '', + owner: query.id?.toString() ?? '', + }; +} + /** * Get the query list. * diff --git a/frontend/src/views/admin/DockerImagesView.vue b/frontend/src/views/admin/DockerImagesView.vue index 0a851ca0..02d7b639 100644 --- a/frontend/src/views/admin/DockerImagesView.vue +++ b/frontend/src/views/admin/DockerImagesView.vue @@ -1,5 +1,4 @@ - \ No newline at end of file + diff --git a/frontend/src/composables/services/docker.service.ts b/frontend/src/composables/services/docker.service.ts index 9df017d7..f6a7806f 100644 --- a/frontend/src/composables/services/docker.service.ts +++ b/frontend/src/composables/services/docker.service.ts @@ -1,11 +1,10 @@ import { DockerImage } from '@/types/DockerImage.ts'; -import { Response } from "@/types/Response.ts"; +import { Response } from '@/types/Response.ts'; import { endpoints } from '@/config/endpoints.ts'; -import { type Ref, ref } from "vue"; -import { Filter } from "@/types/filter/Filter.ts"; -import {create, getList, getPaginatedList, patch} from "@/composables/services/helpers.ts"; -import {PaginatorResponse} from "@/types/filter/Paginator.ts"; - +import { type Ref, ref } from 'vue'; +import { type Filter } from '@/types/filter/Filter.ts'; +import { create, getList, getPaginatedList, patch } from '@/composables/services/helpers.ts'; +import { type PaginatorResponse } from '@/types/filter/Paginator.ts'; interface DockerImagesState { pagination: Ref | null>; @@ -17,7 +16,6 @@ interface DockerImagesState { createDockerImage: (dockerData: DockerImage, file: File) => Promise; } - export function useDockerImages(): DockerImagesState { const pagination = ref | null>(null); const dockerImages = ref(null); @@ -35,7 +33,7 @@ export function useDockerImages(): DockerImagesState { async function patchDockerImage(dockerData: DockerImage): Promise { const endpoint = endpoints.dockerImages.patch.replace('{id}', dockerData.id); - await patch(endpoint, {public: dockerData.public}, response); + await patch(endpoint, { public: dockerData.public }, response); } async function createDockerImage(dockerData: DockerImage, file: File): Promise { @@ -43,9 +41,9 @@ export function useDockerImages(): DockerImagesState { await create( endpoint, { - file: file, + file, name: dockerData.name, - public: dockerData.public + public: dockerData.public, }, response, Response.fromJSON, @@ -61,6 +59,6 @@ export function useDockerImages(): DockerImagesState { getDockerImages, searchDockerImages, patchDockerImage, - createDockerImage - } + createDockerImage, + }; } diff --git a/frontend/src/types/DockerImage.ts b/frontend/src/types/DockerImage.ts index 296dc774..9d82a49f 100644 --- a/frontend/src/types/DockerImage.ts +++ b/frontend/src/types/DockerImage.ts @@ -11,13 +11,7 @@ export class DockerImage { } static fromJSON(dockerData: DockerImage): DockerImage { - return new DockerImage( - dockerData.id, - dockerData.name, - dockerData.file, - dockerData.public, - dockerData.owner - ); + return new DockerImage(dockerData.id, dockerData.name, dockerData.file, dockerData.public, dockerData.owner); } static blankDockerImage(): DockerImage { diff --git a/frontend/src/types/filter/Filter.ts b/frontend/src/types/filter/Filter.ts index 7fed5128..59236fd3 100644 --- a/frontend/src/types/filter/Filter.ts +++ b/frontend/src/types/filter/Filter.ts @@ -1,4 +1,4 @@ -import {type LocationQuery} from 'vue-router'; +import { type LocationQuery } from 'vue-router'; export type UserFilter = { id: string; @@ -18,7 +18,7 @@ export type DockerImageFilter = { id: string; name: string; owner: string; -} & Filter +} & Filter; export interface Filter { search: string; @@ -80,7 +80,7 @@ export function getCourseFilters(query: LocationQuery): CourseFilter { * * @param query */ -export function getDockerImageFilters(query:LocationQuery): DockerImageFilter { +export function getDockerImageFilters(query: LocationQuery): DockerImageFilter { return { search: query.search?.toString() ?? '', id: query.id?.toString() ?? '', diff --git a/frontend/src/views/admin/DockerImagesView.vue b/frontend/src/views/admin/DockerImagesView.vue index 0176e776..22ff516e 100644 --- a/frontend/src/views/admin/DockerImagesView.vue +++ b/frontend/src/views/admin/DockerImagesView.vue @@ -11,20 +11,21 @@ import Title from '@/components/layout/Title.vue'; import Body from '@/components/layout/Body.vue'; import LazyDataTable from '@/components/admin/LazyDataTable.vue'; import { useDockerImages } from '@/composables/services/docker.service.ts'; -import { useFilter } from "@/composables/filters/filter.ts"; +import { useFilter } from '@/composables/filters/filter.ts'; import { useI18n } from 'vue-i18n'; import { ref } from 'vue'; -import { useRoute } from "vue-router"; -import { DockerImage } from "@/types/DockerImage.ts"; -import { getDockerImageFilters } from "@/types/filter/Filter.ts"; -import InputIcon from "primevue/inputicon"; -import Column from "primevue/column"; -import IconField from "primevue/iconfield"; +import { useRoute } from 'vue-router'; +import { DockerImage } from '@/types/DockerImage.ts'; +import { getDockerImageFilters } from '@/types/filter/Filter.ts'; +import InputIcon from 'primevue/inputicon'; +import Column from 'primevue/column'; +import IconField from 'primevue/iconfield'; /* Injection */ const { t } = useI18n(); const { query } = useRoute(); -const { pagination, dockerImages, getDockerImages, searchDockerImages, patchDockerImage, createDockerImage } = useDockerImages(); +const { pagination, dockerImages, getDockerImages, searchDockerImages, patchDockerImage, createDockerImage } = + useDockerImages(); const { filter, onFilter } = useFilter(getDockerImageFilters(query)); const dataTable = ref(); @@ -39,11 +40,10 @@ const columns = ref([ { field: 'id', header: 'admin.id' }, { field: 'name', header: 'admin.docker_images.name' }, { field: 'owner', header: 'admin.docker_images.owner' }, - ]); -const publicOptions = ref<{ value: any, label: string }[]>([ - {value: true, label: 'public'}, - {value: false, label: 'private'} +const publicOptions = ref>([ + { value: true, label: 'public' }, + { value: false, label: 'private' }, ]); const showSafetyGuard = ref(false); @@ -79,7 +79,8 @@ const upload = async (event: FileUploadUploaderEvent): Promise => { :search="searchDockerImages" :filter="filter" :on-filter="onFilter" - ref="dataTable"> + ref="dataTable" + >