-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release' into 'master'
RELEASE 2.2.0 See merge request arenadata/development/adcm!3931
- Loading branch information
Showing
723 changed files
with
36,312 additions
and
17,537 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { httpClient } from '@api/httpClient'; | ||
import type { AdcmConfig, ConfigurationSchema } from '@models/adcm'; | ||
|
||
export interface GetClusterAnsibleSettingsArgs { | ||
clusterId: number; | ||
} | ||
|
||
export interface GetClusterAnsibleSettingsSchemaArgs { | ||
clusterId: number; | ||
configGroupId: number; | ||
} | ||
|
||
export interface CreateClusterAnsibleSettingsArgs { | ||
clusterId: number; | ||
config: Partial<AdcmConfig>; | ||
} | ||
|
||
export class AdcmClusterAnsibleSettingsApi { | ||
public static async getConfig(args: GetClusterAnsibleSettingsArgs) { | ||
const response = await httpClient.get<AdcmConfig>(`/api/v2/clusters/${args.clusterId}/ansible-config/`); | ||
return response.data; | ||
} | ||
|
||
public static async getConfigSchema(args: GetClusterAnsibleSettingsSchemaArgs) { | ||
const response = await httpClient.get<ConfigurationSchema>( | ||
`/api/v2/clusters/${args.clusterId}/ansible-config-schema/`, | ||
); | ||
return response.data; | ||
} | ||
|
||
public static async createConfiguration(args: CreateClusterAnsibleSettingsArgs) { | ||
const { clusterId, config } = args; | ||
const response = await httpClient.post<AdcmConfig>(`/api/v2/clusters/${clusterId}/ansible-config/`, config); | ||
return response.data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
adcm-web/app/src/components/common/DynamicActionDialog/DynamicActionDialog.utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...nts/common/DynamicActionDialog/DynamicActionHostMapping/DynamicActionHostMapping.utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { | ||
AdcmDynamicActionDetails, | ||
AdcmHostComponentMapRuleAction, | ||
AdcmMapping, | ||
AdcmMappingComponent, | ||
AdcmMappingComponentService, | ||
} from '@models/adcm'; | ||
import type { DisabledComponentsMappings } from '@pages/cluster/ClusterMapping/ClusterMapping.types'; | ||
|
||
export const getComponentMapActions = ( | ||
actionDetails: AdcmDynamicActionDetails, | ||
service: AdcmMappingComponentService, | ||
component: AdcmMappingComponent, | ||
) => { | ||
const result = new Set<AdcmHostComponentMapRuleAction>(); | ||
|
||
for (const rule of actionDetails.hostComponentMapRules) { | ||
if (rule.service === service.name && rule.component === component.name) { | ||
result.add(rule.action); | ||
} | ||
} | ||
|
||
return result; | ||
}; | ||
|
||
export const getDisabledMappings = (mapping: AdcmMapping[]) => { | ||
const result: DisabledComponentsMappings = {}; | ||
|
||
for (const m of mapping) { | ||
if (result[m.componentId] === undefined) { | ||
result[m.componentId] = new Set(); | ||
} | ||
|
||
result[m.componentId].add(m.hostId); | ||
} | ||
|
||
return result; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
adcm-web/app/src/components/common/PermissionsChecker/PermissionsChecker.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.spinnerWrapper { | ||
margin: auto 5%; | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
} |
34 changes: 34 additions & 0 deletions
34
adcm-web/app/src/components/common/PermissionsChecker/PermissionsChecker.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import s from './PermissionsChecker.module.scss'; | ||
import { RequestState } from '@models/loadState'; | ||
import NotFoundPage from '@pages/NotFoundPage/NotFoundPage'; | ||
import AccessDeniedPage from '@pages/AccessDeniedPage/AccessDeniedPage'; | ||
import { Spinner } from '@uikit'; | ||
|
||
interface WithHttpResponseRouteProps { | ||
children?: React.ReactNode; | ||
requestState?: RequestState; | ||
} | ||
|
||
const PermissionsChecker = ({ children, requestState }: WithHttpResponseRouteProps) => { | ||
if (requestState === RequestState.Pending) { | ||
return ( | ||
<div className={s.spinnerWrapper}> | ||
<Spinner /> | ||
</div> | ||
); | ||
} | ||
|
||
if (requestState === RequestState.AccessDenied) { | ||
return <AccessDeniedPage />; | ||
} | ||
|
||
if (requestState === RequestState.NotFound) { | ||
return <NotFoundPage />; | ||
} | ||
|
||
if (requestState === RequestState.Completed) { | ||
return <>{children}</>; | ||
} | ||
}; | ||
|
||
export default PermissionsChecker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.