From: Michael Tremer Date: Mon, 7 Jul 2025 16:02:45 +0000 (+0000) Subject: frontend: Create a separate type for the shorter package listing X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f507f80fe37600c9cf35de0b02bd52ba60f4e17c;p=pbs.git frontend: Create a separate type for the shorter package listing Signed-off-by: Michael Tremer --- diff --git a/frontend/src/api/packages.ts b/frontend/src/api/packages.ts index 11450ff8..11eeec1e 100644 --- a/frontend/src/api/packages.ts +++ b/frontend/src/api/packages.ts @@ -1,15 +1,107 @@ import api from "@/api" +export interface PackageSummary { + // Name + name: string; + + // Summary + summary: string; +} + export interface Package { // Name name: string; + // NEVRA + nevra: string; + + // EVR + evr: string; + + // Arch + arch: string; + + // UUID + uuid: string; + // Summary summary: string; + + // Description + description: string; + + // License + license: string; + + // Groups + groups: string[]; + + // URL + url: string; + + // Packager + packager: string; + + // Build Arches + build_arches: string[]; + + // (Installed) Size + size: number; + + // Filesize + filesize: number; + + // Dependencies + prerequires: string[]; + requires: string[]; + provides: string[]; + conflicts: string[]; + obsoletes: string[]; + suggests: string[]; + recommends: string[]; + + // Build ID + build_id: string; + + // Build Host + build_host: string; + + // Build Time + build_time: Date; +} + +export interface File { + // Path + path: string; + + // Mode + mode: number; + + // Ownership + uname: string; + gname: string; + + // Size + size: number; + + // Creation & Modification Time + ctime: Date; + mtime: Date; + + // MIME Type + mimetype: string; + + // Capabilities + capabilities: string[]; + + // Is this a config file? + config: boolean; + + // XXX Add Digests } // Fetch all packages -export async function fetchPackages(): Promise { +export async function fetchPackages(): Promise { const response = await api.get("/v1/packages") return response.data; } diff --git a/frontend/src/views/PackagesView.vue b/frontend/src/views/PackagesView.vue index be955d60..5347cd61 100644 --- a/frontend/src/views/PackagesView.vue +++ b/frontend/src/views/PackagesView.vue @@ -2,14 +2,14 @@ import { onMounted, ref } from "vue"; // API - import type { Package } from "@/api/packages"; + import type { PackageSummary } from "@/api/packages"; import { fetchPackages } from "@/api/packages"; // Components import Section from "@/components/Section.vue"; // Create a list with all packages - const packages = ref([]); + const packages = ref([]); // Fetch all packages on load onMounted(async () => {