@perses-dev/victorialogs-plugin 0.4.0 → 0.5.0-beta.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/__mf/js/{VictoriaLogs.db5cc46b.js → VictoriaLogs.a8769935.js} +3 -3
- package/__mf/js/async/1522.952455c8.js +22 -0
- package/__mf/js/async/1616.5bfbc6c9.js +1 -0
- package/__mf/js/async/198.0747c3c4.js +2 -0
- package/__mf/js/async/2043.15dfcaf2.js +2 -0
- package/__mf/js/async/2377.becaacc4.js +1 -0
- package/__mf/js/async/2650.a7bdaf49.js +3 -0
- package/__mf/js/async/2786.f183253f.js +2 -0
- package/__mf/js/async/2901.d2d83345.js +1 -0
- package/__mf/js/async/392.e0ccad9b.js +2 -0
- package/__mf/js/async/4077.5440638f.js +1 -0
- package/__mf/js/async/4121.e0b41fa2.js +2 -0
- package/__mf/js/async/4248.2c62b66c.js +1 -0
- package/__mf/js/async/4496.46c01862.js +1 -0
- package/__mf/js/async/4960.fd41e601.js +2 -0
- package/__mf/js/async/5019.6f35fcfe.js +1 -0
- package/__mf/js/async/5071.dbccdae6.js +1 -0
- package/__mf/js/async/5440.5a93fae0.js +2 -0
- package/__mf/js/async/5587.5e3cc249.js +1 -0
- package/__mf/js/async/560.56b83614.js +37 -0
- package/__mf/js/async/5623.f2841bc8.js +1 -0
- package/__mf/js/async/5650.8e02c19d.js +7 -0
- package/__mf/js/async/{5405.004a286a.js.LICENSE.txt → 5650.8e02c19d.js.LICENSE.txt} +41 -1
- package/__mf/js/async/5706.4665b04a.js +1 -0
- package/__mf/js/async/6274.05a0c6f1.js +2 -0
- package/__mf/js/async/6854.88725ad0.js +1 -0
- package/__mf/js/async/7192.34127278.js +1 -0
- package/__mf/js/async/7740.802c9257.js +101 -0
- package/__mf/js/async/7817.63122fff.js +2 -0
- package/__mf/js/async/7862.5530d38c.js +2 -0
- package/__mf/js/async/7873.1ef3480e.js +2 -0
- package/__mf/js/async/7968.960f80da.js +1 -0
- package/__mf/js/async/7978.1899f369.js +1 -0
- package/__mf/js/async/8356.21af7a90.js +1 -0
- package/__mf/js/async/8470.b2bd6ab1.js +2 -0
- package/__mf/js/async/873.42d5c5c0.js +1 -0
- package/__mf/js/async/9207.f6612692.js +1 -0
- package/__mf/js/async/9235.2e62d2f5.js +1 -0
- package/__mf/js/async/941.3d0f5a01.js +2 -0
- package/__mf/js/async/9440.ddd37afc.js +10 -0
- package/__mf/js/async/9588.96579f82.js +1 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.03128f7e.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.0ceb2243.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.72183be9.js +2 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.916adf8b.js +1 -0
- package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.1f986674.js +1 -0
- package/__mf/js/{main.0d99a16b.js → main.7c22713c.js} +2 -2
- package/lib/bootstrap.js +2 -2
- package/lib/components/index.js +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/logsql-editor.d.ts +2 -2
- package/lib/components/logsql-editor.d.ts.map +1 -1
- package/lib/components/logsql-editor.js +4 -4
- package/lib/components/logsql-editor.js.map +1 -1
- package/lib/components/logsql-extension.d.ts +1 -1
- package/lib/components/logsql-extension.d.ts.map +1 -1
- package/lib/components/logsql-extension.js +3 -3
- package/lib/components/logsql-extension.js.map +1 -1
- package/lib/components/logsql-highlight.js +1 -1
- package/lib/datasources/index.js +1 -1
- package/lib/datasources/index.js.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.d.ts +3 -3
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.d.ts.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js +2 -2
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasource.js.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.d.ts +2 -2
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.d.ts.map +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.js +1 -1
- package/lib/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.js.map +1 -1
- package/lib/datasources/victorialogs-datasource/index.js +3 -3
- package/lib/datasources/victorialogs-datasource/index.js.map +1 -1
- package/lib/datasources/victorialogs-datasource/types.d.ts +1 -1
- package/lib/datasources/victorialogs-datasource/types.d.ts.map +1 -1
- package/lib/datasources/victorialogs-datasource/types.js.map +1 -1
- package/lib/getPluginModule.d.ts +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +3 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/model/client.d.ts +1 -1
- package/lib/model/client.d.ts.map +1 -1
- package/lib/model/client.js.map +1 -1
- package/lib/model/index.js +3 -3
- package/lib/model/index.js.map +1 -1
- package/lib/model/selectors.d.ts +2 -2
- package/lib/model/selectors.d.ts.map +1 -1
- package/lib/model/selectors.js +1 -1
- package/lib/model/selectors.js.map +1 -1
- package/lib/queries/index.js +2 -2
- package/lib/queries/index.js.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.d.ts +2 -2
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.d.ts.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.js +4 -6
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQuery.js.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.d.ts +3 -3
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.d.ts.map +1 -1
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js +7 -7
- package/lib/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js.map +1 -1
- package/lib/queries/victorialogs-log-query/index.js +4 -4
- package/lib/queries/victorialogs-log-query/index.js.map +1 -1
- package/lib/queries/victorialogs-log-query/query.d.ts +2 -2
- package/lib/queries/victorialogs-log-query/query.d.ts.map +1 -1
- package/lib/queries/victorialogs-log-query/query.js +2 -2
- package/lib/queries/victorialogs-log-query/query.js.map +1 -1
- package/lib/queries/victorialogs-log-query/types.d.ts +1 -1
- package/lib/queries/victorialogs-log-query/types.d.ts.map +1 -1
- package/lib/queries/victorialogs-log-query/types.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.d.ts +2 -2
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.d.ts.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.js +4 -6
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts +3 -3
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.d.ts.map +1 -1
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js +7 -7
- package/lib/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/index.js +4 -4
- package/lib/queries/victorialogs-time-series-query/index.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/query.d.ts +2 -2
- package/lib/queries/victorialogs-time-series-query/query.d.ts.map +1 -1
- package/lib/queries/victorialogs-time-series-query/query.js +4 -4
- package/lib/queries/victorialogs-time-series-query/query.js.map +1 -1
- package/lib/queries/victorialogs-time-series-query/types.d.ts +1 -1
- package/lib/queries/victorialogs-time-series-query/types.d.ts.map +1 -1
- package/lib/queries/victorialogs-time-series-query/types.js.map +1 -1
- package/lib/setup-tests.d.ts +1 -1
- package/lib/setup-tests.d.ts.map +1 -1
- package/lib/setup-tests.js +2 -2
- package/lib/setup-tests.js.map +1 -1
- package/lib/variables/index.js +2 -2
- package/lib/variables/index.js.map +1 -1
- package/lib/variables/types.d.ts +2 -2
- package/lib/variables/types.d.ts.map +1 -1
- package/lib/variables/types.js.map +1 -1
- package/lib/variables/utils.d.ts +5 -5
- package/lib/variables/utils.d.ts.map +1 -1
- package/lib/variables/utils.js +2 -2
- package/lib/variables/utils.js.map +1 -1
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.d.ts +2 -2
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.d.ts.map +1 -1
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.js +4 -4
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.js.map +1 -1
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.d.ts +3 -3
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.d.ts.map +1 -1
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.js +5 -5
- package/lib/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.js.map +1 -1
- package/lib/variables/victorialogs-field-names/index.js +1 -1
- package/lib/variables/victorialogs-field-names/index.js.map +1 -1
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.d.ts +2 -2
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.d.ts.map +1 -1
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.js +4 -4
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.js.map +1 -1
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.d.ts +3 -3
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.d.ts.map +1 -1
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js +6 -6
- package/lib/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js.map +1 -1
- package/lib/variables/victorialogs-field-values/index.js +1 -1
- package/lib/variables/victorialogs-field-values/index.js.map +1 -1
- package/mf-manifest.json +140 -192
- package/mf-stats.json +140 -196
- package/package.json +20 -12
- package/__mf/js/async/1170.532d9fb3.js +0 -101
- package/__mf/js/async/1616.5a6b8ab3.js +0 -1
- package/__mf/js/async/1728.b01c38aa.js +0 -1
- package/__mf/js/async/1969.fc35e1b4.js +0 -1
- package/__mf/js/async/198.fbb67f8a.js +0 -2
- package/__mf/js/async/2043.b149adfd.js +0 -2
- package/__mf/js/async/2377.9265b0a7.js +0 -1
- package/__mf/js/async/2728.fd6779e6.js +0 -1
- package/__mf/js/async/2749.71c38fe0.js +0 -2
- package/__mf/js/async/2842.3740ca9b.js +0 -1
- package/__mf/js/async/3059.fe1cdfc3.js +0 -1
- package/__mf/js/async/392.c6e57bd8.js +0 -2
- package/__mf/js/async/3981.02c66856.js +0 -3
- package/__mf/js/async/3998.e9a3cf1a.js +0 -2
- package/__mf/js/async/4121.5468ac01.js +0 -2
- package/__mf/js/async/4225.744952e9.js +0 -10
- package/__mf/js/async/4248.9b99209c.js +0 -1
- package/__mf/js/async/5019.51d94aab.js +0 -1
- package/__mf/js/async/5071.6ac86637.js +0 -1
- package/__mf/js/async/5405.004a286a.js +0 -2
- package/__mf/js/async/5440.7765ad14.js +0 -2
- package/__mf/js/async/5481.b7b48b8f.js +0 -2
- package/__mf/js/async/5587.12959dbf.js +0 -1
- package/__mf/js/async/5706.55b9ef2f.js +0 -1
- package/__mf/js/async/6274.0634d636.js +0 -2
- package/__mf/js/async/6408.2bc7e8f4.js +0 -7
- package/__mf/js/async/6408.2bc7e8f4.js.LICENSE.txt +0 -39
- package/__mf/js/async/6410.63a88be6.js +0 -1
- package/__mf/js/async/6592.24e266ac.js +0 -1
- package/__mf/js/async/6854.21ddded3.js +0 -1
- package/__mf/js/async/6864.66bc6315.js +0 -2
- package/__mf/js/async/7177.dfbac40a.js +0 -1
- package/__mf/js/async/7192.339adba2.js +0 -1
- package/__mf/js/async/7793.43841fdc.js +0 -1
- package/__mf/js/async/7817.5e96b0dd.js +0 -2
- package/__mf/js/async/7968.d586d9f8.js +0 -1
- package/__mf/js/async/7978.895bbb5f.js +0 -1
- package/__mf/js/async/7984.194982d6.js +0 -22
- package/__mf/js/async/8356.053c21d0.js +0 -1
- package/__mf/js/async/8470.cb89de3b.js +0 -2
- package/__mf/js/async/873.4df0ea19.js +0 -1
- package/__mf/js/async/8787.c3298397.js +0 -2
- package/__mf/js/async/9235.3e1de7b9.js +0 -1
- package/__mf/js/async/941.a44f722e.js +0 -2
- package/__mf/js/async/9588.c379dd44.js +0 -1
- package/__mf/js/async/9836.fd9de3af.js +0 -1
- package/__mf/js/async/9877.8b83de3c.js +0 -38
- package/__mf/js/async/9944.4d41cb7b.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsDatasource.807ae747.js +0 -2
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldNamesVariable.ccafeb36.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsFieldValuesVariable.5e29c327.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsLogQuery.6e607640.js +0 -1
- package/__mf/js/async/__federation_expose_VictoriaLogsTimeSeriesQuery.91a8ad9d.js +0 -1
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/components/index.js +0 -23
- package/lib/cjs/components/logsql-editor.js +0 -110
- package/lib/cjs/components/logsql-extension.js +0 -55
- package/lib/cjs/components/logsql-highlight.js +0 -40
- package/lib/cjs/datasources/index.js +0 -30
- package/lib/cjs/datasources/victorialogs-datasource/VictoriaLogsDatasource.js +0 -61
- package/lib/cjs/datasources/victorialogs-datasource/VictoriaLogsDatasourceEditor.js +0 -95
- package/lib/cjs/datasources/victorialogs-datasource/index.js +0 -32
- package/lib/cjs/datasources/victorialogs-datasource/types.js +0 -16
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -39
- package/lib/cjs/model/client.js +0 -156
- package/lib/cjs/model/index.js +0 -32
- package/lib/cjs/model/selectors.js +0 -47
- package/lib/cjs/model/types.js +0 -16
- package/lib/cjs/queries/constants.js +0 -34
- package/lib/cjs/queries/index.js +0 -31
- package/lib/cjs/queries/victorialogs-log-query/VictoriaLogsLogQuery.js +0 -63
- package/lib/cjs/queries/victorialogs-log-query/VictoriaLogsLogQueryEditor.js +0 -114
- package/lib/cjs/queries/victorialogs-log-query/index.js +0 -33
- package/lib/cjs/queries/victorialogs-log-query/query.js +0 -73
- package/lib/cjs/queries/victorialogs-log-query/types.js +0 -16
- package/lib/cjs/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQuery.js +0 -43
- package/lib/cjs/queries/victorialogs-time-series-query/VictoriaLogsTimeSeriesQueryEditor.js +0 -112
- package/lib/cjs/queries/victorialogs-time-series-query/index.js +0 -33
- package/lib/cjs/queries/victorialogs-time-series-query/query.js +0 -126
- package/lib/cjs/queries/victorialogs-time-series-query/types.js +0 -16
- package/lib/cjs/setup-tests.js +0 -19
- package/lib/cjs/variables/index.js +0 -31
- package/lib/cjs/variables/types.js +0 -16
- package/lib/cjs/variables/utils.js +0 -97
- package/lib/cjs/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariable.js +0 -57
- package/lib/cjs/variables/victorialogs-field-names/VictoriaLogsFieldNamesVariableEditor.js +0 -80
- package/lib/cjs/variables/victorialogs-field-names/index.js +0 -30
- package/lib/cjs/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariable.js +0 -61
- package/lib/cjs/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js +0 -113
- package/lib/cjs/variables/victorialogs-field-values/index.js +0 -30
- /package/__mf/css/async/{6408.85c2cbf6.css → 5650.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{7984.194982d6.js.LICENSE.txt → 1522.952455c8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{198.fbb67f8a.js.LICENSE.txt → 198.0747c3c4.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2043.b149adfd.js.LICENSE.txt → 2043.15dfcaf2.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2749.71c38fe0.js.LICENSE.txt → 2786.f183253f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.c6e57bd8.js.LICENSE.txt → 392.e0ccad9b.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4121.5468ac01.js.LICENSE.txt → 4121.e0b41fa2.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3998.e9a3cf1a.js.LICENSE.txt → 4960.fd41e601.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5440.7765ad14.js.LICENSE.txt → 5440.5a93fae0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.0634d636.js.LICENSE.txt → 6274.05a0c6f1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6864.66bc6315.js.LICENSE.txt → 7817.63122fff.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5481.b7b48b8f.js.LICENSE.txt → 7862.5530d38c.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.cb89de3b.js.LICENSE.txt → 8470.b2bd6ab1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7817.5e96b0dd.js.LICENSE.txt → 941.3d0f5a01.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4225.744952e9.js.LICENSE.txt → 9440.ddd37afc.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8787.c3298397.js.LICENSE.txt → __federation_expose_VictoriaLogsDatasource.03128f7e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.a44f722e.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldNamesVariable.0ceb2243.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_VictoriaLogsDatasource.807ae747.js.LICENSE.txt → __federation_expose_VictoriaLogsFieldValuesVariable.72183be9.js.LICENSE.txt} +0 -0
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the \"License\");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an \"AS IS\" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "VictoriaLogsFieldValuesVariable", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return VictoriaLogsFieldValuesVariable;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
-
const _model = require("../../model");
|
|
25
|
-
const _utils = require("../utils");
|
|
26
|
-
const _VictoriaLogsFieldValuesVariableEditor = require("./VictoriaLogsFieldValuesVariableEditor");
|
|
27
|
-
const VictoriaLogsFieldValuesVariable = {
|
|
28
|
-
getVariableOptions: async (spec, ctx)=>{
|
|
29
|
-
const datasourceSelector = (0, _pluginsystem.datasourceSelectValueToSelector)(spec.datasource ?? _model.DEFAULT_VICTORIALOGS, ctx.variables, await ctx.datasourceStore.listDatasourceSelectItems(_model.VICTORIALOGS_DATASOURCE_KIND)) ?? _model.DEFAULT_VICTORIALOGS;
|
|
30
|
-
const client = await ctx.datasourceStore.getDatasourceClient(datasourceSelector);
|
|
31
|
-
const query = (0, _pluginsystem.replaceVariables)(spec.query, ctx.variables);
|
|
32
|
-
const timeRange = (0, _utils.getVictoriaLogsTimeRange)(ctx.timeRange);
|
|
33
|
-
const { values } = query ? await client.fieldValues({
|
|
34
|
-
field: (0, _pluginsystem.replaceVariables)(spec.field, ctx.variables),
|
|
35
|
-
query: query,
|
|
36
|
-
...timeRange
|
|
37
|
-
}) : {
|
|
38
|
-
values: []
|
|
39
|
-
};
|
|
40
|
-
return {
|
|
41
|
-
data: (0, _utils.fieldItemsToVariableOptions)(values)
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
dependsOn: (spec)=>{
|
|
45
|
-
const queryVariables = (0, _pluginsystem.parseVariables)(spec.query);
|
|
46
|
-
const labelVariables = (0, _pluginsystem.parseVariables)(spec.field);
|
|
47
|
-
const datasourceVariables = spec.datasource && (0, _pluginsystem.isVariableDatasource)(spec.datasource) ? (0, _pluginsystem.parseVariables)(spec.datasource) : [];
|
|
48
|
-
return {
|
|
49
|
-
variables: [
|
|
50
|
-
...queryVariables,
|
|
51
|
-
...labelVariables,
|
|
52
|
-
...datasourceVariables
|
|
53
|
-
]
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
OptionsEditorComponent: _VictoriaLogsFieldValuesVariableEditor.VictoriaLogsFieldValuesVariableEditor,
|
|
57
|
-
createInitialOptions: ()=>({
|
|
58
|
-
field: '',
|
|
59
|
-
query: ''
|
|
60
|
-
})
|
|
61
|
-
};
|
package/lib/cjs/variables/victorialogs-field-values/VictoriaLogsFieldValuesVariableEditor.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "VictoriaLogsFieldValuesVariableEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return VictoriaLogsFieldValuesVariableEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _material = require("@mui/material");
|
|
25
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
26
|
-
const _immer = require("immer");
|
|
27
|
-
const _react = require("react");
|
|
28
|
-
const _model = require("../../model");
|
|
29
|
-
const _utils = require("../utils");
|
|
30
|
-
function VictoriaLogsFieldValuesVariableEditor(props) {
|
|
31
|
-
const { onChange, value, value: { datasource, query, field } } = props;
|
|
32
|
-
const datasourceSelectValue = datasource ?? _model.DEFAULT_VICTORIALOGS;
|
|
33
|
-
const selectedDatasource = (0, _pluginsystem.useDatasourceSelectValueToSelector)(datasourceSelectValue, _model.VICTORIALOGS_DATASOURCE_KIND);
|
|
34
|
-
const { data: fieldNames, isLoading: isFieldNamesOptionsLoading } = (0, _utils.useFieldNames)(query, selectedDatasource);
|
|
35
|
-
const handleDatasourceChange = (0, _react.useCallback)((next)=>{
|
|
36
|
-
if ((0, _pluginsystem.isVariableDatasource)(next) || (0, _model.isVictoriaLogsDatasourceSelector)(next)) {
|
|
37
|
-
onChange((0, _immer.produce)(value, (draft)=>{
|
|
38
|
-
// If they're using the default, just omit the datasource prop (i.e. set to undefined)
|
|
39
|
-
draft.datasource = !(0, _pluginsystem.isVariableDatasource)(next) && (0, _model.isDefaultVictoriaLogsSelector)(next) ? undefined : next;
|
|
40
|
-
}));
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
throw new Error('Got unexpected non-VictoriaLogs datasource selector');
|
|
44
|
-
}, [
|
|
45
|
-
onChange,
|
|
46
|
-
value
|
|
47
|
-
]);
|
|
48
|
-
const handleQueryChange = (0, _react.useCallback)((event)=>{
|
|
49
|
-
onChange((0, _immer.produce)(value, (draft)=>{
|
|
50
|
-
draft.query = event.target.value;
|
|
51
|
-
}));
|
|
52
|
-
}, [
|
|
53
|
-
onChange,
|
|
54
|
-
value
|
|
55
|
-
]);
|
|
56
|
-
const handleFieldChange = (0, _react.useCallback)((_, newValue)=>{
|
|
57
|
-
onChange((0, _immer.produce)(value, (draft)=>{
|
|
58
|
-
draft.field = newValue || '';
|
|
59
|
-
}));
|
|
60
|
-
}, [
|
|
61
|
-
onChange,
|
|
62
|
-
value
|
|
63
|
-
]);
|
|
64
|
-
const fieldNamesOptions = (0, _react.useMemo)(()=>{
|
|
65
|
-
return fieldNames?.values.map((o)=>o.value) || [];
|
|
66
|
-
}, [
|
|
67
|
-
fieldNames
|
|
68
|
-
]);
|
|
69
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
70
|
-
spacing: 2,
|
|
71
|
-
children: [
|
|
72
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControl, {
|
|
73
|
-
margin: "dense",
|
|
74
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
|
|
75
|
-
datasourcePluginKind: "VictoriaLogsDatasource",
|
|
76
|
-
value: datasourceSelectValue,
|
|
77
|
-
onChange: handleDatasourceChange,
|
|
78
|
-
readOnly: props.isReadonly,
|
|
79
|
-
labelId: "victorialogs-datasource-field",
|
|
80
|
-
label: "VictoriaLogs Datasource"
|
|
81
|
-
})
|
|
82
|
-
}),
|
|
83
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Autocomplete, {
|
|
84
|
-
freeSolo: true,
|
|
85
|
-
disableClearable: true,
|
|
86
|
-
value: field,
|
|
87
|
-
loading: isFieldNamesOptionsLoading,
|
|
88
|
-
options: fieldNamesOptions,
|
|
89
|
-
renderInput: (params)=>{
|
|
90
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
91
|
-
...params,
|
|
92
|
-
required: true,
|
|
93
|
-
label: "Field Name",
|
|
94
|
-
variant: "outlined"
|
|
95
|
-
});
|
|
96
|
-
},
|
|
97
|
-
onChange: handleFieldChange
|
|
98
|
-
}),
|
|
99
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
100
|
-
required: true,
|
|
101
|
-
label: "Query",
|
|
102
|
-
InputLabelProps: {
|
|
103
|
-
shrink: props.isReadonly ? true : undefined
|
|
104
|
-
},
|
|
105
|
-
InputProps: {
|
|
106
|
-
readOnly: props.isReadonly
|
|
107
|
-
},
|
|
108
|
-
value: query,
|
|
109
|
-
onChange: handleQueryChange
|
|
110
|
-
})
|
|
111
|
-
]
|
|
112
|
-
});
|
|
113
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
_export_star(require("./VictoriaLogsFieldValuesVariable"), exports);
|
|
18
|
-
function _export_star(from, to) {
|
|
19
|
-
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
-
Object.defineProperty(to, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function() {
|
|
24
|
-
return from[k];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return from;
|
|
30
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|