Skip to content

Commit cfbc99d

Browse files
committed
feat(pro): improve subscription form
1 parent c490660 commit cfbc99d

File tree

2 files changed

+68
-37
lines changed

2 files changed

+68
-37
lines changed

web/src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383

8484
<EditDialog
8585
v-model="subscriptionDialog"
86-
:save-button-text="user.admin && !user.has_active_subscription ? 'Activate' : 'Reactivate'"
86+
:save-button-text="null"
87+
:cancel-button-text="$t('close')"
8788
v-if="user"
8889
event-name="i-user"
8990
dont-close-on-save

web/src/components/SubscriptionForm.vue

Lines changed: 66 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<v-textarea
1515
class="mt-4"
1616
rows="4"
17+
auto-grow
1718
v-model="item.key"
1819
label="Subscription Key"
1920
:rules="[v => !!v || $t('key_required')]"
@@ -23,42 +24,71 @@
2324
dense
2425
></v-textarea>
2526

26-
<v-row v-if="item.plan" class="mb-3">
27-
<v-col class="py-0">
28-
<v-list class="py-0">
29-
<v-list-item class="pa-0">
30-
<v-list-item-content>
31-
<v-list-item-title>Plan</v-list-item-title>
32-
<v-list-item-subtitle>{{ item.plan }}</v-list-item-subtitle>
33-
</v-list-item-content>
34-
</v-list-item>
35-
<v-list-item class="pa-0">
36-
<v-list-item-content>
37-
<v-list-item-title>Pro users</v-list-item-title>
38-
<v-list-item-subtitle>{{ item.users }}</v-list-item-subtitle>
39-
</v-list-item-content>
40-
</v-list-item>
41-
</v-list>
42-
</v-col>
43-
<v-col class="py-0">
44-
<v-list class="py-0">
45-
<v-list-item class="pa-0">
46-
<v-list-item-content>
47-
<v-list-item-title>Expires at</v-list-item-title>
48-
<v-list-item-subtitle>{{ item.expiresAt }}</v-list-item-subtitle>
49-
</v-list-item-content>
50-
</v-list-item>
51-
<v-list-item class="pa-0">
52-
<v-list-item-content>
53-
<v-list-item-title>Status</v-list-item-title>
54-
<v-list-item-subtitle>
55-
<v-chip :color="statusColor" label class="mt-1">{{ item.state }}</v-chip>
56-
</v-list-item-subtitle>
57-
</v-list-item-content>
58-
</v-list-item>
59-
</v-list>
60-
</v-col>
61-
</v-row>
27+
<div style="text-align: right; margin-bottom: 30px; margin-top: -10px;">
28+
<v-btn @click="save" color="primary">Activate new key</v-btn>
29+
</div>
30+
31+
<v-card
32+
v-if="item.plan"
33+
class="mb-3"
34+
style="background: var(--highlighted-card-bg-color)"
35+
>
36+
<v-card-title>Plan &amp; status</v-card-title>
37+
<v-card-text class="pb-2">
38+
<v-row>
39+
<v-col class="py-0">
40+
<v-list class="py-0" style="background: unset;">
41+
<v-list-item class="pa-0">
42+
<v-list-item-content>
43+
<v-list-item-title>Plan</v-list-item-title>
44+
<v-list-item-subtitle>{{ item.plan }}</v-list-item-subtitle>
45+
</v-list-item-content>
46+
</v-list-item>
47+
<v-list-item class="pa-0">
48+
<v-list-item-content>
49+
<v-list-item-title>Expires at</v-list-item-title>
50+
<v-list-item-subtitle>{{ item.expiresAt }}</v-list-item-subtitle>
51+
</v-list-item-content>
52+
</v-list-item>
53+
</v-list>
54+
</v-col>
55+
<v-col class="py-0">
56+
<v-list class="py-0" style="background: unset;">
57+
<v-list-item class="pa-0">
58+
<v-list-item-content>
59+
<v-list-item-title>Pro users</v-list-item-title>
60+
<v-list-item-subtitle>{{ item.users }}</v-list-item-subtitle>
61+
</v-list-item-content>
62+
</v-list-item>
63+
<v-list-item class="pa-0">
64+
<v-list-item-content>
65+
<v-list-item-title>Status</v-list-item-title>
66+
<v-list-item-subtitle style="display: flex; align-items: center;">
67+
<div
68+
style="
69+
border-radius: 100px;
70+
width: 8px;
71+
height: 8px;
72+
background: greenyellow;
73+
margin-right: 5px;
74+
margin-top: 1px;
75+
"
76+
></div>
77+
<div>{{ item.state }}</div>
78+
</v-list-item-subtitle>
79+
</v-list-item-content>
80+
</v-list-item>
81+
</v-list>
82+
</v-col>
83+
</v-row>
84+
85+
<div style="
86+
margin-top: 20px;
87+
font-weight: bold;
88+
color: #00bc00;
89+
">Renews in {{ (new Date() - item.expiresAt) | formatMilliseconds }}</div>
90+
</v-card-text>
91+
</v-card>
6292

6393
<div v-else class="mb-4 mt-2">
6494

0 commit comments

Comments
 (0)