mindroot 9.2.0__py3-none-any.whl → 9.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mindroot/coreplugins/admin/__init__.py +3 -1
- mindroot/coreplugins/admin/agent_router.py +250 -7
- mindroot/coreplugins/admin/asset_manager.py +164 -0
- mindroot/coreplugins/admin/command_router.py +236 -1
- mindroot/coreplugins/admin/mcp_catalog_routes.py +156 -0
- mindroot/coreplugins/admin/mcp_publish_routes.py +450 -0
- mindroot/coreplugins/admin/mcp_registry_routes.py +495 -0
- mindroot/coreplugins/admin/mcp_routes.py +216 -0
- mindroot/coreplugins/admin/mod.py +62 -0
- mindroot/coreplugins/admin/oauth_callback_router.py +84 -0
- mindroot/coreplugins/admin/persona_handler.py +15 -6
- mindroot/coreplugins/admin/persona_router.py +158 -2
- mindroot/coreplugins/admin/plugin_manager.py +63 -0
- mindroot/coreplugins/admin/plugin_router.py +1 -1
- mindroot/coreplugins/admin/plugin_router_fixed.py +23 -0
- mindroot/coreplugins/admin/plugin_router_new_not_working.py +145 -0
- mindroot/coreplugins/admin/plugin_routes.py +114 -0
- mindroot/coreplugins/admin/registry_settings_routes.py +140 -0
- mindroot/coreplugins/admin/router.py +116 -15
- mindroot/coreplugins/admin/service_models.py +1 -1
- mindroot/coreplugins/admin/settings_router.py +1 -0
- mindroot/coreplugins/admin/static/css/admin-custom.css +357 -2
- mindroot/coreplugins/admin/static/css/dark.css +1 -0
- mindroot/coreplugins/admin/static/css/default.css +4 -0
- mindroot/coreplugins/admin/static/js/about-info.js +367 -0
- mindroot/coreplugins/admin/static/js/agent-form.js +83 -3
- mindroot/coreplugins/admin/static/js/api-key-script.js +307 -0
- mindroot/coreplugins/admin/static/js/mcp-manager.js +348 -0
- mindroot/coreplugins/admin/static/js/mcp-publisher.js +780 -0
- mindroot/coreplugins/admin/static/js/persona-editor.js +34 -5
- mindroot/coreplugins/admin/static/js/plugin-toggle.js +1 -1
- mindroot/coreplugins/admin/static/js/recommended-plugin-install.js +63 -0
- mindroot/coreplugins/admin/static/js/registry-auth-section.js +132 -0
- mindroot/coreplugins/admin/static/js/registry-manager-base.js +613 -0
- mindroot/coreplugins/admin/static/js/registry-manager-old.js +385 -0
- mindroot/coreplugins/admin/static/js/registry-manager-publish-old-delete.js +166 -0
- mindroot/coreplugins/admin/static/js/registry-manager.js +351 -0
- mindroot/coreplugins/admin/static/js/registry-publish-section.js +377 -0
- mindroot/coreplugins/admin/static/js/registry-search-section.js +400 -0
- mindroot/coreplugins/admin/static/js/registry-search-section.js.bak +3 -0
- mindroot/coreplugins/admin/static/js/registry-settings.js +69 -0
- mindroot/coreplugins/admin/static/js/registry-shared-services.js +857 -0
- mindroot/coreplugins/admin/static/js/registry-simple-sections.js +85 -0
- mindroot/coreplugins/admin/static/js/secure-widget-manager.js +438 -0
- mindroot/coreplugins/admin/static/logo.png +0 -0
- mindroot/coreplugins/admin/templates/admin.jinja2 +275 -110
- mindroot/coreplugins/agent/Assistant/agent.json +27 -11
- mindroot/coreplugins/agent/agent.py +2 -2
- mindroot/coreplugins/agent/command_parser.py +25 -10
- mindroot/coreplugins/agent/templates/system.jinja2 +0 -12
- mindroot/coreplugins/chat/__init__.py +4 -1
- mindroot/coreplugins/chat/router.py +132 -20
- mindroot/coreplugins/chat/router_dedup_patch.py +20 -0
- mindroot/coreplugins/chat/services.py +31 -1
- mindroot/coreplugins/chat/static/css/action-fix.css +32 -0
- mindroot/coreplugins/chat/static/css/admin-custom.css +5 -3
- mindroot/coreplugins/chat/static/css/dark.css +24 -3
- mindroot/coreplugins/chat/static/css/default.css +24 -3
- mindroot/coreplugins/chat/static/css/main.css +1 -0
- mindroot/coreplugins/chat/static/js/action.js +137 -60
- mindroot/coreplugins/chat/static/js/chat-history.js +3 -0
- mindroot/coreplugins/chat/static/js/chat.js +59 -16
- mindroot/coreplugins/chat/static/js/chat.js.diff +221 -0
- mindroot/coreplugins/chat/static/js/chatform.js +2 -2
- mindroot/coreplugins/chat/static/site.webmanifest +1 -1
- mindroot/coreplugins/chat/templates/chat.jinja2 +3 -3
- mindroot/coreplugins/chat/widget_manager.py +139 -0
- mindroot/coreplugins/chat/widget_routes.py +287 -0
- mindroot/coreplugins/check_list/inject/admin.jinja2 +1 -1
- mindroot/coreplugins/email/__init__.py +2 -0
- mindroot/coreplugins/email/email_provider.py +2 -2
- mindroot/coreplugins/email/mod.py +100 -0
- mindroot/coreplugins/email/services.py +5 -3
- mindroot/coreplugins/email/smtp_handler.py +9 -3
- mindroot/coreplugins/email/test_email_service.py +75 -0
- mindroot/coreplugins/env_manager/mod.py +61 -25
- mindroot/coreplugins/home/router.py +37 -2
- mindroot/coreplugins/home/static/imgs/logo.png +0 -0
- mindroot/coreplugins/home/static/imgs/logo.png.bak +0 -0
- mindroot/coreplugins/home/static/imgs/logo_teal.png +0 -0
- mindroot/coreplugins/home/static/imgs/logo_teal2.png +0 -0
- mindroot/coreplugins/home/static/imgs/logo_teal_detailed.png +0 -0
- mindroot/coreplugins/home/static/imgs/logo_teal_python.png +0 -0
- mindroot/coreplugins/home/templates/home.jinja2 +15 -6
- mindroot/coreplugins/index/handlers/plugin_ops.py +1 -1
- mindroot/coreplugins/index/indices/default/index.json +6 -6
- mindroot/coreplugins/jwt_auth/middleware.py +47 -1
- mindroot/coreplugins/jwt_auth/mod.py +40 -17
- mindroot/coreplugins/l8n/__init__.py +6 -0
- mindroot/coreplugins/l8n/debug_loader.py +85 -0
- mindroot/coreplugins/l8n/debug_middleware.py +74 -0
- mindroot/coreplugins/l8n/l8n_constants.py +19 -0
- mindroot/coreplugins/l8n/language_detection.py +183 -0
- mindroot/coreplugins/l8n/middleware.py +151 -0
- mindroot/coreplugins/l8n/mod.py +277 -0
- mindroot/coreplugins/l8n/monkey_patch_to_delete.py +186 -0
- mindroot/coreplugins/l8n/test_enhanced.py +298 -0
- mindroot/coreplugins/l8n/test_l8n.py +95 -0
- mindroot/coreplugins/l8n/test_l8n_standalone.py +251 -0
- mindroot/coreplugins/l8n/test_middleware.py +272 -0
- mindroot/coreplugins/l8n/utils.py +232 -0
- mindroot/coreplugins/mcp_/__init__.py +14 -0
- mindroot/coreplugins/mcp_/catalog_commands.py +328 -0
- mindroot/coreplugins/mcp_/catalog_manager.py +263 -0
- mindroot/coreplugins/mcp_/dynamic_commands.py +154 -0
- mindroot/coreplugins/mcp_/mcp_manager.py +1031 -0
- mindroot/coreplugins/mcp_/mod.py +367 -0
- mindroot/coreplugins/mcp_/oauth_storage.py +144 -0
- mindroot/coreplugins/mcp_/server_installer.py +79 -0
- mindroot/coreplugins/mcp_/setup.py +26 -0
- mindroot/coreplugins/mcp_/test_dynamic_commands.py +134 -0
- mindroot/coreplugins/mcp_/testmcpclient.py +92 -0
- mindroot/coreplugins/persona/mod.py +12 -7
- mindroot/coreplugins/signup/templates/signup.jinja2 +1 -1
- mindroot/coreplugins/subscriptions/__init__.py +1 -0
- mindroot/coreplugins/subscriptions/mod.py +14 -3
- mindroot/coreplugins/subscriptions/router.py +3 -0
- mindroot/coreplugins/user_service/__init__.py +1 -2
- mindroot/coreplugins/user_service/admin_init.py +1 -0
- mindroot/coreplugins/user_service/email_service.py +72 -17
- mindroot/coreplugins/user_service/mod.py +10 -2
- mindroot/coreplugins/user_service/password_reset_service.py +180 -27
- mindroot/coreplugins/user_service/router.py +84 -22
- mindroot/lib/auth/api_key.py +28 -0
- mindroot/lib/cli/plugins.py +94 -0
- mindroot/lib/plugins/default_plugin_manifest.json +20 -0
- mindroot/lib/plugins/installation.py +5 -5
- mindroot/lib/plugins/l8n_static_handler.py +225 -0
- mindroot/lib/plugins/loader.py +33 -3
- mindroot/lib/plugins/loader_with_l8n.py +281 -0
- mindroot/lib/plugins/manifest.py +238 -17
- mindroot/lib/providers/commands.py +3 -1
- mindroot/lib/route_decorators.py +5 -5
- mindroot/lib/templates.py +183 -11
- mindroot/lib/utils/merge_arrays.py +1 -1
- mindroot/migrate.py +49 -0
- mindroot/registry/data_access.py +1 -1
- mindroot/server.py +47 -13
- mindroot/server_missing_normal_args.py +197 -0
- mindroot/server_prev.py +173 -0
- {mindroot-9.2.0.dist-info → mindroot-9.5.0.dist-info}/METADATA +7 -2
- {mindroot-9.2.0.dist-info → mindroot-9.5.0.dist-info}/RECORD +147 -114
- mindroot/coreplugins/admin/static/favicon/about.txt +0 -6
- mindroot/coreplugins/admin/static/favicon/android-chrome-512x512.png +0 -0
- mindroot/coreplugins/admin/static/favicon/apple-touch-icon.png +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon-16x16.png +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon-32x32.png +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon.ico +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon_io (1)/about.txt +0 -6
- mindroot/coreplugins/admin/static/favicon/favicon_io (1)/android-chrome-192x192.png +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon_io (1)/android-chrome-512x512.png +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon_io (1)/apple-touch-icon.png +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon_io (1)/favicon-16x16.png +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon_io (1)/favicon-32x32.png +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon_io (1)/favicon.ico +0 -0
- mindroot/coreplugins/admin/static/favicon/favicon_io (1)/site.webmanifest +0 -1
- mindroot/coreplugins/admin/static/favicon/logo.png +0 -0
- mindroot/coreplugins/admin/static/favicon/site.webmanifest +0 -1
- mindroot/coreplugins/admin/static/js/backup/agent-editor.js +0 -186
- mindroot/coreplugins/admin/static/js/backup/agent-form.js +0 -1133
- mindroot/coreplugins/admin/static/js/backup/agent-list.js +0 -94
- mindroot/coreplugins/chat/static/favicon/about.txt +0 -6
- mindroot/coreplugins/chat/static/favicon/android-chrome-192x192.png +0 -0
- mindroot/coreplugins/chat/static/favicon/android-chrome-512x512.png +0 -0
- mindroot/coreplugins/chat/static/favicon/apple-touch-icon.png +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon-16x16.png +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon-32x32.png +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon.ico +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon_io (1)/about.txt +0 -6
- mindroot/coreplugins/chat/static/favicon/favicon_io (1)/android-chrome-192x192.png +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon_io (1)/android-chrome-512x512.png +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon_io (1)/apple-touch-icon.png +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon_io (1)/favicon-16x16.png +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon_io (1)/favicon-32x32.png +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon_io (1)/favicon.ico +0 -0
- mindroot/coreplugins/chat/static/favicon/favicon_io (1)/site.webmanifest +0 -1
- mindroot/coreplugins/chat/static/favicon/logo.png +0 -0
- mindroot/coreplugins/chat/static/favicon/site.webmanifest +0 -1
- mindroot/coreplugins/index/default.json +0 -76
- mindroot/coreplugins/user_service/file_trigger_service.py +0 -72
- mindroot/coreplugins/user_service/hooks.py +0 -23
- /mindroot/coreplugins/{admin/static/favicon/android-chrome-192x192.png → home/static/imgs/backuplogo.png} +0 -0
- {mindroot-9.2.0.dist-info → mindroot-9.5.0.dist-info}/WHEEL +0 -0
- {mindroot-9.2.0.dist-info → mindroot-9.5.0.dist-info}/entry_points.txt +0 -0
- {mindroot-9.2.0.dist-info → mindroot-9.5.0.dist-info}/licenses/LICENSE +0 -0
- {mindroot-9.2.0.dist-info → mindroot-9.5.0.dist-info}/top_level.txt +0 -0
|
@@ -139,14 +139,40 @@ class PersonaEditor extends BaseEl {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
async fetchPersonas() {
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
if (this.scope === 'registry') {
|
|
143
|
+
// For registry personas, we need to get all owner directories
|
|
144
|
+
try {
|
|
145
|
+
const response = await fetch(`/personas/registry`);
|
|
146
|
+
const owners = await response.json();
|
|
147
|
+
this.personas = [];
|
|
148
|
+
|
|
149
|
+
// Flatten registry personas to show as "owner/name"
|
|
150
|
+
for (const owner of owners) {
|
|
151
|
+
const ownerResponse = await fetch(`/personas/registry/${owner.name}`);
|
|
152
|
+
const ownerPersonas = await ownerResponse.json();
|
|
153
|
+
ownerPersonas.forEach(persona => {
|
|
154
|
+
this.personas.push({ name: `${owner.name}/${persona.name}`, displayName: `${owner.name}/${persona.name}` });
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
} catch (e) {
|
|
158
|
+
this.personas = [];
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
const response = await fetch(`/personas/${this.scope}`);
|
|
162
|
+
this.personas = await response.json();
|
|
163
|
+
}
|
|
144
164
|
}
|
|
145
165
|
|
|
146
166
|
async fetchPersona() {
|
|
147
167
|
if (!this.newPersona && this.name) {
|
|
148
|
-
|
|
149
|
-
|
|
168
|
+
if (this.scope === 'registry') {
|
|
169
|
+
// For registry personas, use the full path format
|
|
170
|
+
const response = await fetch(`/personas/registry/${this.name}`);
|
|
171
|
+
this.persona = await response.json();
|
|
172
|
+
} else {
|
|
173
|
+
const response = await fetch(`/personas/${this.scope}/${this.name}`);
|
|
174
|
+
this.persona = await response.json();
|
|
175
|
+
}
|
|
150
176
|
} else {
|
|
151
177
|
this.persona = {};
|
|
152
178
|
}
|
|
@@ -223,10 +249,13 @@ class PersonaEditor extends BaseEl {
|
|
|
223
249
|
<label>
|
|
224
250
|
<input type="radio" name="scope" value="shared" .checked=${this.scope === 'shared'} @change=${this.handleScopeChange} /> Shared
|
|
225
251
|
</label>
|
|
252
|
+
<label>
|
|
253
|
+
<input type="radio" name="scope" value="registry" .checked=${this.scope === 'registry'} @change=${this.handleScopeChange} /> Registry
|
|
254
|
+
</label>
|
|
226
255
|
</div>
|
|
227
256
|
<select @change=${this.handlePersonaChange} .value=${this.name || ''} ?disabled=${this.newPersona}>
|
|
228
257
|
<option value="">Select a persona</option>
|
|
229
|
-
${this.personas.map(persona => html`<option value="${persona.name}">${persona.name}</option>`) }
|
|
258
|
+
${this.personas.map(persona => html`<option value="${persona.name}">${persona.displayName || persona.name}</option>`) }
|
|
230
259
|
</select>
|
|
231
260
|
<button class="btn btn-secondary" @click=${this.handleNewPersona}>New Persona</button>
|
|
232
261
|
</div>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { html, css } from '/admin/static/js/lit-core.min.js';
|
|
2
|
+
import { BaseEl } from '/admin/static/js/base.js';
|
|
3
|
+
|
|
4
|
+
class RecommendedPluginInstall extends BaseEl {
|
|
5
|
+
static properties = {
|
|
6
|
+
agent: { type: String },
|
|
7
|
+
logText: { type: String }
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
static styles = css`
|
|
11
|
+
dialog {
|
|
12
|
+
width: 90%;
|
|
13
|
+
max-width: 800px;
|
|
14
|
+
background: #0f0f1a;
|
|
15
|
+
color: #fff;
|
|
16
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
17
|
+
border-radius: 8px;
|
|
18
|
+
padding: 1rem;
|
|
19
|
+
}
|
|
20
|
+
pre.log {
|
|
21
|
+
height: 60vh;
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
background: #000;
|
|
24
|
+
color: #0f0;
|
|
25
|
+
padding: 0.5rem;
|
|
26
|
+
font-size: 0.8rem;
|
|
27
|
+
border: 1px solid #333;
|
|
28
|
+
}
|
|
29
|
+
.actions { text-align: right; margin-top: .5rem; }
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
this.agent = '';
|
|
35
|
+
this.logText = '';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
firstUpdated() { if (this.agent) this.startStream(); }
|
|
39
|
+
|
|
40
|
+
startStream() {
|
|
41
|
+
this.logText = '';
|
|
42
|
+
const es = new EventSource(`/admin/stream-install-recommended-plugins/${encodeURIComponent(this.agent)}`);
|
|
43
|
+
es.onmessage = (e) => {
|
|
44
|
+
if (e.data === 'END') { es.close(); return; }
|
|
45
|
+
this.logText += e.data;
|
|
46
|
+
this.requestUpdate();
|
|
47
|
+
const pre = this.shadowRoot.querySelector('pre.log');
|
|
48
|
+
if (pre) pre.scrollTop = pre.scrollHeight;
|
|
49
|
+
};
|
|
50
|
+
es.onerror = () => es.close();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
closeDialog() { this.remove(); }
|
|
54
|
+
|
|
55
|
+
_render() {
|
|
56
|
+
return html`
|
|
57
|
+
<dialog open>
|
|
58
|
+
<h3>Installing recommended plugins for <b>${this.agent}</b></h3>
|
|
59
|
+
<pre class="log">${this.logText}</pre>
|
|
60
|
+
<div class="actions"><button @click=${this.closeDialog}>Close</button></div>
|
|
61
|
+
</dialog>`; }
|
|
62
|
+
}
|
|
63
|
+
customElements.define('recommended-plugin-install', RecommendedPluginInstall);
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry Authentication Section
|
|
3
|
+
*
|
|
4
|
+
* Handles authentication UI and logic including login, registration,
|
|
5
|
+
* and user management for the registry manager.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { html } from '/admin/static/js/lit-core.min.js';
|
|
9
|
+
|
|
10
|
+
class RegistryAuthSection {
|
|
11
|
+
constructor(sharedState, mainComponent) {
|
|
12
|
+
this.state = sharedState;
|
|
13
|
+
this.main = mainComponent;
|
|
14
|
+
this.services = null; // Will be set by main component
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
setServices(services) {
|
|
18
|
+
this.services = services;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// === Event Handlers ===
|
|
22
|
+
|
|
23
|
+
async handleLogin() {
|
|
24
|
+
const username = this.main.shadowRoot.getElementById('username').value;
|
|
25
|
+
const password = this.main.shadowRoot.getElementById('password').value;
|
|
26
|
+
|
|
27
|
+
if (!username || !password) {
|
|
28
|
+
this.services.showToast('Please enter username and password', 'error');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const success = await this.services.login(username, password);
|
|
33
|
+
if (success) {
|
|
34
|
+
this.main.requestUpdate();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async handleRegister() {
|
|
39
|
+
const username = this.main.shadowRoot.getElementById('reg-username').value;
|
|
40
|
+
const email = this.main.shadowRoot.getElementById('reg-email').value;
|
|
41
|
+
const password = this.main.shadowRoot.getElementById('reg-password').value;
|
|
42
|
+
|
|
43
|
+
if (!username || !email || !password) {
|
|
44
|
+
this.services.showToast('Please fill in all registration fields', 'error');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const success = await this.services.register(username, email, password);
|
|
49
|
+
if (success) {
|
|
50
|
+
this.main.showRegisterForm = false;
|
|
51
|
+
this.main.requestUpdate();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
toggleRegisterForm() {
|
|
56
|
+
this.main.showRegisterForm = !this.main.showRegisterForm;
|
|
57
|
+
this.main.requestUpdate();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
logout() {
|
|
61
|
+
this.services.logout();
|
|
62
|
+
this.main.requestUpdate();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// === Render Methods ===
|
|
66
|
+
|
|
67
|
+
renderHeader() {
|
|
68
|
+
if (this.state.isLoggedIn) {
|
|
69
|
+
return this.renderLoggedInHeader();
|
|
70
|
+
} else {
|
|
71
|
+
return this.renderLoginForm();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
renderLoggedInHeader() {
|
|
76
|
+
return html`
|
|
77
|
+
<div class="user-info">
|
|
78
|
+
<span>Logged in as: ${this.state.currentUser?.username}</span>
|
|
79
|
+
<button @click=${() => this.logout()}>Logout</button>
|
|
80
|
+
</div>
|
|
81
|
+
`;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
renderLoginForm() {
|
|
85
|
+
if (this.main.showRegisterForm) {
|
|
86
|
+
return this.renderRegistrationForm();
|
|
87
|
+
} else {
|
|
88
|
+
return this.renderLoginSection();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
renderLoginSection() {
|
|
93
|
+
return html`
|
|
94
|
+
<div class="section">
|
|
95
|
+
<h3>Registry Login</h3>
|
|
96
|
+
<div class="login-form">
|
|
97
|
+
<input type="text" placeholder="Username or Email" id="username">
|
|
98
|
+
<input type="password" placeholder="Password" id="password">
|
|
99
|
+
<button class="primary" @click=${() => this.handleLogin()} ?disabled=${this.state.loading}>
|
|
100
|
+
${this.state.loading ? 'Logging in...' : 'Login'}
|
|
101
|
+
</button>
|
|
102
|
+
${this.main.error ? html`<div class="error">${this.main.error}</div>` : ''}
|
|
103
|
+
</div>
|
|
104
|
+
<div class="auth-toggle">
|
|
105
|
+
<button @click=${() => this.toggleRegisterForm()}>Don't have an account? Register</button>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
renderRegistrationForm() {
|
|
112
|
+
return html`
|
|
113
|
+
<div class="section">
|
|
114
|
+
<h3>Create Account</h3>
|
|
115
|
+
<div class="login-form">
|
|
116
|
+
<input type="text" placeholder="Username" id="reg-username">
|
|
117
|
+
<input type="email" placeholder="Email" id="reg-email">
|
|
118
|
+
<input type="password" placeholder="Password" id="reg-password">
|
|
119
|
+
<button class="primary" @click=${() => this.handleRegister()} ?disabled=${this.state.loading}>
|
|
120
|
+
${this.state.loading ? 'Creating Account...' : 'Create Account'}
|
|
121
|
+
</button>
|
|
122
|
+
${this.main.error ? html`<div class="error">${this.main.error}</div>` : ''}
|
|
123
|
+
</div>
|
|
124
|
+
<div class="auth-toggle">
|
|
125
|
+
<button @click=${() => this.toggleRegisterForm()}>Already have an account? Login</button>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
`;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export { RegistryAuthSection };
|