| 1 | <html> |
| 2 | <head> |
| 3 | <title>Install Plugin from ZIP</title> |
| 4 | <script type="module"> |
| 5 | import { store } from "/plugins/_plugin_installer/webui/pluginInstallStore.js"; |
| 6 | </script> |
| 7 | </head> |
| 8 | <body> |
| 9 | <div x-data> |
| 10 | <template x-if="$store.pluginInstallStore"> |
| 11 | <div x-create="$store.pluginInstallStore.resetZip()"> |
| 12 | |
| 13 | <div class="pi-upload-section"> |
| 14 | <label for="plugin-zip-file" class="pi-upload-btn button confirm" |
| 15 | :class="{ 'pi-has-file': $store.pluginInstallStore.zipFile }"> |
| 16 | <x-icon class="icon" name="upload_file"></x-icon> |
| 17 | <span x-text="$store.pluginInstallStore.zipFileName || 'Select Plugin ZIP File'"></span> |
| 18 | </label> |
| 19 | <input type="file" id="plugin-zip-file" accept=".zip" style="display:none" |
| 20 | @change="$store.pluginInstallStore.handleFileUpload($event)"> |
| 21 | <div class="pi-hint"> |
| 22 | The ZIP should contain a folder with a plugin.yaml file. |
| 23 | </div> |
| 24 | </div> |
| 25 | |
| 26 | <div x-show="$store.pluginInstallStore.zipFile" class="pi-actions pi-actions-center"> |
| 27 | <button class="button confirm" |
| 28 | @click="$store.pluginInstallStore.installZip()" |
| 29 | :disabled="$store.pluginInstallStore.loading"> |
| 30 | <x-icon class="icon" name="download"></x-icon> Install Plugin |
| 31 | </button> |
| 32 | <x-extension id="install-zip-actions"></x-extension> |
| 33 | </div> |
| 34 | |
| 35 | <div x-show="$store.pluginInstallStore.loading" class="pi-loading"> |
| 36 | <span x-text="$store.pluginInstallStore.loadingMessage || 'Processing...'"></span> |
| 37 | </div> |
| 38 | |
| 39 | <div x-show="$store.pluginInstallStore.result" class="pi-result"> |
| 40 | <div class="pi-result-icon"> |
| 41 | <x-icon name="check_circle"></x-icon> |
| 42 | </div> |
| 43 | <div class="pi-result-text"> |
| 44 | <strong x-text="'Plugin installed: ' + ($store.pluginInstallStore.result?.title || $store.pluginInstallStore.result?.plugin_name || '')"></strong> |
| 45 | <div class="pi-result-path" x-text="$store.pluginInstallStore.result?.path || ''"></div> |
| 46 | </div> |
| 47 | </div> |
| 48 | |
| 49 | </div> |
| 50 | </template> |
| 51 | </div> |
| 52 | |
| 53 | <style> |
| 54 | @import url("/plugins/_plugin_installer/webui/install-shared.css"); |
| 55 | |
| 56 | .pi-upload-section { |
| 57 | text-align: center; |
| 58 | padding: 2rem 1rem; |
| 59 | border: 2px dashed var(--color-border); |
| 60 | border-radius: 8px; |
| 61 | margin-bottom: 1rem; |
| 62 | } |
| 63 | |
| 64 | .pi-upload-btn { |
| 65 | display: inline-flex; |
| 66 | align-items: center; |
| 67 | gap: 0.5rem; |
| 68 | padding: 0.75rem 1.5rem; |
| 69 | font-size: 1rem; |
| 70 | cursor: pointer; |
| 71 | } |
| 72 | |
| 73 | .pi-upload-btn.pi-has-file { |
| 74 | background: var(--color-panel); |
| 75 | border-color: var(--color-highlight); |
| 76 | } |
| 77 | |
| 78 | .pi-loading { |
| 79 | text-align: center; |
| 80 | padding: 1rem; |
| 81 | color: var(--color-text-secondary); |
| 82 | } |
| 83 | </style> |
| 84 | </body> |
| 85 | </html> |