@perses-dev/clickhouse-plugin 0.1.0
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/README.md +41 -0
- package/__mf/css/async/1580.6b2b0c71.css +1 -0
- package/__mf/css/async/2341.6b2b0c71.css +1 -0
- package/__mf/css/async/6759.6b2b0c71.css +1 -0
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/ClickHouse.99e35ca2.js +5 -0
- package/__mf/js/async/1580.5bd6ed40.js +2 -0
- package/__mf/js/async/1580.5bd6ed40.js.LICENSE.txt +9 -0
- package/__mf/js/async/1964.dccce52b.js +2 -0
- package/__mf/js/async/1964.dccce52b.js.LICENSE.txt +9 -0
- package/__mf/js/async/2114.27f707a0.js +1 -0
- package/__mf/js/async/2292.248bd1ea.js +2 -0
- package/__mf/js/async/2292.248bd1ea.js.LICENSE.txt +24 -0
- package/__mf/js/async/2417.1f135170.js +2 -0
- package/__mf/js/async/2417.1f135170.js.LICENSE.txt +9 -0
- package/__mf/js/async/2448.e42be954.js +10 -0
- package/__mf/js/async/2448.e42be954.js.LICENSE.txt +17 -0
- package/__mf/js/async/2651.3bdd6b21.js +1 -0
- package/__mf/js/async/3224.5735a223.js +1 -0
- package/__mf/js/async/3431.54fb88df.js +1 -0
- package/__mf/js/async/3632.f88c5ced.js +101 -0
- package/__mf/js/async/3863.70d46fa8.js +2 -0
- package/__mf/js/async/3863.70d46fa8.js.LICENSE.txt +9 -0
- package/__mf/js/async/3960.e0eb27f3.js +2 -0
- package/__mf/js/async/3960.e0eb27f3.js.LICENSE.txt +8 -0
- package/__mf/js/async/3980.2a6bea70.js +2 -0
- package/__mf/js/async/3980.2a6bea70.js.LICENSE.txt +9 -0
- package/__mf/js/async/4075.598f1ee5.js +1 -0
- package/__mf/js/async/4168.af4fa8b3.js +2 -0
- package/__mf/js/async/4238.8c8282dc.js +1 -0
- package/__mf/js/async/4269.a389e8c6.js +2 -0
- package/__mf/js/async/4269.a389e8c6.js.LICENSE.txt +9 -0
- package/__mf/js/async/4368.8468ec0a.js +2 -0
- package/__mf/js/async/4368.8468ec0a.js.LICENSE.txt +15 -0
- package/__mf/js/async/4421.de18bb66.js +1 -0
- package/__mf/js/async/5035.8a983cd3.js +73 -0
- package/__mf/js/async/5035.8a983cd3.js.LICENSE.txt +19 -0
- package/__mf/js/async/5214.d1943ccc.js +1 -0
- package/__mf/js/async/5409.c4876520.js +1 -0
- package/__mf/js/async/56.9997e6f8.js +1 -0
- package/__mf/js/async/5713.92805154.js +1 -0
- package/__mf/js/async/5981.f3abf3c8.js +2 -0
- package/__mf/js/async/5981.f3abf3c8.js.LICENSE.txt +8 -0
- package/__mf/js/async/6292.4311054b.js +1 -0
- package/__mf/js/async/6333.dfeaf029.js +2 -0
- package/__mf/js/async/6333.dfeaf029.js.LICENSE.txt +9 -0
- package/__mf/js/async/6377.6c8c4e15.js +2 -0
- package/__mf/js/async/6377.6c8c4e15.js.LICENSE.txt +32 -0
- package/__mf/js/async/6411.3873365b.js +1 -0
- package/__mf/js/async/6467.f4e5b898.js +1 -0
- package/__mf/js/async/6569.f8ee50db.js +1 -0
- package/__mf/js/async/6714.e4b5281a.js +2 -0
- package/__mf/js/async/6714.e4b5281a.js.LICENSE.txt +21 -0
- package/__mf/js/async/6770.e50c0d08.js +1 -0
- package/__mf/js/async/694.c93f9cdf.js +1 -0
- package/__mf/js/async/7376.c01a7f82.js +1 -0
- package/__mf/js/async/738.0cdf47b4.js +1 -0
- package/__mf/js/async/7740.b3df297f.js +1 -0
- package/__mf/js/async/8216.44c6334e.js +1 -0
- package/__mf/js/async/8465.f4c53fef.js +7 -0
- package/__mf/js/async/8465.f4c53fef.js.LICENSE.txt +21 -0
- package/__mf/js/async/8488.16a69ea5.js +1 -0
- package/__mf/js/async/8709.6d909ac5.js +2 -0
- package/__mf/js/async/8709.6d909ac5.js.LICENSE.txt +9 -0
- package/__mf/js/async/9173.90ba4f20.js +2 -0
- package/__mf/js/async/9173.90ba4f20.js.LICENSE.txt +19 -0
- package/__mf/js/async/9654.ab803765.js +37 -0
- package/__mf/js/async/__federation_expose_ClickHouseDatasource.1ef730b1.js +2 -0
- package/__mf/js/async/__federation_expose_ClickHouseDatasource.1ef730b1.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_ClickHouseLogQuery.3f312752.js +19 -0
- package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.a3f88e6b.js +19 -0
- package/__mf/js/async/__federation_expose_Logs.88d56eeb.js +2 -0
- package/__mf/js/async/__federation_expose_Logs.88d56eeb.js.LICENSE.txt +9 -0
- package/__mf/js/main.b7c9a660.js +5 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +19 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/lib/cjs/components/ClickQLEditor.js +72 -0
- package/lib/cjs/components/constants.js +41 -0
- package/lib/cjs/components/index.js +30 -0
- package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasource.js +49 -0
- package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +51 -0
- package/lib/cjs/datasources/click-house-datasource/click-house-datasource-types.js +16 -0
- package/lib/cjs/datasources/click-house-datasource/index.js +32 -0
- package/lib/cjs/datasources/index.js +30 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/getPluginModule.js +39 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +39 -0
- package/lib/cjs/model/click-house-client.js +66 -0
- package/lib/cjs/model/click-house-data-types.js +16 -0
- package/lib/cjs/panels/index.js +30 -0
- package/lib/cjs/panels/logs/Logs.js +37 -0
- package/lib/cjs/panels/logs/LogsComponent.js +47 -0
- package/lib/cjs/panels/logs/LogsSettingsEditor.js +57 -0
- package/lib/cjs/panels/logs/components/EmptyLogsState.js +49 -0
- package/lib/cjs/panels/logs/components/LogRow/LogDetailsTable.js +71 -0
- package/lib/cjs/panels/logs/components/LogRow/LogRow.js +163 -0
- package/lib/cjs/panels/logs/components/LogRow/LogTimestamp.js +45 -0
- package/lib/cjs/panels/logs/components/LogRow/LogsStyles.js +77 -0
- package/lib/cjs/panels/logs/components/LogRow/index.js +37 -0
- package/lib/cjs/panels/logs/components/LogsList.js +44 -0
- package/lib/cjs/panels/logs/components/VirtualizedLogsList.js +60 -0
- package/lib/cjs/panels/logs/components/hooks/useExpandedRows.js +45 -0
- package/lib/cjs/panels/logs/index.js +33 -0
- package/lib/cjs/panels/logs/logs-types.js +16 -0
- package/lib/cjs/queries/click-house-log-query/ClickHouseLogQuery.js +43 -0
- package/lib/cjs/queries/click-house-log-query/ClickHouseLogQueryEditor.js +113 -0
- package/lib/cjs/queries/click-house-log-query/click-house-log-query-types.js +16 -0
- package/lib/cjs/queries/click-house-log-query/get-click-house-log-data.js +89 -0
- package/lib/cjs/queries/click-house-log-query/index.js +33 -0
- package/lib/cjs/queries/click-house-log-query/log-query-plugin-interface.js +4 -0
- package/lib/cjs/queries/click-house-time-series-query/ClickHouseQuery.js +43 -0
- package/lib/cjs/queries/click-house-time-series-query/ClickHouseQueryEditor.js +113 -0
- package/lib/cjs/queries/click-house-time-series-query/click-house-query-types.js +16 -0
- package/lib/cjs/queries/click-house-time-series-query/get-click-house-data.js +69 -0
- package/lib/cjs/queries/click-house-time-series-query/index.js +33 -0
- package/lib/cjs/queries/constants.js +34 -0
- package/lib/cjs/queries/index.js +31 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/components/ClickQLEditor.d.ts +5 -0
- package/lib/components/ClickQLEditor.d.ts.map +1 -0
- package/lib/components/ClickQLEditor.js +59 -0
- package/lib/components/ClickQLEditor.js.map +1 -0
- package/lib/components/constants.d.ts +2 -0
- package/lib/components/constants.d.ts.map +1 -0
- package/lib/components/constants.js +33 -0
- package/lib/components/constants.js.map +1 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +15 -0
- package/lib/components/index.js.map +1 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.d.ts +4 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.d.ts.map +1 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.js +41 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.js.map +1 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.d.ts +9 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.d.ts.map +1 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +43 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js.map +1 -0
- package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts +26 -0
- package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts.map +1 -0
- package/lib/datasources/click-house-datasource/click-house-datasource-types.js +15 -0
- package/lib/datasources/click-house-datasource/click-house-datasource-types.js.map +1 -0
- package/lib/datasources/click-house-datasource/index.d.ts +4 -0
- package/lib/datasources/click-house-datasource/index.d.ts.map +1 -0
- package/lib/datasources/click-house-datasource/index.js +17 -0
- package/lib/datasources/click-house-datasource/index.js.map +1 -0
- package/lib/datasources/index.d.ts +2 -0
- package/lib/datasources/index.d.ts.map +1 -0
- package/lib/datasources/index.js +15 -0
- package/lib/datasources/index.js.map +1 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +28 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/model/click-house-client.d.ts +22 -0
- package/lib/model/click-house-client.d.ts.map +1 -0
- package/lib/model/click-house-client.js +58 -0
- package/lib/model/click-house-client.js.map +1 -0
- package/lib/model/click-house-data-types.d.ts +22 -0
- package/lib/model/click-house-data-types.d.ts.map +1 -0
- package/lib/model/click-house-data-types.js +15 -0
- package/lib/model/click-house-data-types.js.map +1 -0
- package/lib/panels/index.d.ts +2 -0
- package/lib/panels/index.d.ts.map +1 -0
- package/lib/panels/index.js +15 -0
- package/lib/panels/index.js.map +1 -0
- package/lib/panels/logs/Logs.d.ts +4 -0
- package/lib/panels/logs/Logs.d.ts.map +1 -0
- package/lib/panels/logs/Logs.js +29 -0
- package/lib/panels/logs/Logs.js.map +1 -0
- package/lib/panels/logs/LogsComponent.d.ts +4 -0
- package/lib/panels/logs/LogsComponent.d.ts.map +1 -0
- package/lib/panels/logs/LogsComponent.js +34 -0
- package/lib/panels/logs/LogsComponent.js.map +1 -0
- package/lib/panels/logs/LogsSettingsEditor.d.ts +7 -0
- package/lib/panels/logs/LogsSettingsEditor.d.ts.map +1 -0
- package/lib/panels/logs/LogsSettingsEditor.js +49 -0
- package/lib/panels/logs/LogsSettingsEditor.js.map +1 -0
- package/lib/panels/logs/components/EmptyLogsState.d.ts +7 -0
- package/lib/panels/logs/components/EmptyLogsState.d.ts.map +1 -0
- package/lib/panels/logs/components/EmptyLogsState.js +36 -0
- package/lib/panels/logs/components/EmptyLogsState.js.map +1 -0
- package/lib/panels/logs/components/LogRow/LogDetailsTable.d.ts +8 -0
- package/lib/panels/logs/components/LogRow/LogDetailsTable.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/LogDetailsTable.js +58 -0
- package/lib/panels/logs/components/LogRow/LogDetailsTable.js.map +1 -0
- package/lib/panels/logs/components/LogRow/LogRow.d.ts +14 -0
- package/lib/panels/logs/components/LogRow/LogRow.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/LogRow.js +109 -0
- package/lib/panels/logs/components/LogRow/LogRow.js.map +1 -0
- package/lib/panels/logs/components/LogRow/LogTimestamp.d.ts +7 -0
- package/lib/panels/logs/components/LogRow/LogTimestamp.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/LogTimestamp.js +32 -0
- package/lib/panels/logs/components/LogRow/LogTimestamp.js.map +1 -0
- package/lib/panels/logs/components/LogRow/LogsStyles.d.ts +22 -0
- package/lib/panels/logs/components/LogRow/LogsStyles.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/LogsStyles.js +55 -0
- package/lib/panels/logs/components/LogRow/LogsStyles.js.map +1 -0
- package/lib/panels/logs/components/LogRow/index.d.ts +3 -0
- package/lib/panels/logs/components/LogRow/index.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/index.js +16 -0
- package/lib/panels/logs/components/LogRow/index.js.map +1 -0
- package/lib/panels/logs/components/LogsList.d.ts +8 -0
- package/lib/panels/logs/components/LogsList.d.ts.map +1 -0
- package/lib/panels/logs/components/LogsList.js +31 -0
- package/lib/panels/logs/components/LogsList.js.map +1 -0
- package/lib/panels/logs/components/VirtualizedLogsList.d.ts +10 -0
- package/lib/panels/logs/components/VirtualizedLogsList.d.ts.map +1 -0
- package/lib/panels/logs/components/VirtualizedLogsList.js +47 -0
- package/lib/panels/logs/components/VirtualizedLogsList.js.map +1 -0
- package/lib/panels/logs/components/hooks/useExpandedRows.d.ts +6 -0
- package/lib/panels/logs/components/hooks/useExpandedRows.d.ts.map +1 -0
- package/lib/panels/logs/components/hooks/useExpandedRows.js +37 -0
- package/lib/panels/logs/components/hooks/useExpandedRows.js.map +1 -0
- package/lib/panels/logs/index.d.ts +5 -0
- package/lib/panels/logs/index.d.ts.map +1 -0
- package/lib/panels/logs/index.js +18 -0
- package/lib/panels/logs/index.js.map +1 -0
- package/lib/panels/logs/logs-types.d.ts +16 -0
- package/lib/panels/logs/logs-types.d.ts.map +1 -0
- package/lib/panels/logs/logs-types.js +15 -0
- package/lib/panels/logs/logs-types.js.map +1 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.d.ts +4 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.js +35 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.js.map +1 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.d.ts +7 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js +105 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js.map +1 -0
- package/lib/queries/click-house-log-query/click-house-log-query-types.d.ts +6 -0
- package/lib/queries/click-house-log-query/click-house-log-query-types.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/click-house-log-query-types.js +15 -0
- package/lib/queries/click-house-log-query/click-house-log-query-types.js.map +1 -0
- package/lib/queries/click-house-log-query/get-click-house-log-data.d.ts +4 -0
- package/lib/queries/click-house-log-query/get-click-house-log-data.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/get-click-house-log-data.js +81 -0
- package/lib/queries/click-house-log-query/get-click-house-log-data.js.map +1 -0
- package/lib/queries/click-house-log-query/index.d.ts +5 -0
- package/lib/queries/click-house-log-query/index.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/index.js +18 -0
- package/lib/queries/click-house-log-query/index.js.map +1 -0
- package/lib/queries/click-house-log-query/log-query-plugin-interface.d.ts +25 -0
- package/lib/queries/click-house-log-query/log-query-plugin-interface.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/log-query-plugin-interface.js +3 -0
- package/lib/queries/click-house-log-query/log-query-plugin-interface.js.map +1 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.d.ts +4 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.js +35 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.js.map +1 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.d.ts +7 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js +105 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js.map +1 -0
- package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts +11 -0
- package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/click-house-query-types.js +16 -0
- package/lib/queries/click-house-time-series-query/click-house-query-types.js.map +1 -0
- package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts +4 -0
- package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/get-click-house-data.js +61 -0
- package/lib/queries/click-house-time-series-query/get-click-house-data.js.map +1 -0
- package/lib/queries/click-house-time-series-query/index.d.ts +5 -0
- package/lib/queries/click-house-time-series-query/index.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/index.js +18 -0
- package/lib/queries/click-house-time-series-query/index.js.map +1 -0
- package/lib/queries/constants.d.ts +5 -0
- package/lib/queries/constants.d.ts.map +1 -0
- package/lib/queries/constants.js +18 -0
- package/lib/queries/constants.js.map +1 -0
- package/lib/queries/index.d.ts +3 -0
- package/lib/queries/index.d.ts.map +1 -0
- package/lib/queries/index.js +16 -0
- package/lib/queries/index.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/mf-manifest.json +505 -0
- package/mf-stats.json +561 -0
- package/package.json +85 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import CodeMirror from '@uiw/react-codemirror';
|
|
15
|
+
import { EditorView } from '@codemirror/view';
|
|
16
|
+
import { useTheme, InputLabel, Stack } from '@mui/material';
|
|
17
|
+
export function ClickQLEditor(props) {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const isDarkMode = theme.palette.mode === 'dark';
|
|
20
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
21
|
+
position: "relative",
|
|
22
|
+
children: [
|
|
23
|
+
/*#__PURE__*/ _jsx(InputLabel, {
|
|
24
|
+
sx: {
|
|
25
|
+
fontWeight: 500,
|
|
26
|
+
marginBottom: '4px',
|
|
27
|
+
color: theme.palette.text.primary
|
|
28
|
+
},
|
|
29
|
+
children: "ClickHouse Query"
|
|
30
|
+
}),
|
|
31
|
+
/*#__PURE__*/ _jsx(CodeMirror, {
|
|
32
|
+
...props,
|
|
33
|
+
style: {
|
|
34
|
+
border: `1px solid ${theme.palette.divider}`
|
|
35
|
+
},
|
|
36
|
+
theme: isDarkMode ? 'dark' : 'light',
|
|
37
|
+
basicSetup: {
|
|
38
|
+
highlightActiveLine: false,
|
|
39
|
+
highlightActiveLineGutter: false,
|
|
40
|
+
foldGutter: false,
|
|
41
|
+
syntaxHighlighting: true
|
|
42
|
+
},
|
|
43
|
+
extensions: [
|
|
44
|
+
EditorView.lineWrapping,
|
|
45
|
+
EditorView.theme({
|
|
46
|
+
'.cm-content': {
|
|
47
|
+
paddingTop: '8px',
|
|
48
|
+
paddingBottom: '8px',
|
|
49
|
+
paddingRight: '40px'
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
],
|
|
53
|
+
placeholder: "Write ClickHouse Query Here..."
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=ClickQLEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ClickQLEditor.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport CodeMirror, { ReactCodeMirrorProps } from '@uiw/react-codemirror';\nimport { EditorView } from '@codemirror/view';\nimport { useTheme, InputLabel, Stack } from '@mui/material';\nimport { ReactElement } from 'react';\n\nexport type ClickQLEditorProps = Omit<ReactCodeMirrorProps, 'theme' | 'extensions'>;\n\nexport function ClickQLEditor(props: ClickQLEditorProps): ReactElement {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n return (\n <Stack position=\"relative\">\n <InputLabel\n sx={{\n fontWeight: 500,\n marginBottom: '4px',\n color: theme.palette.text.primary,\n }}\n >\n ClickHouse Query\n </InputLabel>\n <CodeMirror\n {...props}\n style={{ border: `1px solid ${theme.palette.divider}` }}\n theme={isDarkMode ? 'dark' : 'light'}\n basicSetup={{\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n foldGutter: false,\n syntaxHighlighting: true,\n }}\n extensions={[\n EditorView.lineWrapping,\n EditorView.theme({\n '.cm-content': {\n paddingTop: '8px',\n paddingBottom: '8px',\n paddingRight: '40px',\n },\n }),\n ]}\n placeholder=\"Write ClickHouse Query Here...\"\n />\n </Stack>\n );\n}\n"],"names":["CodeMirror","EditorView","useTheme","InputLabel","Stack","ClickQLEditor","props","theme","isDarkMode","palette","mode","position","sx","fontWeight","marginBottom","color","text","primary","style","border","divider","basicSetup","highlightActiveLine","highlightActiveLineGutter","foldGutter","syntaxHighlighting","extensions","lineWrapping","paddingTop","paddingBottom","paddingRight","placeholder"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,OAAOA,gBAA0C,wBAAwB;AACzE,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,QAAQ,EAAEC,UAAU,EAAEC,KAAK,QAAQ,gBAAgB;AAK5D,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAMC,QAAQL;IACd,MAAMM,aAAaD,MAAME,OAAO,CAACC,IAAI,KAAK;IAE1C,qBACE,MAACN;QAAMO,UAAS;;0BACd,KAACR;gBACCS,IAAI;oBACFC,YAAY;oBACZC,cAAc;oBACdC,OAAOR,MAAME,OAAO,CAACO,IAAI,CAACC,OAAO;gBACnC;0BACD;;0BAGD,KAACjB;gBACE,GAAGM,KAAK;gBACTY,OAAO;oBAAEC,QAAQ,CAAC,UAAU,EAAEZ,MAAME,OAAO,CAACW,OAAO,EAAE;gBAAC;gBACtDb,OAAOC,aAAa,SAAS;gBAC7Ba,YAAY;oBACVC,qBAAqB;oBACrBC,2BAA2B;oBAC3BC,YAAY;oBACZC,oBAAoB;gBACtB;gBACAC,YAAY;oBACVzB,WAAW0B,YAAY;oBACvB1B,WAAWM,KAAK,CAAC;wBACf,eAAe;4BACbqB,YAAY;4BACZC,eAAe;4BACfC,cAAc;wBAChB;oBACF;iBACD;gBACDC,aAAY;;;;AAIpB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const queryExample = "-- Time Series Query\nSELECT \n toStartOfMinute(timestamp) as time,\n avg(cpu_usage) as avg_cpu,\n max(memory_usage) as max_memory\nFROM system_metrics \nWHERE timestamp BETWEEN '{start}' AND '{end}'\nGROUP BY time ORDER BY time\n-- Logs Query \nSELECT \n Timestamp as log_time,\n Body,\n ServiceName,\n ResourceAttributes,\n SeverityNumber,\n SeverityText\nFROM application_logs \nWHERE timestamp >= '{start}' \nORDER BY time DESC LIMIT 1000";
|
|
2
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/constants.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,ycAkBK,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export const queryExample = `-- Time Series Query
|
|
14
|
+
SELECT
|
|
15
|
+
toStartOfMinute(timestamp) as time,
|
|
16
|
+
avg(cpu_usage) as avg_cpu,
|
|
17
|
+
max(memory_usage) as max_memory
|
|
18
|
+
FROM system_metrics
|
|
19
|
+
WHERE timestamp BETWEEN '{start}' AND '{end}'
|
|
20
|
+
GROUP BY time ORDER BY time
|
|
21
|
+
-- Logs Query
|
|
22
|
+
SELECT
|
|
23
|
+
Timestamp as log_time,
|
|
24
|
+
Body,
|
|
25
|
+
ServiceName,
|
|
26
|
+
ResourceAttributes,
|
|
27
|
+
SeverityNumber,
|
|
28
|
+
SeverityText
|
|
29
|
+
FROM application_logs
|
|
30
|
+
WHERE timestamp >= '{start}'
|
|
31
|
+
ORDER BY time DESC LIMIT 1000`;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/constants.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport const queryExample = `-- Time Series Query\nSELECT \n toStartOfMinute(timestamp) as time,\n avg(cpu_usage) as avg_cpu,\n max(memory_usage) as max_memory\nFROM system_metrics \nWHERE timestamp BETWEEN '{start}' AND '{end}'\nGROUP BY time ORDER BY time\n-- Logs Query \nSELECT \n Timestamp as log_time,\n Body,\n ServiceName,\n ResourceAttributes,\n SeverityNumber,\n SeverityText\nFROM application_logs \nWHERE timestamp >= '{start}' \nORDER BY time DESC LIMIT 1000`;\n"],"names":["queryExample"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,MAAMA,eAAe,CAAC;;;;;;;;;;;;;;;;;;6BAkBA,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export * from './ClickQLEditor';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ClickQLEditor';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,kBAAkB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DatasourcePlugin } from '@perses-dev/plugin-system';
|
|
2
|
+
import { ClickHouseDatasourceSpec, ClickHouseDatasourceClient } from './click-house-datasource-types';
|
|
3
|
+
export declare const ClickHouseDatasource: DatasourcePlugin<ClickHouseDatasourceSpec, ClickHouseDatasourceClient>;
|
|
4
|
+
//# sourceMappingURL=ClickHouseDatasource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClickHouseDatasource.d.ts","sourceRoot":"","sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasource.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AA4BtG,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,CAAC,wBAAwB,EAAE,0BAA0B,CAIvG,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
import { ClickHouseDatasourceEditor } from './ClickHouseDatasourceEditor';
|
|
14
|
+
import { query } from '../../model/click-house-client';
|
|
15
|
+
const createClient = (spec, options)=>{
|
|
16
|
+
const { directUrl, proxy } = spec;
|
|
17
|
+
const { proxyUrl } = options;
|
|
18
|
+
const datasourceUrl = directUrl ?? proxyUrl;
|
|
19
|
+
if (datasourceUrl === undefined) {
|
|
20
|
+
throw new Error('No URL specified for ClickHouseDatasource client. You can use directUrl in the spec to configure it.');
|
|
21
|
+
}
|
|
22
|
+
const specHeaders = proxy?.spec.headers || {};
|
|
23
|
+
return {
|
|
24
|
+
options: {
|
|
25
|
+
datasourceUrl
|
|
26
|
+
},
|
|
27
|
+
query: (params, headers)=>query(params, {
|
|
28
|
+
datasourceUrl,
|
|
29
|
+
headers: headers ?? specHeaders
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export const ClickHouseDatasource = {
|
|
34
|
+
createClient,
|
|
35
|
+
OptionsEditorComponent: ClickHouseDatasourceEditor,
|
|
36
|
+
createInitialOptions: ()=>({
|
|
37
|
+
directUrl: ''
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=ClickHouseDatasource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasource.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DatasourcePlugin } from '@perses-dev/plugin-system';\nimport { ClickHouseDatasourceSpec, ClickHouseDatasourceClient } from './click-house-datasource-types';\nimport { ClickHouseDatasourceEditor } from './ClickHouseDatasourceEditor';\nimport { query } from '../../model/click-house-client';\n\nconst createClient: DatasourcePlugin<ClickHouseDatasourceSpec, ClickHouseDatasourceClient>['createClient'] = (\n spec,\n options\n) => {\n const { directUrl, proxy } = spec;\n const { proxyUrl } = options;\n\n const datasourceUrl = directUrl ?? proxyUrl;\n if (datasourceUrl === undefined) {\n throw new Error(\n 'No URL specified for ClickHouseDatasource client. You can use directUrl in the spec to configure it.'\n );\n }\n\n const specHeaders = proxy?.spec.headers || {};\n\n return {\n options: {\n datasourceUrl,\n },\n query: (params, headers) => query(params, { datasourceUrl, headers: headers ?? specHeaders }),\n };\n};\n\nexport const ClickHouseDatasource: DatasourcePlugin<ClickHouseDatasourceSpec, ClickHouseDatasourceClient> = {\n createClient,\n OptionsEditorComponent: ClickHouseDatasourceEditor,\n createInitialOptions: () => ({ directUrl: '' }),\n};\n"],"names":["ClickHouseDatasourceEditor","query","createClient","spec","options","directUrl","proxy","proxyUrl","datasourceUrl","undefined","Error","specHeaders","headers","params","ClickHouseDatasource","OptionsEditorComponent","createInitialOptions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,SAASA,0BAA0B,QAAQ,+BAA+B;AAC1E,SAASC,KAAK,QAAQ,iCAAiC;AAEvD,MAAMC,eAAuG,CAC3GC,MACAC;IAEA,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;IAC7B,MAAM,EAAEI,QAAQ,EAAE,GAAGH;IAErB,MAAMI,gBAAgBH,aAAaE;IACnC,IAAIC,kBAAkBC,WAAW;QAC/B,MAAM,IAAIC,MACR;IAEJ;IAEA,MAAMC,cAAcL,OAAOH,KAAKS,WAAW,CAAC;IAE5C,OAAO;QACLR,SAAS;YACPI;QACF;QACAP,OAAO,CAACY,QAAQD,UAAYX,MAAMY,QAAQ;gBAAEL;gBAAeI,SAASA,WAAWD;YAAY;IAC7F;AACF;AAEA,OAAO,MAAMG,uBAA+F;IAC1GZ;IACAa,wBAAwBf;IACxBgB,sBAAsB,IAAO,CAAA;YAAEX,WAAW;QAAG,CAAA;AAC/C,EAAE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ClickHouseDatasourceSpec } from './click-house-datasource-types';
|
|
3
|
+
export interface ClickHouseDatasourceEditorProps {
|
|
4
|
+
value: ClickHouseDatasourceSpec;
|
|
5
|
+
onChange: (next: ClickHouseDatasourceSpec) => void;
|
|
6
|
+
isReadonly?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function ClickHouseDatasourceEditor(props: ClickHouseDatasourceEditorProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=ClickHouseDatasourceEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClickHouseDatasourceEditor.d.ts","sourceRoot":"","sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasourceEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,wBAAwB,CAAC;IAChC,QAAQ,EAAE,CAAC,IAAI,EAAE,wBAAwB,KAAK,IAAI,CAAC;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,GAAG,YAAY,CA+B/F"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { HTTPSettingsEditor } from '@perses-dev/plugin-system';
|
|
15
|
+
export function ClickHouseDatasourceEditor(props) {
|
|
16
|
+
const { value, onChange, isReadonly } = props;
|
|
17
|
+
const initialSpecDirect = {
|
|
18
|
+
directUrl: ''
|
|
19
|
+
};
|
|
20
|
+
const initialSpecProxy = {
|
|
21
|
+
proxy: {
|
|
22
|
+
kind: 'HTTPProxy',
|
|
23
|
+
spec: {
|
|
24
|
+
allowedEndpoints: [
|
|
25
|
+
{
|
|
26
|
+
endpointPattern: '/',
|
|
27
|
+
method: 'GET'
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
url: ''
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return /*#__PURE__*/ _jsx(HTTPSettingsEditor, {
|
|
35
|
+
value: value,
|
|
36
|
+
onChange: onChange,
|
|
37
|
+
isReadonly: isReadonly,
|
|
38
|
+
initialSpecDirect: initialSpecDirect,
|
|
39
|
+
initialSpecProxy: initialSpecProxy
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=ClickHouseDatasourceEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/ClickHouseDatasourceEditor.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { HTTPSettingsEditor } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { ClickHouseDatasourceSpec } from './click-house-datasource-types';\n\nexport interface ClickHouseDatasourceEditorProps {\n value: ClickHouseDatasourceSpec;\n onChange: (next: ClickHouseDatasourceSpec) => void;\n isReadonly?: boolean;\n}\n\nexport function ClickHouseDatasourceEditor(props: ClickHouseDatasourceEditorProps): ReactElement {\n const { value, onChange, isReadonly } = props;\n\n const initialSpecDirect: ClickHouseDatasourceSpec = {\n directUrl: '',\n };\n\n const initialSpecProxy: ClickHouseDatasourceSpec = {\n proxy: {\n kind: 'HTTPProxy',\n spec: {\n allowedEndpoints: [\n {\n endpointPattern: '/',\n method: 'GET',\n },\n ],\n url: '',\n },\n },\n };\n\n return (\n <HTTPSettingsEditor\n value={value}\n onChange={onChange}\n isReadonly={isReadonly}\n initialSpecDirect={initialSpecDirect}\n initialSpecProxy={initialSpecProxy}\n />\n );\n}\n"],"names":["HTTPSettingsEditor","ClickHouseDatasourceEditor","props","value","onChange","isReadonly","initialSpecDirect","directUrl","initialSpecProxy","proxy","kind","spec","allowedEndpoints","endpointPattern","method","url"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,kBAAkB,QAAQ,4BAA4B;AAU/D,OAAO,SAASC,2BAA2BC,KAAsC;IAC/E,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGH;IAExC,MAAMI,oBAA8C;QAClDC,WAAW;IACb;IAEA,MAAMC,mBAA6C;QACjDC,OAAO;YACLC,MAAM;YACNC,MAAM;gBACJC,kBAAkB;oBAChB;wBACEC,iBAAiB;wBACjBC,QAAQ;oBACV;iBACD;gBACDC,KAAK;YACP;QACF;IACF;IAEA,qBACE,KAACf;QACCG,OAAOA;QACPC,UAAUA;QACVC,YAAYA;QACZC,mBAAmBA;QACnBE,kBAAkBA;;AAGxB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HTTPProxy, RequestHeaders } from '@perses-dev/core';
|
|
2
|
+
import { DatasourceClient } from '@perses-dev/plugin-system';
|
|
3
|
+
export interface ClickHouseDatasourceSpec {
|
|
4
|
+
directUrl?: string;
|
|
5
|
+
proxy?: HTTPProxy;
|
|
6
|
+
}
|
|
7
|
+
interface QueryRequestParameters extends Record<string, string> {
|
|
8
|
+
query: string;
|
|
9
|
+
start: string;
|
|
10
|
+
end: string;
|
|
11
|
+
}
|
|
12
|
+
interface ClickHouseDatasourceClientOptions {
|
|
13
|
+
datasourceUrl: string;
|
|
14
|
+
headers?: RequestHeaders;
|
|
15
|
+
}
|
|
16
|
+
export interface ClickHouseDatasourceResponse {
|
|
17
|
+
status: string;
|
|
18
|
+
warnings?: string[];
|
|
19
|
+
data: any;
|
|
20
|
+
}
|
|
21
|
+
export interface ClickHouseDatasourceClient extends DatasourceClient {
|
|
22
|
+
options: ClickHouseDatasourceClientOptions;
|
|
23
|
+
query(params: QueryRequestParameters, headers?: RequestHeaders): Promise<ClickHouseDatasourceResponse>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=click-house-datasource-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-house-datasource-types.d.ts","sourceRoot":"","sources":["../../../../src/datasources/click-house-datasource/click-house-datasource-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,UAAU,sBAAuB,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,iCAAiC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB;IAClE,OAAO,EAAE,iCAAiC,CAAC;IAC3C,KAAK,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;CACxG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export { };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=click-house-datasource-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/click-house-datasource-types.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { HTTPProxy, RequestHeaders } from '@perses-dev/core';\nimport { DatasourceClient } from '@perses-dev/plugin-system';\n\nexport interface ClickHouseDatasourceSpec {\n directUrl?: string;\n proxy?: HTTPProxy;\n}\n\ninterface QueryRequestParameters extends Record<string, string> {\n query: string;\n start: string;\n end: string;\n}\n\ninterface ClickHouseDatasourceClientOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface ClickHouseDatasourceResponse {\n status: string;\n warnings?: string[];\n // TODO: adjust this type to match your datasource response shape\n data: any;\n}\n\nexport interface ClickHouseDatasourceClient extends DatasourceClient {\n options: ClickHouseDatasourceClientOptions;\n query(params: QueryRequestParameters, headers?: RequestHeaders): Promise<ClickHouseDatasourceResponse>;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA4BjC,WAGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/datasources/click-house-datasource/index.ts"],"names":[],"mappings":"AAaA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export * from './ClickHouseDatasource';
|
|
14
|
+
export * from './ClickHouseDatasourceEditor';
|
|
15
|
+
export * from './click-house-datasource-types';
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/datasources/click-house-datasource/index.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ClickHouseDatasource';\nexport * from './ClickHouseDatasourceEditor';\nexport * from './click-house-datasource-types';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,iCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/datasources/index.ts"],"names":[],"mappings":"AAaA,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export * from './click-house-datasource';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/datasources/index.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './click-house-datasource';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,2BAA2B"}
|
package/lib/env.d.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
/// <reference types="@rsbuild/core/types" />
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=env.d.js.map
|
package/lib/env.d.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/env.d.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/// <reference types=\"@rsbuild/core/types\" />\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,6CAA6C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPluginModule.d.ts","sourceRoot":"","sources":["../../src/getPluginModule.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAGnF;;GAEG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAUtD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
import packageJson from '../package.json';
|
|
14
|
+
/**
|
|
15
|
+
* Returns the plugin module information from package.json
|
|
16
|
+
*/ export function getPluginModule() {
|
|
17
|
+
const { name, version, perses } = packageJson;
|
|
18
|
+
return {
|
|
19
|
+
kind: 'PluginModule',
|
|
20
|
+
metadata: {
|
|
21
|
+
name,
|
|
22
|
+
version
|
|
23
|
+
},
|
|
24
|
+
spec: perses
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=getPluginModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/getPluginModule.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { PluginModuleResource, PluginModuleSpec } from '@perses-dev/plugin-system';\nimport packageJson from '../package.json';\n\n/**\n * Returns the plugin module information from package.json\n */\nexport function getPluginModule(): PluginModuleResource {\n const { name, version, perses } = packageJson;\n return {\n kind: 'PluginModule',\n metadata: {\n name,\n version,\n },\n spec: perses as PluginModuleSpec,\n };\n}\n"],"names":["packageJson","getPluginModule","name","version","perses","kind","metadata","spec"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,OAAOA,iBAAiB,kBAAkB;AAE1C;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGJ;IAClC,OAAO;QACLK,MAAM;QACNC,UAAU;YACRJ;YACAC;QACF;QACAI,MAAMH;IACR;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index-federation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-federation.d.ts","sourceRoot":"","sources":["../../src/index-federation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
import('./bootstrap');
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index-federation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index-federation.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport('./bootstrap');\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,MAAM,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export { getPluginModule } from './getPluginModule';
|
|
14
|
+
export * from './panels';
|
|
15
|
+
export * from './queries';
|
|
16
|
+
export * from './datasources';
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport { getPluginModule } from './getPluginModule';\nexport * from './panels';\nexport * from './queries';\nexport * from './datasources';\n"],"names":["getPluginModule"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,eAAe,QAAQ,oBAAoB;AACpD,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,gBAAgB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RequestHeaders } from '@perses-dev/core';
|
|
2
|
+
export interface ClickHouseQueryParams {
|
|
3
|
+
query: string;
|
|
4
|
+
database?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ClickHouseQueryOptions {
|
|
7
|
+
datasourceUrl: string;
|
|
8
|
+
headers?: RequestHeaders;
|
|
9
|
+
}
|
|
10
|
+
export interface ClickHouseQueryResponse {
|
|
11
|
+
status: 'success' | 'error';
|
|
12
|
+
data: any;
|
|
13
|
+
}
|
|
14
|
+
export interface ClickHouseClient {
|
|
15
|
+
query: (params: {
|
|
16
|
+
start: string;
|
|
17
|
+
end: string;
|
|
18
|
+
query: string;
|
|
19
|
+
}) => Promise<ClickHouseQueryResponse>;
|
|
20
|
+
}
|
|
21
|
+
export declare function query(params: ClickHouseQueryParams, queryOptions: ClickHouseQueryOptions): Promise<ClickHouseQueryResponse>;
|
|
22
|
+
//# sourceMappingURL=click-house-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-house-client.d.ts","sourceRoot":"","sources":["../../../src/model/click-house-client.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACpG;AAED,wBAAsB,KAAK,CACzB,MAAM,EAAE,qBAAqB,EAC7B,YAAY,EAAE,sBAAsB,GACnC,OAAO,CAAC,uBAAuB,CAAC,CA4ClC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
export async function query(params, queryOptions) {
|
|
14
|
+
const { datasourceUrl, headers } = queryOptions;
|
|
15
|
+
const url = urlBuilder(datasourceUrl);
|
|
16
|
+
if (!params.query) {
|
|
17
|
+
throw new Error('No query provided in params');
|
|
18
|
+
}
|
|
19
|
+
let finalQuery = params.query.trim();
|
|
20
|
+
if (!finalQuery.toUpperCase().includes('FORMAT')) {
|
|
21
|
+
finalQuery += ' FORMAT JSON';
|
|
22
|
+
}
|
|
23
|
+
url.searchParams.set('query', finalQuery);
|
|
24
|
+
url.searchParams.set('database', params.database || 'default');
|
|
25
|
+
const init = {
|
|
26
|
+
method: 'GET',
|
|
27
|
+
headers: {
|
|
28
|
+
...headers
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
try {
|
|
32
|
+
const response = await fetch(url.toString(), init);
|
|
33
|
+
if (!response.ok) {
|
|
34
|
+
const errorText = await response.text();
|
|
35
|
+
console.error('ClickHouse error response:', errorText);
|
|
36
|
+
return {
|
|
37
|
+
status: 'error',
|
|
38
|
+
data: []
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const body = await response.json();
|
|
42
|
+
return {
|
|
43
|
+
status: 'success',
|
|
44
|
+
data: body.data || body
|
|
45
|
+
};
|
|
46
|
+
} catch (e) {
|
|
47
|
+
throw new Error(`ClickHouse query failed: ${e}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function urlBuilder(datasourceUrl) {
|
|
51
|
+
if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {
|
|
52
|
+
return new URL(datasourceUrl);
|
|
53
|
+
}
|
|
54
|
+
// if relative path (e.g. proxy url), resolve against window.location.origin
|
|
55
|
+
return new URL(datasourceUrl, window.location.origin);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=click-house-client.js.map
|