Files
Atomcms-edit/resources/views/filament/components/commandocentrum/emulator-status.blade.php
T
root 2f30a058a4 feat: add full i18n support to Commandocentrum
- Replace all hardcoded Dutch/English strings with __() translation calls
- Update 13 Blade components to use translation keys
- Update Commandocentrum.php controller with translation calls
- Add comprehensive Dutch (nl.json) and English (en.json) translations
- 150+ translation keys for UI labels, messages, and notifications
- Supports all 21 languages available in the lang/ directory
2026-05-19 21:49:39 +02:00

86 lines
5.0 KiB
PHP
Executable File

@props([
'emulatorOnline',
'jarExists',
'serviceName',
'sourceCommit',
'remoteVersion',
'canBuild',
'jarPath',
'sourcePath',
])
@php
$sourceCommitShort = substr($sourceCommit, 0, 7);
$hasUpdate = $sourceCommit !== 'N/A' && $remoteVersion !== 'N/A' && $sourceCommitShort !== $remoteVersion;
$updateColor = $hasUpdate ? '#f59e0b' : '#22c55e';
$updateText = $hasUpdate ? '🔄 ' . __('commandocentrum.update_available') : '✓ ' . __('commandocentrum.up_to_date');
$btnColor = $hasUpdate ? '#f59e0b' : '#3b82f6';
$btnGradient = $hasUpdate ? 'linear-gradient(135deg,#f59e0b,#d97706)' : 'linear-gradient(135deg,#3b82f6,#2563eb)';
$btnText = $hasUpdate ? '⚡ ' . __('commandocentrum.update') : '🔄 ' . __('commandocentrum.rebuild');
$jarFileName = '';
if ($jarExists) {
$jarSize = shell_exec('ls -lh ' . escapeshellarg($jarPath) . '/*.jar 2>/dev/null | head -1');
if ($jarSize) {
preg_match('/(\S+\.jar)/', $jarSize, $matches);
if (isset($matches[1])) {
$jarFileName = basename($matches[1]);
}
}
}
@endphp
<div style="display:flex;flex-direction:column;gap:8px;font-size:13px;">
<div style="display:flex;gap:16px;">
@if ($emulatorOnline)
<span style="color:#22c55e;"> {{ __('commandocentrum.online') }}</span>
@else
<span style="color:#ef4444;"> {{ __('commandocentrum.offline') }}</span>
@endif
@if ($jarExists)
<span style="color:#22c55e;"> JAR {{ __('commandocentrum.ok') }}</span>
@else
<span style="color:#ef4444;"> JAR {{ __('commandocentrum.missing') }}</span>
@endif
<span style="color:#3b82f6;">{{ __('commandocentrum.service') }}: {{ e($serviceName) }}</span>
</div>
<div style="padding-top:8px;border-top:1px solid #e2e8f0;">
<div style="font-weight:600;color:#475569;margin-bottom:8px;">GitHub {{ __('commandocentrum.status') }}:</div>
<div style="background:{{ $hasUpdate ? '#fef3c7' : '#dcfce7' }};padding:12px;border-radius:8px;margin-bottom:12px;">
<div style="display:flex;align-items:center;justify-content:space-between;">
<div style="display:flex;align-items:center;gap:8px;font-weight:600;color:{{ $updateColor }};">
{{ $updateText }}
</div>
<button
wire:click="checkEmulatorUpdates"
style="background:{{ $btnGradient }};padding:8px 16px;border-radius:6px;color:white;border:none;cursor:pointer;font-weight:600;font-size:12px;box-shadow:0 2px 8px rgba(0,0,0,0.2);transition:transform 0.2s,box-shadow 0.2s;"
onmouseover="this.style.transform='translateY(-1px)';this.style.boxShadow='0 4px 12px rgba(0,0,0,0.3)'"
onmouseout="this.style.transform='translateY(0)';this.style.boxShadow='0 2px 8px rgba(0,0,0,0.2)'"
>
{{ $btnText }}
</button>
</div>
</div>
<div style="display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid #f1f5f9;"><span>{{ __('commandocentrum.latest') }}:</span><span style="color:#22c55e;font-weight:600;"> {{ e($remoteVersion) }}</span></div>
<div style="display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid #f1f5f9;"><span>{{ __('commandocentrum.source') }}:</span><span style="color:#22c55e;font-weight:600;"> {{ $sourceCommitShort }}</span></div>
@if ($jarFileName !== '')
<div style="display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid #f1f5f9;"><span>{{ __('commandocentrum.jars') }}:</span><span style="color:#22c55e;font-weight:600;"> {{ e($jarFileName) }}</span></div>
@endif
@if ($canBuild)
<div style="display:flex;justify-content:space-between;padding:6px 0;"><span>{{ __('commandocentrum.method') }}:</span><span style="color:#22c55e;font-weight:600;"> {{ __('commandocentrum.maven_pom') }}</span></div>
@else
<div style="display:flex;justify-content:space-between;padding:6px 0;"><span>{{ __('commandocentrum.method') }}:</span><span style="color:#f59e0b;font-weight:600;">⚠️ {{ __('commandocentrum.no_pom') }}</span></div>
@endif
<div style="margin-top:12px;padding:12px;background:#f8fafc;border-radius:8px;">
<div style="font-size:11px;color:#64748b;font-weight:600;margin-bottom:8px;">{{ __('commandocentrum.method') }}:</div>
@if ($jarExists)
<div style="color:#3b82f6;font-weight:600;">📦 {{ __('commandocentrum.jar_download_restart') }}</div>
@elseif ($canBuild)
<div style="color:#3b82f6;font-weight:600;">🔨 {{ __('commandocentrum.maven_build_restart') }}</div>
@else
<div style="color:#64748b;">{{ __('commandocentrum.manual_download') }}</div>
@endif
</div>
</div>
</div>