mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-01 20:55:16 +09:00
Merge pull request #200 from jhd3197/feat/ux-docker-unavailable
feat(docker): calmer 'Docker not available' state
This commit is contained in:
19 files changed
+102
-72
No files matched your search
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "على Linux، تأكد من بدء تشغيل البرنامج الخفي Docker",
|
||||
"retryConnection": "أعد محاولة الاتصال",
|
||||
"targets": "الأهداف",
|
||||
"toUseDockerManagement": "لاستخدام إدارة Docker:",
|
||||
"verifyTheUserHasPermissionsTo": "تحقق من أن المستخدم لديه أذونات للوصول إلى Docker",
|
||||
"volumes": "وحدات التخزين"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "Linux এ, নিশ্চিত করুন যে Docker ডেমন শুরু হয়েছে",
|
||||
"retryConnection": "সংযোগ পুনরায় চেষ্টা করুন",
|
||||
"targets": "টার্গেট",
|
||||
"toUseDockerManagement": "Docker ব্যবস্থাপনা ব্যবহার করতে:",
|
||||
"verifyTheUserHasPermissionsTo": "ব্যবহারকারীর Docker অ্যাক্সেস করার অনুমতি আছে তা যাচাই করুন",
|
||||
"volumes": "ভলিউম"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "Stellen Sie unter Linux sicher, dass der Docker-Daemon gestartet ist",
|
||||
"retryConnection": "Verbindung erneut versuchen",
|
||||
"targets": "Ziele",
|
||||
"toUseDockerManagement": "So verwenden Sie die Docker-Verwaltung:",
|
||||
"verifyTheUserHasPermissionsTo": "Stellen Sie sicher, dass der Benutzer über Berechtigungen zum Zugriff auf Docker verfügt",
|
||||
"volumes": "Volumes"
|
||||
},
|
||||
|
||||
@@ -2068,15 +2068,18 @@
|
||||
"compose": "Compose",
|
||||
"containers": "Containers",
|
||||
"couldntConnectToDaemon": "Couldn't connect to the Docker daemon.",
|
||||
"details": "Details",
|
||||
"dockerIsNotInstalledOrNot": "Docker is not installed or not running on this system.",
|
||||
"dockerNotAvailable": "Docker not available",
|
||||
"ensureDockerDesktopIsInstalledAnd": "Ensure Docker Desktop is installed and running",
|
||||
"grantAccess": "Grant access",
|
||||
"images": "Images",
|
||||
"installDocker": "Install Docker",
|
||||
"networks": "Networks",
|
||||
"onLinuxMakeSureTheDocker": "On Linux, make sure the Docker daemon is started",
|
||||
"retryConnection": "Retry connection",
|
||||
"startTheDaemon": "Start the daemon",
|
||||
"targets": "Targets",
|
||||
"toUseDockerManagement": "To use Docker management:",
|
||||
"verifyTheUserHasPermissionsTo": "Verify the user has permissions to access Docker",
|
||||
"volumes": "Volumes"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "En Linux, asegúrate de que el demonio de Docker esté iniciado",
|
||||
"retryConnection": "Reintentar conexión",
|
||||
"targets": "Destinos",
|
||||
"toUseDockerManagement": "Para usar la gestión de Docker:",
|
||||
"verifyTheUserHasPermissionsTo": "Verifica que el usuario tenga permisos para acceder a Docker",
|
||||
"volumes": "Volúmenes"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "Sur Linux, assurez-vous que le démon Docker est démarré",
|
||||
"retryConnection": "Réessayer la connexion",
|
||||
"targets": "Cibles",
|
||||
"toUseDockerManagement": "Pour utiliser la gestion Docker :",
|
||||
"verifyTheUserHasPermissionsTo": "Vérifiez que l'utilisateur dispose des autorisations nécessaires pour accéder à Docker.",
|
||||
"volumes": "Volumes"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "Pada Linux, pastikan daemon Docker dimulai",
|
||||
"retryConnection": "Coba Lagi Koneksi",
|
||||
"targets": "Target",
|
||||
"toUseDockerManagement": "Untuk menggunakan manajemen Docker:",
|
||||
"verifyTheUserHasPermissionsTo": "Verifikasikan bahwa pengguna memiliki izin untuk mengakses Docker",
|
||||
"volumes": "Volume"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "Su Linux, assicurati che il demone Docker sia avviato",
|
||||
"retryConnection": "Riprovare la connessione",
|
||||
"targets": "Destinazioni",
|
||||
"toUseDockerManagement": "Per utilizzare la gestione Docker:",
|
||||
"verifyTheUserHasPermissionsTo": "Verificare che l'utente disponga delle autorizzazioni per accedere a Docker",
|
||||
"volumes": "Volumi"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "Linux에서는 Docker 데몬이 시작되었는지 확인하세요.",
|
||||
"retryConnection": "연결 재시도",
|
||||
"targets": "대상",
|
||||
"toUseDockerManagement": "Docker 관리를 사용하려면:",
|
||||
"verifyTheUserHasPermissionsTo": "사용자에게 Docker에 액세스할 수 있는 권한이 있는지 확인",
|
||||
"volumes": "볼륨"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "W przypadku Linux upewnij się, że demon Docker jest uruchomiony",
|
||||
"retryConnection": "Ponów próbę połączenia",
|
||||
"targets": "Cele",
|
||||
"toUseDockerManagement": "Aby skorzystać z zarządzania Docker:",
|
||||
"verifyTheUserHasPermissionsTo": "Sprawdź, czy użytkownik ma uprawnienia dostępu do Docker",
|
||||
"volumes": "Woluminy"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "No Linux, certifique-se de que o daemon Docker esteja iniciado",
|
||||
"retryConnection": "Tentar novamente a conexão",
|
||||
"targets": "Alvos",
|
||||
"toUseDockerManagement": "Para usar o gerenciamento do Docker:",
|
||||
"verifyTheUserHasPermissionsTo": "Verifique se o usuário tem permissões para acessar o Docker",
|
||||
"volumes": "Volumes"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "В Linux убедитесь, что демон Docker запущен.",
|
||||
"retryConnection": "Повторить попытку подключения",
|
||||
"targets": "Цели",
|
||||
"toUseDockerManagement": "Чтобы использовать управление Docker:",
|
||||
"verifyTheUserHasPermissionsTo": "Убедитесь, что у пользователя есть разрешения на доступ к Docker.",
|
||||
"volumes": "Тома"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "บน Linux ตรวจสอบให้แน่ใจว่า Docker daemon เริ่มทำงานแล้ว",
|
||||
"retryConnection": "ลองเชื่อมต่ออีกครั้ง",
|
||||
"targets": "เป้าหมาย",
|
||||
"toUseDockerManagement": "หากต้องการใช้การจัดการ Docker:",
|
||||
"verifyTheUserHasPermissionsTo": "ตรวจสอบว่าผู้ใช้มีสิทธิ์ในการเข้าถึง Docker",
|
||||
"volumes": "โวลุ่ม"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "Linux'de Docker arka plan programının başlatıldığından emin olun",
|
||||
"retryConnection": "Bağlantıyı Yeniden Dene",
|
||||
"targets": "Hedefler",
|
||||
"toUseDockerManagement": "Docker yönetimini kullanmak için:",
|
||||
"verifyTheUserHasPermissionsTo": "Kullanıcının Docker'ye erişim izinleri olduğunu doğrulayın",
|
||||
"volumes": "Birimler"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "Trên Linux, hãy đảm bảo daemon Docker được khởi động",
|
||||
"retryConnection": "Thử lại kết nối",
|
||||
"targets": "Mục tiêu",
|
||||
"toUseDockerManagement": "Để sử dụng quản lý Docker:",
|
||||
"verifyTheUserHasPermissionsTo": "Xác minh người dùng có quyền truy cập Docker",
|
||||
"volumes": "Volume"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "在 Linux 上,确保 Docker 守护进程已启动",
|
||||
"retryConnection": "重试连接",
|
||||
"targets": "目标",
|
||||
"toUseDockerManagement": "使用 Docker 管理:",
|
||||
"verifyTheUserHasPermissionsTo": "验证用户是否有访问Docker的权限",
|
||||
"volumes": "卷"
|
||||
},
|
||||
|
||||
@@ -2042,7 +2042,6 @@
|
||||
"onLinuxMakeSureTheDocker": "在 Linux 上,確保 Docker 守護程式已啟動",
|
||||
"retryConnection": "重試連線",
|
||||
"targets": "目標",
|
||||
"toUseDockerManagement": "使用 Docker 管理:",
|
||||
"verifyTheUserHasPermissionsTo": "驗證使用者是否有權限存取 Docker",
|
||||
"volumes": "磁碟區"
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { MetricCard, KpiBand } from '@/components/ds';
|
||||
import ServerPicker from '../components/ServerPicker';
|
||||
import PageLayout from '@/layouts/PageLayout';
|
||||
import { Box, Layers, HardDrive, Network as NetworkIcon, Package } from 'lucide-react';
|
||||
import { Box, Boxes, ChevronDown, Download, Power, RefreshCw, UserCheck, Layers, HardDrive, Network as NetworkIcon, Package } from 'lucide-react';
|
||||
import {
|
||||
ServerContext,
|
||||
VALID_TABS,
|
||||
@@ -27,6 +27,7 @@ const Docker = () => {
|
||||
const [activeTab] = useTabParam('/docker', VALID_TABS);
|
||||
const [dockerStatus, setDockerStatus] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [retrying, setRetrying] = useState(false);
|
||||
const [selectedServer, setSelectedServer] = useState(LOCAL_DOCKER_TARGET);
|
||||
const [availableServers, setAvailableServers] = useState([LOCAL_DOCKER_TARGET]);
|
||||
const [stats, setStats] = useState({
|
||||
@@ -65,8 +66,8 @@ const Docker = () => {
|
||||
return () => { cancelled = true; };
|
||||
}, []);
|
||||
|
||||
async function checkDockerStatus() {
|
||||
setLoading(true);
|
||||
async function checkDockerStatus(silent = false) {
|
||||
if (!silent) setLoading(true);
|
||||
try {
|
||||
if (selectedServer.id === 'local') {
|
||||
const status = await api.getDockerStatus();
|
||||
@@ -93,6 +94,12 @@ const Docker = () => {
|
||||
}
|
||||
}
|
||||
|
||||
async function retry() {
|
||||
setRetrying(true);
|
||||
await checkDockerStatus(true);
|
||||
setRetrying(false);
|
||||
}
|
||||
|
||||
async function loadStats() {
|
||||
try {
|
||||
let containersData, imagesData, volumesData, networksData;
|
||||
@@ -174,35 +181,40 @@ const Docker = () => {
|
||||
<PageLayout className="docker-page" icon={<Box size={18} />} title={t('common.labels.docker', 'Docker')}>
|
||||
<div className="docker-unavailable">
|
||||
<div className="docker-unavailable-icon">
|
||||
<svg viewBox="0 0 24 24" width="64" height="64" stroke="currentColor" fill="none" strokeWidth="1">
|
||||
<rect x="2" y="7" width="5" height="5" rx="1"/>
|
||||
<rect x="9" y="7" width="5" height="5" rx="1"/>
|
||||
<rect x="16" y="7" width="5" height="5" rx="1"/>
|
||||
<rect x="2" y="14" width="5" height="5" rx="1"/>
|
||||
<rect x="9" y="14" width="5" height="5" rx="1"/>
|
||||
<path d="M21 12c0 4-3 7-8 7s-8-3-8-7" strokeDasharray="2 2"/>
|
||||
</svg>
|
||||
<Boxes size={32} />
|
||||
</div>
|
||||
<h2>{t('app.docker.dockerNotAvailable', 'Docker not available')}</h2>
|
||||
<p className="docker-unavailable-message">
|
||||
{t('app.docker.dockerIsNotInstalledOrNot', 'Docker is not installed or not running on this system.')}
|
||||
</p>
|
||||
<div className="docker-unavailable-details">
|
||||
<ul className="docker-unavailable-steps">
|
||||
<li title={t('app.docker.ensureDockerDesktopIsInstalledAnd', 'Ensure Docker Desktop is installed and running')}>
|
||||
<Download size={18} />
|
||||
<span>{t('app.docker.installDocker', 'Install Docker')}</span>
|
||||
</li>
|
||||
<li title={t('app.docker.onLinuxMakeSureTheDocker', 'On Linux, make sure the Docker daemon is started')}>
|
||||
<Power size={18} />
|
||||
<span>{t('app.docker.startTheDaemon', 'Start the daemon')}</span>
|
||||
</li>
|
||||
<li title={t('app.docker.verifyTheUserHasPermissionsTo', 'Verify the user has permissions to access Docker')}>
|
||||
<UserCheck size={18} />
|
||||
<span>{t('app.docker.grantAccess', 'Grant access')}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<details className="docker-unavailable-disclosure">
|
||||
<summary>
|
||||
{t('app.docker.details', 'Details')}
|
||||
<ChevronDown size={14} />
|
||||
</summary>
|
||||
<code>{dockerStatus?.error || t('app.docker.couldntConnectToDaemon', "Couldn't connect to the Docker daemon.")}</code>
|
||||
</div>
|
||||
<div className="docker-unavailable-help">
|
||||
<h4>{t('app.docker.toUseDockerManagement', 'To use Docker management:')}</h4>
|
||||
<ul>
|
||||
<li>{t('app.docker.ensureDockerDesktopIsInstalledAnd', 'Ensure Docker Desktop is installed and running')}</li>
|
||||
<li>{t('app.docker.onLinuxMakeSureTheDocker', 'On Linux, make sure the Docker daemon is started')}</li>
|
||||
<li>{t('app.docker.verifyTheUserHasPermissionsTo', 'Verify the user has permissions to access Docker')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<Button onClick={checkDockerStatus}>
|
||||
<svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" fill="none" strokeWidth="2">
|
||||
<path d="M23 4v6h-6M1 20v-6h6"/>
|
||||
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/>
|
||||
</svg>
|
||||
</details>
|
||||
<Button onClick={retry} disabled={retrying}>
|
||||
<RefreshCw size={16} className={retrying ? 'docker-unavailable-spin' : undefined} />
|
||||
{t('app.docker.retryConnection', 'Retry connection')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -155,17 +155,17 @@
|
||||
margin: 0 auto;
|
||||
|
||||
.docker-unavailable-icon {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: fade($color-docker, 10%);
|
||||
border-radius: $radius-overlay;
|
||||
margin-bottom: $space-6;
|
||||
margin-block-end: $space-5;
|
||||
color: $color-docker;
|
||||
|
||||
svg {
|
||||
stroke: $color-docker;
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
@@ -183,12 +183,60 @@
|
||||
margin: 0 0 $space-4 0;
|
||||
}
|
||||
|
||||
.docker-unavailable-details {
|
||||
.docker-unavailable-steps {
|
||||
list-style: none;
|
||||
margin: 0 0 $space-4 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
margin-bottom: $space-6;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: $space-2;
|
||||
|
||||
li {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: $space-2;
|
||||
padding: $space-3 $space-2;
|
||||
background: $bg-hover;
|
||||
border: 1px solid $border-subtle;
|
||||
border-radius: $radius-control;
|
||||
color: $text-secondary;
|
||||
font-size: $text-xs;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
}
|
||||
|
||||
.docker-unavailable-disclosure {
|
||||
width: 100%;
|
||||
margin-block-end: $space-6;
|
||||
text-align: start;
|
||||
|
||||
summary {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: $space-1;
|
||||
cursor: pointer;
|
||||
color: $text-tertiary;
|
||||
font-size: $text-xs;
|
||||
list-style: none;
|
||||
|
||||
&::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
svg {
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
}
|
||||
|
||||
&[open] summary svg {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
code {
|
||||
display: block;
|
||||
margin-block-start: $space-3;
|
||||
padding: $space-3 $space-4;
|
||||
background: $bg-hover;
|
||||
border: 1px solid $border-subtle;
|
||||
@@ -196,39 +244,22 @@
|
||||
font-family: $font-mono;
|
||||
font-size: $text-xs;
|
||||
color: $text-tertiary;
|
||||
word-break: break-all;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.docker-unavailable-help {
|
||||
width: 100%;
|
||||
padding: $space-5;
|
||||
background: $bg-hover;
|
||||
border-radius: $radius-card;
|
||||
text-align: left;
|
||||
margin-bottom: $space-6;
|
||||
|
||||
h4 {
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
margin: 0 0 $space-3 0;
|
||||
color: $text-primary;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
padding-left: $space-5;
|
||||
margin: $space-3 0 0 0;
|
||||
padding-inline-start: $space-5;
|
||||
font-size: $text-xs;
|
||||
color: $text-secondary;
|
||||
}
|
||||
}
|
||||
|
||||
li {
|
||||
font-size: $text-xs;
|
||||
color: $text-secondary;
|
||||
margin-bottom: $space-2;
|
||||
.docker-unavailable-spin {
|
||||
animation: spinner-rotate 0.8s linear infinite;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user