iobroker.influxdb 4.0.2 → 5.0.2
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.
- package/LICENSE +1 -1
- package/README.md +39 -245
- package/RetentionPolicies.md +23 -22
- package/admin/custom/assets/Components-B31xFgHA.js +1 -0
- package/admin/custom/assets/DataBrowser-BjC3hA47.js +1 -0
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__InfluxDBComponentsSet__mf_owner__1-B9Ylge1m.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-B1eVfdnr.js +1243 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-CxiY1CI5.js +1494 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DySAygl2.js +9 -0
- package/admin/custom/assets/hostInit-6uyyXgUg.js +1 -0
- package/admin/custom/assets/index-Bqsp0Vtz.js +1 -0
- package/admin/custom/assets/lib-BQ9Iy9vH.js +3 -0
- package/admin/custom/assets/mf-entry-bootstrap-0-1d56ce7a.js +41 -0
- package/admin/custom/assets/rolldown-runtime-C0FnF6B9.js +1 -0
- package/admin/custom/assets/virtualExposes-BDloXo0b.js +1 -0
- package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__InfluxDBComponentsSet__customComponents_js-C-UWbkzd.js +1 -0
- package/admin/custom/assets/virtual_mf-exposes___mfe_internal__InfluxDBComponentsSet__customComponents_js-DCQ_KAEk.js +2 -0
- package/admin/custom/assets/vite-preload-helper-B7qeedMF.js +1 -0
- package/admin/custom/customComponents.js +12 -0
- package/admin/custom/i18n/de.json +30 -0
- package/admin/custom/i18n/en.json +30 -0
- package/admin/custom/i18n/es.json +30 -0
- package/admin/custom/i18n/fr.json +30 -0
- package/admin/custom/i18n/it.json +30 -0
- package/admin/custom/i18n/nl.json +30 -0
- package/admin/custom/i18n/pl.json +30 -0
- package/admin/custom/i18n/pt.json +30 -0
- package/admin/custom/i18n/ru.json +30 -0
- package/admin/custom/i18n/uk.json +30 -0
- package/admin/custom/i18n/zh-cn.json +30 -0
- package/admin/custom/mf-manifest.json +1 -0
- package/admin/i18n/{de/translations.json → de.json} +23 -4
- package/admin/i18n/{en/translations.json → en.json} +22 -3
- package/admin/i18n/{es/translations.json → es.json} +20 -1
- package/admin/i18n/fr.json +108 -0
- package/admin/i18n/it.json +108 -0
- package/admin/i18n/{nl/translations.json → nl.json} +19 -0
- package/admin/i18n/pl.json +108 -0
- package/admin/i18n/pt.json +108 -0
- package/admin/i18n/ru.json +108 -0
- package/admin/i18n/uk.json +108 -0
- package/admin/i18n/zh-cn.json +108 -0
- package/admin/jsonConfig.json +488 -359
- package/admin/jsonCustom.json +1 -1
- package/admin/words.js +87 -87
- package/build/lib/Database.js +76 -0
- package/build/lib/Database.js.map +1 -0
- package/build/lib/DatabaseInfluxDB1x.js +194 -0
- package/build/lib/DatabaseInfluxDB1x.js.map +1 -0
- package/build/lib/DatabaseInfluxDB2x.js +252 -0
- package/build/lib/DatabaseInfluxDB2x.js.map +1 -0
- package/build/main.js +3219 -0
- package/build/main.js.map +1 -0
- package/docker-compose.yaml +63 -0
- package/io-package.json +90 -54
- package/package.json +31 -19
- package/admin/i18n/fr/translations.json +0 -89
- package/admin/i18n/it/translations.json +0 -89
- package/admin/i18n/pl/translations.json +0 -89
- package/admin/i18n/pt/translations.json +0 -89
- package/admin/i18n/ru/translations.json +0 -89
- package/admin/i18n/zh-cn/translations.json +0 -89
- package/lib/Database.js +0 -30
- package/lib/DatabaseInfluxDB1x.js +0 -136
- package/lib/DatabaseInfluxDB2x.js +0 -370
- package/lib/aggregate.js +0 -1000
- package/main.js +0 -2787
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2016-
|
|
3
|
+
Copyright (c) 2016-2026 bluefox <dogafox@gmail.com>, apollon77
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -91,6 +91,7 @@ CREATE USER "user" WITH PASSWORD '<userpassword>'
|
|
|
91
91
|
CREATE DATABASE "iobroker"
|
|
92
92
|
GRANT ALL ON "iobroker" TO "user"
|
|
93
93
|
```
|
|
94
|
+
|
|
94
95
|
Enable authentication by editing /etc/influxdb/influxdb.conf:
|
|
95
96
|
```
|
|
96
97
|
[http]
|
|
@@ -105,6 +106,12 @@ Enable authentication by editing /etc/influxdb/influxdb.conf:
|
|
|
105
106
|
```
|
|
106
107
|
- Restart service: ``` service influxdb restart ```
|
|
107
108
|
|
|
109
|
+
## Self-hosted docker image for InfluxDB
|
|
110
|
+
This version of the adapter could start a self-hosted docker image of InfluxDB 2.x.
|
|
111
|
+
It is not opened for the network and only accessible from localhost. Of course, the docker environment must be installed and running on the host.
|
|
112
|
+
|
|
113
|
+
The `iobroker` user must have access to the docker CLI. To fix the rights start `iob fix`.
|
|
114
|
+
|
|
108
115
|
## Installation of Grafana (Charting Tool)
|
|
109
116
|
There is an additional charting tool for InfluxDB - Grafana.
|
|
110
117
|
It must be installed additionally.
|
|
@@ -375,10 +382,9 @@ sendTo('influxdb.0', 'update', [
|
|
|
375
382
|
If you want to flush the buffers for one or all data points to the Database, you can use the build in system function `flushBuffer`:
|
|
376
383
|
|
|
377
384
|
```javascript
|
|
378
|
-
sendTo('influxdb.0', 'flushBuffer', {id: 'mbus.0.counter.xxx'
|
|
379
|
-
, result => console.log('deleted, error: ' + result.error));
|
|
385
|
+
sendTo('influxdb.0', 'flushBuffer', {id: 'mbus.0.counter.xxx'}, result => console.log('deleted, error: ' + result.error));
|
|
380
386
|
```
|
|
381
|
-
if no id is provided all buffers will be flushed.
|
|
387
|
+
if no id is provided, all buffers will be flushed.
|
|
382
388
|
|
|
383
389
|
## History Logging Management via Javascript
|
|
384
390
|
The adapter supports enabling and disabling of history logging via JavaScript and also retrieving the list of enabled data points with their settings.
|
|
@@ -428,8 +434,8 @@ The message has no parameters.
|
|
|
428
434
|
|
|
429
435
|
```javascript
|
|
430
436
|
sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
|
|
431
|
-
//result is object like:
|
|
432
|
-
{
|
|
437
|
+
// result is an object like:
|
|
438
|
+
console.log(JSON.stringify({
|
|
433
439
|
'system.adapter.influxdb.0.memRss': {
|
|
434
440
|
changesOnly: true,
|
|
435
441
|
debounce: 0,
|
|
@@ -440,8 +446,8 @@ sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
|
|
|
440
446
|
changesRelogInterval: 0,
|
|
441
447
|
aliasId: ''
|
|
442
448
|
}
|
|
443
|
-
...
|
|
444
|
-
}
|
|
449
|
+
/// ...
|
|
450
|
+
}));
|
|
445
451
|
});
|
|
446
452
|
```
|
|
447
453
|
|
|
@@ -451,6 +457,30 @@ sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
|
|
|
451
457
|
-->
|
|
452
458
|
|
|
453
459
|
## Changelog
|
|
460
|
+
### 5.0.2 (2026-08-26)
|
|
461
|
+
* (@GermanBluefox) Added the data browser to the configuration, so the stored values can be viewed, edited and deleted.
|
|
462
|
+
* (@GermanBluefox) The aggregation is used now from `@iobroker/aggregate` and is shared with the history and SQL adapters.
|
|
463
|
+
* (@joltcoke) Fixed average and total returning null for every interval that contains a null value: parseFloat(null) is NaN and poisoned the sum of the whole interval (thanks to @joltcoke, ioBroker/ioBroker.sql#526). As the result was NaN and not null, ignoreNull could not act on it either
|
|
464
|
+
* (@joltcoke) Fixed min returning a wrong value if the interval contains a null, minmax losing the minimum if the interval starts with a null, and percentile/quantile counting a null as 0
|
|
465
|
+
|
|
466
|
+
### 5.0.1 (2026-08-15)
|
|
467
|
+
* (@GermanBluefox) Completely refactored the code to TypeScript and ES6
|
|
468
|
+
* (@GermanBluefox) Added possibility to start docker containers directly from the adapter
|
|
469
|
+
* (mcm1957) Adapter requires admin >= 7.7.2 now
|
|
470
|
+
* (arteck) Fixed the connection handling for InfluxDB 1.x: the health check (ping) and the automatic reconnect were never started
|
|
471
|
+
* (arteck) Fixed the loss of buffered values if the writing was running while new values arrived or if the write failed
|
|
472
|
+
* (arteck) Values are no longer written twice if they are written directly (buffer size 0 or conflicting points)
|
|
473
|
+
* (arteck) State IDs and database names are now escaped in the queries
|
|
474
|
+
* (arteck) The password/token is no longer written into the log by the connection test
|
|
475
|
+
* (arteck) The settings "request timeout" and "validate SSL" are now used for InfluxDB 1.x too
|
|
476
|
+
* (arteck) Fixed the cache file name if more than one instance runs in the compact mode
|
|
477
|
+
* (arteck) Fixed the aggregation for `percentile: 100`/`quantile: 1` and the last value of `integralTotal`
|
|
478
|
+
* (bluefox) Fixed empty charts for the aggregation `onchange` ("raw" in e-charts): it was run through the interval aggregation and returned only `null` values
|
|
479
|
+
* (@GermanBluefox) Minimal node.js version is 22
|
|
480
|
+
|
|
481
|
+
### 4.0.3 (2024-05-16)
|
|
482
|
+
* (bluefox) Some packages were updated
|
|
483
|
+
|
|
454
484
|
### 4.0.2 (2024-01-03)
|
|
455
485
|
* (bluefox) Corrected JSON config
|
|
456
486
|
* (Marc-Berg) Corrected filter function in booleanTypeCheckQuery
|
|
@@ -462,249 +492,13 @@ sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
|
|
|
462
492
|
### 3.2.0 (2022-09-19)
|
|
463
493
|
* (Apollon77) Adjust cache file to be different per instance when having multiple instances
|
|
464
494
|
|
|
465
|
-
|
|
466
|
-
* (Apollon77) Fix crash cases reported by Sentry
|
|
467
|
-
|
|
468
|
-
### 3.1.7 (2022-06-27)
|
|
469
|
-
* (Apollon77) Allows removing a configuration value for "round" in config again
|
|
470
|
-
|
|
471
|
-
### 3.1.6 (2022-06-27)
|
|
472
|
-
* (Apollon77) When not count is provided for aggregate "none" or "onchange" then the limit (default 2000) is used as count to define the number of data to return.
|
|
473
|
-
|
|
474
|
-
### 3.1.5 (2022-06-12)
|
|
475
|
-
* (Apollon77) Make sure the debug log is active, according to the settings
|
|
476
|
-
|
|
477
|
-
### 3.1.4 (2022-06-08)
|
|
478
|
-
* (Apollon77) Performance optimizations for GetHistory calls, especially for "minmax" aggregate method
|
|
479
|
-
* (Apollon77) Prevent the crash case reported by Sentry
|
|
480
|
-
|
|
481
|
-
### 3.1.3 (2022-06-01)
|
|
482
|
-
* (Apollon77) Corrected issue when testing connection to InfluxDBv1 with weird passwords
|
|
483
|
-
|
|
484
|
-
### 3.1.2 (2022-05-31)
|
|
485
|
-
* (Apollon77) Workaround an admin issue when testing connection to InfluxDB
|
|
486
|
-
|
|
487
|
-
### 3.1.0 (2022-05-27)
|
|
488
|
-
* (Apollon77) Data are not converted to number if they are other data types on `getHistory` to respect the saved data formats as defined in the datapoint settings for storage.
|
|
489
|
-
* (Apollon77) Fix retention change to lower checkbox in UI
|
|
490
|
-
* (Apollon77) Allow storeState again to write to InfluxDB for "unknown state ids" - "rules" usage is not supported in for this and storeState would be silently discarded in this case!
|
|
491
|
-
* (Apollon77) Fix several crash cases reported by Sentry
|
|
492
|
-
* (Apollon77) Make sure disabling "Log changes only" also really do not log the changes anymore
|
|
493
|
-
* (Apollon77) Allow storeState and GetHistory also to be called for "unknown ids"
|
|
494
|
-
|
|
495
|
-
### 3.0.2 (2022-05-12)
|
|
496
|
-
* (Apollon77) handles an empty Path for InfluxDB 2.0 correctly in all cases
|
|
497
|
-
|
|
498
|
-
### 3.0.1 (2022-05-11)
|
|
499
|
-
* (Apollon77) BREAKING: Configuration is only working in the new Admin 5 UI!
|
|
500
|
-
* (Apollon77) Did bigger adjustments to the recording logic and added a lot of new Features. Please refer to Changelog and Forum post for details.
|
|
501
|
-
|
|
502
|
-
### 3.0.0 (2022-05-11)
|
|
503
|
-
* (Apollon77) Breaking: Configuration is only working in the new Admin 5 UI!
|
|
504
|
-
* (Apollon77) Breaking! Did bigger adjustments to the recording logic. Debounce is refined and blockTime is added to differentiate between the two checks
|
|
505
|
-
* (Apollon77) Breaking! GetHistory requests now need to deliver the ts in milliseconds! Make sure to use up to date scripts and Charting UIs
|
|
506
|
-
* (Apollon77) New setting added to disable the "logging of additional values for charting optimization" - then only the expected data are logged
|
|
507
|
-
* (Apollon77) Added new Debug flag to enable/disable debug logging on datapoint level (default is false) to optimize performance
|
|
508
|
-
* (Apollon77) Added flag returnNewestEntries for GetHistory to determine which records to return when more entries as "count" are existing for aggregate "none"
|
|
509
|
-
* (Apollon77) Flush the buffer for the datapoint which is queried by GetHistory before the query is done, so that all data are in the database
|
|
510
|
-
* (Apollon77) make sure id is always returned on GetHistory when addId is set
|
|
511
|
-
* (Apollon77) Added aggregate method "percentile" to calculate the percentile (0..100) of the values (requires options.percentile with the percentile level, defaults to 50 if not provided). Basically same as Quantile just different levels are used. Calculation will be done by InfluxDB
|
|
512
|
-
* (Apollon77) Added aggregate method "quantile" to calculate the quantile (0..1) of the values (requires options.quantile with the quantile level, defaults to 0.5 if not provided). Basically same as Percentile just different levels are used. Calculation will be done by InfluxDB
|
|
513
|
-
* (Apollon77) Added (experimental) method "integral" to calculate the integral of the values. Requires options.integralUnit with the time duration of the integral in seconds, defaults to 60s if not provided. Optionally a linear interpolation can be done by setting options.integralInterpolation to "linear". Calculation will be done byInfluxDB (except for InfluxDB 1 and interpolation "linear", this is done by adapter on raw data)
|
|
514
|
-
* (Apollon77) When request contains flag removeBorderValues: true, the result then cut the additional pre and post border values out of the results
|
|
515
|
-
* (Apollon77) Enhance the former "Ignore below 0" feature and now allow specifying to ignore below or above specified values. The old setting is converted to the new one
|
|
516
|
-
* (Apollon77) Allow to specify custom retention duration in days
|
|
517
|
-
* (Apollon77) Added a new message flushBuffer to flush complete buffers or for a given id
|
|
518
|
-
* (Apollon77) Allow to specify an additional path for the InfluxDB URL, when Reverse proxies are used or such
|
|
519
|
-
* (Apollon77) Make sure that min change delta allows numbers entered with comma (german notation) in all cases
|
|
520
|
-
* (Apollon77) Added support to specify how to round numbers on query per datapoint
|
|
521
|
-
* (Apollon77) Allow to specify if the last value of a state is logged on startup
|
|
522
|
-
|
|
523
|
-
### 2.6.3 (2022-03-07)
|
|
524
|
-
* (Apollon77) Fix potential crash cases (Sentry IOBROKER-INFLUXDB-4Q)
|
|
525
|
-
|
|
526
|
-
### 2.6.2 (2022-03-03)
|
|
527
|
-
* (Apollon77) Correctly handle db names with hyphens for InfluxDB 1
|
|
528
|
-
* (Apollon77) Fix getHistory for non-boolean fields
|
|
529
|
-
* (Apollon77) Adjust shard group duration to influxdb proposals
|
|
530
|
-
|
|
531
|
-
### 2.6.1 (2022-02-28)
|
|
532
|
-
* (Excodibur) Address issue with updating retention policy for influxDB 1
|
|
533
|
-
|
|
534
|
-
### 2.6.0 (2022-02-24)
|
|
535
|
-
* (Excodibur) Make request timeout configurable - defaults to 30s
|
|
536
|
-
* (Apollon77) Added an option to also accept self-signed ssl certificates for InfluxDB 2.x
|
|
537
|
-
|
|
538
|
-
### 2.5.2 (2022-02-22)
|
|
539
|
-
* (bluefox) Marked interpolated data with `i=true`
|
|
540
|
-
|
|
541
|
-
### 2.5.0 (2022-02-14)
|
|
542
|
-
* (bluefox) Added new messages: 'update', 'delete', 'deleteRange', 'deleteAll' (only for influxdb v1)
|
|
543
|
-
* (bluefox) Corrected aggregation of data
|
|
544
|
-
|
|
545
|
-
### 2.4.0 (2021-12-19)
|
|
546
|
-
* (Excodibur) Added expert settings to deactivate health checks for Influx 2 db (There are no health checks for Influx 1)
|
|
547
|
-
* (Excodibur) Hide settings not relevant when "log changes only" is not used
|
|
548
|
-
* (Apollon77) Allow all number values for debounce again
|
|
549
|
-
* (Apollon77) InfluxDB also does not like Infinite values, so ignore them too
|
|
550
|
-
|
|
551
|
-
### 2.3.0 (2021-12-14)
|
|
552
|
-
* (bluefox) Support only `js.controller` >= 3.3.x
|
|
553
|
-
* (bluefox) Used system/custom view for collecting the objects
|
|
554
|
-
* (bluefox) Implemented option to ignore zero- or/and below zero- values
|
|
555
|
-
|
|
556
|
-
### 2.2.0 (2021-08-25)
|
|
557
|
-
* (Excodibur) Added an option to store metadata (q, ack, from) as tags instead of fields for Influx 2.x - see README!
|
|
558
|
-
* (Excodibur) Failure to update/set retention policy will now cause warning instead of error/restart, to support more restrictive DB setups
|
|
559
|
-
* (Excodibur/Apollon77) Bug fixes and adjustments
|
|
560
|
-
|
|
561
|
-
### 2.1.1 (2021-08-13)
|
|
562
|
-
* IMPORTANT: You need to re-enter the password after installing this version!
|
|
563
|
-
* IMPORTANT: The adapter now requires Admin 5.1.15+ and js-controller 3.3+! For other admin or js-controller versions please use the former v1.9.5 of thi adapter.
|
|
564
|
-
* (Excodibur) Added InfluxDB 2.0 support
|
|
565
|
-
* (Excodibur) Adjust Retention handling on Database level to work for InfluxDB 1.x and 2.x
|
|
566
|
-
* (Excodibur) Removed retention options on datapoint level because never worked and also not supported really by InfluxDB anymore
|
|
567
|
-
|
|
568
|
-
### 1.9.5 (2021-04-19)
|
|
569
|
-
* (bluefox) Added the support of Admin5
|
|
570
|
-
|
|
571
|
-
### 1.9.4 (2021-01-17)
|
|
572
|
-
* (Apollon77) Optimize stop handling
|
|
573
|
-
|
|
574
|
-
### 1.9.3 (2020-11-07)
|
|
575
|
-
* (Apollon77) Crash case prevented (Sentry IOBROKER-INFLUXDB-T, IOBROKER-INFLUXDB-Y)
|
|
576
|
-
|
|
577
|
-
### 1.9.2 (2020-08-06)
|
|
578
|
-
* (Apollon77) crash prevented (Sentry IOBROKER-INFLUXDB-G)
|
|
579
|
-
|
|
580
|
-
### 1.9.1 (2020-07-22)
|
|
581
|
-
* (Apollon77) crash prevented (Sentry IOBROKER-INFLUXDB-E)
|
|
582
|
-
|
|
583
|
-
### 1.9.0 (2020-07-21)
|
|
584
|
-
* (Apollon77) Optimize handling in case of write errors and host unavailabilities
|
|
585
|
-
|
|
586
|
-
### 1.8.8 (2020-07-18)
|
|
587
|
-
* (Apollon77) Some errors prevented
|
|
588
|
-
* (Apollon77) Set timeouts for influxdb connections to make sure connectioens do not run forever
|
|
589
|
-
|
|
590
|
-
### 1.8.7 (2020-05-14)
|
|
591
|
-
* (bluefox) added command to read supported features
|
|
592
|
-
|
|
593
|
-
### 1.8.6 (2020-05-11)
|
|
594
|
-
* (Apollon77) make sure disabling of data points while starting adapter do not crash adapter (Sentry IOBROKER-INFLUXDB-7)
|
|
595
|
-
* (Apollon77) Make sure all start values are processed correctly
|
|
596
|
-
* (Apollon77) More checks to make sure to not crash when states are disabled while data are processed (Sentry IOBROKER-INFLUXDB-8)
|
|
597
|
-
|
|
598
|
-
### 1.8.5 (2020-05-08)
|
|
599
|
-
* (bluefox) set default history if not yet set
|
|
600
|
-
|
|
601
|
-
### 1.8.4 (2020-05-02)
|
|
602
|
-
* (Apollon77) make sure disabling of data points do not crash adapter (Sentry IOBROKER-INFLUXDB-4)
|
|
603
|
-
|
|
604
|
-
### 1.8.3 (2020-04-29)
|
|
605
|
-
* (Apollon77) Fix pot crash case when deleting objects while saving values (Sentry)
|
|
606
|
-
|
|
607
|
-
### 1.8.2 (2020-04-19)
|
|
608
|
-
* __Requires js-controller >= 2.0.0__
|
|
609
|
-
* (Apollon77) removed usage of `adapter.objects`
|
|
610
|
-
* (Apollon77) check if objects have changed and ignore unchanged
|
|
611
|
-
* (Apollon77) Added Sentry for Error Reporting with js-controller 3.0
|
|
612
|
-
* (Apollon77) Make sure value undefined is ignored
|
|
613
|
-
|
|
614
|
-
### 1.4.2 (2017-03-02)
|
|
615
|
-
* (Apollon77) Added option to define storage datatype per datapoint inclusing converting the value if needed
|
|
616
|
-
|
|
617
|
-
### 1.3.4 (2017-02-22)
|
|
618
|
-
* (Apollon77) Small fix for older configurations
|
|
619
|
-
|
|
620
|
-
### 1.3.3 (2017-02-08)
|
|
621
|
-
* (Apollon77) Enhance handling of DB outages with mass writes afterwards
|
|
622
|
-
* (Apollon77) Small fix for older configurations
|
|
623
|
-
|
|
624
|
-
### 1.3.2
|
|
625
|
-
* (Apollon77) Enhance Min-Delta logic for data points from type mixed
|
|
626
|
-
|
|
627
|
-
### 1.3.1 (2017-01-16)
|
|
628
|
-
* (bluefox) Fix handling of float values in Adapter config and Datapoint config.
|
|
629
|
-
|
|
630
|
-
### 1.3.0 (2016-12-02)
|
|
631
|
-
* (Apollon77) Added messages enableHistory/disableHistory
|
|
632
|
-
* (Apollon77) Added support to log changes only if value differs a minimum value for numbers
|
|
633
|
-
|
|
634
|
-
### 1.2.1 (2016-11)
|
|
635
|
-
* (Apollon77) small enhancements and fixes
|
|
636
|
-
|
|
637
|
-
### 1.2.0 (2016-11-05)
|
|
638
|
-
* (Apollon77) support re-logging also for states that are not updated often (timed relog using relog-Interval)
|
|
639
|
-
* (Apollon77) try to solve easy type conflicts and convert float <--> boolean if needed
|
|
640
|
-
* (Apollon77) enhance `getHistory` to retrieve also boundary values better by selecting also points outside of the given time boundaries
|
|
641
|
-
|
|
642
|
-
### 1.1.1 (2016-11-03)
|
|
643
|
-
* (Apollon77) small final change on custom dialog
|
|
644
|
-
|
|
645
|
-
### 1.1.0 (2016-10-29)
|
|
646
|
-
* (Apollon77) optimizations and enhancements for high-traffic situations
|
|
647
|
-
* (Apollon77) Bugfix if InfluxDB is unavailable
|
|
648
|
-
* (Apollon77) Added functions getConflictingPoints and resetConflictingPoints
|
|
649
|
-
* (Apollon77) Added option to re-log unchanged values to make it easier for visualization
|
|
650
|
-
|
|
651
|
-
### 1.0.1 (2016-10-18)
|
|
652
|
-
* (Apollon77) changed storing values to asynchronous way
|
|
653
|
-
* (Apollon77) Added support for `minmax` aggregate type on getHistory
|
|
654
|
-
|
|
655
|
-
### 1.0.0 (2016-10-10)
|
|
656
|
-
* (Apollon77) bulk write into DB
|
|
657
|
-
* (Apollon77) buffer values if no connection to DB
|
|
658
|
-
* (bluefox) connection indication
|
|
659
|
-
|
|
660
|
-
### 0.5.3 (2016-09-30)
|
|
661
|
-
* (Apollon77) enhance and correct documentation
|
|
662
|
-
* (Apollon77) implement "step" calculation for aggregation if only "count" is set
|
|
663
|
-
|
|
664
|
-
### 0.5.2 (2016-09-25)
|
|
665
|
-
* (Apollon77) change custom queries. Fix delete DB
|
|
666
|
-
|
|
667
|
-
### 0.5.1 (2016-09-20)
|
|
668
|
-
* (Apollon77) Step is given as Milliseconds and not Seconds!
|
|
669
|
-
|
|
670
|
-
### 0.5.0 (2016-08-30)
|
|
671
|
-
* (bluefox) Compatible only with new admin
|
|
672
|
-
|
|
673
|
-
### 0.4.0 (2016-08-27)
|
|
674
|
-
* (bluefox) change name of object from "history" to "custom"
|
|
675
|
-
|
|
676
|
-
### 0.3.1 (2016-06-07)
|
|
677
|
-
* (bluefox) better error handling
|
|
678
|
-
|
|
679
|
-
### 0.3.1 (2016-06-05)
|
|
680
|
-
* (bluefox) no support of influxDB 0.8 (please update)
|
|
681
|
-
|
|
682
|
-
### 0.3.0 (2016-05-18)
|
|
683
|
-
* (bluefox) make name of DB configurable
|
|
684
|
-
|
|
685
|
-
### 0.2.0 (2016-04-30)
|
|
686
|
-
* (bluefox) support of milliseconds instead of seconds
|
|
687
|
-
|
|
688
|
-
### 0.1.2 (2015-12-19)
|
|
689
|
-
* (bluefox) make onchange work
|
|
690
|
-
|
|
691
|
-
### 0.1.1 (2015-12-19)
|
|
692
|
-
* (bluefox) retention policy for 0.9.x
|
|
693
|
-
|
|
694
|
-
### 0.1.0 (2015-12-19)
|
|
695
|
-
* (bluefox) supported InfluxDB version 0.9.x and 0.8.x
|
|
696
|
-
|
|
697
|
-
### 0.0.2 (2015-12-14)
|
|
698
|
-
* (bluefox) change supported InfluxDB version to 0.9.x
|
|
699
|
-
|
|
700
|
-
### 0.0.1 (2015-12-12)
|
|
701
|
-
* (bluefox) initial commit
|
|
495
|
+
[Older changelogs can be found there](CHANGELOG_OLD.md)
|
|
702
496
|
|
|
703
497
|
## License
|
|
704
498
|
|
|
705
499
|
The MIT License (MIT)
|
|
706
500
|
|
|
707
|
-
Copyright (c) 2015-
|
|
501
|
+
Copyright (c) 2015-2026 bluefox, apollon77
|
|
708
502
|
|
|
709
503
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
710
504
|
of this software and associated documentation files (the "Software"), to deal
|
package/RetentionPolicies.md
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
# Understanding retention policies
|
|
2
2
|
|
|
3
|
-
It is important to understand how **Retention Policies** and **Shard Group Durations** are related in order to determine how long data
|
|
3
|
+
It is important to understand how **Retention Policies** and **Shard Group Durations** are related in order to determine how long data
|
|
4
|
+
will be kept in InfluxDB.
|
|
4
5
|
|
|
5
|
-
|
|
6
6
|
|
|
7
|
-
Influx stores all measurements within a given time range into the same **Shard** which itself is part of a **Shard Group**.
|
|
7
|
+
Influx stores all measurements within a given time range into the same **Shard** which itself is part of a **Shard Group**.
|
|
8
|
+
The Shard Group enforces a time range defined by `Shard Group Duration` to all shards, but it is set differently depending on the Influx release.
|
|
8
9
|
|
|
9
10
|
When exceeding the configured `Shard Group Duration`,
|
|
10
11
|
|
|
11
12
|
- a new Shard is created which stores newer measurement data from that point onwards
|
|
12
13
|
- the old Shard with all its measurement-data is still kept in the database, but will be dropped, once the retention policy for the measurement is exceeded
|
|
13
|
-
|
|
14
14
|
|
|
15
15
|
Measurement data-points are not deleted by Influx via "looking" at their retention policies individually, but instead the Shard as a whole is subject to retention policy check and will be dropped, if the retention policy is exceeded. The check however will only be performed on old Shards, meaning Shards that are still active are not checked, as they also still can receive new measurement data points.
|
|
16
16
|
|
|
17
|
-
*Please refer to https://docs.influxdata.com/influxdb/v1.4/concepts/schema_and_data_layout/#shard-group-duration-management
|
|
18
|
-
|
|
17
|
+
*Please refer to https://docs.influxdata.com/influxdb/v1.4/concepts/schema_and_data_layout/#shard-group-duration-management
|
|
18
|
+
for more explanation and examples.*
|
|
19
19
|
|
|
20
|
-
The following two examples illustrate how the same retention period will be enforced differently,
|
|
20
|
+
The following two examples illustrate how the same retention period will be enforced differently, depending on the configured Shard Group Duration.
|
|
21
21
|
|
|
22
|
-
|
|
|
23
|
-
|
|
24
|
-
| Retention Period
|
|
25
|
-
| Shard Group Duration
|
|
26
|
-
| How long will data be kept at max? | 2 hours
|
|
27
|
-
| Why?
|
|
22
|
+
| | Example 1 | Example 2 |
|
|
23
|
+
|------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
24
|
+
| Retention Period | 2 hours | 2 hours |
|
|
25
|
+
| Shard Group Duration | 1 hour | 1 day |
|
|
26
|
+
| How long will data be kept at max? | 2 hours | 1 day |
|
|
27
|
+
| Why? | The Shard is switched every hour, hence Influx will enforce the configured RP once **every hour** and keep only data from the **last 2 hours**. | The Shard is switched once a day, and Influx will then enforce the configured RP, meaning it will only keep data from the last **2 hours**. Because of this, measurement-data inserted at the beginning of the Shard-lifetime in theory should only be kept for 2 hours, but effectively will be kept a **whole day**. |
|
|
28
28
|
|
|
29
29
|
## iobroker.influxdb Adapter
|
|
30
30
|
The Influx Adapter only allows you to select a **Retention Period** and itself will automatically choose the **Shard Group Duration** according to [official InfluxDB recommendations](https://docs.influxdata.com/influxdb/v2.0/reference/internals/shards/#shard-group-duration).
|
|
31
31
|
|
|
32
|
-
| Bucket retention period
|
|
33
|
-
|
|
34
|
-
| less than 2 days
|
|
35
|
-
| between 2 days and 6 months | 1d
|
|
36
|
-
| greater than 6 months
|
|
32
|
+
| Bucket retention period | Default shard group duration |
|
|
33
|
+
|-----------------------------|------------------------------|
|
|
34
|
+
| less than 2 days | 1h |
|
|
35
|
+
| between 2 days and 6 months | 1d |
|
|
36
|
+
| greater than 6 months | 7d |
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
The Shard Group Duration can still be altered manually in the DB itself, but in order to keep the adapter configuration manageable,
|
|
39
|
+
The Shard Group Duration can still be altered manually in the DB itself, but in order to keep the adapter configuration manageable,
|
|
40
|
+
it can not be changed directly within ioBroker.
|
|
40
41
|
|
|
41
|
-
By design the adapter enforces only one global retention policy that applies to all measurements - regardless of the DB version that is used. The policy can be changed at any time, but for the reasons described earlier it might take a while for the changes to take effect.
|
|
42
|
+
By design, the adapter enforces only one global retention policy that applies to all measurements - regardless of the DB version that is used. The policy can be changed at any time, but for the reasons described earlier, it might take a while for the changes to take effect.
|
|
42
43
|
|
|
43
44
|
## Additional considerations
|
|
44
45
|
|
|
45
46
|
- The shard group duration is often configured shorter than the retention period, in order to be enforced effectively. But it is difficult to state this as a general advice, since other factors, like performance should be considered, too. If shard group durations are configured extremely short, this might be beneficial for housekeeping, but it could negatively impact performance, like causing longer query times, or slow write speeds.
|
|
46
|
-
- A retention policy may not be lower than 1 hour. This was a choice made by Influx devs (https://github.com/influxdata/influxdb/issues/5198#issuecomment-166629531) and can only be bypassed by building InfluxDB from latest source with changed values directly.
|
|
47
|
-
-
|
|
47
|
+
- A retention policy may not be lower than 1 hour. This was a choice made by Influx devs (https://github.com/influxdata/influxdb/issues/5198#issuecomment-166629531) and can only be bypassed by building InfluxDB from the latest source with changed values directly.
|
|
48
|
+
- Retention policies are checked by default every 30 minutes. This can be changed, however, in [server configuration for Influx 1.x](https://docs.influxdata.com/influxdb/v1.8/administration/config/#retention-policy-settings) and [server configuration for Influx 2.x](https://docs.influxdata.com/influxdb/v2.0/reference/config-options/#storage-retention-check-interval). This does **not** bypass the principles explained earlier.
|
|
48
49
|
- **Influx 1.x**: For existing dbs the adapter is able to detect the current default retention policy and will update it. If you modified retention policies manually and now are still experiencing missing data in the adapter, it might be related to the changed default-policy. See also here for more information: https://docs.influxdata.com/influxdb/v1.7/troubleshooting/frequently-asked-questions/#why-am-i-missing-data-after-creating-a-new-default-retention-policy.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./DataBrowser-BjC3hA47.js";var t={DataBrowser:e};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-CxiY1CI5.js";import{$t as t,An as n,B as r,Br as i,Bt as a,Dn as o,En as s,F as c,H as l,I as u,In as d,Nn as f,On as p,Ot as m,P as h,Rr as g,Sn as _,Tt as v,Ut as y,Vt as b,Wt as x,Xt as S,Zt as C,_ as w,cn as T,fn as E,hi as D,jt as O,ln as k,lt as A,pt as j,qt as M,rn as N,tn as P,u as F,un as I,wn as L,xn as R,zn as z,zr as B,zt as V}from"./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-B1eVfdnr.js";D();var H={root:{display:`flex`,width:`100%`,height:`calc(100vh - 220px)`,minHeight:400,gap:8},list:{width:320,minWidth:220,display:`flex`,flexDirection:`column`,overflow:`hidden`},filterField:{padding:8,flexShrink:0},listItems:{overflowY:`auto`,flexGrow:1,minHeight:0},data:{flexGrow:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},toolbar:{display:`flex`,alignItems:`center`,flexWrap:`nowrap`,gap:8,padding:8,overflow:`hidden`,flexShrink:0},title:{display:`flex`,flexDirection:`column`,flexGrow:1,minWidth:60,overflow:`hidden`},titleId:{fontWeight:`bold`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},titleName:{fontSize:`smaller`,opacity:.7,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},dateField:{width:200,flexShrink:0},table:{overflowY:`auto`,flexGrow:1,minHeight:0},nowrap:{whiteSpace:`nowrap`},pageInfo:{whiteSpace:`nowrap`,flexShrink:0},grow:{flexGrow:1}},U=e=>({"& input::-webkit-calendar-picker-indicator":{filter:e.palette.mode===`dark`?`invert(1)`:`none`,cursor:`pointer`}});function W(e){let t=new Date(e);if(isNaN(t.getTime()))return String(e);let n=(e,t)=>e.toString().padStart(t||2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}.${n(t.getMilliseconds(),3)}`}function G(e){let t=e=>e.toString().padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function K(e){let t=e=>e.toString().padStart(2,`0`);return`${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}`}function q(e){if(!e)return;let t=new Date(e).getTime();return isNaN(t)?void 0:t}var J=class extends e{constructor(e){super(e),this.state={...this.state,points:null,names:{},filter:``,selected:null,rows:[],total:0,page:0,rowsPerPage:100,sort:`desc`,start:``,end:``,checked:[],loadingPoints:!1,loadingRows:!1,errorText:``,entryDialog:null,confirmText:``,confirmAction:null}}async componentDidMount(){await super.componentDidMount(),this.props.alive&&await this.loadDatapoints()}async componentDidUpdate(e){this.props.alive&&!e.alive&&!this.state.points&&await this.loadDatapoints()}get instance(){return`${this.props.oContext.adapterName}.${this.props.oContext.instance}`}async sendToInstance(e,t){let n=await this.props.oContext.socket.sendTo(this.instance,e,t);if(n!=null&&n.error)throw Error(n.error);return n}async loadDatapoints(){this.setState({loadingPoints:!0,errorText:``});try{let e=await this.sendToInstance(`getDatapoints`,{}),t=(e==null?void 0:e.result)||[];this.setState({points:t,loadingPoints:!1},()=>void this.loadNames(t))}catch(e){this.setState({loadingPoints:!1,points:[],errorText:e.message})}}async loadNames(e){if(e.length)try{let t=await this.props.oContext.socket.getObjectsById(e.map(e=>e.id)),n={};for(let r of e){let e=t==null?void 0:t[r.id],i=e?w.getObjectNameFromObj(e,null,{language:F.getLanguage()}):``;i&&i!==r.id&&(n[r.id]=i)}this.setState({names:n})}catch(e){console.warn(`Cannot read the names of the objects: ${e.message}`)}}async loadRows(){let e=this.state.selected;if(e){this.setState({loadingRows:!0,errorText:``});try{let t=await this.sendToInstance(`getRawEntries`,{id:e.id,start:q(this.state.start),end:q(this.state.end),limit:this.state.rowsPerPage,offset:this.state.page*this.state.rowsPerPage,sort:this.state.sort});this.setState({rows:(t==null?void 0:t.result)||[],total:(t==null?void 0:t.total)||0,checked:[],loadingRows:!1})}catch(e){this.setState({rows:[],total:0,loadingRows:!1,errorText:e.message})}}}selectDatapoint(e){this.setState({selected:e,page:0,rows:[],total:0,checked:[]},()=>void this.loadRows())}parseValue(e){var t,n;if(e===``)return null;if(((t=this.state.selected)==null?void 0:t.type)===`Number`){let t=parseFloat(e.replace(`,`,`.`));return isNaN(t)?0:t}return((n=this.state.selected)==null?void 0:n.type)===`Boolean`?e===`true`||e===`1`:e}async saveEntry(){let e=this.state.entryDialog,t=this.state.selected;if(!e||!t)return;let n=parseInt(e.ts,10);if(!n){this.setState({errorText:`Invalid timestamp`});return}let r={ts:n,val:this.parseValue(e.val),ack:e.ack,q:parseInt(e.q,10)||0};this.setState({entryDialog:null,loadingRows:!0});try{e.original?await this.sendToInstance(`update`,{id:t.id,state:r}):await this.sendToInstance(`storeState`,{id:t.id,state:r})}catch(e){this.setState({errorText:e.message})}await this.loadRows()}async deleteEntries(e){let t=this.state.selected;if(!(!t||!e.length)){this.setState({loadingRows:!0});try{e.length===1?await this.sendToInstance(`delete`,{id:t.id,ts:e[0]}):await this.sendToInstance(`delete`,e.map(e=>({id:t.id,ts:e})))}catch(e){this.setState({errorText:e.message})}await this.loadRows()}}renderDatapoints(){let e=this.state.filter.toLowerCase(),t=(this.state.points||[]).filter(t=>{var n;return!e||t.id.toLowerCase().includes(e)||((n=this.state.names[t.id])==null?void 0:n.toLowerCase().includes(e))});return i(d,{style:H.list,children:[B(M,{variant:`standard`,style:H.filterField,value:this.state.filter,onChange:e=>this.setState({filter:e.target.value}),placeholder:F.t(`influxdb_filter`),slotProps:{input:{startAdornment:B(L,{position:`start`,children:B(m,{})}),endAdornment:this.state.filter?B(L,{position:`end`,children:B(_,{size:`small`,onClick:()=>this.setState({filter:``}),children:B(u,{})})}):null}}}),this.state.loadingPoints?B(s,{}):null,i(o,{dense:!0,style:H.listItems,children:[t.map(e=>{var t;return B(p,{selected:((t=this.state.selected)==null?void 0:t.id)===e.id,onClick:()=>this.selectDatapoint(e),sx:e=>({"&.Mui-selected":{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"& .MuiListItemText-secondary":{color:e.palette.primary.contrastText,opacity:.8},"&:hover":{backgroundColor:e.palette.primary.dark}}}),children:B(n,{primary:e.id,secondary:i(g,{children:[this.state.names[e.id]?B(`b`,{children:this.state.names[e.id]}):null,this.state.names[e.id]?` `:``,`[${e.type||`?`}]`]}),slotProps:{primary:{style:{wordBreak:`break-all`}},secondary:{style:{wordBreak:`break-word`}}}})},e.id)}),!t.length&&!this.state.loadingPoints?B(C,{style:{padding:16,opacity:.7},children:F.t(this.state.filter?`influxdb_no_data`:`influxdb_no_datapoints`)}):null]})]})}renderToolbar(){var e,t;let{page:n,rowsPerPage:a,total:o}=this.state,s=o?n*a+1:0,l=Math.min((n+1)*a,o);return i(`div`,{style:H.toolbar,children:[i(`div`,{style:H.title,children:[B(S,{title:((e=this.state.selected)==null?void 0:e.id)||``,children:B(`span`,{style:H.titleId,children:(t=this.state.selected)==null?void 0:t.id})}),this.state.selected&&this.state.names[this.state.selected.id]?B(`span`,{style:H.titleName,children:this.state.names[this.state.selected.id]}):null]}),B(S,{title:F.t(`influxdb_range_start`),children:B(M,{variant:`outlined`,size:`small`,style:H.dateField,sx:U,type:`datetime-local`,value:this.state.start,onChange:e=>this.setState({start:e.target.value,page:0},()=>void this.loadRows())})}),B(S,{title:F.t(`influxdb_range_end`),children:B(M,{variant:`outlined`,size:`small`,style:H.dateField,sx:U,type:`datetime-local`,value:this.state.end,onChange:e=>this.setState({end:e.target.value,page:0},()=>void this.loadRows())})}),B(z,{variant:`outlined`,size:`small`,value:a,onChange:e=>this.setState({rowsPerPage:Number(e.target.value),page:0},()=>void this.loadRows()),children:[50,100,500,1e3].map(e=>B(f,{value:e,children:e},e))}),B(S,{title:F.t(this.state.sort===`desc`?`influxdb_sort_desc`:`influxdb_sort_asc`),children:B(_,{size:`small`,onClick:()=>this.setState({sort:this.state.sort===`desc`?`asc`:`desc`,page:0},()=>void this.loadRows()),children:this.state.sort===`desc`?B(A,{}):B(j,{})})}),B(C,{style:H.pageInfo,children:F.t(`influxdb_page`,s.toString(),l.toString(),o.toString())}),B(_,{size:`small`,disabled:!n,onClick:()=>this.setState({page:n-1},()=>void this.loadRows()),children:B(h,{})}),B(_,{size:`small`,disabled:l>=o,onClick:()=>this.setState({page:n+1},()=>void this.loadRows()),children:B(c,{})}),B(S,{title:F.t(`influxdb_refresh`),children:B(_,{size:`small`,onClick:()=>void this.loadRows(),children:B(v,{})})}),B(S,{title:F.t(`influxdb_add`),children:B(_,{size:`small`,color:`primary`,onClick:()=>this.setState({entryDialog:{original:null,ts:Date.now().toString(),val:``,ack:!0,q:`0`}}),children:B(O,{})})}),B(S,{title:F.t(`influxdb_delete_selected`),children:B(`span`,{children:B(_,{size:`small`,disabled:!this.state.checked.length,onClick:()=>this.setState({confirmText:F.t(`influxdb_confirm_delete`,this.state.checked.length.toString()),confirmAction:()=>void this.deleteEntries(this.state.checked)}),children:B(r,{})})})})]})}renderTable(){return i(`div`,{style:H.table,children:[i(V,{size:`small`,stickyHeader:!0,children:[B(y,{children:i(x,{children:[B(b,{padding:`checkbox`,children:B(N,{indeterminate:!!this.state.checked.length&&this.state.checked.length<this.state.rows.length,checked:!!this.state.rows.length&&this.state.checked.length===this.state.rows.length,onChange:e=>this.setState({checked:e.target.checked?this.state.rows.map(e=>e.ts):[]})})}),B(b,{children:F.t(`influxdb_time`)}),B(b,{children:F.t(`influxdb_value`)}),B(b,{children:F.t(`influxdb_ack`)}),B(b,{children:F.t(`influxdb_quality`)}),B(b,{children:F.t(`influxdb_from`)}),B(b,{})]})}),B(a,{children:this.state.rows.map(e=>i(x,{hover:!0,children:[B(b,{padding:`checkbox`,children:B(N,{checked:this.state.checked.includes(e.ts),onChange:t=>this.setState({checked:t.target.checked?[...this.state.checked,e.ts]:this.state.checked.filter(t=>t!==e.ts)})})}),B(b,{style:H.nowrap,children:B(S,{title:e.ts.toString(),children:B(`span`,{children:W(e.ts)})})}),B(b,{style:{wordBreak:`break-all`},children:e.val===null||e.val===void 0?B(`span`,{style:{opacity:.5},children:`null`}):e.val.toString()}),B(b,{children:e.ack?`✓`:``}),B(b,{children:e.q??``}),B(b,{style:{opacity:.7},children:e.from||``}),i(b,{padding:`none`,children:[B(_,{size:`small`,onClick:()=>this.setState({entryDialog:{original:e,ts:e.ts.toString(),val:e.val===null||e.val===void 0?``:e.val.toString(),ack:!!e.ack,q:(e.q??0).toString()}}),children:B(l,{fontSize:`small`})}),B(_,{size:`small`,onClick:()=>this.setState({confirmText:F.t(`influxdb_confirm_delete_one`,W(e.ts)),confirmAction:()=>void this.deleteEntries([e.ts])}),children:B(r,{fontSize:`small`})})]})]},e.ts))})]}),!this.state.rows.length&&!this.state.loadingRows?B(C,{style:{padding:16,opacity:.7},children:F.t(`influxdb_no_data`)}):null]})}renderTimeSelector(e){let t=parseInt(e.ts,10),n=!isNaN(t),r=!!e.original,a=(r,i)=>{let a=new Date(n?t:Date.now()),o=G(a),s=K(a),c=a.getMilliseconds();if(r===`date`){if(!i)return;o=i}else if(r===`time`){if(!i)return;s=i.length===5?`${i}:00`:i}else c=Math.min(999,Math.max(0,parseInt(i,10)||0));let l=new Date(`${o}T${s}.${c.toString().padStart(3,`0`)}`).getTime();isNaN(l)||this.setState({entryDialog:{...e,ts:l.toString()}})};return i(`div`,{children:[i(`div`,{style:{display:`flex`,gap:8,alignItems:`center`},children:[B(M,{label:F.t(`influxdb_date`),type:`date`,value:n?G(new Date(t)):``,disabled:r,style:{flexGrow:1},sx:U,slotProps:{inputLabel:{shrink:!0}},onChange:e=>a(`date`,e.target.value)}),B(M,{label:F.t(`influxdb_time`),type:`time`,value:n?K(new Date(t)):``,disabled:r,style:{flexGrow:1},sx:U,slotProps:{inputLabel:{shrink:!0},htmlInput:{step:1}},onChange:e=>a(`time`,e.target.value)}),B(M,{label:F.t(`influxdb_ms`),type:`number`,value:n?new Date(t).getMilliseconds():``,disabled:r,style:{width:100},slotProps:{inputLabel:{shrink:!0},htmlInput:{min:0,max:999}},onChange:e=>a(`ms`,e.target.value)})]}),B(C,{variant:`caption`,style:{opacity:.7},children:n?`${W(t)} · ${t}`:``})]})}renderEntryDialog(){var e;let t=this.state.entryDialog;return t?i(T,{open:!0,maxWidth:`sm`,fullWidth:!0,onClose:()=>this.setState({entryDialog:null}),children:[B(E,{children:F.t(t.original?`influxdb_save`:`influxdb_add`)}),i(I,{style:{display:`flex`,flexDirection:`column`,gap:16,paddingTop:8},children:[this.renderTimeSelector(t),((e=this.state.selected)==null?void 0:e.type)===`Boolean`?i(z,{value:t.val===`true`||t.val===`1`?`true`:`false`,onChange:e=>this.setState({entryDialog:{...t,val:e.target.value}}),children:[B(f,{value:`true`,children:`true`}),B(f,{value:`false`,children:`false`})]}):B(M,{label:F.t(`influxdb_value`),value:t.val,autoFocus:!0,onChange:e=>this.setState({entryDialog:{...t,val:e.target.value}})}),i(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[B(N,{checked:t.ack,onChange:e=>this.setState({entryDialog:{...t,ack:e.target.checked}})}),B(C,{children:F.t(`influxdb_ack`)}),B(M,{label:F.t(`influxdb_quality`),value:t.q,type:`number`,onChange:e=>this.setState({entryDialog:{...t,q:e.target.value}})})]})]}),i(k,{children:[B(P,{variant:`contained`,color:`primary`,onClick:()=>void this.saveEntry(),children:F.t(`influxdb_save`)}),B(P,{variant:`outlined`,onClick:()=>this.setState({entryDialog:null}),children:F.t(`influxdb_cancel`)})]})]}):null}renderConfirmDialog(){return this.state.confirmAction?i(T,{open:!0,onClose:()=>this.setState({confirmText:``,confirmAction:null}),children:[B(E,{children:F.t(`influxdb_delete`)}),B(I,{children:this.state.confirmText}),i(k,{children:[B(P,{variant:`contained`,color:`error`,startIcon:B(r,{}),onClick:()=>{let e=this.state.confirmAction;this.setState({confirmText:``,confirmAction:null},()=>e==null?void 0:e())},children:F.t(`influxdb_delete`)}),B(P,{variant:`outlined`,onClick:()=>this.setState({confirmText:``,confirmAction:null}),children:F.t(`influxdb_cancel`)})]})]}):null}renderItem(){return this.props.alive?i(t,{style:H.root,children:[this.renderDatapoints(),i(d,{style:H.data,children:[this.state.errorText?B(R,{severity:`error`,style:{flexShrink:0},onClose:()=>this.setState({errorText:``}),children:this.state.errorText}):null,this.state.selected?i(g,{children:[this.renderToolbar(),this.state.loadingRows?B(s,{}):null,this.renderTable()]}):B(C,{style:{padding:16,opacity:.7},children:F.t(`influxdb_select_datapoint`)})]}),this.renderEntryDialog(),this.renderConfirmDialog()]}):B(R,{severity:`info`,children:F.t(`influxdb_instance_not_alive`)})}};export{J as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./vite-preload-helper-B7qeedMF.js";var t={react:async()=>await e(()=>import(`./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-B1eVfdnr.js`).then(e=>(e._i(),e.gi)),[],import.meta.url),"react/jsx-runtime":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-B1eVfdnr.js`).then(e=>e.Vr),[],import.meta.url),"react-dom":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-B1eVfdnr.js`).then(e=>(e.Jr(),e.qr)),[],import.meta.url),"react-dom/client":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DySAygl2.js`).then(e=>e.n),[],import.meta.url),"@mui/material":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-B1eVfdnr.js`).then(e=>e.Vn),[],import.meta.url),"@mui/icons-material":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-B1eVfdnr.js`).then(e=>e.Ft),[],import.meta.url),"@iobroker/gui-components":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-B1eVfdnr.js`).then(e=>e.b),[],import.meta.url),"@iobroker/json-config":async()=>await e(()=>import(`./_virtual_mf___mfe_internal__InfluxDBComponentsSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-CxiY1CI5.js`).then(e=>e.n),[],import.meta.url)},n={react:{name:`react`,version:`19.2.8`,scope:[`default`],loaded:!1,materialize:!0,eager:!1,from:`InfluxDBComponentsSet`,canLiveRebind:!0,async get(){n.react.loaded=!0;let{react:e}=t,r={...await e()};return r.__esModule!==!0&&Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`*`,strictVersion:!1,eager:!1}},"react/jsx-runtime":{name:`react/jsx-runtime`,version:`19.2.8`,scope:[`default`],loaded:!1,materialize:!0,eager:!1,from:`InfluxDBComponentsSet`,canLiveRebind:!0,async get(){n[`react/jsx-runtime`].loaded=!0;let{"react/jsx-runtime":e}=t,r={...await e()};return r.__esModule!==!0&&Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`*`,strictVersion:!1,eager:!1}},"react-dom":{name:`react-dom`,version:`19.2.8`,scope:[`default`],loaded:!1,materialize:!0,eager:!1,from:`InfluxDBComponentsSet`,canLiveRebind:!0,async get(){n[`react-dom`].loaded=!0;let{"react-dom":e}=t,r={...await e()};return r.__esModule!==!0&&Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`*`,strictVersion:!1,eager:!1}},"react-dom/client":{name:`react-dom/client`,version:`19.2.8`,scope:[`default`],loaded:!1,materialize:!0,eager:!1,from:`InfluxDBComponentsSet`,canLiveRebind:!0,async get(){n[`react-dom/client`].loaded=!0;let{"react-dom/client":e}=t,r={...await e()};return r.__esModule!==!0&&Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`*`,strictVersion:!1,eager:!1}},"@mui/material":{name:`@mui/material`,version:`9.3.1`,scope:[`default`],loaded:!1,materialize:!0,eager:!1,from:`InfluxDBComponentsSet`,canLiveRebind:!0,async get(){n[`@mui/material`].loaded=!0;let{"@mui/material":e}=t,r={...await e()};return r.__esModule!==!0&&Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`*`,strictVersion:!1,eager:!1}},"@mui/icons-material":{name:`@mui/icons-material`,version:`9.3.1`,scope:[`default`],loaded:!1,materialize:!0,eager:!1,from:`InfluxDBComponentsSet`,canLiveRebind:!0,async get(){n[`@mui/icons-material`].loaded=!0;let{"@mui/icons-material":e}=t,r={...await e()};return r.__esModule!==!0&&Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`*`,strictVersion:!1,eager:!1}},"@iobroker/gui-components":{name:`@iobroker/gui-components`,version:`10.1.0`,scope:[`default`],loaded:!1,materialize:!0,eager:!1,from:`InfluxDBComponentsSet`,canLiveRebind:!0,async get(){n[`@iobroker/gui-components`].loaded=!0;let{"@iobroker/gui-components":e}=t,r={...await e()};return r.__esModule!==!0&&Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`*`,strictVersion:!1,eager:!1}},"@iobroker/json-config":{name:`@iobroker/json-config`,version:`9.0.22`,scope:[`default`],loaded:!1,materialize:!0,eager:!1,from:`InfluxDBComponentsSet`,canLiveRebind:!0,async get(){n[`@iobroker/json-config`].loaded=!0;let{"@iobroker/json-config":e}=t,r={...await e()};return r.__esModule!==!0&&Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:`*`,strictVersion:!1,eager:!1}}},r=[];export{r as usedRemotes,n as usedShared};
|