mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-06 10:58:48 +00:00
feat: console feature api (#1480)
This commit is contained in:
@@ -28,6 +28,23 @@
|
||||
</app-card>
|
||||
</ng-container>
|
||||
|
||||
<h2>{{'FEATURES.TITLE' | translate}}</h2>
|
||||
<p class="top-desc">{{'FEATURES.DESCRIPTION' | translate}}</p>
|
||||
<div *ngIf="features" class="tier">
|
||||
<mat-icon>stars</mat-icon>
|
||||
<div class="text" *ngIf="features.tier">
|
||||
<p class="title"><strong>ZITADEL {{features.tier.name}}</strong></p>
|
||||
<p>{{features.tier?.description}}</p>
|
||||
<p>{{'FEATURES.TIERSTATES.'+features.tier.state | translate}}</p>
|
||||
<p>{{features.tier?.statusInfo}}</p>
|
||||
</div>
|
||||
<span class="fill-space"></span>
|
||||
<a class="ext" href="https://zitadel.ch/pricing" target="_blank"><i
|
||||
class="las la-external-link-alt"></i></a>
|
||||
|
||||
<button mat-raised-button [routerLink]="['features']">{{'FEATURES.BTN-EDIT' | translate}}</button>
|
||||
</div>
|
||||
|
||||
<ng-template appHasRole [appHasRole]="['policy.read']">
|
||||
<app-policy-grid [type]="PolicyGridType.ORG"></app-policy-grid>
|
||||
</ng-template>
|
||||
|
||||
@@ -2,11 +2,62 @@
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.2rem;
|
||||
letter-spacing: .05em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.top-desc {
|
||||
color: var(--grey);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.sub {
|
||||
color: var(--grey);
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.tier {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 1rem;
|
||||
border-radius: .5rem;
|
||||
color: white;
|
||||
background-color: rgb(245, 203, 99);
|
||||
margin-bottom: .5rem;
|
||||
|
||||
.ext {
|
||||
margin-right: .5rem;
|
||||
align-self: center;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
mat-icon {
|
||||
margin-right: 1rem;
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
p {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.title {
|
||||
font-size: 16px;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.fill-space {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.domain {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ChangeType } from 'src/app/modules/changes/changes.component';
|
||||
import { PolicyComponentServiceType } from 'src/app/modules/policies/policy-component-types.enum';
|
||||
import { PolicyGridType } from 'src/app/modules/policy-grid/policy-grid.component';
|
||||
import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component';
|
||||
import { Features } from 'src/app/proto/generated/zitadel/features_pb';
|
||||
import { Member } from 'src/app/proto/generated/zitadel/member_pb';
|
||||
import { Domain, Org, OrgState } from 'src/app/proto/generated/zitadel/org_pb';
|
||||
import { User } from 'src/app/proto/generated/zitadel/user_pb';
|
||||
@@ -43,13 +44,17 @@ export class OrgDetailComponent implements OnInit {
|
||||
= new BehaviorSubject<Member.AsObject[]>([]);
|
||||
public PolicyGridType: any = PolicyGridType;
|
||||
|
||||
public features!: Features.AsObject;
|
||||
|
||||
constructor(
|
||||
private dialog: MatDialog,
|
||||
public translate: TranslateService,
|
||||
public mgmtService: ManagementService,
|
||||
private toast: ToastService,
|
||||
private router: Router,
|
||||
) { }
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.getData();
|
||||
@@ -65,12 +70,12 @@ export class OrgDetailComponent implements OnInit {
|
||||
});
|
||||
this.loadMembers();
|
||||
this.loadDomains();
|
||||
this.loadFeatures();
|
||||
}
|
||||
|
||||
public loadDomains(): void {
|
||||
this.mgmtService.listOrgDomains().then(result => {
|
||||
this.domains = result.resultList;
|
||||
console.log(this.domains);
|
||||
this.primaryDomain = this.domains.find(domain => domain.isPrimary)?.domainName ?? '';
|
||||
});
|
||||
}
|
||||
@@ -208,4 +213,13 @@ export class OrgDetailComponent implements OnInit {
|
||||
this.membersSubject.next(members);
|
||||
});
|
||||
}
|
||||
|
||||
public loadFeatures(): void {
|
||||
this.loadingSubject.next(true);
|
||||
this.mgmtService.getFeatures().then(resp => {
|
||||
if (resp.features) {
|
||||
this.features = resp.features;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user