diff --git a/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.ts b/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.ts
index 150c3a698a..12377e2c5c 100644
--- a/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.ts
+++ b/frontend/src/app/settings/modelsources/t4c-settings/edit-t4c-instance/edit-t4c-instance.component.ts
@@ -11,8 +11,8 @@ import { filter, map } from 'rxjs';
import { BreadcrumbsService } from 'src/app/general/breadcrumbs/breadcrumbs.service';
import { ToastService } from 'src/app/helpers/toast/toast.service';
import {
- BaseT4CInstance,
NewT4CInstance,
+ PatchT4CInstance,
Protocol,
T4CInstanceService,
} from 'src/app/services/settings/t4c-instance.service';
@@ -34,6 +34,8 @@ export class EditT4CInstanceComponent implements OnInit, OnDestroy {
instanceId?: number;
capellaVersions?: ToolVersion[];
+ isArchived?: boolean;
+
portValidators = [
Validators.pattern(/^\d*$/),
Validators.min(0),
@@ -91,6 +93,7 @@ export class EditT4CInstanceComponent implements OnInit, OnDestroy {
.pipe(untilDestroyed(this), filter(Boolean))
.subscribe((t4cInstance) => {
t4cInstance.password = '***********';
+ this.isArchived = t4cInstance.is_archived;
this.form.patchValue(t4cInstance);
this.breadcrumbsService.updatePlaceholder({ t4cInstance });
});
@@ -139,7 +142,7 @@ export class EditT4CInstanceComponent implements OnInit, OnDestroy {
update(): void {
if (this.form.valid && this.instanceId) {
this.t4cInstanceService
- .updateInstance(this.instanceId, this.form.value as BaseT4CInstance)
+ .updateInstance(this.instanceId, this.form.value as PatchT4CInstance)
.subscribe((instance) => {
this.editing = false;
this.form.disable();
@@ -151,6 +154,24 @@ export class EditT4CInstanceComponent implements OnInit, OnDestroy {
}
}
+ toggleArchive(): void {
+ if (this.instanceId) {
+ this.t4cInstanceService
+ .updateInstance(this.instanceId, {
+ is_archived: !this.isArchived,
+ })
+ .subscribe((instance) => {
+ this.isArchived = instance.is_archived;
+ this.toastService.showSuccess(
+ 'Instance updated',
+ `The instance “${instance.name}” is now ${
+ this.isArchived ? 'archived' : 'unarchived'
+ }.`
+ );
+ });
+ }
+ }
+
submit(): void {
if (this.existing) {
this.update();
diff --git a/frontend/src/app/settings/modelsources/t4c-settings/t4c-settings.component.html b/frontend/src/app/settings/modelsources/t4c-settings/t4c-settings.component.html
index 804c43b309..cce15fc2e6 100644
--- a/frontend/src/app/settings/modelsources/t4c-settings/t4c-settings.component.html
+++ b/frontend/src/app/settings/modelsources/t4c-settings/t4c-settings.component.html
@@ -19,7 +19,11 @@
*ngFor="let instance of t4cInstanceService.t4cInstances$ | async"
[routerLink]="['instance', instance.id]"
>
-
+
tag Capella version:
@@ -28,6 +32,13 @@
link Host:
{{ instance.protocol }}://{{ instance.host }}:{{ instance.port }}
+
+
+ Archived
+