Commit Graph

5 Commits (chore-js-refactor-footer-scripts-modules)

Author SHA1 Message Date
Jason Stirnaman f9f81ae8f9 Initial Kapa.ai chat integration.
Continue refactoring JavaScript into a component pattern and ESM.
Replaces some jQuery with native DOM API.

chore(ai): reference documentation and instructions for training AI

chore(ai): implement Kapa AI chat widget
- Move script tag to HTML template to make it obvious.
- Cleanup javascript to make it more component-like
- Set Kapa attributes, support setting userid

chore(js): add JS dependencies, previously referenced in script tags, to package.json for JS builds.

fix(api): indents

chore(js): package Mermaid diagram library

chore(js): refactor JS for AIChat and Theme as examples of using the component pattern for HTML/CSS/JS

chore(js): Use the new local-storage API in refactored module code and in code not yet ported. Cleanup syntax in local-storage and make functions available from window.LocalStorageAPI.

fix(js): theme.js name-change

chore(js): fix ai-chat.js file name

fix(js): refactor:
- componentNames are snakecase in HTML
- replace DOM selection method and jQuery eventhandler assignment
- remove old theme.js references

chore(ai): configure chat window overlay, size, and position:
- removes overlay and scroll lock
- positions chat to the right and bottom
- expands sample question width to 12 cols

chore(ai): edit disclaimer

fix(ai): size and position

chore(js): make ai-chat specific to configuration and and setting userid (for testing and future use).

fix(js): copy referrerHost variable to v3-wayfinding instead of relying on influxdb-url to assign it.

chore(ai): add a footer div at page bottom to contain modal triggers for custom-time and ask-ai. Still needs some CSS help. Moves tooltip text from CSS to HTML data attribute.

chore(ai): dynamically load AI script tag after DOMContentLoaded to avoid race conditions. Call initialization from the modal trigger module and pass the show trigger function to the onload handler.

fix(ai): fix modal triggers to viewport

fix(modal-triggers): stack the triggers into a single column.

restyle footer widgets

updated time selector modal to use correct storage term

minor style update

WIP(ai-chat): get product data

chore(js): Factor out pageContext module from influxdb-url.js

chore(js): Refactor helpers.js out of inflluxdb-url.js

WIP: refactor influxdburl - minimal changes for module conversions

feat(ai): Custom AI chat example questions product and version.
Ask AI example questions:
- Adds support for customizing example Ask AI questions per product or version.
- Configure questions in site `data/products.yml`; otherwise, it uses default questions from `ask-ai.js`

Context, page, and product data:
- Adds sample URLs for remaining versions in influxdb_urls
- `page-context.js` consolidates and exports constants for page context (protocol, host, path, referrer) and path-to-data mappings for product and influxdb_url site data

Module refactor:
- Refactors some JavaScript into ES6 modules, and refactors some of those further into a Component pattern--just vanilla JS and no shadow DOM stuff. The Component pattern that uses data attributes to "bind" JavaScript modules with CSS and HTML is a popular approach in modern web development. This pattern enhances modularity, reusability, and maintainability by associating behavior (JavaScript), structure (HTML), and style (CSS) through the use of data attributes.
- `assets/main.js` is the entrypoint
- Passes pageParams from the Hugo page to modules that import `@params`.
- Moves most external dependencies out of `script` tags and into package.json to be managed with `yarn`.
- Adds `eslint`.
- For modules that aren't yet components, wraps execution statements inside an `initialize()` function and calls the function from `main.js` on `DOMContentLoaded`.
- For components, if the page contains the `data-component="<component-name>"`, the matching element is passed to the component function on `DOMContentLoaded`.
- I tried to avoid changing logic where it wasn't necessary.

Update DOC_GPT_PROFILE.md

customize ai chat modal styles

fix(influxdb-url): Rename to cloud_dedicated in influxdb_urls.yml, remove newly added placeholder URL and use the extant default, refactor
- Rename  to  in influxdb_urls.yml
- Fix influxdb-url.js and data provision in local-storage.js to use the new name, mapping it to  to retain the existing local storage key

chore(api-lib): Use local-storage import instead of window global

chore(js): cleanup

fix(js): Ensure feature-callout initializes on page load

fix(theme): Load preferred theme before making the page visible. Execute a predefined function by specifying the function name in data-theme-callback

fix(search-toggle): Restores toggling the search field when sidebar is collapsed. Moves the event handler to a new search-button component

fix(ai): Fix custom attribute assignment. Rename property to ai_example_questions

Include the word `Bearer` or `Token`, a space, and your **token** value (all case-sensitive). Fix TOC links.
Fixes #5781

fix(api-docs): Update API reference directories and generation script for influxdb3 URL paths, update links and names in reference content

fix(api-ref): Update getswagger.sh destination paths to use the new directory structure when fetching spec files. Update the redocly  plugin module path.

hotfix: fix hlevel bug in children shortcode

Remove underline from custom time widget

add color to custom time widget styling
2025-02-03 08:31:55 -06:00
Scott Anderson 43fe12e2ec
Update Grafana documentation for v1, v2, and Enterprise (#5393)
* update v2 and cloud (tsm) grafana docs

* fixed bug where clicking tab would not update url

* updated v1 and enterprise grafana docs, added grafana video to v3
2024-03-27 10:33:45 -06:00
Scott Anderson 52e5e20aa7
Consolidate sessions cookies and implement APIs to manage each (#5319)
* WIP restructuring of cookies to pull from a limited set of cookies

* WIP update cloud-urls.js to use new cookie api

* move api-libs-related js into own file

* minor updates to cookies.js

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Update assets/js/notifications.js

* set get started date default to null

* remove line breaks in header js template

* Add cookie migration (#5323)

* migrate old cookies to new cookie structure

* set explicit expiration date on influxdata_docs_ported cookie

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>
2024-02-15 07:45:45 -07:00
Scott Anderson 6223ef0ecd
Cloud Dedicated documentation (#4903)
* base changes for influxdb cloud dedicated

* removed unnecessary whitespace from dedicated homepage

* influxctl reference documentation (#4855)

* influxctl reference docs

* fixed typo, added auth0 token life span

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* more updates to influxctl docs

* update influxctl docs to address PR feedback

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Add admin and manage databases sections to Cloud Dedicated (#4857)

* add admin and manage databases sections

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* added missing page descriptions to admin docs

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Add token management documentation to Cloud Dedicated documentation (#4861)

* add manage tokens documentation to dedicated

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* update admin token docs to address PR feedback

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Dedicated get started (#4878)

* WIP dedicated get started content

* fix(cst): infinite cardinality (#4851)

* WIP cloud dedicated get started

* feat(cloud-dedicated): WIP - write data to Cloud Dedicated

* fix(cloud-dedicated): grammar.

* feat(cloud-dedicated): WIP outline write methods, v1 API use

* fix(cloud-dedicated): dupe name.

* updated staging config, fixed dedicated page titles

* updated dedicated setup doc

* Cloud Dedicated primers v1 API: auth and write (#4865)

* feat(cloud-dedicated): v1 API with Cloud Dedicated
- Add /primers >> /api >> /v1 and /v2
- Move draft started in /write-data to /primers/api/v1
- Created code samples that still need testing
- v1 authentication schemes.

* fix(cloud-dedicated): list children pages

* wip(cloud-dedicated): v1 primer intro

* wip(cloud-dedicated): auth fixes.

* feat(cloud-dedicated): v1 API primer
- part of #4863, #4864
Still untested against CST:
- v1 auth methods
- v1 /write
  - Telegraf config
  - Precision
  - API sample code

* Update content/influxdb/cloud-dedicated/primers/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/_index.md

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v2/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v2/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update layouts/shortcodes/api/cloud/v2-prefer.html

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update shared/text/api/cloud-dedicated/basic-auth.js

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

---------

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Dedicated v1 write (#4873)

* wip(v1): Revise v1 and add client library info.

* feat(cloud-dedicated): primer v1 API auth and writes

- Fixes for v1 auth and writes
- Configuring node and python v1 client libraries for Cloud Dedicated.

* fix(cloud-dedicated): v1 intros:

- Fix redundant intro
- Query intros

* Apply suggestions from code review

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

---------

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Dedicated v2 write (#4875)

* fix(cloud-dedicated): v1 API primer:

- fix typo
- fix description

* wip(cloud-dedicated): v2 auth, write, Telegraf

* feat(cloud-dedicated): v2 API primer (#4874)

- v2 authentication
- Write using /api/v2/write
- Cleanup in v1

* Update content/influxdb/cloud-dedicated/primers/api/v2/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/primers/api/v1/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update shared/text/api/cloud-dedicated/token-auth-v2-write.sh

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* fix(cloud-dedicated): parameters for v1 and v2 writes

- testing proves that org can't be empty

Ongoing:
- writes with v2 client library appear to work, but I can't find the measurement when I query.
- v1 writes with curl respond with 404.

---------

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Add Python and Go write instructions to Cloud Dedicated get started (#4876)

* added python and go write instructions to dedicated get started

* Add get started query guide to dedicated (#4877)

* Add get started query guide to dedicated

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Apply suggestions from code review

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Port reference content into dedicated (#4879)

* ported line protocol and sql reference

* port glossary to dedicated

* fix(cloud-dedicated): cleanup (#4880)

* fix(cloud-dedicated): v1 parameter values

- Fixes parameter values in requests.
- Based on inspection of the request (default port, content-type headers).
- Still not working in CST.

* fix(cloud-dedicated): cleanup auth description and list query tools.

* fix(cloud-dedicated): cleanup auth examples:

- remove boilerplate JS examples. Eventually replace with client lib examples.
- fix incorrect URL
- replace localhost with cloud2 host

* fix(cloud-dedicated): replace placeholders

* Add support for custom dedicated URLs (#4882)

* add support for custom dedicated urls

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* removed unnecessary conditional in influxdb-urls.js

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* add information about flight sql support (#4894)

* Update influxctl install and setup instructions (#4893)

* updated influxctl install and setup instructions

* added details to influxctl init page

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Dedicated query data (#4895)

* WIP port query data section to dedicated

* updated database-name to iox-namespace-name

* updated grafana instructions

* update grafana install instructions

* updated images and links

* fixed broken links in query data section

* fix(cloud-dedicated): get-started write (#4890)

* fix(cloud-dedicated): package name typo

* fix(cloud-dedicated): URL missing query

* fix(cloud-dedicated): iox-namespace-name

* fix(cloud-dedicated): use get-started database name

* fix(cloud-dedicated): add auth-specific examples.

* fix(cloud-dedicated): use Bearer for v2 example

* fix(cloud-dedicated): add a note about token schemes and link to primer.

* fix(cloud-dedicated): org no longer required by API, remove from curl example

* fix(cloud-dedicated): use Bearer

* fix(cloud-dedicated): wordsmithing

* fix(cloud-dedicated): file name

* fix(cloud-dedicated): Go client works without org

* fix(cloud-dedicated): separate the commands for copy-pasting

* fix(cloud-dedicated): v1 API token authentication

* fix(cloud-dedicated): org parameter ignored, but needed in python clients

* fix(cloud-dedicated): v1 API examples and params for /query (#4897)

* fix(cloud-dedicated): minor word change (#4898)

* New homepage and structural changes (#4899)

* WIP first sweep of cloud-iox to cloud-serverless

* WIP iox to serverless content updates

* WIP iox to serverless updates in page templates and data files

* WIP new homepage

* chore(dedicated): copy best-practices from serverless

* fix(serverless): missing shortcut

* new homepage

* fix(dedicated): token links in v1 API primer

* chore(dedicated): write csv with Telegraf

* fix(serverless): write CSV with Telegraf

* updated homepage styles

* updated deps, fix unclosed shortcodes, fix light css

* fix product selector order

* updated database naming restrictions, add resource delete confirmation

* add cloud-ios to cloud-serverless redirect to edge.js

* remove sh from allowed extentions

* fix bug in redirect logic

* add sections to product dropdown (#4900)

* minor homepage css adjustment

* fixed page titles

* fixed more iox references in templates

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Migrate 1.x data to dedicated (#4901)

* fix(serverless): cleanup

* chore(dedicated): Migrate 1.x data to dedicated

- Minimal adaptation of IOx to Dedicated for now.
- Use APIs for writing data (CLIs? pyinflux3 only writes CSV? Can't promote influxdb_iox for now)
- Add 2.x CLI warning

* fix(dedicated): URL typos

* Update content/influxdb/cloud-dedicated/write-data/migrate-data/_index.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/write-data/migrate-data/migrate-1x-to-cloud-dedicated.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/write-data/migrate-data/migrate-1x-to-cloud-dedicated.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/write-data/migrate-data/migrate-1x-to-cloud-dedicated.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/write-data/migrate-data/migrate-1x-to-cloud-dedicated.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/influxdb/cloud-dedicated/write-data/migrate-data/migrate-1x-to-cloud-dedicated.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

---------

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* add step for requesting a cluster in dedicated setup

* minor content fixes in best practices

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>
2023-04-26 08:03:37 -06:00
Scott Anderson 4dcb7dfe6f
InfluxDB get started (#4628)
* WIP new influxdb get started

* WIP get started tutorial

* WIP get started

* persist tab selection when navigating tutorials

* WIP wrapped up query get-started

* WIP small updated to query get-started

* WIP influxdb get started

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* minor updates to get started started docs

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* fixed truncate behavior

* centralize get-started credential storing

* add suggestions from PR review

* Get started processing and visualizing data (#4648)

* remove draft from process and visualize

* WIP get started processing data

* updated get started processing data with PR feedback

* add get started visualizing data content

* udpated vis get started with PR feedback

* added clockface v4

* last updates from PR review

* ported get started content to 2.5

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2022-11-21 15:44:14 -07:00