1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-09 05:57:40 +02:00
bitwarden-browser/src/app/settings/user-subscription.component.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

181 lines
5.8 KiB
HTML
Raw Normal View History

<div class="page-header">
<h1>
{{ "premiumMembership" | i18n }}
2019-10-11 16:35:24 +02:00
<small *ngIf="firstLoaded && loading">
<i
class="fa fa-spinner fa-spin text-muted"
title="{{ 'loading' | i18n }}"
aria-hidden="true"
></i>
<span class="sr-only">{{ "loading" | i18n }}</span>
</small>
</h1>
</div>
2019-10-11 16:35:24 +02:00
<ng-container *ngIf="!firstLoaded && loading">
<i class="fa fa-spinner fa-spin text-muted" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
<span class="sr-only">{{ "loading" | i18n }}</span>
</ng-container>
<ng-container *ngIf="sub">
2019-02-21 22:50:37 +01:00
<app-callout
type="warning"
title="{{ 'canceled' | i18n }}"
*ngIf="subscription && subscription.cancelled"
>
{{ "subscriptionCanceled" | i18n }}</app-callout
>
<app-callout
type="warning"
title="{{ 'pendingCancellation' | i18n }}"
*ngIf="subscriptionMarkedForCancel"
>
<p>{{ "subscriptionPendingCanceled" | i18n }}</p>
2019-02-21 22:50:37 +01:00
<button
#reinstateBtn
type="button"
class="btn btn-outline-secondary btn-submit"
(click)="reinstate()"
[appApiAction]="reinstatePromise"
[disabled]="reinstateBtn.loading"
>
2019-10-11 16:35:24 +02:00
<i class="fa fa-spinner fa-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
<span>{{ "reinstateSubscription" | i18n }}</span>
</button>
</app-callout>
<dl *ngIf="selfHosted">
<dt>{{ "expiration" | i18n }}</dt>
<dd *ngIf="sub.expiration">{{ sub.expiration | date: "mediumDate" }}</dd>
<dd *ngIf="!sub.expiration">{{ "neverExpires" | i18n }}</dd>
2021-12-17 15:57:11 +01:00
</dl>
<div class="row" *ngIf="!selfHosted">
<div class="col-4">
2021-12-17 15:57:11 +01:00
<dl>
<dt>{{ "status" | i18n }}</dt>
2021-12-17 15:57:11 +01:00
<dd>
<span class="text-capitalize">{{ (subscription && subscription.status) || "-" }}</span>
2019-02-21 22:50:37 +01:00
<span class="badge badge-warning" *ngIf="subscriptionMarkedForCancel">{{
"pendingCancellation" | i18n
2021-12-17 15:57:11 +01:00
}}</span>
</dd>
<dt>{{ "nextCharge" | i18n }}</dt>
2021-12-17 15:57:11 +01:00
<dd>
{{
nextInvoice
? (nextInvoice.date | date: "mediumDate") +
2021-12-17 15:57:11 +01:00
", " +
(nextInvoice.amount | currency: "$")
2021-12-17 15:57:11 +01:00
: "-"
}}
</dd>
</dl>
</div>
<div class="col-8" *ngIf="subscription">
<strong class="d-block mb-1">{{ "details" | i18n }}</strong>
<table class="table">
2021-12-17 15:57:11 +01:00
<tbody>
<tr *ngFor="let i of subscription.items">
2021-12-17 15:57:11 +01:00
<td>
{{ i.name }} {{ i.quantity > 1 ? "&times;" + i.quantity : "" }} @
{{ i.amount | currency: "$" }}
2021-12-17 15:57:11 +01:00
</td>
<td>{{ i.quantity * i.amount | currency: "$" }} /{{ i.interval | i18n }}</td>
2021-12-17 15:57:11 +01:00
</tr>
</tbody>
</table>
</div>
</div>
<ng-container *ngIf="selfHosted">
2021-12-17 15:57:11 +01:00
<div>
<button type="button" class="btn btn-outline-secondary" (click)="updateLicense()">
{{ "updateLicense" | i18n }}
</button>
2021-12-17 15:57:11 +01:00
<a
2019-02-21 22:50:37 +01:00
href="https://vault.bitwarden.com/#/settings/subscription"
target="_blank"
rel="noopener"
class="btn btn-outline-secondary"
2021-12-17 15:57:11 +01:00
>
{{ "manageSubscription" | i18n }}
2021-12-17 15:57:11 +01:00
</a>
</div>
<div class="card mt-3" *ngIf="showUpdateLicense">
<div class="card-body">
2021-12-17 15:57:11 +01:00
<button
type="button"
2019-10-11 16:35:24 +02:00
class="close"
appA11yTitle="{{ 'cancel' | i18n }}"
2019-03-20 15:16:01 +01:00
(click)="closeUpdateLicense(false)"
2021-12-17 15:57:11 +01:00
>
2019-03-20 15:16:01 +01:00
<span aria-hidden="true">&times;</span>
</button>
<h3 class="card-body-header">{{ "updateLicense" | i18n }}</h3>
2019-02-21 22:50:37 +01:00
<app-update-license
(onUpdated)="closeUpdateLicense(true)"
(onCanceled)="closeUpdateLicense(false)"
>
</app-update-license>
</div>
</div>
</ng-container>
<ng-container *ngIf="!selfHosted">
<div class="d-flex">
<button
type="button"
class="btn btn-outline-secondary"
(click)="downloadLicense()"
2019-02-21 22:50:37 +01:00
*ngIf="!subscription || !subscription.cancelled"
2021-12-17 15:57:11 +01:00
>
2019-02-21 22:50:37 +01:00
{{ "downloadLicense" | i18n }}
</button>
2021-12-17 15:57:11 +01:00
<button
#cancelBtn
2019-02-21 22:50:37 +01:00
type="button"
class="btn btn-outline-danger btn-submit ml-auto"
(click)="cancel()"
2019-10-11 16:35:24 +02:00
[appApiAction]="cancelPromise"
2019-02-21 22:50:37 +01:00
[disabled]="cancelBtn.loading"
*ngIf="subscription && !subscription.cancelled && !subscriptionMarkedForCancel"
>
<i class="fa fa-spinner fa-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
2019-02-21 22:50:37 +01:00
<span>{{ "cancelSubscription" | i18n }}</span>
</button>
2021-12-17 15:57:11 +01:00
</div>
2019-02-21 22:50:37 +01:00
<h2 class="spaced-header">{{ "storage" | i18n }}</h2>
<p>{{ "subscriptionStorage" | i18n: sub.maxStorageGb || 0:sub.storageName || "0 MB" }}</p>
<div class="progress">
2021-12-17 15:57:11 +01:00
<div
2019-02-21 22:50:37 +01:00
class="progress-bar bg-success"
role="progressbar"
[ngStyle]="{ width: storageProgressWidth + '%' }"
[attr.aria-valuenow]="storagePercentage"
aria-valuemin="0"
aria-valuemax="100"
2021-12-17 15:57:11 +01:00
>
2019-02-21 22:50:37 +01:00
{{ storagePercentage / 100 | percent }}
</div>
</div>
<ng-container *ngIf="subscription && !subscription.cancelled && !subscriptionMarkedForCancel">
<div class="mt-3">
2019-10-11 16:35:24 +02:00
<div class="d-flex" *ngIf="!showAdjustStorage">
<button type="button" class="btn btn-outline-secondary" (click)="adjustStorage(true)">
{{ "addStorage" | i18n }}
</button>
2021-12-17 15:57:11 +01:00
<button
type="button"
class="ml-1 btn btn-outline-secondary"
(click)="adjustStorage(false)"
>
{{ "removeStorage" | i18n }}
</button>
</div>
2019-02-21 22:50:37 +01:00
<app-adjust-storage
[storageGbPrice]="4"
[add]="adjustStorageAdd"
(onAdjusted)="closeStorage(true)"
(onCanceled)="closeStorage(false)"
*ngIf="showAdjustStorage"
></app-adjust-storage>
</div>
</ng-container>
</ng-container>
</ng-container>