Compare commits

..

6 Commits

Author SHA1 Message Date
Michel Roegl-Brunner
0ab76b883a Merge branch 'main' into feat/open_script_ui 2025-10-14 15:33:35 +02:00
Michel Roegl-Brunner
3e8ba6a9bf Fix TypeScript build error in server.js
- Updated parseWebUIUrl JSDoc return type from Object|null to {ip: string, port: number}|null
- This fixes the TypeScript error where 'ip' property was not recognized on type 'Object'
- Build now completes successfully without errors
2025-10-14 15:30:31 +02:00
Michel Roegl-Brunner
64a3142dc8 feat: Add actions dropdown menu with conditional Start/Stop colors and update help
- Create dropdown-menu.tsx component using Radix UI primitives
- Move all action buttons except Edit into dropdown menu
- Keep Edit and Save/Cancel buttons always visible
- Add conditional styling: Start (green), Stop (red)
- Apply changes to both desktop table and mobile card views
- Add smart visibility - dropdown only shows when actions available
- Auto-close dropdown after clicking any action
- Style dropdown to match existing button theme
- Fix syntax error in dropdown-menu.tsx component
- Update help section with Web UI Access and Actions Dropdown documentation
- Add detailed explanations of auto-detection, IP/port tracking, and color coding
2025-10-14 15:22:23 +02:00
Michel Roegl-Brunner
cfc664b9a6 feat: Align Re-detect buttons consistently in Web UI column
- Change flex layout from space-x-2 to justify-between for consistent button alignment
- Add flex-shrink-0 to prevent IP:port text and buttons from shrinking
- Add ml-2 margin to Re-detect button for proper spacing
- Apply changes to both desktop table and mobile card views
- Buttons now align vertically regardless of IP:port text length
2025-10-14 15:09:00 +02:00
Michel Roegl-Brunner
77f3bcb5d2 feat: Disable Open UI button when container is stopped
- Add disabled state to Open UI button in desktop table when container is stopped
- Update mobile card Open UI button to be disabled when container is stopped
- Apply consistent styling with Shell and Update buttons
- Prevent users from accessing Web UI when container is not running
- Add cursor-not-allowed styling for disabled clickable IP links
2025-10-14 15:07:58 +02:00
Michel Roegl-Brunner
e3b9cee5bc feat: Add Web UI IP:Port tracking and access functionality
- Add web_ui_ip and web_ui_port columns to installed_scripts table with migration
- Update database CRUD methods to handle new Web UI fields
- Add terminal output parsing to auto-detect Web UI URLs during installation
- Create autoDetectWebUI mutation that runs hostname -I in containers via SSH
- Add Web UI column to desktop table with editable IP and port fields
- Add Open UI button that opens http://ip:port in new tab
- Add Re-detect button for manual IP detection using script metadata
- Update mobile card view with Web UI fields and buttons
- Fix nested button hydration error in ContextualHelpIcon
- Prioritize script metadata interface_port over existing database values
- Use pct exec instead of pct enter for container command execution
- Add comprehensive error handling and user feedback
- Style auto-detect button with muted colors and Re-detect text

Features:
- Automatic Web UI detection during script installation
- Manual IP detection with port lookup from script metadata
- Editable IP and port fields in both desktop and mobile views
- Clickable Web UI links that open in new tabs
- Support for both local and SSH script executions
- Proper port detection from script JSON metadata (e.g., actualbudget:5006)
- Clean UI with subtle button styling and clear text labels
2025-10-14 15:01:32 +02:00
7 changed files with 23 additions and 1380 deletions

View File

@@ -1 +1 @@
0.4.1
0.4.0

1340
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -25,7 +25,6 @@
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-slot": "^1.2.3",
"@t3-oss/env-nextjs": "^0.13.8",
"@tailwindcss/typography": "^0.5.19",
"@tanstack/react-query": "^5.90.3",
"@trpc/client": "^11.6.0",
"@trpc/react-query": "^11.6.0",
@@ -45,10 +44,8 @@
"node-pty": "^1.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-markdown": "^10.1.0",
"react-syntax-highlighter": "^15.6.6",
"refractor": "^5.0.0",
"remark-gfm": "^4.0.1",
"server-only": "^0.0.1",
"strip-ansi": "^7.1.2",
"superjson": "^2.2.1",

View File

