Status LED
Dieser Commit ist enthalten in:
@ -68,6 +68,19 @@ class ProjectTile(ctk.CTkFrame):
|
||||
title_row = ctk.CTkFrame(container, fg_color="transparent")
|
||||
title_row.pack(fill="x", pady=(0, 5))
|
||||
|
||||
# Service status indicator for Admin Panel and Activity Server
|
||||
if self.project.id in ["admin-panel-permanent", "activity-server-permanent"]:
|
||||
self.service_status_indicator = ctk.CTkLabel(
|
||||
title_row,
|
||||
text="⚫", # Gray circle by default
|
||||
font=('Segoe UI', 10),
|
||||
text_color=COLORS['text_dim'],
|
||||
width=20
|
||||
)
|
||||
self.service_status_indicator.pack(side="left", padx=(0, 5))
|
||||
# Initialize tooltip
|
||||
self._update_service_tooltip("Wird geprüft...")
|
||||
|
||||
# Activity indicator (initially hidden)
|
||||
self.activity_indicator = ctk.CTkLabel(
|
||||
title_row,
|
||||
@ -209,8 +222,8 @@ class ProjectTile(ctk.CTkFrame):
|
||||
)
|
||||
self.open_button.pack(side="left", padx=(0, 5))
|
||||
|
||||
# CMD button only for main VPS Server tile (not Admin Panel or Docker)
|
||||
if self.is_vps and self.project.id == "vps-permanent":
|
||||
# CMD button for VPS Server and Activity Server
|
||||
if self.project.id in ["vps-permanent", "activity-server-permanent"]:
|
||||
self.cmd_button = ctk.CTkButton(
|
||||
button_frame,
|
||||
text="CMD",
|
||||
@ -220,8 +233,8 @@ class ProjectTile(ctk.CTkFrame):
|
||||
)
|
||||
self.cmd_button.pack(side="left", padx=(0, 5))
|
||||
|
||||
# Gitea button (not for VPS)
|
||||
if not self.is_vps:
|
||||
# Gitea button and Activity button (not for VPS and not for Activity Server)
|
||||
if not self.is_vps and self.project.id != "activity-server-permanent":
|
||||
self.gitea_button = ctk.CTkButton(
|
||||
button_frame,
|
||||
text="Gitea ▼",
|
||||
@ -246,8 +259,8 @@ class ProjectTile(ctk.CTkFrame):
|
||||
if not activity_service.is_configured() or not activity_service.connected:
|
||||
self.activity_button.configure(state="normal", text_color=COLORS['text_dim'])
|
||||
|
||||
# Delete button (not for VPS) - keep it in first row
|
||||
if not self.is_vps and self.on_delete:
|
||||
# Delete button (not for VPS and not for Activity Server) - keep it in first row
|
||||
if not self.is_vps and self.on_delete and self.project.id != "activity-server-permanent":
|
||||
self.delete_button = ctk.CTkButton(
|
||||
button_frame,
|
||||
text="✕",
|
||||
@ -259,8 +272,8 @@ class ProjectTile(ctk.CTkFrame):
|
||||
)
|
||||
self.delete_button.pack(side="right")
|
||||
|
||||
# Second row - Open Explorer button (only for non-VPS tiles)
|
||||
if not self.is_vps:
|
||||
# Second row - Open Explorer button (only for non-VPS tiles and not for Activity Server)
|
||||
if not self.is_vps and self.project.id != "activity-server-permanent":
|
||||
explorer_frame = ctk.CTkFrame(container, fg_color="transparent")
|
||||
explorer_frame.pack(fill="x", pady=(5, 0))
|
||||
|
||||
@ -416,7 +429,41 @@ class ProjectTile(ctk.CTkFrame):
|
||||
if platform.system() == 'Windows':
|
||||
# Create a temporary batch file for Windows
|
||||
with tempfile.NamedTemporaryFile(mode='w', suffix='.bat', delete=False) as f:
|
||||
batch_content = f'''@echo off
|
||||
# Different content based on which tile's CMD button was pressed
|
||||
if self.project.id == "activity-server-permanent":
|
||||
batch_content = f'''@echo off
|
||||
echo Connecting to CPM Activity Server...
|
||||
echo.
|
||||
echo Target Directory: /home/claude-dev/cpm-activity-server
|
||||
echo.
|
||||
|
||||
REM Try using plink if available (PuTTY command line)
|
||||
where plink >nul 2>&1
|
||||
if %ERRORLEVEL% EQU 0 (
|
||||
echo Using PuTTY plink for connection...
|
||||
echo.
|
||||
echo After connection, please run:
|
||||
echo cd /home/claude-dev/cpm-activity-server
|
||||
echo.
|
||||
plink -ssh -l {ssh_user} -pw "{ssh_pass}" {ssh_host}
|
||||
) else (
|
||||
echo PuTTY plink not found. Trying ssh with manual password entry...
|
||||
echo.
|
||||
echo Password: {ssh_pass}
|
||||
echo.
|
||||
echo Please copy the password above and paste it when prompted.
|
||||
echo.
|
||||
echo After login, run: cd /home/claude-dev/cpm-activity-server
|
||||
echo.
|
||||
pause
|
||||
ssh {ssh_user}@{ssh_host}
|
||||
)
|
||||
|
||||
pause
|
||||
'''
|
||||
else:
|
||||
# Regular VPS Server connection
|
||||
batch_content = f'''@echo off
|
||||
echo Connecting to VPS Server...
|
||||
echo.
|
||||
echo Please wait while establishing connection...
|
||||
@ -715,6 +762,71 @@ pause
|
||||
# Update activity button if exists
|
||||
if hasattr(self, 'activity_button'):
|
||||
self.activity_button.configure(text="▶")
|
||||
|
||||
def update_service_status(self, is_online: bool):
|
||||
"""Update service status indicator"""
|
||||
if hasattr(self, 'service_status_indicator'):
|
||||
if is_online:
|
||||
self.service_status_indicator.configure(
|
||||
text="🟢",
|
||||
text_color=COLORS['accent_success']
|
||||
)
|
||||
self._update_service_tooltip("Online")
|
||||
else:
|
||||
self.service_status_indicator.configure(
|
||||
text="🔴",
|
||||
text_color=COLORS['accent_error']
|
||||
)
|
||||
self._update_service_tooltip("Offline")
|
||||
|
||||
def _update_service_tooltip(self, status: str):
|
||||
"""Update tooltip for service status"""
|
||||
if hasattr(self, 'service_status_indicator'):
|
||||
# Store status for tooltip
|
||||
self.service_status = status
|
||||
|
||||
# Bind hover events if not already bound
|
||||
if not hasattr(self, '_service_tooltip_bound'):
|
||||
self.service_status_indicator.bind("<Enter>", self._show_service_tooltip)
|
||||
self.service_status_indicator.bind("<Leave>", self._hide_service_tooltip)
|
||||
self._service_tooltip_bound = True
|
||||
|
||||
def _show_service_tooltip(self, event):
|
||||
"""Show service status tooltip"""
|
||||
if hasattr(self, 'service_tooltip'):
|
||||
self.service_tooltip.destroy()
|
||||
|
||||
self.service_tooltip = ctk.CTkToplevel(self)
|
||||
self.service_tooltip.wm_overrideredirect(True)
|
||||
self.service_tooltip.configure(fg_color=COLORS['bg_secondary'])
|
||||
|
||||
# Get status text
|
||||
status_text = getattr(self, 'service_status', 'Wird geprüft...')
|
||||
if status_text == "Online":
|
||||
display_text = "✓ Service ist online"
|
||||
elif status_text == "Offline":
|
||||
display_text = "✗ Service ist offline"
|
||||
else:
|
||||
display_text = "⟳ Status wird geprüft..."
|
||||
|
||||
label = ctk.CTkLabel(
|
||||
self.service_tooltip,
|
||||
text=display_text,
|
||||
font=FONTS['small'],
|
||||
text_color=COLORS['text_primary'],
|
||||
fg_color=COLORS['bg_secondary']
|
||||
)
|
||||
label.pack(padx=8, pady=5)
|
||||
|
||||
# Position tooltip
|
||||
x = self.service_status_indicator.winfo_rootx()
|
||||
y = self.service_status_indicator.winfo_rooty() + 25
|
||||
self.service_tooltip.geometry(f"+{x}+{y}")
|
||||
|
||||
def _hide_service_tooltip(self, event):
|
||||
"""Hide service status tooltip"""
|
||||
if hasattr(self, 'service_tooltip'):
|
||||
self.service_tooltip.destroy()
|
||||
|
||||
def _show_activity_tooltip(self, user_name: str):
|
||||
"""Show tooltip with active user name"""
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren