Skip to content

Commit

Permalink
ref
Browse files Browse the repository at this point in the history
  • Loading branch information
xsalonx committed Apr 30, 2024
1 parent 09bf895 commit 6178857
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { tooltip } from '../popover/tooltip.js';
import spinner from '../spinner.js';
import { configurationService } from '../../../services/configurationService.js';
import { h, iconWarning } from '/js/src/index.js';
import { buildUrl } from '../../../utilities/fetch/buildUrl.js';

/**
* Format environment links
Expand All @@ -23,7 +24,11 @@ import { h, iconWarning } from '/js/src/index.js';
*/
export const getAliEcsEnvironmentLink = ({ environmentId }) =>
configurationService.configuration$.getCurrent().match({
Success: ({ AliEcsGuiUrl }) => h('a', { href: `${AliEcsGuiUrl}?page=environment&id=${environmentId}`, target: '_blank' }, 'ECS'),
Success: ({ AliEcsGuiUrl }) => h(
'a',
{ target: '_blank', href: buildUrl(AliEcsGuiUrl, { page: 'environment', id: environmentId }) },
'ECS',
),
Loading: () => spinner({ size: 3, absolute: false }),
Failure: () => tooltip(iconWarning(), 'Error when fetching configuration'),
NotAsked: () => tooltip(iconWarning(), 'No configuration was asked for'),
Expand Down

0 comments on commit 6178857

Please sign in to comment.