mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 00:03:03 +08:00
better filter app
This commit is contained in:
parent
d6e48ea2e4
commit
ef6388887f
1 changed files with 105 additions and 95 deletions
|
@ -92,124 +92,133 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- END Global Stats -->
|
<!-- END Global Stats -->
|
||||||
|
|
||||||
|
<!-- Controls: buttons & search -->
|
||||||
<div class="row mb-3">
|
<div id="filter-app">
|
||||||
|
<div class="row mb-3">
|
||||||
<div class="col-lg-6 pt-1" style="max-width: 25em">
|
<div class="col d-flex">
|
||||||
<div class="btn-group" role="group">
|
<div>
|
||||||
<form method="post">
|
<div class="btn-group" role="group">
|
||||||
<input type="hidden" name="form-name" value="create-custom-email">
|
<form method="post">
|
||||||
<button data-toggle="tooltip"
|
<input type="hidden" name="form-name" value="create-custom-email">
|
||||||
title="Create a custom alias"
|
<button data-toggle="tooltip"
|
||||||
class="btn btn-primary mr-2"><i class="fa fa-plus"></i> New Custom Alias
|
title="Create a custom alias"
|
||||||
</button>
|
class="btn btn-primary mr-2"><i class="fa fa-plus"></i> New Custom Alias
|
||||||
</form>
|
</button>
|
||||||
<div class="btn-group" role="group">
|
</form>
|
||||||
<form method="post">
|
<div class="btn-group" role="group">
|
||||||
<input type="hidden" name="form-name" value="create-random-email">
|
|
||||||
<button data-toggle="tooltip"
|
|
||||||
title="Create a totally random alias"
|
|
||||||
class="btn btn-success"><i class="fa fa-random"></i> Random Alias
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<button id="btnGroupDrop1" type="button" class="btn btn-success dropdown-toggle btn-group-border-left"
|
|
||||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
||||||
</button>
|
|
||||||
<div class="dropdown-menu dropdown-menu-right border-left" aria-labelledby="btnGroupDrop1">
|
|
||||||
<div class="">
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<input type="hidden" name="form-name" value="create-random-email">
|
<input type="hidden" name="form-name" value="create-random-email">
|
||||||
<input type="hidden" name="generator_scheme" value="{{ AliasGeneratorEnum.word.value }}">
|
<button data-toggle="tooltip"
|
||||||
<button class="dropdown-item">By Random Words</button>
|
title="Create a totally random alias"
|
||||||
</form>
|
class="btn btn-success"><i class="fa fa-random"></i> Random Alias
|
||||||
</div>
|
</button>
|
||||||
<div class="">
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="form-name" value="create-random-email">
|
|
||||||
<input type="hidden" name="generator_scheme" value="{{ AliasGeneratorEnum.uuid.value }}">
|
|
||||||
<button class="dropdown-item">By UUID</button>
|
|
||||||
</form>
|
</form>
|
||||||
|
<button id="btnGroupDrop1" type="button" class="btn btn-success dropdown-toggle btn-group-border-left"
|
||||||
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu dropdown-menu-right border-left" aria-labelledby="btnGroupDrop1">
|
||||||
|
<div class="">
|
||||||
|
<form method="post">
|
||||||
|
<input type="hidden" name="form-name" value="create-random-email">
|
||||||
|
<input type="hidden" name="generator_scheme" value="{{ AliasGeneratorEnum.word.value }}">
|
||||||
|
<button class="dropdown-item">By Random Words</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="">
|
||||||
|
<form method="post">
|
||||||
|
<input type="hidden" name="form-name" value="create-random-email">
|
||||||
|
<input type="hidden" name="generator_scheme" value="{{ AliasGeneratorEnum.uuid.value }}">
|
||||||
|
<button class="dropdown-item">By UUID</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="" style="margin-left: auto">
|
||||||
|
<div class="btn-group">
|
||||||
|
<a v-if="!showFilter" @click="toggleFilter()" class="btn btn-outline-secondary">
|
||||||
|
<i class="fe fe-chevrons-down"></i> Filters
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="filter-app" class="col-lg-auto pt-1 flex-grow-1">
|
<div class="row mb-2" v-if="showFilter" id="filter-control">
|
||||||
<div class="float-right d-flex">
|
<!-- Filter Control -->
|
||||||
|
<div class="col d-flex">
|
||||||
|
<form method="get" class="form-inline">
|
||||||
|
<select name="sort"
|
||||||
|
onchange="this.form.submit()"
|
||||||
|
class="form-control mr-3 shadow">
|
||||||
|
<option value="" {% if sort == "" %} selected {% endif %}>
|
||||||
|
Sort by most recent activity
|
||||||
|
</option>
|
||||||
|
<option value="old2new" {% if sort == "old2new" %} selected {% endif %}>
|
||||||
|
Alias Old-Recent
|
||||||
|
</option>
|
||||||
|
<option value="new2old" {% if sort == "new2old" %} selected {% endif %}>
|
||||||
|
Alias Recent-Old
|
||||||
|
</option>
|
||||||
|
<option value="a2z" {% if sort == "a2z" %} selected {% endif %}>
|
||||||
|
Alias A-Z
|
||||||
|
</option>
|
||||||
|
<option value="z2a" {% if sort == "z2a" %} selected {% endif %}>
|
||||||
|
Alias Z-A
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- Filter Control -->
|
<select name="filter"
|
||||||
<div v-if="showFilter" id="filter-control">
|
onchange="this.form.submit()"
|
||||||
<form method="get" class="form-inline">
|
class="form-control mr-3 shadow"
|
||||||
<select name="sort"
|
style="max-width: 200px">
|
||||||
onchange="this.form.submit()"
|
<option value="" {% if filter == "" %} selected {% endif %}>
|
||||||
class="form-control mr-3 shadow">
|
All Aliases
|
||||||
<option value="" {% if sort == "" %} selected {% endif %}>
|
</option>
|
||||||
Sort by most recent activity
|
<option value="enabled" {% if filter == "enabled" %} selected {% endif %}>
|
||||||
|
Only Enabled Aliases
|
||||||
|
</option>
|
||||||
|
<option value="disabled" {% if filter == "disabled" %} selected {% endif %}>
|
||||||
|
Only Disabled Aliases
|
||||||
|
</option>
|
||||||
|
<option value="hibp" {% if filter == "hibp" %} selected {% endif %}>
|
||||||
|
Only Aliases Found In Data Breaches
|
||||||
|
</option>
|
||||||
|
{% for mailbox in current_user.mailboxes() %}
|
||||||
|
<option value="mailbox:{{ mailbox.id }}" {% if filter == "mailbox:" ~ mailbox.id %}
|
||||||
|
selected {% endif %}>
|
||||||
|
{{ mailbox.email }}'s aliases
|
||||||
</option>
|
</option>
|
||||||
<option value="old2new" {% if sort == "old2new" %} selected {% endif %}>
|
{% endfor %}
|
||||||
Alias Old-Recent
|
</select>
|
||||||
</option>
|
|
||||||
<option value="new2old" {% if sort == "new2old" %} selected {% endif %}>
|
|
||||||
Alias Recent-Old
|
|
||||||
</option>
|
|
||||||
<option value="a2z" {% if sort == "a2z" %} selected {% endif %}>
|
|
||||||
Alias A-Z
|
|
||||||
</option>
|
|
||||||
<option value="z2a" {% if sort == "z2a" %} selected {% endif %}>
|
|
||||||
Alias Z-A
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select name="filter"
|
<input type="search" name="query" placeholder="Enter to search for alias"
|
||||||
onchange="this.form.submit()"
|
class="form-control shadow mr-2"
|
||||||
class="form-control mr-3 shadow"
|
style="max-width: 15em"
|
||||||
style="max-width: 200px">
|
value="{{ query }}">
|
||||||
<option value="" {% if filter == "" %} selected {% endif %}>
|
|
||||||
All Aliases
|
|
||||||
</option>
|
|
||||||
<option value="enabled" {% if filter == "enabled" %} selected {% endif %}>
|
|
||||||
Only Enabled Aliases
|
|
||||||
</option>
|
|
||||||
<option value="disabled" {% if filter == "disabled" %} selected {% endif %}>
|
|
||||||
Only Disabled Aliases
|
|
||||||
</option>
|
|
||||||
<option value="hibp" {% if filter == "hibp" %} selected {% endif %}>
|
|
||||||
Only Aliases Found In Data Breaches
|
|
||||||
</option>
|
|
||||||
{% for mailbox in current_user.mailboxes() %}
|
|
||||||
<option value="mailbox:{{ mailbox.id }}" {% if filter == "mailbox:" ~ mailbox.id %}
|
|
||||||
selected {% endif %}>
|
|
||||||
{{ mailbox.email }}'s aliases
|
|
||||||
</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<input type="search" name="query" placeholder="Enter to search for alias"
|
|
||||||
class="form-control shadow mr-2"
|
|
||||||
style="max-width: 15em"
|
|
||||||
value="{{ query }}">
|
|
||||||
|
|
||||||
{% if query or sort or filter %}
|
</form>
|
||||||
<a href="{{ url_for('dashboard.index') }}"
|
|
||||||
class="btn btn-light">Reset</a>
|
|
||||||
{% endif %}
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="btn-group">
|
<div style="margin-left: auto">
|
||||||
<a v-if="!showFilter" @click="toggleFilter()" class="btn btn-outline-secondary">
|
|
||||||
<i class="fe fe-chevrons-left"></i> Filters
|
{% if query or sort or filter %}
|
||||||
</a>
|
<a href="{{ url_for('dashboard.index') }}"
|
||||||
|
class="btn btn-outline-secondary">Reset</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<a v-if="showFilter" @click="toggleFilter()" class="btn btn-outline-secondary">
|
<a v-if="showFilter" @click="toggleFilter()" class="btn btn-outline-secondary">
|
||||||
<i class="fe fe-chevrons-right"></i>
|
<i class="fe fe-chevrons-up"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- END Controls: buttons & search -->
|
||||||
|
|
||||||
|
<!-- Alias list -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for alias_info in alias_infos %}
|
{% for alias_info in alias_infos %}
|
||||||
{% set alias = alias_info.alias %}
|
{% set alias = alias_info.alias %}
|
||||||
|
@ -502,6 +511,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
<!-- END Alias list -->
|
||||||
|
|
||||||
<!-- Only show pagination control if there are previous/next page -->
|
<!-- Only show pagination control if there are previous/next page -->
|
||||||
{% if page > 0 or not last_page %}
|
{% if page > 0 or not last_page %}
|
||||||
|
|
Loading…
Reference in a new issue