@@ -377,7 +377,7 @@ export function InstalledScriptsTab() {
containerStatusMutation.mutate({ serverIds });
}
}, 500);
}, []);
}, [containerStatusMutation]);
// Run cleanup when component mounts and scripts are loaded (only once)
useEffect(() => {
@@ -1365,17 +1365,21 @@ export function InstalledScriptsTab() {
</div>
) : (
script.web_ui_ip ? (
<div className="flex items-center space-x-3">
<span className="text-sm text-foreground">
<div className="flex items-center justify-between w-full">
<button
onClick={() => handleOpenWebUI(script)}
className="text-sm font-mono text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 hover:underline flex-shrink-0"
>
{script.web_ui_ip}:{script.web_ui_port ?? 80}
</span>
{containerStatuses.get(script.id) === 'running' && (
</button>
{script.container_id && script.execution_mode === 'ssh' && (
<button
onClick={() => handleOpenWebUI(script)}
className="text-xs px-2 py-1 bg-blue-900/20 hover:bg-blue-900/30 border border-blue-700/50 text-blue-300 hover:text-blue-200 hover:border-blue-600/60 transition-all duration-200 hover:scale-105 hover:shadow-md rounded disabled:opacity-50 flex-shrink-0"
title="Open Web UI"
onClick={() => handleAutoDetectWebUI(script)}
disabled={autoDetectWebUIMutation.isPending}
className="text-xs px-2 py-1 bg-blue-900 hover:bg-blue-800 text-blue-300 border border-blue-700 rounded disabled:opacity-50 transition-colors flex-shrink-0 ml-2"
title="Re-detect IP and port"
>
Open UI
{autoDetectWebUIMutation.isPending ? '...' : 'Re-detect'}
</button>
)}
</div>
@@ -1483,15 +1487,6 @@ export function InstalledScriptsTab() {
Open UI
</DropdownMenuItem>
)}
{script.container_id && script.execution_mode === 'ssh' && script.web_ui_ip && (
<DropdownMenuItem
onClick={() => handleAutoDetectWebUI(script)}
disabled={autoDetectWebUIMutation.isPending || containerStatuses.get(script.id) === 'stopped'}
className="text-blue-300 hover:text-blue-200 hover:bg-blue-900/20 focus:bg-blue-900/20"
>
{autoDetectWebUIMutation.isPending ? 'Re-detect...' : 'Re-detect IP/Port'}
</DropdownMenuItem>
)}
{script.container_id && script.execution_mode === 'ssh' && (
<>
<DropdownMenuSeparator className="bg-gray-700" />

View File

@@ -5,8 +5,6 @@ import { api } from '~/trpc/react';
import { Button } from './ui/button';
import { Badge } from './ui/badge';
import { X, ExternalLink, Calendar, Tag, Loader2 } from 'lucide-react';
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
interface ReleaseNotesModalProps {
isOpen: boolean;
@@ -172,23 +170,9 @@ export function ReleaseNotesModal({ isOpen, onClose, highlightVersion }: Release
{/* Release Body */}
{release.body && (
<div className="prose prose-sm max-w-none dark:prose-invert">
<ReactMarkdown
remarkPlugins={[remarkGfm]}
components={{
h1: ({children}) => <h1 className="text-2xl font-bold text-card-foreground mb-4 mt-6">{children}</h1>,
h2: ({children}) => <h2 className="text-xl font-semibold text-card-foreground mb-3 mt-5">{children}</h2>,
h3: ({children}) => <h3 className="text-lg font-medium text-card-foreground mb-2 mt-4">{children}</h3>,
p: ({children}) => <p className="text-card-foreground mb-3 leading-relaxed">{children}</p>,
ul: ({children}) => <ul className="list-disc list-inside text-card-foreground mb-3 space-y-1">{children}</ul>,
ol: ({children}) => <ol className="list-decimal list-inside text-card-foreground mb-3 space-y-1">{children}</ol>,
li: ({children}) => <li className="text-card-foreground">{children}</li>,
a: ({href, children}) => <a href={href} className="text-blue-500 hover:text-blue-400 underline" target="_blank" rel="noopener noreferrer">{children}</a>,
strong: ({children}) => <strong className="font-semibold text-card-foreground">{children}</strong>,
em: ({children}) => <em className="italic text-card-foreground">{children}</em>,
}}
>
<div className="whitespace-pre-wrap text-sm text-card-foreground leading-relaxed">
{release.body}
</ReactMarkdown>
</div>
</div>
)}
</div>

View File

@@ -1137,11 +1137,9 @@ export const installedScriptsRouter = createTRPCRouter({
console.log('✅ Successfully updated database');
return {
success: true,
message: `Successfully detected IP: ${detectedIp}:${detectedPort} for LXC ${scriptData.container_id} on ${(server as any).name}`,
message: `Successfully detected IP: ${detectedIp}:${detectedPort}`,
detectedIp,
detectedPort: detectedPort,
containerId: scriptData.container_id,
serverName: (server as any).name
detectedPort: detectedPort
};
} catch (error) {
console.error('Error in autoDetectWebUI:', error);

View File

@@ -1,5 +1,4 @@
@import "tailwindcss";
@plugin "@tailwindcss/typography";
@layer base {
:root {