Merge branch 'master' into influxctl-token-expiration

influxctl-token-expiration
Scott Anderson 2025-03-31 08:16:22 -06:00 committed by GitHub
commit 1dddb0223b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 81 additions and 52 deletions

View File

@ -1,50 +1,77 @@
import $ from 'jquery';
import { toggleModal } from './modals.js';
/*
Interactions related to the Flux/InfluxDB version modal
*/
const fluxInfluxDBModal = '.modal-content#flux-influxdb-versions'
const pageType = ($(document).attr('title')).includes("package") ? "package" : "function";
const fluxInfluxDBModal = '.modal-content#flux-influxdb-versions';
// Check for deprecated or pending versions
function keysPresent() {
var list = $(fluxInfluxDBModal + ' .version-list')
var list = $(fluxInfluxDBModal + ' .version-list');
return {
pending: list.find('.pending').length !== 0,
deprecated: list.find('.deprecated').length !== 0,
supported: list.find('.supported').length !== 0,
}
};
}
// Only execute if the Flux/InfluxDB modal is present in the DOM
if ($(fluxInfluxDBModal).length > 0) {
var presentKeys = keysPresent()
// Remove color key list items if the colors/states are present in the version list
if (presentKeys.pending === false) { $(fluxInfluxDBModal + ' .color-key #pending-key' ).remove() }
if (presentKeys.deprecated === false) { $(fluxInfluxDBModal + ' .color-key #deprecated-key' ).remove() }
if (presentKeys.pending === false && presentKeys.deprecated === false) { $(fluxInfluxDBModal + ' .color-key' ).remove() }
// If no versions are supported, remove and replace InfluxDB version tables
if (Object.values(presentKeys).every(value => !value)) {
$(fluxInfluxDBModal + ' .influxdb-versions > :not(".more-info")').remove();
$(fluxInfluxDBModal + ' .influxdb-versions').prepend(`<p class="no-support">No versions of InfluxDB currently support this ${pageType}.</p>`)
}
}
// Open version modal and add query param
const queryParams = new URLSearchParams(window.location.search);
function openFluxVersionModal() {
function openFluxVersionModal(queryParams) {
const anchor = window.location.hash;
toggleModal('#flux-influxdb-versions');
queryParams.set('view', 'influxdb-support');
window.history.replaceState({}, '', `${location.pathname}?${queryParams}${anchor}`);
};
queryParams?.set('view', 'influxdb-support');
window.history.replaceState(
{},
'',
`${location.pathname}?${queryParams}${anchor}`
);
}
// Check for the modal query param and open the modal if it exists
if (queryParams.get('view') !== null) {
openFluxVersionModal();
};
export default function FluxInfluxDBVersionsTrigger({ component }) {
const $component = $(component);
const pageType = $(document).attr('title').includes('package')
? 'package'
: 'function';
// Only execute if the Flux/InfluxDB modal is present in the DOM
if ($(fluxInfluxDBModal).length > 0) {
var presentKeys = keysPresent();
// Remove color key list items if the colors/states are present in the version list
if (presentKeys.pending === false) {
$(fluxInfluxDBModal + ' .color-key #pending-key').remove();
}
if (presentKeys.deprecated === false) {
$(fluxInfluxDBModal + ' .color-key #deprecated-key').remove();
}
if (presentKeys.pending === false && presentKeys.deprecated === false) {
$(fluxInfluxDBModal + ' .color-key').remove();
}
// If no versions are supported, remove and replace InfluxDB version tables
if (Object.values(presentKeys).every((value) => !value)) {
$(
fluxInfluxDBModal + ' .influxdb-versions > :not(".more-info")'
).remove();
$(fluxInfluxDBModal + ' .influxdb-versions').prepend(
`<p class="no-support">No versions of InfluxDB currently support this ${pageType}.</p>`
);
}
}
// Open version modal and add query param
const queryParams = new URLSearchParams(window.location.search);
// // Check for the modal query param and open the modal if it exists
if (queryParams.get('view') !== null) {
openFluxVersionModal(queryParams);
}
// Open modal window on click
$component
.find('a[data-action="open"]:first')
.on('click', () => openFluxVersionModal(queryParams));
}

View File

