Skip to content

Commit 161d9b7

Browse files
committed
feat: re-design home page in admin panel
1 parent d286ae1 commit 161d9b7

25 files changed

+3276
-2692
lines changed

plugin.php

+7
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ function VFA_vuefront_admin_action_vf_information()
9797
{
9898
$plugin_data = get_plugin_data(__FILE__);
9999
$woocommerce_data = get_plugin_data(WP_PLUGIN_DIR . '/woocommerce/woocommerce.php');
100+
$brand_data = get_plugin_data(WP_PLUGIN_DIR . '/perfect-woocommerce-brands/perfect-woocommerce-brands.php');
100101
$plugin_version = $plugin_data['Version'];
101102
$extensions = array();
102103
$extensions[] = array(
@@ -105,6 +106,12 @@ function VFA_vuefront_admin_action_vf_information()
105106
'status' => is_plugin_active('woocommerce/woocommerce.php')
106107
);
107108

109+
$extensions[] = array(
110+
'name' => "Perfect Brands for WooCommerce",
111+
'version' => $brand_data['Version'],
112+
'status' => is_plugin_active('perfect-woocommerce-brands/perfect-woocommerce-brands.php')
113+
);
114+
108115
$status = file_exists(__DIR__ . '/.htaccess.txt');
109116

110117
echo json_encode(

view/javascript/d_pax/components/access.vue

100755100644
File mode changed.

view/javascript/d_pax/pages/alien.vue renamed to view/javascript/d_pax/components/alien.vue

+7-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<script>
3535
import {mapGetters} from 'vuex'
3636
export default {
37-
layout: 'auth',
3837
middleware: ['alien'],
3938
data() {
4039
return {
@@ -49,13 +48,13 @@ export default {
4948
methods: {
5049
handleLogout() {
5150
this.$store.dispatch('auth/logout')
52-
this.$router.push('/check')
51+
this.$store.commit('auth/toggleShowLogin')
5352
},
5453
async handleRefresh() {
5554
this.refreshLoading = true
5655
await this.$store.dispatch('account/load')
5756
if(this.account.banneded) {
58-
this.$router.push('/')
57+
this.$store.commit('auth/toggleShowLogin')
5958
}
6059
this.refreshLoading = false
6160
},
@@ -75,7 +74,11 @@ export default {
7574
</i18n>
7675
<style lang="scss">
7776
.alient-page {
78-
margin-top: 60px;
77+
border-radius: 3px;
78+
border: 1px solid #d9d9d9;
79+
background-color: #ffffff;
80+
padding: 50px 55px;
81+
margin-bottom: 60px;
7982
&__button_logout {
8083
display: block;
8184
cursor: pointer;
@@ -90,8 +93,6 @@ export default {
9093
text-align: center;
9194
}
9295
&__banner {
93-
background-color: #f9f9f9;
94-
padding: 50px;
9596
margin-bottom: 40px;
9697
&_image {
9798
padding: 0 40px;

view/javascript/d_pax/components/apps.vue

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export default {
210210
padding: 10px;
211211
background: #efeff1 !important;
212212
border: none;
213+
margin: 0;
213214
height: 54px !important;
214215
background-color: #efeff1 !important;
215216
padding: 12px 24px !important;

view/javascript/d_pax/pages/banned.vue renamed to view/javascript/d_pax/components/banned.vue

+7-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<script>
3535
import {mapGetters} from 'vuex'
3636
export default {
37-
layout: 'auth',
3837
middleware: ['banned'],
3938
data() {
4039
return {
@@ -49,13 +48,13 @@ export default {
4948
methods: {
5049
handleLogout() {
5150
this.$store.dispatch('auth/logout')
52-
this.$router.push('/check')
51+
this.$store.commit('auth/toggleShowLogin')
5352
},
5453
async handleRefresh() {
5554
this.refreshLoading = true
5655
await this.$store.dispatch('account/load')
5756
if(this.account.banneded) {
58-
this.$router.push('/')
57+
this.$store.commit('auth/toggleShowLogin')
5958
}
6059
this.refreshLoading = false
6160
},
@@ -75,7 +74,11 @@ export default {
7574
</i18n>
7675
<style lang="scss">
7776
.banned-page {
78-
margin-top: 60px;
77+
border-radius: 3px;
78+
border: 1px solid #d9d9d9;
79+
background-color: #ffffff;
80+
padding: 50px 55px;
81+
margin-bottom: 60px;
7982
&__button_logout {
8083
display: block;
8184
cursor: pointer;
@@ -90,8 +93,6 @@ export default {
9093
text-align: center;
9194
}
9295
&__banner {
93-
background-color: #f9f9f9;
94-
padding: 50px;
9596
margin-bottom: 40px;
9697
&_image {
9798
padding: 0 40px;

view/javascript/d_pax/pages/check.vue renamed to view/javascript/d_pax/components/check.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
<script>
5151
import { mapGetters } from "vuex";
5252
export default {
53-
layout: 'auth',
54-
middleware: ['notAuthenticated'],
5553
data() {
5654
return {
5755
form: {
@@ -67,6 +65,9 @@ export default {
6765
existingEmail: "auth/existingEmail"
6866
})
6967
},
68+
mounted() {
69+
this.$store.commit('account/setBanned', false)
70+
},
7071
methods: {
7172
async onSubmit (valid) {
7273
if (!valid) {
@@ -77,9 +78,9 @@ export default {
7778
await this.$store.dispatch('auth/checkEmail', {email: this.form.email})
7879
7980
if(!this.existingEmail) {
80-
this.$router.push('/register')
81+
this.$emit('register')
8182
} else {
82-
this.$router.push('/login')
83+
this.$emit('login')
8384
}
8485
8586
this.loading = false

view/javascript/d_pax/pages/confirm.vue renamed to view/javascript/d_pax/components/confirm.vue

+8-8
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
<script>
5757
import {mapGetters} from 'vuex'
5858
export default {
59-
layout: 'auth',
6059
middleware: ['authenticated', 'notConfirmed'],
6160
data() {
6261
return {
@@ -71,14 +70,12 @@ export default {
7170
methods: {
7271
handleLogout() {
7372
this.$store.dispatch('auth/logout')
74-
this.$router.push('/check')
73+
this.$store.commit('auth/toggleShowLogin')
7574
},
7675
async handleRefresh() {
7776
this.refreshLoading = true
7877
await this.$store.dispatch('account/load')
79-
if(this.account.confirmed) {
80-
this.$router.push('/')
81-
}
78+
8279
this.refreshLoading = false
8380
},
8481
async handleResend() {
@@ -98,7 +95,11 @@ export default {
9895
</i18n>
9996
<style lang="scss">
10097
.confirm-page {
101-
margin-top: 60px;
98+
border-radius: 3px;
99+
border: 1px solid #d9d9d9;
100+
background-color: #ffffff;
101+
padding: 50px 55px;
102+
margin-bottom: 60px;
102103
&__button_logout {
103104
display: block;
104105
cursor: pointer;
@@ -125,12 +126,11 @@ export default {
125126
text-align: center;
126127
}
127128
&__banner {
128-
background-color: #f9f9f9;
129-
padding: 50px;
130129
margin-bottom: 40px;
131130
&_image {
132131
padding: 0 40px;
133132
margin-bottom: 20px;
133+
text-align: center;
134134
img {
135135
width: 100;
136136
max-width: 100%;

view/javascript/d_pax/components/editApp.vue

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export default {
5353
this.$store.commit('apps/setEdit', false)
5454
},
5555
async onSubmit(valid) {
56-
console.log(valid)
5756
if (valid) {
5857
await this.$store.dispatch('apps/edit', {key: this.id, app: {
5958
eventUrl: this.form.eventUrl,

view/javascript/d_pax/components/header.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
</b-col>
1212
<b-col>
1313
<b-navbar-nav class="align-items-center vf-header__right_nav">
14-
<header-activation v-if="cms.builds.length > 0 && information.apache" />
14+
<header-activation v-if="isLogged && cms.builds.length > 0 && information.apache" />
1515
<b-button
16-
v-if="cms.builds.length > 0 && !information.apache"
16+
v-if="isLogged && cms.builds.length > 0 && !information.apache"
1717
class="vf-header__button_activate"
1818
variant="success"
1919
@click="$scrollTo('#vf-nginx-configure')"
@@ -42,6 +42,7 @@ export default {
4242
4343
computed: {
4444
...mapGetters({
45+
isLogged: "auth/isLogged",
4546
cms: 'cms/get',
4647
information: 'information/get'
4748
})

view/javascript/d_pax/components/header/Account.vue

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<template>
22
<div
3+
v-if="isLogged"
34
id="vf-header-account"
45
class="header-account"
56
>
67
<b-nav-item-dropdown
8+
79
toggle-class="text-decoration-none text-1 m-0 font-weight-semibold"
810
no-caret
911
text
@@ -69,7 +71,8 @@ export default {
6971
},
7072
computed: {
7173
...mapGetters({
72-
account: 'account/get'
74+
account: 'account/get',
75+
isLogged: "auth/isLogged"
7376
}),
7477
faAngleDown () {
7578
return faAngleDown
@@ -85,7 +88,6 @@ export default {
8588
methods: {
8689
async logout () {
8790
await this.$store.dispatch('auth/logout')
88-
this.$router.push('/check')
8991
}
9092
}
9193
}
@@ -99,7 +101,13 @@ export default {
99101
border: solid 1px $white-five;
100102
background-color: $white;
101103
padding: 13px 17px;
102-
104+
.header-account__sign-in {
105+
list-style: none;
106+
a {
107+
font-weight: 600;
108+
color: black;
109+
}
110+
}
103111
.header-account__separator {
104112
border-top: 1px solid $white-eight;
105113
margin-top: 0;

view/javascript/d_pax/components/information.vue

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<template>
22
<div class="vf-information">
3-
<div class="vf-information__item">
3+
<div
4+
v-if="isLogged"
5+
class="vf-information__item"
6+
>
47
<div class="vf-information__item_title">
58
{{ $t('textAccount') }}
69
</div>
710
<div class="vf-information__item_value">
8-
{{ $t('textFree') }}
11+
{{ !account.subscribe ? $t('textFree') : $t('textSubscribe') }}
912
</div>
1013
</div>
11-
<div class="vf-information__item">
14+
<div
15+
v-if="isLogged"
16+
class="vf-information__item"
17+
>
1218
<div class="vf-information__item_title">
1319
{{ $t('textBuildMin') }}
1420
</div>
@@ -58,7 +64,7 @@
5864
import {mapGetters} from 'vuex'
5965
export default {
6066
computed: {
61-
...mapGetters({information: 'information/get', cms: 'cms/get', account: 'account/get'}),
67+
...mapGetters({isLogged: "auth/isLogged", information: 'information/get', cms: 'cms/get', account: 'account/get'}),
6268
totalUsaged () {
6369
return Math.floor(this.$moment.duration(this.account.times, 'milliseconds').asMinutes())
6470
},
@@ -72,6 +78,7 @@ export default {
7278
{
7379
"textAccount": "Account",
7480
"textFree": "Free",
81+
"textSubscribe": "Subscription",
7582
"textPluginVersion": "Plugin version",
7683
"textPHPVersion": "PHP",
7784
"textServer": "Server",

view/javascript/d_pax/pages/login.vue renamed to view/javascript/d_pax/components/login.vue

+11-7
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
<script>
6868
import {mapGetters} from 'vuex'
6969
export default {
70-
layout: 'auth',
7170
middleware: ['notAuthenticated', 'withEmail'],
7271
data() {
7372
return {
@@ -87,7 +86,8 @@ export default {
8786
methods: {
8887
handleLogout() {
8988
this.$store.dispatch('auth/logout')
90-
this.$router.push('/check')
89+
this.$emit('check')
90+
// this.$router.push('/check')
9191
},
9292
async onSubmit (valid) {
9393
if (!valid) {
@@ -101,15 +101,19 @@ export default {
101101
102102
await this.$store.dispatch('cms/list')
103103
const id = await this.$store.dispatch('cms/search')
104-
if(id) {
105-
await this.$store.dispatch('cms/load', {id})
104+
if (this.$store.getters['cms/alien']) {
105+
this.$store.commit('auth/toggleShowLogin')
106+
} else {
107+
if(id) {
108+
await this.$store.dispatch('cms/load', {id})
109+
}
110+
this.$store.commit('auth/toggleShowLogin')
106111
}
107-
108-
this.$router.push('/')
109112
} else {
110113
if (this.error == 'email_banned') {
111114
this.$store.commit('account/setBanned', true)
112-
this.$router.push('/banned')
115+
this.$store.commit('setResponseError', false)
116+
this.$store.commit('auth/toggleShowLogin')
113117
}
114118
}
115119

view/javascript/d_pax/pages/register.vue renamed to view/javascript/d_pax/components/register.vue

+2-5
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@
111111
<script>
112112
import { mapGetters } from "vuex";
113113
export default {
114-
layout: 'auth',
115-
middleware: ['notAuthenticated', 'withEmail'],
116114
data() {
117115
return {
118116
form: {
@@ -132,7 +130,7 @@ export default {
132130
methods: {
133131
handleLogout() {
134132
this.$store.dispatch('auth/logout')
135-
this.$router.push('/check')
133+
this.$emit('check')
136134
},
137135
async onSubmit (valid) {
138136
if (!valid) {
@@ -143,10 +141,9 @@ export default {
143141
await this.$store.dispatch("auth/register", {email: this.form.email, password: this.form.password, firstName: this.form.firstName, lastName: this.form.lastName})
144142
145143
if(!this.error) {
146-
this.$router.push('/')
144+
this.$store.commit('auth/toggleShowLogin')
147145
}
148146
149-
150147
this.loading = false
151148
}
152149
}

0 commit comments

Comments
 (0)