From 9258bfd8113995a6251b5bc52494d3df9d999bec Mon Sep 17 00:00:00 2001 From: Marco0300 Date: Fri, 4 Sep 2026 14:16:29 +0200 Subject: [PATCH] deploy ui rebuild v2 --- apps/api/app/main.py | 9 +++++++-- apps/web/app.js | 3 ++- apps/web/asset-manifest.json | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/api/app/main.py b/apps/api/app/main.py index 7df7f5f..07eade5 100644 --- a/apps/api/app/main.py +++ b/apps/api/app/main.py @@ -1367,7 +1367,12 @@ class ApiHandler(BaseHTTPRequestHandler): except (TypeError,ValueError): policy={} credential_exists = bool(db.execute("SELECT 1 FROM source_credentials WHERE source_id=? AND organization_id=? AND provider=? AND key_name=?", (raw["id"], org, "google_places", "api_key")).fetchone()) item.update({"available": bool(meta.get("available", False)), "optional": bool(meta.get("optional", False)), - "configured": bool(meta.get("available", False) and (config.get("csv") or config.get("rows") is not None or raw["approved"])), + # Older registered free-source rows may have approved=0 + # even though their validated config is approved. Treat + # either signal as configured so the operator can test + # and enable the existing source instead of being sent + # back through setup. + "configured": bool(meta.get("available", False) and (config.get("csv") or config.get("rows") is not None or raw["approved"] or config.get("approved") is True)), "credential_status": ("Configured" if credential_exists else "Required / not configured") if meta.get("requires_credentials") else "Not required", "terms_status": "Provided" if policy.get("terms_url") or config.get("terms_url") else "Not reviewed", "owner": policy.get("owner") or config.get("owner") or "Not assigned", @@ -1431,7 +1436,7 @@ class ApiHandler(BaseHTTPRequestHandler): adapter=adapter_for(source['source_code'] or source['kind']) try: config=json.loads(source['config_json'] or '{}') except (TypeError,ValueError): config={} - metadata=next((item for item in available_adapters() if item['source_code']==source['kind']), {}) + metadata=next((item for item in available_adapters() if item['source_code']==(source['source_code'] or source['kind'])), {}) if not metadata.get('available', False): return self.send_json(409,{"error":"source_unavailable"}) validation=adapter.validate_config(config) # A blank manual source is a deliberate staging point: the query or diff --git a/apps/web/app.js b/apps/web/app.js index 012d71a..600baa9 100644 --- a/apps/web/app.js +++ b/apps/web/app.js @@ -359,7 +359,8 @@ $('aiProviderForm').addEventListener('submit',saveAiProviderSettings);$('aiProvi const actionButton = event.target.closest?.('[data-source-action="toggle"]'); if (!actionButton) return; const source = sources.find(item => String(item.id) === String(actionButton.dataset.sourceId)); - if (source && !source.configured && source.available) { event.preventDefault(); event.stopImmediatePropagation(); configureSourceFromUi(source, actionButton); } + const needsPromptConfig = ['public_website','dns','rdap','ct_logs'].includes(sourceType(source)); + if (source && !source.configured && source.available && needsPromptConfig) { event.preventDefault(); event.stopImmediatePropagation(); configureSourceFromUi(source, actionButton); } }, true); document.querySelectorAll('.sidebar nav a, [data-scroll]').forEach(link => link.addEventListener('click', event => { const target = (link.getAttribute('href') || link.dataset.scroll || '').replace(/^#/, ''); const view = viewMap[target]; if (view) { event.preventDefault(); activateView(view); document.querySelector('.sidebar')?.classList.remove('open'); } })); bootstrap(); diff --git a/apps/web/asset-manifest.json b/apps/web/asset-manifest.json index 4f6281f..8dc86f1 100644 --- a/apps/web/asset-manifest.json +++ b/apps/web/asset-manifest.json @@ -14,7 +14,7 @@ ], "integrity": { "config.js": "sha256-95293871c068b38098cead4af5de4b17ee505a0b051b9379567a716dc5364490", - "app.js": "sha256-3bd0215c904f7a8b0ebce3b96c799944880a3ce123694e3680db4516b690e490", + "app.js": "sha256-b7455ddbfdc755bdd08b1713362ed097ab678fb2c47b425bf11595bdb97ba8b6", "styles.css": "sha256-ba90290ab11e82a6b2639dfd70d1e74502c1cacb2b26cf1db92b45beb67ac03f", "index.html": "sha256-f5d2ab03e5c676f8af8a9bfd201e6d4fb3bfb19ba10098e93eae5680122fa2cc", "health.html": "sha256-c352a6f37aa24628cfc8d5709a70ff2d94181d192ed5fe00916cca9378a61d81",