@ -49,7 +49,7 @@ import ThemeSwitch from './theme-switch.js';
// import CustomTimestamps from './custom-timestamps.js';
// import Diagram from './Diagram.js';
// import FluxGroupKeysExample from './FluxGroupKeysExample.js';
// import FluxInfluxDBVersionsModal from './flux-influxdb-versions.js';
import FluxInfluxDBVersionsTrigger from './flux-influxdb-versions.js';
// import PageFeedback from './page-feedback.js';
// import SearchInput from './SearchInput.js';
// import Sidebar from './Sidebar.js';
@ -101,6 +101,10 @@ document.addEventListener('DOMContentLoaded', function () {
CustomTimeTrigger({ component });
window.influxdatadocs[componentName] = CustomTimeTrigger;
break;
case 'flux-influxdb-versions-trigger':
FluxInfluxDBVersionsTrigger({ component });
window.influxdatadocs[componentName] = FluxInfluxDBVersionsTrigger;
break;
case 'search-button':
SearchButton({ component });
window.influxdatadocs[componentName] = SearchButton;

View File

@ -209,5 +209,4 @@ To learn more about the InfluxDB write protocol,
check out the guide on [Writing Data](/influxdb/v1/guides/writing_data/).
To further explore the query language,
check out the guide on [Querying Data](/influxdb/v1/guides/querying_data/).
For more information on InfluxDB concepts, check out the [Key Concepts]
(/influxdb/v1/concepts/key_concepts/) page.
For more information on InfluxDB concepts, check out the [Key Concepts](/influxdb/v1/concepts/key_concepts/) page.

View File

@ -18,14 +18,14 @@ influxdb3 create table [OPTIONS] \
## Options
| Option | | Description |
| :----- | :-------------- | :--------------------------------------------------------------------------------------- |
| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) |
| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on |
| | `--token` | Authentication token |
| | `--tags` | _({{< req >}})_ Space-separated list of tag columns to include in the table |
| | `--fields` | Space-separated list of field columns to include in the table |
| `-h` | `--help` | Print help information |
| Option | | Description |
| :----- | :----------- | :--------------------------------------------------------------------------------------- |
| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) |
| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on |
| | `--token` | Authentication token |
| | `--tags` | _({{< req >}})_ Comma-separated list of tag columns to include in the table |
| | `--fields` | Comma-separated list of field columns and their types to include in the table |
| `-h` | `--help` | Print help information |
> [!Important]
>
@ -62,8 +62,8 @@ In the examples below, replace the following:
```bash
influxdb3 create table \
--tags tag1 tag2 tag3 \
--database DATABASE_NAME
--tags tag1,tag2,tag3 \
--database DATABASE_NAME \
TABLE_NAME
```
@ -73,9 +73,9 @@ influxdb3 create table \
```bash
influxdb3 create table \
--tags room sensor_id \
--fields temp:float64 hum:float64 co:int64 \
--database DATABASE_NAME
--tags room,sensor_id \
--fields temp:float64,hum:float64,co:int64 \
--database DATABASE_NAME \
TABLE_NAME
```

View File

@ -10,7 +10,7 @@
{{ $productName }} {{ .Page.Params.introduced }}{{ if .Page.Params.deprecated }}{{ print " " .Page.Params.deprecated }}{{ else if .Page.Params.removed }}{{ print " " .Page.Params.removed }}{{ else }}+{{ end }}
</li>
{{ if $inStdlib }}
<li class="flux-influxdb"><a onclick="openFluxVersionModal()">View InfluxDB support</a></li>
<li class="flux-influxdb" data-component="flux-influxdb-versions-trigger"><a data-action="open">View InfluxDB support</a></li>
{{ end }}
</ul>
{{ end }}

View File

@ -7,10 +7,9 @@
{{ $fluxGroupKeys := resources.Get "js/flux-group-keys.js" }}
{{ $dateTime := resources.Get "js/datetime.js" }}
{{ $homepageInteractions := resources.Get "js/home-interactions.js" }}
{{ $fluxInfluxDBVersions := resources.Get "/js/flux-influxdb-versions.js" }}
{{ $codePlaceholders := resources.Get "/js/code-placeholders.js" }}
{{ $releaseTOC := resources.Get "/js/release-toc.js" }}
{{ $footerjs := slice $versionSelector $searchInteractions $listFilters $featureCallouts $keybindings $homepageInteractions $fluxInfluxDBVersions | resources.Concat "js/footer.bundle.js" | resources.Fingerprint }}
{{ $footerjs := slice $versionSelector $searchInteractions $listFilters $featureCallouts $keybindings $homepageInteractions | resources.Concat "js/footer.bundle.js" | resources.Fingerprint }}
{{ $fluxGroupKeyjs := $fluxGroupKeys | resources.Fingerprint }}
{{ $dateTimejs := $dateTime | resources.Fingerprint }}
{{ $codePlaceholdersjs := $codePlaceholders | resources.Fingerprint }}