@terrestris/shogun-admin 16.1.0-next.1 → 17.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +74 -74
- package/dist/build/assets/App-BP74CNP_.js +0 -1258
- package/dist/build/assets/__federation_shared_react-CvClEUjg.js +0 -9
- package/dist/build/assets/__federation_shared_react-dom-BxqGBSTk.js +0 -24
- package/dist/build/assets/__federation_shared_react-i18next-MD_bYxcL.js +0 -1
- package/dist/build/assets/__federation_shared_react-router-dom-Vy7O6TNk.js +0 -2
- package/dist/build/assets/_commonjsHelpers-BosuxZz1.js +0 -1
- package/dist/build/assets/_virtual___federation_fn_import-PJHfB1tr.js +0 -1
- package/dist/build/assets/abap-DRC6TkPh.js +0 -6
- package/dist/build/assets/apex-BuapDI9Y.js +0 -6
- package/dist/build/assets/azcli-BypH-vXm.js +0 -6
- package/dist/build/assets/bat-BY6pwuIY.js +0 -6
- package/dist/build/assets/bicep-gRuQeaLk.js +0 -7
- package/dist/build/assets/cameligo-ul-Lp4lw.js +0 -6
- package/dist/build/assets/clojure-DeYg-96x.js +0 -6
- package/dist/build/assets/codicon-DCmgc-ay.ttf +0 -0
- package/dist/build/assets/coffee-CfnpWUYo.js +0 -6
- package/dist/build/assets/cpp-C9L3yaDO.js +0 -6
- package/dist/build/assets/csharp-DWGz5Zuj.js +0 -6
- package/dist/build/assets/csp-DrRCxMg5.js +0 -6
- package/dist/build/assets/css-BfLuTCmN.js +0 -8
- package/dist/build/assets/css.worker-BAJD-bzR.js +0 -83
- package/dist/build/assets/cssMode-Btzqpc23.js +0 -4
- package/dist/build/assets/cypher-DoFvH58O.js +0 -6
- package/dist/build/assets/dart-DIovg4uR.js +0 -6
- package/dist/build/assets/dockerfile-D2PfwrvU.js +0 -6
- package/dist/build/assets/ecl-C_scCXcs.js +0 -6
- package/dist/build/assets/editor.worker-MnaSPjGA.js +0 -11
- package/dist/build/assets/elixir-BRk-K-rg.js +0 -6
- package/dist/build/assets/favicon-CwZoocDV.ico +0 -0
- package/dist/build/assets/flow9-DLs3tTet.js +0 -6
- package/dist/build/assets/freemarker2-CoZuEXJi.js +0 -3
- package/dist/build/assets/fsharp-D0UiDa5C.js +0 -6
- package/dist/build/assets/go-CyVeKkvQ.js +0 -6
- package/dist/build/assets/graphql-BygKL3ZF.js +0 -6
- package/dist/build/assets/handlebars-BQ2vXFqT.js +0 -1
- package/dist/build/assets/hcl-D_OY6ada.js +0 -6
- package/dist/build/assets/html-S9BExIX4.js +0 -1
- package/dist/build/assets/html.worker-Bp7pNElH.js +0 -460
- package/dist/build/assets/htmlMode-D6oh_W-n.js +0 -4
- package/dist/build/assets/index-D5X_Cuhy.js +0 -139
- package/dist/build/assets/ini-BTpWsGps.js +0 -6
- package/dist/build/assets/java-3TATJI7h.js +0 -6
- package/dist/build/assets/javascript-C_BsKwTq.js +0 -1
- package/dist/build/assets/json.worker-BfIkrIax.js +0 -48
- package/dist/build/assets/jsonMode-CFQnTUoH.js +0 -10
- package/dist/build/assets/julia-DDpSJMW6.js +0 -6
- package/dist/build/assets/kotlin-DVYH6Lj_.js +0 -6
- package/dist/build/assets/less-CuFlys0T.js +0 -7
- package/dist/build/assets/lexon-m09vb5r-.js +0 -6
- package/dist/build/assets/liquid-CsJvQ-Gd.js +0 -1
- package/dist/build/assets/lua-D2Z7JJdl.js +0 -6
- package/dist/build/assets/m3-B2Cf9XSq.js +0 -6
- package/dist/build/assets/markdown-BXYnMxBe.js +0 -6
- package/dist/build/assets/mdx-CcsV6KQM.js +0 -1
- package/dist/build/assets/mips-Ckkbw-AO.js +0 -6
- package/dist/build/assets/msdax-B5uW3Zvf.js +0 -6
- package/dist/build/assets/mysql-B8ssZoUh.js +0 -6
- package/dist/build/assets/objective-c-CrrKwR0a.js +0 -6
- package/dist/build/assets/pascal-BWBTHuhh.js +0 -6
- package/dist/build/assets/pascaligo-BGLI1Hdo.js +0 -6
- package/dist/build/assets/perl-DDrv2Hr-.js +0 -6
- package/dist/build/assets/pgsql-DLPipH_Q.js +0 -6
- package/dist/build/assets/php-CTNlIIiR.js +0 -6
- package/dist/build/assets/pla-2oJWbEOo.js +0 -6
- package/dist/build/assets/postiats-DOk3G3cc.js +0 -6
- package/dist/build/assets/powerquery-Dgyr3wWZ.js +0 -6
- package/dist/build/assets/powershell-B_i9asfM.js +0 -6
- package/dist/build/assets/protobuf-CV9EbfTh.js +0 -7
- package/dist/build/assets/pug-CCBS_C5_.js +0 -6
- package/dist/build/assets/python-BNsLUA-F.js +0 -1
- package/dist/build/assets/qsharp-BLuZWbUW.js +0 -6
- package/dist/build/assets/r-CzF1MCbP.js +0 -6
- package/dist/build/assets/razor-CwLyy1uA.js +0 -1
- package/dist/build/assets/redis-C75U4IDy.js +0 -6
- package/dist/build/assets/redshift-Bc5xkKR1.js +0 -6
- package/dist/build/assets/restructuredtext-DmdQbaLT.js +0 -6
- package/dist/build/assets/ruby-DB0RB20n.js +0 -6
- package/dist/build/assets/rust-UMmp-gVE.js +0 -6
- package/dist/build/assets/sb-DVG02705.js +0 -6
- package/dist/build/assets/scala-DvSxYeG4.js +0 -6
- package/dist/build/assets/scheme-yf5bffbF.js +0 -6
- package/dist/build/assets/scss-Bzb7OGdO.js +0 -8
- package/dist/build/assets/shell-FNqbgIOG.js +0 -6
- package/dist/build/assets/shogun-spinner-BmOUi9Ar.gif +0 -0
- package/dist/build/assets/shogun_logo-B9ohJOpL.png +0 -0
- package/dist/build/assets/solidity-DyKutqhl.js +0 -6
- package/dist/build/assets/sophia-B4VqtPa2.js +0 -6
- package/dist/build/assets/sparql-B7alP455.js +0 -6
- package/dist/build/assets/sql-D7lU1fdU.js +0 -6
- package/dist/build/assets/st-VuadG5SK.js +0 -6
- package/dist/build/assets/style-CJpWC7V3.css +0 -1
- package/dist/build/assets/swift-BYtUz8ZP.js +0 -8
- package/dist/build/assets/systemverilog-DOAuugfS.js +0 -6
- package/dist/build/assets/tcl-CXKOl_mN.js +0 -6
- package/dist/build/assets/ts.worker-BBBnYv8q.js +0 -51333
- package/dist/build/assets/tsMode-meseu6bK.js +0 -11
- package/dist/build/assets/twig-D9yiNO04.js +0 -6
- package/dist/build/assets/typescript-BuOvk1sq.js +0 -1
- package/dist/build/assets/typespec-BupSXVCO.js +0 -6
- package/dist/build/assets/vb-ZlaFEk-P.js +0 -6
- package/dist/build/assets/wgsl-DrbANKle.js +0 -303
- package/dist/build/assets/xml-BXx9C-xA.js +0 -1
- package/dist/build/assets/yaml-CuMedh6B.js +0 -1
- package/dist/build/index.html +0 -24
- package/dist/lib/App.d.ts +0 -4
- package/dist/lib/App.js +0 -122
- package/dist/lib/Component/Dashboard/Dashboard.d.ts +0 -12
- package/dist/lib/Component/Dashboard/Dashboard.js +0 -10
- package/dist/lib/Component/Dashboard/DashboardCard/DashboardCard.d.ts +0 -13
- package/dist/lib/Component/Dashboard/DashboardCard/DashboardCard.js +0 -7
- package/dist/lib/Component/Dashboard/DashboardStatistics/DashboardStatistics.d.ts +0 -15
- package/dist/lib/Component/Dashboard/DashboardStatistics/DashboardStatistics.js +0 -30
- package/dist/lib/Component/EvictCache/EvictCache.d.ts +0 -6
- package/dist/lib/Component/EvictCache/EvictCache.js +0 -28
- package/dist/lib/Component/FormField/DisplayField/DisplayField.d.ts +0 -13
- package/dist/lib/Component/FormField/DisplayField/DisplayField.js +0 -32
- package/dist/lib/Component/FormField/JSONEditor/JSONEditor.d.ts +0 -13
- package/dist/lib/Component/FormField/JSONEditor/JSONEditor.js +0 -90
- package/dist/lib/Component/FormField/JSONEditor/UserWorker.d.ts +0 -1
- package/dist/lib/Component/FormField/JSONEditor/UserWorker.js +0 -26
- package/dist/lib/Component/FormField/LinkField/LinkField.d.ts +0 -11
- package/dist/lib/Component/FormField/LinkField/LinkField.js +0 -15
- package/dist/lib/Component/FormField/MarkdownEditor/MarkdownEditor.d.ts +0 -10
- package/dist/lib/Component/FormField/MarkdownEditor/MarkdownEditor.js +0 -23
- package/dist/lib/Component/FormField/Permission/GroupPermissionGrid/GroupPermissionGrid.d.ts +0 -7
- package/dist/lib/Component/FormField/Permission/GroupPermissionGrid/GroupPermissionGrid.js +0 -73
- package/dist/lib/Component/FormField/Permission/InstancePermissionGrid/InstancePermissionGrid.d.ts +0 -30
- package/dist/lib/Component/FormField/Permission/InstancePermissionGrid/InstancePermissionGrid.js +0 -151
- package/dist/lib/Component/FormField/Permission/PermissionModal/PermissionModal.d.ts +0 -28
- package/dist/lib/Component/FormField/Permission/PermissionModal/PermissionModal.js +0 -103
- package/dist/lib/Component/FormField/Permission/PermissionSelect/PermissionSelect.d.ts +0 -6
- package/dist/lib/Component/FormField/Permission/PermissionSelect/PermissionSelect.js +0 -21
- package/dist/lib/Component/FormField/Permission/RolePermissionGrid/RolePermissionGrid.d.ts +0 -7
- package/dist/lib/Component/FormField/Permission/RolePermissionGrid/RolePermissionGrid.js +0 -81
- package/dist/lib/Component/FormField/Permission/UserPermissionGrid/UserPermissionGrid.d.ts +0 -8
- package/dist/lib/Component/FormField/Permission/UserPermissionGrid/UserPermissionGrid.js +0 -87
- package/dist/lib/Component/FormField/VerifyProviderDetailsField/VerifyProviderDetailsField.d.ts +0 -13
- package/dist/lib/Component/FormField/VerifyProviderDetailsField/VerifyProviderDetailsField.js +0 -14
- package/dist/lib/Component/FormField/YesOrNoField/YesOrNoField.d.ts +0 -8
- package/dist/lib/Component/FormField/YesOrNoField/YesOrNoField.js +0 -10
- package/dist/lib/Component/FullscreenWrapper/FullscreenWrapper.d.ts +0 -4
- package/dist/lib/Component/FullscreenWrapper/FullscreenWrapper.js +0 -48
- package/dist/lib/Component/GeneralEntity/GeneralEntityForm/GeneralEntityForm.d.ts +0 -43
- package/dist/lib/Component/GeneralEntity/GeneralEntityForm/GeneralEntityForm.js +0 -145
- package/dist/lib/Component/GeneralEntity/GeneralEntityRoot/GeneralEntityRoot.d.ts +0 -22
- package/dist/lib/Component/GeneralEntity/GeneralEntityRoot/GeneralEntityRoot.js +0 -527
- package/dist/lib/Component/GeneralEntity/GeneralEntityTable/GeneralEntityTable.d.ts +0 -46
- package/dist/lib/Component/GeneralEntity/GeneralEntityTable/GeneralEntityTable.js +0 -179
- package/dist/lib/Component/GlobalSettings/GlobalSettingsRoot/GlobalSettingsRoot.d.ts +0 -5
- package/dist/lib/Component/GlobalSettings/GlobalSettingsRoot/GlobalSettingsRoot.js +0 -15
- package/dist/lib/Component/Header/Header.d.ts +0 -8
- package/dist/lib/Component/Header/Header.js +0 -16
- package/dist/lib/Component/ImageFile/ImageFileForm/ImageFileForm.d.ts +0 -7
- package/dist/lib/Component/ImageFile/ImageFileForm/ImageFileForm.js +0 -94
- package/dist/lib/Component/ImageFile/ImageFileRoot/ImageFileRoot.d.ts +0 -7
- package/dist/lib/Component/ImageFile/ImageFileRoot/ImageFileRoot.js +0 -44
- package/dist/lib/Component/ImageFile/ImageFileTable/ImageFileTable.d.ts +0 -9
- package/dist/lib/Component/ImageFile/ImageFileTable/ImageFileTable.js +0 -157
- package/dist/lib/Component/LanguageSelector/index.d.ts +0 -4
- package/dist/lib/Component/LanguageSelector/index.js +0 -15
- package/dist/lib/Component/Layer/LayerTypeSelect/LayerTypeSelect.d.ts +0 -11
- package/dist/lib/Component/Layer/LayerTypeSelect/LayerTypeSelect.js +0 -33
- package/dist/lib/Component/LayerPreview/LayerPreview.d.ts +0 -9
- package/dist/lib/Component/LayerPreview/LayerPreview.js +0 -159
- package/dist/lib/Component/LayerPreview/MapComponent/MapComponent.d.ts +0 -10
- package/dist/lib/Component/LayerPreview/MapComponent/MapComponent.js +0 -22
- package/dist/lib/Component/LogSettings/LogLevelSelect/LogLevelSelect.d.ts +0 -7
- package/dist/lib/Component/LogSettings/LogLevelSelect/LogLevelSelect.js +0 -20
- package/dist/lib/Component/LogSettings/LogLevelTable/LogLevelTable.d.ts +0 -12
- package/dist/lib/Component/LogSettings/LogLevelTable/LogLevelTable.js +0 -73
- package/dist/lib/Component/LogSettings/LogSettingsRoot/LogSettingsRoot.d.ts +0 -4
- package/dist/lib/Component/LogSettings/LogSettingsRoot/LogSettingsRoot.js +0 -11
- package/dist/lib/Component/Logs/Logs.d.ts +0 -5
- package/dist/lib/Component/Logs/Logs.js +0 -58
- package/dist/lib/Component/Menu/Navigation/Navigation.d.ts +0 -10
- package/dist/lib/Component/Menu/Navigation/Navigation.js +0 -96
- package/dist/lib/Component/Menu/User/User.d.ts +0 -7
- package/dist/lib/Component/Menu/User/User.js +0 -91
- package/dist/lib/Component/Metrics/JdbcConnectionsActive/JdbcConnectionsActive.d.ts +0 -6
- package/dist/lib/Component/Metrics/JdbcConnectionsActive/JdbcConnectionsActive.js +0 -7
- package/dist/lib/Component/Metrics/JvmMemoryUsed/JvmMemoryUsed.d.ts +0 -6
- package/dist/lib/Component/Metrics/JvmMemoryUsed/JvmMemoryUsed.js +0 -13
- package/dist/lib/Component/Metrics/JvmThreadsLive/JvmThreadsLive.d.ts +0 -6
- package/dist/lib/Component/Metrics/JvmThreadsLive/JvmThreadsLive.js +0 -7
- package/dist/lib/Component/Metrics/MetricEntry/MetricEntry.d.ts +0 -13
- package/dist/lib/Component/Metrics/MetricEntry/MetricEntry.js +0 -54
- package/dist/lib/Component/Metrics/MetricsRoot/MetricsRoot.d.ts +0 -12
- package/dist/lib/Component/Metrics/MetricsRoot/MetricsRoot.js +0 -28
- package/dist/lib/Component/Metrics/ProcessCpuUsage/ProcessCpuUsage.d.ts +0 -6
- package/dist/lib/Component/Metrics/ProcessCpuUsage/ProcessCpuUsage.js +0 -7
- package/dist/lib/Component/Metrics/ProcessStartTime/ProcessStartTime.d.ts +0 -6
- package/dist/lib/Component/Metrics/ProcessStartTime/ProcessStartTime.js +0 -12
- package/dist/lib/Component/Metrics/ProcessUptime/ProcessUptime.d.ts +0 -6
- package/dist/lib/Component/Metrics/ProcessUptime/ProcessUptime.js +0 -15
- package/dist/lib/Component/Metrics/SystemCpuCount/SystemCpuCount.d.ts +0 -6
- package/dist/lib/Component/Metrics/SystemCpuCount/SystemCpuCount.js +0 -7
- package/dist/lib/Component/Metrics/SystemCpuUsage/SystemCpuUsage.d.ts +0 -6
- package/dist/lib/Component/Metrics/SystemCpuUsage/SystemCpuUsage.js +0 -7
- package/dist/lib/Component/Metrics/SystemLoadAverage/SystemLoadAverage.d.ts +0 -6
- package/dist/lib/Component/Metrics/SystemLoadAverage/SystemLoadAverage.js +0 -7
- package/dist/lib/Component/Modal/ApplicationInfo/ApplicationInfo.d.ts +0 -7
- package/dist/lib/Component/Modal/ApplicationInfo/ApplicationInfo.js +0 -18
- package/dist/lib/Component/ShogunSpinner/ShogunSpinner.d.ts +0 -5
- package/dist/lib/Component/ShogunSpinner/ShogunSpinner.js +0 -7
- package/dist/lib/Component/UserAvatar/UserAvatar.d.ts +0 -9
- package/dist/lib/Component/UserAvatar/UserAvatar.js +0 -13
- package/dist/lib/Component/WelcomeDashboard/WelcomeDashboard.d.ts +0 -5
- package/dist/lib/Component/WelcomeDashboard/WelcomeDashboard.js +0 -35
- package/dist/lib/Context/PluginContext.d.ts +0 -9
- package/dist/lib/Context/PluginContext.js +0 -7
- package/dist/lib/Context/SHOGunAPIClientContext.d.ts +0 -9
- package/dist/lib/Context/SHOGunAPIClientContext.js +0 -7
- package/dist/lib/Controller/ControllerUtil.d.ts +0 -27
- package/dist/lib/Controller/ControllerUtil.js +0 -60
- package/dist/lib/Controller/GenericEntityController.d.ts +0 -169
- package/dist/lib/Controller/GenericEntityController.js +0 -368
- package/dist/lib/Hooks/useClientVersion.d.ts +0 -1
- package/dist/lib/Hooks/useClientVersion.js +0 -3
- package/dist/lib/Hooks/usePlugins.d.ts +0 -3
- package/dist/lib/Hooks/usePlugins.js +0 -6
- package/dist/lib/Hooks/useSHOGunAPIClient.d.ts +0 -3
- package/dist/lib/Hooks/useSHOGunAPIClient.js +0 -6
- package/dist/lib/Logger.d.ts +0 -2
- package/dist/lib/Logger.js +0 -23
- package/dist/lib/Page/Portal/Portal.d.ts +0 -7
- package/dist/lib/Page/Portal/Portal.js +0 -74
- package/dist/lib/Service/GenericServiceImpl/GenericServiceImpl.d.ts +0 -5
- package/dist/lib/Service/GenericServiceImpl/GenericServiceImpl.js +0 -7
- package/dist/lib/Service/LogService/LogService.d.ts +0 -18
- package/dist/lib/Service/LogService/LogService.js +0 -79
- package/dist/lib/Service/MetricService/MetricService.d.ts +0 -26
- package/dist/lib/Service/MetricService/MetricService.js +0 -25
- package/dist/lib/State/atoms.d.ts +0 -7
- package/dist/lib/State/atoms.js +0 -25
- package/dist/lib/State/static.d.ts +0 -3
- package/dist/lib/State/static.js +0 -10
- package/dist/lib/Util/FileUtil.d.ts +0 -3
- package/dist/lib/Util/FileUtil.js +0 -10
- package/dist/lib/Util/JsonUtil.d.ts +0 -11
- package/dist/lib/Util/JsonUtil.js +0 -22
- package/dist/lib/Util/OpenAPIUtil.d.ts +0 -25
- package/dist/lib/Util/OpenAPIUtil.js +0 -230
- package/dist/lib/Util/TableUtil.d.ts +0 -14
- package/dist/lib/Util/TableUtil.js +0 -71
- package/dist/lib/Util/TranslationUtil.d.ts +0 -3
- package/dist/lib/Util/TranslationUtil.js +0 -23
- package/dist/lib/Util/UserUtil.d.ts +0 -22
- package/dist/lib/Util/UserUtil.js +0 -32
- package/dist/lib/i18n/index.d.ts +0 -2
- package/dist/lib/i18n/index.js +0 -17
- package/dist/lib/i18n/translations.d.ts +0 -508
- package/dist/lib/i18n/translations.js +0 -512
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.js +0 -172
- package/dist/lib/plugin/index.d.ts +0 -58
- package/dist/lib/plugin/index.js +0 -3
- package/dist/lib/test-util.d.ts +0 -6
- package/dist/lib/test-util.js +0 -16
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import './LayerPreview.less';
|
|
3
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
|
-
import { GlobalOutlined } from '@ant-design/icons';
|
|
5
|
-
import { Alert, Modal, Spin, Tooltip } from 'antd';
|
|
6
|
-
import Logger from 'js-logger';
|
|
7
|
-
import _isNil from 'lodash/isNil';
|
|
8
|
-
import OlLayerTile from 'ol/layer/Tile';
|
|
9
|
-
import OlMap from 'ol/Map';
|
|
10
|
-
import { transformExtent } from 'ol/proj';
|
|
11
|
-
import OlSourceImage from 'ol/source/Image';
|
|
12
|
-
import OlSourceImageWMS from 'ol/source/ImageWMS';
|
|
13
|
-
import OlSourceOSM from 'ol/source/OSM';
|
|
14
|
-
import OlSourceTileImage from 'ol/source/TileImage';
|
|
15
|
-
import OlSourceTileWMS from 'ol/source/TileWMS';
|
|
16
|
-
import OlSourceVector from 'ol/source/Vector';
|
|
17
|
-
import OlView from 'ol/View';
|
|
18
|
-
import { useTranslation } from 'react-i18next';
|
|
19
|
-
import LayerUtil from '@terrestris/ol-util/dist/LayerUtil/LayerUtil';
|
|
20
|
-
import SHOGunApplicationUtil from '@terrestris/shogun-util/dist/parser/SHOGunApplicationUtil';
|
|
21
|
-
import { getBearerTokenHeader } from '@terrestris/shogun-util/dist/security/getBearerTokenHeader';
|
|
22
|
-
import useSHOGunAPIClient from '../../Hooks/useSHOGunAPIClient';
|
|
23
|
-
import MapComponent from './MapComponent/MapComponent';
|
|
24
|
-
function isWmsLayer(layer) {
|
|
25
|
-
if (_isNil(layer)) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
const source = layer.getSource();
|
|
29
|
-
return source instanceof OlSourceImageWMS || source instanceof OlSourceTileWMS;
|
|
30
|
-
}
|
|
31
|
-
export const LayerPreview = ({ layer, ...passThroughProps }) => {
|
|
32
|
-
const [loading, setLoading] = useState(false);
|
|
33
|
-
const [addLayerError, setAddLayerError] = useState();
|
|
34
|
-
const [extentError, setExtentError] = useState();
|
|
35
|
-
const [loadLayerError, setLoadLayerError] = useState();
|
|
36
|
-
const [visible, setVisible] = useState(false);
|
|
37
|
-
const { t } = useTranslation();
|
|
38
|
-
const client = useSHOGunAPIClient();
|
|
39
|
-
const parser = useMemo(() => {
|
|
40
|
-
return new SHOGunApplicationUtil({
|
|
41
|
-
client: client
|
|
42
|
-
});
|
|
43
|
-
}, [client]);
|
|
44
|
-
const map = useMemo(() => {
|
|
45
|
-
return new OlMap({
|
|
46
|
-
layers: [
|
|
47
|
-
new OlLayerTile({
|
|
48
|
-
source: new OlSourceOSM()
|
|
49
|
-
})
|
|
50
|
-
],
|
|
51
|
-
target: '',
|
|
52
|
-
view: new OlView({
|
|
53
|
-
center: [0, 0],
|
|
54
|
-
zoom: 0
|
|
55
|
-
})
|
|
56
|
-
});
|
|
57
|
-
}, []);
|
|
58
|
-
const addLayer = useCallback(async () => {
|
|
59
|
-
if (!layer) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
try {
|
|
63
|
-
const olLayer = await parser.parseLayer(layer);
|
|
64
|
-
const layers = map.getAllLayers();
|
|
65
|
-
layers
|
|
66
|
-
.filter(l => l.get('shogunId') === layer.id)
|
|
67
|
-
.forEach(l => map.removeLayer(l));
|
|
68
|
-
if (_isNil(olLayer)) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const source = olLayer.getSource();
|
|
72
|
-
if (_isNil(source)) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (source instanceof OlSourceImage) {
|
|
76
|
-
const imageSource = source;
|
|
77
|
-
imageSource.on('imageloaderror', () => {
|
|
78
|
-
setLoadLayerError(t('LayerPreview.loadLayerErrorMsg'));
|
|
79
|
-
});
|
|
80
|
-
imageSource.on('imageloadend', () => setLoadLayerError(undefined));
|
|
81
|
-
}
|
|
82
|
-
if (source instanceof OlSourceTileImage) {
|
|
83
|
-
const tileImageSource = source;
|
|
84
|
-
tileImageSource.on('tileloaderror', () => {
|
|
85
|
-
setLoadLayerError(t('LayerPreview.loadLayerErrorMsg'));
|
|
86
|
-
});
|
|
87
|
-
tileImageSource.on('tileloadend', () => setLoadLayerError(undefined));
|
|
88
|
-
}
|
|
89
|
-
if (source instanceof OlSourceVector) {
|
|
90
|
-
const vectorSource = source;
|
|
91
|
-
vectorSource.on('featuresloaderror', () => {
|
|
92
|
-
setLoadLayerError(t('LayerPreview.loadLayerErrorMsg'));
|
|
93
|
-
});
|
|
94
|
-
vectorSource.on('featuresloadend', () => setLoadLayerError(undefined));
|
|
95
|
-
}
|
|
96
|
-
// @ts-ignore
|
|
97
|
-
map.addLayer(olLayer);
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
Logger.error(e);
|
|
101
|
-
setAddLayerError(t('LayerPreview.addLayerErrorMsg'));
|
|
102
|
-
}
|
|
103
|
-
}, [map, layer, parser, t]);
|
|
104
|
-
const zoomToLayer = useCallback(async () => {
|
|
105
|
-
try {
|
|
106
|
-
setLoading(true);
|
|
107
|
-
const olLayer = map.getAllLayers()
|
|
108
|
-
.find(l => l.get('shogunId') === layer.id);
|
|
109
|
-
if (isWmsLayer(olLayer)) {
|
|
110
|
-
let extent = await LayerUtil.getExtentForLayer(olLayer, {
|
|
111
|
-
headers: olLayer.get('useBearerToken') ? {
|
|
112
|
-
...getBearerTokenHeader(client?.getKeycloak())
|
|
113
|
-
} : {}
|
|
114
|
-
});
|
|
115
|
-
extent = transformExtent(extent, 'EPSG:4326', map.getView().getProjection());
|
|
116
|
-
map.getView().fit(extent);
|
|
117
|
-
}
|
|
118
|
-
else if (olLayer?.getSource() instanceof OlSourceVector) {
|
|
119
|
-
const source = olLayer.getSource();
|
|
120
|
-
source.on('addfeature', () => {
|
|
121
|
-
map.getView().fit(source.getExtent());
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
setExtentError(t('LayerPreview.extentNotSupportedErrorMsg'));
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
catch (e) {
|
|
129
|
-
Logger.error(e);
|
|
130
|
-
setExtentError(t('LayerPreview.extentErrorMsg'));
|
|
131
|
-
}
|
|
132
|
-
finally {
|
|
133
|
-
setLoading(false);
|
|
134
|
-
}
|
|
135
|
-
}, [map, layer, client, t]);
|
|
136
|
-
useEffect(() => {
|
|
137
|
-
setAddLayerError(undefined);
|
|
138
|
-
setExtentError(undefined);
|
|
139
|
-
}, [layer]);
|
|
140
|
-
useEffect(() => {
|
|
141
|
-
addLayer();
|
|
142
|
-
}, [addLayer]);
|
|
143
|
-
const onClick = () => {
|
|
144
|
-
setVisible(true);
|
|
145
|
-
};
|
|
146
|
-
const onCancel = () => {
|
|
147
|
-
setVisible(false);
|
|
148
|
-
};
|
|
149
|
-
return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: t('LayerPreview.tooltipTitle'), children: _jsx(GlobalOutlined, { className: "layer-preview-button", onClick: onClick }) }), _jsxs(Modal, { className: "layer-preview-modal", title: t('LayerPreview.title', {
|
|
150
|
-
layerName: layer.name
|
|
151
|
-
}), open: visible, onCancel: onCancel, footer: false, ...passThroughProps, children: [(addLayerError || extentError || loadLayerError) && (_jsx(Alert, { message: _jsx("ul", { children: [
|
|
152
|
-
addLayerError,
|
|
153
|
-
extentError,
|
|
154
|
-
loadLayerError
|
|
155
|
-
]
|
|
156
|
-
.filter(error => !!error)
|
|
157
|
-
.map(error => _jsx("li", { children: error }, error)) }), type: "warning", showIcon: true })), _jsx(Spin, { spinning: loading, children: _jsx(MapComponent, { id: "preview-map", map: map, onRender: zoomToLayer }) })] })] }));
|
|
158
|
-
};
|
|
159
|
-
export default LayerPreview;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import './MapComponent.less';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import OlMap from 'ol/Map';
|
|
4
|
-
export interface MapComponentProps extends React.ComponentProps<'div'> {
|
|
5
|
-
map: OlMap;
|
|
6
|
-
mapDivId?: string;
|
|
7
|
-
onRender?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const MapComponent: React.FC<MapComponentProps>;
|
|
10
|
-
export default MapComponent;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import './MapComponent.less';
|
|
3
|
-
import { useCallback } from 'react';
|
|
4
|
-
export const MapComponent = ({ map, mapDivId = 'map', onRender = () => { }, ...passThroughProps }) => {
|
|
5
|
-
const refCallback = useCallback((ref) => {
|
|
6
|
-
if (!map) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (ref === null) {
|
|
10
|
-
map.setTarget(undefined);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
map.setTarget(ref);
|
|
14
|
-
}
|
|
15
|
-
onRender();
|
|
16
|
-
}, [map, onRender]);
|
|
17
|
-
if (!map) {
|
|
18
|
-
return _jsx(_Fragment, {});
|
|
19
|
-
}
|
|
20
|
-
return (_jsx("div", { id: mapDivId, ref: refCallback, className: "map", role: "presentation", ...passThroughProps }));
|
|
21
|
-
};
|
|
22
|
-
export default MapComponent;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SelectProps } from 'antd/lib/select';
|
|
3
|
-
import { LogLevel } from '../../../Service/LogService/LogService';
|
|
4
|
-
export interface LogLevelSelectProps extends SelectProps<LogLevel> {
|
|
5
|
-
}
|
|
6
|
-
export declare const LogLevelSelect: React.FC<LogLevelSelectProps>;
|
|
7
|
-
export default LogLevelSelect;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Select } from 'antd';
|
|
3
|
-
const { Option } = Select;
|
|
4
|
-
const logLevels = [
|
|
5
|
-
'OFF',
|
|
6
|
-
'FATAL',
|
|
7
|
-
'ERROR',
|
|
8
|
-
'WARN',
|
|
9
|
-
'INFO',
|
|
10
|
-
'DEBUG',
|
|
11
|
-
'TRACE'
|
|
12
|
-
];
|
|
13
|
-
;
|
|
14
|
-
export const LogLevelSelect = props => {
|
|
15
|
-
const options = logLevels.map((logLevel, i) => {
|
|
16
|
-
return (_jsx(Option, { value: `${logLevel}`, children: logLevel }, i));
|
|
17
|
-
});
|
|
18
|
-
return (_jsx(Select, { ...props, children: options }));
|
|
19
|
-
};
|
|
20
|
-
export default LogLevelSelect;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TableProps } from 'antd/lib/table';
|
|
3
|
-
import { LogLevel } from '../../../Service/LogService/LogService';
|
|
4
|
-
interface TableData {
|
|
5
|
-
key: number;
|
|
6
|
-
name: string;
|
|
7
|
-
level: LogLevel;
|
|
8
|
-
}
|
|
9
|
-
interface LogLevelTableProps extends Omit<TableProps<TableData>, 'loading' | 'columns' | 'dataSource'> {
|
|
10
|
-
}
|
|
11
|
-
export declare const LogLevelTable: React.FC<LogLevelTableProps>;
|
|
12
|
-
export default LogLevelTable;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { Input, message, Table } from 'antd';
|
|
4
|
-
import _get from 'lodash/get';
|
|
5
|
-
import _isNil from 'lodash/isNil';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import useSHOGunAPIClient from '../../../Hooks/useSHOGunAPIClient';
|
|
8
|
-
import LogService from '../../../Service/LogService/LogService';
|
|
9
|
-
import LogLevelSelect from '../LogLevelSelect/LogLevelSelect';
|
|
10
|
-
export const LogLevelTable = props => {
|
|
11
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
12
|
-
const [data, setData] = useState([]);
|
|
13
|
-
const [filteredData, setFilteredData] = useState([]);
|
|
14
|
-
const client = useSHOGunAPIClient();
|
|
15
|
-
const { t } = useTranslation();
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const fetchLoggers = async () => {
|
|
18
|
-
setIsLoading(true);
|
|
19
|
-
const logService = new LogService({
|
|
20
|
-
keycloak: client?.getKeycloak()
|
|
21
|
-
});
|
|
22
|
-
const loggers = await logService.getLoggers();
|
|
23
|
-
const tableData = Object.keys(loggers)
|
|
24
|
-
.filter(l => l.split('.').length === 2 || l === 'org.springframework.security')
|
|
25
|
-
.filter(l => !l.startsWith('_'))
|
|
26
|
-
.map((loggerName, i) => ({
|
|
27
|
-
key: i,
|
|
28
|
-
name: loggerName,
|
|
29
|
-
level: loggers[loggerName].effectiveLevel
|
|
30
|
-
}));
|
|
31
|
-
setData(tableData);
|
|
32
|
-
setIsLoading(false);
|
|
33
|
-
};
|
|
34
|
-
fetchLoggers();
|
|
35
|
-
}, [client]);
|
|
36
|
-
const columns = [{
|
|
37
|
-
title: t('LogSettings.tableName'),
|
|
38
|
-
dataIndex: 'name',
|
|
39
|
-
key: 'name',
|
|
40
|
-
}, {
|
|
41
|
-
title: t('LogSettings.tableLevel'),
|
|
42
|
-
dataIndex: 'level',
|
|
43
|
-
key: 'level',
|
|
44
|
-
render: (level, record) => (_jsx(LogLevelSelect, { style: {
|
|
45
|
-
width: '100%'
|
|
46
|
-
}, defaultValue: level, onChange: (lvl) => {
|
|
47
|
-
onLoggerChange(lvl, record);
|
|
48
|
-
} }))
|
|
49
|
-
}];
|
|
50
|
-
const onLoggerChange = async (level, record) => {
|
|
51
|
-
const logService = new LogService({
|
|
52
|
-
keycloak: client?.getKeycloak()
|
|
53
|
-
});
|
|
54
|
-
const success = await logService.setLogger(record.name, level);
|
|
55
|
-
if (success) {
|
|
56
|
-
message.success('Successfully set log level');
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
message.error('Could not set log level');
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const search = (searchValue) => {
|
|
63
|
-
const filtered = data.filter(o => Object.keys(o).some(k => String(_get(o, k))
|
|
64
|
-
.toLowerCase()
|
|
65
|
-
.includes(searchValue.toLowerCase())));
|
|
66
|
-
setFilteredData(filtered);
|
|
67
|
-
};
|
|
68
|
-
if (_isNil(client)) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
return (_jsxs(_Fragment, { children: [_jsx(Input.Search, { style: { margin: '0 0 10px 0' }, placeholder: t('LogSettings.searchPlaceholder'), enterButton: true, onSearch: search }), _jsx(Table, { loading: isLoading, columns: columns, dataSource: filteredData.length === 0 ? data : filteredData, ...props })] }));
|
|
72
|
-
};
|
|
73
|
-
export default LogLevelTable;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { PageHeader } from '@ant-design/pro-components';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { useNavigate } from 'react-router-dom';
|
|
5
|
-
import LogLevelTable from '../LogLevelTable/LogLevelTable';
|
|
6
|
-
export const LogSettingsRoot = (props) => {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
const navigate = useNavigate();
|
|
9
|
-
return (_jsxs("div", { className: "log-root", children: [_jsx(PageHeader, { className: "header", onBack: () => navigate(-1), title: t('LogSettings.logs'), subTitle: t('LogSettings.logsInfo') }), _jsx(LogLevelTable, {})] }));
|
|
10
|
-
};
|
|
11
|
-
export default LogSettingsRoot;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { PageHeader } from '@ant-design/pro-components';
|
|
4
|
-
import { Alert, Button, Form, Switch } from 'antd';
|
|
5
|
-
import _isNil from 'lodash/isNil';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useNavigate } from 'react-router-dom';
|
|
8
|
-
import useSHOGunAPIClient from '../../Hooks/useSHOGunAPIClient';
|
|
9
|
-
import LogService from '../../Service/LogService/LogService';
|
|
10
|
-
import './Logs.less';
|
|
11
|
-
export const Logs = () => {
|
|
12
|
-
const [logs, setLogs] = useState();
|
|
13
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
14
|
-
const [error, setError] = useState(false);
|
|
15
|
-
const client = useSHOGunAPIClient();
|
|
16
|
-
const intervalTimer = useRef();
|
|
17
|
-
const navigate = useNavigate();
|
|
18
|
-
const { t } = useTranslation();
|
|
19
|
-
const onChange = (checked) => {
|
|
20
|
-
if (checked) {
|
|
21
|
-
if (!intervalTimer.current) {
|
|
22
|
-
intervalTimer.current = setInterval(fetchLogs, 1000);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
clearInterval(intervalTimer?.current);
|
|
27
|
-
intervalTimer.current = undefined;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const fetchLogs = useCallback(async () => {
|
|
31
|
-
try {
|
|
32
|
-
setIsLoading(true);
|
|
33
|
-
setError(false);
|
|
34
|
-
const logService = new LogService({
|
|
35
|
-
keycloak: client?.getKeycloak()
|
|
36
|
-
});
|
|
37
|
-
const fetchedLogs = await logService.getLogs();
|
|
38
|
-
setLogs(fetchedLogs);
|
|
39
|
-
if (!fetchedLogs) {
|
|
40
|
-
setError(true);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
finally {
|
|
44
|
-
setIsLoading(false);
|
|
45
|
-
}
|
|
46
|
-
}, [client]);
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
fetchLogs();
|
|
49
|
-
}, [fetchLogs]);
|
|
50
|
-
if (_isNil(client)) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
return (_jsxs("div", { className: "log-root", children: [_jsx(PageHeader, { className: "header", onBack: () => navigate(-1), title: t('Logs.logs'), subTitle: t('Logs.logsInfo'), extra: [
|
|
54
|
-
_jsx(Form.Item, { label: t('Logs.autoReload'), className: 'auto-reload-switch', children: _jsx(Switch, { onChange: onChange }) }, "reload"),
|
|
55
|
-
_jsx(Button, { type: "primary", loading: isLoading, onClick: fetchLogs, children: t('Logs.refresh') }, "fetch-logs")
|
|
56
|
-
] }), _jsx("div", { className: "log-container", children: error ? (_jsx(Alert, { message: t('Logs.warningMessage'), description: t('Logs.warningDescribtion'), type: "warning", showIcon: true })) : (_jsx("pre", { children: _jsx("code", { children: logs }) })) })] }));
|
|
57
|
-
};
|
|
58
|
-
export default Logs;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import BaseEntity from '@terrestris/shogun-util/dist/model/BaseEntity';
|
|
3
|
-
import { GeneralEntityConfigType } from '../../GeneralEntity/GeneralEntityRoot/GeneralEntityRoot';
|
|
4
|
-
interface OwnProps {
|
|
5
|
-
collapsed?: boolean;
|
|
6
|
-
entityConfigs?: GeneralEntityConfigType<BaseEntity>[];
|
|
7
|
-
}
|
|
8
|
-
type NavigationProps = OwnProps;
|
|
9
|
-
export declare const Navigation: React.FC<NavigationProps>;
|
|
10
|
-
export default Navigation;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { BankOutlined, BarChartOutlined, ControlOutlined, FileImageOutlined, FileTextOutlined } from '@ant-design/icons';
|
|
3
|
-
import { Menu } from 'antd';
|
|
4
|
-
import _isNil from 'lodash/isNil';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { matchPath, useLocation, useNavigate } from 'react-router-dom';
|
|
7
|
-
import config from 'shogunApplicationConfig';
|
|
8
|
-
import usePlugins from '../../../Hooks/usePlugins';
|
|
9
|
-
import { isToolMenuIntegration } from '../../../plugin';
|
|
10
|
-
import TranslationUtil from '../../../Util/TranslationUtil';
|
|
11
|
-
export const Navigation = ({ collapsed = false, entityConfigs = [] }) => {
|
|
12
|
-
const { t } = useTranslation();
|
|
13
|
-
const plugins = usePlugins();
|
|
14
|
-
const navigate = useNavigate();
|
|
15
|
-
const location = useLocation();
|
|
16
|
-
const onSelect = ({ key }) => {
|
|
17
|
-
navigate(`${config.appPrefix}/portal/${key}`);
|
|
18
|
-
};
|
|
19
|
-
const match = matchPath({
|
|
20
|
-
path: `${config.appPrefix}/portal/:activeKey`
|
|
21
|
-
}, location.pathname);
|
|
22
|
-
const activeKey = match?.params?.activeKey;
|
|
23
|
-
const navigationConf = config.navigation;
|
|
24
|
-
const navigationContentChildren = entityConfigs.map(conf => ({
|
|
25
|
-
key: conf.entityType,
|
|
26
|
-
label: (_jsxs(_Fragment, { children: [_jsx(BankOutlined, {}), _jsx("span", { children: TranslationUtil.getTranslationFromConfig(conf.navigationTitle, conf.i18n) })] }))
|
|
27
|
-
}));
|
|
28
|
-
if (navigationConf?.general?.imagefiles?.visible) {
|
|
29
|
-
navigationContentChildren.push({
|
|
30
|
-
key: 'imagefile',
|
|
31
|
-
label: (_jsxs(_Fragment, { children: [_jsx(FileImageOutlined, {}), _jsx("span", { children: t('Navigation.image') })] }))
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const statusChildren = [];
|
|
35
|
-
if (navigationConf?.status?.metrics?.visible) {
|
|
36
|
-
statusChildren.push({
|
|
37
|
-
key: 'status/metrics',
|
|
38
|
-
label: (_jsxs(_Fragment, { children: [_jsx(BarChartOutlined, {}), _jsx("span", { children: t('Navigation.metrics') })] }))
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
if (navigationConf?.status?.logs?.visible) {
|
|
42
|
-
statusChildren.push({
|
|
43
|
-
key: 'status/logs',
|
|
44
|
-
label: (_jsxs(_Fragment, { children: [_jsx(FileTextOutlined, {}), _jsx("span", { children: t('Navigation.logs') })] }))
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
const settingsChildren = [];
|
|
48
|
-
if (navigationConf?.settings?.global?.visible) {
|
|
49
|
-
settingsChildren.push({
|
|
50
|
-
key: 'settings/global',
|
|
51
|
-
label: (_jsxs(_Fragment, { children: [_jsx(ControlOutlined, {}), _jsx("span", { children: t('Navigation.global') })] }))
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if (navigationConf?.settings?.logs?.visible) {
|
|
55
|
-
settingsChildren.push({
|
|
56
|
-
key: 'settings/logs',
|
|
57
|
-
label: (_jsxs(_Fragment, { children: [_jsx(FileTextOutlined, {}), _jsx("span", { children: t('Navigation.logLevels') })] }))
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const items = [];
|
|
61
|
-
if (navigationContentChildren.length > 0) {
|
|
62
|
-
items.push({
|
|
63
|
-
key: 'general',
|
|
64
|
-
label: t('Navigation.content'),
|
|
65
|
-
children: navigationContentChildren
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
if (statusChildren.length > 0) {
|
|
69
|
-
items.push({
|
|
70
|
-
key: 'status',
|
|
71
|
-
label: t('Navigation.status'),
|
|
72
|
-
children: statusChildren
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
if (settingsChildren.length > 0) {
|
|
76
|
-
items.push({
|
|
77
|
-
key: 'settings',
|
|
78
|
-
label: t('Navigation.configuration'),
|
|
79
|
-
children: settingsChildren
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
if (plugins) {
|
|
83
|
-
plugins.forEach(plugin => {
|
|
84
|
-
if (isToolMenuIntegration(plugin.integration)) {
|
|
85
|
-
const { key, integration: { label = 'Plugin', insertionIndex } } = plugin;
|
|
86
|
-
items.splice(insertionIndex || 0, 0, {
|
|
87
|
-
key,
|
|
88
|
-
icon: plugin.integration.icon && _jsx(plugin.integration.icon, {}),
|
|
89
|
-
label: _jsx("span", { children: t(label) })
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return (_jsx(Menu, { className: "navigation-menu", defaultSelectedKeys: ['1'], mode: "inline", theme: "dark", inlineCollapsed: collapsed, onSelect: onSelect, selectedKeys: !_isNil(activeKey) ? [activeKey] : [], defaultOpenKeys: ['general'], items: items }));
|
|
95
|
-
};
|
|
96
|
-
export default Navigation;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import './User.less';
|
|
3
|
-
import { InfoCircleOutlined, LogoutOutlined, SettingOutlined } from '@ant-design/icons';
|
|
4
|
-
import { Dropdown } from 'antd';
|
|
5
|
-
import Avatar from 'antd/lib/avatar/avatar';
|
|
6
|
-
import _isNil from 'lodash/isNil';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import { useRecoilState } from 'recoil';
|
|
9
|
-
import config from 'shogunApplicationConfig';
|
|
10
|
-
import useSHOGunAPIClient from '../../../Hooks/useSHOGunAPIClient';
|
|
11
|
-
import { shogunInfoModalVisibleAtom, userInfoAtom } from '../../../State/atoms';
|
|
12
|
-
import UserUtil from '../../../Util/UserUtil';
|
|
13
|
-
export const User = () => {
|
|
14
|
-
const [userInfo] = useRecoilState(userInfoAtom);
|
|
15
|
-
const [, setInfoVisible] = useRecoilState(shogunInfoModalVisibleAtom);
|
|
16
|
-
const { t } = useTranslation();
|
|
17
|
-
const client = useSHOGunAPIClient();
|
|
18
|
-
if (_isNil(client)) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
const avatarSource = !_isNil(userInfo.providerDetails?.email) ? UserUtil.getGravatarUrl({
|
|
22
|
-
email: userInfo.providerDetails?.email || '',
|
|
23
|
-
size: 38
|
|
24
|
-
}) : '';
|
|
25
|
-
const onMenuClick = (evt) => {
|
|
26
|
-
switch (evt.key) {
|
|
27
|
-
case 'info':
|
|
28
|
-
setInfoVisible(true);
|
|
29
|
-
break;
|
|
30
|
-
case 'settings':
|
|
31
|
-
// TODO: Fix settings for non keycloak setups
|
|
32
|
-
client?.getKeycloak()?.accountManagement();
|
|
33
|
-
break;
|
|
34
|
-
case 'logout':
|
|
35
|
-
const keycloak = client.getKeycloak();
|
|
36
|
-
if (keycloak) {
|
|
37
|
-
keycloak.logout();
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
fetch('/auth/logout', {
|
|
41
|
-
method: 'POST',
|
|
42
|
-
credentials: 'same-origin'
|
|
43
|
-
}).then(response => {
|
|
44
|
-
if (response.status === 200 && !_isNil(config?.security?.tokenName)) {
|
|
45
|
-
localStorage.removeItem(config?.security?.tokenName);
|
|
46
|
-
window.location.href = '/';
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
break;
|
|
51
|
-
default:
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const userName = userInfo?.providerDetails?.username || userInfo?.authProviderId;
|
|
56
|
-
let userMenuItems = [];
|
|
57
|
-
if (userName) {
|
|
58
|
-
userMenuItems.push({
|
|
59
|
-
label: (_jsx("div", { className: 'user-name', children: _jsx("span", { children: userName }) })),
|
|
60
|
-
key: 'username'
|
|
61
|
-
}, {
|
|
62
|
-
type: 'divider'
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
if (client.getKeycloak()) {
|
|
66
|
-
userMenuItems.push({
|
|
67
|
-
label: t('User.settings'),
|
|
68
|
-
icon: _jsx(SettingOutlined, {}),
|
|
69
|
-
key: 'settings'
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
userMenuItems.push({
|
|
73
|
-
label: t('User.info'),
|
|
74
|
-
icon: _jsx(InfoCircleOutlined, {}),
|
|
75
|
-
key: 'info'
|
|
76
|
-
}, {
|
|
77
|
-
type: 'divider'
|
|
78
|
-
});
|
|
79
|
-
userMenuItems.push({
|
|
80
|
-
label: t('User.logout'),
|
|
81
|
-
icon: _jsx(LogoutOutlined, {}),
|
|
82
|
-
key: 'logout'
|
|
83
|
-
});
|
|
84
|
-
return (_jsx(Dropdown, { className: 'user-menu', menu: {
|
|
85
|
-
style: { width: 256 },
|
|
86
|
-
className: 'user-chip-menu',
|
|
87
|
-
items: userMenuItems,
|
|
88
|
-
onClick: onMenuClick
|
|
89
|
-
}, trigger: ['click'], children: _jsxs("div", { children: [_jsx(Avatar, { src: avatarSource, size: 'large', className: 'userimage', children: avatarSource ? '' : UserUtil.getInitials(userInfo) }), _jsx("span", { className: 'username', children: userName })] }) }));
|
|
90
|
-
};
|
|
91
|
-
export default User;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MetricEntryProps } from '../MetricEntry/MetricEntry';
|
|
3
|
-
interface JdbcConnectionsActiveProps extends Omit<MetricEntryProps, 'type'> {
|
|
4
|
-
}
|
|
5
|
-
export declare const JdbcConnectionsActive: React.FC<JdbcConnectionsActiveProps>;
|
|
6
|
-
export default JdbcConnectionsActive;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import MetricEntry from '../MetricEntry/MetricEntry';
|
|
3
|
-
;
|
|
4
|
-
export const JdbcConnectionsActive = ({ ...passThroughProps }) => {
|
|
5
|
-
return (_jsx(MetricEntry, { type: "jdbc.connections.active", ...passThroughProps }));
|
|
6
|
-
};
|
|
7
|
-
export default JdbcConnectionsActive;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import MetricEntry from '../MetricEntry/MetricEntry';
|
|
3
|
-
export const JvmMemoryUsed = ({ ...passThroughProps }) => {
|
|
4
|
-
const valueRenderer = (value) => {
|
|
5
|
-
const val = Number(value) * (9.537 * Math.pow(10, -7));
|
|
6
|
-
return _jsx("span", { children: val.toFixed(2) });
|
|
7
|
-
};
|
|
8
|
-
const suffixRenderer = () => {
|
|
9
|
-
return _jsx("span", { children: "MB" });
|
|
10
|
-
};
|
|
11
|
-
return (_jsx(MetricEntry, { type: "jvm.memory.used", valueRenderer: valueRenderer, suffixRenderer: suffixRenderer, ...passThroughProps }));
|
|
12
|
-
};
|
|
13
|
-
export default JvmMemoryUsed;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MetricEntryProps } from '../MetricEntry/MetricEntry';
|
|
3
|
-
interface JvmThreadsLiveProps extends Omit<MetricEntryProps, 'type'> {
|
|
4
|
-
}
|
|
5
|
-
export declare const JvmThreadsLive: React.FC<JvmThreadsLiveProps>;
|
|
6
|
-
export default JvmThreadsLive;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import MetricEntry from '../MetricEntry/MetricEntry';
|
|
3
|
-
;
|
|
4
|
-
export const JvmThreadsLive = ({ ...passThroughProps }) => {
|
|
5
|
-
return (_jsx(MetricEntry, { type: "jvm.threads.live", ...passThroughProps }));
|
|
6
|
-
};
|
|
7
|
-
export default JvmThreadsLive;
|