Deploy on 2026-06-05 17:47:27

This commit is contained in:
Hamza-Ayed
2026-06-05 17:47:27 +03:00
parent e5074451af
commit f468227019
15 changed files with 415 additions and 225 deletions

View File

@@ -1,5 +1,5 @@
<div class="page-header">
<h1><?= $source ? 'Edit' : 'Add' ?> Source</h1>
<h1><?= $source ? 'تعديل' : 'إضافة' ?> مصدر</h1>
</div>
<div class="glass-panel" style="max-width: 600px;">
@@ -10,32 +10,32 @@
<input type="hidden" name="_csrf" value="<?= $this->session->getCsrfToken() ?>">
<div class="form-group">
<label class="form-label">Name</label>
<label class="form-label">الاسم</label>
<input type="text" name="name" class="form-control" required value="<?= $source ? $this->escape($source['name']) : '' ?>">
</div>
<div class="form-group">
<label class="form-label">URL</label>
<label class="form-label">الرابط</label>
<input type="url" name="url" class="form-control" required value="<?= $source ? $this->escape($source['url']) : '' ?>" placeholder="https://example.com/rss">
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Type</label>
<label class="form-label">النوع</label>
<select name="type" class="form-control">
<option value="rss" <?= $source && $source['type'] === 'rss' ? 'selected' : '' ?>>RSS Feed</option>
<option value="api" <?= $source && $source['type'] === 'api' ? 'selected' : '' ?>>API</option>
<option value="rss" <?= $source && $source['type'] === 'rss' ? 'selected' : '' ?>>خلاصة RSS</option>
<option value="api" <?= $source && $source['type'] === 'api' ? 'selected' : '' ?>>واجهة برمجة تطبيقات (API)</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Status</label>
<label class="form-label">الحالة</label>
<select name="status" class="form-control">
<option value="active" <?= $source && $source['status'] === 'active' ? 'selected' : '' ?>>Active</option>
<option value="inactive" <?= $source && $source['status'] === 'inactive' ? 'selected' : '' ?>>Inactive</option>
<option value="active" <?= $source && $source['status'] === 'active' ? 'selected' : '' ?>>نشط</option>
<option value="inactive" <?= $source && $source['status'] === 'inactive' ? 'selected' : '' ?>>غير نشط</option>
</select>
</div>
</div>
<div style="display: flex; gap: 12px; margin-top: 10px;">
<button type="submit" class="btn btn-primary">Save Source</button>
<a href="/admin/sources" class="btn btn-secondary">Cancel</a>
<button type="submit" class="btn btn-primary">حفظ المصدر</button>
<a href="/admin/sources" class="btn btn-secondary">إلغاء</a>
</div>
</form>
</div>

View File

@@ -1,9 +1,9 @@
<div class="page-header">
<div>
<h1>Data Sources</h1>
<p>Manage RSS feeds and API sources for data collection</p>
<h1>مصادر البيانات</h1>
<p>إدارة خلاصات RSS ومصادر واجهة برمجة التطبيقات (API) لجمع البيانات</p>
</div>
<a href="/admin/sources/create" class="btn btn-primary">+ Add Source</a>
<a href="/admin/sources/create" class="btn btn-primary">+ إضافة مصدر</a>
</div>
<?php if ($flashSuccess = $this->session->getFlash('success')): ?>
@@ -17,16 +17,16 @@
<table class="data-table">
<thead>
<tr>
<th>Name</th>
<th>URL</th>
<th>Type</th>
<th>Status</th>
<th>Actions</th>
<th>الاسم</th>
<th>الرابط</th>
<th>النوع</th>
<th>الحالة</th>
<th>إجراءات</th>
</tr>
</thead>
<tbody>
<?php if (empty($sources)): ?>
<tr><td colspan="5" style="text-align: center; padding: 40px; color: var(--text-muted);">No data sources configured.</td></tr>
<tr><td colspan="5" style="text-align: center; padding: 40px; color: var(--text-muted);">لا توجد مصادر بيانات مهيأة.</td></tr>
<?php else: ?>
<?php foreach ($sources as $source): ?>
<tr>
@@ -35,11 +35,11 @@
<a href="<?= $this->escape($source['url']) ?>" target="_blank" style="font-size: 0.85rem;"><?= $this->escape($source['url']) ?></a>
</td>
<td><span class="badge badge-source-<?= $source['type'] ?>"><?= $this->escape($source['type']) ?></span></td>
<td><span class="badge <?= $source['status'] === 'active' ? 'badge-active' : 'badge-inactive' ?>"><?= $this->escape($source['status']) ?></span></td>
<td><span class="badge <?= $source['status'] === 'active' ? 'badge-active' : 'badge-inactive' ?>"><?= $source['status'] === 'active' ? 'نشط' : 'غير نشط' ?></span></td>
<td>
<a href="/admin/sources/<?= $source['id'] ?>/run" class="btn btn-sm btn-primary" onclick="return confirm('Run collector on this source?')">Run</a>
<a href="/admin/sources/<?= $source['id'] ?>/edit" class="btn btn-sm btn-secondary">Edit</a>
<a href="/admin/sources/<?= $source['id'] ?>/delete" class="btn btn-sm btn-secondary" onclick="return confirm('Delete this source?')">Delete</a>
<a href="/admin/sources/<?= $source['id'] ?>/run" class="btn btn-sm btn-primary" onclick="return confirm('هل تريد تشغيل جامع البيانات على هذا المصدر؟')">تشغيل</a>
<a href="/admin/sources/<?= $source['id'] ?>/edit" class="btn btn-sm btn-secondary">تعديل</a>
<a href="/admin/sources/<?= $source['id'] ?>/delete" class="btn btn-sm btn-secondary" onclick="return confirm('هل أنت متأكد من حذف هذا المصدر؟')">حذف</a>
</td>
</tr>
<?php endforeach; ?>