something i dont know

This commit is contained in:
emirsassan 2025-06-14 12:32:55 +03:00
parent 7a25c017e6
commit ed0da96040
4 changed files with 7 additions and 53 deletions

View file

@ -2,7 +2,6 @@ import type { Model } from '@/bindings.gen';
import DefaultBanner from '@/assets/images/default_banner.png';
import DefaultInstancePhoto from '@/assets/images/default_instance_cover.jpg';
import { NewClusterCreate } from '@/components/launcher/cluster/ClusterCreation';
import { NewClusterCreate } from '@/components/launcher/cluster/ClusterCreation';
import Modal from '@/components/overlay/Modal';
import useRecentCluster from '@/hooks/useCluster';
import { bindings } from '@/main';
@ -11,7 +10,6 @@ import { useCommand } from '@onelauncher/common';
import { Button, Show, TextField } from '@onelauncher/common/components';
import { createFileRoute, Link } from '@tanstack/react-router';
import { PlayIcon, Server01Icon } from '@untitled-theme/icons-react';
import { PlayIcon, Server01Icon } from '@untitled-theme/icons-react';
import { OverlayScrollbarsComponent } from 'overlayscrollbars-react';
export const Route = createFileRoute('/app/')({
@ -165,18 +163,6 @@ function ClusterCard({
console.error(launch.error.message);
};
const launch = useCommand('launchCluster', () => bindings.core.launchCluster(id, null), {
enabled: false,
subscribed: false,
});
const handleLaunch = () => {
launch.refetch();
if (launch.error)
console.error(launch.error.message);
};
return (
<>
<Link
@ -204,37 +190,6 @@ function ClusterCard({
{mc_loader}
{' '}
{mc_version}
{/* {' '}
<>
<Link
search={{
id,
}} to="/app/cluster"
>
<div
className="group relative h-[152px] flex flex-col rounded-xl border border-component-border/5 bg-component-bg active:bg-component-bg-pressed hover:bg-component-bg-hover"
>
<div className="relative flex-1 overflow-hidden rounded-t-xl">
<div
className="absolute h-full w-full transition-transform group-hover:!scale-110"
>
<img
className="h-full w-full object-cover"
src={DefaultInstancePhoto}
/>
</div>
</div>
<div className="z-10 flex flex-row items-center justify-between gap-x-3 p-3">
<div className="h-full flex flex-col gap-1.5 overflow-hidden">
<p className="h-4 text-ellipsis whitespace-nowrap font-medium">{name}</p>
<p className="h-4 text-xs">
{mc_loader}
{' '}
{mc_version}
{/* {' '}
{props.packages.mods && `• ${props.mods} mods`} */}
</p>
</div>
</p>
</div>

View file

@ -122,10 +122,6 @@ impl TauriLauncherApi for TauriLauncherApiImpl {
async fn update_cluster_by_id(id: ClusterId, request: clusters::ActiveModel) -> LauncherResult<()> {
let updated_cluster = api::cluster::dao::update_cluster_by_id(id, |mut active_model| async move {
if let Some(name) = request.name {
active_model.name = Set(name);
}
active_model.updated_at = Set(chrono::Utc::now().naive_utc());
Ok(active_model)

View file

@ -41,5 +41,8 @@
"vite": "^6.1.0",
"vite-plugin-dts": "^4.5.4",
"vite-plugin-static-copy": "^3.0.0"
},
"dependencies": {
"@untitled-theme/icons-react": "^0.14.0"
}
}

View file

@ -1,7 +1,7 @@
import path from 'node:path';
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import { defineConfig, normalizePath } from 'vite';
import dts from 'vite-plugin-dts';
import { viteStaticCopy } from 'vite-plugin-static-copy';
@ -12,7 +12,7 @@ export default defineConfig({
viteStaticCopy({
targets: [
{
src: path.resolve(__dirname, 'src/theme.css'),
src: normalizePath(path.resolve(__dirname, 'src/theme.css')),
dest: './',
},
],
@ -25,8 +25,8 @@ export default defineConfig({
minify: false,
lib: {
entry: {
'index': path.resolve(__dirname, 'src/index.ts'),
'components': path.resolve(__dirname, 'src/components/index.ts'),
index: path.resolve(__dirname, 'src/index.ts'),
components: path.resolve(__dirname, 'src/components/index.ts'),
},
formats: ['es'],
fileName: (_, entryName) => `${entryName}.js`,