mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
download license for org
This commit is contained in:
@@ -79,8 +79,10 @@
|
||||
<button type="button" class="btn btn-outline-secondary" (click)="changePlan()">
|
||||
{{'changeBillingPlan' | i18n}}
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary ml-1" (click)="downloadLicense()" *ngIf="subscription && !subscription.cancelled">
|
||||
{{'downloadLicense' | i18n}}
|
||||
<button type="button" class="btn btn-outline-secondary btn-submit ml-1" #licenseBtn [appApiAction]="licensePromise" [disabled]="licenseBtn.loading"
|
||||
(click)="downloadLicense()" *ngIf="subscription && !subscription.cancelled">
|
||||
<i class="fa fa-spinner fa-spin"></i>
|
||||
<span>{{'downloadLicense' | i18n}}</span>
|
||||
</button>
|
||||
<button #cancelBtn type="button" class="btn btn-outline-danger btn-submit ml-auto" (click)="cancel()" [appApiAction]="cancelPromise"
|
||||
[disabled]="cancelBtn.loading" *ngIf="subscription && !subscription.cancelled && !subscriptionMarkedForCancel">
|
||||
|
||||
@@ -40,6 +40,7 @@ export class OrganizationBillingComponent implements OnInit {
|
||||
|
||||
cancelPromise: Promise<any>;
|
||||
reinstatePromise: Promise<any>;
|
||||
licensePromise: Promise<any>;
|
||||
|
||||
constructor(private tokenService: TokenService, private apiService: ApiService,
|
||||
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
|
||||
@@ -113,10 +114,22 @@ export class OrganizationBillingComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
downloadLicense() {
|
||||
async downloadLicense() {
|
||||
if (this.loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
const installationId = window.prompt(this.i18nService.t('enterInstallationId'));
|
||||
if (installationId == null || installationId === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this.licensePromise = this.apiService.getOrganizationLicense(this.organizationId, installationId);
|
||||
const license = await this.licensePromise;
|
||||
const licenseString = JSON.stringify(license, null, 2);
|
||||
this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json');
|
||||
} catch { }
|
||||
}
|
||||
|
||||
updateLicense() {
|
||||
|
||||
Reference in New Issue
Block a user