feat: start checks

This commit is contained in:
2025-03-16 17:55:38 +00:00
parent 08d6a2a2fe
commit 8d55e92fc9
26 changed files with 456 additions and 211 deletions

View File

@ -1,21 +1,25 @@
<script setup lang="ts">
import { ref } from 'vue';
import { computed, ref } from 'vue';
import Button from 'primevue/button';
import Fieldset from 'primevue/fieldset';
import ModListEntry from './ModListEntry.vue';
import { usePkgStore } from '../stores';
import ModTitlecard from './ModTitlecard.vue';
import { usePkgStore, usePrfStore } from '../stores';
import { Package } from '../types';
const props = defineProps({
search: String,
});
const pkg = usePkgStore();
const pkgs = usePkgStore();
const prf = usePrfStore();
const empty = ref(true);
const group = () => {
const a = Object.assign(
{},
Object.groupBy(
pkg.allLocal
pkgs.allLocal
.filter(
(p) =>
props.search === undefined ||
@ -34,9 +38,36 @@ const group = () => {
empty.value = Object.keys(a).length === 0;
return a;
};
const missing = computed(() => {
return prf.current?.mods.filter((m) => !pkgs.hasLocal(m));
});
</script>
<template>
<Fieldset legend="Missing" v-if="(missing?.length ?? 0) > 0">
<div class="flex items-center" v-for="p in missing">
<ModTitlecard
show-namespace
:pkg="
{
namespace: p.split('-')[0],
name: p.split('-')[1],
} as Package
"
/>
<Button
rounded
icon="pi pi-minus"
severity="danger"
aria-label="install"
size="small"
class="self-center ml-4"
style="width: 2rem; height: 2rem"
v-on:click="prf.togglePkg(p, false)"
/>
</div>
</Fieldset>
<Fieldset v-for="(namespace, key) in group()" :legend="key.toString()">
<ModListEntry v-for="p in namespace" :pkg="p" />
</Fieldset>