Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #388 from safing/fix/account-showing-switches
Browse files Browse the repository at this point in the history
Fix account showing switches
  • Loading branch information
dhaavi authored Dec 12, 2022
2 parents a567eae + 4f0ccad commit 1ff76e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/portmaster/src/app/pages/spn/spn-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</spn-feature-carousel>

<div class="flex flex-col items-center justify-center gap-4">
<button (click)="openAccountDetails()" *ngIf="!currentUser || currentUser.state === ''"
<button (click)="openAccountDetails()" *ngIf="!currentUser?.current_plan?.feature_ids?.includes('spn')"
class="w-56 px-5 py-2 font-medium uppercase rounded-full bg-blue bg-opacity-90 hover:bg-blue text-primary">
Login
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1 class="mb-4 text-xl">Account Details</h1>
</div>
</div>

<table *ngIf="currentUser.view?.ShowAccountData" class="mb-4">
<table *ngIf="!currentUser.view || currentUser.view?.ShowAccountData" class="mb-4">
<tr>
<th>Package</th>
<td>{{ currentUser.current_plan?.name }}</td>
Expand Down Expand Up @@ -43,16 +43,17 @@ <h1 class="mb-4 text-xl">Account Details</h1>
</table>

<div class="flex items-end justify-end w-full space-x-2">
<!-- Always show all buttons, no matter what the view says here. -->
<button *ngIf="dialogRef" (click)="dialogRef.close()" class="">Close</button>
<div class="flex-grow"></div>

<a *ngIf="currentUser.view?.ShowAccountButton" href="https://account.safing.io/?source=Portmaster"
<a href="https://account.safing.io/?source=Portmaster"
class="flex flex-row items-center self-stretch justify-center gap-1 px-2 bg-gray-300 rounded hover:bg-gray-200 text-blue whitespace-nowrap">
Open Account Page
</a>

<button *ngIf="currentUser.view?.ShowLogoutButton || currentUser.view?.ShowLoginButton" (click)="logout()" class="bg-info-red">Logout</button>
<button *ngIf="currentUser.view?.ShowRefreshButton" (click)="refreshAccount()" style="width: 70px">
<button (click)="logout()" class="bg-info-red">Logout</button>
<button (click)="refreshAccount()" style="width: 70px">
<ng-container *ngIf="!refreshing; else: loading">
Refresh
</ng-container>
Expand Down
8 changes: 4 additions & 4 deletions modules/portmaster/src/app/shared/spn-login/spn-login.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
<div class="w-full px-5">
<h2 class="w-full text-center">SPN Account Login</h2>

<a class="inline-block w-full mb-4 text-xs font-medium text-center text-tertiary" href="https://safing.io/spn"
<a class="inline-block w-full mb-4 text-xs font-medium text-center text-tertiary" href="https://safing.io/spn?source=Portmaster"
target="_blank">
Unlock the <u>powerful VPN alternative</u>
</a>

<div *ngIf="forcedLogout" class="w-full px-4 py-2 mb-4 text-center rounded bg-info-red">
You have been logged out by the account server.
<br />
Please check <a class="underline text-primary" href="https://account.safing.io">your account</a>.
Please check <a class="underline text-primary" href="https://account.safing.io/?source=Portmaster">your account</a>.
</div>

<form (ngSubmit)="login()">
<div class="flex flex-col items-stretch mt-4 space-y-6">
<div class="flex flex-col justify-items-start">
<label for="username" class="font-semibold text-primary">Username</label>
<input type="text" name="username" placeholder="Your username" autocomplete="off" class="custom-form-input"
<input type="text" name="username" autocomplete="off" class="custom-form-input"
[(ngModel)]="username">
</div>

<div class="flex flex-col justify-items-start">
<label for="password" class="font-semibold text-primary">Password</label>
<input type="password" name="password" placeholder="Enter your strong password" autocomplete="off"
<input type="password" name="password" autocomplete="off"
class="custom-form-input" [(ngModel)]="password">
</div>

Expand Down

0 comments on commit 1ff76e0

Please sign in to comment.