103 lines
6.5 KiB
PHP
103 lines
6.5 KiB
PHP
|
|
@extends('layouts.app')
|
||
|
|
|
||
|
|
@section('page-title', 'Platform Accounts')
|
||
|
|
|
||
|
|
@section('content')
|
||
|
|
<div class="mb-6">
|
||
|
|
<a href="{{ route('platforms.create') }}" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg inline-flex items-center">
|
||
|
|
<i class="fas fa-plus mr-2"></i>
|
||
|
|
Add Platform Account
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="bg-white rounded-lg shadow">
|
||
|
|
<div class="px-6 py-4 border-b border-gray-200">
|
||
|
|
<h2 class="text-lg font-medium text-gray-900">Platform Accounts</h2>
|
||
|
|
<p class="text-sm text-gray-600 mt-1">Manage your social media platform accounts for posting</p>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
@if($accounts->isEmpty())
|
||
|
|
<div class="p-6 text-center">
|
||
|
|
<i class="fas fa-share-alt text-gray-400 text-4xl mb-4"></i>
|
||
|
|
<h3 class="text-lg font-medium text-gray-900 mb-2">No platform accounts configured</h3>
|
||
|
|
<p class="text-gray-600 mb-4">Add your first platform account to start posting articles</p>
|
||
|
|
<a href="{{ route('platforms.create') }}" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg inline-flex items-center">
|
||
|
|
<i class="fas fa-plus mr-2"></i>
|
||
|
|
Add Platform Account
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
@else
|
||
|
|
<div class="overflow-x-auto">
|
||
|
|
<table class="min-w-full divide-y divide-gray-200">
|
||
|
|
<thead class="bg-gray-50">
|
||
|
|
<tr>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Platform</th>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Account</th>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Last Tested</th>
|
||
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody class="bg-white divide-y divide-gray-200">
|
||
|
|
@foreach($accounts as $account)
|
||
|
|
<tr class="hover:bg-gray-50">
|
||
|
|
<td class="px-6 py-4 whitespace-nowrap">
|
||
|
|
<div class="flex items-center">
|
||
|
|
<i class="fab fa-{{ $account->platform }} text-lg mr-3
|
||
|
|
{{ $account->platform === 'lemmy' ? 'text-orange-500' :
|
||
|
|
($account->platform === 'mastodon' ? 'text-purple-500' : 'text-red-500') }}"></i>
|
||
|
|
<span class="text-sm font-medium text-gray-900 capitalize">{{ $account->platform }}</span>
|
||
|
|
@if($account->is_active)
|
||
|
|
<span class="ml-2 inline-flex px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
|
||
|
|
Active
|
||
|
|
</span>
|
||
|
|
@endif
|
||
|
|
</div>
|
||
|
|
</td>
|
||
|
|
<td class="px-6 py-4">
|
||
|
|
<div class="text-sm text-gray-900">{{ $account->username }}</div>
|
||
|
|
<div class="text-sm text-gray-500">{{ $account->instance_url }}</div>
|
||
|
|
</td>
|
||
|
|
<td class="px-6 py-4 whitespace-nowrap">
|
||
|
|
<span class="inline-flex px-2 py-1 text-xs font-semibold rounded-full
|
||
|
|
{{ $account->status === 'working' ? 'bg-green-100 text-green-800' :
|
||
|
|
($account->status === 'failed' ? 'bg-red-100 text-red-800' : 'bg-gray-100 text-gray-800') }}">
|
||
|
|
{{ ucfirst($account->status) }}
|
||
|
|
</span>
|
||
|
|
</td>
|
||
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
||
|
|
{{ $account->last_tested_at ? $account->last_tested_at->format('Y-m-d H:i') : 'Never' }}
|
||
|
|
</td>
|
||
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
|
||
|
|
<div class="flex space-x-2">
|
||
|
|
@if(!$account->is_active)
|
||
|
|
<form action="{{ route('platforms.set-active', $account) }}" method="POST" class="inline">
|
||
|
|
@csrf
|
||
|
|
<button type="submit" class="text-green-600 hover:text-green-900">
|
||
|
|
<i class="fas fa-check mr-1"></i>Set Active
|
||
|
|
</button>
|
||
|
|
</form>
|
||
|
|
@endif
|
||
|
|
|
||
|
|
<a href="{{ route('platforms.edit', $account) }}" class="text-blue-600 hover:text-blue-900">
|
||
|
|
<i class="fas fa-edit mr-1"></i>Edit
|
||
|
|
</a>
|
||
|
|
|
||
|
|
<form action="{{ route('platforms.destroy', $account) }}" method="POST" class="inline"
|
||
|
|
onsubmit="return confirm('Are you sure you want to delete this platform account?')">
|
||
|
|
@csrf
|
||
|
|
@method('DELETE')
|
||
|
|
<button type="submit" class="text-red-600 hover:text-red-900">
|
||
|
|
<i class="fas fa-trash mr-1"></i>Delete
|
||
|
|
</button>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
@endforeach
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
</div>
|
||
|
|
@endsection
|