mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-01 08:33:22 +02:00
Dashboard improvements
This commit is contained in:
parent
9b19930892
commit
e7cc84166c
3 changed files with 86 additions and 17 deletions
|
@ -15,11 +15,13 @@ class HomeController extends Controller
|
|||
$whois_server = $db->selectValue("SELECT value FROM settings WHERE name = 'whois_server'");
|
||||
$rdap_server = $db->selectValue("SELECT value FROM settings WHERE name = 'rdap_server'");
|
||||
$company_name = $db->selectValue("SELECT value FROM settings WHERE name = 'company_name'");
|
||||
$email = $db->selectValue("SELECT value FROM settings WHERE name = 'email'");
|
||||
|
||||
return view($response, 'index.twig', [
|
||||
'whois_server' => $whois_server,
|
||||
'rdap_server' => $rdap_server,
|
||||
'company_name' => $company_name,
|
||||
'email' => $email
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -41,26 +43,34 @@ class HomeController extends Controller
|
|||
}
|
||||
|
||||
if ($clid !== null) {
|
||||
$domains = $db->selectRow('SELECT count(id) as domains FROM domain WHERE clid = ?', [$clid]);
|
||||
$hosts = $db->selectRow('SELECT count(id) as hosts FROM host WHERE clid = ?', [$clid]);
|
||||
$contacts = $db->selectRow('SELECT count(id) as contacts FROM contact WHERE clid = ?', [$clid]);
|
||||
$domains = $db->selectValue('SELECT count(id) as domains FROM domain WHERE clid = ?', [$clid]);
|
||||
$latest_domains = $db->select('SELECT name, crdate FROM domain WHERE clid = ? ORDER BY crdate DESC LIMIT 10', [$clid]);
|
||||
$tickets = $db->select('SELECT id, subject, status, priority FROM support_tickets WHERE user_id = ? ORDER BY date_created DESC LIMIT 10', [$clid]);
|
||||
$hosts = $db->selectValue('SELECT count(id) as hosts FROM host WHERE clid = ?', [$clid]);
|
||||
$contacts = $db->selectValue('SELECT count(id) as contacts FROM contact WHERE clid = ?', [$clid]);
|
||||
|
||||
return view($response, 'admin/dashboard/index.twig', [
|
||||
'domains' => $domains['domains'],
|
||||
'hosts' => $hosts['hosts'],
|
||||
'contacts' => $contacts['contacts'],
|
||||
'domains' => $domains,
|
||||
'hosts' => $hosts,
|
||||
'contacts' => $contacts,
|
||||
'latest_domains' => $latest_domains,
|
||||
'tickets' => $tickets,
|
||||
]);
|
||||
} else {
|
||||
$domains = $db->selectRow('SELECT count(id) as domains FROM domain');
|
||||
$hosts = $db->selectRow('SELECT count(id) as hosts FROM host');
|
||||
$contacts = $db->selectRow('SELECT count(id) as contacts FROM contact');
|
||||
$registrars = $db->selectRow('SELECT count(id) as registrars FROM registrar');
|
||||
$domains = $db->selectValue('SELECT count(id) as domains FROM domain');
|
||||
$latest_domains = $db->select('SELECT name, crdate FROM domain ORDER BY crdate DESC LIMIT 10');
|
||||
$tickets = $db->select('SELECT id, subject, status, priority FROM support_tickets ORDER BY date_created DESC LIMIT 10');
|
||||
$hosts = $db->selectValue('SELECT count(id) as hosts FROM host');
|
||||
$contacts = $db->selectValue('SELECT count(id) as contacts FROM contact');
|
||||
$registrars = $db->selectValue('SELECT count(id) as registrars FROM registrar');
|
||||
|
||||
return view($response, 'admin/dashboard/index.twig', [
|
||||
'domains' => $domains['domains'],
|
||||
'hosts' => $hosts['hosts'],
|
||||
'contacts' => $contacts['contacts'],
|
||||
'registrars' => $registrars['registrars'],
|
||||
'domains' => $domains,
|
||||
'hosts' => $hosts,
|
||||
'contacts' => $contacts,
|
||||
'registrars' => $registrars,
|
||||
'latest_domains' => $latest_domains,
|
||||
'tickets' => $tickets,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<div class="btn-list">
|
||||
<span class="d-none d-sm-inline">
|
||||
<a href="{{route('reports')}}" class="btn btn-pink">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h5.697" /><path d="M18 14v4h4" /><path d="M18 11v-4a2 2 0 0 0 -2 -2h-2" /><path d="M8 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z" /><path d="M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M8 11h4" /><path d="M8 15h3" /></svg>
|
||||
{{ __('View Reports') }}
|
||||
</a>
|
||||
</span>
|
||||
|
@ -165,6 +166,64 @@
|
|||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-12 col-md-6 mt-5">
|
||||
<h3 class="card-title">Recent Domains</h3>
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
class="table table-vcenter card-table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('Name') }}</th>
|
||||
<th>{{ __('Creation Date') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if latest_domains|length > 0 %}
|
||||
{% for domain in latest_domains %}
|
||||
<tr>
|
||||
<td><a href="/domain/view/{{ domain.name }}">{{ domain.name }}</a></td>
|
||||
<td class="text-secondary">{{ domain.crdate }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr><td colspan="2">{{ __('No Data') }}</td></tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 mt-5">
|
||||
<h3 class="card-title">Recent Support Tickets</h3>
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
class="table table-vcenter card-table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('Subject') }}</th>
|
||||
<th>{{ __('Status') }}</th>
|
||||
<th>{{ __('Priority') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if tickets|length > 0 %}
|
||||
{% for ticket in tickets %}
|
||||
<tr>
|
||||
<td><a href="/domain/view/{{ ticket.id }}">{{ ticket.subject }}</a></td>
|
||||
<td class="text-secondary">{{ ticket.status }}</td>
|
||||
<td class="text-secondary">{{ ticket.priority }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr><td colspan="3">{{ __('No Data') }}</td></tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">
|
||||
Help Center
|
||||
<a class="nav-link" href="mailto:{{ email }}">
|
||||
Support Team
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -88,7 +88,7 @@
|
|||
<ul class="custom-bullet">
|
||||
<li>{% if auth.isLogin %}<a href="{{route('home')}}"><strong>Open panel</strong></a>{% else %}<a href="{{route('login')}}"><strong>Log in</strong></a>{% endif %} to access your registrar dashboard and manage domains.</li>
|
||||
<li>Access our <a href="https://{{ whois_server }}" target="_blank"><strong>WHOIS</strong></a> and <a href="{{ rdap_server }}" target="_blank"><strong>RDAP</strong></a> services for domain information lookup.</li>
|
||||
<li>Visit our <a href="#"><strong>Help Center</strong></a> for guides, FAQs, and support.</li>
|
||||
<li>Contact our <a href="mailto:{{ email }}"><strong>Support Team</strong></a> for assistance, guidance, FAQs, and further support needs.</li>
|
||||
<li>Interested in partnering with us? <a href="#"><strong>Apply</strong></a> to become an official registrar.</li>
|
||||
</ul>
|
||||
<code>Personalize this template to fit the unique needs and branding of your registry by editing `resources/views/index.twig`</code>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue