Add organize_enabled toggle for folders and improve UI with loading states
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div id="imap-modal" @click.away="$refs.modal.close()" class="modal-box" x-data="{ errors: {{ 'true' if errors else 'false' }} }" x-init="$nextTick(() => { if (errors) { document.querySelector('#submit-btn').classList.add('shake'); } })">
|
||||
<div id="imap-modal" @click.away="$refs.modal.close()" class="modal-box" x-data="{ errors: {{ 'true' if errors else 'false' }} }" x-init="$nextTick(() => { if (errors) { document.querySelector('#submit-btn').classList.add('shake'); } })" >
|
||||
<h3 class="font-bold text-lg mb-4">Configure IMAP Connection</h3>
|
||||
|
||||
{% if success %}
|
||||
@@ -18,7 +18,7 @@
|
||||
<form id="imap-form" hx-post="/api/imap/test" hx-target="#imap-modal" hx-swap="outerHTML">
|
||||
<div class="mb-4">
|
||||
<label for="imap-server" class="block text-sm font-medium mb-1">IMAP Server</label>
|
||||
<input type="text" id="imap-server" name="server"
|
||||
<input type="text" id="imap-server" name="server"
|
||||
class="input input-bordered w-full {% if errors and errors.server %}input-error{% endif %}"
|
||||
placeholder="e.g., imap.gmail.com" required
|
||||
value="{% if server is defined %}{{ server }}{% endif %}">
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="imap-port" class="block text-sm font-medium mb-1">Port</label>
|
||||
<input type="number" id="imap-port" name="port"
|
||||
<input type="number" id="imap-port" name="port"
|
||||
class="input input-bordered w-full {% if errors and errors.port %}input-error{% endif %}"
|
||||
placeholder="e.g., 993" required
|
||||
value="{% if port is defined %}{{ port }}{% else %}993{% endif %}">
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="imap-username" class="block text-sm font-medium mb-1">Username</label>
|
||||
<input type="text" id="imap-username" name="username"
|
||||
<input type="text" id="imap-username" name="username"
|
||||
class="input input-bordered w-full {% if errors and errors.username %}input-error{% endif %}"
|
||||
placeholder="e.g., your-email@gmail.com" required
|
||||
value="{% if username is defined %}{{ username }}{% endif %}">
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="imap-password" class="block text-sm font-medium mb-1">Password</label>
|
||||
<input type="password" id="imap-password" name="password"
|
||||
<input type="password" id="imap-password" name="password"
|
||||
class="input input-bordered w-full {% if errors and errors.password %}input-error{% endif %}"
|
||||
placeholder="App password or account password" required>
|
||||
{% if errors and errors.password %}
|
||||
@@ -67,20 +67,21 @@
|
||||
<p class="text-xs text-base-content/70 mt-1">Most IMAP servers use SSL on port 993</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-action">
|
||||
<div class="modal-action" data-loading-states>
|
||||
<button type="button" class="btn btn-outline"
|
||||
@click="$dispatch('close-modal')">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary" id="submit-btn" :class="{ 'shake': errors }">
|
||||
Test Connection
|
||||
<button type="submit" class="btn btn-primary" id="submit-btn" :class="{ 'shake': errors }" data-loading-disable >
|
||||
<span data-loading-class="!hidden">Test Connection</span>
|
||||
<span class="loading loading-spinner loading-xs hidden" data-loading-class-remove="hidden"></span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% if success %}
|
||||
<div class="mt-4 pt-4 border-t border-base-300">
|
||||
<button class="btn btn-success w-full" hx-post="/api/imap/sync" hx-target="#folders-list" hx-swap="innerHTML">
|
||||
<i class="fas fa-sync mr-2"></i>
|
||||
Sync Folders
|
||||
<div class="mt-4 pt-4 border-t border-base-300" data-loading-states>
|
||||
<button class="btn btn-success w-full" hx-post="/api/imap/sync" hx-target="#folders-list" hx-swap="innerHTML" data-loading-disable>
|
||||
<span data-loading-class="!hidden"><i class="fas fa-sync mr-2"></i>Sync Folders</span>
|
||||
<span class="loading loading-spinner loading-xs hidden" data-loading-class-remove="hidden"></span>
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user