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

@ -4,12 +4,14 @@ import Button from 'primevue/button';
import ToggleSwitch from 'primevue/toggleswitch';
import { open } from '@tauri-apps/plugin-shell';
import InstallButton from './InstallButton.vue';
import LinkButton from './LinkButton.vue';
import ModTitlecard from './ModTitlecard.vue';
import UpdateButton from './UpdateButton.vue';
import { usePrfStore } from '../stores';
import { usePkgStore, usePrfStore } from '../stores';
import { Package } from '../types';
const prf = usePrfStore();
const pkgs = usePkgStore();
const props = defineProps({
pkg: Object as () => Package,
@ -27,13 +29,14 @@ const model = computed({
<template>
<div class="flex items-center">
<ModTitlecard showVersion :pkg="pkg" />
<ModTitlecard show-version show-icon show-description :pkg="pkg" />
<UpdateButton :pkg="pkg" />
<!-- @vue-expect-error Can't 'as any' because it breaks VSCode -->
<ToggleSwitch
v-if="pkg?.loc?.kind === 'Mod' || pkg?.loc?.kind === 'Unsupported'"
class="scale-[1.33] shrink-0"
inputId="switch"
:disabled="!pkg?.loc"
:disabled="pkg!.loc!.kind === 'Unsupported'"
v-model="model"
/>
<InstallButton :pkg="pkg" />
@ -47,17 +50,7 @@ const model = computed({
style="width: 2rem; height: 2rem"
v-on:click="pkg?.loc && open(pkg.loc.path ?? '')"
/>
<Button
v-if="pkg?.rmt"
rounded
icon="pi pi-external-link"
severity="info"
aria-label="delete"
size="small"
class="ml-2 shrink-0"
style="width: 2rem; height: 2rem"
v-on:click="open(pkg.rmt.package_url ?? '')"
/>
<LinkButton v-if="pkgs.networkStatus === 'online'" :pkg="pkg" />
</div>
</template>