feat: initialize Infra Manager with React, Tailwind CSS, and Inertia.js

- Added main application entry point (app.jsx) and bootstrap file for React setup.
- Created Wiki index page (Index.jsx) for documentation and file management.
- Implemented utility functions for formatting and status handling in utils.js.
- Set up Blade template (app.blade.php) for Inertia.js integration.
- Defined API routes for metrics and terminal access in api.php.
- Established console commands for scheduled tasks in console.php.
- Created web routes for various application features including authentication, hypervisors, containers, cloud accounts, security, backups, and wiki management in web.php.
- Developed setup scripts for Windows (setup.ps1) and Linux (setup.sh) environments.
- Configured Tailwind CSS for styling with custom themes and animations in tailwind.config.js.
- Set up Vite for asset bundling and development server in vite.config.js.
This commit is contained in:
I-Fun
2026-04-07 20:29:32 +07:00
commit c649f055d8
126 changed files with 8122 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
import { motion } from 'framer-motion';
import { cn } from '@/lib/utils';
export function ProgressBar({ value, max = 100, className, showLabel = true, color, size = 'md' }) {
const pct = Math.min(100, Math.max(0, (value / max) * 100));
const autoColor = color ?? (
pct >= 90 ? 'red' :
pct >= 70 ? 'yellow' :
pct >= 50 ? 'cyan' : 'green'
);
const colors = {
cyan: { bar: 'bg-cyan-400', glow: 'shadow-[0_0_10px_rgba(0,212,255,0.5)]' },
green: { bar: 'bg-green-400', glow: 'shadow-[0_0_10px_rgba(0,255,136,0.5)]' },
yellow: { bar: 'bg-yellow-400', glow: 'shadow-[0_0_10px_rgba(255,255,0,0.5)]' },
red: { bar: 'bg-red-400', glow: 'shadow-[0_0_10px_rgba(255,45,85,0.5)]' },
purple: { bar: 'bg-purple-400', glow: 'shadow-[0_0_10px_rgba(157,78,221,0.5)]' },
};
const c = colors[autoColor] ?? colors.cyan;
const heights = { sm: 'h-1', md: 'h-1.5', lg: 'h-2' };
return (
<div className={cn('space-y-1', className)}>
{showLabel && (
<div className="flex justify-between text-xs text-white/50">
<span>{Math.round(pct)}%</span>
</div>
)}
<div className={cn('w-full bg-white/10 rounded-full overflow-hidden', heights[size])}>
<motion.div
initial={{ width: 0 }}
animate={{ width: `${pct}%` }}
transition={{ duration: 0.8, ease: 'easeOut' }}
className={cn('h-full rounded-full', c.bar, c.glow)}
/>
</div>
</div>
);
}