backend.ai-ui 25.18.0-canary-2e72edfbc-20251219 → 25.18.0-canary-ee47c4e58-20251222

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.
Files changed (36) hide show
  1. package/dist/__generated__/BAIDomainSelectorQuery.graphql.d.ts +13 -0
  2. package/dist/__generated__/BAIProjectBulkEditModalFragment.graphql.d.ts +12 -0
  3. package/dist/__generated__/BAIProjectBulkEditModalProjectMutation.graphql.d.ts +29 -0
  4. package/dist/__generated__/BAIProjectResourcePolicySelectorQuery.graphql.d.ts +14 -0
  5. package/dist/__generated__/BAIProjectSettingModalAssociateMutation.graphql.d.ts +17 -0
  6. package/dist/__generated__/BAIProjectSettingModalCreateMutation.graphql.d.ts +31 -0
  7. package/dist/__generated__/BAIProjectSettingModalFragment.graphql.d.ts +23 -0
  8. package/dist/__generated__/BAIProjectSettingModalModifyMutation.graphql.d.ts +45 -0
  9. package/dist/__generated__/BAIProjectSettingModalQuery.graphql.d.ts +13 -0
  10. package/dist/__generated__/BAIProjectTableDeleteMutation.graphql.d.ts +16 -0
  11. package/dist/__generated__/BAIProjectTablePurgeMutation.graphql.d.ts +16 -0
  12. package/dist/__generated__/BAIResourceGroupSelectQuery.graphql.d.ts +13 -0
  13. package/dist/backend.ai-ui.js +15811 -14072
  14. package/dist/backend.ai-ui.js.map +1 -1
  15. package/dist/components/BAIAlert.d.ts +7 -0
  16. package/dist/components/BAIAllowedHostNamesSelect.d.ts +6 -0
  17. package/dist/components/BAIDynamicUnitInputNumber.d.ts +15 -0
  18. package/dist/components/BAIDynamicUnitInputNumberWithSlider.d.ts +12 -0
  19. package/dist/components/BAIProjectResourceGroupSelect.d.ts +9 -0
  20. package/dist/components/BAITextHighlighter.d.ts +8 -0
  21. package/dist/components/fragments/BAIDomainSelector.d.ts +7 -0
  22. package/dist/components/fragments/BAIProjectBulkEditModal.d.ts +7 -0
  23. package/dist/components/fragments/BAIProjectResourcePolicySelector.d.ts +5 -0
  24. package/dist/components/fragments/BAIProjectSettingModal.d.ts +8 -0
  25. package/dist/components/fragments/BAIProjectTable.d.ts +3 -2
  26. package/dist/components/fragments/BAIResourceGroupSelect.d.ts +5 -0
  27. package/dist/components/fragments/index.d.ts +9 -0
  28. package/dist/components/index.d.ts +9 -0
  29. package/dist/components/provider/BAIClientProvider/types.d.ts +4 -0
  30. package/dist/components/provider/BAIMetaDataProvider/types.d.ts +1 -11
  31. package/dist/helper/index.d.ts +1 -0
  32. package/dist/helper/reactQueryAlias.d.ts +18 -0
  33. package/dist/hooks/index.d.ts +70 -0
  34. package/dist/hooks/useEventNotStable.d.ts +1 -1
  35. package/dist/hooks/usePaginatedQuery.d.ts +1 -1
  36. package/package.json +4 -2
@@ -0,0 +1,7 @@
1
+ import { AlertProps } from 'antd';
2
+ import { default as React } from 'react';
3
+ export interface BAIAlertProps extends AlertProps {
4
+ ghostInfoBg?: boolean;
5
+ }
6
+ declare const BAIAlert: React.FC<BAIAlertProps>;
7
+ export default BAIAlert;
@@ -0,0 +1,6 @@
1
+ import { SelectProps } from 'antd';
2
+ import { default as React } from 'react';
3
+ interface AllowedHostNamesSelectProps extends SelectProps {
4
+ }
5
+ declare const AllowedHostNamesSelect: React.FC<AllowedHostNamesSelectProps>;
6
+ export default AllowedHostNamesSelect;
@@ -0,0 +1,15 @@
1
+ import { InputNumberProps } from 'antd';
2
+ import { default as React, RefObject } from 'react';
3
+ export interface BAIDynamicUnitInputNumberProps extends Omit<InputNumberProps, 'step' | 'max' | 'min' | 'value' | 'onChange'> {
4
+ dynamicSteps?: number[];
5
+ disableAutoUnit?: boolean;
6
+ max?: string;
7
+ min?: string;
8
+ value?: string | null | undefined;
9
+ units?: string[];
10
+ roundStep?: number;
11
+ onChange?: (value: string) => void;
12
+ ref?: RefObject<HTMLInputElement | null>;
13
+ }
14
+ declare const BAIDynamicUnitInputNumber: React.FC<BAIDynamicUnitInputNumberProps>;
15
+ export default BAIDynamicUnitInputNumber;
@@ -0,0 +1,12 @@
1
+ import { BAIDynamicUnitInputNumberProps } from './BAIDynamicUnitInputNumber';
2
+ import { SliderMarks } from 'antd/es/slider';
3
+ import { default as React } from 'react';
4
+ export interface BAIDynamicUnitInputNumberWithSliderProps extends BAIDynamicUnitInputNumberProps {
5
+ extraMarks?: SliderMarks;
6
+ hideSlider?: boolean;
7
+ warn?: string;
8
+ step?: number;
9
+ inputMinWidth?: number;
10
+ }
11
+ declare const DynamicUnitInputNumberWithSlider: React.FC<BAIDynamicUnitInputNumberWithSliderProps>;
12
+ export default DynamicUnitInputNumberWithSlider;
@@ -0,0 +1,9 @@
1
+ import { BAISelectProps } from './BAISelect';
2
+ import { default as React } from 'react';
3
+ interface BAIProjectResourceGroupSelectProps extends BAISelectProps {
4
+ projectName: string;
5
+ autoSelectDefault?: boolean;
6
+ filter?: (projectName: string) => boolean;
7
+ }
8
+ declare const BAIProjectResourceGroupSelect: React.FC<BAIProjectResourceGroupSelectProps>;
9
+ export default BAIProjectResourceGroupSelect;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ interface BAITextHighlighterProps {
3
+ children?: string | null;
4
+ keyword?: string;
5
+ style?: React.CSSProperties;
6
+ }
7
+ declare const _default: React.NamedExoticComponent<BAITextHighlighterProps>;
8
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { SelectProps } from 'antd';
2
+ import { default as React } from 'react';
3
+ interface Props extends SelectProps {
4
+ onSelectDomain?: (project: any) => void;
5
+ }
6
+ declare const BAIDomainSelector: React.FC<Props>;
7
+ export default BAIDomainSelector;
@@ -0,0 +1,7 @@
1
+ import { BAIProjectBulkEditModalFragment$key } from '../../__generated__/BAIProjectBulkEditModalFragment.graphql';
2
+ import { BAIModalProps } from '../BAIModal';
3
+ export interface BAIProjectBulkEditModalProps extends BAIModalProps {
4
+ selectedProjectFragments: BAIProjectBulkEditModalFragment$key;
5
+ }
6
+ declare const BAIProjectBulkEditModal: ({ selectedProjectFragments, ...tableProps }: BAIProjectBulkEditModalProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default BAIProjectBulkEditModal;
@@ -0,0 +1,5 @@
1
+ import { BAISelectProps } from '../BAISelect';
2
+ export interface BAIProjectResourcePolicySelectorProps extends Omit<BAISelectProps, 'options'> {
3
+ }
4
+ declare const BAIProjectResourcePolicySelector: ({ ...selectProps }: BAIProjectResourcePolicySelectorProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default BAIProjectResourcePolicySelector;
@@ -0,0 +1,8 @@
1
+ import { BAIProjectSettingModalFragment$key } from '../../__generated__/BAIProjectSettingModalFragment.graphql';
2
+ import { BAIModalProps } from '../BAIModal';
3
+ export interface BAIProjectSettingModalProps extends Omit<BAIModalProps, 'title' | 'loading'> {
4
+ projectFragment: BAIProjectSettingModalFragment$key | null;
5
+ }
6
+ export type BAIProjectSettingModalFragmentKey = BAIProjectSettingModalFragment$key;
7
+ declare const BAIProjectSettingModal: ({ projectFragment, ...modalProps }: BAIProjectSettingModalProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default BAIProjectSettingModal;
@@ -6,7 +6,8 @@ type Project = NonNullable<NonNullable<BAIProjectTableFragment$data>[number]>;
6
6
  export interface BAIProjectTableProps extends Omit<BAITableProps<Project>, 'dataSource' | 'columns' | 'rowKey' | 'onChangeOrder'> {
7
7
  projectFragment: BAIProjectTableFragment$key;
8
8
  onChangeOrder?: (order: (typeof availableProjectSorterValues)[number] | null) => void;
9
- onEditProject: (project: Project) => void;
9
+ onClickProjectEditButton: (project: Project) => void;
10
+ updateFetchKey?: () => void;
10
11
  }
11
- declare const BAIProjectTable: ({ projectFragment, onChangeOrder, ...tableProps }: BAIProjectTableProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const BAIProjectTable: ({ projectFragment, onChangeOrder, onClickProjectEditButton, updateFetchKey, ...tableProps }: BAIProjectTableProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export default BAIProjectTable;
@@ -0,0 +1,5 @@
1
+ import { BAISelectProps } from '../BAISelect';
2
+ export interface BAIResourceGroupSelectProps extends Omit<BAISelectProps, 'options'> {
3
+ }
4
+ declare const BAIResourceGroupSelect: ({ ...selectProps }: BAIResourceGroupSelectProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default BAIResourceGroupSelect;
@@ -37,3 +37,12 @@ export { default as BAIProjectTable, availableProjectSorterKeys, availableProjec
37
37
  export type { BAIProjectTableProps } from './BAIProjectTable';
38
38
  export { default as BAIAllowedVfolderHostsWithPermission } from './BAIAllowedVfolderHostsWithPermission';
39
39
  export type { BAIAllowedVfolderHostsWithPermissionProps } from './BAIAllowedVfolderHostsWithPermission';
40
+ export { default as BAIDomainSelector } from './BAIDomainSelector';
41
+ export { default as BAIProjectSettingModal } from './BAIProjectSettingModal';
42
+ export type { BAIProjectSettingModalFragmentKey } from './BAIProjectSettingModal';
43
+ export { default as BAIProjectResourcePolicySelector } from './BAIProjectResourcePolicySelector';
44
+ export type { BAIProjectResourcePolicySelectorProps } from './BAIProjectResourcePolicySelector';
45
+ export { default as BAIResourceGroupSelect } from './BAIResourceGroupSelect';
46
+ export type { BAIResourceGroupSelectProps } from './BAIResourceGroupSelect';
47
+ export { default as BAIProjectBulkEditModal } from './BAIProjectBulkEditModal';
48
+ export type { BAIProjectBulkEditModalProps } from './BAIProjectBulkEditModal';
@@ -37,6 +37,15 @@ export { default as BAIFetchKeyButton } from './BAIFetchKeyButton';
37
37
  export { default as BAIResourceNumberWithIcon, ResourceTypeIcon, } from './BAIResourceNumberWithIcon';
38
38
  export type { BAIResourceNumberWithIconProps } from './BAIResourceNumberWithIcon';
39
39
  export { default as BAINumberWithUnit } from './BAINumberWithUnit';
40
+ export { default as BAIAllowedHostNamesSelect } from './BAIAllowedHostNamesSelect';
41
+ export { default as BAIDynamicUnitInputNumber } from './BAIDynamicUnitInputNumber';
42
+ export type { BAIDynamicUnitInputNumberProps } from './BAIDynamicUnitInputNumber';
43
+ export { default as BAIDynamicUnitInputNumberWithSlider } from './BAIDynamicUnitInputNumberWithSlider';
44
+ export type { BAIDynamicUnitInputNumberWithSliderProps } from './BAIDynamicUnitInputNumberWithSlider';
45
+ export { default as BAIAlert } from './BAIAlert';
46
+ export type { BAIAlertProps } from './BAIAlert';
47
+ export { default as BAIProjectResourceGroupSelect } from './BAIProjectResourceGroupSelect';
48
+ export { default as BAITextHighlighter } from './BAITextHighlighter';
40
49
  export * from './Table';
41
50
  export * from './fragments';
42
51
  export * from './provider';
@@ -4,6 +4,10 @@ export interface BAIClient {
4
4
  info: (name: string) => Promise<vfolderInfo>;
5
5
  list: (path: string) => Promise<any>;
6
6
  list_hosts: () => Promise<VFolderHosts>;
7
+ list_all_hosts: () => Promise<{
8
+ allowed: Array<string>;
9
+ default: string;
10
+ }>;
7
11
  list_files: (path: string, id: string) => Promise<{
8
12
  items: Array<VFolderFile>;
9
13
  }>;
@@ -1,17 +1,7 @@
1
+ import { ResourceSlotDetail } from '../../../hooks';
1
2
  export type DeviceMetaData = {
2
3
  [name: string]: ResourceSlotDetail | undefined;
3
4
  };
4
- export type ResourceSlotDetail = {
5
- slot_name: string;
6
- description: string;
7
- human_readable_name: string;
8
- display_unit: string;
9
- number_format: {
10
- binary: boolean;
11
- round_length: number;
12
- };
13
- display_icon: string;
14
- };
15
5
  export declare const baseResourceSlotNames: readonly ["cpu", "mem"];
16
6
  export type BaseResourceSlotName = (typeof baseResourceSlotNames)[number];
17
7
  export declare const knownAcceleratorResourceSlotNames: readonly ["cuda.device", "cuda.shares", "rocm.device", "tpu.device", "ipu.device", "atom.device", "atom-plus.device", "atom-max.device", "gaudi2.device", "warboy.device", "rngd.device", "hyperaccel-lpu.device"];
@@ -171,4 +171,5 @@ export declare const omitNullAndUndefinedFields: <T extends Record<string, any>>
171
171
  * - Characters 26-51 map to lowercase letters a-z
172
172
  */
173
173
  export declare const generateRandomString: (n?: number) => string;
174
+ export declare const isValidUUID: (uuid: string) => boolean;
174
175
  export {};
@@ -0,0 +1,18 @@
1
+ import { QueryKey, useQuery, useMutation, UseSuspenseQueryOptions } from '@tanstack/react-query';
2
+ export declare const useTanQuery: typeof useQuery;
3
+ export declare const useTanMutation: typeof useMutation;
4
+ /**
5
+ * Custom hook that wraps the `useQuery` hook from `react-query` and enables suspense mode refetch using `fetchKey`.
6
+ *
7
+ * @template TQueryFnData The type of the data returned by the query function.
8
+ * @template TError The type of the error thrown by the query function.
9
+ * @template TData The type of the data returned by the query.
10
+ * @template TQueryKey The type of the query key.
11
+ *
12
+ * @param {Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & { fetchKey?: string; }, 'suspense'>} options The options for the query.
13
+ *
14
+ * @returns {QueryResult<TQueryFnData, TError, TData>} The query result.
15
+ */
16
+ export declare const useSuspenseTanQuery: <TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>({ fetchKey, ...options }: UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
17
+ fetchKey?: string;
18
+ }) => import('@tanstack/react-query').UseSuspenseQueryResult<TData, TError>;
@@ -1,3 +1,4 @@
1
+ import { GraphQLTaggedNode, MutationParameters } from 'relay-runtime';
1
2
  type UseMemoizedJsonParseOptions<T> = {
2
3
  fallbackValue: T;
3
4
  };
@@ -14,6 +15,74 @@ type UseMemoizedJsonParseOptions<T> = {
14
15
  * const data = useMemoizedJSONParse<MyType>(jsonString, { fallbackValue: defaultValue });
15
16
  */
16
17
  export declare function useMemoizedJSONParse<T = any>(jsonString: string | undefined | null, options?: UseMemoizedJsonParseOptions<T>): T;
18
+ export declare const useDateISOState: (initialValue?: string) => readonly [string, (newValue?: string | undefined) => void];
19
+ export declare const useUpdatableState: (initialValue: string) => readonly [string, (newValue?: string | undefined) => void];
20
+ export declare const useAllowedHostNames: () => string[];
21
+ export type ResourceSlotDetail = {
22
+ slot_name: string;
23
+ description: string;
24
+ human_readable_name: string;
25
+ display_unit: string;
26
+ number_format: {
27
+ binary: boolean;
28
+ round_length: number;
29
+ };
30
+ display_icon: string;
31
+ };
32
+ /**
33
+ * Custom hook to fetch resource slot details by resource group name.
34
+ * @param resourceGroupName - The name of the resource group. if not provided, it will use resource/device_metadata.json
35
+ * @returns An array containing the resource slots and a refresh function.
36
+ */
37
+ export declare const useResourceSlotsDetails: (resourceGroupName?: string) => {
38
+ resourceSlotsInRG: {
39
+ cpu?: ResourceSlotDetail | undefined;
40
+ mem?: ResourceSlotDetail | undefined;
41
+ "cuda.device"?: ResourceSlotDetail | undefined;
42
+ "cuda.shares"?: ResourceSlotDetail | undefined;
43
+ "rocm.device"?: ResourceSlotDetail | undefined;
44
+ "tpu.device"?: ResourceSlotDetail | undefined;
45
+ "ipu.device"?: ResourceSlotDetail | undefined;
46
+ "atom.device"?: ResourceSlotDetail | undefined;
47
+ "atom-plus.device"?: ResourceSlotDetail | undefined;
48
+ "atom-max.device"?: ResourceSlotDetail | undefined;
49
+ "gaudi2.device"?: ResourceSlotDetail | undefined;
50
+ "warboy.device"?: ResourceSlotDetail | undefined;
51
+ "rngd.device"?: ResourceSlotDetail | undefined;
52
+ "hyperaccel-lpu.device"?: ResourceSlotDetail | undefined;
53
+ };
54
+ deviceMetaData: import('../components').DeviceMetaData;
55
+ mergedResourceSlots: import('../components').DeviceMetaData & {
56
+ cpu?: ResourceSlotDetail | undefined;
57
+ mem?: ResourceSlotDetail | undefined;
58
+ "cuda.device"?: ResourceSlotDetail | undefined;
59
+ "cuda.shares"?: ResourceSlotDetail | undefined;
60
+ "rocm.device"?: ResourceSlotDetail | undefined;
61
+ "tpu.device"?: ResourceSlotDetail | undefined;
62
+ "ipu.device"?: ResourceSlotDetail | undefined;
63
+ "atom.device"?: ResourceSlotDetail | undefined;
64
+ "atom-plus.device"?: ResourceSlotDetail | undefined;
65
+ "atom-max.device"?: ResourceSlotDetail | undefined;
66
+ "gaudi2.device"?: ResourceSlotDetail | undefined;
67
+ "warboy.device"?: ResourceSlotDetail | undefined;
68
+ "rngd.device"?: ResourceSlotDetail | undefined;
69
+ "hyperaccel-lpu.device"?: ResourceSlotDetail | undefined;
70
+ };
71
+ refresh: (newValue?: string | undefined) => void;
72
+ isLoading: false;
73
+ };
74
+ export declare function useMutationWithPromise<T extends MutationParameters>(mutation: GraphQLTaggedNode): (variables: T["variables"]) => Promise<T["response"]>;
75
+ export declare const baiSignedRequestWithPromise: ({ method, url, body, client, }: {
76
+ method: string;
77
+ url: string;
78
+ body?: any;
79
+ client: any;
80
+ }) => any;
81
+ export declare const useBAISignedRequestWithPromise: () => ({ method, url, body, }: {
82
+ method: string;
83
+ url: string;
84
+ body?: any;
85
+ }) => any;
17
86
  export { default as useErrorMessageResolver } from './useErrorMessageResolver';
18
87
  export { default as useViewer } from './useViewer';
19
88
  export type { ErrorResponse } from './useErrorMessageResolver';
@@ -22,3 +91,4 @@ export { default as useGetAvailableFolderName } from './useGetAvailableFolderNam
22
91
  export { useInterval, useIntervalValue } from './useIntervalValue';
23
92
  export { default as useBAILogger, ContextualLogger, LogLevel, } from './useBAILogger';
24
93
  export type { LoggerPlugin, LogContext, BAILogger } from './useBAILogger';
94
+ export { useEventNotStable } from './useEventNotStable';
@@ -1 +1 @@
1
- export declare function useEventNotStable<Args extends unknown[], Return>(handler: (...args: Args) => Return): (...args: Args) => Return | undefined;
1
+ export declare function useEventNotStable<Args extends unknown[], Return>(handler: (...args: Args) => Return): (...args: Args) => Return;
@@ -13,7 +13,7 @@ export declare function useLazyPaginatedQuery<T extends OperationType & {
13
13
  }, ItemType>(query: GraphQLTaggedNode, initialPaginationVariables: Pick<T['variables'], 'limit'>, otherVariables: Omit<Partial<T['variables']>, 'limit' | 'offset'>, options: Parameters<typeof useLazyLoadQuery<T>>[2], { getItem, getId, getTotal }: extraOptions<T['response'], ItemType>): {
14
14
  paginationData: ItemType[] | undefined;
15
15
  result: T["response"];
16
- loadNext: () => void | undefined;
16
+ loadNext: () => void;
17
17
  hasNext: boolean;
18
18
  isLoadingNext: boolean;
19
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend.ai-ui",
3
- "version": "25.18.0-canary-2e72edfbc-20251219",
3
+ "version": "25.18.0-canary-ee47c4e58-20251222",
4
4
  "description": "React components for Backend.AI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -161,6 +161,7 @@
161
161
  "@types/relay-test-utils": "^19.0.0",
162
162
  "@vitejs/plugin-react": "^4.7.0",
163
163
  "babel-plugin-react-compiler": "^1.0.0",
164
+ "babel-jest": "^30.2.0",
164
165
  "eslint": "^8.57.1",
165
166
  "eslint-plugin-import": "^2.31.0",
166
167
  "eslint-plugin-react": "^7.37.4",
@@ -195,7 +196,8 @@
195
196
  "jsx": "react-jsx"
196
197
  }
197
198
  }
198
- ]
199
+ ],
200
+ "^.+\\.(js|jsx|ts|tsx)$": "babel-jest"
199
201
  },
200
202
  "setupFilesAfterEnv": [
201
203
  "./setupTests.ts"