Skip to content

Commit 3aef704

Browse files
committed
feat: add support subscription
1 parent feeaa6c commit 3aef704

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+143
-108
lines changed

views/js/d_pax/components/development.vue

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ export default {
186186
letter-spacing: 0.18px;
187187
text-align: left;
188188
color: $warm-grey-two;
189+
margin-bottom: 10px;
189190
ul {
190191
list-style-type: decimal;
191192
padding-left: 20px;

views/js/d_pax/components/firstBuild.vue

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
>{{ $t('text_bellow') }}</a>.
2323
</div>
2424
<div
25+
v-if="information.apache"
2526
class="first-build__footer_title"
2627
>
2728
{{ $t('footerTitlePopup') }}

views/js/d_pax/components/information.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{{ $t('textBuildMin') }}
1414
</div>
1515
<div class="vf-information__item_value">
16-
{{ Math.floor($moment.duration(cms.usagedTime, 'milliseconds').asMinutes()) }} / 100
16+
{{ totalUsaged }} / {{ timeCount }}
1717
</div>
1818
</div>
1919
<div class="vf-information__item">
@@ -58,7 +58,13 @@
5858
import {mapGetters} from 'vuex'
5959
export default {
6060
computed: {
61-
...mapGetters({information: 'information/get', cms: 'cms/get'})
61+
...mapGetters({information: 'information/get', cms: 'cms/get', account: 'account/get'}),
62+
totalUsaged () {
63+
return Math.floor(this.$moment.duration(this.account.times, 'milliseconds').asMinutes())
64+
},
65+
timeCount () {
66+
return this.account.subscribe ? 1000 : 100
67+
}
6268
}
6369
}
6470
</script>

views/js/d_pax/components/subscription.vue

+10
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,21 @@
1010
class="account-subscription__button"
1111
variant="warning"
1212
size="lg"
13+
@click="handleSubscribe"
1314
>
1415
{{ $t("button_subscribe") }}
1516
</b-button>
1617
</div>
1718
</template>
19+
<script>
20+
export default {
21+
methods: {
22+
async handleSubscribe () {
23+
await this.$store.dispatch('cms/subscribe')
24+
}
25+
}
26+
}
27+
</script>
1828
<i18n locale="en">
1929
{
2030
"text_title": "Go Production!",

views/js/d_pax/components/welcome.vue

+16-11
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export default {
4242
},
4343
computed: {
4444
...mapGetters({
45-
cms: 'cms/get'
45+
cms: 'cms/get',
46+
error: 'error'
4647
})
4748
},
4849
mounted() {
@@ -62,17 +63,21 @@ export default {
6263
async handleGenerate() {
6364
this.loading = true
6465
await this.$store.dispatch('cms/generate', {id: this.cms.id})
65-
const interval = setInterval(async () => {
66-
await this.$store.dispatch('cms/load', {id: this.cms.id})
67-
this.$apolloClient.defaultClient.clearStore()
68-
if(!this.cms.generating) {
69-
await this.$store.dispatch('information/updateVueFront', {url: this.cms.downloadUrl})
70-
this.$store.commit('cms/setFirstBuild', true)
66+
if(!this.error) {
67+
const interval = setInterval(async () => {
68+
await this.$store.dispatch('cms/load', {id: this.cms.id})
69+
this.$apolloClient.defaultClient.clearStore()
70+
if(!this.cms.generating) {
71+
await this.$store.dispatch('information/updateVueFront', {url: this.cms.downloadUrl})
72+
this.$store.commit('cms/setFirstBuild', true)
7173
72-
this.loading = false
73-
clearInterval(interval)
74-
}
75-
}, 3000)
74+
this.loading = false
75+
clearInterval(interval)
76+
}
77+
}, 3000)
78+
} else {
79+
this.loading = false
80+
}
7681
}
7782
}
7883
}

views/js/d_pax/layouts/default.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export default {
2626
</script>
2727
<i18n locale="en">
2828
{
29-
"not_writable_htaccess": "File permissions. Please add writing permissions to the following files and folder: .htaccess"
29+
"not_writable_htaccess": "File permissions. Please add writing permissions to the following files and folder: .htaccess",
30+
"validate_payment": "Not verified account",
31+
"not_exists_url": "The CMS Connect URL you have provided is not working. Please check if you have properly specified the url and try again.",
32+
"not_working_graphql_api": "The CMS Connect URL you have provided is not working. Please check if you have properly specified the url and try again."
3033
}
3134
</i18n>
3235
<style lang="scss">

views/js/d_pax/pages/index.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<development />
1313
</b-col>
1414
<b-col md="3">
15-
<subscription v-if="false" />
15+
<subscription v-if="!account.subscribe" />
1616
<information />
1717
</b-col>
1818
</b-row>
@@ -42,7 +42,7 @@ export default {
4242
},
4343
middleware: ['authenticated', 'confirmed', 'noBanned', 'noAlien'],
4444
computed: {
45-
...mapGetters({information: 'information/get', cms: 'cms/get', firstBuild: 'cms/firstBuild'})
45+
...mapGetters({account: 'account/get' ,information: 'information/get', cms: 'cms/get', firstBuild: 'cms/firstBuild'})
4646
}
4747
}
4848
</script>

views/js/d_pax/store/account.js

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export const actions = {
3838
confirmed
3939
email
4040
banned
41+
subscribe
42+
subscribeCancel
43+
subscribeDateEnd
44+
paymentMethodChecked
4145
image(width: 101, height: 101) {
4246
url
4347
path

views/js/d_pax/store/auth.js

+15
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ export const actions = {
7979
email
8080
banned
8181
confirmed
82+
times
83+
subscribe
84+
subscribeCancel
85+
subscribeDateEnd
86+
paymentMethodChecked
8287
image(width: 101, height: 101) {
8388
url
8489
path
@@ -111,6 +116,11 @@ export const actions = {
111116
email
112117
banned
113118
confirmed
119+
times
120+
subscribe
121+
subscribeCancel
122+
subscribeDateEnd
123+
paymentMethodChecked
114124
image(width: 101, height: 101) {
115125
url
116126
path
@@ -148,6 +158,11 @@ export const actions = {
148158
email
149159
banned
150160
confirmed
161+
times
162+
subscribe
163+
subscribeCancel
164+
subscribeDateEnd
165+
paymentMethodChecked
151166
image(width: 101, height: 101) {
152167
url
153168
path

views/js/d_pax/store/cms.js

+42
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,48 @@ export const getters = {
3737
}
3838

3939
export const actions = {
40+
41+
async subscribe({commit}) {
42+
try {
43+
const { data } = await this.$apolloClient.defaultClient.mutate({
44+
mutation: gql`
45+
mutation {
46+
subscribeCms {
47+
id
48+
firstName
49+
lastName
50+
email
51+
npmToken
52+
banned
53+
confirmed
54+
balance
55+
times
56+
subscribe
57+
subscribeCancel
58+
subscribeDateEnd
59+
paymentMethodChecked
60+
image(width: 101, height: 101) {
61+
url
62+
path
63+
}
64+
developer {
65+
linkSupport
66+
status
67+
username
68+
}
69+
role {
70+
name
71+
}
72+
}
73+
}
74+
`,
75+
variables: {}
76+
})
77+
commit('account/setAccount', data.subscribeCms, { root: true })
78+
} catch (e) {
79+
commit('setResponseError', e, { root: true })
80+
}
81+
},
4082
async search({commit, getters, dispatch, rootGetters}) {
4183
let id = false
4284
for(const key in getters['list'].content) {

views/js/d_vuefront/0.056b5da031fd3f4b3240.bundle.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/0.4ccd0cd5ab10b7705f3f.css renamed to views/js/d_vuefront/0.056b5da031fd3f4b3240.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/0.4ccd0cd5ab10b7705f3f.bundle.js

-1
This file was deleted.

views/js/d_vuefront/13.4ccd0cd5ab10b7705f3f.bundle.js renamed to views/js/d_vuefront/13.056b5da031fd3f4b3240.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/14.4ccd0cd5ab10b7705f3f.bundle.js renamed to views/js/d_vuefront/14.056b5da031fd3f4b3240.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/15.4ccd0cd5ab10b7705f3f.bundle.js renamed to views/js/d_vuefront/15.056b5da031fd3f4b3240.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/21.4ccd0cd5ab10b7705f3f.bundle.js renamed to views/js/d_vuefront/21.056b5da031fd3f4b3240.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/22.4ccd0cd5ab10b7705f3f.bundle.js renamed to views/js/d_vuefront/22.056b5da031fd3f4b3240.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/25.4ccd0cd5ab10b7705f3f.bundle.js renamed to views/js/d_vuefront/25.056b5da031fd3f4b3240.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/4.4ccd0cd5ab10b7705f3f.bundle.js renamed to views/js/d_vuefront/4.056b5da031fd3f4b3240.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/6.4ccd0cd5ab10b7705f3f.bundle.js renamed to views/js/d_vuefront/6.056b5da031fd3f4b3240.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/js/d_vuefront/7.4ccd0cd5ab10b7705f3f.bundle.js renamed to views/js/d_vuefront/7.056b5da031fd3f4b3240.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)