@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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/model/click-house-client.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 { RequestHeaders } from '@perses-dev/core';\n\nexport interface ClickHouseQueryParams {\n query: string;\n database?: string;\n}\n\nexport interface ClickHouseQueryOptions {\n datasourceUrl: string;\n headers?: RequestHeaders;\n}\n\nexport interface ClickHouseQueryResponse {\n status: 'success' | 'error';\n data: any;\n}\n\nexport interface ClickHouseClient {\n query: (params: { start: string; end: string; query: string }) => Promise<ClickHouseQueryResponse>;\n}\n\nexport async function query(\n params: ClickHouseQueryParams,\n queryOptions: ClickHouseQueryOptions\n): Promise<ClickHouseQueryResponse> {\n const { datasourceUrl, headers } = queryOptions;\n\n const url = urlBuilder(datasourceUrl);\n if (!params.query) {\n throw new Error('No query provided in params');\n }\n\n let finalQuery = params.query.trim();\n if (!finalQuery.toUpperCase().includes('FORMAT')) {\n finalQuery += ' FORMAT JSON';\n }\n\n url.searchParams.set('query', finalQuery);\n url.searchParams.set('database', params.database || 'default');\n\n const init = {\n method: 'GET',\n headers: {\n ...headers,\n },\n };\n\n try {\n const response = await fetch(url.toString(), init);\n\n if (!response.ok) {\n const errorText = await response.text();\n console.error('ClickHouse error response:', errorText);\n return {\n status: 'error',\n data: [],\n };\n }\n\n const body = await response.json();\n\n return {\n status: 'success',\n data: body.data || body,\n };\n } catch (e) {\n throw new Error(`ClickHouse query failed: ${e}`);\n }\n}\n\nfunction urlBuilder(datasourceUrl: string): URL {\n if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {\n return new URL(datasourceUrl);\n }\n // if relative path (e.g. proxy url), resolve against window.location.origin\n return new URL(datasourceUrl, window.location.origin);\n}\n"],"names":["query","params","queryOptions","datasourceUrl","headers","url","urlBuilder","Error","finalQuery","trim","toUpperCase","includes","searchParams","set","database","init","method","response","fetch","toString","ok","errorText","text","console","error","status","data","body","json","e","startsWith","URL","window","location","origin"],"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;AAuBjC,OAAO,eAAeA,MACpBC,MAA6B,EAC7BC,YAAoC;IAEpC,MAAM,EAAEC,aAAa,EAAEC,OAAO,EAAE,GAAGF;IAEnC,MAAMG,MAAMC,WAAWH;IACvB,IAAI,CAACF,OAAOD,KAAK,EAAE;QACjB,MAAM,IAAIO,MAAM;IAClB;IAEA,IAAIC,aAAaP,OAAOD,KAAK,CAACS,IAAI;IAClC,IAAI,CAACD,WAAWE,WAAW,GAAGC,QAAQ,CAAC,WAAW;QAChDH,cAAc;IAChB;IAEAH,IAAIO,YAAY,CAACC,GAAG,CAAC,SAASL;IAC9BH,IAAIO,YAAY,CAACC,GAAG,CAAC,YAAYZ,OAAOa,QAAQ,IAAI;IAEpD,MAAMC,OAAO;QACXC,QAAQ;QACRZ,SAAS;YACP,GAAGA,OAAO;QACZ;IACF;IAEA,IAAI;QACF,MAAMa,WAAW,MAAMC,MAAMb,IAAIc,QAAQ,IAAIJ;QAE7C,IAAI,CAACE,SAASG,EAAE,EAAE;YAChB,MAAMC,YAAY,MAAMJ,SAASK,IAAI;YACrCC,QAAQC,KAAK,CAAC,8BAA8BH;YAC5C,OAAO;gBACLI,QAAQ;gBACRC,MAAM,EAAE;YACV;QACF;QAEA,MAAMC,OAAO,MAAMV,SAASW,IAAI;QAEhC,OAAO;YACLH,QAAQ;YACRC,MAAMC,KAAKD,IAAI,IAAIC;QACrB;IACF,EAAE,OAAOE,GAAG;QACV,MAAM,IAAItB,MAAM,CAAC,yBAAyB,EAAEsB,GAAG;IACjD;AACF;AAEA,SAASvB,WAAWH,aAAqB;IACvC,IAAIA,cAAc2B,UAAU,CAAC,cAAc3B,cAAc2B,UAAU,CAAC,aAAa;QAC/E,OAAO,IAAIC,IAAI5B;IACjB;IACA,4EAA4E;IAC5E,OAAO,IAAI4B,IAAI5B,eAAe6B,OAAOC,QAAQ,CAACC,MAAM;AACtD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TimeSeriesData } from '@perses-dev/core';
|
|
2
|
+
export interface LogLabels {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface LogEntry {
|
|
6
|
+
timestamp: number;
|
|
7
|
+
labels: LogLabels;
|
|
8
|
+
line?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LogsData {
|
|
11
|
+
entries: LogEntry[];
|
|
12
|
+
totalCount: number;
|
|
13
|
+
hasMore?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ClickHouseTimeSeriesData extends TimeSeriesData {
|
|
16
|
+
logs?: LogsData;
|
|
17
|
+
}
|
|
18
|
+
export interface TimeSeriesEntry {
|
|
19
|
+
time: string;
|
|
20
|
+
log_count: number | string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=click-house-data-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-house-data-types.d.ts","sourceRoot":"","sources":["../../../src/model/click-house-data-types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B"}
|
|
@@ -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-data-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/model/click-house-data-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 { TimeSeriesData } from '@perses-dev/core';\n\nexport interface LogLabels {\n [key: string]: any;\n}\n\nexport interface LogEntry {\n timestamp: number;\n labels: LogLabels;\n line?: string;\n}\n\nexport interface LogsData {\n entries: LogEntry[];\n totalCount: number;\n hasMore?: boolean;\n}\n\nexport interface ClickHouseTimeSeriesData extends TimeSeriesData {\n logs?: LogsData;\n}\n\nexport interface TimeSeriesEntry {\n time: string;\n log_count: number | string;\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;AAwBjC,WAGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panels/index.ts"],"names":[],"mappings":"AAaA,cAAc,QAAQ,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 './logs';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/panels/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 './logs';\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,SAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logs.d.ts","sourceRoot":"","sources":["../../../../src/panels/logs/Logs.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,eAAO,MAAM,IAAI,EAAE,WAAW,CAAC,WAAW,EAAE,SAAS,CAKpD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { LogsComponent } from './LogsComponent';
|
|
14
|
+
import { LogsSettingsEditor } from './LogsSettingsEditor';
|
|
15
|
+
export const Logs = {
|
|
16
|
+
PanelComponent: LogsComponent,
|
|
17
|
+
panelOptionsEditorComponents: [
|
|
18
|
+
{
|
|
19
|
+
label: 'Settings',
|
|
20
|
+
content: LogsSettingsEditor
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
supportedQueryTypes: [
|
|
24
|
+
'LogQuery'
|
|
25
|
+
],
|
|
26
|
+
createInitialOptions: ()=>({})
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=Logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/panels/logs/Logs.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 { LogsComponent } from './LogsComponent';\nimport { LogsOptions, LogsProps } from './logs-types';\nimport { PanelPlugin } from '@perses-dev/plugin-system';\nimport { LogsSettingsEditor } from './LogsSettingsEditor';\n\nexport const Logs: PanelPlugin<LogsOptions, LogsProps> = {\n PanelComponent: LogsComponent,\n panelOptionsEditorComponents: [{ label: 'Settings', content: LogsSettingsEditor }],\n supportedQueryTypes: ['LogQuery'],\n createInitialOptions: () => ({}),\n};\n"],"names":["LogsComponent","LogsSettingsEditor","Logs","PanelComponent","panelOptionsEditorComponents","label","content","supportedQueryTypes","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;AAEjC,SAASA,aAAa,QAAQ,kBAAkB;AAGhD,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1D,OAAO,MAAMC,OAA4C;IACvDC,gBAAgBH;IAChBI,8BAA8B;QAAC;YAAEC,OAAO;YAAYC,SAASL;QAAmB;KAAE;IAClFM,qBAAqB;QAAC;KAAW;IACjCC,sBAAsB,IAAO,CAAA,CAAC,CAAA;AAChC,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogsComponent.d.ts","sourceRoot":"","sources":["../../../../src/panels/logs/LogsComponent.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,GAAG,IAAI,CAmBnE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { Typography } from '@mui/material';
|
|
15
|
+
import LogsList from './components/LogsList';
|
|
16
|
+
export function LogsComponent(props) {
|
|
17
|
+
const { queryResults, spec } = props;
|
|
18
|
+
if (queryResults[0]?.data.logs === undefined) {
|
|
19
|
+
return /*#__PURE__*/ _jsx(Typography, {
|
|
20
|
+
variant: "h3",
|
|
21
|
+
sx: {
|
|
22
|
+
textAlign: 'center',
|
|
23
|
+
marginTop: 4
|
|
24
|
+
},
|
|
25
|
+
children: "No logs to display"
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const logs = queryResults[0]?.data.logs.entries;
|
|
29
|
+
return /*#__PURE__*/ _jsx(LogsList, {
|
|
30
|
+
logs: logs
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=LogsComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/panels/logs/LogsComponent.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 { ReactElement } from 'react';\nimport { LogsProps } from './logs-types';\nimport { Typography } from '@mui/material';\nimport LogsList from './components/LogsList';\n\nexport function LogsComponent(props: LogsProps): ReactElement | null {\n const { queryResults, spec } = props;\n\n if (queryResults[0]?.data.logs === undefined) {\n return (\n <Typography\n variant=\"h3\"\n sx={{\n textAlign: 'center',\n marginTop: 4,\n }}\n >\n No logs to display\n </Typography>\n );\n }\n const logs = queryResults[0]?.data.logs.entries;\n\n return <LogsList logs={logs} />;\n}\n"],"names":["Typography","LogsList","LogsComponent","props","queryResults","spec","data","logs","undefined","variant","sx","textAlign","marginTop","entries"],"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,UAAU,QAAQ,gBAAgB;AAC3C,OAAOC,cAAc,wBAAwB;AAE7C,OAAO,SAASC,cAAcC,KAAgB;IAC5C,MAAM,EAAEC,YAAY,EAAEC,IAAI,EAAE,GAAGF;IAE/B,IAAIC,YAAY,CAAC,EAAE,EAAEE,KAAKC,SAASC,WAAW;QAC5C,qBACE,KAACR;YACCS,SAAQ;YACRC,IAAI;gBACFC,WAAW;gBACXC,WAAW;YACb;sBACD;;IAIL;IACA,MAAML,OAAOH,YAAY,CAAC,EAAE,EAAEE,KAAKC,KAAKM;IAExC,qBAAO,KAACZ;QAASM,MAAMA;;AACzB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OptionsEditorProps } from '@perses-dev/plugin-system';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { LogsOptions } from './logs-types';
|
|
4
|
+
type LogsSettingsEditorProps = OptionsEditorProps<LogsOptions>;
|
|
5
|
+
export declare function LogsSettingsEditor(props: LogsSettingsEditorProps): ReactElement;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=LogsSettingsEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogsSettingsEditor.d.ts","sourceRoot":"","sources":["../../../../src/panels/logs/LogsSettingsEditor.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAiD,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC9G,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,KAAK,uBAAuB,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;AAE/D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,CAqB/E"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { OptionsEditorGrid, OptionsEditorColumn, ThresholdsEditor } from '@perses-dev/components';
|
|
15
|
+
import { LegendOptionsEditor } from '@perses-dev/plugin-system';
|
|
16
|
+
export function LogsSettingsEditor(props) {
|
|
17
|
+
const { onChange, value } = props;
|
|
18
|
+
const handleLegendChange = (newLegend)=>{
|
|
19
|
+
onChange({
|
|
20
|
+
...value,
|
|
21
|
+
legend: newLegend
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const handleThresholdsChange = (thresholds)=>{
|
|
25
|
+
onChange({
|
|
26
|
+
...value,
|
|
27
|
+
thresholds
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/ _jsxs(OptionsEditorGrid, {
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ _jsx(OptionsEditorColumn, {
|
|
33
|
+
children: /*#__PURE__*/ _jsx(LegendOptionsEditor, {
|
|
34
|
+
value: value.legend,
|
|
35
|
+
onChange: handleLegendChange
|
|
36
|
+
})
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ _jsx(OptionsEditorColumn, {
|
|
39
|
+
children: /*#__PURE__*/ _jsx(ThresholdsEditor, {
|
|
40
|
+
hideDefault: true,
|
|
41
|
+
thresholds: value.thresholds,
|
|
42
|
+
onChange: handleThresholdsChange
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=LogsSettingsEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/panels/logs/LogsSettingsEditor.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 {\n OptionsEditorGrid,\n OptionsEditorColumn,\n ThresholdsEditor,\n ThresholdsEditorProps,\n} from '@perses-dev/components';\nimport { LegendOptionsEditor, LegendOptionsEditorProps, OptionsEditorProps } from '@perses-dev/plugin-system';\nimport { ReactElement } from 'react';\nimport { LogsOptions } from './logs-types';\n\ntype LogsSettingsEditorProps = OptionsEditorProps<LogsOptions>;\n\nexport function LogsSettingsEditor(props: LogsSettingsEditorProps): ReactElement {\n const { onChange, value } = props;\n\n const handleLegendChange: LegendOptionsEditorProps['onChange'] = (newLegend) => {\n onChange({ ...value, legend: newLegend });\n };\n\n const handleThresholdsChange: ThresholdsEditorProps['onChange'] = (thresholds) => {\n onChange({ ...value, thresholds });\n };\n\n return (\n <OptionsEditorGrid>\n <OptionsEditorColumn>\n <LegendOptionsEditor value={value.legend} onChange={handleLegendChange} />\n </OptionsEditorColumn>\n <OptionsEditorColumn>\n <ThresholdsEditor hideDefault thresholds={value.thresholds} onChange={handleThresholdsChange} />\n </OptionsEditorColumn>\n </OptionsEditorGrid>\n );\n}\n"],"names":["OptionsEditorGrid","OptionsEditorColumn","ThresholdsEditor","LegendOptionsEditor","LogsSettingsEditor","props","onChange","value","handleLegendChange","newLegend","legend","handleThresholdsChange","thresholds","hideDefault"],"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,SACEA,iBAAiB,EACjBC,mBAAmB,EACnBC,gBAAgB,QAEX,yBAAyB;AAChC,SAASC,mBAAmB,QAAsD,4BAA4B;AAM9G,OAAO,SAASC,mBAAmBC,KAA8B;IAC/D,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGF;IAE5B,MAAMG,qBAA2D,CAACC;QAChEH,SAAS;YAAE,GAAGC,KAAK;YAAEG,QAAQD;QAAU;IACzC;IAEA,MAAME,yBAA4D,CAACC;QACjEN,SAAS;YAAE,GAAGC,KAAK;YAAEK;QAAW;IAClC;IAEA,qBACE,MAACZ;;0BACC,KAACC;0BACC,cAAA,KAACE;oBAAoBI,OAAOA,MAAMG,MAAM;oBAAEJ,UAAUE;;;0BAEtD,KAACP;0BACC,cAAA,KAACC;oBAAiBW,WAAW;oBAACD,YAAYL,MAAMK,UAAU;oBAAEN,UAAUK;;;;;AAI9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyLogsState.d.ts","sourceRoot":"","sources":["../../../../../src/panels/logs/components/EmptyLogsState.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuBxD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 React from 'react';
|
|
15
|
+
import { Box, Typography, useTheme } from '@mui/material';
|
|
16
|
+
export const EmptyLogsState = ({ message = 'No logs to display' })=>{
|
|
17
|
+
const theme = useTheme();
|
|
18
|
+
return /*#__PURE__*/ _jsx(Box, {
|
|
19
|
+
sx: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
height: '200px'
|
|
24
|
+
},
|
|
25
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
26
|
+
variant: "body2",
|
|
27
|
+
sx: {
|
|
28
|
+
color: theme.palette.text.secondary,
|
|
29
|
+
fontSize: '14px'
|
|
30
|
+
},
|
|
31
|
+
children: message
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=EmptyLogsState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/panels/logs/components/EmptyLogsState.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 React from 'react';\nimport { Box, Typography, useTheme } from '@mui/material';\n\ninterface EmptyLogsStateProps {\n message?: string;\n}\n\nexport const EmptyLogsState: React.FC<EmptyLogsStateProps> = ({ message = 'No logs to display' }) => {\n const theme = useTheme();\n\n return (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: '200px',\n }}\n >\n <Typography\n variant=\"body2\"\n sx={{\n color: theme.palette.text.secondary,\n fontSize: '14px',\n }}\n >\n {message}\n </Typography>\n </Box>\n );\n};\n"],"names":["React","Box","Typography","useTheme","EmptyLogsState","message","theme","sx","display","alignItems","justifyContent","height","variant","color","palette","text","secondary","fontSize"],"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,WAAW,QAAQ;AAC1B,SAASC,GAAG,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,gBAAgB;AAM1D,OAAO,MAAMC,iBAAgD,CAAC,EAAEC,UAAU,oBAAoB,EAAE;IAC9F,MAAMC,QAAQH;IAEd,qBACE,KAACF;QACCM,IAAI;YACFC,SAAS;YACTC,YAAY;YACZC,gBAAgB;YAChBC,QAAQ;QACV;kBAEA,cAAA,KAACT;YACCU,SAAQ;YACRL,IAAI;gBACFM,OAAOP,MAAMQ,OAAO,CAACC,IAAI,CAACC,SAAS;gBACnCC,UAAU;YACZ;sBAECZ;;;AAIT,EAAE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LogLabels } from '../../../../model/click-house-data-types';
|
|
3
|
+
interface LogDetailsTableProps {
|
|
4
|
+
log: LogLabels;
|
|
5
|
+
}
|
|
6
|
+
export declare const LogDetailsTable: React.FC<LogDetailsTableProps>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=LogDetailsTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogDetailsTable.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/logs/components/LogRow/LogDetailsTable.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAErE,UAAU,oBAAoB;IAC5B,GAAG,EAAE,SAAS,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAgD1D,CAAC"}
|
|
@@ -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
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { Table, TableBody, TableRow, TableCell, useTheme, alpha } from '@mui/material';
|
|
16
|
+
export const LogDetailsTable = ({ log })=>{
|
|
17
|
+
const theme = useTheme();
|
|
18
|
+
return /*#__PURE__*/ _jsx(Table, {
|
|
19
|
+
size: "small",
|
|
20
|
+
sx: {
|
|
21
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
22
|
+
'& .MuiTableCell-root': {
|
|
23
|
+
border: 'none',
|
|
24
|
+
padding: '6px 8px',
|
|
25
|
+
fontSize: '12px'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
children: /*#__PURE__*/ _jsx(TableBody, {
|
|
29
|
+
children: Object.entries(log).map(([key, value])=>/*#__PURE__*/ _jsxs(TableRow, {
|
|
30
|
+
sx: {
|
|
31
|
+
'&:hover': {
|
|
32
|
+
backgroundColor: alpha(theme.palette.action.hover, 0.04)
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
37
|
+
sx: {
|
|
38
|
+
color: theme.palette.text.secondary,
|
|
39
|
+
fontWeight: 500,
|
|
40
|
+
width: '33%'
|
|
41
|
+
},
|
|
42
|
+
children: key
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
45
|
+
sx: {
|
|
46
|
+
color: theme.palette.text.primary,
|
|
47
|
+
wordBreak: 'break-word',
|
|
48
|
+
width: '67%'
|
|
49
|
+
},
|
|
50
|
+
children: value !== undefined && value !== null && value !== '' ? value : '--'
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
}, key))
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=LogDetailsTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/panels/logs/components/LogRow/LogDetailsTable.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 React from 'react';\nimport { Table, TableBody, TableRow, TableCell, useTheme, alpha } from '@mui/material';\nimport { LogLabels } from '../../../../model/click-house-data-types';\n\ninterface LogDetailsTableProps {\n log: LogLabels;\n}\n\nexport const LogDetailsTable: React.FC<LogDetailsTableProps> = ({ log }) => {\n const theme = useTheme();\n\n return (\n <Table\n size=\"small\"\n sx={{\n border: `1px solid ${theme.palette.divider}`,\n '& .MuiTableCell-root': {\n border: 'none',\n padding: '6px 8px',\n fontSize: '12px',\n },\n }}\n >\n <TableBody>\n {Object.entries(log).map(([key, value]) => (\n <TableRow\n key={key}\n sx={{\n '&:hover': {\n backgroundColor: alpha(theme.palette.action.hover, 0.04),\n },\n }}\n >\n <TableCell\n sx={{\n color: theme.palette.text.secondary,\n fontWeight: 500,\n width: '33%',\n }}\n >\n {key}\n </TableCell>\n <TableCell\n sx={{\n color: theme.palette.text.primary,\n wordBreak: 'break-word',\n width: '67%',\n }}\n >\n {value !== undefined && value !== null && value !== '' ? value : '--'}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n};\n"],"names":["React","Table","TableBody","TableRow","TableCell","useTheme","alpha","LogDetailsTable","log","theme","size","sx","border","palette","divider","padding","fontSize","Object","entries","map","key","value","backgroundColor","action","hover","color","text","secondary","fontWeight","width","primary","wordBreak","undefined"],"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,WAAW,QAAQ;AAC1B,SAASC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,gBAAgB;AAOvF,OAAO,MAAMC,kBAAkD,CAAC,EAAEC,GAAG,EAAE;IACrE,MAAMC,QAAQJ;IAEd,qBACE,KAACJ;QACCS,MAAK;QACLC,IAAI;YACFC,QAAQ,CAAC,UAAU,EAAEH,MAAMI,OAAO,CAACC,OAAO,EAAE;YAC5C,wBAAwB;gBACtBF,QAAQ;gBACRG,SAAS;gBACTC,UAAU;YACZ;QACF;kBAEA,cAAA,KAACd;sBACEe,OAAOC,OAAO,CAACV,KAAKW,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,iBACpC,MAAClB;oBAECQ,IAAI;wBACF,WAAW;4BACTW,iBAAiBhB,MAAMG,MAAMI,OAAO,CAACU,MAAM,CAACC,KAAK,EAAE;wBACrD;oBACF;;sCAEA,KAACpB;4BACCO,IAAI;gCACFc,OAAOhB,MAAMI,OAAO,CAACa,IAAI,CAACC,SAAS;gCACnCC,YAAY;gCACZC,OAAO;4BACT;sCAECT;;sCAEH,KAAChB;4BACCO,IAAI;gCACFc,OAAOhB,MAAMI,OAAO,CAACa,IAAI,CAACI,OAAO;gCACjCC,WAAW;gCACXF,OAAO;4BACT;sCAECR,UAAUW,aAAaX,UAAU,QAAQA,UAAU,KAAKA,QAAQ;;;mBAvB9DD;;;AA8BjB,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LogEntry } from '../../../../model/click-house-data-types';
|
|
3
|
+
interface LogRowProps {
|
|
4
|
+
log?: LogEntry;
|
|
5
|
+
index: number;
|
|
6
|
+
isExpanded: boolean;
|
|
7
|
+
onToggle: (index: number) => void;
|
|
8
|
+
isExpandable?: boolean;
|
|
9
|
+
time?: boolean;
|
|
10
|
+
wrap?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const LogRow: React.FC<LogRowProps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=LogRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogRow.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/logs/components/LogRow/LogRow.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAMjD,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAEpE,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsExC,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import React, { memo, useCallback } from 'react';
|
|
15
|
+
import { Box, Collapse, useTheme } from '@mui/material';
|
|
16
|
+
import ChevronRight from 'mdi-material-ui/ChevronRight';
|
|
17
|
+
import { LogTimestamp } from './LogTimestamp';
|
|
18
|
+
import { LogRowContainer, LogRowContent, ExpandButton, LogText } from './LogsStyles';
|
|
19
|
+
import { LogDetailsTable } from './LogDetailsTable';
|
|
20
|
+
export const LogRow = /*#__PURE__*/ memo(({ log, isExpanded, index, onToggle, isExpandable = true, time = false, wrap = false })=>{
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
const severityColor = theme.palette.text.secondary;
|
|
23
|
+
const handleToggle = useCallback(()=>{
|
|
24
|
+
if (isExpandable) {
|
|
25
|
+
onToggle(index);
|
|
26
|
+
}
|
|
27
|
+
}, [
|
|
28
|
+
isExpandable,
|
|
29
|
+
onToggle,
|
|
30
|
+
index
|
|
31
|
+
]);
|
|
32
|
+
if (!log) return null;
|
|
33
|
+
return /*#__PURE__*/ _jsxs(LogRowContainer, {
|
|
34
|
+
severityColor: severityColor,
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ _jsxs(LogRowContent, {
|
|
37
|
+
onClick: handleToggle,
|
|
38
|
+
isExpandable: isExpandable,
|
|
39
|
+
time: time,
|
|
40
|
+
children: [
|
|
41
|
+
isExpandable && /*#__PURE__*/ _jsx(Box, {
|
|
42
|
+
sx: {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
width: '16px',
|
|
46
|
+
justifyContent: 'center'
|
|
47
|
+
},
|
|
48
|
+
children: /*#__PURE__*/ _jsx(ExpandButton, {
|
|
49
|
+
size: "small",
|
|
50
|
+
isExpanded: isExpanded,
|
|
51
|
+
children: /*#__PURE__*/ _jsx(ChevronRight, {
|
|
52
|
+
sx: {
|
|
53
|
+
fontSize: '12px'
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
}),
|
|
58
|
+
/*#__PURE__*/ _jsx(LogTimestamp, {
|
|
59
|
+
timestamp: log?.timestamp
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
62
|
+
sx: {
|
|
63
|
+
display: 'flex',
|
|
64
|
+
gap: '10px',
|
|
65
|
+
marginLeft: '36px'
|
|
66
|
+
},
|
|
67
|
+
children: /*#__PURE__*/ _jsx(LogText, {
|
|
68
|
+
variant: "body2",
|
|
69
|
+
wrap: wrap,
|
|
70
|
+
children: log?.line
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
}),
|
|
75
|
+
/*#__PURE__*/ _jsx(Collapse, {
|
|
76
|
+
in: isExpanded,
|
|
77
|
+
timeout: 200,
|
|
78
|
+
children: /*#__PURE__*/ _jsx(Box, {
|
|
79
|
+
sx: {
|
|
80
|
+
padding: '8px'
|
|
81
|
+
},
|
|
82
|
+
children: /*#__PURE__*/ _jsxs(Box, {
|
|
83
|
+
sx: {
|
|
84
|
+
display: 'grid',
|
|
85
|
+
gridTemplateColumns: !time ? '1fr' : '8px minmax(160px, max-content) 1fr',
|
|
86
|
+
gap: '12px'
|
|
87
|
+
},
|
|
88
|
+
children: [
|
|
89
|
+
time && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
90
|
+
children: [
|
|
91
|
+
/*#__PURE__*/ _jsx(Box, {}),
|
|
92
|
+
/*#__PURE__*/ _jsx(Box, {})
|
|
93
|
+
]
|
|
94
|
+
}),
|
|
95
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
96
|
+
children: /*#__PURE__*/ _jsx(LogDetailsTable, {
|
|
97
|
+
log: log.labels
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
LogRow.displayName = 'LogRow';
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=LogRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/panels/logs/components/LogRow/LogRow.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 React, { memo, useCallback } from 'react';\nimport { Box, Collapse, useTheme } from '@mui/material';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport { LogTimestamp } from './LogTimestamp';\nimport { LogRowContainer, LogRowContent, ExpandButton, LogText } from './LogsStyles';\nimport { LogDetailsTable } from './LogDetailsTable';\nimport { LogEntry } from '../../../../model/click-house-data-types';\n\ninterface LogRowProps {\n log?: LogEntry;\n index: number;\n isExpanded: boolean;\n onToggle: (index: number) => void;\n isExpandable?: boolean;\n time?: boolean;\n wrap?: boolean;\n}\n\nexport const LogRow: React.FC<LogRowProps> = memo(\n ({ log, isExpanded, index, onToggle, isExpandable = true, time = false, wrap = false }) => {\n const theme = useTheme();\n const severityColor = theme.palette.text.secondary;\n\n const handleToggle = useCallback(() => {\n if (isExpandable) {\n onToggle(index);\n }\n }, [isExpandable, onToggle, index]);\n\n if (!log) return null;\n\n return (\n <LogRowContainer severityColor={severityColor}>\n <LogRowContent onClick={handleToggle} isExpandable={isExpandable} time={time}>\n {isExpandable && (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n width: '16px',\n justifyContent: 'center',\n }}\n >\n <ExpandButton size=\"small\" isExpanded={isExpanded}>\n <ChevronRight sx={{ fontSize: '12px' }} />\n </ExpandButton>\n </Box>\n )}\n\n <LogTimestamp timestamp={log?.timestamp} />\n\n <Box\n sx={{\n display: 'flex',\n gap: '10px',\n marginLeft: '36px',\n }}\n >\n <LogText variant=\"body2\" wrap={wrap}>\n {log?.line}\n </LogText>\n </Box>\n </LogRowContent>\n\n <Collapse in={isExpanded} timeout={200}>\n <Box sx={{ padding: '8px' }}>\n <Box\n sx={{\n display: 'grid',\n gridTemplateColumns: !time ? '1fr' : '8px minmax(160px, max-content) 1fr',\n gap: '12px',\n }}\n >\n {time && (\n <>\n <Box />\n <Box />\n </>\n )}\n <Box>\n <LogDetailsTable log={log.labels} />\n </Box>\n </Box>\n </Box>\n </Collapse>\n </LogRowContainer>\n );\n }\n);\n\nLogRow.displayName = 'LogRow';\n"],"names":["React","memo","useCallback","Box","Collapse","useTheme","ChevronRight","LogTimestamp","LogRowContainer","LogRowContent","ExpandButton","LogText","LogDetailsTable","LogRow","log","isExpanded","index","onToggle","isExpandable","time","wrap","theme","severityColor","palette","text","secondary","handleToggle","onClick","sx","display","alignItems","width","justifyContent","size","fontSize","timestamp","gap","marginLeft","variant","line","in","timeout","padding","gridTemplateColumns","labels","displayName"],"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,SAASC,IAAI,EAAEC,WAAW,QAAQ,QAAQ;AACjD,SAASC,GAAG,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,gBAAgB;AACxD,OAAOC,kBAAkB,+BAA+B;AACxD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,eAAe,EAAEC,aAAa,EAAEC,YAAY,EAAEC,OAAO,QAAQ,eAAe;AACrF,SAASC,eAAe,QAAQ,oBAAoB;AAapD,OAAO,MAAMC,uBAAgCZ,KAC3C,CAAC,EAAEa,GAAG,EAAEC,UAAU,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,eAAe,IAAI,EAAEC,OAAO,KAAK,EAAEC,OAAO,KAAK,EAAE;IACpF,MAAMC,QAAQhB;IACd,MAAMiB,gBAAgBD,MAAME,OAAO,CAACC,IAAI,CAACC,SAAS;IAElD,MAAMC,eAAexB,YAAY;QAC/B,IAAIgB,cAAc;YAChBD,SAASD;QACX;IACF,GAAG;QAACE;QAAcD;QAAUD;KAAM;IAElC,IAAI,CAACF,KAAK,OAAO;IAEjB,qBACE,MAACN;QAAgBc,eAAeA;;0BAC9B,MAACb;gBAAckB,SAASD;gBAAcR,cAAcA;gBAAcC,MAAMA;;oBACrED,8BACC,KAACf;wBACCyB,IAAI;4BACFC,SAAS;4BACTC,YAAY;4BACZC,OAAO;4BACPC,gBAAgB;wBAClB;kCAEA,cAAA,KAACtB;4BAAauB,MAAK;4BAAQlB,YAAYA;sCACrC,cAAA,KAACT;gCAAasB,IAAI;oCAAEM,UAAU;gCAAO;;;;kCAK3C,KAAC3B;wBAAa4B,WAAWrB,KAAKqB;;kCAE9B,KAAChC;wBACCyB,IAAI;4BACFC,SAAS;4BACTO,KAAK;4BACLC,YAAY;wBACd;kCAEA,cAAA,KAAC1B;4BAAQ2B,SAAQ;4BAAQlB,MAAMA;sCAC5BN,KAAKyB;;;;;0BAKZ,KAACnC;gBAASoC,IAAIzB;gBAAY0B,SAAS;0BACjC,cAAA,KAACtC;oBAAIyB,IAAI;wBAAEc,SAAS;oBAAM;8BACxB,cAAA,MAACvC;wBACCyB,IAAI;4BACFC,SAAS;4BACTc,qBAAqB,CAACxB,OAAO,QAAQ;4BACrCiB,KAAK;wBACP;;4BAECjB,sBACC;;kDACE,KAAChB;kDACD,KAACA;;;0CAGL,KAACA;0CACC,cAAA,KAACS;oCAAgBE,KAAKA,IAAI8B,MAAM;;;;;;;;;AAO9C,GACA;AAEF/B,OAAOgC,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogTimestamp.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/logs/components/LogRow/LogTimestamp.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAkBpD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 React from 'react';
|
|
15
|
+
import { Typography, useTheme } from '@mui/material';
|
|
16
|
+
export const LogTimestamp = ({ timestamp })=>{
|
|
17
|
+
const theme = useTheme();
|
|
18
|
+
const isDarkMode = theme.palette.mode === 'dark';
|
|
19
|
+
return /*#__PURE__*/ _jsx(Typography, {
|
|
20
|
+
variant: "caption",
|
|
21
|
+
sx: {
|
|
22
|
+
color: isDarkMode ? '#000000' : theme.palette.text.secondary,
|
|
23
|
+
fontSize: '12px',
|
|
24
|
+
whiteSpace: 'nowrap',
|
|
25
|
+
minWidth: 'max-content',
|
|
26
|
+
backgroundColor: '#FFF3E0'
|
|
27
|
+
},
|
|
28
|
+
children: timestamp
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=LogTimestamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/panels/logs/components/LogRow/LogTimestamp.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 React from 'react';\nimport { Typography, useTheme } from '@mui/material';\n\ninterface LogTimestampProps {\n timestamp: number;\n}\n\nexport const LogTimestamp: React.FC<LogTimestampProps> = ({ timestamp }) => {\n const theme = useTheme();\n const isDarkMode = theme.palette.mode === 'dark';\n\n return (\n <Typography\n variant=\"caption\"\n sx={{\n color: isDarkMode ? '#000000' : theme.palette.text.secondary,\n fontSize: '12px',\n whiteSpace: 'nowrap',\n minWidth: 'max-content',\n backgroundColor: '#FFF3E0',\n }}\n >\n {timestamp}\n </Typography>\n );\n};\n"],"names":["React","Typography","useTheme","LogTimestamp","timestamp","theme","isDarkMode","palette","mode","variant","sx","color","text","secondary","fontSize","whiteSpace","minWidth","backgroundColor"],"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,WAAW,QAAQ;AAC1B,SAASC,UAAU,EAAEC,QAAQ,QAAQ,gBAAgB;AAMrD,OAAO,MAAMC,eAA4C,CAAC,EAAEC,SAAS,EAAE;IACrE,MAAMC,QAAQH;IACd,MAAMI,aAAaD,MAAME,OAAO,CAACC,IAAI,KAAK;IAE1C,qBACE,KAACP;QACCQ,SAAQ;QACRC,IAAI;YACFC,OAAOL,aAAa,YAAYD,MAAME,OAAO,CAACK,IAAI,CAACC,SAAS;YAC5DC,UAAU;YACVC,YAAY;YACZC,UAAU;YACVC,iBAAiB;QACnB;kBAECb;;AAGP,EAAE"}
|