Skip to content

Commit 9608aff

Browse files
Change Position of text
1 parent ac23d01 commit 9608aff

File tree

2 files changed

+104
-53
lines changed

2 files changed

+104
-53
lines changed

src/app/_components/HelpModal.tsx

Lines changed: 103 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useState } from 'react';
44
import { Button } from './ui/button';
5-
import { HelpCircle, Server, Settings, RefreshCw, Clock, Package, HardDrive, FolderOpen, Search, Download, Lock } from 'lucide-react';
5+
import { HelpCircle, Server, Settings, RefreshCw, Clock, Package, HardDrive, FolderOpen, Search, Download, Lock, GitBranch } from 'lucide-react';
66
import { useRegisterModal } from './modal/ModalStackProvider';
77

88
interface HelpModalProps {
@@ -11,7 +11,7 @@ interface HelpModalProps {
1111
initialSection?: string;
1212
}
1313

14-
type HelpSection = 'server-settings' | 'general-settings' | 'auth-settings' | 'sync-button' | 'auto-sync' | 'available-scripts' | 'downloaded-scripts' | 'installed-scripts' | 'lxc-settings' | 'update-system';
14+
type HelpSection = 'server-settings' | 'general-settings' | 'auth-settings' | 'sync-button' | 'auto-sync' | 'available-scripts' | 'downloaded-scripts' | 'installed-scripts' | 'lxc-settings' | 'update-system' | 'repositories';
1515

1616
export function HelpModal({ isOpen, onClose, initialSection = 'server-settings' }: HelpModalProps) {
1717
useRegisterModal(isOpen, { id: 'help-modal', allowEscape: true, onClose });
@@ -25,6 +25,7 @@ export function HelpModal({ isOpen, onClose, initialSection = 'server-settings'
2525
{ id: 'auth-settings' as HelpSection, label: 'Authentication Settings', icon: Lock },
2626
{ id: 'sync-button' as HelpSection, label: 'Sync Button', icon: RefreshCw },
2727
{ id: 'auto-sync' as HelpSection, label: 'Auto-Sync', icon: Clock },
28+
{ id: 'repositories' as HelpSection, label: 'Repositories', icon: GitBranch },
2829
{ id: 'available-scripts' as HelpSection, label: 'Available Scripts', icon: Package },
2930
{ id: 'downloaded-scripts' as HelpSection, label: 'Downloaded Scripts', icon: HardDrive },
3031
{ id: 'installed-scripts' as HelpSection, label: 'Installed Scripts', icon: FolderOpen },
@@ -379,6 +380,106 @@ export function HelpModal({ isOpen, onClose, initialSection = 'server-settings'
379380
</div>
380381
);
381382

383+
case 'repositories':
384+
return (
385+
<div className="space-y-6">
386+
<div>
387+
<h3 className="text-xl font-semibold text-foreground mb-4">Repositories</h3>
388+
<p className="text-muted-foreground mb-6">
389+
Manage script repositories (GitHub repositories) and configure which repositories to use for syncing scripts.
390+
</p>
391+
</div>
392+
393+
<div className="space-y-4">
394+
<div className="p-4 border border-border rounded-lg">
395+
<h4 className="font-medium text-foreground mb-2">What Are Repositories?</h4>
396+
<p className="text-sm text-muted-foreground mb-2">
397+
Repositories are GitHub repositories that contain scripts and their metadata. Scripts are organized by repositories, allowing you to add custom repositories or manage which repositories are active.
398+
</p>
399+
<p className="text-sm text-muted-foreground">
400+
You can add custom repositories or manage existing ones in General Settings &gt; Repositories.
401+
</p>
402+
</div>
403+
404+
<div className="p-4 border border-border rounded-lg">
405+
<h4 className="font-medium text-foreground mb-2">Repository Structure</h4>
406+
<p className="text-sm text-muted-foreground mb-2">
407+
For a repository to work with this system, it must follow this structure:
408+
</p>
409+
<ul className="text-sm text-muted-foreground space-y-2 ml-4 list-disc">
410+
<li><strong>JSON files:</strong> Must be located in a <code className="bg-muted px-1 rounded">frontend/public/json/</code> folder at the repository root. Each JSON file contains metadata for a script (name, description, installation methods, etc.).</li>
411+
<li><strong>Script files:</strong> Must be organized in subdirectories:
412+
<ul className="ml-4 mt-1 space-y-1 list-disc">
413+
<li><code className="bg-muted px-1 rounded">ct/</code> - Container scripts (LXC)</li>
414+
<li><code className="bg-muted px-1 rounded">install/</code> - Installation scripts</li>
415+
<li><code className="bg-muted px-1 rounded">tools/</code> - Tool scripts</li>
416+
<li><code className="bg-muted px-1 rounded">vm/</code> - Virtual machine scripts</li>
417+
</ul>
418+
</li>
419+
</ul>
420+
</div>
421+
422+
<div className="p-4 border border-border rounded-lg">
423+
<h4 className="font-medium text-foreground mb-2">Default Repositories</h4>
424+
<p className="text-sm text-muted-foreground mb-2">
425+
The system comes with two default repositories that cannot be deleted:
426+
</p>
427+
<ul className="text-sm text-muted-foreground space-y-2 ml-4 list-disc">
428+
<li><strong>Main Repository (ProxmoxVE):</strong> The primary repository at <code className="bg-muted px-1 rounded">github.com/community-scripts/ProxmoxVE</code>. This is enabled by default and contains stable, production-ready scripts. This repository cannot be deleted.</li>
429+
<li><strong>Dev Repository (ProxmoxVED):</strong> The development/testing repository at <code className="bg-muted px-1 rounded">github.com/community-scripts/ProxmoxVED</code>. This is disabled by default and contains experimental or in-development scripts. This repository cannot be deleted.</li>
430+
</ul>
431+
</div>
432+
433+
<div className="p-4 border border-border rounded-lg">
434+
<h4 className="font-medium text-foreground mb-2">Enable vs Disable</h4>
435+
<p className="text-sm text-muted-foreground mb-2">
436+
You can enable or disable repositories to control which scripts are available:
437+
</p>
438+
<ul className="text-sm text-muted-foreground space-y-2 ml-4 list-disc">
439+
<li><strong>Enabled:</strong> Scripts from this repository are included in the Available Scripts tab and will be synced when you sync repositories. Enabled repositories are checked for updates during sync operations.</li>
440+
<li><strong>Disabled:</strong> Scripts from this repository are excluded from the Available Scripts tab and will not be synced. Scripts already downloaded from a disabled repository remain on your system but won&apos;t appear in the list. Disabled repositories are not checked for updates.</li>
441+
</ul>
442+
<p className="text-xs text-muted-foreground mt-2">
443+
<strong>Note:</strong> Disabling a repository doesn&apos;t delete scripts you&apos;ve already downloaded from it. They remain on your system but are hidden from the Available Scripts list.
444+
</p>
445+
</div>
446+
447+
<div className="p-4 border border-border rounded-lg">
448+
<h4 className="font-medium text-foreground mb-2">Repository Filter Buttons</h4>
449+
<p className="text-sm text-muted-foreground mb-2">
450+
When multiple repositories are enabled, filter buttons appear in the filter bar on the Available Scripts tab.
451+
</p>
452+
<ul className="text-sm text-muted-foreground space-y-2 ml-4 list-disc">
453+
<li>Each enabled repository gets its own filter button</li>
454+
<li>Click a repository button to toggle showing/hiding scripts from that repository</li>
455+
<li>Active buttons are highlighted with primary styling</li>
456+
<li>Inactive buttons have muted styling</li>
457+
<li>This allows you to quickly focus on scripts from specific repositories</li>
458+
</ul>
459+
<p className="text-xs text-muted-foreground mt-2">
460+
<strong>Note:</strong> Filter buttons only appear when more than one repository is enabled. If only one repository is enabled, all scripts from that repository are shown by default.
461+
</p>
462+
</div>
463+
464+
<div className="p-4 border border-border rounded-lg">
465+
<h4 className="font-medium text-foreground mb-2">Adding Custom Repositories</h4>
466+
<p className="text-sm text-muted-foreground mb-2">
467+
You can add your own GitHub repositories to access custom scripts:
468+
</p>
469+
<ol className="text-sm text-muted-foreground space-y-2 ml-4 list-decimal">
470+
<li>Go to General Settings &gt; Repositories</li>
471+
<li>Enter the GitHub repository URL (format: <code className="bg-muted px-1 rounded">https://github.com/owner/repo</code>)</li>
472+
<li>Choose whether to enable it immediately</li>
473+
<li>Click &quot;Add Repository&quot;</li>
474+
</ol>
475+
<p className="text-xs text-muted-foreground mt-2">
476+
<strong>Important:</strong> Custom repositories must follow the repository structure described above. Repositories that don&apos;t follow this structure may not work correctly.
477+
</p>
478+
</div>
479+
</div>
480+
</div>
481+
);
482+
382483
case 'available-scripts':
383484
return (
384485
<div className="space-y-6">
@@ -411,56 +512,6 @@ export function HelpModal({ isOpen, onClose, initialSection = 'server-settings'
411512
</ul>
412513
</div>
413514

414-
<div className="p-4 border border-border rounded-lg">
415-
<h4 className="font-medium text-foreground mb-2">Repository Management</h4>
416-
<p className="text-sm text-muted-foreground mb-3">
417-
Scripts are organized by repositories (GitHub repositories). You can add custom repositories or manage existing ones in General Settings.
418-
</p>
419-
420-
<div className="space-y-3">
421-
<div>
422-
<h5 className="font-medium text-foreground mb-1 text-sm">Repository Structure</h5>
423-
<p className="text-sm text-muted-foreground mb-2">
424-
For a repository to work with this system, it must follow this structure:
425-
</p>
426-
<ul className="text-xs text-muted-foreground space-y-1 ml-4 list-disc">
427-
<li><strong>JSON files:</strong> Must be located in a <code className="bg-muted px-1 rounded">frontend/public/json/</code> folder at the repository root</li>
428-
<li><strong>Script files:</strong> Must be organized in subdirectories:
429-
<ul className="ml-4 mt-1 space-y-0.5 list-disc">
430-
<li><code className="bg-muted px-1 rounded">ct/</code> - Container scripts</li>
431-
<li><code className="bg-muted px-1 rounded">install/</code> - Installation scripts</li>
432-
<li><code className="bg-muted px-1 rounded">tools/</code> - Tool scripts</li>
433-
<li><code className="bg-muted px-1 rounded">vm/</code> - Virtual machine scripts</li>
434-
</ul>
435-
</li>
436-
</ul>
437-
</div>
438-
439-
<div>
440-
<h5 className="font-medium text-foreground mb-1 text-sm">Default Repositories</h5>
441-
<ul className="text-xs text-muted-foreground space-y-1 ml-4 list-disc">
442-
<li><strong>Main Repository (ProxmoxVE):</strong> The primary repository, enabled by default. This repository cannot be deleted.</li>
443-
<li><strong>Dev Repository (ProxmoxVED):</strong> Development/testing repository, disabled by default. This repository cannot be deleted.</li>
444-
</ul>
445-
</div>
446-
447-
<div>
448-
<h5 className="font-medium text-foreground mb-1 text-sm">Enable vs Disable</h5>
449-
<ul className="text-xs text-muted-foreground space-y-1 ml-4 list-disc">
450-
<li><strong>Enabled:</strong> Scripts from this repository are included in the Available Scripts tab and will be synced when you sync repositories.</li>
451-
<li><strong>Disabled:</strong> Scripts from this repository are excluded from the Available Scripts tab and will not be synced. Scripts already downloaded from a disabled repository remain on your system but won&apos;t appear in the list.</li>
452-
</ul>
453-
</div>
454-
455-
<div>
456-
<h5 className="font-medium text-foreground mb-1 text-sm">Repository Filter Buttons</h5>
457-
<p className="text-xs text-muted-foreground">
458-
When multiple repositories are enabled, filter buttons appear in the filter bar. Click a repository button to toggle showing/hiding scripts from that repository. Active buttons are highlighted. This allows you to quickly focus on scripts from specific repositories.
459-
</p>
460-
</div>
461-
</div>
462-
</div>
463-
464515
<div className="p-4 border border-border rounded-lg">
465516
<h4 className="font-medium text-foreground mb-2">Script Actions</h4>
466517
<ul className="text-sm text-muted-foreground space-y-2">

src/app/_components/ResyncButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function ResyncButton() {
4242
return (
4343
<div className="flex flex-col sm:flex-row sm:items-center gap-3">
4444
<div className="text-sm text-muted-foreground font-medium">
45-
Sync scripts with ProxmoxVE repo
45+
Sync scripts with configured repositories
4646
</div>
4747
<div className="flex flex-col sm:flex-row sm:items-center gap-3">
4848
<div className="flex items-center gap-2">

0 commit comments

Comments
 (0)