]> git.ipfire.org Git - pbs.git/commitdiff
frontend: Create a separate type for the shorter package listing
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 7 Jul 2025 16:02:45 +0000 (16:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 7 Jul 2025 16:02:45 +0000 (16:02 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
frontend/src/api/packages.ts
frontend/src/views/PackagesView.vue

index 11450ff8fa1907b029eaf7061aafe10c000a8f75..11eeec1e378591d3e5222afbba5d5efece07d2a5 100644 (file)
 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<Package[]> {
+export async function fetchPackages(): Promise<PackageSummary[]> {
        const response = await api.get("/v1/packages")
        return response.data;
 }
index be955d60eb9a666f2f0f98d918a7eec16904ff55..5347cd61b3d295b56dfebb3144a91be27c2a618d 100644 (file)
@@ -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<Package[]>([]);
+       const packages = ref<PackageSummary[]>([]);
 
        // Fetch all packages on load
        onMounted(async () => {