feat: start checks
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user