| 1 | <html> |
| 2 | <head> |
| 3 | <title>Install Plugin from Git</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.resetGit()"> |
| 12 | |
| 13 | <div class="pi-form-group"> |
| 14 | <label class="pi-label">Git Repository URL</label> |
| 15 | <input type="text" class="pi-input" |
| 16 | x-model="$store.pluginInstallStore.gitUrl" |
| 17 | :disabled="$store.pluginInstallStore.loading" |
| 18 | placeholder="https://github.com/user/my-plugin.git"> |
| 19 | </div> |
| 20 | |
| 21 | <div class="pi-form-group"> |
| 22 | <label class="pi-label">Access Token <span class="pi-optional">(optional, for private repos)</span></label> |
| 23 | <input type="text" class="pi-input masked-text-input" autocomplete="off" |
| 24 | x-model="$store.pluginInstallStore.gitToken" |
| 25 | :disabled="$store.pluginInstallStore.loading" |
| 26 | placeholder="ghp_xxxx or glpat-xxxx"> |
| 27 | <div class="pi-hint">Token is used only for cloning and is not stored.</div> |
| 28 | </div> |
| 29 | |
| 30 | <div class="pi-actions pi-actions-start"> |
| 31 | <button class="button confirm" |
| 32 | @click="$store.pluginInstallStore.installGit()" |
| 33 | :disabled="$store.pluginInstallStore.loading || !$store.pluginInstallStore.gitUrl.trim()"> |
| 34 | <template x-if="$store.pluginInstallStore.loading"> |
| 35 | <span class="pi-button-loading"> |
| 36 | <span class="spinner"></span> |
| 37 | <span x-text="$store.pluginInstallStore.loadingMessage || 'Cloning...'"></span> |
| 38 | </span> |
| 39 | </template> |
| 40 | <template x-if="!$store.pluginInstallStore.loading"> |
| 41 | <span> |
| 42 | <x-icon class="icon" name="terminal"></x-icon> Clone & Install |
| 43 | </span> |
| 44 | </template> |
| 45 | </button> |
| 46 | <x-extension id="install-git-actions"></x-extension> |
| 47 | </div> |
| 48 | |
| 49 | <div x-show="$store.pluginInstallStore.result" class="pi-result"> |
| 50 | <div class="pi-result-icon"> |
| 51 | <x-icon name="check_circle"></x-icon> |
| 52 | </div> |
| 53 | <div class="pi-result-text"> |
| 54 | <strong x-text="'Plugin installed: ' + ($store.pluginInstallStore.result?.title || $store.pluginInstallStore.result?.plugin_name || '')"></strong> |
| 55 | <div class="pi-result-path" x-text="$store.pluginInstallStore.result?.path || ''"></div> |
| 56 | </div> |
| 57 | </div> |
| 58 | |
| 59 | </div> |
| 60 | </template> |
| 61 | </div> |
| 62 | |
| 63 | <style> |
| 64 | @import url("/plugins/_plugin_installer/webui/install-shared.css"); |
| 65 | |
| 66 | .pi-form-group { |
| 67 | margin-bottom: 1rem; |
| 68 | } |
| 69 | |
| 70 | .pi-label { |
| 71 | display: block; |
| 72 | font-weight: 600; |
| 73 | margin-bottom: 0.35rem; |
| 74 | } |
| 75 | |
| 76 | .pi-optional { |
| 77 | font-weight: 400; |
| 78 | color: var(--color-text-secondary); |
| 79 | font-size: 0.85rem; |
| 80 | } |
| 81 | |
| 82 | .pi-input { |
| 83 | width: 100%; |
| 84 | padding: 0.6rem 0.75rem; |
| 85 | border: 1px solid var(--color-border); |
| 86 | border-radius: 4px; |
| 87 | background: var(--color-bg-primary); |
| 88 | color: var(--color-text-primary); |
| 89 | font-size: 0.95rem; |
| 90 | box-sizing: border-box; |
| 91 | } |
| 92 | |
| 93 | .pi-button-loading { |
| 94 | display: inline-flex; |
| 95 | align-items: center; |
| 96 | gap: 0.5rem; |
| 97 | } |
| 98 | </style> |
| 99 | </body> |
| 100 | </html> |