@datalayer/core 1.0.13 → 1.0.14
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/lib/App.js +2 -2
- package/lib/api/DatalayerApi.js +1 -1
- package/lib/api/iam/authentication.js +3 -3
- package/lib/api/iam/datasources.js +3 -3
- package/lib/api/iam/healthz.js +2 -2
- package/lib/api/iam/index.js +12 -12
- package/lib/api/iam/oauth2.js +2 -2
- package/lib/api/iam/profile.js +3 -3
- package/lib/api/iam/secrets.js +3 -3
- package/lib/api/iam/usage.js +2 -2
- package/lib/api/index.js +8 -8
- package/lib/api/otel/index.js +5 -5
- package/lib/api/otel/logs.js +3 -3
- package/lib/api/otel/metrics.js +3 -3
- package/lib/api/otel/query.js +3 -3
- package/lib/api/otel/services.js +3 -3
- package/lib/api/otel/traces.js +3 -3
- package/lib/api/runtimes/checkpoints.js +3 -3
- package/lib/api/runtimes/environments.js +3 -3
- package/lib/api/runtimes/healthz.js +2 -2
- package/lib/api/runtimes/index.js +5 -5
- package/lib/api/runtimes/runtimes.js +3 -3
- package/lib/api/runtimes/snapshots.js +3 -3
- package/lib/api/spacer/documents.js +2 -2
- package/lib/api/spacer/healthz.js +2 -2
- package/lib/api/spacer/index.js +7 -7
- package/lib/api/spacer/items.js +2 -2
- package/lib/api/spacer/lexicals.js +2 -2
- package/lib/api/spacer/notebooks.js +2 -2
- package/lib/api/spacer/spaces.js +3 -3
- package/lib/api/spacer/users.js +3 -3
- package/lib/client/auth/AuthenticationManager.js +3 -3
- package/lib/client/auth/index.js +4 -4
- package/lib/client/auth/storage.js +1 -1
- package/lib/client/auth/strategies.js +3 -3
- package/lib/client/base.js +2 -2
- package/lib/client/index.js +19 -19
- package/lib/client/mixins/IAMMixin.js +10 -10
- package/lib/client/mixins/RuntimesMixin.js +7 -7
- package/lib/client/mixins/SpacerMixin.js +11 -11
- package/lib/client/utils/spacerUtils.js +3 -3
- package/lib/collaboration/DatalayerCollaborationProvider.js +1 -1
- package/lib/collaboration/index.js +2 -2
- package/lib/components/auth/Login.js +6 -6
- package/lib/components/auth/Login.stories.js +2 -2
- package/lib/components/auth/LoginToken.js +2 -2
- package/lib/components/auth/index.js +3 -3
- package/lib/components/avatars/BoringAvatar.stories.js +1 -1
- package/lib/components/avatars/UserProfileAvatar.js +2 -2
- package/lib/components/avatars/index.js +2 -2
- package/lib/components/banners/NoAutomationBanner.js +1 -1
- package/lib/components/banners/index.js +1 -1
- package/lib/components/buttons/DownloadCSVButton.js +1 -1
- package/lib/components/buttons/DownloadJsonButton.js +1 -1
- package/lib/components/buttons/index.js +5 -5
- package/lib/components/checkout/StripeCheckout.js +1 -1
- package/lib/components/checkout/index.js +1 -1
- package/lib/components/confetti/index.js +1 -1
- package/lib/components/context/OrganizationSelect.js +2 -2
- package/lib/components/context/SpaceSelect.js +2 -2
- package/lib/components/context/index.js +2 -2
- package/lib/components/display/DatalayerBox.js +1 -1
- package/lib/components/display/LiveRelativeTime.js +1 -1
- package/lib/components/display/NavLink.js +1 -1
- package/lib/components/display/index.js +14 -14
- package/lib/components/echarts/index.js +1 -1
- package/lib/components/flashes/FlashDisclaimer.js +2 -2
- package/lib/components/flashes/FlashGuest.js +4 -4
- package/lib/components/flashes/FlashSurveys.js +4 -4
- package/lib/components/flashes/FlashUnauthorized.js +1 -1
- package/lib/components/flashes/index.js +6 -6
- package/lib/components/flashes/surveys/index.js +2 -2
- package/lib/components/iam/ExternalTokenSilentLogin.js +3 -3
- package/lib/components/iam/index.js +1 -1
- package/lib/components/icons/index.js +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/labels/index.js +1 -1
- package/lib/components/landings/index.js +1 -1
- package/lib/components/navbar/NavigationVisbilityObserver.js +4 -4
- package/lib/components/navbar/SubdomainNavBar.js +5 -5
- package/lib/components/navbar/index.js +2 -2
- package/lib/components/nbgrader/index.js +1 -1
- package/lib/components/notebooks/index.js +2 -2
- package/lib/components/progress/ConsumptionBar.js +1 -1
- package/lib/components/progress/CreditsIndicator.js +2 -2
- package/lib/components/progress/index.js +6 -6
- package/lib/components/runtimes/RuntimeCellVariablesDialog.js +2 -2
- package/lib/components/runtimes/RuntimeLauncherDialog.js +9 -9
- package/lib/components/runtimes/RuntimePickerBase.js +3 -3
- package/lib/components/runtimes/RuntimePickerCell.js +8 -8
- package/lib/components/runtimes/RuntimePickerNotebook.js +6 -6
- package/lib/components/runtimes/RuntimeSimplePicker.js +3 -3
- package/lib/components/runtimes/index.js +11 -11
- package/lib/components/screencapture/ScreencaptureButton.js +3 -3
- package/lib/components/screencapture/index.js +2 -2
- package/lib/components/snapshots/RuntimeSnapshotMenu.js +4 -4
- package/lib/components/snapshots/index.js +1 -1
- package/lib/components/snippets/SnippetDialog.js +1 -1
- package/lib/components/snippets/index.js +1 -1
- package/lib/components/sparklines/Sparklines.js +5 -1
- package/lib/components/sparklines/dataProcessing.js +4 -0
- package/lib/components/sparklines/index.js +7 -3
- package/lib/components/sparklines/types.js +1 -1
- package/lib/components/storage/ContentsBrowser.js +3 -3
- package/lib/components/storage/index.js +2 -2
- package/lib/components/students/index.js +1 -1
- package/lib/components/subnav/SubNav.js +2 -2
- package/lib/components/subnav/index.js +1 -1
- package/lib/components/tables/index.js +1 -1
- package/lib/components/text-reveal/TextRevealAnimation.js +1 -1
- package/lib/components/text-reveal/index.js +1 -1
- package/lib/components/tokens/index.js +1 -1
- package/lib/components/toolbars/AssignmentEditorToolbar.js +1 -1
- package/lib/components/toolbars/DocumentEditorToolbar.js +1 -1
- package/lib/components/toolbars/index.js +3 -3
- package/lib/components/users/PeerIndicator.js +1 -1
- package/lib/components/users/index.js +1 -1
- package/lib/config/Configuration.js +1 -1
- package/lib/config/index.js +2 -2
- package/lib/config/integrations/index.js +1 -1
- package/lib/hooks/assets/index.js +1 -1
- package/lib/hooks/index.js +33 -33
- package/lib/hooks/layouts/LayoutBackdrop.js +2 -2
- package/lib/hooks/layouts/LayoutScreencapture.js +3 -3
- package/lib/hooks/layouts/index.js +2 -2
- package/lib/hooks/useAuthorization.js +3 -3
- package/lib/hooks/useBackdrop.js +2 -2
- package/lib/hooks/useCache.js +8 -8
- package/lib/hooks/useCellOutputshot.js +2 -2
- package/lib/hooks/useDatalayer.js +6 -6
- package/lib/hooks/useIAM.js +4 -4
- package/lib/hooks/useLocation.js +2 -2
- package/lib/hooks/useLocationHandles.js +3 -3
- package/lib/hooks/useNavigate.js +4 -4
- package/lib/hooks/useParams.js +2 -2
- package/lib/hooks/useProjects.js +1 -1
- package/lib/hooks/useRuntimes.js +1 -1
- package/lib/hooks/useScreencapture.js +1 -1
- package/lib/hooks/useToast.js +41 -5
- package/lib/hooks/useUpload.js +2 -2
- package/lib/hooks/useUser.js +1 -1
- package/lib/i18n/index.js +1 -1
- package/lib/index.js +16 -16
- package/lib/main.js +1 -1
- package/lib/mocks/components/FlashMock.js +1 -1
- package/lib/mocks/components/index.js +1 -1
- package/lib/mocks/hooks/index.js +1 -1
- package/lib/mocks/hooks/rests/index.js +1 -1
- package/lib/mocks/hooks/useDatalayerMock.js +5 -5
- package/lib/mocks/index.js +5 -5
- package/lib/mocks/models/CourseMock.js +3 -3
- package/lib/mocks/models/InviteMock.js +2 -2
- package/lib/mocks/models/OrganisationMock.js +1 -1
- package/lib/mocks/models/SchoolMock.js +1 -1
- package/lib/mocks/models/SpaceMock.js +2 -2
- package/lib/mocks/models/TeamMock.js +1 -1
- package/lib/mocks/models/UserMock.js +1 -1
- package/lib/mocks/models/index.js +9 -9
- package/lib/mocks/views/ChartMock.js +3 -3
- package/lib/mocks/views/DashboardMock.js +2 -2
- package/lib/mocks/views/TableMock.js +1 -1
- package/lib/mocks/views/index.js +7 -7
- package/lib/models/Contact.js +3 -3
- package/lib/models/CreditsDTO.js +1 -1
- package/lib/models/Datasource.js +1 -1
- package/lib/models/EnvironmentDTO.js +1 -1
- package/lib/models/HealthCheck.js +1 -1
- package/lib/models/IAMProviderUsers.js +1 -1
- package/lib/models/Invite.js +1 -1
- package/lib/models/ItemDTO.js +1 -1
- package/lib/models/LexicalDTO.js +4 -4
- package/lib/models/NotebookDTO.js +4 -4
- package/lib/models/Organization.js +2 -2
- package/lib/models/Page.js +2 -2
- package/lib/models/RuntimeDTO.js +2 -2
- package/lib/models/RuntimeSnapshotDTO.js +2 -2
- package/lib/models/Secret.js +1 -1
- package/lib/models/Space.js +3 -3
- package/lib/models/SpaceDTO.js +9 -9
- package/lib/models/Team.js +2 -2
- package/lib/models/User.js +5 -5
- package/lib/models/UserDTO.js +1 -1
- package/lib/models/index.js +75 -75
- package/lib/navigation/components.js +1 -1
- package/lib/navigation/index.js +4 -4
- package/lib/otel/client/OtelClient.js +1 -1
- package/lib/otel/client/index.js +1 -1
- package/lib/otel/hooks/index.js +1 -1
- package/lib/otel/index.js +15 -15
- package/lib/otel/views/OtelLive.js +11 -11
- package/lib/otel/views/OtelLogsList.js +1 -1
- package/lib/otel/views/OtelMetricsList.js +2 -2
- package/lib/otel/views/OtelSpanDetail.js +2 -2
- package/lib/otel/views/OtelSpanTree.js +1 -1
- package/lib/otel/views/OtelSqlView.js +1 -1
- package/lib/otel/views/OtelSystemView.js +1 -1
- package/lib/otel/views/OtelTimeline.js +1 -1
- package/lib/otel/views/OtelTracesList.js +1 -1
- package/lib/otel/views/index.js +12 -12
- package/lib/routes/index.js +1 -1
- package/lib/services/DatalayerServiceManager.js +3 -3
- package/lib/services/index.js +3 -3
- package/lib/state/State.js +13 -13
- package/lib/state/index.js +3 -3
- package/lib/state/storage/IAMStorage.js +2 -2
- package/lib/state/storage/index.js +1 -1
- package/lib/state/substates/CoreState.js +1 -1
- package/lib/state/substates/IAMState.js +5 -5
- package/lib/state/substates/RuntimesState.js +3 -3
- package/lib/state/substates/SurveysState.js +4 -4
- package/lib/state/substates/TeamState.js +1 -1
- package/lib/state/substates/index.js +14 -14
- package/lib/stateful/index.js +2 -2
- package/lib/stateful/jupyter/exec/Snippets.js +1 -1
- package/lib/stateful/jupyter/exec/index.js +2 -2
- package/lib/stateful/jupyter/index.js +2 -2
- package/lib/stateful/runtimes/actions.js +4 -4
- package/lib/stateful/runtimes/index.js +5 -5
- package/lib/stateful/runtimes/snapshots.js +1 -1
- package/lib/utils/Date.d.ts +11 -0
- package/lib/utils/Date.js +30 -0
- package/lib/utils/cli/index.js +1 -1
- package/lib/utils/index.js +29 -29
- package/lib/views/datasources/DatasourceDetail.js +3 -3
- package/lib/views/datasources/DatasourceNew.js +2 -2
- package/lib/views/datasources/Datasources.js +1 -1
- package/lib/views/datasources/index.js +3 -3
- package/lib/views/iam/SignInSimple.js +1 -1
- package/lib/views/iam/index.js +1 -1
- package/lib/views/iam-tokens/IAMTokenEdit.js +3 -3
- package/lib/views/iam-tokens/IAMTokenNew.js +2 -2
- package/lib/views/iam-tokens/IAMTokens.js +1 -1
- package/lib/views/iam-tokens/Tokens.js +1 -1
- package/lib/views/iam-tokens/index.js +3 -3
- package/lib/views/index.js +3 -3
- package/lib/views/otel/DashboardView.js +1 -1
- package/lib/views/otel/LogsView.js +1 -1
- package/lib/views/otel/MetricsView.js +1 -1
- package/lib/views/otel/OtelHeader.js +1 -1
- package/lib/views/otel/SqlView.js +1 -1
- package/lib/views/otel/SystemView.js +1 -1
- package/lib/views/otel/TracesView.js +1 -1
- package/lib/views/otel/index.js +8 -8
- package/lib/views/profile/UserBadge.js +1 -1
- package/lib/views/profile/index.js +1 -1
- package/lib/views/secrets/SecretEdit.js +3 -3
- package/lib/views/secrets/SecretNew.js +2 -2
- package/lib/views/secrets/Secrets.js +1 -1
- package/lib/views/secrets/index.js +3 -3
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
import { Poll } from '@lumino/polling';
|
|
6
6
|
import { useStore } from 'zustand';
|
|
7
7
|
import { createStore } from 'zustand/vanilla';
|
|
8
|
-
import { ANONYMOUS_USER_TOKEN, ANONYMOUS_USER, asUser, IAMProvidersSpecs, } from '../../models';
|
|
9
|
-
import { getStoredToken, getStoredUser, loadRefreshTokenFromCookie, storeToken, storeUser, } from '../storage';
|
|
10
|
-
import { requestDatalayerAPI, } from '../../api/DatalayerApi';
|
|
11
|
-
import { getCookie, setCookie, deleteCookie } from '../../utils';
|
|
12
|
-
import { coreStore } from './CoreState';
|
|
8
|
+
import { ANONYMOUS_USER_TOKEN, ANONYMOUS_USER, asUser, IAMProvidersSpecs, } from '../../models/index.js';
|
|
9
|
+
import { getStoredToken, getStoredUser, loadRefreshTokenFromCookie, storeToken, storeUser, } from '../storage/index.js';
|
|
10
|
+
import { requestDatalayerAPI, } from '../../api/DatalayerApi.js';
|
|
11
|
+
import { getCookie, setCookie, deleteCookie } from '../../utils/index.js';
|
|
12
|
+
import { coreStore } from './CoreState.js';
|
|
13
13
|
/**
|
|
14
14
|
* Limit to warn about low credits in milliseconds.
|
|
15
15
|
*/
|
|
@@ -6,9 +6,9 @@ import { useStore } from 'zustand';
|
|
|
6
6
|
import { createStore } from 'zustand/vanilla';
|
|
7
7
|
import { JSONExt } from '@lumino/coreutils';
|
|
8
8
|
import { Poll } from '@lumino/polling';
|
|
9
|
-
import { getRuntimes } from '../../stateful/runtimes';
|
|
10
|
-
import { coreStore } from './CoreState';
|
|
11
|
-
import { iamStore } from './IAMState';
|
|
9
|
+
import { getRuntimes } from '../../stateful/runtimes/index.js';
|
|
10
|
+
import { coreStore } from './CoreState.js';
|
|
11
|
+
import { iamStore } from './IAMState.js';
|
|
12
12
|
/**
|
|
13
13
|
* Kernel store
|
|
14
14
|
*/
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { createStore } from 'zustand/vanilla';
|
|
6
6
|
import { useStore } from 'zustand';
|
|
7
|
-
import { requestDatalayerAPI, } from '../../api/DatalayerApi';
|
|
8
|
-
import { asSurvey, } from '../../models';
|
|
9
|
-
import { coreStore } from './CoreState';
|
|
10
|
-
import { iamStore } from './IAMState';
|
|
7
|
+
import { requestDatalayerAPI, } from '../../api/DatalayerApi.js';
|
|
8
|
+
import { asSurvey, } from '../../models/index.js';
|
|
9
|
+
import { coreStore } from './CoreState.js';
|
|
10
|
+
import { iamStore } from './IAMState.js';
|
|
11
11
|
export const surveysStore = createStore((set, get) => ({
|
|
12
12
|
surveys: undefined,
|
|
13
13
|
growthRunUrl: coreStore.getState().configuration?.growthRunUrl,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { createStore } from 'zustand/vanilla';
|
|
6
6
|
import { useStore } from 'zustand';
|
|
7
|
-
import { TEAMS_MOCK } from '../../mocks';
|
|
7
|
+
import { TEAMS_MOCK } from '../../mocks/index.js';
|
|
8
8
|
export const teamStore = createStore((set, get) => ({
|
|
9
9
|
teams: TEAMS_MOCK,
|
|
10
10
|
update: (teams) => set((state) => ({
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
export * from './CellState';
|
|
6
|
-
export * from './CoreState';
|
|
7
|
-
export * from './DatasourceState';
|
|
8
|
-
export * from './DocumentState';
|
|
9
|
-
export * from './GradeState';
|
|
10
|
-
export * from './IAMState';
|
|
11
|
-
export * from './JupyterLabState';
|
|
12
|
-
export * from './LayoutState';
|
|
13
|
-
export * from './NbformatState';
|
|
14
|
-
export * from './OrganizationState';
|
|
15
|
-
export * from './RuntimesState';
|
|
16
|
-
export * from './SpaceState';
|
|
17
|
-
export * from './SurveysState';
|
|
18
|
-
export * from './TeamState';
|
|
5
|
+
export * from './CellState.js';
|
|
6
|
+
export * from './CoreState.js';
|
|
7
|
+
export * from './DatasourceState.js';
|
|
8
|
+
export * from './DocumentState.js';
|
|
9
|
+
export * from './GradeState.js';
|
|
10
|
+
export * from './IAMState.js';
|
|
11
|
+
export * from './JupyterLabState.js';
|
|
12
|
+
export * from './LayoutState.js';
|
|
13
|
+
export * from './NbformatState.js';
|
|
14
|
+
export * from './OrganizationState.js';
|
|
15
|
+
export * from './RuntimesState.js';
|
|
16
|
+
export * from './SpaceState.js';
|
|
17
|
+
export * from './SurveysState.js';
|
|
18
|
+
export * from './TeamState.js';
|
package/lib/stateful/index.js
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
import { URLExt } from '@jupyterlab/coreutils';
|
|
9
9
|
import { PromiseDelegate } from '@lumino/coreutils';
|
|
10
10
|
import { Upload } from 'tus-js-client';
|
|
11
|
-
import { requestDatalayerAPI, } from '../../api';
|
|
12
|
-
import { asRuntimeSnapshot } from '../../models';
|
|
13
|
-
import { iamStore, runtimesStore } from '../../state';
|
|
14
|
-
import { sleep } from '../../utils';
|
|
11
|
+
import { requestDatalayerAPI, } from '../../api/index.js';
|
|
12
|
+
import { asRuntimeSnapshot } from '../../models/index.js';
|
|
13
|
+
import { iamStore, runtimesStore } from '../../state/index.js';
|
|
14
|
+
import { sleep } from '../../utils/index.js';
|
|
15
15
|
/**
|
|
16
16
|
* Get available Environments.
|
|
17
17
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
export * from './actions';
|
|
6
|
-
export * from './apis';
|
|
7
|
-
export * from './settings';
|
|
8
|
-
export * from './snapshots';
|
|
9
|
-
export * from './utils';
|
|
5
|
+
export * from './actions.js';
|
|
6
|
+
export * from './apis.js';
|
|
7
|
+
export * from './settings.js';
|
|
8
|
+
export * from './snapshots.js';
|
|
9
|
+
export * from './utils.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
5
|
import { KernelExecutor } from '@datalayer/jupyter-react';
|
|
6
|
-
import { createRuntimeSnapshotDownloadURL, uploadRuntimeSnapshot } from '.';
|
|
6
|
+
import { createRuntimeSnapshotDownloadURL, uploadRuntimeSnapshot } from './index.js';
|
|
7
7
|
/**
|
|
8
8
|
* Snapshot a runtime through the frontend and upload it to the cloud.
|
|
9
9
|
*
|
package/lib/utils/Date.d.ts
CHANGED
|
@@ -6,3 +6,14 @@ export declare const timeSince: (date: Date) => string;
|
|
|
6
6
|
* Examples: "just now", "15m ago", "3h ago", "2d ago", "4w ago", "1y ago".
|
|
7
7
|
*/
|
|
8
8
|
export declare const formatRelativeTime: (value?: Date | string | number, now?: Date) => string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Format a duration in milliseconds into a human-readable string.
|
|
11
|
+
*
|
|
12
|
+
* Examples:
|
|
13
|
+
* - 500 → "< 1s"
|
|
14
|
+
* - 1500 → "1s"
|
|
15
|
+
* - 65000 → "1m 5s"
|
|
16
|
+
* - 3661000 → "1h 1m 1s"
|
|
17
|
+
* - 90061000 → "1d 1h 1m"
|
|
18
|
+
*/
|
|
19
|
+
export declare const formatDurationMs: (ms: number) => string;
|
package/lib/utils/Date.js
CHANGED
|
@@ -95,3 +95,33 @@ export const formatRelativeTime = (value, now = new Date()) => {
|
|
|
95
95
|
const years = Math.floor(days / 365);
|
|
96
96
|
return `${years}y ago`;
|
|
97
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* Format a duration in milliseconds into a human-readable string.
|
|
100
|
+
*
|
|
101
|
+
* Examples:
|
|
102
|
+
* - 500 → "< 1s"
|
|
103
|
+
* - 1500 → "1s"
|
|
104
|
+
* - 65000 → "1m 5s"
|
|
105
|
+
* - 3661000 → "1h 1m 1s"
|
|
106
|
+
* - 90061000 → "1d 1h 1m"
|
|
107
|
+
*/
|
|
108
|
+
export const formatDurationMs = (ms) => {
|
|
109
|
+
const clamped = Math.max(0, ms);
|
|
110
|
+
const totalSeconds = Math.floor(clamped / 1000);
|
|
111
|
+
if (totalSeconds < 1)
|
|
112
|
+
return '< 1s';
|
|
113
|
+
const days = Math.floor(totalSeconds / 86400);
|
|
114
|
+
const hours = Math.floor((totalSeconds % 86400) / 3600);
|
|
115
|
+
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
116
|
+
const seconds = totalSeconds % 60;
|
|
117
|
+
const parts = [];
|
|
118
|
+
if (days > 0)
|
|
119
|
+
parts.push(`${days}d`);
|
|
120
|
+
if (hours > 0)
|
|
121
|
+
parts.push(`${hours}h`);
|
|
122
|
+
if (minutes > 0)
|
|
123
|
+
parts.push(`${minutes}m`);
|
|
124
|
+
if (seconds > 0 && days === 0)
|
|
125
|
+
parts.push(`${seconds}s`);
|
|
126
|
+
return parts.join(' ') || '< 1s';
|
|
127
|
+
};
|
package/lib/utils/cli/index.js
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
export * from './Array';
|
|
6
|
-
export * from './Avatar';
|
|
7
|
-
export * from './Browser';
|
|
8
|
-
export * from './cli';
|
|
9
|
-
export * from './Cookie';
|
|
10
|
-
export * from './Cells';
|
|
11
|
-
export * from './Date';
|
|
12
|
-
export * from './Download';
|
|
13
|
-
export * from './DownloadFile';
|
|
14
|
-
export * from './Env';
|
|
15
|
-
export * from './File';
|
|
16
|
-
export * from './Format';
|
|
17
|
-
export * from './Ids';
|
|
18
|
-
export * from './Jwt';
|
|
19
|
-
export * from './Jupyter';
|
|
20
|
-
export * from './Lazy';
|
|
21
|
-
export * from './Msc';
|
|
22
|
-
export * from './Name';
|
|
23
|
-
export * from './Notebook';
|
|
24
|
-
export * from './Number';
|
|
25
|
-
export * from './Plots';
|
|
26
|
-
export * from './Random';
|
|
27
|
-
// export * from './Screencapture'; Do not export html2canvas for now.
|
|
28
|
-
export * from './Sleep';
|
|
29
|
-
export * from './Snapshot';
|
|
30
|
-
export * from './String';
|
|
31
|
-
export * from './Uri';
|
|
32
|
-
export * from './Validator';
|
|
33
|
-
export * from './WithSuspense';
|
|
5
|
+
export * from './Array.js';
|
|
6
|
+
export * from './Avatar.js';
|
|
7
|
+
export * from './Browser.js';
|
|
8
|
+
export * from './cli/index.js';
|
|
9
|
+
export * from './Cookie.js';
|
|
10
|
+
export * from './Cells.js';
|
|
11
|
+
export * from './Date.js';
|
|
12
|
+
export * from './Download.js';
|
|
13
|
+
export * from './DownloadFile.js';
|
|
14
|
+
export * from './Env.js';
|
|
15
|
+
export * from './File.js';
|
|
16
|
+
export * from './Format.js';
|
|
17
|
+
export * from './Ids.js';
|
|
18
|
+
export * from './Jwt.js';
|
|
19
|
+
export * from './Jupyter.js';
|
|
20
|
+
export * from './Lazy.js';
|
|
21
|
+
export * from './Msc.js';
|
|
22
|
+
export * from './Name.js';
|
|
23
|
+
export * from './Notebook.js';
|
|
24
|
+
export * from './Number.js';
|
|
25
|
+
export * from './Plots.js';
|
|
26
|
+
export * from './Random.js';
|
|
27
|
+
// export * from './Screencapture.js'; Do not export html2canvas for now.
|
|
28
|
+
export * from './Sleep.js';
|
|
29
|
+
export * from './Snapshot.js';
|
|
30
|
+
export * from './String.js';
|
|
31
|
+
export * from './Uri.js';
|
|
32
|
+
export * from './Validator.js';
|
|
33
|
+
export * from './WithSuspense.js';
|
|
@@ -8,9 +8,9 @@ import { useParams } from 'react-router-dom';
|
|
|
8
8
|
import { PageHeader, Heading, Text, Button, TextInput, FormControl, Textarea, Label, } from '@primer/react';
|
|
9
9
|
import { Box } from '@datalayer/primer-addons';
|
|
10
10
|
import { EyeIcon, EyeClosedIcon } from '@primer/octicons-react';
|
|
11
|
-
import { BoringAvatar } from '../../components/avatars';
|
|
12
|
-
import { useCache, useToast } from '../../hooks';
|
|
13
|
-
import { useRunStore } from '../../state';
|
|
11
|
+
import { BoringAvatar } from '../../components/avatars/index.js';
|
|
12
|
+
import { useCache, useToast } from '../../hooks/index.js';
|
|
13
|
+
import { useRunStore } from '../../state/index.js';
|
|
14
14
|
export const DatasourceDetail = () => {
|
|
15
15
|
const { datasourceId } = useParams();
|
|
16
16
|
const runStore = useRunStore();
|
|
@@ -6,8 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
6
6
|
import { useEffect, useState } from 'react';
|
|
7
7
|
import { PageHeader, FormControl, Button, TextInput, Text, Textarea, Select, Flash, Link, } from '@primer/react';
|
|
8
8
|
import { Box } from '@datalayer/primer-addons';
|
|
9
|
-
import { useCache, useNavigate, useToast } from '../../hooks';
|
|
10
|
-
import { useRunStore } from '../../state';
|
|
9
|
+
import { useCache, useNavigate, useToast } from '../../hooks/index.js';
|
|
10
|
+
import { useRunStore } from '../../state/index.js';
|
|
11
11
|
export const DatasourceNew = ({ datasourcesListRoute = '/settings/integrations/datasources', secretsRoute = '/settings/iam/secrets', } = {}) => {
|
|
12
12
|
const runStore = useRunStore();
|
|
13
13
|
const { useCreateDatasource } = useCache();
|
|
@@ -8,7 +8,7 @@ import { PageLayout, Button, IconButton, Text, Label } from '@primer/react';
|
|
|
8
8
|
import { Blankslate, PageHeader, Table, DataTable, } from '@primer/react/experimental';
|
|
9
9
|
import { Box } from '@datalayer/primer-addons';
|
|
10
10
|
import { EditIcon } from '@datalayer/icons-react';
|
|
11
|
-
import { useCache, useNavigate } from '../../hooks';
|
|
11
|
+
import { useCache, useNavigate } from '../../hooks/index.js';
|
|
12
12
|
const DatasourcesTable = ({ datasourcesListRoute, }) => {
|
|
13
13
|
const { useDatasources } = useCache();
|
|
14
14
|
const datasourcesQuery = useDatasources();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
export * from './DatasourceDetail';
|
|
6
|
-
export * from './DatasourceNew';
|
|
7
|
-
export * from './Datasources';
|
|
5
|
+
export * from './DatasourceDetail.js';
|
|
6
|
+
export * from './DatasourceNew.js';
|
|
7
|
+
export * from './Datasources.js';
|
|
@@ -16,7 +16,7 @@ import { useState, useCallback, useRef, useMemo } from 'react';
|
|
|
16
16
|
import { Box, Button, FormControl, Heading, Text, Textarea, TextInput, } from '@primer/react';
|
|
17
17
|
import { Dialog } from '@primer/react/experimental';
|
|
18
18
|
import { EyeIcon, EyeClosedIcon, KeyIcon, TelescopeIcon, } from '@primer/octicons-react';
|
|
19
|
-
import { coreStore } from '../../state';
|
|
19
|
+
import { coreStore } from '../../state/index.js';
|
|
20
20
|
// ── Component ────────────────────────────────────────────────────────
|
|
21
21
|
export const SignInSimple = ({ onSignIn, onApiKeySignIn, loginUrl: loginUrlProp, title = 'Datalayer OTEL', description = 'Sign in to access the observability dashboard.', leadingIcon = _jsx(TelescopeIcon, { size: 24 }), }) => {
|
|
22
22
|
const loginUrl = useMemo(() => {
|
package/lib/views/iam/index.js
CHANGED
|
@@ -7,9 +7,9 @@ import { useState, useEffect } from 'react';
|
|
|
7
7
|
import { useParams } from 'react-router-dom';
|
|
8
8
|
import { PageHeader, Heading, Text, Button, TextInput, FormControl, Textarea, Label, } from '@primer/react';
|
|
9
9
|
import { Box } from '@datalayer/primer-addons';
|
|
10
|
-
import { BoringAvatar } from '../../components/avatars';
|
|
11
|
-
import { useCache, useNavigate, useToast } from '../../hooks';
|
|
12
|
-
import { useRunStore } from '../../state';
|
|
10
|
+
import { BoringAvatar } from '../../components/avatars/index.js';
|
|
11
|
+
import { useCache, useNavigate, useToast } from '../../hooks/index.js';
|
|
12
|
+
import { useRunStore } from '../../state/index.js';
|
|
13
13
|
export const IAMTokenEdit = ({ tokensListRoute = '/settings/iam/tokens', } = {}) => {
|
|
14
14
|
const { tokenId } = useParams();
|
|
15
15
|
const runStore = useRunStore();
|
|
@@ -8,8 +8,8 @@ import { PageHeader, FormControl, Button, TextInput, Textarea, Select, Text, Ico
|
|
|
8
8
|
import { Box } from '@datalayer/primer-addons';
|
|
9
9
|
import { CopyIcon } from '@primer/octicons-react';
|
|
10
10
|
import { Calendar, defaultCalendarStrings } from '@fluentui/react';
|
|
11
|
-
import { useCache, useNavigate, useToast } from '../../hooks';
|
|
12
|
-
import { useRunStore } from '../../state';
|
|
11
|
+
import { useCache, useNavigate, useToast } from '../../hooks/index.js';
|
|
12
|
+
import { useRunStore } from '../../state/index.js';
|
|
13
13
|
export const IAMTokenNew = ({ tokensListRoute = '/settings/iam/tokens', } = {}) => {
|
|
14
14
|
const runStore = useRunStore();
|
|
15
15
|
const { useCreateToken } = useCache();
|
|
@@ -9,7 +9,7 @@ import { Blankslate, PageHeader, Table, DataTable, } from '@primer/react/experim
|
|
|
9
9
|
import { Box } from '@datalayer/primer-addons';
|
|
10
10
|
import { EditIcon } from '@datalayer/icons-react';
|
|
11
11
|
import { TrashIcon } from '@primer/octicons-react';
|
|
12
|
-
import { useCache, useNavigate, useToast } from '../../hooks';
|
|
12
|
+
import { useCache, useNavigate, useToast } from '../../hooks/index.js';
|
|
13
13
|
const TokensTable = ({ tokensListRoute, showTitle = true, }) => {
|
|
14
14
|
const { useTokens, useDeleteToken } = useCache();
|
|
15
15
|
const { enqueueToast } = useToast();
|
|
@@ -9,7 +9,7 @@ import { Blankslate, PageHeader, Table, DataTable, } from '@primer/react/experim
|
|
|
9
9
|
import { Box } from '@datalayer/primer-addons';
|
|
10
10
|
import { EditIcon } from '@datalayer/icons-react';
|
|
11
11
|
import { TrashIcon } from '@primer/octicons-react';
|
|
12
|
-
import { useCache, useNavigate, useToast } from '../../hooks';
|
|
12
|
+
import { useCache, useNavigate, useToast } from '../../hooks/index.js';
|
|
13
13
|
const TokensTable = () => {
|
|
14
14
|
const { useTokens, useDeleteToken } = useCache();
|
|
15
15
|
const { enqueueToast } = useToast();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
export * from './IAMTokenEdit';
|
|
6
|
-
export * from './IAMTokenNew';
|
|
7
|
-
export * from './IAMTokens';
|
|
5
|
+
export * from './IAMTokenEdit.js';
|
|
6
|
+
export * from './IAMTokenNew.js';
|
|
7
|
+
export * from './IAMTokens.js';
|
package/lib/views/index.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
export * from './iam';
|
|
6
|
-
export * from './profile';
|
|
7
|
-
export * from './otel';
|
|
5
|
+
export * from './iam/index.js';
|
|
6
|
+
export * from './profile/index.js';
|
|
7
|
+
export * from './otel/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@primer/react';
|
|
3
|
-
import { OtelLive } from '../../otel';
|
|
3
|
+
import { OtelLive } from '../../otel/index.js';
|
|
4
4
|
export const DashboardView = ({ baseUrl = '', wsBaseUrl, token, autoRefreshMs = 5000, defaultSignal = 'traces', limit = 200, onSignalRef, }) => (_jsx(Box, { sx: { display: 'flex', flex: 1, minHeight: 0, overflow: 'hidden' }, children: _jsx(OtelLive, { baseUrl: baseUrl, wsBaseUrl: wsBaseUrl, token: token, autoRefreshMs: autoRefreshMs, defaultSignal: defaultSignal, limit: limit, onSignalRef: onSignalRef }) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@primer/react';
|
|
3
|
-
import { OtelLive } from '../../otel';
|
|
3
|
+
import { OtelLive } from '../../otel/index.js';
|
|
4
4
|
export const LogsView = ({ baseUrl = '', token, autoRefreshMs = 5000, limit = 200, }) => (_jsx(Box, { sx: { display: 'flex', flex: 1, minHeight: 0, overflow: 'hidden' }, children: _jsx(OtelLive, { baseUrl: baseUrl, token: token, autoRefreshMs: autoRefreshMs, defaultSignal: "logs", limit: limit }) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@primer/react';
|
|
3
|
-
import { OtelLive } from '../../otel';
|
|
3
|
+
import { OtelLive } from '../../otel/index.js';
|
|
4
4
|
export const MetricsView = ({ baseUrl = '', token, autoRefreshMs = 5000, limit = 200, }) => (_jsx(Box, { sx: { display: 'flex', flex: 1, minHeight: 0, overflow: 'hidden' }, children: _jsx(OtelLive, { baseUrl: baseUrl, token: token, autoRefreshMs: autoRefreshMs, defaultSignal: "metrics", limit: limit }) }));
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
13
13
|
import { useState, useCallback, useRef } from 'react';
|
|
14
14
|
import { Box, Text, Button, Dialog } from '@primer/react';
|
|
15
15
|
import { TelescopeIcon, SignOutIcon } from '@primer/octicons-react';
|
|
16
|
-
import { UserBadge } from '../profile';
|
|
16
|
+
import { UserBadge } from '../profile/index.js';
|
|
17
17
|
export const OtelHeader = ({ baseUrl = '', token, trailing, onNavigate, onSignOut, showGenerateButtons = true, }) => {
|
|
18
18
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
19
19
|
const [dialogTitle, setDialogTitle] = useState('');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@primer/react';
|
|
3
|
-
import { OtelSqlView } from '../../otel';
|
|
3
|
+
import { OtelSqlView } from '../../otel/index.js';
|
|
4
4
|
export const SqlView = ({ baseUrl = '', token }) => (_jsx(Box, { sx: { display: 'flex', flex: 1, minHeight: 0, overflow: 'hidden' }, children: _jsx(OtelSqlView, { baseUrl: baseUrl, token: token }) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@primer/react';
|
|
3
|
-
import { OtelSystemView } from '../../otel';
|
|
3
|
+
import { OtelSystemView } from '../../otel/index.js';
|
|
4
4
|
export const SystemView = ({ baseUrl = '', token, }) => (_jsx(Box, { sx: { display: 'flex', flex: 1, minHeight: 0, overflow: 'hidden' }, children: _jsx(OtelSystemView, { baseUrl: baseUrl, token: token }) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@primer/react';
|
|
3
|
-
import { OtelLive } from '../../otel';
|
|
3
|
+
import { OtelLive } from '../../otel/index.js';
|
|
4
4
|
export const TracesView = ({ baseUrl = '', token, autoRefreshMs = 5000, limit = 200, }) => (_jsx(Box, { sx: { display: 'flex', flex: 1, minHeight: 0, overflow: 'hidden' }, children: _jsx(OtelLive, { baseUrl: baseUrl, token: token, autoRefreshMs: autoRefreshMs, defaultSignal: "traces", limit: limit }) }));
|
package/lib/views/otel/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
export { DashboardView } from './DashboardView';
|
|
6
|
-
export { TracesView } from './TracesView';
|
|
7
|
-
export { LogsView } from './LogsView';
|
|
8
|
-
export { MetricsView } from './MetricsView';
|
|
9
|
-
export { SqlView } from './SqlView';
|
|
10
|
-
export { SystemView } from './SystemView';
|
|
11
|
-
export { OtelHeader } from './OtelHeader';
|
|
12
|
-
export { useSimpleAuthStore } from './simpleAuthStore';
|
|
5
|
+
export { DashboardView } from './DashboardView.js';
|
|
6
|
+
export { TracesView } from './TracesView.js';
|
|
7
|
+
export { LogsView } from './LogsView.js';
|
|
8
|
+
export { MetricsView } from './MetricsView.js';
|
|
9
|
+
export { SqlView } from './SqlView.js';
|
|
10
|
+
export { SystemView } from './SystemView.js';
|
|
11
|
+
export { OtelHeader } from './OtelHeader.js';
|
|
12
|
+
export { useSimpleAuthStore } from './simpleAuthStore.js';
|
|
@@ -16,7 +16,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
16
16
|
*/
|
|
17
17
|
import { useState, useRef, useCallback } from 'react';
|
|
18
18
|
import { Box, Text } from '@primer/react';
|
|
19
|
-
import { parseJwtPayload, getDatalayerJwtUser, getDatalayerDisplayName, } from '../../utils/Jwt';
|
|
19
|
+
import { parseJwtPayload, getDatalayerJwtUser, getDatalayerDisplayName, } from '../../utils/Jwt.js';
|
|
20
20
|
// ── Component ─────────────────────────────────────────────────────
|
|
21
21
|
export const UserBadge = ({ token, variant = 'full', }) => {
|
|
22
22
|
const [open, setOpen] = useState(false);
|
|
@@ -8,9 +8,9 @@ import { useParams } from 'react-router-dom';
|
|
|
8
8
|
import { PageHeader, Heading, Text, Button, TextInput, FormControl, Textarea, Label, } from '@primer/react';
|
|
9
9
|
import { Box } from '@datalayer/primer-addons';
|
|
10
10
|
import { EyeIcon, EyeClosedIcon } from '@primer/octicons-react';
|
|
11
|
-
import { BoringAvatar } from '../../components/avatars';
|
|
12
|
-
import { useCache, useNavigate, useToast } from '../../hooks';
|
|
13
|
-
import { useRunStore } from '../../state';
|
|
11
|
+
import { BoringAvatar } from '../../components/avatars/index.js';
|
|
12
|
+
import { useCache, useNavigate, useToast } from '../../hooks/index.js';
|
|
13
|
+
import { useRunStore } from '../../state/index.js';
|
|
14
14
|
export const SecretEdit = () => {
|
|
15
15
|
const { secretId } = useParams();
|
|
16
16
|
const runStore = useRunStore();
|
|
@@ -6,8 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { useEffect, useState } from 'react';
|
|
7
7
|
import { PageHeader, FormControl, Button, TextInput, Textarea, Select, } from '@primer/react';
|
|
8
8
|
import { Box } from '@datalayer/primer-addons';
|
|
9
|
-
import { useCache, useNavigate, useToast } from '../../hooks';
|
|
10
|
-
import { useRunStore } from '../../state';
|
|
9
|
+
import { useCache, useNavigate, useToast } from '../../hooks/index.js';
|
|
10
|
+
import { useRunStore } from '../../state/index.js';
|
|
11
11
|
export const SecretNew = () => {
|
|
12
12
|
const runStore = useRunStore();
|
|
13
13
|
const navigate = useNavigate();
|
|
@@ -8,7 +8,7 @@ import { PageLayout, Button, IconButton, Text, Label } from '@primer/react';
|
|
|
8
8
|
import { Blankslate, PageHeader, Table, DataTable, } from '@primer/react/experimental';
|
|
9
9
|
import { Box } from '@datalayer/primer-addons';
|
|
10
10
|
import { EditIcon } from '@datalayer/icons-react';
|
|
11
|
-
import { useCache, useNavigate } from '../../hooks';
|
|
11
|
+
import { useCache, useNavigate } from '../../hooks/index.js';
|
|
12
12
|
const SecretsTable = () => {
|
|
13
13
|
const { useSecrets } = useCache();
|
|
14
14
|
const secretsQuery = useSecrets();
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
export * from './SecretEdit';
|
|
6
|
-
export * from './SecretNew';
|
|
7
|
-
export * from './Secrets';
|
|
5
|
+
export * from './SecretEdit.js';
|
|
6
|
+
export * from './SecretNew.js';
|
|
7
|
+
export * from './Secrets.js';
|