86 lines
4.2 KiB
PHP
86 lines
4.2 KiB
PHP
<?php
|
|
|
|
use App\Data\Ui\ConnectedServices\ConnectedServiceData;
|
|
use App\Enums\ConnectionProtocolEnum;
|
|
use App\Enums\ConnectionStatusEnum;
|
|
use App\Enums\ConnectionProtocols;
|
|
use Illuminate\Support\Collection;
|
|
use Livewire\Component;
|
|
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
|
use Spatie\LaravelData\DataCollection;
|
|
|
|
new class extends Component {
|
|
#[DataCollectionOf(ConnectedServiceData::class)]
|
|
public DataCollection $connectedServices;
|
|
|
|
public function mount(): void
|
|
{
|
|
$this->connectedServices = ConnectedServiceData::collect([
|
|
new ConnectedServiceData(
|
|
name: 'Microsoft Outlook',
|
|
icon: 'home',
|
|
type: ConnectionProtocolEnum::OIDC,
|
|
connectionService: 'Azure AD',
|
|
status: ConnectionStatusEnum::Connected
|
|
),
|
|
new ConnectedServiceData(
|
|
name: 'Microsoft Teams',
|
|
icon: 'home',
|
|
type: ConnectionProtocolEnum::OIDC,
|
|
connectionService: 'Azure AD',
|
|
status: ConnectionStatusEnum::Pending
|
|
),
|
|
new ConnectedServiceData(
|
|
name: 'Keka HR',
|
|
icon: 'home',
|
|
type: ConnectionProtocolEnum::SAML,
|
|
connectionService: 'KeKA',
|
|
status: ConnectionStatusEnum::Disconnected
|
|
),
|
|
new ConnectedServiceData(
|
|
name: 'Trutimer',
|
|
icon: 'home',
|
|
type: ConnectionProtocolEnum::SAML,
|
|
connectionService: 'Redmine',
|
|
status: ConnectionStatusEnum::Error
|
|
),
|
|
], DataCollection::class);
|
|
}
|
|
};
|
|
?>
|
|
|
|
<div class="flex overflow-x-auto gap-x-4">
|
|
@foreach ($connectedServices as $service)
|
|
<x-shared.card class="min-w-60 p-4">
|
|
<div class="flex space-x-4">
|
|
<div class="bg-blue-200 p-4 rounded-lg flex items-center justify-center max-h-10">
|
|
<svg role="img" class="w-4 h-4" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>
|
|
Outline</title>
|
|
<path
|
|
d="M 15.081 21.857 L 15.081 22.459 C 15.081 23.636 13.812 24.378 12.785 23.8 L 3.543 18.602 C 3.058 18.329 2.758 17.816 2.758 17.26 L 2.758 6.742 C 2.758 6.185 3.058 5.672 3.543 5.399 L 12.785 0.201 C 13.812 -0.378 15.082 0.365 15.081 1.544 L 15.081 2.145 L 16.178 1.814 C 17.167 1.517 18.163 2.258 18.162 3.29 L 18.162 3.915 L 19.511 3.746 C 20.431 3.632 21.243 4.348 21.242 5.275 L 21.242 18.726 C 21.243 19.652 20.431 20.37 19.511 20.254 L 18.162 20.085 L 18.162 20.71 C 18.163 21.743 17.167 22.484 16.178 22.186 L 15.081 21.857 Z M 15.081 20.249 L 16.621 20.71 L 16.621 3.29 L 15.081 3.753 L 15.081 20.249 Z M 18.162 5.467 L 18.162 18.534 L 19.702 18.726 L 19.702 5.275 L 18.162 5.467 Z M 2.758 16.801 L 2.758 7.2 L 2.758 16.801 Z M 4.298 6.742 L 4.298 17.26 L 13.54 22.459 L 13.54 1.544 L 4.298 6.742 Z M 5.838 7.765 L 7.379 6.995 L 7.379 17.005 L 5.838 16.235 L 5.838 7.765 Z"/>
|
|
</svg>
|
|
</div>
|
|
<div class="flex flex-col">
|
|
<p class="font-medium">{{$service->name}}</p>
|
|
<p class="text-sm text-gray-600">{{$service->type->name}} - {{$service->connectionService}}</p>
|
|
</div>
|
|
</div>
|
|
<div class="mt-4 flex space-x-2.5 justify-between items-center">
|
|
<div class="flex items-center space-x-1">
|
|
<div
|
|
@class([
|
|
"w-2 h-2 rounded-full",
|
|
'bg-green-400' => $service->status === ConnectionStatusEnum::Connected,
|
|
'bg-gray-400' => $service->status === ConnectionStatusEnum::Disconnected,
|
|
'bg-yellow-400' => $service->status === ConnectionStatusEnum::Pending,
|
|
'bg-red-400' => $service->status === ConnectionStatusEnum::Error,
|
|
])
|
|
></div>
|
|
<p class="text-sm">{{ucfirst($service->status->name)}}</p>
|
|
</div>
|
|
<x-shared.button>Revoke</x-shared.button>
|
|
</div>
|
|
</x-shared.card>
|
|
@endforeach
|
|
</div>
|