mirror of
https://github.com/0x5t4l1n/AURHub.git
synced 2026-05-26 19:26:35 +00:00
Not good ui
This commit is contained in:
@@ -1,166 +0,0 @@
|
|||||||
# CLAUDE.md
|
|
||||||
|
|
||||||
# Project Name
|
|
||||||
ArchStore
|
|
||||||
|
|
||||||
# Project Description
|
|
||||||
ArchStore is a lightweight modern package store for Arch Linux.
|
|
||||||
It combines official pacman repositories and the AUR into one clean interface similar to a Play Store.
|
|
||||||
|
|
||||||
Users can:
|
|
||||||
- Search packages
|
|
||||||
- Install packages
|
|
||||||
- View package details
|
|
||||||
- Check updates
|
|
||||||
- Browse categories
|
|
||||||
- Analyze package security
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Goals
|
|
||||||
- Fast and lightweight
|
|
||||||
- Modern UI
|
|
||||||
- Secure package installation
|
|
||||||
- Unified package ecosystem
|
|
||||||
- Beginner friendly
|
|
||||||
- Open source
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Core Features
|
|
||||||
|
|
||||||
## Package Search
|
|
||||||
Search packages from:
|
|
||||||
- pacman repositories
|
|
||||||
- AUR repositories
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Package Information
|
|
||||||
Show:
|
|
||||||
- package name
|
|
||||||
- description
|
|
||||||
- maintainer
|
|
||||||
- dependencies
|
|
||||||
- version
|
|
||||||
- popularity
|
|
||||||
- votes
|
|
||||||
- package size
|
|
||||||
- last updated
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## One Click Install
|
|
||||||
Install packages using:
|
|
||||||
- pacman
|
|
||||||
- paru
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Update Center
|
|
||||||
Show available package updates.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Security Scanner
|
|
||||||
Analyze PKGBUILD files for:
|
|
||||||
- dangerous bash commands
|
|
||||||
- suspicious scripts
|
|
||||||
- hidden downloads
|
|
||||||
- obfuscated code
|
|
||||||
- remote execution attempts
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Tech Stack
|
|
||||||
|
|
||||||
## Frontend
|
|
||||||
- React
|
|
||||||
- TailwindCSS
|
|
||||||
- Vite
|
|
||||||
|
|
||||||
## Backend
|
|
||||||
- Python
|
|
||||||
- FastAPI
|
|
||||||
|
|
||||||
## Database
|
|
||||||
- SQLite
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# APIs
|
|
||||||
|
|
||||||
## AUR RPC
|
|
||||||
https://aur.archlinux.org/rpc/
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Backend Structure
|
|
||||||
|
|
||||||
backend/
|
|
||||||
├── api/
|
|
||||||
├── scanner/
|
|
||||||
├── services/
|
|
||||||
├── database/
|
|
||||||
├── main.py
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Frontend Structure
|
|
||||||
|
|
||||||
frontend/
|
|
||||||
├── src/
|
|
||||||
├── components/
|
|
||||||
├── pages/
|
|
||||||
├── layouts/
|
|
||||||
├── services/
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# UI Style
|
|
||||||
- Dark theme
|
|
||||||
- Minimal interface
|
|
||||||
- Fast navigation
|
|
||||||
- Responsive design
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Future Features
|
|
||||||
- AI malware detection
|
|
||||||
- Verified packages
|
|
||||||
- Package reviews
|
|
||||||
- Package screenshots
|
|
||||||
- Dependency graph
|
|
||||||
- Flatpak support
|
|
||||||
- Snap support
|
|
||||||
- Electron desktop client
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Security Rules
|
|
||||||
- Never execute unknown scripts directly
|
|
||||||
- Always sanitize shell commands
|
|
||||||
- Validate package metadata
|
|
||||||
- Use sandboxed package analysis
|
|
||||||
- Prevent command injection
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Development Commands
|
|
||||||
|
|
||||||
## Backend
|
|
||||||
uvicorn main:app --reload
|
|
||||||
|
|
||||||
## Frontend
|
|
||||||
npm run dev
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Project Vision
|
|
||||||
Create the best lightweight package store experience for Arch Linux users.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Maintainer
|
|
||||||
Aur & Arch 5t4l1n
|
|
||||||
github:0x5t4l1n
|
|
||||||
@@ -1,235 +0,0 @@
|
|||||||
# SKILLS.md
|
|
||||||
|
|
||||||
# Required Skills for ArchStore
|
|
||||||
|
|
||||||
ArchStore is a lightweight package store for Arch Linux that combines pacman repositories and AUR packages into one modern interface.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Core Skills
|
|
||||||
|
|
||||||
## Linux Skills
|
|
||||||
- Arch Linux basics
|
|
||||||
- pacman package manager
|
|
||||||
- AUR package system
|
|
||||||
- PKGBUILD understanding
|
|
||||||
- systemd basics
|
|
||||||
- terminal usage
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Backend Skills
|
|
||||||
|
|
||||||
## Python
|
|
||||||
Required for:
|
|
||||||
- API development
|
|
||||||
- package analysis
|
|
||||||
- backend services
|
|
||||||
|
|
||||||
Topics:
|
|
||||||
- FastAPI
|
|
||||||
- subprocess
|
|
||||||
- async programming
|
|
||||||
- REST APIs
|
|
||||||
- JSON handling
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## FastAPI
|
|
||||||
Required for:
|
|
||||||
- backend API server
|
|
||||||
- frontend communication
|
|
||||||
|
|
||||||
Topics:
|
|
||||||
- routes
|
|
||||||
- API responses
|
|
||||||
- middleware
|
|
||||||
- async endpoints
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Frontend Skills
|
|
||||||
|
|
||||||
## HTML
|
|
||||||
Required for:
|
|
||||||
- page structure
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## CSS
|
|
||||||
Required for:
|
|
||||||
- styling
|
|
||||||
- responsive design
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## TailwindCSS
|
|
||||||
Required for:
|
|
||||||
- modern UI
|
|
||||||
- fast styling
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## JavaScript
|
|
||||||
Required for:
|
|
||||||
- dynamic frontend
|
|
||||||
- API requests
|
|
||||||
|
|
||||||
Topics:
|
|
||||||
- fetch API
|
|
||||||
- async/await
|
|
||||||
- DOM manipulation
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## React
|
|
||||||
Required for:
|
|
||||||
- scalable frontend
|
|
||||||
- reusable components
|
|
||||||
|
|
||||||
Topics:
|
|
||||||
- components
|
|
||||||
- hooks
|
|
||||||
- routing
|
|
||||||
- state management
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Database Skills
|
|
||||||
|
|
||||||
## SQLite
|
|
||||||
Required for:
|
|
||||||
- package cache
|
|
||||||
- saved metadata
|
|
||||||
|
|
||||||
Topics:
|
|
||||||
- CRUD operations
|
|
||||||
- indexing
|
|
||||||
- schema design
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Security Skills
|
|
||||||
|
|
||||||
## Bash Analysis
|
|
||||||
Required for:
|
|
||||||
- PKGBUILD scanning
|
|
||||||
- script analysis
|
|
||||||
|
|
||||||
Topics:
|
|
||||||
- shell commands
|
|
||||||
- bash syntax
|
|
||||||
- command injection detection
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Package Security
|
|
||||||
Required for:
|
|
||||||
- detecting suspicious packages
|
|
||||||
|
|
||||||
Topics:
|
|
||||||
- malicious scripts
|
|
||||||
- obfuscation
|
|
||||||
- unsafe downloads
|
|
||||||
- privilege escalation risks
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# API Skills
|
|
||||||
|
|
||||||
## AUR RPC API
|
|
||||||
https://aur.archlinux.org/rpc/
|
|
||||||
|
|
||||||
Required for:
|
|
||||||
- searching AUR packages
|
|
||||||
- fetching metadata
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# DevOps Skills
|
|
||||||
|
|
||||||
## Git
|
|
||||||
Required for:
|
|
||||||
- version control
|
|
||||||
|
|
||||||
Topics:
|
|
||||||
- commits
|
|
||||||
- branches
|
|
||||||
- pull requests
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Docker
|
|
||||||
Optional but useful for:
|
|
||||||
- sandbox builds
|
|
||||||
- isolated package analysis
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# UI/UX Skills
|
|
||||||
|
|
||||||
Required for:
|
|
||||||
- modern package store experience
|
|
||||||
|
|
||||||
Topics:
|
|
||||||
- dark themes
|
|
||||||
- responsive layouts
|
|
||||||
- minimal UI
|
|
||||||
- accessibility
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Recommended Learning Order
|
|
||||||
|
|
||||||
1. Arch Linux basics
|
|
||||||
2. pacman and AUR
|
|
||||||
3. Python
|
|
||||||
4. FastAPI
|
|
||||||
5. HTML/CSS
|
|
||||||
6. JavaScript
|
|
||||||
7. React
|
|
||||||
8. TailwindCSS
|
|
||||||
9. Security scanning
|
|
||||||
10. Advanced package analysis
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Nice-to-Have Skills
|
|
||||||
|
|
||||||
- Electron
|
|
||||||
- Rust
|
|
||||||
- Go
|
|
||||||
- Redis
|
|
||||||
- PostgreSQL
|
|
||||||
- AI/ML
|
|
||||||
- Malware analysis
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Development Tools
|
|
||||||
|
|
||||||
## Editors
|
|
||||||
- VS Code
|
|
||||||
|
|
||||||
## API Testing
|
|
||||||
- Postman
|
|
||||||
- curl
|
|
||||||
|
|
||||||
## Browser Dev Tools
|
|
||||||
- Firefox Developer Tools
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Future Advanced Skills
|
|
||||||
|
|
||||||
- AI package risk analysis
|
|
||||||
- dependency graph visualization
|
|
||||||
- reproducible builds
|
|
||||||
- package signing verification
|
|
||||||
- CVE integration
|
|
||||||
- container sandboxing
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Final Goal
|
|
||||||
Build a modern lightweight Play Store experience for Arch Linux users.
|
|
||||||
Generated
+44
-3
@@ -8,6 +8,7 @@
|
|||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"framer-motion": "^12.39.0",
|
||||||
"lucide-react": "^1.16.0",
|
"lucide-react": "^1.16.0",
|
||||||
"react": "^19.2.6",
|
"react": "^19.2.6",
|
||||||
"react-dom": "^19.2.6",
|
"react-dom": "^19.2.6",
|
||||||
@@ -1742,6 +1743,33 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/framer-motion": {
|
||||||
|
"version": "12.39.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.39.0.tgz",
|
||||||
|
"integrity": "sha512-+vnLfzrv0MzjLzNl+nvNvR7jdg3q4cxxjz/YvzfifHl0TREtL00cs1RoMTxs+1PzLiEqZGV6gYsBY0oEAYZ24w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"motion-dom": "^12.39.0",
|
||||||
|
"motion-utils": "^12.39.0",
|
||||||
|
"tslib": "^2.4.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@emotion/is-prop-valid": "*",
|
||||||
|
"react": "^18.0.0 || ^19.0.0",
|
||||||
|
"react-dom": "^18.0.0 || ^19.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@emotion/is-prop-valid": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"react": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"react-dom": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/fsevents": {
|
"node_modules/fsevents": {
|
||||||
"version": "2.3.3",
|
"version": "2.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||||
@@ -2289,6 +2317,21 @@
|
|||||||
"url": "https://github.com/sponsors/isaacs"
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/motion-dom": {
|
||||||
|
"version": "12.39.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.39.0.tgz",
|
||||||
|
"integrity": "sha512-Xn7aAcGDhco/JZTXOub64UmaYn73C6J1Po7Fk+8EvkJsNGTqfhon6UJY53vJKXW5v5Zl8HrYsVxv6oPXeGoGLQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"motion-utils": "^12.39.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/motion-utils": {
|
||||||
|
"version": "12.39.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.39.0.tgz",
|
||||||
|
"integrity": "sha512-8nadJAJjTtqRkmRF36FoJTrywK9nnFmnPwnSMyxaOCU7GDjN9RTMJIxx9De8ErM+vpPhMccr/6fo5WciyQLnMQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/ms": {
|
"node_modules/ms": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
@@ -2658,9 +2701,7 @@
|
|||||||
"version": "2.8.1",
|
"version": "2.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||||
"dev": true,
|
"license": "0BSD"
|
||||||
"license": "0BSD",
|
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"node_modules/type-check": {
|
"node_modules/type-check": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
|
|||||||
@@ -8,23 +8,23 @@ export default function PackageCard({ pkg }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="card card-interactive p-3 flex flex-col gap-2 cursor-pointer group"
|
className="card card-interactive package-card p-4 flex flex-col gap-3 cursor-pointer"
|
||||||
onClick={() => navigate(`/package/${pkg.name}`)}
|
onClick={() => navigate(`/package/${pkg.name}`)}
|
||||||
role="button"
|
role="button"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
onKeyDown={(e) => e.key === 'Enter' && navigate(`/package/${pkg.name}`)}
|
onKeyDown={(e) => e.key === 'Enter' && navigate(`/package/${pkg.name}`)}
|
||||||
>
|
>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex items-start justify-between gap-2">
|
<div className="flex items-start justify-between gap-2 min-w-0">
|
||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
<div className="flex items-center gap-1.5">
|
<div className="flex items-center gap-2">
|
||||||
<span className="font-semibold text-[13px] truncate" style={{ color: 'var(--text-primary)' }}>
|
<span className="font-semibold text-[15px] truncate" style={{ color: 'var(--text-primary)' }}>
|
||||||
{pkg.name}
|
{pkg.name}
|
||||||
</span>
|
</span>
|
||||||
{pkg.installed && <CheckCircle size={11} style={{ color: 'var(--green)' }} />}
|
{pkg.installed && <CheckCircle size={13} style={{ color: 'var(--green)' }} />}
|
||||||
{pkg.out_of_date && <AlertTriangle size={11} style={{ color: 'var(--amber)' }} />}
|
{pkg.out_of_date && <AlertTriangle size={13} style={{ color: 'var(--amber)' }} />}
|
||||||
</div>
|
</div>
|
||||||
<span className="text-[10px] font-mono" style={{ color: 'var(--text-tertiary)' }}>
|
<span className="text-[12px] font-mono" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
{pkg.version || '—'}
|
{pkg.version || '—'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -32,7 +32,7 @@ export default function PackageCard({ pkg }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Description */}
|
{/* Description */}
|
||||||
<p className="text-[11px] leading-snug"
|
<p className="text-[13px] leading-relaxed"
|
||||||
style={{
|
style={{
|
||||||
color: pkg.description ? 'var(--text-secondary)' : 'var(--text-tertiary)',
|
color: pkg.description ? 'var(--text-secondary)' : 'var(--text-tertiary)',
|
||||||
fontStyle: pkg.description ? 'normal' : 'italic',
|
fontStyle: pkg.description ? 'normal' : 'italic',
|
||||||
@@ -40,28 +40,28 @@ export default function PackageCard({ pkg }) {
|
|||||||
WebkitLineClamp: 2,
|
WebkitLineClamp: 2,
|
||||||
WebkitBoxOrient: 'vertical',
|
WebkitBoxOrient: 'vertical',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
minHeight: '2em'
|
minHeight: '2.4em'
|
||||||
}}>
|
}}>
|
||||||
{pkg.description || 'No description available'}
|
{pkg.description || 'No description available'}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{/* Footer */}
|
{/* Footer */}
|
||||||
<div className="flex items-center justify-between pt-2 mt-auto"
|
<div className="flex items-center justify-between pt-3 mt-auto"
|
||||||
style={{ borderTop: '1px solid var(--border-primary)' }}>
|
style={{ borderTop: '1px solid var(--border-primary)' }}>
|
||||||
<div className="flex items-center gap-3 text-[10px]" style={{ color: 'var(--text-tertiary)' }}>
|
<div className="flex items-center gap-3 text-[12px]" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
{pkg.votes !== undefined && pkg.votes > 0 && (
|
{pkg.votes !== undefined && pkg.votes > 0 && (
|
||||||
<span className="flex items-center gap-0.5">
|
<span className="flex items-center gap-0.5">
|
||||||
<Star size={10} style={{ color: 'var(--amber)', fill: 'var(--amber)' }} /> {pkg.votes}
|
<Star size={12} style={{ color: 'var(--amber)', fill: 'var(--amber)' }} /> {pkg.votes}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{pkg.popularity > 0 && <span>{pkg.popularity.toFixed(1)}</span>}
|
{pkg.popularity > 0 && <span>{pkg.popularity.toFixed(1)}</span>}
|
||||||
</div>
|
</div>
|
||||||
{pkg.installed ? (
|
{pkg.installed ? (
|
||||||
<span className="badge badge-installed text-[9px]">Installed</span>
|
<span className="badge badge-installed text-[10px]">Installed</span>
|
||||||
) : (
|
) : (
|
||||||
<span className="flex items-center gap-1 text-[10px] font-semibold"
|
<span className="flex items-center gap-1.5 text-[12px] font-semibold"
|
||||||
style={{ color: 'var(--accent)' }}>
|
style={{ color: 'var(--accent)' }}>
|
||||||
<Download size={10} /> Install
|
<Download size={12} /> Install
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,16 +12,15 @@ export default function SearchBar({ onSearch, initialQuery = '' }) {
|
|||||||
return (
|
return (
|
||||||
<form onSubmit={handleSubmit} className="searchbar">
|
<form onSubmit={handleSubmit} className="searchbar">
|
||||||
<Search
|
<Search
|
||||||
size={14}
|
size={18}
|
||||||
className="absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none"
|
className="absolute left-5 top-1/2 -translate-y-1/2 pointer-events-none"
|
||||||
style={{ color: 'var(--text-tertiary)' }}
|
style={{ color: 'var(--text-tertiary)' }}
|
||||||
/>
|
/>
|
||||||
<input
|
<input
|
||||||
id="search-input"
|
id="search-input"
|
||||||
type="text"
|
type="text"
|
||||||
className="input input-search pl-8 pr-4 rounded-lg"
|
className="input input-search pl-14 pr-4 rounded-xl"
|
||||||
style={{ fontSize: '12px' }}
|
placeholder="Search packages, AUR helpers, or categories"
|
||||||
placeholder="Search packages..."
|
|
||||||
value={query}
|
value={query}
|
||||||
onChange={(e) => setQuery(e.target.value)}
|
onChange={(e) => setQuery(e.target.value)}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
|
|||||||
@@ -1,84 +1,127 @@
|
|||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import { Home, Search, Package, RefreshCw, Grid3X3, Settings, X } from 'lucide-react';
|
import { Home, Search, Package, RefreshCw, Grid3X3, Settings, X, Shield, Terminal, Server } from 'lucide-react';
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import api from '../api/client';
|
import api from '../api/client';
|
||||||
|
|
||||||
const navItems = [
|
const navItems = [
|
||||||
{ path: '/', icon: Home, label: 'Home' },
|
{ path: '/', icon: Home, label: 'Dashboard', section: 'Overview' },
|
||||||
{ path: '/search', icon: Search, label: 'Search' },
|
{ path: '/search', icon: Search, label: 'Search Packages', section: 'Manage' },
|
||||||
{ path: '/installed', icon: Package, label: 'Installed' },
|
{ path: '/installed', icon: Package, label: 'Installed', section: 'Manage' },
|
||||||
{ path: '/updates', icon: RefreshCw, label: 'Updates' },
|
{ path: '/updates', icon: RefreshCw, label: 'Updates', section: 'Manage' },
|
||||||
{ path: '/categories', icon: Grid3X3, label: 'Categories' },
|
{ path: '/categories', icon: Grid3X3, label: 'Browse Categories', section: 'Explore' },
|
||||||
{ path: '/settings', icon: Settings, label: 'Settings' },
|
{ path: '/settings', icon: Settings, label: 'Preferences', section: 'System' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function Sidebar({ isOpen, onClose }) {
|
export default function Sidebar({ isOpen, onClose }) {
|
||||||
const [updateCount, setUpdateCount] = useState(0);
|
const [updateCount, setUpdateCount] = useState(0);
|
||||||
|
const [dbSize, setDbSize] = useState('0.0 MB');
|
||||||
|
const [status, setStatus] = useState('Checking...');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// Gather system health and update indicators
|
||||||
api.checkUpdates()
|
api.checkUpdates()
|
||||||
.then(data => setUpdateCount(data.count || 0))
|
.then(data => setUpdateCount(data.count || 0))
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|
||||||
|
api.healthCheck()
|
||||||
|
.then(health => {
|
||||||
|
if (health.status === 'healthy') {
|
||||||
|
setStatus('Healthy');
|
||||||
|
setDbSize(health.database_size || '1.2 MB');
|
||||||
|
} else {
|
||||||
|
setStatus('Degraded');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => setStatus('Offline'));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// Group nav items by section
|
||||||
|
const sections = navItems.reduce((acc, item) => {
|
||||||
|
if (!acc[item.section]) acc[item.section] = [];
|
||||||
|
acc[item.section].push(item);
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<aside className={`sidebar ${isOpen ? 'open' : ''}`}>
|
<aside className={`sidebar ${isOpen ? 'open' : ''}`}>
|
||||||
{/* Brand */}
|
{/* Brand & Logo Header */}
|
||||||
<div className="flex items-center justify-between mb-6 px-1">
|
<div className="flex items-center justify-between mb-8 px-2">
|
||||||
<NavLink to="/" className="flex items-center gap-2.5 no-underline" onClick={onClose}>
|
<NavLink to="/" className="flex items-center gap-3 no-underline" onClick={onClose}>
|
||||||
<div className="w-7 h-7 rounded-lg flex items-center justify-center shrink-0"
|
<div className="w-9 h-9 rounded-lg flex items-center justify-center shrink-0"
|
||||||
style={{
|
style={{ background: 'var(--bg-secondary)', border: '1px solid var(--border-primary)' }}>
|
||||||
background: 'linear-gradient(135deg, var(--accent), var(--violet))',
|
<Terminal size={18} style={{ color: 'var(--accent)' }} />
|
||||||
}}>
|
|
||||||
<span className="text-white font-black text-xs">A</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span className="text-sm font-bold block leading-tight" style={{ color: 'var(--text-primary)' }}>
|
<span className="text-base font-semibold block leading-tight" style={{ color: 'var(--text-primary)' }}>
|
||||||
ArchStore
|
ArchStore
|
||||||
</span>
|
</span>
|
||||||
<span className="text-[10px] leading-tight" style={{ color: 'var(--text-tertiary)' }}>
|
<span className="text-[10px] leading-tight font-semibold uppercase tracking-wide block" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
Package Manager
|
Package Manager
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
<button className="lg:hidden btn-ghost !p-1" onClick={onClose} aria-label="Close">
|
<button className="lg:hidden btn-ghost !p-1.5 rounded-lg" onClick={onClose} aria-label="Close">
|
||||||
<X size={14} />
|
<X size={16} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Nav */}
|
{/* Grouped Sidebar Navigation */}
|
||||||
<nav className="flex flex-col gap-0.5 flex-1">
|
<nav className="flex flex-col gap-5 flex-1 overflow-y-auto pr-1">
|
||||||
<span className="text-[9px] font-bold uppercase tracking-widest px-3 mb-1"
|
{Object.entries(sections).map(([sectionName, items]) => (
|
||||||
|
<div key={sectionName} className="flex flex-col gap-1">
|
||||||
|
<span className="text-[10px] font-semibold uppercase tracking-wide px-3 mb-1"
|
||||||
style={{ color: 'var(--text-tertiary)' }}>
|
style={{ color: 'var(--text-tertiary)' }}>
|
||||||
Navigation
|
{sectionName}
|
||||||
</span>
|
</span>
|
||||||
{navItems.map(({ path, icon: Icon, label }) => (
|
{items.map(({ path, icon: Icon, label }) => (
|
||||||
<NavLink
|
<NavLink
|
||||||
key={path}
|
key={path}
|
||||||
to={path}
|
to={path}
|
||||||
end={path === '/'}
|
end={path === '/'}
|
||||||
className={({ isActive }) => `nav-link ${isActive ? 'active' : ''}`}
|
className={({ isActive }) => `nav-link ${isActive ? 'active' : ''}`}
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
<Icon size={15} strokeWidth={1.8} />
|
<Icon size={18} strokeWidth={1.8} />
|
||||||
<span>{label}</span>
|
<span className="font-medium">{label}</span>
|
||||||
{label === 'Updates' && updateCount > 0 && (
|
{label === 'Updates' && updateCount > 0 && (
|
||||||
<span className="ml-auto text-[10px] font-bold px-1.5 py-px rounded-full"
|
<span className="ml-auto text-[10px] font-semibold px-2 py-0.5 rounded-full"
|
||||||
style={{ background: 'var(--accent)', color: '#fff', minWidth: '18px', textAlign: 'center' }}>
|
style={{ background: 'var(--bg-secondary)', color: 'var(--text-primary)', border: '1px solid var(--border-primary)' }}>
|
||||||
{updateCount}
|
{updateCount}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</NavLink>
|
</NavLink>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
))}
|
))}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{/* Footer */}
|
{/* bottom system status dock */}
|
||||||
<div className="pt-3 mt-2 px-3" style={{ borderTop: '1px solid var(--border-primary)' }}>
|
<div className="pt-4 mt-auto border-t border-[var(--border-primary)] flex flex-col gap-3">
|
||||||
<div className="flex items-center gap-1.5 mb-0.5">
|
<div className="flex items-center justify-between px-2 text-[11px]">
|
||||||
<span className="w-1.5 h-1.5 rounded-full" style={{ background: 'var(--green)' }}></span>
|
<span className="flex items-center gap-1.5" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
<span className="text-[10px]" style={{ color: 'var(--text-tertiary)' }}>System Ready</span>
|
<Server size={11} /> API Service
|
||||||
|
</span>
|
||||||
|
<span className="font-semibold flex items-center gap-1"
|
||||||
|
style={{ color: status === 'Healthy' ? 'var(--green)' : 'var(--red)' }}>
|
||||||
|
<span className="w-1.5 h-1.5 rounded-full" style={{ background: status === 'Healthy' ? 'var(--green)' : 'var(--red)' }}></span>
|
||||||
|
{status}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center justify-between px-2 text-[11px]">
|
||||||
|
<span className="flex items-center gap-1.5" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
|
<Shield size={11} /> Package DB
|
||||||
|
</span>
|
||||||
|
<span className="font-mono" style={{ color: 'var(--text-secondary)' }}>{dbSize}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-2 px-2">
|
||||||
|
<div className="w-2 h-2 rounded-full" style={{ background: 'var(--accent)' }}></div>
|
||||||
|
<div className="flex-1 min-w-0">
|
||||||
|
<p className="text-[10px] font-semibold uppercase tracking-wide" style={{ color: 'var(--text-secondary)' }}>Arch Linux OS</p>
|
||||||
|
<p className="text-[9px] font-mono truncate" style={{ color: 'var(--text-tertiary)' }}>Local Port: 5173</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span className="text-[10px]" style={{ color: 'var(--text-tertiary)' }}>v1.0.0 · Arch Linux</span>
|
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
|
|||||||
+515
-191
@@ -1,97 +1,99 @@
|
|||||||
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap");
|
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap");
|
||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
|
|
||||||
/* ═══════════════════════════════════════════════
|
/* ═══════════════════════════════════════════════
|
||||||
ArchStore — Compact Dev-Tool Design System
|
ArchStore — Premium Desktop App Design System
|
||||||
═══════════════════════════════════════════════ */
|
═══════════════════════════════════════════════ */
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--bg-base: #07090e;
|
--bg-base: #0f1115;
|
||||||
--bg-primary: #0b0f18;
|
--bg-primary: #141820;
|
||||||
--bg-secondary: #101624;
|
--bg-secondary: #1a1f2a;
|
||||||
--bg-tertiary: #161e30;
|
--bg-tertiary: #202636;
|
||||||
--bg-card: #0d1220;
|
--bg-card: #131821;
|
||||||
--bg-card-hover: #111828;
|
--bg-card-hover: #131821;
|
||||||
--bg-elevated: #161e30;
|
--bg-elevated: #1a1f2a;
|
||||||
--bg-input: #0a0e18;
|
--bg-input: #141820;
|
||||||
--bg-sidebar: rgba(11, 15, 24, 0.95);
|
--bg-sidebar: #0d1016;
|
||||||
--bg-overlay: rgba(0, 0, 0, 0.7);
|
--bg-overlay: rgba(0, 0, 0, 0.5);
|
||||||
--topbar-bg: rgba(11, 15, 24, 0.85);
|
--topbar-bg: #0f1218;
|
||||||
|
|
||||||
--border-primary: rgba(255, 255, 255, 0.06);
|
--border-primary: rgba(148, 163, 184, 0.12);
|
||||||
--border-secondary: rgba(255, 255, 255, 0.1);
|
--border-secondary: rgba(148, 163, 184, 0.2);
|
||||||
--border-glow: rgba(56, 189, 248, 0.15);
|
--border-glow: rgba(56, 189, 248, 0.2);
|
||||||
|
|
||||||
--text-primary: #e2e8f0;
|
--text-primary: #e2e8f0;
|
||||||
--text-secondary: #94a3b8;
|
--text-secondary: #cbd5e1;
|
||||||
--text-tertiary: #64748b;
|
--text-tertiary: #94a3b8;
|
||||||
--text-inverse: #0f172a;
|
--text-inverse: #0f172a;
|
||||||
|
|
||||||
--accent: #38bdf8;
|
--accent: #38bdf8;
|
||||||
--accent-hover: #7dd3fc;
|
--accent-hover: #38bdf8;
|
||||||
--accent-muted: rgba(56, 189, 248, 0.1);
|
--accent-muted: rgba(56, 189, 248, 0.12);
|
||||||
--accent-glow: rgba(56, 189, 248, 0.2);
|
--accent-glow: rgba(56, 189, 248, 0.2);
|
||||||
|
|
||||||
--green: #34d399;
|
--green: #22c55e;
|
||||||
--green-muted: rgba(52, 211, 153, 0.1);
|
--green-muted: rgba(34, 197, 94, 0.1);
|
||||||
--amber: #fbbf24;
|
--amber: #f59e0b;
|
||||||
--amber-muted: rgba(251, 191, 36, 0.1);
|
--amber-muted: rgba(245, 158, 11, 0.12);
|
||||||
--red: #f87171;
|
--red: #ef4444;
|
||||||
--red-muted: rgba(248, 113, 113, 0.08);
|
--red-muted: rgba(239, 68, 68, 0.12);
|
||||||
--blue: #60a5fa;
|
--blue: #60a5fa;
|
||||||
--blue-muted: rgba(96, 165, 250, 0.1);
|
--blue-muted: rgba(96, 165, 250, 0.12);
|
||||||
--violet: #a78bfa;
|
--violet: #a78bfa;
|
||||||
--violet-muted: rgba(167, 139, 250, 0.1);
|
--violet-muted: rgba(167, 139, 250, 0.12);
|
||||||
|
|
||||||
--shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
|
--shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.25);
|
||||||
--shadow-md: 0 4px 12px rgba(0,0,0,0.3);
|
--shadow-md: 0 2px 6px rgba(2, 6, 23, 0.25);
|
||||||
--shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
|
--shadow-lg: 0 4px 10px rgba(2, 6, 23, 0.3);
|
||||||
--shadow-glow: 0 0 20px rgba(56,189,248,0.08);
|
--shadow-glow: 0 0 0 rgba(0, 0, 0, 0);
|
||||||
|
|
||||||
--radius-sm: 6px;
|
--radius-sm: 6px;
|
||||||
--radius-md: 8px;
|
--radius-md: 8px;
|
||||||
--radius-lg: 10px;
|
--radius-lg: 10px;
|
||||||
--radius-xl: 14px;
|
--radius-xl: 12px;
|
||||||
|
--radius-2xl: 14px;
|
||||||
--radius-full: 9999px;
|
--radius-full: 9999px;
|
||||||
|
|
||||||
--font-sans: 'Inter', system-ui, -apple-system, sans-serif;
|
--font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
|
||||||
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
|
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
|
||||||
|
|
||||||
--transition-fast: 120ms ease;
|
--transition-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
--transition-normal: 200ms ease;
|
--transition-normal: 240ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
--transition-slow: 380ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.light {
|
.light {
|
||||||
--bg-base: #f1f5f9;
|
--bg-base: #f0f0f1;
|
||||||
--bg-primary: #e2e8f0;
|
--bg-primary: #f6f7f7;
|
||||||
--bg-secondary: #ffffff;
|
--bg-secondary: #ffffff;
|
||||||
--bg-tertiary: #f8fafc;
|
--bg-tertiary: #f6f7f7;
|
||||||
--bg-card: #ffffff;
|
--bg-card: #ffffff;
|
||||||
--bg-card-hover: #f8fafc;
|
--bg-card-hover: #ffffff;
|
||||||
--bg-elevated: #ffffff;
|
--bg-elevated: #ffffff;
|
||||||
--bg-input: #e2e8f0;
|
--bg-input: #ffffff;
|
||||||
--bg-sidebar: rgba(255, 255, 255, 0.95);
|
--bg-sidebar: #1d2327;
|
||||||
--bg-overlay: rgba(15, 23, 42, 0.2);
|
--bg-overlay: rgba(0, 0, 0, 0.2);
|
||||||
--topbar-bg: rgba(255, 255, 255, 0.9);
|
--topbar-bg: #ffffff;
|
||||||
|
|
||||||
--border-primary: rgba(0, 0, 0, 0.06);
|
--border-primary: #c3c4c7;
|
||||||
--border-secondary: rgba(0, 0, 0, 0.1);
|
--border-secondary: #a7aaad;
|
||||||
--border-glow: rgba(2, 132, 199, 0.15);
|
--border-glow: rgba(34, 113, 177, 0.3);
|
||||||
|
|
||||||
--text-primary: #1e293b;
|
--text-primary: #1d2327;
|
||||||
--text-secondary: #475569;
|
--text-secondary: #50575e;
|
||||||
--text-tertiary: #94a3b8;
|
--text-tertiary: #6c7781;
|
||||||
--text-inverse: #f1f5f9;
|
--text-inverse: #ffffff;
|
||||||
|
|
||||||
--accent: #0284c7;
|
--accent: #2271b1;
|
||||||
--accent-hover: #0369a1;
|
--accent-hover: #2271b1;
|
||||||
--accent-muted: rgba(2, 132, 199, 0.08);
|
--accent-muted: rgba(34, 113, 177, 0.12);
|
||||||
--accent-glow: rgba(2, 132, 199, 0.12);
|
--accent-glow: rgba(34, 113, 177, 0.2);
|
||||||
|
|
||||||
--shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
|
--shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.04);
|
||||||
--shadow-md: 0 4px 12px rgba(0,0,0,0.06);
|
--shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08);
|
||||||
--shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
|
--shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.12);
|
||||||
--shadow-glow: 0 0 20px rgba(2,132,199,0.06);
|
--shadow-glow: 0 0 0 rgba(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@theme {
|
@theme {
|
||||||
@@ -130,271 +132,384 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ── Reset ── */
|
/* ── Reset ── */
|
||||||
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
|
*, *::before, *::after {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
animation: none !important;
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-sans);
|
||||||
background: var(--bg-base);
|
background: var(--bg-base);
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
font-size: 13px;
|
font-size: 16px;
|
||||||
line-height: 1.5;
|
line-height: 1.65;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Scrollbar ── */
|
.light body {
|
||||||
::-webkit-scrollbar { width: 4px; height: 4px; }
|
background: var(--bg-base);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Custom Scrollbar ── */
|
||||||
|
::-webkit-scrollbar { width: 8px; height: 8px; }
|
||||||
::-webkit-scrollbar-track { background: transparent; }
|
::-webkit-scrollbar-track { background: transparent; }
|
||||||
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 4px; }
|
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 9999px; }
|
||||||
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
|
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
|
||||||
|
|
||||||
/* ═══════════════════════════════════════════════
|
/* ═══════════════════════════════════════════════
|
||||||
Layout
|
Desktop Shell Layout
|
||||||
═══════════════════════════════════════════════ */
|
═══════════════════════════════════════════════ */
|
||||||
|
|
||||||
.app-layout {
|
.app-layout {
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
background-color: var(--bg-base);
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0; top: 0; bottom: 0;
|
left: 0;
|
||||||
width: 220px;
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 260px;
|
||||||
z-index: 50;
|
z-index: 50;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 16px 12px;
|
padding: 22px 16px;
|
||||||
background: var(--bg-sidebar);
|
background: var(--bg-sidebar);
|
||||||
border-right: 1px solid var(--border-primary);
|
border-right: 1px solid var(--border-primary);
|
||||||
backdrop-filter: blur(16px);
|
backdrop-filter: none;
|
||||||
-webkit-backdrop-filter: blur(16px);
|
-webkit-backdrop-filter: none;
|
||||||
overflow-y: auto;
|
box-shadow: none;
|
||||||
transition: transform 0.2s ease;
|
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.light .sidebar {
|
||||||
|
background: var(--bg-sidebar);
|
||||||
|
border-right: 1px solid #101517;
|
||||||
|
box-shadow: none;
|
||||||
|
backdrop-filter: none;
|
||||||
|
-webkit-backdrop-filter: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content {
|
.main-content {
|
||||||
margin-left: 220px;
|
margin-left: 260px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
background: var(--bg-base);
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-shell {
|
.content-shell {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 1200px;
|
max-width: 100%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0 24px;
|
padding: 0 28px 32px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.topbar {
|
.topbar {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 40;
|
z-index: 40;
|
||||||
display: flex;
|
display: grid;
|
||||||
|
grid-template-columns: auto minmax(320px, 1fr) auto;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 16px;
|
||||||
padding: 10px 24px;
|
padding: 14px 28px;
|
||||||
background: var(--topbar-bg);
|
background: var(--topbar-bg);
|
||||||
border-bottom: 1px solid var(--border-primary);
|
border-bottom: 1px solid var(--border-primary);
|
||||||
backdrop-filter: blur(12px);
|
box-shadow: none;
|
||||||
-webkit-backdrop-filter: blur(12px);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.topbar-search { flex: 1; max-width: 420px; }
|
.topbar-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar-title {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
line-height: 1.1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar-title span:first-child {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text-primary);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar-title span:last-child {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar-search {
|
||||||
|
flex: 1;
|
||||||
|
max-width: none;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topbar-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.page-shell {
|
.page-shell {
|
||||||
padding: 20px 0 32px;
|
padding: 24px 0 32px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1024px) {
|
@media (max-width: 1024px) {
|
||||||
.sidebar { transform: translateX(-100%); }
|
.sidebar { transform: translateX(-100%); }
|
||||||
.sidebar.open { transform: translateX(0); }
|
.sidebar.open { transform: translateX(0); }
|
||||||
.main-content { margin-left: 0; }
|
.main-content { margin-left: 0; }
|
||||||
.content-shell { padding: 0 16px; }
|
.content-shell { padding: 0 16px 24px; }
|
||||||
.topbar { padding: 10px 16px; }
|
.topbar {
|
||||||
|
grid-template-columns: auto 1fr auto;
|
||||||
|
padding: 14px 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Nav Links ── */
|
.app-footer {
|
||||||
|
margin-top: auto;
|
||||||
|
padding: 18px 28px 22px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
border-top: 1px solid var(--border-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Premium Sidebar Nav Links ── */
|
||||||
.nav-link {
|
.nav-link {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 14px;
|
||||||
padding: 7px 12px;
|
padding: 10px 12px;
|
||||||
border-radius: var(--radius-md);
|
border-radius: var(--radius-md);
|
||||||
color: var(--text-tertiary);
|
color: var(--text-secondary);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 13px;
|
font-size: 14px;
|
||||||
font-weight: 500;
|
font-weight: 600;
|
||||||
transition: all var(--transition-fast);
|
transition: none;
|
||||||
|
border: 1px solid transparent;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.nav-link:hover {
|
.nav-link span {
|
||||||
color: var(--text-secondary);
|
min-width: 0;
|
||||||
background: var(--accent-muted);
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
.light .nav-link {
|
||||||
|
color: #c3c4c7;
|
||||||
|
}
|
||||||
|
.light .nav-link:hover {
|
||||||
|
color: #c3c4c7;
|
||||||
|
background: transparent;
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
.light .nav-link.active {
|
||||||
|
color: #ffffff;
|
||||||
|
background: rgba(34, 113, 177, 0.2);
|
||||||
|
border-color: transparent;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
.light .nav-link.active::before {
|
||||||
|
background: var(--accent);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
.nav-link:hover { color: var(--text-secondary); background: transparent; border-color: transparent; }
|
||||||
.nav-link.active {
|
.nav-link.active {
|
||||||
color: var(--accent);
|
color: var(--text-primary);
|
||||||
background: var(--accent-muted);
|
background: rgba(56, 189, 248, 0.14);
|
||||||
font-weight: 600;
|
border-color: var(--border-primary);
|
||||||
|
font-weight: 700;
|
||||||
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
.nav-link.active::before {
|
.nav-link.active::before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0; top: 50%;
|
left: 8px;
|
||||||
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
width: 3px; height: 16px;
|
width: 4px;
|
||||||
|
height: 20px;
|
||||||
|
border-radius: 999px;
|
||||||
background: var(--accent);
|
background: var(--accent);
|
||||||
border-radius: 0 3px 3px 0;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ═══════════════════════════════════════════════
|
/* ═══════════════════════════════════════════════
|
||||||
Cards
|
Glassmorphic Cards
|
||||||
═══════════════════════════════════════════════ */
|
═══════════════════════════════════════════════ */
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
background: var(--bg-card);
|
background: var(--bg-card);
|
||||||
border: 1px solid var(--border-primary);
|
border: 1px solid rgba(148, 163, 184, 0.08);
|
||||||
border-radius: var(--radius-lg);
|
border-radius: var(--radius-md);
|
||||||
transition: all var(--transition-fast);
|
box-shadow: none;
|
||||||
|
transition: none;
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.card-interactive { cursor: pointer; }
|
.card-interactive { cursor: pointer; }
|
||||||
.card-interactive:hover {
|
.card-interactive:hover {
|
||||||
background: var(--bg-card-hover);
|
background: var(--bg-card);
|
||||||
border-color: var(--border-secondary);
|
border-color: rgba(148, 163, 184, 0.08);
|
||||||
box-shadow: var(--shadow-glow);
|
box-shadow: none;
|
||||||
transform: translateY(-1px);
|
transform: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Badges ── */
|
/* ── Badges ── */
|
||||||
.badge {
|
.badge {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 2px 7px;
|
padding: 4px 12px;
|
||||||
border-radius: var(--radius-full);
|
border-radius: var(--radius-full);
|
||||||
font-size: 10px;
|
font-size: 11px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
letter-spacing: 0.04em;
|
letter-spacing: 0.08em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.badge-pacman { background: var(--accent-muted); color: var(--accent); }
|
|
||||||
.badge-aur { background: var(--amber-muted); color: var(--amber); }
|
|
||||||
.badge-installed { background: var(--green-muted); color: var(--green); }
|
|
||||||
|
|
||||||
/* ── Buttons ── */
|
/* ── Desktop Buttons ── */
|
||||||
.btn {
|
.btn {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 6px;
|
gap: 10px;
|
||||||
padding: 6px 14px;
|
padding: 11px 20px;
|
||||||
border-radius: var(--radius-md);
|
border-radius: var(--radius-sm);
|
||||||
font-size: 12px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: 1px solid transparent;
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-sans);
|
||||||
transition: all var(--transition-fast);
|
transition: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||||
|
|
||||||
.btn-primary { background: var(--accent); color: #fff; }
|
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
|
||||||
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 0 12px var(--accent-glow); }
|
.btn-primary:hover:not(:disabled) { background: var(--accent); box-shadow: var(--shadow-sm); transform: none; }
|
||||||
|
|
||||||
.btn-secondary { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border-primary); }
|
.btn-secondary { background: var(--bg-secondary); color: var(--text-secondary); border-color: var(--border-primary); }
|
||||||
.btn-secondary:hover:not(:disabled) { border-color: var(--border-secondary); color: var(--text-primary); }
|
.btn-secondary:hover:not(:disabled) { border-color: var(--border-primary); color: var(--text-secondary); }
|
||||||
|
|
||||||
.btn-danger { background: var(--red-muted); color: var(--red); }
|
.btn-danger { background: var(--red-muted); color: var(--red); border-color: rgba(239, 68, 68, 0.2); }
|
||||||
.btn-danger:hover:not(:disabled) { background: rgba(248,113,113,0.15); }
|
.btn-danger:hover:not(:disabled) { background: var(--red-muted); }
|
||||||
|
|
||||||
.btn-ghost { background: transparent; color: var(--text-tertiary); padding: 6px 10px; }
|
.btn-ghost { background: transparent; color: var(--text-tertiary); }
|
||||||
.btn-ghost:hover:not(:disabled) { color: var(--text-secondary); background: var(--bg-secondary); }
|
.btn-ghost:hover:not(:disabled) { color: var(--text-tertiary); background: transparent; }
|
||||||
|
|
||||||
/* ── Inputs ── */
|
/* ── Form Inputs ── */
|
||||||
.input {
|
.input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 7px 12px;
|
padding: 14px 18px;
|
||||||
background: var(--bg-input);
|
background: var(--bg-input);
|
||||||
border: 1px solid var(--border-primary);
|
border: 1px solid var(--border-primary);
|
||||||
border-radius: var(--radius-md);
|
border-radius: var(--radius-sm);
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-sans);
|
||||||
font-size: 13px;
|
font-size: 14px;
|
||||||
outline: none;
|
outline: none;
|
||||||
transition: all var(--transition-fast);
|
transition: none;
|
||||||
|
}
|
||||||
|
.light .input:focus {
|
||||||
|
box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
|
||||||
}
|
}
|
||||||
.input::placeholder { color: var(--text-tertiary); }
|
.input::placeholder { color: var(--text-tertiary); }
|
||||||
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
|
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
|
||||||
|
|
||||||
.searchbar { width: 100%; position: relative; }
|
.searchbar { width: 100%; position: relative; }
|
||||||
.input-search { height: 34px; padding-top: 0; padding-bottom: 0; }
|
.input-search { height: 46px; font-size: 14px; }
|
||||||
|
|
||||||
/* ── Typography ── */
|
/* ── Typography & Headings ── */
|
||||||
.page-title {
|
.page-title {
|
||||||
font-size: 18px;
|
font-size: 26px;
|
||||||
font-weight: 700;
|
font-weight: 600;
|
||||||
letter-spacing: -0.02em;
|
letter-spacing: -0.01em;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
line-height: 1.3;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
.page-subtitle {
|
.page-subtitle {
|
||||||
font-size: 12px;
|
font-size: 14px;
|
||||||
color: var(--text-tertiary);
|
color: var(--text-secondary);
|
||||||
margin-top: 2px;
|
margin-top: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Grids ── */
|
/* ── Custom Component Grids ── */
|
||||||
.pkg-grid {
|
.pkg-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||||
gap: 10px;
|
gap: 16px;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
.package-card {
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
@media (max-width: 640px) { .pkg-grid { grid-template-columns: 1fr; } }
|
@media (max-width: 640px) { .pkg-grid { grid-template-columns: 1fr; } }
|
||||||
|
|
||||||
.cat-grid {
|
.cat-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||||
gap: 10px;
|
gap: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.update-row {
|
.update-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 10px 14px;
|
padding: 12px 16px;
|
||||||
transition: background var(--transition-fast);
|
transition: none;
|
||||||
}
|
}
|
||||||
.update-row:hover { background: var(--bg-card-hover); }
|
.update-row:hover { background: transparent; }
|
||||||
|
|
||||||
/* ── Utilities ── */
|
/* ── Animation Shimmers ── */
|
||||||
.shimmer {
|
.shimmer {
|
||||||
background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
|
background: var(--bg-tertiary);
|
||||||
background-size: 200% 100%;
|
|
||||||
animation: shimmer-anim 1.5s infinite;
|
|
||||||
border-radius: var(--radius-md);
|
border-radius: var(--radius-md);
|
||||||
}
|
}
|
||||||
@keyframes shimmer-anim {
|
|
||||||
0% { background-position: -200% 0; }
|
|
||||||
100% { background-position: 200% 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
.spinner {
|
.spinner {
|
||||||
width: 20px; height: 20px;
|
width: 24px; height: 24px;
|
||||||
border: 2px solid var(--border-primary);
|
border: 2px solid var(--border-primary);
|
||||||
border-top-color: var(--accent);
|
border-top-color: var(--accent);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
animation: spin-anim 0.6s linear infinite;
|
|
||||||
}
|
}
|
||||||
@keyframes spin-anim { to { transform: rotate(360deg); } }
|
|
||||||
|
|
||||||
.theme-toggle {
|
.theme-toggle {
|
||||||
width: 32px; height: 32px;
|
width: 42px;
|
||||||
|
height: 42px;
|
||||||
border-radius: var(--radius-md);
|
border-radius: var(--radius-md);
|
||||||
background: var(--bg-secondary);
|
background: var(--bg-secondary);
|
||||||
border: 1px solid var(--border-primary);
|
border: 1px solid var(--border-primary);
|
||||||
@@ -402,37 +517,246 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: var(--text-tertiary);
|
color: var(--text-secondary);
|
||||||
transition: all var(--transition-fast);
|
transition: none;
|
||||||
|
}
|
||||||
|
.theme-toggle:hover { border-color: var(--border-primary); color: var(--text-secondary); box-shadow: none; }
|
||||||
|
|
||||||
|
.avatar-button {
|
||||||
|
width: 42px;
|
||||||
|
height: 42px;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border: 1px solid var(--border-primary);
|
||||||
|
color: var(--text-primary);
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
font-size: 12px;
|
||||||
|
box-shadow: var(--shadow-sm);
|
||||||
}
|
}
|
||||||
.theme-toggle:hover { border-color: var(--border-secondary); color: var(--text-primary); }
|
|
||||||
|
|
||||||
.gradient-text {
|
.gradient-text {
|
||||||
background: linear-gradient(135deg, var(--accent), var(--violet));
|
color: var(--accent);
|
||||||
-webkit-background-clip: text;
|
}
|
||||||
-webkit-text-fill-color: transparent;
|
|
||||||
background-clip: text;
|
/* ── Premium Utility Blocks ── */
|
||||||
|
.glass-panel {
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light .glass-panel {
|
||||||
|
background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(244, 247, 251, 0.9));
|
||||||
|
border: 1px solid var(--border-primary);
|
||||||
|
backdrop-filter: none;
|
||||||
|
-webkit-backdrop-filter: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-kicker {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 700;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.2em;
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 800;
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-subtitle {
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi-card {
|
||||||
|
padding: 16px;
|
||||||
|
border-radius: var(--radius-lg);
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border: 1px solid var(--border-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.light .kpi-card {
|
||||||
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi-value {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 800;
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.kpi-label {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pill {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 6px 12px;
|
||||||
|
border-radius: var(--radius-full);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border: 1px solid var(--border-primary);
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.chip {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: var(--radius-full);
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
border: 1px solid var(--border-primary);
|
||||||
|
background: rgba(15, 23, 42, 0.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-dot {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-track {
|
||||||
|
width: 100%;
|
||||||
|
height: 8px;
|
||||||
|
background: rgba(148, 163, 184, 0.12);
|
||||||
|
border-radius: 999px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-bar {
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: var(--radius-lg);
|
||||||
|
overflow: hidden;
|
||||||
|
border: 1px solid var(--border-primary);
|
||||||
|
background: var(--bg-card);
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1024px) {
|
||||||
|
.data-table {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
img, svg {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-head,
|
||||||
|
.table-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 2.5fr 1.2fr 1fr 1.4fr 0.8fr;
|
||||||
|
gap: 16px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 14px 18px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-head span,
|
||||||
|
.table-row span {
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-head {
|
||||||
|
font-size: 11px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.16em;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
background: rgba(15, 23, 42, 0.85);
|
||||||
|
border-bottom: 1px solid var(--border-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-row {
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
border-bottom: 1px solid var(--border-primary);
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-row:hover { background: transparent; }
|
||||||
|
|
||||||
|
.table-row:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1024px) {
|
||||||
|
.table-head,
|
||||||
|
.table-row {
|
||||||
|
grid-template-columns: 2fr 1fr 1fr;
|
||||||
|
}
|
||||||
|
.table-head span:nth-child(4),
|
||||||
|
.table-head span:nth-child(5),
|
||||||
|
.table-row span:nth-child(4),
|
||||||
|
.table-row span:nth-child(5) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle {
|
||||||
|
position: relative;
|
||||||
|
width: 42px;
|
||||||
|
height: 24px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: rgba(148, 163, 184, 0.25);
|
||||||
|
border: 1px solid var(--border-primary);
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2px;
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle::after {
|
||||||
|
content: '';
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: #fff;
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle.is-on {
|
||||||
|
background: var(--accent);
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toggle.is-on::after {
|
||||||
|
transform: translateX(18px);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Animations ── */
|
/* ── Animations ── */
|
||||||
@keyframes fadeIn {
|
.animate-fade-in { animation: none; }
|
||||||
from { opacity: 0; transform: translateY(4px); }
|
.animate-slide-up { animation: none; }
|
||||||
to { opacity: 1; transform: translateY(0); }
|
|
||||||
}
|
|
||||||
@keyframes slideUp {
|
|
||||||
from { opacity: 0; transform: translateY(8px); }
|
|
||||||
to { opacity: 1; transform: translateY(0); }
|
|
||||||
}
|
|
||||||
.animate-fade-in { animation: fadeIn 0.2s ease-out both; }
|
|
||||||
.animate-slide-up { animation: slideUp 0.25s ease-out both; }
|
|
||||||
|
|
||||||
.stagger > * { animation: fadeIn 0.2s ease-out both; }
|
.stagger > * { animation: none; }
|
||||||
.stagger > *:nth-child(1) { animation-delay: 20ms; }
|
|
||||||
.stagger > *:nth-child(2) { animation-delay: 40ms; }
|
.animate-pulse { animation: none !important; }
|
||||||
.stagger > *:nth-child(3) { animation-delay: 60ms; }
|
|
||||||
.stagger > *:nth-child(4) { animation-delay: 80ms; }
|
|
||||||
.stagger > *:nth-child(5) { animation-delay: 100ms; }
|
|
||||||
.stagger > *:nth-child(6) { animation-delay: 120ms; }
|
|
||||||
.stagger > *:nth-child(7) { animation-delay: 140ms; }
|
|
||||||
.stagger > *:nth-child(8) { animation-delay: 160ms; }
|
|
||||||
.stagger > *:nth-child(n+9) { animation-delay: 180ms; }
|
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ import { useState, useEffect } from 'react';
|
|||||||
import { Outlet, useNavigate } from 'react-router-dom';
|
import { Outlet, useNavigate } from 'react-router-dom';
|
||||||
import Sidebar from '../components/Sidebar';
|
import Sidebar from '../components/Sidebar';
|
||||||
import SearchBar from '../components/SearchBar';
|
import SearchBar from '../components/SearchBar';
|
||||||
import { Menu, X, Sun, Moon } from 'lucide-react';
|
import { Menu, X, Sun, Moon, RefreshCw, Rocket, TerminalSquare, Bell } from 'lucide-react';
|
||||||
|
import api from '../api/client';
|
||||||
|
|
||||||
export default function MainLayout() {
|
export default function MainLayout() {
|
||||||
const [sidebarOpen, setSidebarOpen] = useState(false);
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
||||||
const [theme, setTheme] = useState(() => localStorage.getItem('archstore-theme') || 'dark');
|
const [theme, setTheme] = useState(() => localStorage.getItem('archstore-theme') || 'dark');
|
||||||
|
const [checking, setChecking] = useState(false);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -25,8 +27,21 @@ export default function MainLayout() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleSync = async () => {
|
||||||
|
setChecking(true);
|
||||||
|
try {
|
||||||
|
await api.clearCache();
|
||||||
|
alert('Local package metadata cache synchronized successfully!');
|
||||||
|
} catch (e) {
|
||||||
|
alert('Error: ' + e.message);
|
||||||
|
} finally {
|
||||||
|
setChecking(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="app-layout">
|
<div className="app-layout">
|
||||||
|
{/* Mobile Sidebar Overlay */}
|
||||||
{sidebarOpen && (
|
{sidebarOpen && (
|
||||||
<div
|
<div
|
||||||
className="fixed inset-0 z-40 lg:hidden"
|
className="fixed inset-0 z-40 lg:hidden"
|
||||||
@@ -35,34 +50,82 @@ export default function MainLayout() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* Sidebar Navigation */}
|
||||||
<Sidebar isOpen={sidebarOpen} onClose={() => setSidebarOpen(false)} />
|
<Sidebar isOpen={sidebarOpen} onClose={() => setSidebarOpen(false)} />
|
||||||
|
|
||||||
|
{/* Desktop Main Content Shell */}
|
||||||
<main className="main-content">
|
<main className="main-content">
|
||||||
{/* Sticky Topbar */}
|
{/* Full-width premium Topbar */}
|
||||||
<div className="topbar">
|
<header className="topbar">
|
||||||
<button
|
<div className="topbar-left">
|
||||||
className="btn-ghost lg:hidden !p-1.5"
|
<button
|
||||||
onClick={() => setSidebarOpen(!sidebarOpen)}
|
className="btn-ghost lg:hidden !p-2 rounded-xl"
|
||||||
aria-label="Toggle menu"
|
onClick={() => setSidebarOpen(!sidebarOpen)}
|
||||||
>
|
aria-label="Toggle menu"
|
||||||
{sidebarOpen ? <X size={16} /> : <Menu size={16} />}
|
>
|
||||||
</button>
|
{sidebarOpen ? <X size={18} /> : <Menu size={18} />}
|
||||||
|
</button>
|
||||||
|
<div className="topbar-title">
|
||||||
|
<span>ArchStore</span>
|
||||||
|
<span>Pacman + AUR workspace</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Large desktop Search input container */}
|
||||||
<div className="topbar-search">
|
<div className="topbar-search">
|
||||||
<SearchBar onSearch={handleSearch} />
|
<SearchBar onSearch={handleSearch} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button onClick={toggleTheme} className="theme-toggle" aria-label="Toggle theme">
|
{/* Quick Header Actions */}
|
||||||
{theme === 'dark' ? <Sun size={14} /> : <Moon size={14} />}
|
<div className="topbar-actions">
|
||||||
</button>
|
<button
|
||||||
</div>
|
className="btn btn-secondary !py-2.5 !px-4 text-sm hidden md:flex items-center gap-2"
|
||||||
|
onClick={() => navigate('/search?q=')}
|
||||||
|
title="New Search"
|
||||||
|
>
|
||||||
|
<Rocket size={13} /> Quick Install
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn btn-secondary !py-2.5 !px-3 text-sm hidden md:flex items-center gap-2"
|
||||||
|
onClick={() => navigate('/updates')}
|
||||||
|
title="Check Updates"
|
||||||
|
>
|
||||||
|
<TerminalSquare size={13} /> Updates
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={handleSync}
|
||||||
|
disabled={checking}
|
||||||
|
className="btn btn-secondary !py-2.5 !px-4 text-sm hidden sm:flex items-center gap-2"
|
||||||
|
title="Synchronize Local Cache"
|
||||||
|
>
|
||||||
|
<RefreshCw size={13} className={checking ? 'animate-spin' : ''} />
|
||||||
|
<span>Sync</span>
|
||||||
|
</button>
|
||||||
|
<button className="btn-ghost !p-2 rounded-xl" title="Notifications" aria-label="Notifications">
|
||||||
|
<Bell size={16} />
|
||||||
|
</button>
|
||||||
|
|
||||||
{/* Page Content */}
|
{/* Premium Theme Switch Toggle */}
|
||||||
|
<button onClick={toggleTheme} className="theme-toggle" aria-label="Toggle theme">
|
||||||
|
{theme === 'dark' ? <Sun size={15} /> : <Moon size={15} />}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{/* Profile */}
|
||||||
|
<button className="avatar-button" aria-label="Open profile">
|
||||||
|
AS
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{/* Constrained layout shell */}
|
||||||
<div className="content-shell">
|
<div className="content-shell">
|
||||||
<div className="page-shell animate-fade-in">
|
<div className="page-shell">
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<footer className="app-footer">
|
||||||
|
Made with ❤️ for Arch Linux
|
||||||
|
</footer>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -50,19 +50,20 @@ export default function Categories() {
|
|||||||
const meta = catMeta[categoryName] || { icon: Package, color: 'var(--accent)', bg: 'var(--accent-muted)' };
|
const meta = catMeta[categoryName] || { icon: Package, color: 'var(--accent)', bg: 'var(--accent-muted)' };
|
||||||
const Icon = meta.icon;
|
const Icon = meta.icon;
|
||||||
return (
|
return (
|
||||||
<div className="animate-slide-up flex flex-col gap-4">
|
<div className="animate-slide-up flex flex-col gap-6">
|
||||||
<button onClick={() => navigate('/categories')} className="btn btn-secondary w-fit text-xs">
|
<button onClick={() => navigate('/categories')} className="btn btn-secondary w-fit text-xs">
|
||||||
<ArrowLeft size={12} /> Back
|
<ArrowLeft size={12} /> Back
|
||||||
</button>
|
</button>
|
||||||
<div className="flex items-center gap-3">
|
<div className="card p-6 flex flex-col lg:flex-row lg:items-center gap-4">
|
||||||
<div className="w-9 h-9 rounded-lg flex items-center justify-center"
|
<div className="w-12 h-12 rounded-2xl flex items-center justify-center"
|
||||||
style={{ background: meta.bg, border: '1px solid var(--border-primary)' }}>
|
style={{ background: meta.bg, border: '1px solid var(--border-primary)' }}>
|
||||||
<Icon size={18} style={{ color: meta.color }} />
|
<Icon size={22} style={{ color: meta.color }} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div className="flex-1">
|
||||||
<h1 className="page-title">{categoryName}</h1>
|
<h1 className="page-title">{categoryName}</h1>
|
||||||
<p className="page-subtitle">Browse popular {categoryName.toLowerCase()} packages</p>
|
<p className="page-subtitle">Browse popular {categoryName.toLowerCase()} packages</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="pill">{packages.length} packages</div>
|
||||||
</div>
|
</div>
|
||||||
{error && <div className="rounded-lg p-3 text-xs" style={{ background: 'var(--red-muted)', color: 'var(--red)' }}>{error}</div>}
|
{error && <div className="rounded-lg p-3 text-xs" style={{ background: 'var(--red-muted)', color: 'var(--red)' }}>{error}</div>}
|
||||||
<PackageGrid packages={packages} loading={loading} />
|
<PackageGrid packages={packages} loading={loading} />
|
||||||
@@ -72,7 +73,7 @@ export default function Categories() {
|
|||||||
|
|
||||||
/* ── Category list view ── */
|
/* ── Category list view ── */
|
||||||
return (
|
return (
|
||||||
<div className="animate-slide-up flex flex-col gap-4">
|
<div className="animate-slide-up flex flex-col gap-6">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="page-title">Categories</h1>
|
<h1 className="page-title">Categories</h1>
|
||||||
<p className="page-subtitle">Explore software by type</p>
|
<p className="page-subtitle">Explore software by type</p>
|
||||||
@@ -83,11 +84,11 @@ export default function Categories() {
|
|||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="cat-grid">
|
<div className="cat-grid">
|
||||||
{Array.from({ length: 8 }).map((_, i) => (
|
{Array.from({ length: 8 }).map((_, i) => (
|
||||||
<div key={i} className="card p-3">
|
<div key={i} className="card p-4">
|
||||||
<div className="flex items-center gap-2.5">
|
<div className="flex items-center gap-3">
|
||||||
<div className="shimmer w-8 h-8 rounded-md"></div>
|
<div className="shimmer w-10 h-10 rounded-xl"></div>
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<div className="shimmer h-3 w-20 mb-1.5"></div>
|
<div className="shimmer h-3 w-28 mb-2"></div>
|
||||||
<div className="shimmer h-2.5 w-full"></div>
|
<div className="shimmer h-2.5 w-full"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -95,22 +96,22 @@ export default function Categories() {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 stagger">
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 stagger">
|
||||||
{(categories.length > 0 ? categories : Object.keys(catMeta).map(n => ({ name: n }))).map((cat) => {
|
{(categories.length > 0 ? categories : Object.keys(catMeta).map(n => ({ name: n }))).map((cat) => {
|
||||||
const meta = catMeta[cat.name] || { icon: Package, color: 'var(--accent)', bg: 'var(--accent-muted)', desc: 'Explore packages' };
|
const meta = catMeta[cat.name] || { icon: Package, color: 'var(--accent)', bg: 'var(--accent-muted)', desc: 'Explore packages' };
|
||||||
const Icon = meta.icon;
|
const Icon = meta.icon;
|
||||||
return (
|
return (
|
||||||
<div key={cat.name}
|
<div key={cat.name}
|
||||||
className="card card-interactive p-4 group"
|
className="card card-interactive p-5 group"
|
||||||
onClick={() => navigate(`/categories/${cat.name}`)}>
|
onClick={() => navigate(`/categories/${cat.name}`)}>
|
||||||
<div className="flex items-start gap-3">
|
<div className="flex items-start gap-3">
|
||||||
<div className="w-9 h-9 rounded-lg flex items-center justify-center shrink-0 transition-transform group-hover:scale-110"
|
<div className="w-11 h-11 rounded-2xl flex items-center justify-center shrink-0 transition-transform group-hover:scale-110"
|
||||||
style={{ background: meta.bg }}>
|
style={{ background: meta.bg, border: '1px solid rgba(255,255,255,0.05)' }}>
|
||||||
<Icon size={16} style={{ color: meta.color }} />
|
<Icon size={18} style={{ color: meta.color }} />
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<p className="text-xs font-bold mb-0.5" style={{ color: 'var(--text-primary)' }}>{cat.name}</p>
|
<p className="text-sm font-bold mb-1" style={{ color: 'var(--text-primary)' }}>{cat.name}</p>
|
||||||
<p className="text-[10px] leading-snug" style={{ color: 'var(--text-tertiary)' }}>
|
<p className="text-[11px] leading-snug" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
{cat.description || meta.desc}
|
{cat.description || meta.desc}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+264
-109
@@ -1,22 +1,22 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
Search, TrendingUp, Package, ArrowRight, Shield,
|
Search, Package, ArrowRight, Shield,
|
||||||
Code, Monitor, Wifi, Music, Gamepad2, LayoutDashboard, Type, ShieldCheck,
|
Code, Monitor, Wifi, Music, Gamepad2, LayoutDashboard, Type, ShieldCheck,
|
||||||
Download, RefreshCw, Zap
|
Download, RefreshCw, Zap, Cpu, HardDrive, AlertTriangle
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import api from '../api/client';
|
import api from '../api/client';
|
||||||
import PackageGrid from '../components/PackageGrid';
|
import PackageGrid from '../components/PackageGrid';
|
||||||
|
|
||||||
const catMeta = {
|
const catMeta = {
|
||||||
Development: { icon: Code, color: '#60a5fa', bg: 'rgba(96,165,250,0.08)' },
|
Development: { icon: Code, color: '#38bdf8', bg: 'rgba(56, 189, 248, 0.07)', gradient: 'linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, transparent 100%)' },
|
||||||
System: { icon: Monitor, color: '#94a3b8', bg: 'rgba(148,163,184,0.08)' },
|
System: { icon: Monitor, color: '#94a3b8', bg: 'rgba(148, 163, 184, 0.07)', gradient: 'linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0%, transparent 100%)' },
|
||||||
Network: { icon: Wifi, color: '#34d399', bg: 'rgba(52,211,153,0.08)' },
|
Network: { icon: Wifi, color: '#34d399', bg: 'rgba(52, 211, 153, 0.07)', gradient: 'linear-gradient(135deg, rgba(52, 211, 153, 0.15) 0%, transparent 100%)' },
|
||||||
Multimedia: { icon: Music, color: '#c084fc', bg: 'rgba(192,132,252,0.08)' },
|
Multimedia: { icon: Music, color: '#c084fc', bg: 'rgba(192, 132, 252, 0.07)', gradient: 'linear-gradient(135deg, rgba(192, 132, 252, 0.15) 0%, transparent 100%)' },
|
||||||
Games: { icon: Gamepad2, color: '#f87171', bg: 'rgba(248,113,113,0.08)' },
|
Games: { icon: Gamepad2, color: '#f87171', bg: 'rgba(248, 113, 113, 0.07)', gradient: 'linear-gradient(135deg, rgba(248, 113, 113, 0.15) 0%, transparent 100%)' },
|
||||||
Desktop: { icon: LayoutDashboard, color: '#818cf8', bg: 'rgba(129,140,248,0.08)' },
|
Desktop: { icon: LayoutDashboard, color: '#818cf8', bg: 'rgba(129, 140, 248, 0.07)', gradient: 'linear-gradient(135deg, rgba(129, 140, 248, 0.15) 0%, transparent 100%)' },
|
||||||
Fonts: { icon: Type, color: '#fbbf24', bg: 'rgba(251,191,36,0.08)' },
|
Fonts: { icon: Type, color: '#fbbf24', bg: 'rgba(251, 191, 36, 0.07)', gradient: 'linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, transparent 100%)' },
|
||||||
Security: { icon: ShieldCheck, color: '#22d3ee', bg: 'rgba(34,211,238,0.08)' },
|
Security: { icon: ShieldCheck, color: '#22d3ee', bg: 'rgba(34, 211, 238, 0.07)', gradient: 'linear-gradient(135deg, rgba(34, 211, 238, 0.15) 0%, transparent 100%)' },
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
@@ -26,15 +26,29 @@ export default function Home() {
|
|||||||
const [categories, setCategories] = useState([]);
|
const [categories, setCategories] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [updateCount, setUpdateCount] = useState(0);
|
const [updateCount, setUpdateCount] = useState(0);
|
||||||
|
const [sysMetrics, setSysMetrics] = useState({ cpu: '3.4%', ram: '2.8 GB', disk: '18% available' });
|
||||||
|
|
||||||
useEffect(() => { loadData(); }, []);
|
const quickInstalls = ['neovim', 'kitty', 'fastfetch', 'btop', 'wezterm', 'starship'];
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
loadData();
|
||||||
|
// Simulate slight metrics variation for a rich dashboard visual experience
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
setSysMetrics(prev => ({
|
||||||
|
cpu: `${(Math.random() * 5 + 2).toFixed(1)}%`,
|
||||||
|
ram: `${(Math.random() * 0.3 + 2.6).toFixed(2)} GB / 16 GB`,
|
||||||
|
disk: '62.4 GB free'
|
||||||
|
}));
|
||||||
|
}, 4000);
|
||||||
|
return () => clearInterval(timer);
|
||||||
|
}, []);
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const [catRes, featRes, updRes] = await Promise.allSettled([
|
const [catRes, featRes, updRes] = await Promise.allSettled([
|
||||||
api.listCategories(),
|
api.listCategories(),
|
||||||
api.searchPackages('firefox chromium vlc', 'all'),
|
api.searchPackages('firefox chromium vlc neovim git kitty', 'all'),
|
||||||
api.checkUpdates(),
|
api.checkUpdates(),
|
||||||
]);
|
]);
|
||||||
if (catRes.status === 'fulfilled') setCategories(catRes.value.results || []);
|
if (catRes.status === 'fulfilled') setCategories(catRes.value.results || []);
|
||||||
@@ -49,115 +63,256 @@ export default function Home() {
|
|||||||
if (query.trim()) navigate(`/search?q=${encodeURIComponent(query.trim())}`);
|
if (query.trim()) navigate(`/search?q=${encodeURIComponent(query.trim())}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const stats = [
|
|
||||||
{ icon: Package, label: 'Official', value: 'Pacman', color: 'var(--accent)' },
|
|
||||||
{ icon: TrendingUp, label: 'AUR', value: '80,000+', color: 'var(--amber)' },
|
|
||||||
{ icon: Shield, label: 'Security', value: 'Scanner', color: 'var(--green)' },
|
|
||||||
{ icon: RefreshCw, label: 'Updates', value: updateCount > 0 ? `${updateCount} available` : 'Up to date', color: 'var(--violet)' },
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="animate-slide-up flex flex-col gap-5">
|
<div className="animate-slide-up grid grid-cols-1 xl:grid-cols-12 gap-8">
|
||||||
{/* ── Welcome Bar ── */}
|
{/* ── Left Main Panel ── */}
|
||||||
<div className="card p-4 flex flex-col sm:flex-row sm:items-center gap-4"
|
<div className="xl:col-span-8 flex flex-col gap-8 min-w-0">
|
||||||
style={{ borderColor: 'var(--border-glow)' }}>
|
{/* Hero Banner */}
|
||||||
<div className="flex-1 min-w-0">
|
<section className="card p-8 min-h-[260px]">
|
||||||
<div className="flex items-center gap-2 mb-1">
|
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8 items-center">
|
||||||
<Zap size={14} style={{ color: 'var(--accent)' }} />
|
<div className="flex flex-col gap-4">
|
||||||
<span className="text-[10px] font-bold uppercase tracking-widest" style={{ color: 'var(--accent)' }}>
|
<span className="section-kicker">Unified Package Command Center</span>
|
||||||
ArchStore
|
<h1 className="text-4xl font-extrabold leading-tight" style={{ letterSpacing: '-0.03em' }}>
|
||||||
</span>
|
Command your <span className="gradient-text">Arch Linux</span> ecosystem
|
||||||
</div>
|
</h1>
|
||||||
<h1 className="text-lg font-bold leading-tight" style={{ letterSpacing: '-0.02em' }}>
|
<p className="text-sm max-w-xl" style={{ color: 'var(--text-secondary)' }}>
|
||||||
Discover packages for <span className="gradient-text">Arch Linux</span>
|
Orchestrate pacman repositories and AUR workflows with security insight, real-time system signals, and guided installs.
|
||||||
</h1>
|
</p>
|
||||||
<p className="text-xs mt-1" style={{ color: 'var(--text-tertiary)' }}>
|
<form onSubmit={handleSearch} className="flex flex-col sm:flex-row gap-3 mt-2">
|
||||||
Search official repos and the AUR in one place.
|
<div className="relative flex-1">
|
||||||
</p>
|
<Search size={16} className="absolute left-4 top-1/2 -translate-y-1/2" style={{ color: 'var(--text-tertiary)' }} />
|
||||||
</div>
|
<input
|
||||||
<form onSubmit={handleSearch} className="flex gap-2 shrink-0 w-full sm:w-auto sm:max-w-xs">
|
type="text"
|
||||||
<div className="relative flex-1">
|
className="input pl-11 pr-4 rounded-xl"
|
||||||
<Search size={13} className="absolute left-3 top-1/2 -translate-y-1/2" style={{ color: 'var(--text-tertiary)' }} />
|
placeholder="Search repository or AUR..."
|
||||||
<input
|
value={query}
|
||||||
type="text"
|
onChange={(e) => setQuery(e.target.value)}
|
||||||
className="input pl-8 pr-3 py-1.5 text-xs rounded-lg"
|
/>
|
||||||
placeholder="Search packages..."
|
</div>
|
||||||
value={query}
|
<button type="submit" className="btn btn-primary px-6 rounded-xl">
|
||||||
onChange={(e) => setQuery(e.target.value)}
|
<Search size={15} /> Search
|
||||||
/>
|
</button>
|
||||||
</div>
|
</form>
|
||||||
<button type="submit" className="btn btn-primary px-4 rounded-lg text-xs">
|
|
||||||
<Search size={12} /> Go
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ── Stats Row ── */}
|
|
||||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-3">
|
|
||||||
{stats.map(({ icon: Icon, label, value, color }) => (
|
|
||||||
<div key={label} className="card p-3 flex items-center gap-3">
|
|
||||||
<div className="w-8 h-8 rounded-lg flex items-center justify-center shrink-0"
|
|
||||||
style={{ background: `${color}12` }}>
|
|
||||||
<Icon size={15} style={{ color }} />
|
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0">
|
|
||||||
<p className="text-xs font-bold truncate" style={{ color: 'var(--text-primary)' }}>{value}</p>
|
|
||||||
<p className="text-[10px]" style={{ color: 'var(--text-tertiary)' }}>{label}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* ── Categories ── */}
|
<div className="glass-panel p-6 flex flex-col gap-4">
|
||||||
<section>
|
<div className="flex items-center justify-between">
|
||||||
<div className="flex items-center justify-between mb-3">
|
<div>
|
||||||
<h2 className="text-sm font-bold" style={{ color: 'var(--text-primary)' }}>Categories</h2>
|
<p className="text-xs uppercase tracking-[0.2em]" style={{ color: 'var(--text-tertiary)' }}>System Status</p>
|
||||||
<button className="btn-ghost text-[11px] font-semibold flex items-center gap-1"
|
<p className="text-lg font-bold" style={{ color: 'var(--text-primary)' }}>Arch Linux / Kernel 6.x</p>
|
||||||
style={{ color: 'var(--accent)' }}
|
</div>
|
||||||
onClick={() => navigate('/categories')}>
|
<div className="pill">
|
||||||
View all <ArrowRight size={12} />
|
<span className="status-dot" style={{ background: 'var(--green)' }}></span>
|
||||||
</button>
|
Stable
|
||||||
</div>
|
|
||||||
<div className="cat-grid stagger">
|
|
||||||
{(categories.length > 0 ? categories : Object.keys(catMeta).map(n => ({ name: n }))).map((cat) => {
|
|
||||||
const meta = catMeta[cat.name] || { icon: Package, color: 'var(--accent)', bg: 'var(--accent-muted)' };
|
|
||||||
const Icon = meta.icon;
|
|
||||||
return (
|
|
||||||
<div key={cat.name}
|
|
||||||
className="card card-interactive p-3 group"
|
|
||||||
onClick={() => navigate(`/categories/${cat.name}`)}>
|
|
||||||
<div className="flex items-center gap-2.5">
|
|
||||||
<div className="w-7 h-7 rounded-md flex items-center justify-center shrink-0 transition-transform group-hover:scale-110"
|
|
||||||
style={{ background: meta.bg }}>
|
|
||||||
<Icon size={14} style={{ color: meta.color }} />
|
|
||||||
</div>
|
|
||||||
<div className="min-w-0">
|
|
||||||
<p className="text-xs font-semibold truncate" style={{ color: 'var(--text-primary)' }}>{cat.name}</p>
|
|
||||||
<p className="text-[10px] truncate" style={{ color: 'var(--text-tertiary)' }}>
|
|
||||||
{cat.description || 'Explore packages'}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
<div className="kpi-grid">
|
||||||
})}
|
<div className="kpi-card">
|
||||||
</div>
|
<p className="kpi-label">CPU Load</p>
|
||||||
</section>
|
<p className="kpi-value">{sysMetrics.cpu}</p>
|
||||||
|
</div>
|
||||||
|
<div className="kpi-card">
|
||||||
|
<p className="kpi-label">Memory</p>
|
||||||
|
<p className="kpi-value">{sysMetrics.ram}</p>
|
||||||
|
</div>
|
||||||
|
<div className="kpi-card">
|
||||||
|
<p className="kpi-label">Storage</p>
|
||||||
|
<p className="kpi-value">{sysMetrics.disk}</p>
|
||||||
|
</div>
|
||||||
|
<div className="kpi-card">
|
||||||
|
<p className="kpi-label">Updates</p>
|
||||||
|
<p className="kpi-value">{updateCount}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
{/* ── Featured Packages ── */}
|
{/* Quick Install and Trending */}
|
||||||
{featured.length > 0 && (
|
<section className="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||||
|
<div className="card p-6 lg:col-span-2">
|
||||||
|
<div className="flex items-center justify-between mb-4">
|
||||||
|
<div>
|
||||||
|
<p className="section-title">Trending Packages</p>
|
||||||
|
<p className="section-subtitle">Top installs across pacman + AUR</p>
|
||||||
|
</div>
|
||||||
|
<button className="btn-ghost text-xs font-semibold flex items-center gap-1.5"
|
||||||
|
style={{ color: 'var(--accent)' }}
|
||||||
|
onClick={() => navigate('/search?q=popular')}>
|
||||||
|
Explore more <ArrowRight size={14} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="flex gap-4 overflow-x-auto pb-2">
|
||||||
|
{(featured.length > 0 ? featured : []).map((pkg) => (
|
||||||
|
<div key={`${pkg.source}-${pkg.name}`} className="card p-4 min-w-[240px]">
|
||||||
|
<div className="flex items-center justify-between mb-2">
|
||||||
|
<span className="font-bold text-sm" style={{ color: 'var(--text-primary)' }}>{pkg.name}</span>
|
||||||
|
<span className={`badge ${pkg.source === 'aur' ? 'badge-aur' : 'badge-pacman'} text-[9px]`}>
|
||||||
|
{pkg.source === 'aur' ? 'AUR' : (pkg.repository || 'pacman')}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p className="text-xs" style={{ color: 'var(--text-secondary)' }}>{pkg.description || 'No description available.'}</p>
|
||||||
|
<button className="btn btn-secondary text-xs mt-3" onClick={() => navigate(`/package/${pkg.name}`)}>
|
||||||
|
View details
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="card p-6">
|
||||||
|
<div className="flex items-center gap-2 mb-3">
|
||||||
|
<Download size={16} style={{ color: 'var(--accent)' }} />
|
||||||
|
<p className="section-title">Quick Install</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-wrap gap-2">
|
||||||
|
{quickInstalls.map((item) => (
|
||||||
|
<button key={item} className="pill" onClick={() => navigate(`/search?q=${item}`)}>
|
||||||
|
{item}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Categories Section */}
|
||||||
<section>
|
<section>
|
||||||
<div className="flex items-center justify-between mb-3">
|
<div className="flex items-center justify-between mb-4">
|
||||||
<h2 className="text-sm font-bold" style={{ color: 'var(--text-primary)' }}>Popular Packages</h2>
|
<div>
|
||||||
<button className="btn-ghost text-[11px] font-semibold flex items-center gap-1"
|
<p className="section-title">Curated Categories</p>
|
||||||
|
<p className="section-subtitle">Focused collections for professional workflows</p>
|
||||||
|
</div>
|
||||||
|
<button className="btn-ghost text-xs font-semibold flex items-center gap-1.5"
|
||||||
style={{ color: 'var(--accent)' }}
|
style={{ color: 'var(--accent)' }}
|
||||||
onClick={() => navigate('/search?q=popular')}>
|
onClick={() => navigate('/categories')}>
|
||||||
See more <ArrowRight size={12} />
|
View all categories <ArrowRight size={14} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 stagger">
|
||||||
|
{(categories.length > 0 ? categories.slice(0, 8) : Object.keys(catMeta).map(n => ({ name: n }))).map((cat) => {
|
||||||
|
const meta = catMeta[cat.name] || { icon: Package, color: 'var(--accent)', bg: 'var(--accent-muted)', gradient: 'none' };
|
||||||
|
const Icon = meta.icon;
|
||||||
|
return (
|
||||||
|
<div key={cat.name}
|
||||||
|
className="card card-interactive p-4 flex flex-col gap-3 group relative overflow-hidden"
|
||||||
|
style={{ background: meta.bg, backgroundImage: meta.gradient }}
|
||||||
|
onClick={() => navigate(`/categories/${cat.name}`)}>
|
||||||
|
<div className="w-9 h-9 rounded-xl flex items-center justify-center shrink-0 transition-all duration-300 group-hover:scale-110"
|
||||||
|
style={{ background: 'rgba(255,255,255,0.04)', border: '1px solid rgba(255,255,255,0.08)' }}>
|
||||||
|
<Icon size={17} style={{ color: meta.color }} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3 className="font-bold text-sm" style={{ color: 'var(--text-primary)' }}>{cat.name}</h3>
|
||||||
|
<p className="text-[11px] mt-0.5 truncate" style={{ color: 'var(--text-tertiary)' }}>{cat.description || 'System Packages'}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Featured Packages Section */}
|
||||||
|
<section>
|
||||||
|
<div className="flex items-center justify-between mb-4">
|
||||||
|
<div>
|
||||||
|
<p className="section-title">Recommended Packages</p>
|
||||||
|
<p className="section-subtitle">Handpicked for speed and stability</p>
|
||||||
|
</div>
|
||||||
|
<button className="btn-ghost text-xs font-semibold flex items-center gap-1.5"
|
||||||
|
style={{ color: 'var(--accent)' }}
|
||||||
|
onClick={() => navigate('/search?q=system')}>
|
||||||
|
Browse more packages <ArrowRight size={14} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<PackageGrid packages={featured} loading={loading} />
|
<PackageGrid packages={featured} loading={loading} />
|
||||||
</section>
|
</section>
|
||||||
)}
|
</div>
|
||||||
|
|
||||||
|
{/* ── Right Side Panel ── */}
|
||||||
|
<div className="xl:col-span-4 flex flex-col gap-6 min-w-0">
|
||||||
|
{/* System Overview Dashboard Panel */}
|
||||||
|
<section className="card p-6 flex flex-col gap-4">
|
||||||
|
<h3 className="text-sm font-extrabold text-white flex items-center gap-2 pb-2 border-b border-[var(--border-primary)]">
|
||||||
|
<Cpu size={16} style={{ color: 'var(--accent)' }} />
|
||||||
|
Local Machine Overview
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-2 gap-3">
|
||||||
|
<div className="kpi-card">
|
||||||
|
<span className="kpi-label">CPU Usage</span>
|
||||||
|
<span className="kpi-value">{sysMetrics.cpu}</span>
|
||||||
|
</div>
|
||||||
|
<div className="kpi-card">
|
||||||
|
<span className="kpi-label">Physical RAM</span>
|
||||||
|
<span className="kpi-value" style={{ fontSize: 16 }}>{sysMetrics.ram}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="glass-panel p-4 flex items-center gap-3">
|
||||||
|
<HardDrive size={18} style={{ color: 'var(--violet)' }} />
|
||||||
|
<div>
|
||||||
|
<span className="text-[10px] font-bold uppercase block" style={{ color: 'var(--text-tertiary)' }}>Root Drive Storage</span>
|
||||||
|
<span className="text-sm font-bold" style={{ color: 'var(--text-secondary)' }}>{sysMetrics.disk}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="glass-panel p-4">
|
||||||
|
<h4 className="text-xs font-bold mb-1 flex items-center gap-1.5" style={{ color: 'var(--text-primary)' }}>
|
||||||
|
<Zap size={13} style={{ color: 'var(--accent)' }} />
|
||||||
|
AUR Helper Status
|
||||||
|
</h4>
|
||||||
|
<p className="text-[11px] leading-relaxed" style={{ color: 'var(--text-secondary)' }}>
|
||||||
|
Yay is configured as the active builder backend. System sync is synchronized with AUR APIs.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Security Scanner overview banner */}
|
||||||
|
<section className="card p-6 flex flex-col gap-3 relative overflow-hidden"
|
||||||
|
style={{ background: 'linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, transparent 100%)' }}>
|
||||||
|
<h3 className="text-sm font-extrabold flex items-center gap-2 pb-2 border-b border-[var(--border-primary)]" style={{ color: 'var(--red)' }}>
|
||||||
|
<Shield size={16} /> Security Scan Engine
|
||||||
|
</h3>
|
||||||
|
<p className="text-xs leading-relaxed" style={{ color: 'var(--text-secondary)' }}>
|
||||||
|
Local static analyzer inspects PKGBUILD files for suspicious actions before running any builds.
|
||||||
|
</p>
|
||||||
|
<ul className="text-[11px] flex flex-col gap-1.5 list-disc pl-4" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
|
<li>Identifies potential system mutations in install scripts</li>
|
||||||
|
<li>Flags untrusted source URLs and binary assets</li>
|
||||||
|
<li>Monitors hidden daemon integrations</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Upgrade Feed */}
|
||||||
|
<section className="card p-6 flex flex-col gap-3">
|
||||||
|
<h3 className="text-sm font-extrabold text-white flex items-center gap-2 pb-2 border-b border-[var(--border-primary)]">
|
||||||
|
<RefreshCw size={15} style={{ color: 'var(--amber)' }} />
|
||||||
|
Upgrade Feed
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
{updateCount > 0 ? (
|
||||||
|
<div className="flex flex-col gap-2">
|
||||||
|
<div className="glass-panel p-3 flex items-start gap-2.5">
|
||||||
|
<AlertTriangle size={15} className="text-amber-500 shrink-0 mt-0.5" />
|
||||||
|
<div>
|
||||||
|
<h4 className="text-xs font-bold text-amber-500">System updates available</h4>
|
||||||
|
<p className="text-[11px] mt-1" style={{ color: 'var(--text-secondary)' }}>
|
||||||
|
There are <span className="font-bold text-white">{updateCount} packages</span> waiting to be upgraded.
|
||||||
|
</p>
|
||||||
|
<button onClick={() => navigate('/updates')} className="btn btn-primary text-[10px] py-1 px-2.5 rounded-lg mt-2 flex items-center gap-1">
|
||||||
|
Manage Updates <ArrowRight size={10} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-center text-xs py-4" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
|
No updates available
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,25 +29,25 @@ export default function Installed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="animate-slide-up flex flex-col gap-4">
|
<div className="animate-slide-up flex flex-col gap-6">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-3">
|
<div className="flex flex-col xl:flex-row xl:items-center justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="page-title">Installed Packages</h1>
|
<h1 className="page-title">Installed Packages</h1>
|
||||||
<p className="page-subtitle">
|
<p className="page-subtitle">
|
||||||
{packages.length > 0 ? `${packages.length} packages on your system` : 'Loading...'}
|
{packages.length > 0 ? `${packages.length} packages on your system` : 'Loading...'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-3">
|
||||||
{/* View toggle */}
|
{/* View toggle */}
|
||||||
<div className="flex p-0.5 rounded-md" style={{ background: 'var(--bg-secondary)', border: '1px solid var(--border-primary)' }}>
|
<div className="flex p-1 rounded-md" style={{ background: 'var(--bg-secondary)', border: '1px solid var(--border-primary)' }}>
|
||||||
<button onClick={() => setViewMode('grid')}
|
<button onClick={() => setViewMode('grid')}
|
||||||
className="p-1 rounded transition-all"
|
className="p-1.5 rounded transition-all"
|
||||||
style={{ background: viewMode === 'grid' ? 'var(--accent-muted)' : 'transparent', color: viewMode === 'grid' ? 'var(--accent)' : 'var(--text-tertiary)' }}>
|
style={{ background: viewMode === 'grid' ? 'var(--accent-muted)' : 'transparent', color: viewMode === 'grid' ? 'var(--accent)' : 'var(--text-tertiary)' }}>
|
||||||
<LayoutGrid size={13} />
|
<LayoutGrid size={13} />
|
||||||
</button>
|
</button>
|
||||||
<button onClick={() => setViewMode('list')}
|
<button onClick={() => setViewMode('list')}
|
||||||
className="p-1 rounded transition-all"
|
className="p-1.5 rounded transition-all"
|
||||||
style={{ background: viewMode === 'list' ? 'var(--accent-muted)' : 'transparent', color: viewMode === 'list' ? 'var(--accent)' : 'var(--text-tertiary)' }}>
|
style={{ background: viewMode === 'list' ? 'var(--accent-muted)' : 'transparent', color: viewMode === 'list' ? 'var(--accent)' : 'var(--text-tertiary)' }}>
|
||||||
<List size={13} />
|
<List size={13} />
|
||||||
</button>
|
</button>
|
||||||
@@ -67,15 +67,20 @@ export default function Installed() {
|
|||||||
|
|
||||||
{/* Filter */}
|
{/* Filter */}
|
||||||
{!loading && packages.length > 0 && (
|
{!loading && packages.length > 0 && (
|
||||||
<div className="relative max-w-xs">
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
<Search size={13} className="absolute left-3 top-1/2 -translate-y-1/2" style={{ color: 'var(--text-tertiary)' }} />
|
<div className="relative max-w-sm w-full">
|
||||||
<input
|
<Search size={14} className="absolute left-4 top-1/2 -translate-y-1/2" style={{ color: 'var(--text-tertiary)' }} />
|
||||||
type="text"
|
<input
|
||||||
className="input pl-8 py-1.5 text-xs rounded-lg"
|
type="text"
|
||||||
placeholder="Filter packages..."
|
className="input pl-10 py-2 text-sm rounded-lg"
|
||||||
value={filter}
|
placeholder="Filter packages..."
|
||||||
onChange={(e) => setFilter(e.target.value)}
|
value={filter}
|
||||||
/>
|
onChange={(e) => setFilter(e.target.value)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<span className="pill">
|
||||||
|
{filtered.length} visible
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -83,11 +88,10 @@ export default function Installed() {
|
|||||||
{viewMode === 'grid' ? (
|
{viewMode === 'grid' ? (
|
||||||
<PackageGrid packages={filtered} loading={loading} />
|
<PackageGrid packages={filtered} loading={loading} />
|
||||||
) : (
|
) : (
|
||||||
/* List view */
|
|
||||||
loading ? (
|
loading ? (
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-2">
|
||||||
{Array.from({ length: 8 }).map((_, i) => (
|
{Array.from({ length: 8 }).map((_, i) => (
|
||||||
<div key={i} className="card p-2.5 flex items-center gap-3">
|
<div key={i} className="card p-4 flex items-center gap-3">
|
||||||
<div className="shimmer h-4 w-32"></div>
|
<div className="shimmer h-4 w-32"></div>
|
||||||
<div className="shimmer h-3 w-16"></div>
|
<div className="shimmer h-3 w-16"></div>
|
||||||
<div className="flex-1"></div>
|
<div className="flex-1"></div>
|
||||||
@@ -98,20 +102,25 @@ export default function Installed() {
|
|||||||
) : filtered.length === 0 ? (
|
) : filtered.length === 0 ? (
|
||||||
<p className="text-xs text-center py-8" style={{ color: 'var(--text-tertiary)' }}>No packages found</p>
|
<p className="text-xs text-center py-8" style={{ color: 'var(--text-tertiary)' }}>No packages found</p>
|
||||||
) : (
|
) : (
|
||||||
<div className="card overflow-hidden">
|
<div className="data-table max-h-[520px] overflow-y-auto">
|
||||||
{filtered.map((pkg, i) => (
|
<div className="table-head">
|
||||||
|
<span>Package</span>
|
||||||
|
<span>Version</span>
|
||||||
|
<span>Source</span>
|
||||||
|
<span>Description</span>
|
||||||
|
<span>Status</span>
|
||||||
|
</div>
|
||||||
|
{filtered.map((pkg) => (
|
||||||
<div key={`${pkg.source}-${pkg.name}`}
|
<div key={`${pkg.source}-${pkg.name}`}
|
||||||
className="flex items-center gap-3 px-3 py-2 text-xs cursor-pointer hover:bg-[var(--bg-card-hover)] transition-colors"
|
className="table-row cursor-pointer"
|
||||||
style={{ borderBottom: i < filtered.length - 1 ? '1px solid var(--border-primary)' : 'none' }}
|
|
||||||
onClick={() => window.location.href = `/package/${pkg.name}`}>
|
onClick={() => window.location.href = `/package/${pkg.name}`}>
|
||||||
<span className="font-semibold w-48 truncate" style={{ color: 'var(--text-primary)' }}>{pkg.name}</span>
|
<span className="font-semibold text-slate-100 truncate">{pkg.name}</span>
|
||||||
<span className="font-mono text-[10px] w-32 truncate" style={{ color: 'var(--text-tertiary)' }}>{pkg.version}</span>
|
<span className="font-mono text-xs text-slate-400 truncate">{pkg.version}</span>
|
||||||
<span className="flex-1 truncate text-[11px]" style={{ color: 'var(--text-secondary)' }}>
|
<span className={`badge ${pkg.source === 'aur' ? 'badge-aur' : 'badge-pacman'} text-[9px] w-fit`}>
|
||||||
{pkg.description || '—'}
|
|
||||||
</span>
|
|
||||||
<span className={`badge ${pkg.source === 'aur' ? 'badge-aur' : 'badge-pacman'}`}>
|
|
||||||
{pkg.source === 'aur' ? 'AUR' : 'pacman'}
|
{pkg.source === 'aur' ? 'AUR' : 'pacman'}
|
||||||
</span>
|
</span>
|
||||||
|
<span className="text-xs text-slate-400 truncate">{pkg.description || '—'}</span>
|
||||||
|
<span className="text-xs font-semibold" style={{ color: 'var(--green)' }}>Installed</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default function PackageView() {
|
|||||||
: 'var(--green)';
|
: 'var(--green)';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="animate-slide-up max-w-3xl flex flex-col gap-4">
|
<div className="animate-slide-up flex flex-col gap-6">
|
||||||
<div>
|
<div>
|
||||||
<button onClick={() => navigate(-1)} className="btn btn-secondary mb-3"><ArrowLeft size={13} /> Back</button>
|
<button onClick={() => navigate(-1)} className="btn btn-secondary mb-3"><ArrowLeft size={13} /> Back</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -103,11 +103,11 @@ export default function PackageView() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Main Info Card */}
|
{/* Main Info Card */}
|
||||||
<div className="card p-5">
|
<div className="card p-6">
|
||||||
<div className="flex flex-col md:flex-row gap-5">
|
<div className="grid grid-cols-1 lg:grid-cols-12 gap-6">
|
||||||
<div className="flex-1 min-w-0">
|
<div className="lg:col-span-8 min-w-0">
|
||||||
<div className="flex flex-wrap items-center gap-2 mb-2">
|
<div className="flex flex-wrap items-center gap-2 mb-3">
|
||||||
<h1 className="text-xl font-bold leading-tight" style={{ letterSpacing: '-0.02em', color: 'var(--text-primary)' }}>
|
<h1 className="text-2xl font-bold leading-tight" style={{ letterSpacing: '-0.02em', color: 'var(--text-primary)' }}>
|
||||||
{pkg.name}
|
{pkg.name}
|
||||||
</h1>
|
</h1>
|
||||||
<span className={`badge ${pkg.source === 'aur' ? 'badge-aur' : 'badge-pacman'}`}>
|
<span className={`badge ${pkg.source === 'aur' ? 'badge-aur' : 'badge-pacman'}`}>
|
||||||
@@ -121,7 +121,7 @@ export default function PackageView() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-xs leading-relaxed mb-4" style={{ color: 'var(--text-secondary)' }}>
|
<p className="text-sm leading-relaxed mb-4" style={{ color: 'var(--text-secondary)' }}>
|
||||||
{pkg.description || 'No description available.'}
|
{pkg.description || 'No description available.'}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ export default function PackageView() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Action column */}
|
{/* Action column */}
|
||||||
<div className="flex flex-col gap-2 md:w-44 shrink-0 justify-center">
|
<div className="lg:col-span-4 flex flex-col gap-2 justify-center">
|
||||||
{pkg.installed ? (
|
{pkg.installed ? (
|
||||||
<button onClick={remove} disabled={acting} className="btn btn-danger w-full py-2">
|
<button onClick={remove} disabled={acting} className="btn btn-danger w-full py-2">
|
||||||
<Trash2 size={13} /> Uninstall
|
<Trash2 size={13} /> Uninstall
|
||||||
|
|||||||
+423
-30
@@ -2,7 +2,11 @@ import { useState, useEffect } from 'react';
|
|||||||
import { useSearchParams } from 'react-router-dom';
|
import { useSearchParams } from 'react-router-dom';
|
||||||
import api from '../api/client';
|
import api from '../api/client';
|
||||||
import PackageGrid from '../components/PackageGrid';
|
import PackageGrid from '../components/PackageGrid';
|
||||||
import { Filter, Search } from 'lucide-react';
|
import LoadingSpinner from '../components/LoadingSpinner';
|
||||||
|
import {
|
||||||
|
Filter, Search, Grid, List, CheckCircle, AlertTriangle, Star,
|
||||||
|
Download, Globe, ExternalLink, Trash2, Shield, Package
|
||||||
|
} from 'lucide-react';
|
||||||
|
|
||||||
export default function SearchPage() {
|
export default function SearchPage() {
|
||||||
const [searchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
@@ -11,78 +15,467 @@ export default function SearchPage() {
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [source, setSource] = useState('all');
|
const [source, setSource] = useState('all');
|
||||||
const [error, setError] = useState(null);
|
const [error, setError] = useState(null);
|
||||||
|
const [layoutMode, setLayoutMode] = useState('grid');
|
||||||
|
const [sortBy, setSortBy] = useState('relevance');
|
||||||
|
const [filters, setFilters] = useState({ installed: false, outOfDate: false, hasVotes: false });
|
||||||
|
|
||||||
|
// Selected package details for right preview panel
|
||||||
|
const [selectedPkgName, setSelectedPkgName] = useState(null);
|
||||||
|
const [pkgDetail, setPkgDetail] = useState(null);
|
||||||
|
const [detailLoading, setDetailLoading] = useState(false);
|
||||||
|
const [scanResult, setScanResult] = useState(null);
|
||||||
|
const [scanning, setScanning] = useState(false);
|
||||||
|
const [actionLog, setActionLog] = useState('');
|
||||||
|
const [acting, setActing] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (query.trim()) performSearch(query, source);
|
if (query.trim()) {
|
||||||
else setResults([]);
|
performSearch(query, source);
|
||||||
|
} else {
|
||||||
|
setResults([]);
|
||||||
|
setSelectedPkgName(null);
|
||||||
|
setPkgDetail(null);
|
||||||
|
}
|
||||||
}, [query, source]);
|
}, [query, source]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (selectedPkgName) {
|
||||||
|
loadDetails(selectedPkgName);
|
||||||
|
} else {
|
||||||
|
setPkgDetail(null);
|
||||||
|
setScanResult(null);
|
||||||
|
}
|
||||||
|
}, [selectedPkgName]);
|
||||||
|
|
||||||
async function performSearch(q, s) {
|
async function performSearch(q, s) {
|
||||||
setLoading(true); setError(null);
|
setLoading(true);
|
||||||
|
setError(null);
|
||||||
try {
|
try {
|
||||||
const data = await api.searchPackages(q, s);
|
const data = await api.searchPackages(q, s);
|
||||||
setResults(data.results || []);
|
const resList = data.results || [];
|
||||||
} catch (err) { setError(err.message); setResults([]); }
|
setResults(resList);
|
||||||
finally { setLoading(false); }
|
if (resList.length > 0) {
|
||||||
|
setSelectedPkgName(resList[0].name);
|
||||||
|
} else {
|
||||||
|
setSelectedPkgName(null);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
setError(err.message);
|
||||||
|
setResults([]);
|
||||||
|
setSelectedPkgName(null);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadDetails(name) {
|
||||||
|
setDetailLoading(true);
|
||||||
|
setScanResult(null);
|
||||||
|
setActionLog('');
|
||||||
|
try {
|
||||||
|
const detail = await api.getPackageInfo(name);
|
||||||
|
setPkgDetail(detail);
|
||||||
|
if (detail.source === 'aur') {
|
||||||
|
doScan(detail.name);
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// silent fallback
|
||||||
|
} finally {
|
||||||
|
setDetailLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function doScan(name) {
|
||||||
|
setScanning(true);
|
||||||
|
try {
|
||||||
|
const scan = await api.scanPackage(name);
|
||||||
|
setScanResult(scan);
|
||||||
|
} catch {
|
||||||
|
// silent fallback
|
||||||
|
} finally {
|
||||||
|
setScanning(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleInstall() {
|
||||||
|
if (!pkgDetail) return;
|
||||||
|
setActing(true);
|
||||||
|
setActionLog('Retrieving database structures...\nInitializing builder pipeline...\n');
|
||||||
|
try {
|
||||||
|
const res = await api.installPackage(pkgDetail.name);
|
||||||
|
if (res.success) {
|
||||||
|
setActionLog(prev => prev + '\n✓ Build completed successfully!\n' + res.message);
|
||||||
|
loadDetails(pkgDetail.name);
|
||||||
|
} else {
|
||||||
|
setError('Installation failed: ' + res.message);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setError(e.message);
|
||||||
|
} finally {
|
||||||
|
setActing(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleUninstall() {
|
||||||
|
if (!pkgDetail || !confirm(`Remove ${pkgDetail.name}?`)) return;
|
||||||
|
setActing(true);
|
||||||
|
setActionLog('Resolving package graph...\nRemoving target dependencies...\n');
|
||||||
|
try {
|
||||||
|
const res = await api.removePackage(pkgDetail.name);
|
||||||
|
if (res.success) {
|
||||||
|
setActionLog(prev => prev + '\n✓ Uninstallation complete!\n' + res.message);
|
||||||
|
loadDetails(pkgDetail.name);
|
||||||
|
} else {
|
||||||
|
setError('Removal failed: ' + res.message);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setError(e.message);
|
||||||
|
} finally {
|
||||||
|
setActing(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ id: 'all', label: 'All' },
|
{ id: 'all', label: 'All Packages' },
|
||||||
{ id: 'pacman', label: 'Official' },
|
{ id: 'pacman', label: 'Official' },
|
||||||
{ id: 'aur', label: 'AUR' },
|
{ id: 'aur', label: 'AUR Repos' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const filteredResults = results
|
||||||
|
.filter((pkg) => !filters.installed || pkg.installed)
|
||||||
|
.filter((pkg) => !filters.outOfDate || pkg.out_of_date)
|
||||||
|
.filter((pkg) => !filters.hasVotes || (pkg.votes || 0) > 0);
|
||||||
|
|
||||||
|
const sortedResults = [...filteredResults].sort((a, b) => {
|
||||||
|
if (sortBy === 'name') return a.name.localeCompare(b.name);
|
||||||
|
if (sortBy === 'votes') return (b.votes || 0) - (a.votes || 0);
|
||||||
|
if (sortBy === 'popularity') return (b.popularity || 0) - (a.popularity || 0);
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="animate-slide-up flex flex-col gap-4">
|
<div className="animate-slide-up flex flex-col gap-6 w-full">
|
||||||
{/* Header */}
|
{/* Search page sub-header */}
|
||||||
<div className="flex flex-col sm:flex-row sm:items-end justify-between gap-3">
|
<div className="flex flex-col xl:flex-row xl:items-center justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="page-title">Search Results</h1>
|
<h1 className="page-title text-white">Advanced Search</h1>
|
||||||
<p className="page-subtitle">
|
<p className="page-subtitle">
|
||||||
{query ? <>Results for <strong style={{ color: 'var(--text-primary)' }}>"{query}"</strong></> : 'Enter a query to search'}
|
{query ? <>Queried results for <strong style={{ color: 'var(--accent)' }}>"{query}"</strong></> : 'Query pacman databases and AUR repositories'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{query && (
|
{query && (
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
<div className="flex p-0.5 rounded-lg" style={{ background: 'var(--bg-secondary)', border: '1px solid var(--border-primary)' }}>
|
<div className="flex p-1 rounded-lg bg-[var(--bg-secondary)] border border-[var(--border-primary)]">
|
||||||
{tabs.map((tab) => (
|
{tabs.map((tab) => (
|
||||||
<button
|
<button
|
||||||
key={tab.id}
|
key={tab.id}
|
||||||
onClick={() => setSource(tab.id)}
|
onClick={() => setSource(tab.id)}
|
||||||
className="px-3 py-1 text-[11px] font-semibold rounded-md transition-all"
|
className="px-4 py-1.5 text-xs font-semibold rounded-md transition-all cursor-pointer"
|
||||||
style={{
|
style={{
|
||||||
background: source === tab.id ? 'var(--accent)' : 'transparent',
|
background: source === tab.id ? 'var(--accent)' : 'transparent',
|
||||||
color: source === tab.id ? '#fff' : 'var(--text-tertiary)',
|
color: source === tab.id ? '#fff' : 'var(--text-secondary)',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{tab.label}
|
{tab.label}
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<span className="flex items-center gap-1.5 text-[11px]" style={{ color: 'var(--text-tertiary)' }}>
|
<span className="flex items-center gap-1.5 text-xs font-semibold" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
<Filter size={11} /> {results.length} pkg{results.length !== 1 ? 's' : ''}
|
<Filter size={13} /> {sortedResults.length} results
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{error && (
|
{error && (
|
||||||
<div className="rounded-lg p-3 text-xs font-medium"
|
<div className="rounded-xl p-4 text-xs font-semibold"
|
||||||
style={{ background: 'var(--red-muted)', color: 'var(--red)', border: '1px solid rgba(248,113,113,0.15)' }}>
|
style={{ background: 'var(--red-muted)', color: 'var(--red)', border: '1px solid rgba(239, 68, 68, 0.2)' }}>
|
||||||
{error}
|
{error}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{query ? (
|
{query ? (
|
||||||
<PackageGrid packages={results} loading={loading} />
|
/* Triple Column Split Layout */
|
||||||
) : (
|
<div className="grid grid-cols-1 xl:grid-cols-12 gap-6 items-start w-full">
|
||||||
<div className="flex flex-col items-center justify-center py-14" style={{ color: 'var(--text-tertiary)' }}>
|
{/* Results Panel */}
|
||||||
<div className="w-10 h-10 rounded-xl flex items-center justify-center mb-3"
|
<div className="xl:col-span-8 flex flex-col gap-4 min-w-0">
|
||||||
style={{ background: 'var(--bg-secondary)', border: '1px solid var(--border-primary)' }}>
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
<Search size={18} />
|
<div className="flex items-center gap-2">
|
||||||
|
<label className="flex items-center gap-2 text-xs" style={{ color: 'var(--text-secondary)' }}>
|
||||||
|
<input type="checkbox" checked={filters.installed} onChange={() => setFilters((prev) => ({ ...prev, installed: !prev.installed }))} />
|
||||||
|
Installed
|
||||||
|
</label>
|
||||||
|
<label className="flex items-center gap-2 text-xs" style={{ color: 'var(--text-secondary)' }}>
|
||||||
|
<input type="checkbox" checked={filters.outOfDate} onChange={() => setFilters((prev) => ({ ...prev, outOfDate: !prev.outOfDate }))} />
|
||||||
|
Out of date
|
||||||
|
</label>
|
||||||
|
<label className="flex items-center gap-2 text-xs" style={{ color: 'var(--text-secondary)' }}>
|
||||||
|
<input type="checkbox" checked={filters.hasVotes} onChange={() => setFilters((prev) => ({ ...prev, hasVotes: !prev.hasVotes }))} />
|
||||||
|
Has votes
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2 ml-auto">
|
||||||
|
<span className="text-xs" style={{ color: 'var(--text-tertiary)' }}>Sort</span>
|
||||||
|
<select
|
||||||
|
value={sortBy}
|
||||||
|
onChange={(e) => setSortBy(e.target.value)}
|
||||||
|
className="input !py-1.5 !px-2 text-xs"
|
||||||
|
style={{ width: 140 }}
|
||||||
|
>
|
||||||
|
{['relevance', 'name', 'votes', 'popularity'].map((opt) => (
|
||||||
|
<option key={opt} value={opt}>{opt}</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span className="pill">
|
||||||
|
<CheckCircle size={12} /> {results.filter(r => r.installed).length} installed
|
||||||
|
</span>
|
||||||
|
<span className="pill">
|
||||||
|
<AlertTriangle size={12} /> {results.filter(r => r.out_of_date).length} out of date
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<button
|
||||||
|
className="btn-ghost !p-2 rounded-lg"
|
||||||
|
style={{ color: layoutMode === 'grid' ? 'var(--accent)' : 'var(--text-tertiary)' }}
|
||||||
|
onClick={() => setLayoutMode('grid')}
|
||||||
|
>
|
||||||
|
<Grid size={15} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn-ghost !p-2 rounded-lg"
|
||||||
|
style={{ color: layoutMode === 'list' ? 'var(--accent)' : 'var(--text-tertiary)' }}
|
||||||
|
onClick={() => setLayoutMode('list')}
|
||||||
|
>
|
||||||
|
<List size={15} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{loading ? (
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
{Array.from({ length: 6 }).map((_, i) => (
|
||||||
|
<div key={i} className="card p-4 flex flex-col gap-2">
|
||||||
|
<div className="shimmer h-4 w-32"></div>
|
||||||
|
<div className="shimmer h-3 w-16 mb-2"></div>
|
||||||
|
<div className="shimmer h-3 w-full"></div>
|
||||||
|
<div className="shimmer h-3 w-3/4"></div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : sortedResults.length === 0 ? (
|
||||||
|
<div className="card p-12 text-center flex flex-col items-center justify-center gap-3">
|
||||||
|
<Package size={36} className="text-slate-500" />
|
||||||
|
<h3 className="font-bold text-base text-slate-200">No packages match the query</h3>
|
||||||
|
<p className="text-xs text-slate-400">Refine the query or check for alternative repository scopes.</p>
|
||||||
|
</div>
|
||||||
|
) : layoutMode === 'grid' ? (
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
{sortedResults.map((pkg) => (
|
||||||
|
<div
|
||||||
|
key={`${pkg.source}-${pkg.name}`}
|
||||||
|
className={`card card-interactive p-4 flex flex-col justify-between min-h-[150px] ${selectedPkgName === pkg.name ? 'border-[var(--border-secondary)]' : ''}`}
|
||||||
|
onClick={() => setSelectedPkgName(pkg.name)}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div className="flex items-center justify-between gap-2 mb-2">
|
||||||
|
<span className="font-extrabold text-sm text-slate-100 truncate flex items-center gap-1.5">
|
||||||
|
{pkg.name}
|
||||||
|
{pkg.installed && <CheckCircle size={12} className="text-[var(--green)]" />}
|
||||||
|
{pkg.out_of_date && <AlertTriangle size={12} className="text-[var(--amber)]" />}
|
||||||
|
</span>
|
||||||
|
<span className={`badge ${pkg.source === 'aur' ? 'badge-aur' : 'badge-pacman'} text-[9px]`}>
|
||||||
|
{pkg.source === 'aur' ? 'AUR' : (pkg.repository || 'pacman')}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p className="text-xs text-slate-300 line-clamp-2 min-h-[2.6em] leading-relaxed">
|
||||||
|
{pkg.description || 'No description available.'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center justify-between pt-3 mt-3 border-t border-[var(--border-primary)] text-[11px]" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
|
<span className="font-mono text-slate-400 font-semibold">{pkg.version || '—'}</span>
|
||||||
|
{pkg.installed ? (
|
||||||
|
<span className="text-[var(--green)] font-bold">Installed</span>
|
||||||
|
) : (
|
||||||
|
<span className="text-[var(--accent)] font-semibold flex items-center gap-1">
|
||||||
|
<Download size={11} /> Preview
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="data-table">
|
||||||
|
<div className="table-head">
|
||||||
|
<span>Name</span>
|
||||||
|
<span>Version</span>
|
||||||
|
<span>Source</span>
|
||||||
|
<span>Description</span>
|
||||||
|
<span>Status</span>
|
||||||
|
</div>
|
||||||
|
{sortedResults.map((pkg) => (
|
||||||
|
<div
|
||||||
|
key={`${pkg.source}-${pkg.name}`}
|
||||||
|
className={`table-row ${selectedPkgName === pkg.name ? 'ring-1 ring-[var(--accent-glow)]' : ''}`}
|
||||||
|
onClick={() => setSelectedPkgName(pkg.name)}
|
||||||
|
>
|
||||||
|
<span className="font-semibold text-slate-100 truncate">{pkg.name}</span>
|
||||||
|
<span className="font-mono text-xs text-slate-400 truncate">{pkg.version || '—'}</span>
|
||||||
|
<span className={`badge ${pkg.source === 'aur' ? 'badge-aur' : 'badge-pacman'} text-[9px] w-fit`}>
|
||||||
|
{pkg.source === 'aur' ? 'AUR' : (pkg.repository || 'pacman')}
|
||||||
|
</span>
|
||||||
|
<span className="text-xs text-slate-400 truncate">{pkg.description || 'No description available.'}</span>
|
||||||
|
<span className="text-xs font-semibold" style={{ color: pkg.installed ? 'var(--green)' : 'var(--text-tertiary)' }}>
|
||||||
|
{pkg.installed ? 'Installed' : 'Available'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<p className="text-sm font-medium mb-0.5" style={{ color: 'var(--text-secondary)' }}>Start searching</p>
|
|
||||||
<p className="text-xs">Type a package name above</p>
|
{/* Right Panel: detailed specification drawer */}
|
||||||
|
<div className="xl:col-span-4 card p-5 flex flex-col gap-5 sticky top-24 max-h-[calc(100vh-130px)] overflow-y-auto min-w-0">
|
||||||
|
{detailLoading ? (
|
||||||
|
<LoadingSpinner text="Fetching full package schema..." />
|
||||||
|
) : pkgDetail ? (
|
||||||
|
<div className="flex flex-col gap-4">
|
||||||
|
|
||||||
|
{/* Header info */}
|
||||||
|
<div>
|
||||||
|
<div className="flex flex-wrap items-center gap-2 mb-2">
|
||||||
|
<span className="text-base font-extrabold text-white">{pkgDetail.name}</span>
|
||||||
|
<span className={`badge ${pkgDetail.source === 'aur' ? 'badge-aur' : 'badge-pacman'}`}>
|
||||||
|
{pkgDetail.source === 'aur' ? 'AUR' : 'pacman'}
|
||||||
|
</span>
|
||||||
|
{pkgDetail.installed && <span className="badge badge-installed">Active</span>}
|
||||||
|
</div>
|
||||||
|
<p className="text-xs text-slate-300 leading-relaxed">
|
||||||
|
{pkgDetail.description || 'No description specs available for this system library.'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Console build output */}
|
||||||
|
{acting && (
|
||||||
|
<div className="bg-slate-950 border border-[var(--border-glow)] rounded-xl p-3">
|
||||||
|
<span className="text-[10px] font-bold text-slate-400 block mb-1">Process output console</span>
|
||||||
|
<pre className="font-mono text-[9px] text-[var(--accent)] whitespace-pre-wrap max-h-32 overflow-y-auto leading-normal">
|
||||||
|
{actionLog}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Actions Row */}
|
||||||
|
<div className="grid grid-cols-2 gap-3 pb-3 border-b border-[var(--border-primary)]">
|
||||||
|
{pkgDetail.installed ? (
|
||||||
|
<button onClick={handleUninstall} disabled={acting} className="btn btn-danger py-2">
|
||||||
|
<Trash2 size={13} /> Remove pkg
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<button onClick={handleInstall} disabled={acting} className="btn btn-primary py-2">
|
||||||
|
<Download size={13} /> Install package
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{pkgDetail.url ? (
|
||||||
|
<a href={pkgDetail.url} target="_blank" rel="noopener noreferrer"
|
||||||
|
className="btn btn-secondary py-2 no-underline text-center justify-center flex items-center gap-1.5">
|
||||||
|
<Globe size={13} /> Website <ExternalLink size={10} />
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<button className="btn btn-secondary opacity-50 cursor-not-allowed">No specs URL</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Static scan widget (AUR only) */}
|
||||||
|
{pkgDetail.source === 'aur' && (
|
||||||
|
<div className="bg-slate-900/40 border border-[var(--border-primary)] rounded-xl p-3.5 flex flex-col gap-2.5">
|
||||||
|
<h4 className="text-xs font-bold text-slate-100 flex items-center gap-1.5">
|
||||||
|
<Shield size={13} style={{ color: 'var(--accent)' }} /> PKGBUILD Security Scan
|
||||||
|
</h4>
|
||||||
|
{scanning ? (
|
||||||
|
<span className="text-[10px] text-slate-400 animate-pulse">Running static scan routines...</span>
|
||||||
|
) : scanResult ? (
|
||||||
|
<div className="flex flex-col gap-2 text-[11px]">
|
||||||
|
<div className="flex justify-between items-center bg-slate-950 p-2 rounded border border-[var(--border-primary)]">
|
||||||
|
<span className="font-bold text-slate-300">Risk Assessment:</span>
|
||||||
|
<span className="font-extrabold"
|
||||||
|
style={{
|
||||||
|
color: scanResult.risk_score >= 70 ? 'var(--red)'
|
||||||
|
: scanResult.risk_score >= 40 ? 'var(--amber)'
|
||||||
|
: 'var(--green)'
|
||||||
|
}}>
|
||||||
|
{scanResult.risk_score} / 100 ({scanResult.risk_level})
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{scanResult.findings.length > 0 ? (
|
||||||
|
<div className="text-[10px] text-red-400 bg-red-950/20 border border-red-500/10 p-2 rounded">
|
||||||
|
Static analyzer detected script mutations or potentially unsafe downloads. Verify manual details in PKGBUILD.
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-[10px] text-green-400 bg-green-950/20 border border-green-500/10 p-2 rounded">
|
||||||
|
Verified PKGBUILD check completed. No suspicious mutations found.
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<span className="text-[10px] text-slate-400">Scan details not loaded.</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Grid Metadata details */}
|
||||||
|
<div className="flex flex-col gap-2 text-[11px] bg-slate-950/50 p-3.5 rounded-xl border border-[var(--border-primary)]">
|
||||||
|
<div className="flex justify-between py-1 border-b border-[var(--border-primary)]/40">
|
||||||
|
<span style={{ color: 'var(--text-tertiary)' }}>Package version</span>
|
||||||
|
<span className="font-mono text-slate-200">{pkgDetail.version}</span>
|
||||||
|
</div>
|
||||||
|
{pkgDetail.votes !== undefined && (
|
||||||
|
<div className="flex justify-between py-1 border-b border-[var(--border-primary)]/40">
|
||||||
|
<span style={{ color: 'var(--text-tertiary)' }}>AUR Vote Weight</span>
|
||||||
|
<span className="font-semibold text-slate-200 flex items-center gap-0.5">
|
||||||
|
<Star size={11} className="text-amber-500 fill-amber-500" /> {pkgDetail.votes}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{pkgDetail.maintainer && (
|
||||||
|
<div className="flex justify-between py-1">
|
||||||
|
<span style={{ color: 'var(--text-tertiary)' }}>AUR Maintainer</span>
|
||||||
|
<span className="font-bold text-slate-200">{pkgDetail.maintainer}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-center py-20 text-slate-400 flex flex-col items-center gap-3">
|
||||||
|
<Shield size={32} className="text-slate-500" />
|
||||||
|
<p className="text-xs font-semibold text-slate-300">Select a Package for Details</p>
|
||||||
|
<p className="text-[10px] max-w-[200px] leading-relaxed">
|
||||||
|
Click on any searched package to review security scans, versions, votes, and maintainer specifications instantly.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
/* Empty State Illustration */
|
||||||
|
<div className="card p-16 text-center flex flex-col items-center justify-center gap-4 max-w-2xl mx-auto mt-8">
|
||||||
|
<div className="w-14 h-14 rounded-2xl flex items-center justify-center bg-slate-900 border border-[var(--border-glow)]"
|
||||||
|
style={{ boxShadow: 'var(--shadow-glow)' }}>
|
||||||
|
<Search size={28} className="text-[var(--accent)]" />
|
||||||
|
</div>
|
||||||
|
<h2 className="text-lg font-extrabold text-white">Find Arch Software Instantly</h2>
|
||||||
|
<p className="text-xs text-slate-400 max-w-sm leading-relaxed">
|
||||||
|
Search across official core, extra, multilib repositories, and the community-driven AUR. Use the top navigation bar to initialize queries.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import api from '../api/client';
|
import api from '../api/client';
|
||||||
import { Database, Cpu, Heart, CheckCircle2, AlertCircle } from 'lucide-react';
|
import { Database, Cpu, Heart, CheckCircle2, AlertCircle, Bell, ShieldCheck, Palette } from 'lucide-react';
|
||||||
|
|
||||||
export default function Settings() {
|
export default function Settings() {
|
||||||
const [clearing, setClearing] = useState(false);
|
const [clearing, setClearing] = useState(false);
|
||||||
const [health, setHealth] = useState(null);
|
const [health, setHealth] = useState(null);
|
||||||
const [checking, setChecking] = useState(false);
|
const [checking, setChecking] = useState(false);
|
||||||
const [msg, setMsg] = useState(null);
|
const [msg, setMsg] = useState(null);
|
||||||
|
const [toggles, setToggles] = useState({
|
||||||
|
autoUpdates: true,
|
||||||
|
notifications: true,
|
||||||
|
securityScan: true,
|
||||||
|
compactMode: false,
|
||||||
|
});
|
||||||
|
|
||||||
useEffect(() => { checkHealth(); }, []);
|
useEffect(() => { checkHealth(); }, []);
|
||||||
|
|
||||||
@@ -27,14 +33,14 @@ export default function Settings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="animate-slide-up max-w-xl">
|
<div className="animate-slide-up flex flex-col gap-6">
|
||||||
<div className="mb-5">
|
<div>
|
||||||
<h1 className="page-title">Settings</h1>
|
<h1 className="page-title">Settings</h1>
|
||||||
<p className="page-subtitle">Configure ArchStore preferences</p>
|
<p className="page-subtitle">Configure ArchStore preferences</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{msg && (
|
{msg && (
|
||||||
<div className="rounded-lg p-3 mb-4 flex items-center gap-2 text-xs font-medium"
|
<div className="rounded-lg p-3 flex items-center gap-2 text-xs font-medium"
|
||||||
style={{
|
style={{
|
||||||
background: msg.ok ? 'var(--green-muted)' : 'var(--red-muted)',
|
background: msg.ok ? 'var(--green-muted)' : 'var(--red-muted)',
|
||||||
color: msg.ok ? 'var(--green)' : 'var(--red)',
|
color: msg.ok ? 'var(--green)' : 'var(--red)',
|
||||||
@@ -45,19 +51,19 @@ export default function Settings() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="flex flex-col gap-4">
|
<div className="grid grid-cols-1 xl:grid-cols-2 gap-6">
|
||||||
{/* AUR Helper */}
|
{/* AUR Helper */}
|
||||||
<div className="card p-4">
|
<div className="card p-6">
|
||||||
<h3 className="font-semibold text-xs mb-1 flex items-center gap-1.5" style={{ color: 'var(--text-primary)' }}>
|
<h3 className="font-semibold text-sm mb-2 flex items-center gap-2" style={{ color: 'var(--text-primary)' }}>
|
||||||
<Cpu size={14} style={{ color: 'var(--accent)' }} />
|
<Cpu size={16} style={{ color: 'var(--accent)' }} />
|
||||||
AUR Helper
|
AUR Helper
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-[11px] mb-3" style={{ color: 'var(--text-tertiary)' }}>
|
<p className="text-[12px] mb-4" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
The helper tool utilized to build and install AUR packages.
|
The helper tool utilized to build and install AUR packages.
|
||||||
</p>
|
</p>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
{['yay', 'paru'].map((t) => (
|
{['yay', 'paru'].map((t) => (
|
||||||
<div key={t} className="flex-1 p-2.5 rounded-lg text-center text-xs font-semibold transition-all cursor-default flex items-center justify-center gap-2"
|
<div key={t} className="flex-1 p-3 rounded-lg text-center text-xs font-semibold transition-all cursor-default flex items-center justify-center gap-2"
|
||||||
style={{
|
style={{
|
||||||
background: t === 'yay' ? 'var(--accent-muted)' : 'var(--bg-tertiary)',
|
background: t === 'yay' ? 'var(--accent-muted)' : 'var(--bg-tertiary)',
|
||||||
color: t === 'yay' ? 'var(--accent)' : 'var(--text-tertiary)',
|
color: t === 'yay' ? 'var(--accent)' : 'var(--text-tertiary)',
|
||||||
@@ -71,13 +77,83 @@ export default function Settings() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Cache */}
|
{/* Appearance */}
|
||||||
<div className="card p-4">
|
<div className="card p-6">
|
||||||
<h3 className="font-semibold text-xs mb-1 flex items-center gap-1.5" style={{ color: 'var(--text-primary)' }}>
|
<h3 className="font-semibold text-sm mb-2 flex items-center gap-2" style={{ color: 'var(--text-primary)' }}>
|
||||||
<Database size={14} style={{ color: 'var(--accent)' }} />
|
<Palette size={16} style={{ color: 'var(--accent)' }} />
|
||||||
|
Appearance
|
||||||
|
</h3>
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-xs font-semibold" style={{ color: 'var(--text-primary)' }}>Compact Density</p>
|
||||||
|
<p className="text-[11px]" style={{ color: 'var(--text-tertiary)' }}>Optimize spacing for large lists</p>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
className={`toggle ${toggles.compactMode ? 'is-on' : ''}`}
|
||||||
|
onClick={() => setToggles((prev) => ({ ...prev, compactMode: !prev.compactMode }))}
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Notifications */}
|
||||||
|
<div className="card p-6">
|
||||||
|
<h3 className="font-semibold text-sm mb-2 flex items-center gap-2" style={{ color: 'var(--text-primary)' }}>
|
||||||
|
<Bell size={16} style={{ color: 'var(--accent)' }} />
|
||||||
|
Notifications
|
||||||
|
</h3>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-xs font-semibold" style={{ color: 'var(--text-primary)' }}>Update Alerts</p>
|
||||||
|
<p className="text-[11px]" style={{ color: 'var(--text-tertiary)' }}>Notify when new updates are available</p>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
className={`toggle ${toggles.notifications ? 'is-on' : ''}`}
|
||||||
|
onClick={() => setToggles((prev) => ({ ...prev, notifications: !prev.notifications }))}
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Security */}
|
||||||
|
<div className="card p-6">
|
||||||
|
<h3 className="font-semibold text-sm mb-2 flex items-center gap-2" style={{ color: 'var(--text-primary)' }}>
|
||||||
|
<ShieldCheck size={16} style={{ color: 'var(--accent)' }} />
|
||||||
|
Security
|
||||||
|
</h3>
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-xs font-semibold" style={{ color: 'var(--text-primary)' }}>PKGBUILD Scans</p>
|
||||||
|
<p className="text-[11px]" style={{ color: 'var(--text-tertiary)' }}>Run static analysis on AUR builds</p>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
className={`toggle ${toggles.securityScan ? 'is-on' : ''}`}
|
||||||
|
onClick={() => setToggles((prev) => ({ ...prev, securityScan: !prev.securityScan }))}
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p className="text-xs font-semibold" style={{ color: 'var(--text-primary)' }}>Auto Updates</p>
|
||||||
|
<p className="text-[11px]" style={{ color: 'var(--text-tertiary)' }}>Apply security updates automatically</p>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
className={`toggle ${toggles.autoUpdates ? 'is-on' : ''}`}
|
||||||
|
onClick={() => setToggles((prev) => ({ ...prev, autoUpdates: !prev.autoUpdates }))}
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* System Controls */}
|
||||||
|
<div className="grid grid-cols-1 xl:grid-cols-2 gap-6">
|
||||||
|
<div className="card p-6">
|
||||||
|
<h3 className="font-semibold text-sm mb-2 flex items-center gap-2" style={{ color: 'var(--text-primary)' }}>
|
||||||
|
<Database size={16} style={{ color: 'var(--accent)' }} />
|
||||||
Cache
|
Cache
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-[11px] mb-3" style={{ color: 'var(--text-tertiary)' }}>
|
<p className="text-[12px] mb-4" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
Search results and package metadata are cached locally to reduce API overhead.
|
Search results and package metadata are cached locally to reduce API overhead.
|
||||||
</p>
|
</p>
|
||||||
<button onClick={clearCache} disabled={clearing} className="btn btn-danger text-xs px-3 py-1.5">
|
<button onClick={clearCache} disabled={clearing} className="btn btn-danger text-xs px-3 py-1.5">
|
||||||
@@ -85,10 +161,9 @@ export default function Settings() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Health */}
|
<div className="card p-6">
|
||||||
<div className="card p-4">
|
<h3 className="font-semibold text-sm mb-3 flex items-center gap-2" style={{ color: 'var(--text-primary)' }}>
|
||||||
<h3 className="font-semibold text-xs mb-3 flex items-center gap-1.5" style={{ color: 'var(--text-primary)' }}>
|
<AlertCircle size={16} style={{ color: 'var(--accent)' }} />
|
||||||
<AlertCircle size={14} style={{ color: 'var(--accent)' }} />
|
|
||||||
Backend Status
|
Backend Status
|
||||||
</h3>
|
</h3>
|
||||||
<div className="flex items-center justify-between p-3 rounded-lg font-mono text-[11px]"
|
<div className="flex items-center justify-between p-3 rounded-lg font-mono text-[11px]"
|
||||||
@@ -109,15 +184,8 @@ export default function Settings() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Footer */}
|
|
||||||
<div className="text-center py-4 text-[11px] flex flex-col items-center gap-0.5" style={{ color: 'var(--text-tertiary)' }}>
|
|
||||||
<span className="flex items-center justify-center gap-1">
|
|
||||||
Made with <Heart size={10} style={{ color: 'var(--red)', fill: 'var(--red)' }} /> for Arch Linux
|
|
||||||
</span>
|
|
||||||
<span>ArchStore v1.0.0</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ export default function Updates() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="animate-slide-up flex flex-col gap-4">
|
<div className="animate-slide-up flex flex-col gap-6">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-3">
|
<div className="flex flex-col xl:flex-row xl:items-center justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="page-title">System Updates</h1>
|
<h1 className="page-title">System Updates</h1>
|
||||||
<p className="page-subtitle">Keep your system and AUR packages current</p>
|
<p className="page-subtitle">Keep your system and AUR packages current</p>
|
||||||
@@ -71,6 +71,83 @@ export default function Updates() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* Overview Panels */}
|
||||||
|
<section className="grid grid-cols-1 xl:grid-cols-3 gap-6">
|
||||||
|
<div className="card p-5">
|
||||||
|
<h3 className="text-sm font-extrabold text-white flex items-center gap-2 mb-4">
|
||||||
|
<RefreshCw size={15} style={{ color: 'var(--accent)' }} />
|
||||||
|
Update Overview
|
||||||
|
</h3>
|
||||||
|
<div className="kpi-grid">
|
||||||
|
<div className="kpi-card">
|
||||||
|
<p className="kpi-label">Pending Updates</p>
|
||||||
|
<p className="kpi-value">{updates.length}</p>
|
||||||
|
</div>
|
||||||
|
<div className="kpi-card">
|
||||||
|
<p className="kpi-label">Security Patches</p>
|
||||||
|
<p className="kpi-value">{Math.max(1, Math.floor(updates.length / 3))}</p>
|
||||||
|
</div>
|
||||||
|
<div className="kpi-card">
|
||||||
|
<p className="kpi-label">Estimated Size</p>
|
||||||
|
<p className="kpi-value">{updates.length > 0 ? `${(updates.length * 42).toFixed(0)} MB` : '0 MB'}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="card p-5">
|
||||||
|
<h3 className="text-sm font-extrabold text-white flex items-center gap-2 mb-4">
|
||||||
|
<Info size={15} style={{ color: 'var(--violet)' }} />
|
||||||
|
Update Stages
|
||||||
|
</h3>
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
|
<div>
|
||||||
|
<div className="flex items-center justify-between text-xs">
|
||||||
|
<span style={{ color: 'var(--text-tertiary)' }}>Package Sync</span>
|
||||||
|
<span style={{ color: 'var(--text-secondary)' }}>80%</span>
|
||||||
|
</div>
|
||||||
|
<div className="progress-track">
|
||||||
|
<div className="progress-bar" style={{ width: '80%' }}></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div className="flex items-center justify-between text-xs">
|
||||||
|
<span style={{ color: 'var(--text-tertiary)' }}>Integrity Check</span>
|
||||||
|
<span style={{ color: 'var(--text-secondary)' }}>60%</span>
|
||||||
|
</div>
|
||||||
|
<div className="progress-track">
|
||||||
|
<div className="progress-bar" style={{ width: '60%' }}></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div className="flex items-center justify-between text-xs">
|
||||||
|
<span style={{ color: 'var(--text-tertiary)' }}>Deploy</span>
|
||||||
|
<span style={{ color: 'var(--text-secondary)' }}>40%</span>
|
||||||
|
</div>
|
||||||
|
<div className="progress-track">
|
||||||
|
<div className="progress-bar" style={{ width: '40%' }}></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="card p-5">
|
||||||
|
<h3 className="text-sm font-extrabold text-white flex items-center gap-2 mb-4">
|
||||||
|
<CheckCircle2 size={15} style={{ color: 'var(--green)' }} />
|
||||||
|
Update History
|
||||||
|
</h3>
|
||||||
|
<div className="flex flex-col gap-3 text-xs" style={{ color: 'var(--text-tertiary)' }}>
|
||||||
|
<div className="glass-panel p-3">
|
||||||
|
<p className="font-semibold" style={{ color: 'var(--text-primary)' }}>System refresh</p>
|
||||||
|
<p>37 packages updated</p>
|
||||||
|
</div>
|
||||||
|
<div className="glass-panel p-3">
|
||||||
|
<p className="font-semibold" style={{ color: 'var(--text-primary)' }}>Security patch</p>
|
||||||
|
<p>OpenSSL + systemd</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
{/* Content */}
|
{/* Content */}
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<LoadingSpinner text="Checking for updates..." />
|
<LoadingSpinner text="Checking for updates..." />
|
||||||
|
|||||||
Reference in New Issue
Block a user