@extends('layouts.app') @section('title', 'Docker 管理') @push('styles') @endpush @section('content')

Docker 管理

{{-- 主機選擇器 --}} @if($hosts->count() > 1)
@else @if($currentHost) {{ $currentHost->name }} @endif @endif
@if($canManage && $isLocal) 新增 Compose @endif
{{-- 系統概況卡片 --}}
{{ $info['containers_running'] }}
執行中容器
{{ $info['containers_stopped'] }}
已停止容器
{{ $info['images'] }}
Images
{{ $info['cpus'] }}
CPU 核心 / {{ $info['mem_total'] }}
{{-- 頁籤導覽 --}}
{{-- ══ 頁籤:容器 ══ --}}
@if($canManage)@endif @forelse($containers as $c) @php $cmeta = $c['compose'] ? ($composeMeta[$c['compose']] ?? []) : []; @endphp @if($canManage) @else @endif @empty @endforelse
# 客戶 容器名稱 對應 Port 用途 狀態 資源 負責人 建立日期操作
{{ $loop->iteration }} @if(!empty($cmeta['client'])) {{ $cmeta['client'] }} @else @endif {{ $c['name'] }} @if($c['compose'])
{{ $c['compose'] }} @endif
{{ $c['id'] }}
@foreach($c['ports'] as $p) {{ $p }} @endforeach @if(empty($c['ports']))@endif @if(!empty($cmeta['purpose'])) {{ $cmeta['purpose'] }} @else @endif {{ $c['state'] }}
{{ $c['status'] }}
@if($c['state']==='running')
載入中…
@else
@endif
@if(!empty($cmeta['owner'])) {{ $cmeta['owner'] }} @else @endif {{ $c['created'] ? date('Y-m-d', $c['created']) : '—' }} @if($c['state']==='running') @else @endif
目前沒有容器
Docker {{ $info['docker_version'] }} · {{ $info['os'] }}
{{-- ══ 頁籤:Compose ══ --}}
@if($canManage) @endif @if(empty($composes))
尚無 Compose 設定 @if($canManage),新增一個@endif
@else
@if($canManage)@endif @foreach($composes as $c) @if($canManage) @endif @endforeach
名稱 / 標題 案子 / 客戶 負責人 用途 最後修改操作
{{ $c['name'] }}.yml @if(!empty($c['meta']['title']))
{{ $c['meta']['title'] }} @endif
@if(!empty($c['meta']['project'])) {{ $c['meta']['project'] }} @endif @if(!empty($c['meta']['client']))
{{ $c['meta']['client'] }} @endif @if(empty($c['meta']['project']) && empty($c['meta']['client'])) @endif
@if(!empty($c['meta']['owner'])) {{ $c['meta']['owner'] }} @else @endif @if(!empty($c['meta']['purpose'])) {{ Str::limit($c['meta']['purpose'], 50) }} @else @endif {{ date('Y-m-d H:i', $c['modified']) }}
@endif
{{-- ══ 頁籤:Images ══ --}}
@if($canManage)
{{-- Pull --}}
{{-- Load --}}
@endif @if(empty($images))
尚無 Images
@else
@if($canManage)@endif @foreach($images as $img) @php $autoUsed = collect($img['tags'])->flatMap(fn($t) => $imageContainers[$t] ?? [])->unique()->values(); $manualUsed = array_filter(array_map('trim', explode(',', $img['meta']['used_by'] ?? ''))); $allUsed = $autoUsed->merge($manualUsed)->unique()->values(); @endphp @if($canManage) @endif @endforeach
# 名稱 / Tag ID 使用容器 大小 建立者 時間 備註操作
{{ $loop->iteration }} @foreach($img['tags'] as $tag) {{ $tag }} @endforeach {{ $img['id'] }} @forelse($allUsed as $cn) {{ $cn }} @empty @endforelse {{ $img['size'] }} @if(!empty($img['meta']['owner'])) {{ $img['meta']['owner'] }} @else @endif {{ date('Y-m-d', $img['created']) }} @if(!empty($img['meta']['note'])) {{ Str::limit($img['meta']['note'], 30) }} @else @endif
@endif
{{-- ══ 頁籤:Volumes ══ --}}
@if(empty($volumes))
尚無 Volumes
@else
@if($canManage)@endif @foreach($volumes as $v) @if($canManage) @endif @endforeach
名稱 Driver 掛載路徑 建立時間 使用容器
{{ $v['name'] }} {{ $v['driver'] }} {{ $v['mountpoint'] }} {{ $v['created'] ? date('Y-m-d', strtotime($v['created'])) : '—' }} @forelse($volumeContainers[$v['name']] ?? [] as $cn) {{ $cn }} @empty @endforelse
@endif
{{-- /tab-content --}}
{{-- Image Meta 編輯 Modal --}} {{-- Image Pull / Load 輸出 Modal --}} {{-- Container 詳細 Modal --}} {{-- Log Modal --}} {{-- Compose 輸出 Modal --}} @endsection @push('scripts') @endpush