Select Server Directory
Scanning: {scanProgress.current_file}
{scanProgress.processed} / {scanProgress.total}Installed Plugins ({plugins.length})
Installed Plugins (0)
No plugins found in this directory.
import { useState, useEffect } from "react"; import { invoke } from "@tauri-apps/api/core"; import { open } from "@tauri-apps/plugin-dialog"; import { listen, UnlistenFn } from "@tauri-apps/api/event"; import { appDataDir } from '@tauri-apps/api/path'; // Import for data directory (if needed frontend side) import "./App.css"; type ServerType = | 'Paper' | 'Spigot' | 'Bukkit' | 'Vanilla' | 'Forge' | 'Fabric' | 'Velocity' | 'BungeeCord' | 'Waterfall' | 'Unknown'; interface ServerInfo { server_type: ServerType; minecraft_version?: string; plugins_directory: string; plugins_count: number; } interface Plugin { name: string; version: string; latest_version?: string; description?: string; authors: string[]; has_update: boolean; api_version?: string; main_class?: string; depend?: string[] | null; soft_depend?: string[] | null; load_before?: string[] | null; commands?: any; permissions?: any; file_path: string; file_hash: string; website?: string; changelog?: string; repository_source?: string; // Add repository source (string for simplicity) repository_id?: string; // Add repository ID repository_url?: string; // URL to the plugin's repository page } interface ScanResult { server_info: ServerInfo; plugins: Plugin[]; } interface ScanProgress { processed: number; total: number; current_file: string; } // --- New Interfaces for Update Events --- interface BulkUpdateProgressPayload { processed: number; total: number; current_plugin_name: string; } interface SingleUpdateResultPayload { original_file_path: string; plugin: Plugin | null; // Updated plugin state or null if check failed but wasn't a panic error: string | null; // Error message if any } // Interface for potential plugin matches for ambiguous plugins interface PotentialPluginMatch { name: string; version: string; repository: string; repository_id: string; page_url: string; description?: string; minecraft_versions: string[]; download_count?: number; } // --- End New Interfaces --- interface PluginDetailsProps { plugin: Plugin; onClose: () => void; } // Get server type icon function getServerTypeIcon(serverType: ServerType): string { switch (serverType) { case 'Paper': return '๐'; case 'Spigot': return '๐'; case 'Bukkit': return '๐ชฃ'; case 'Vanilla': return '๐ง'; case 'Forge': return '๐จ'; case 'Fabric': return '๐งต'; case 'Velocity': return 'โก'; case 'BungeeCord': return '๐'; case 'Waterfall': return '๐'; default: return 'โ'; } } // Get a formatted server type name for display function getServerTypeName(serverType: ServerType): string { return serverType === 'Unknown' ? 'Unknown Server' : serverType; } function PluginDetails({ plugin, onClose }: PluginDetailsProps) { return (
{message}
We found several potential matches for {plugin.name}. Please select the correct one:
Version: {match.version}
{match.description &&{match.description}
}Minecraft Plugin Manager
Scanning: {scanProgress.current_file}
{scanProgress.processed} / {scanProgress.total}No plugins found in this directory.