| 1 | <html> |
| 2 | <head> |
| 3 | <title>Rename</title> |
| 4 | <script type="module"> |
| 5 | import { store } from "/plugins/_chat_naming/webui/chat-naming-store.js"; |
| 6 | </script> |
| 7 | </head> |
| 8 | <body> |
| 9 | <div x-data> |
| 10 | <template x-if="$store.chatNaming"> |
| 11 | <div class="chat-naming-modal" |
| 12 | x-init="await $store.chatNaming.onOpen(); $nextTick(() => $refs.nameInput?.focus())"> |
| 13 | <label class="chat-naming-label" for="chat-naming-input">Name</label> |
| 14 | <input id="chat-naming-input" type="text" x-ref="nameInput" |
| 15 | x-model="$store.chatNaming.name" |
| 16 | @keydown.enter.prevent="$store.chatNaming.save()" |
| 17 | :disabled="$store.chatNaming.loading || $store.chatNaming.saving" |
| 18 | maxlength="200" autocomplete="off"> |
| 19 | </div> |
| 20 | </template> |
| 21 | </div> |
| 22 | |
| 23 | <template x-if="$store.chatNaming"> |
| 24 | <div class="modal-footer" data-modal-footer> |
| 25 | <div class="chat-naming-secondary-actions"> |
| 26 | <button type="button" class="btn" |
| 27 | @click="$store.chatNaming.generate()" |
| 28 | :disabled="$store.chatNaming.loading || $store.chatNaming.generating |
| 29 | || $store.chatNaming.saving"> |
| 30 | <x-icon |
| 31 | :name="$store.chatNaming.generating ? 'progress_activity' : 'auto_awesome'"></x-icon> |
| 32 | <span x-text="$store.chatNaming.generating ? 'Generating...' : 'Generate'"></span> |
| 33 | </button> |
| 34 | <button type="button" class="btn" |
| 35 | @click="$store.chatNaming.openSettings()" |
| 36 | :disabled="$store.chatNaming.loading || $store.chatNaming.saving"> |
| 37 | <x-icon name="settings"></x-icon> |
| 38 | <span>Settings</span> |
| 39 | </button> |
| 40 | </div> |
| 41 | <button type="button" class="btn btn-ok" |
| 42 | @click="$store.chatNaming.save()" |
| 43 | :disabled="$store.chatNaming.loading || $store.chatNaming.saving |
| 44 | || !$store.chatNaming.name.trim()"> |
| 45 | Save |
| 46 | </button> |
| 47 | <button type="button" class="btn btn-cancel" |
| 48 | @click="$store.chatNaming.close()" :disabled="$store.chatNaming.saving"> |
| 49 | Cancel |
| 50 | </button> |
| 51 | </div> |
| 52 | </template> |
| 53 | |
| 54 | <style> |
| 55 | .chat-naming-modal { |
| 56 | display: flex; |
| 57 | flex-direction: column; |
| 58 | gap: var(--spacing-sm); |
| 59 | padding: 1rem; |
| 60 | } |
| 61 | |
| 62 | .chat-naming-label { |
| 63 | color: var(--color-text); |
| 64 | font-weight: 600; |
| 65 | } |
| 66 | |
| 67 | .chat-naming-modal input { |
| 68 | width: 100%; |
| 69 | } |
| 70 | |
| 71 | .chat-naming-secondary-actions { |
| 72 | display: inline-flex; |
| 73 | align-items: center; |
| 74 | gap: 0.75rem; |
| 75 | margin-right: auto; |
| 76 | } |
| 77 | |
| 78 | .chat-naming-secondary-actions .btn { |
| 79 | display: inline-flex; |
| 80 | align-items: center; |
| 81 | justify-content: center; |
| 82 | gap: 0.5rem; |
| 83 | } |
| 84 | |
| 85 | .chat-naming-secondary-actions .material-symbols-outlined { |
| 86 | font-size: 1.1rem; |
| 87 | line-height: 1; |
| 88 | } |
| 89 | </style> |
| 90 | </body> |
| 91 | </html> |