download license for org
This commit is contained in:
parent
6fcda290c7
commit
e4f12ed47f
2
jslib
2
jslib
|
@ -1 +1 @@
|
|||
Subproject commit 9c0b4b897387045d08c5e9651ba4c103379d3ac6
|
||||
Subproject commit 4228277d23503d563560b44a652293d23233aa1b
|
|
@ -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() {
|
||||
|
|
|
@ -2219,5 +2219,8 @@
|
|||
},
|
||||
"bankAccountTypeIndividual": {
|
||||
"message": "Individual (Personal)"
|
||||
},
|
||||
"enterInstallationId": {
|
||||
"message": "Enter your installation id"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue