ezidam: apps: don't include ezidam
This commit is contained in:
parent
23f69e8377
commit
14bff68cbf
2 changed files with 33 additions and 25 deletions
|
|
@ -4,10 +4,13 @@ use rocket::get;
|
|||
|
||||
#[get("/admin/apps")]
|
||||
pub async fn admin_apps(mut db: Connection<Database>, admin: JwtAdmin) -> Result<Page> {
|
||||
let list = App::get_all(&mut *db, None).await?;
|
||||
let mut apps = App::get_all(&mut *db, None).await?;
|
||||
|
||||
// Remove ezidam from list
|
||||
apps.retain(|app| *app.id() != AppID("ezidam".into()));
|
||||
|
||||
Ok(Page::AdminApps(super::content::AdminApps {
|
||||
user: admin.0,
|
||||
apps: list,
|
||||
apps,
|
||||
}))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
{% extends "shell" %}
|
||||
|
||||
{% block content %}
|
||||
{% set new_app_label = "New application" %}
|
||||
{% set new_app_link = "./new" %}
|
||||
<div class="page-header d-print-none">
|
||||
<div class="container-xl">
|
||||
<div class="row align-items-center">
|
||||
{% if apps | length != 0 %}
|
||||
<div class="col">
|
||||
<div class="page-pretitle">
|
||||
Admin dashboard
|
||||
|
|
@ -14,38 +17,24 @@
|
|||
</div>
|
||||
<div class="col-auto ms-auto">
|
||||
<div class="btn-list">
|
||||
{% set primary_action = "New application" %}
|
||||
<a href="#" class="btn btn-primary d-none d-sm-inline-block" data-bs-toggle="modal"
|
||||
data-bs-target="#modal-report">
|
||||
<!-- Download SVG icon from http://tabler-icons.io/i/plus -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
|
||||
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 5l0 14"/>
|
||||
<path d="M5 12l14 0"/>
|
||||
</svg>
|
||||
{{ primary_action }}
|
||||
<a href="{{ new_app_link }}" class="btn btn-primary d-none d-sm-inline-block">
|
||||
{% include "icons/plus" %}
|
||||
{{ new_app_label }}
|
||||
</a>
|
||||
<a href="#" class="btn btn-primary d-sm-none btn-icon" data-bs-toggle="modal"
|
||||
data-bs-target="#modal-report" aria-label="{{ primary_action }}">
|
||||
<!-- Download SVG icon from http://tabler-icons.io/i/plus -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
|
||||
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M12 5l0 14"/>
|
||||
<path d="M5 12l14 0"/>
|
||||
</svg>
|
||||
<a href="{{ new_app_link }}" class="btn btn-primary d-sm-none btn-icon"
|
||||
aria-label="{{ new_app_label }}">
|
||||
{% include "icons/plus" %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page body -->
|
||||
<div class="page-body">
|
||||
<div class="container-xl">
|
||||
{% if apps | length != 0 %}
|
||||
<div class="card">
|
||||
<div id="table-default" class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
|
|
@ -91,7 +80,7 @@
|
|||
<td class="sort-id">{{ app.id }}</td>
|
||||
<td class="sort-redirect-uri">{{ app.redirect_uri }}</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-outline-secondary" href="#">Details</a>
|
||||
<a href="#">Details</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
@ -100,6 +89,22 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="d-flex flex-column justify-content-center">
|
||||
<div class="empty">
|
||||
<p class="empty-title">No registered applications</p>
|
||||
<p class="empty-subtitle text-muted">
|
||||
Register an application to allow users access it with ezidam.
|
||||
</p>
|
||||
<div class="empty-action">
|
||||
<a href="{{ new_app_link }}" class="btn btn-primary">
|
||||
{% include "icons/plus" %}
|
||||
{{ new_app_label }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue