initial commit

This commit is contained in:
2025-02-12 22:13:31 +01:00
commit 047b2e9f4a
52 changed files with 8552 additions and 0 deletions

View File

@ -0,0 +1,60 @@
<script setup lang="ts">
import { ref } from 'vue';
import Button from 'primevue/button';
import { invoke } from '@tauri-apps/api/core';
import { open } from '@tauri-apps/plugin-shell';
import ModTitlecard from './ModTitlecard.vue';
import { ModEntry } from '../types';
const emit = defineEmits(['updated']);
const props = defineProps({
mod: Object as () => ModEntry,
isLocal: Boolean,
});
const isLoading = ref(false);
const handlePackageButton = async () => {
isLoading.value = true;
if (!props.isLocal) {
await invoke('download_package', { pkg: props.mod });
} else {
await invoke('delete_package', {
namespace: props.mod?.namespace,
name: props.mod?.name,
});
}
await invoke('reload_packages');
emit('updated');
isLoading.value = false;
};
</script>
<template>
<ModTitlecard :mod="mod" showNamespace />
<Button
rounded
:icon="isLocal ? 'pi pi-trash' : 'pi pi-plus'"
:severity="isLocal ? 'danger' : 'success'"
aria-label="install"
size="small"
class="self-center"
style="width: 2rem; height: 2rem"
:loading="isLoading"
v-on:click="handlePackageButton()"
/>
<Button
rounded
icon="pi pi-external-link"
severity="info"
aria-label="storepage"
size="small"
class="self-center ml-2"
style="width: 2rem; height: 2rem"
v-on:click="open(mod?.package_url ?? '')"
/>
</template>
<style lang="scss">
@import 'primeicons/primeicons.css';
</style>