-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add indicator to warn when most t4c licenses are being used
Closes #1784
- Loading branch information
Showing
14 changed files
with
409 additions
and
24 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
101 changes: 85 additions & 16 deletions
101
frontend/src/app/openapi/api/settings-modelsources-t4-c-license-servers.service.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
frontend/src/app/openapi/model/public-license-server-with-usage.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
frontend/src/app/sessions/license-indicator/license-indicator.component.html
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 @@ | ||
<!-- | ||
~ SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
@if ((licenseUsageWrapperService.licenseServerUsage$ | async) !== undefined) { | ||
@for ( | ||
licenseServer of licenseUsageWrapperService.licenseServerUsage$ | async; | ||
track licenseServer.id | ||
) { | ||
@if (licenseServer.usage.free === 0) { | ||
<div | ||
class="my-1 flex items-center gap-1.5 rounded border bg-red-500 p-1 text-sm text-white shadow" | ||
> | ||
<mat-icon class="shrink-0">error</mat-icon> | ||
<span | ||
>All {{ licenseServer.usage.total }} TeamForCapella licenses are | ||
currently in use. You will not be able to start a new session until a | ||
license is available. Please make sure to terminate your sessions | ||
after use. | ||
</span> | ||
</div> | ||
} @else if (licenseServer.usage.free / licenseServer.usage.total < 0.4) { | ||
<div | ||
class="my-1 flex items-center gap-1.5 rounded border bg-yellow-300 p-1 text-sm shadow" | ||
> | ||
<mat-icon class="shrink-0">warning</mat-icon> | ||
<span | ||
>{{ licenseServer.usage.total - licenseServer.usage.free }}/{{ | ||
licenseServer.usage.total | ||
}} | ||
TeamForCapella licenses are currently in use. Please make sure to | ||
terminate your sessions after use. | ||
</span> | ||
</div> | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
frontend/src/app/sessions/license-indicator/license-indicator.component.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,18 @@ | ||
/* | ||
* SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import { AsyncPipe } from '@angular/common'; | ||
import { Component } from '@angular/core'; | ||
import { MatIcon } from '@angular/material/icon'; | ||
import { LicenseUsageWrapperService } from './license-usage.service'; | ||
|
||
@Component({ | ||
selector: 'app-license-indicator', | ||
standalone: true, | ||
imports: [MatIcon, AsyncPipe], | ||
templateUrl: './license-indicator.component.html', | ||
}) | ||
export class LicenseIndicatorComponent { | ||
constructor(public licenseUsageWrapperService: LicenseUsageWrapperService) {} | ||
} |
Oops, something went wrong.