Add complete ScoutIQ system: Crawler (RSS+AI), CRUD Controllers (Organizations, Contacts, Opportunities, Sources), dynamic Views, API routes, CLI collector
This commit is contained in:
46
resources/views/admin/sources/form.php
Normal file
46
resources/views/admin/sources/form.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<div class="page-header">
|
||||
<h1><?= $source ? 'Edit' : 'Add' ?> Source</h1>
|
||||
</div>
|
||||
|
||||
<div class="glass-panel" style="max-width: 600px;">
|
||||
<form action="/admin/sources/store" method="POST" class="form-stacked">
|
||||
<?php if ($source): ?>
|
||||
<input type="hidden" name="id" value="<?= $source['id'] ?>">
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="_csrf" value="<?= $this->session->getCsrfToken() ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Name</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>
|
||||
<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>
|
||||
<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>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Status</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>
|
||||
</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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.form-stacked { display: flex; flex-direction: column; gap: 16px; }
|
||||
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
|
||||
</style>
|
||||
60
resources/views/admin/sources/index.php
Normal file
60
resources/views/admin/sources/index.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1>Data Sources</h1>
|
||||
<p>Manage RSS feeds and API sources for data collection</p>
|
||||
</div>
|
||||
<a href="/admin/sources/create" class="btn btn-primary">+ Add Source</a>
|
||||
</div>
|
||||
|
||||
<?php if ($flashSuccess = $this->session->getFlash('success')): ?>
|
||||
<div class="alert alert-success"><span><?= $this->escape($flashSuccess) ?></span></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($flashError = $this->session->getFlash('error')): ?>
|
||||
<div class="alert alert-error"><span><?= $this->escape($flashError) ?></span></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="glass-panel" style="overflow-x: auto;">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>URL</th>
|
||||
<th>Type</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</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>
|
||||
<?php else: ?>
|
||||
<?php foreach ($sources as $source): ?>
|
||||
<tr>
|
||||
<td style="font-weight: 600;"><?= $this->escape($source['name']) ?></td>
|
||||
<td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis;">
|
||||
<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>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.data-table { width: 100%; border-collapse: collapse; }
|
||||
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
|
||||
.data-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
|
||||
.data-table tr:hover { background: rgba(255,255,255,0.02); }
|
||||
.badge-source-rss { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
|
||||
.badge-source-api { background: rgba(52, 211, 153, 0.2); color: #34d399; }
|
||||
.badge-active { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
|
||||
.badge-inactive { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user