Skip to content

Commit

Permalink
Merge pull request #934 from Piumal1999/intra-vendor-model-routing-po…
Browse files Browse the repository at this point in the history
…st-alpha

Improve the AI API policy adding UI
  • Loading branch information
ashera96 authored Feb 21, 2025
2 parents 75a7c2e + c5452f7 commit ed73e79
Show file tree
Hide file tree
Showing 7 changed files with 697 additions and 316 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,27 @@ const AIEndpoints = ({
defaultMessage='Production Endpoints'
/>
</Typography>
{productionEndpoints.map((endpoint) => (
<EndpointCard
key={endpoint.id}
endpoint={endpoint}
apiObject={apiObject}
isPrimary={endpoint.id === apiObject.primaryProductionEndpointId}
isDeleting={isDeleting}
onDelete={handleDelete}
onSetPrimary={handleSetAsPrimary}
onRemovePrimary={handleRemovePrimary}
/>
))}
{productionEndpoints.length > 0 ? (
productionEndpoints.map((endpoint) => (
<EndpointCard
key={endpoint.id}
endpoint={endpoint}
apiObject={apiObject}
isPrimary={endpoint.id === apiObject.primaryProductionEndpointId}
isDeleting={isDeleting}
onDelete={handleDelete}
onSetPrimary={handleSetAsPrimary}
onRemovePrimary={handleRemovePrimary}
/>
))
) : (
<Typography variant='body1'>
<FormattedMessage
id='Apis.Details.Endpoints.AIEndpoints.no.production.endpoints'
defaultMessage='No production endpoints configured'
/>
</Typography>
)}
</StyledPaper>
</Grid>
<Grid item xs={12}>
Expand All @@ -260,18 +269,27 @@ const AIEndpoints = ({
defaultMessage='Sandbox Endpoints'
/>
</Typography>
{sandboxEndpoints.map((endpoint) => (
<EndpointCard
key={endpoint.id}
endpoint={endpoint}
apiObject={apiObject}
isPrimary={endpoint.id === apiObject.primarySandboxEndpointId}
isDeleting={isDeleting}
onDelete={handleDelete}
onSetPrimary={handleSetAsPrimary}
onRemovePrimary={handleRemovePrimary}
/>
))}
{sandboxEndpoints.length > 0 ? (
sandboxEndpoints.map((endpoint) => (
<EndpointCard
key={endpoint.id}
endpoint={endpoint}
apiObject={apiObject}
isPrimary={endpoint.id === apiObject.primarySandboxEndpointId}
isDeleting={isDeleting}
onDelete={handleDelete}
onSetPrimary={handleSetAsPrimary}
onRemovePrimary={handleRemovePrimary}
/>
))
) : (
<Typography variant='body1'>
<FormattedMessage
id='Apis.Details.Endpoints.AIEndpoints.no.sandbox.endpoints'
defaultMessage='No sandbox endpoints configured'
/>
</Typography>
)}
</StyledPaper>
</Grid>
<Grid item xs={12}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ const Endpoint = () => {
path={'/' + urlPrefix + '/:api_uuid/endpoints/'}
component={() => <Endpoints api={api} />}
/>
{!isRestricted(['apim:api_manage']) && (
<Route
exact
path={'/' + urlPrefix + '/:api_uuid/endpoints/create'}
component={(props) => <AddEditAIEndpoint apiObject={api} {...props} />}
/>
)}
{!isRestricted(['apim:api_view', 'apim:api_manage']) && (
<>
<Route
exact
path={'/' + urlPrefix + '/:api_uuid/endpoints/create'}
component={(props) => <AddEditAIEndpoint apiObject={api} {...props} />}
/>
<Route
exact
path={'/' + urlPrefix + '/:api_uuid/endpoints/:id'}
component={(props) => <AddEditAIEndpoint apiObject={api} {...props} />}
/>
</>
<Route
exact
path={'/' + urlPrefix + '/:api_uuid/endpoints/:id'}
component={(props) => <AddEditAIEndpoint apiObject={api} {...props} />}
/>
)}
<Route component={ResourceNotFound} />
</Switch>
Expand Down
Loading

0 comments on commit ed73e79

Please sign in to comment.