@extends('layouts.app') @section('title', $project->name . ' — GitLab') @push('head') @endpush @section('content') @include('projects._nav')
@if(session('success'))
{{ session('success') }}
@endif {{-- 未連結 --}} @if($notLinked)

此專案尚未連結 GitLab Repository。

@can('update', $project) 前往專案設定填入 GitLab Project ID @endcan
@stop @endif {{-- 標題列 --}}
{{ $info['name_with_namespace'] ?? $project->name }}
@if(!empty($info['web_url'])) {{ $info['web_url'] }} @endif
@csrf
{{-- 統計卡片 --}}
{{ count($branches) }}
分支
{{ count($tags) }}
標籤
@php $openMrs = collect($mrs)->where('state','opened')->count(); @endphp
{{ $openMrs }}
開放合併請求
@php $latestPipe = collect($pipes)->first(); @endphp @php $pipeColor = match($latestPipe['status'] ?? '') { 'success' => 'success', 'failed' => 'danger', 'running' => 'primary', 'pending' => 'warning', default => 'secondary' }; $pipeLabel = match($latestPipe['status'] ?? '') { 'success' => '成功', 'failed' => '失敗', 'running' => '執行中', 'pending' => '等待中', default => '—' }; @endphp
{{ $pipeLabel }}
最新流水線
{{-- 分頁 Tabs --}}
{{-- ── Repository (Files) ── --}}
{{-- Toolbar --}}
{{-- Latest commit bar --}} @php $headCommit = $commits[0] ?? null; @endphp
{{ $headCommit['title'] ?? '—' }} · {{ $headCommit['author_name'] ?? '' }} · {{ isset($headCommit['created_at']) ? \Carbon\Carbon::parse($headCommit['created_at'])->diffForHumans() : '' }} @if(!empty($headCommit['short_id']) && !empty($info['web_url'])) {{ $headCommit['short_id'] }} @endif
{{-- Split pane: tree + viewer --}}
{{-- Left: file tree --}}
名稱 最後提交訊息 更新時間
載入中…
{{-- Right: file content viewer (hidden by default) --}}
載入中…
{{-- ── Commits ── --}}
最近提交({{ count($commits) }})
@forelse($commits as $c) @empty @endforelse
提交碼訊息作者時間
@if(!empty($info['web_url'])) {{ $c['short_id'] }} @else {{ $c['short_id'] }} @endif {{ $c['title'] }} {{ $c['author_name'] }} {{ \Carbon\Carbon::parse($c['created_at'])->diffForHumans() }}
無提交記錄
{{-- ── Branches / Tags ── --}}
{{-- Branches --}}
分支({{ count($branches) }})
@forelse($branches as $b) @empty @endforelse
名稱最後提交時間
{{ $b['name'] }} @if($b['default'] ?? false) default @endif {{ $b['commit']['title'] ?? '—' }} {{ isset($b['commit']['committed_date']) ? \Carbon\Carbon::parse($b['commit']['committed_date'])->diffForHumans() : '—' }}
無資料
{{-- Tags --}}
標籤({{ count($tags) }})
@forelse($tags as $t) @empty @endforelse
名稱提交
{{ $t['name'] }} {{ substr($t['commit']['short_id'] ?? '', 0, 8) }}
無標籤
{{-- ── Merge Requests ── --}}
@php $mrsByState = collect($mrs)->groupBy('state'); $mrStates = [ 'opened' => ['label' => '開放', 'color' => 'success'], 'merged' => ['label' => '已合併', 'color' => 'primary'], 'closed' => ['label' => '已關閉', 'color' => 'secondary'], ]; @endphp
@foreach($mrStates as $state => $cfg)
@forelse($mrsByState[$state] ?? [] as $mr) @empty @endforelse
#標題分支作者時間
!{{ $mr['iid'] }} @if(!empty($mr['web_url'])) {{ $mr['title'] }} @else {{ $mr['title'] }} @endif {{ Str::limit($mr['source_branch'], 18) }} {{ $mr['target_branch'] }} {{ $mr['author']['name'] ?? '—' }} {{ \Carbon\Carbon::parse($mr['updated_at'])->diffForHumans() }}
無資料
@endforeach
{{-- ── Pipelines ── --}}
最近流水線
@php $pipeColors = ['success'=>'success','failed'=>'danger','running'=>'primary','pending'=>'warning','canceled'=>'secondary','skipped'=>'secondary']; $pipeLabels = ['success'=>'成功','failed'=>'失敗','running'=>'執行中','pending'=>'等待','canceled'=>'已取消','skipped'=>'略過']; @endphp @forelse($pipes as $p) @php $pStatus = $p['status'] ?? 'unknown'; @endphp @empty @endforelse
ID狀態分支 / 標籤提交碼時間
@if(!empty($info['web_url'])) #{{ $p['id'] }} @else #{{ $p['id'] }} @endif {{ $pipeLabels[$pStatus] ?? $pStatus }} {{ $p['ref'] ?? '—' }} {{ substr($p['sha'] ?? '', 0, 8) }} {{ isset($p['created_at']) ? \Carbon\Carbon::parse($p['created_at'])->diffForHumans() : '—' }}
無流水線記錄
{{-- /tab-content --}}
@push('scripts') @endpush @endsection