mirror of
https://github.com/yusufipk/RepoHub.git
synced 2026-09-11 18:46:07 +00:00
refactor: remove unused server-side sync scripts
- Deleted cron-setup.sh for automated sync scheduling - Removed init-backend.sh database initialization script - Removed server-sync.sh for platform synchronization
This commit is contained in:
@@ -205,7 +205,7 @@ export function PackageBrowserV2({
|
||||
</CardHeader>
|
||||
<CardContent className="pt-0">
|
||||
<div className="text-center py-8 text-muted-foreground">
|
||||
Please select a platform first
|
||||
{t('platform.please_select')}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -219,7 +219,7 @@ export function PackageBrowserV2({
|
||||
<PackageIcon className="h-5 w-5" />
|
||||
{t('packages.title')}
|
||||
<span className="text-sm font-normal text-muted-foreground">
|
||||
({packages.length} of {totalCount} packages for {selectedPlatform?.name || 'Unknown Platform'})
|
||||
{t('packages.count_label', { current: packages.length, total: totalCount, platform: selectedPlatform?.name || 'Unknown Platform' })}
|
||||
</span>
|
||||
</CardTitle>
|
||||
<CardDescription className="text-sm">
|
||||
|
||||
@@ -16,6 +16,16 @@ export function PlatformSelector({ selectedPlatform, onPlatformSelect }: Platfor
|
||||
const { t } = useLocale()
|
||||
const [platforms, setPlatforms] = useState<Platform[]>([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
|
||||
const iconSlug: Record<string, string> = {
|
||||
debian: 'debian',
|
||||
ubuntu: 'ubuntu',
|
||||
fedora: 'fedora',
|
||||
arch: 'archlinux',
|
||||
windows: 'windows',
|
||||
macos: 'apple'
|
||||
}
|
||||
const iconBase = (slug: string) => `https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/${slug}.svg`
|
||||
|
||||
useEffect(() => {
|
||||
const loadPlatforms = async () => {
|
||||
@@ -62,29 +72,37 @@ export function PlatformSelector({ selectedPlatform, onPlatformSelect }: Platfor
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-0">
|
||||
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3">
|
||||
<div className="grid grid-cols-3 sm:grid-cols-4 lg:grid-cols-6 gap-2">
|
||||
{platforms.map((platform) => (
|
||||
<Button
|
||||
key={platform.id}
|
||||
variant={selectedPlatform?.id === platform.id ? "default" : "outline"}
|
||||
className="h-auto p-3 flex flex-col items-center space-y-1"
|
||||
variant="outline"
|
||||
className={`h-12 px-2 py-1 flex flex-col items-center justify-center gap-1 rounded-md border transition-colors
|
||||
${selectedPlatform?.id === platform.id
|
||||
? 'border-primary ring-2 ring-primary/60 bg-primary/5'
|
||||
: 'border-border hover:bg-secondary/60'}`}
|
||||
onClick={() => onPlatformSelect(platform)}
|
||||
>
|
||||
<div className="text-xl">{platform.icon}</div>
|
||||
<div
|
||||
className={`h-5 w-5 ${selectedPlatform?.id === platform.id ? 'text-foreground' : 'text-muted-foreground'}`}
|
||||
style={{
|
||||
WebkitMaskImage: `url(${iconBase(iconSlug[platform.id] || 'linux')})`,
|
||||
maskImage: `url(${iconBase(iconSlug[platform.id] || 'linux')})`,
|
||||
WebkitMaskRepeat: 'no-repeat',
|
||||
maskRepeat: 'no-repeat',
|
||||
WebkitMaskSize: 'contain',
|
||||
maskSize: 'contain',
|
||||
WebkitMaskPosition: 'center',
|
||||
maskPosition: 'center',
|
||||
backgroundColor: 'currentColor'
|
||||
} as React.CSSProperties}
|
||||
/>
|
||||
<div className="text-center">
|
||||
<div className="font-semibold text-sm">{platform.name}</div>
|
||||
<div className="text-xs text-muted-foreground">{platform.packageManager}</div>
|
||||
<div className="font-medium text-xs leading-tight truncate max-w-[90px]">{platform.name}</div>
|
||||
</div>
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
{selectedPlatform && (
|
||||
<div className="mt-3 p-3 bg-secondary rounded-md">
|
||||
<p className="text-xs">
|
||||
<strong>{t('platform.selected')}:</strong> {selectedPlatform.name} ({selectedPlatform.packageManager})
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user