fix(askai): add Explorer product mapping for Ask AI widget

- Add influxdb3_explorer mapping to getCurrentProductData()
- Add explorer context to getContext() function
- Ensures Explorer pages use correct ai_sample_questions from products.yml
- Reorder Explorer questions with 'install and run' first

This fixes the issue where Explorer Ask AI widget was showing wrong
example questions by properly loading the influxdb3_explorer config.
jts-askai-group-filters
Jason Stirnaman 2025-11-12 10:33:46 -06:00
parent 75b7f82f3e
commit 9c89863acf
2 changed files with 10 additions and 2 deletions

View File

@ -37,6 +37,11 @@ function getCurrentProductData() {
product: products.influxdb3_clustered, product: products.influxdb3_clustered,
urls: influxdbUrls.clustered, urls: influxdbUrls.clustered,
}, },
{
pattern: /\/influxdb3\/explorer/,
product: products.influxdb3_explorer,
urls: influxdbUrls.core,
},
{ {
pattern: /\/enterprise_v1\//, pattern: /\/enterprise_v1\//,
product: products.enterprise_influxdb, product: products.enterprise_influxdb,
@ -83,7 +88,7 @@ function getCurrentProductData() {
} }
// Return the page context // Return the page context
// (cloud, serverless, oss/enterprise, dedicated, clustered, other) // (cloud, serverless, oss/enterprise, dedicated, clustered, explorer, other)
function getContext() { function getContext() {
if (/\/influxdb\/cloud\//.test(window.location.pathname)) { if (/\/influxdb\/cloud\//.test(window.location.pathname)) {
return 'cloud'; return 'cloud';
@ -97,6 +102,8 @@ function getContext() {
return 'dedicated'; return 'dedicated';
} else if (/\/influxdb3\/clustered/.test(window.location.pathname)) { } else if (/\/influxdb3\/clustered/.test(window.location.pathname)) {
return 'clustered'; return 'clustered';
} else if (/\/influxdb3\/explorer/.test(window.location.pathname)) {
return 'explorer';
} else if ( } else if (
/\/(enterprise_|influxdb).*\/v[1-2]\//.test(window.location.pathname) /\/(enterprise_|influxdb).*\/v[1-2]\//.test(window.location.pathname)
) { ) {

View File

@ -68,9 +68,10 @@ influxdb3_explorer:
latest_patch: 1.4.0 latest_patch: 1.4.0
placeholder_host: localhost:8888 placeholder_host: localhost:8888
ai_sample_questions: ai_sample_questions:
- How do I install and run?
- How do I query data? - How do I query data?
- How do I visualize data? - How do I visualize data?
- How do I install and run?
ai_source_group_ids: "b650cf0b-4b52-42e8-bde7-a02738f27262" ai_source_group_ids: "b650cf0b-4b52-42e8-bde7-a02738f27262"
influxdb3_cloud_serverless: influxdb3_cloud_serverless: