Skip to content

Commit

Permalink
chore!: split apis (#1718)
Browse files Browse the repository at this point in the history
  • Loading branch information
astandrik authored Nov 28, 2024
1 parent 0faaf87 commit e050bd7
Show file tree
Hide file tree
Showing 56 changed files with 1,194 additions and 1,069 deletions.
2 changes: 1 addition & 1 deletion src/components/MetricChart/getChartData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getChartData = async (
const until = Math.round(Date.now() / 1000);
const from = until - TIMEFRAMES[timeFrame];

return window.api.getChartData(
return window.api.viewer.getChartData(
{target: targetString, from, until, maxDataPoints, database},
{signal},
);
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Nodes/getNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const getNodes: FetchData<

const dataFieldsRequired = getRequiredDataFields(columnsIds, NODES_COLUMNS_TO_DATA_FIELDS);

const response = await window.api.getNodes({
const response = await window.api.viewer.getNodes({
type,
storage,
tablets,
Expand Down
4 changes: 2 additions & 2 deletions src/containers/PDiskPage/PDiskPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function PDiskPage() {

const handleRestart = async (isRetry?: boolean) => {
if (pDiskParamsDefined) {
const response = await window.api[
const response = await window.api.pdisk[
newDiskApiAvailable ? 'restartPDisk' : 'restartPDiskOld'
]({nodeId, pDiskId, force: isRetry});

Expand All @@ -109,7 +109,7 @@ export function PDiskPage() {
isRetry?: boolean,
) => {
if (pDiskParamsDefined) {
const response = await window.api.changePDiskStatus({
const response = await window.api.pdisk.changePDiskStatus({
nodeId,
pDiskId,
force: isRetry,
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Storage/StorageNodes/getNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const getStorageNodes: FetchData<

const dataFieldsRequired = getRequiredDataFields(columnsIds, NODES_COLUMNS_TO_DATA_FIELDS);

const response = await window.api.getNodes({
const response = await window.api.viewer.getNodes({
type,
storage,
limit,
Expand Down
4 changes: 3 additions & 1 deletion src/containers/VDiskPage/VDiskPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ export function VDiskPage() {

const handleEvictVDisk = async (isRetry?: boolean) => {
if (vDiskIdParamsDefined) {
return window.api[newDiskApiAvailable ? 'evictVDisk' : 'evictVDiskOld']({
return (
newDiskApiAvailable ? window.api.vdisk.evictVDisk : window.api.tablets.evictVDiskOld
)({
groupId: GroupID,
groupGeneration: GroupGeneration,
failRealmIdx: Ring,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export {AsideNavigation} from './containers/AsideNavigation/AsideNavigation';
export {configureStore, rootReducer} from './store';
export {default as appRoutes} from './routes';

export {createApi, YdbEmbeddedAPI, YdbWebVersionAPI} from './services/api';
export {createApi, YdbEmbeddedAPI} from './services/api';
export {settingsManager} from './services/settings';
export {getUserSettings} from './containers/UserSettings/settings';
export {setSettingValue, getSettingValue} from './store/reducers/settings/settings';
Expand Down
Loading

0 comments on commit e050bd7

Please sign in to comment.