-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: yaacov <kobi.zamir@gmail.com>
- Loading branch information
Showing
7 changed files
with
47 additions
and
18 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
26 changes: 26 additions & 0 deletions
26
...es/Providers/views/details/components/DetailsSection/utils/getVSphereProviderWebUILink.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,26 @@ | ||
import { V1beta1Provider } from '@kubev2v/types'; | ||
|
||
import { getProviderUIAnnotation } from './getProviderUIAnnotation'; | ||
|
||
/** | ||
* A function for auto calculating the vSphere UI link. | ||
* It extracts the provider's vSphere UI link from the vSphere URL by searching for the URL's | ||
*/ | ||
export const getVSphereProviderWebUILink = (provider: V1beta1Provider): string => { | ||
// Check for custom link | ||
const customLink = getProviderUIAnnotation(provider); | ||
if (customLink) { | ||
return customLink; | ||
} | ||
|
||
// Calculate link using API URL | ||
const url = provider?.spec?.url || ''; | ||
const suffix = '/sdk'; | ||
const newSuffix = '/ui'; | ||
|
||
if (url.endsWith(suffix)) { | ||
return url.slice(0, -suffix.length) + newSuffix; | ||
} else { | ||
return url; | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
...nsole-plugin/src/modules/Providers/views/details/components/DetailsSection/utils/index.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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// @index(['./*', /style/g], f => `export * from '${f.path}';`) | ||
export * from './getOvirtProviderWebUILink'; | ||
export * from './getProviderUIAnnotation'; | ||
export * from './getVSphereProviderWebUILink'; | ||
// @endindex |