@awes-io/nuxt-admin 2.6.5 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/package.json +4 -4
- package/src/index.js +2 -0
- package/src/pages/roles/_id.vue +11 -16
- package/src/pages/roles/index.vue +13 -17
- package/src/pages/users/_id/2fa.vue +21 -13
- package/src/pages/users/_id/edit.vue +27 -26
- package/src/pages/users/_id/index.vue +19 -19
- package/src/pages/users/_id/security.vue +4 -4
- package/src/pages/users/_id.vue +1 -1
- package/src/pages/users/index.vue +15 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.7.0](https://github.com/awes-io/client/compare/@awes-io/nuxt-admin@2.6.6...@awes-io/nuxt-admin@2.7.0) (2023-01-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* translations keys updated ([57e8dcc](https://github.com/awes-io/client/commit/57e8dcc44208fb567bc6196b2dac131095030e8e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* translation keys replaced with values ([90e58da](https://github.com/awes-io/client/commit/90e58dabb389c9c47a33115965f8724845f3ad75))
|
|
17
|
+
* translation keys replaced with values ([f4bcf3a](https://github.com/awes-io/client/commit/f4bcf3aa43231b8a12b39a68cef94059205162d4))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## [2.6.6](https://github.com/awes-io/client/compare/@awes-io/nuxt-admin@2.6.5...@awes-io/nuxt-admin@2.6.6) (2023-01-11)
|
|
24
|
+
|
|
25
|
+
**Note:** Version bump only for package @awes-io/nuxt-admin
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
6
31
|
## [2.6.5](https://github.com/awes-io/client/compare/@awes-io/nuxt-admin@2.6.4...@awes-io/nuxt-admin@2.6.5) (2022-12-29)
|
|
7
32
|
|
|
8
33
|
**Note:** Version bump only for package @awes-io/nuxt-admin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awes-io/nuxt-admin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Administration of roles and permissions for Awes.io v1",
|
|
5
5
|
"homepage": "https://awes.io",
|
|
6
6
|
"bugs": {
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@awes-io/nuxt-auth": "^2.
|
|
58
|
-
"@awes-io/ui": "^2.
|
|
57
|
+
"@awes-io/nuxt-auth": "^2.12.0",
|
|
58
|
+
"@awes-io/ui": "^2.62.0",
|
|
59
59
|
"@awes-io/vue-mc": "^0.7.0",
|
|
60
60
|
"rambdax": "^7.2.0"
|
|
61
61
|
},
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"vue-jest": "^3.0.4",
|
|
92
92
|
"vue-template-compiler": "^2.6.10"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "45f0bbd83f1ecca9035c58a7af11124f717d47a3"
|
|
95
95
|
}
|
package/src/index.js
CHANGED
package/src/pages/roles/_id.vue
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
v-if="!role.isNew()"
|
|
10
10
|
:items="[
|
|
11
11
|
{
|
|
12
|
-
text: $t('
|
|
12
|
+
text: $t('Delete'),
|
|
13
13
|
color: 'error',
|
|
14
14
|
listeners: {
|
|
15
15
|
click: deleteRole
|
|
@@ -21,20 +21,17 @@
|
|
|
21
21
|
|
|
22
22
|
<AwModelEdit :model="role">
|
|
23
23
|
<AwGrid>
|
|
24
|
-
<AwCard
|
|
25
|
-
:title="$t('aw.nuxt_admin.information')"
|
|
26
|
-
:model="role"
|
|
27
|
-
>
|
|
24
|
+
<AwCard :title="$t('Information')" :model="role">
|
|
28
25
|
<AwGrid>
|
|
29
26
|
<AwInput
|
|
30
|
-
:label="$t('
|
|
27
|
+
:label="$t('Role name')"
|
|
31
28
|
v-model="role.name"
|
|
32
29
|
name="name"
|
|
33
30
|
:error="role.errors.name"
|
|
34
31
|
/>
|
|
35
32
|
<!-- <AwInput
|
|
36
33
|
v-model="role.priority"
|
|
37
|
-
:label="$t('
|
|
34
|
+
:label="$t('Priority')"
|
|
38
35
|
name="priority"
|
|
39
36
|
:error="role.errors.priority"
|
|
40
37
|
type="number"
|
|
@@ -42,23 +39,23 @@
|
|
|
42
39
|
/> -->
|
|
43
40
|
<AwTextarea
|
|
44
41
|
v-model="role.description"
|
|
45
|
-
:label="$t('
|
|
42
|
+
:label="$t('Description')"
|
|
46
43
|
name="description"
|
|
47
44
|
:error="role.errors.description"
|
|
48
45
|
/>
|
|
49
|
-
<!-- <AwInfo :label="$t('
|
|
46
|
+
<!-- <AwInfo :label="$t('Do you want to use this role by default?')">
|
|
50
47
|
<AwSwitcher
|
|
51
48
|
v-model="role.default_new"
|
|
52
|
-
:label="$t('
|
|
49
|
+
:label="$t('Yes, I want to use by default.')"
|
|
53
50
|
/>
|
|
54
51
|
</AwInfo> -->
|
|
55
52
|
</AwGrid>
|
|
56
53
|
</AwCard>
|
|
57
54
|
|
|
58
|
-
<AwCard :title="$t('
|
|
55
|
+
<AwCard :title="$t('Permissions')">
|
|
59
56
|
<template #badge>
|
|
60
57
|
<AwLink
|
|
61
|
-
:text="$t('
|
|
58
|
+
:text="$t('All')"
|
|
62
59
|
@click.stop="toggleAllRoles"
|
|
63
60
|
/>
|
|
64
61
|
</template>
|
|
@@ -112,9 +109,7 @@ export default {
|
|
|
112
109
|
|
|
113
110
|
computed: {
|
|
114
111
|
title() {
|
|
115
|
-
return this.role.isNew()
|
|
116
|
-
? this.$t('aw.nuxt_admin.create_role')
|
|
117
|
-
: this.role.$.name
|
|
112
|
+
return this.role.isNew() ? this.$t('Create role') : this.role.$.name
|
|
118
113
|
}
|
|
119
114
|
},
|
|
120
115
|
|
|
@@ -135,7 +130,7 @@ export default {
|
|
|
135
130
|
async deleteRole() {
|
|
136
131
|
try {
|
|
137
132
|
await this.$confirm(
|
|
138
|
-
this.$t('
|
|
133
|
+
this.$t('Are you sure, you want to delete this role?')
|
|
139
134
|
)
|
|
140
135
|
await this.role.delete()
|
|
141
136
|
await this.$router.replace('/admin/roles')
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<AwPage
|
|
3
|
-
:title="$t('aw.nuxt_admin.roles')"
|
|
4
|
-
:breadcrumb="{ href: '/admin/users' }"
|
|
5
|
-
>
|
|
2
|
+
<AwPage :title="$t('Roles')" :breadcrumb="{ href: '/admin/users' }">
|
|
6
3
|
<template #buttons>
|
|
7
4
|
<AwPageMenuButtons
|
|
8
5
|
:items="[
|
|
9
6
|
{
|
|
10
|
-
text: $t('
|
|
7
|
+
text: $t('Create Role'),
|
|
11
8
|
icon: 'plus',
|
|
12
9
|
href: '/admin/roles/add',
|
|
13
10
|
cta: true
|
|
@@ -17,32 +14,31 @@
|
|
|
17
14
|
</template>
|
|
18
15
|
|
|
19
16
|
<AwTableBuilder :collection="roles" @click:row="showRole">
|
|
20
|
-
<AwTableCol :title="$t('
|
|
17
|
+
<AwTableCol :title="$t('Role')">
|
|
21
18
|
<template #default="{ cell }">
|
|
22
19
|
{{ cell.name }}
|
|
23
20
|
<span class="text-mono-400">
|
|
24
21
|
{{
|
|
25
22
|
cell.default_new
|
|
26
|
-
? '(' + $t('
|
|
23
|
+
? '(' + $t('default new') + ')'
|
|
27
24
|
: ''
|
|
28
25
|
}}
|
|
29
26
|
</span>
|
|
30
27
|
</template>
|
|
31
28
|
</AwTableCol>
|
|
32
|
-
<AwTableCol :title="$t('
|
|
29
|
+
<AwTableCol :title="$t('Permissions')">
|
|
33
30
|
<template #default="{ cell }">
|
|
34
|
-
{{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
{{
|
|
32
|
+
$t('{count} permissions of {total}', {
|
|
33
|
+
count: cell.permissions.length,
|
|
34
|
+
total: cell.permissions_total
|
|
35
|
+
})
|
|
36
|
+
}}
|
|
38
37
|
</template>
|
|
39
38
|
</AwTableCol>
|
|
40
|
-
<AwTableCol
|
|
41
|
-
field="users.count"
|
|
42
|
-
:title="$t('aw.nuxt_admin.employees')"
|
|
43
|
-
>
|
|
39
|
+
<AwTableCol field="users" :title="$t('Users')">
|
|
44
40
|
<template #default="{ cell }">
|
|
45
|
-
{{ $
|
|
41
|
+
{{ $t('Users: {count}', cell) }}
|
|
46
42
|
</template>
|
|
47
43
|
</AwTableCol>
|
|
48
44
|
</AwTableBuilder>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<AwPage
|
|
3
|
-
:title="$t('
|
|
3
|
+
:title="$t('Two-factor authentication')"
|
|
4
4
|
:breadcrumb="{ href: `/admin/users/${model.id}` }"
|
|
5
5
|
container="small"
|
|
6
6
|
>
|
|
7
7
|
<AwSwitcher
|
|
8
8
|
v-model="switcher"
|
|
9
9
|
:disabled="switcherDisabled"
|
|
10
|
-
:label="$t('
|
|
10
|
+
:label="$t('Two-factor authentication')"
|
|
11
11
|
/>
|
|
12
12
|
|
|
13
13
|
<!-- two factor form -->
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<AwGrid>
|
|
22
22
|
<AwTel
|
|
23
23
|
:value="phone"
|
|
24
|
-
:label="$t('
|
|
24
|
+
:label="$t('Phone')"
|
|
25
25
|
name="phone"
|
|
26
26
|
autocomplete="tel"
|
|
27
27
|
required
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
/>
|
|
30
30
|
<AwButton
|
|
31
31
|
type="submit"
|
|
32
|
-
:text="$t('
|
|
33
|
-
:data-loading="$t('
|
|
32
|
+
:text="$t('Enable')"
|
|
33
|
+
:data-loading="$t('Loading...')"
|
|
34
34
|
/>
|
|
35
35
|
</AwGrid>
|
|
36
36
|
</AwForm>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<!-- verify -->
|
|
40
40
|
<template v-if="twoFactorEnabled && !twoFactorVerified">
|
|
41
41
|
<AwButton
|
|
42
|
-
:text="$t('
|
|
42
|
+
:text="$t('Activation info')"
|
|
43
43
|
@click="$refs.infoModal.open()"
|
|
44
44
|
/>
|
|
45
45
|
|
|
@@ -48,14 +48,18 @@
|
|
|
48
48
|
theme="fullscreen"
|
|
49
49
|
ref="infoModal"
|
|
50
50
|
name="info"
|
|
51
|
-
:title="$t('
|
|
51
|
+
:title="$t('Activation info')"
|
|
52
52
|
>
|
|
53
53
|
<div class="max-w-sm mx-auto text-center">
|
|
54
54
|
<p class="text-xl">
|
|
55
|
-
{{ $t('
|
|
55
|
+
{{ $t('Scan QR Code') }}
|
|
56
56
|
</p>
|
|
57
57
|
<p class="mt-6">
|
|
58
|
-
{{
|
|
58
|
+
{{
|
|
59
|
+
$t(
|
|
60
|
+
'To enable the method please to scan the QR code using the Google Authenticator'
|
|
61
|
+
)
|
|
62
|
+
}}
|
|
59
63
|
</p>
|
|
60
64
|
<img
|
|
61
65
|
class="inline-block mt-6"
|
|
@@ -70,20 +74,24 @@
|
|
|
70
74
|
@sended="$auth.fetchUser()"
|
|
71
75
|
>
|
|
72
76
|
<AwCode
|
|
73
|
-
:label="$t('
|
|
77
|
+
:label="$t('Please enter authorization token')"
|
|
74
78
|
name="token"
|
|
75
79
|
@change="$nextTick(() => $refs.submit.$el.click())"
|
|
76
80
|
/>
|
|
77
81
|
<AwButton
|
|
78
82
|
ref="submit"
|
|
79
83
|
type="submit"
|
|
80
|
-
:text="$t('
|
|
84
|
+
:text="$t('Enable')"
|
|
81
85
|
class="sr-only"
|
|
82
86
|
/>
|
|
83
87
|
</AwForm>
|
|
84
88
|
|
|
85
89
|
<p class="mt-12 mb-6 text-center">
|
|
86
|
-
{{
|
|
90
|
+
{{
|
|
91
|
+
$t(
|
|
92
|
+
'If you do not have Google Authenticator, you can easily install it by clicking on the link below'
|
|
93
|
+
)
|
|
94
|
+
}}
|
|
87
95
|
</p>
|
|
88
96
|
|
|
89
97
|
<div class="flex justify-center items-center -mx-2">
|
|
@@ -119,7 +127,7 @@
|
|
|
119
127
|
<!-- verified -->
|
|
120
128
|
<AwButton
|
|
121
129
|
v-if="twoFactorVerified"
|
|
122
|
-
:text="$t('
|
|
130
|
+
:text="$t('Disable')"
|
|
123
131
|
@click="twoFactorDisable()"
|
|
124
132
|
/>
|
|
125
133
|
</AwPage>
|
|
@@ -2,36 +2,34 @@
|
|
|
2
2
|
<AwPage :title="title" :breadcrumb="breadcrumb" container="small">
|
|
3
3
|
<AwModelEdit :model="model">
|
|
4
4
|
<AwGrid>
|
|
5
|
-
<AwIsland :title="$t('
|
|
5
|
+
<AwIsland :title="$t('Information')" expanded>
|
|
6
6
|
<template v-if="!model.isNew() && isRolesEditable" #options>
|
|
7
7
|
<AwSwitcher
|
|
8
8
|
v-model="model.statusBoolean"
|
|
9
|
-
v-tooltip="
|
|
10
|
-
$t(`AwesIoNuxtAdmin.status_${model.status}`)
|
|
11
|
-
"
|
|
9
|
+
v-tooltip="$t(ucFirst(model.status))"
|
|
12
10
|
inactive-color="error"
|
|
13
11
|
/>
|
|
14
12
|
</template>
|
|
15
13
|
|
|
16
14
|
<AwGrid>
|
|
17
|
-
<AwInfo :label="$t('
|
|
15
|
+
<AwInfo :label="$t('Gender')">
|
|
18
16
|
<AwRadio
|
|
19
17
|
class="inline-block"
|
|
20
18
|
v-model="model.profile.sex"
|
|
21
|
-
:label="$t('
|
|
19
|
+
:label="$t('Male')"
|
|
22
20
|
value="male"
|
|
23
21
|
:error="model.errors['profile.sex']"
|
|
24
22
|
/>
|
|
25
23
|
<AwRadio
|
|
26
24
|
class="inline-block ml-3"
|
|
27
25
|
v-model="model.profile.sex"
|
|
28
|
-
:label="$t('
|
|
26
|
+
:label="$t('Female')"
|
|
29
27
|
value="female"
|
|
30
28
|
/>
|
|
31
29
|
<AwRadio
|
|
32
30
|
class="inline-block ml-3"
|
|
33
31
|
v-model="model.profile.sex"
|
|
34
|
-
:label="$t('
|
|
32
|
+
:label="$t('Divers')"
|
|
35
33
|
value="divers"
|
|
36
34
|
/>
|
|
37
35
|
</AwInfo>
|
|
@@ -39,20 +37,20 @@
|
|
|
39
37
|
<AwInput
|
|
40
38
|
v-model="model.profile.first_name"
|
|
41
39
|
name="first_name"
|
|
42
|
-
:label="$t('
|
|
40
|
+
:label="$t('First name')"
|
|
43
41
|
:error="model.errors['profile.first_name']"
|
|
44
42
|
autocomplete="given-name"
|
|
45
43
|
/>
|
|
46
44
|
<AwInput
|
|
47
45
|
v-model="model.profile.last_name"
|
|
48
|
-
:label="$t('
|
|
46
|
+
:label="$t('Last name')"
|
|
49
47
|
name="last_name"
|
|
50
48
|
:error="model.errors['profile.last_name']"
|
|
51
49
|
autocomplete="family-name"
|
|
52
50
|
/>
|
|
53
51
|
|
|
54
52
|
<AwInput
|
|
55
|
-
:label="$t('
|
|
53
|
+
:label="$t('Email')"
|
|
56
54
|
v-model="model.email"
|
|
57
55
|
name="email"
|
|
58
56
|
:error="model.errors.email"
|
|
@@ -61,7 +59,7 @@
|
|
|
61
59
|
|
|
62
60
|
<template v-if="model.isNew()">
|
|
63
61
|
<AwPassword
|
|
64
|
-
:label="$t('
|
|
62
|
+
:label="$t('Password')"
|
|
65
63
|
v-model="model.password"
|
|
66
64
|
name="email"
|
|
67
65
|
:error="model.errors.password"
|
|
@@ -71,7 +69,7 @@
|
|
|
71
69
|
<AwPassword
|
|
72
70
|
v-if="model.isNew()"
|
|
73
71
|
:label="
|
|
74
|
-
$t('
|
|
72
|
+
$t('Password confirmation')
|
|
75
73
|
"
|
|
76
74
|
v-model="model.password_confirmation"
|
|
77
75
|
name="email"
|
|
@@ -81,7 +79,7 @@
|
|
|
81
79
|
</template>
|
|
82
80
|
|
|
83
81
|
<AwTel
|
|
84
|
-
:label="$t('
|
|
82
|
+
:label="$t('Phone')"
|
|
85
83
|
v-model="model.profile.phone"
|
|
86
84
|
name="phone"
|
|
87
85
|
:error="model.errors['profile.phone']"
|
|
@@ -89,7 +87,7 @@
|
|
|
89
87
|
/>
|
|
90
88
|
|
|
91
89
|
<AwInput
|
|
92
|
-
:label="$t('
|
|
90
|
+
:label="$t('Position')"
|
|
93
91
|
v-model="model.profile.position"
|
|
94
92
|
name="position"
|
|
95
93
|
:error="model.errors['profile.position']"
|
|
@@ -99,12 +97,12 @@
|
|
|
99
97
|
|
|
100
98
|
<AwIsland
|
|
101
99
|
v-if="isRolesEditable"
|
|
102
|
-
:title="$t('
|
|
100
|
+
:title="$t('Permissions')"
|
|
103
101
|
expanded
|
|
104
102
|
>
|
|
105
103
|
<AwSelect
|
|
106
104
|
v-model="model.role.id"
|
|
107
|
-
:label="$t('
|
|
105
|
+
:label="$t('Role')"
|
|
108
106
|
:options="
|
|
109
107
|
(text) => `/api/admin/roles?name=${text}&limit=100`
|
|
110
108
|
"
|
|
@@ -114,9 +112,9 @@
|
|
|
114
112
|
/>
|
|
115
113
|
</AwIsland>
|
|
116
114
|
|
|
117
|
-
<AwIsland :title="$t('
|
|
115
|
+
<AwIsland :title="$t('About')" expanded>
|
|
118
116
|
<AwTextarea
|
|
119
|
-
:label="$t('
|
|
117
|
+
:label="$t('Description')"
|
|
120
118
|
v-model="model.profile.description"
|
|
121
119
|
name="description"
|
|
122
120
|
:error="model.errors['profile.description']"
|
|
@@ -132,8 +130,8 @@
|
|
|
132
130
|
>
|
|
133
131
|
{{
|
|
134
132
|
model.isNew()
|
|
135
|
-
? $t('
|
|
136
|
-
: $t('
|
|
133
|
+
? $t('Create')
|
|
134
|
+
: $t('Update')
|
|
137
135
|
}}
|
|
138
136
|
</AwButton>
|
|
139
137
|
|
|
@@ -145,7 +143,7 @@
|
|
|
145
143
|
@click="model.reset()"
|
|
146
144
|
:disabled="!model.changed()"
|
|
147
145
|
>
|
|
148
|
-
{{ $t('
|
|
146
|
+
{{ $t('Reset') }}
|
|
149
147
|
</AwButton>
|
|
150
148
|
</div> -->
|
|
151
149
|
</AwGrid>
|
|
@@ -155,6 +153,7 @@
|
|
|
155
153
|
|
|
156
154
|
<script>
|
|
157
155
|
import User from '@awes-io/nuxt-admin/src/collections/User'
|
|
156
|
+
import { ucFirst } from '@AwUtils/string'
|
|
158
157
|
|
|
159
158
|
export default {
|
|
160
159
|
name: 'AdminUserEditPage',
|
|
@@ -173,7 +172,7 @@ export default {
|
|
|
173
172
|
computed: {
|
|
174
173
|
title() {
|
|
175
174
|
return this.model.isNew()
|
|
176
|
-
? this.$t('
|
|
175
|
+
? this.$t('New user')
|
|
177
176
|
: this.model.full_name
|
|
178
177
|
},
|
|
179
178
|
|
|
@@ -199,8 +198,8 @@ export default {
|
|
|
199
198
|
await this.model.save()
|
|
200
199
|
|
|
201
200
|
this.$notify({
|
|
202
|
-
title: this.$t('
|
|
203
|
-
text: this.$t('
|
|
201
|
+
title: this.$t('Well Done!'),
|
|
202
|
+
text: this.$t('You have successfully updated the user profile.'),
|
|
204
203
|
type: 'success'
|
|
205
204
|
})
|
|
206
205
|
|
|
@@ -208,7 +207,9 @@ export default {
|
|
|
208
207
|
} catch (error) {
|
|
209
208
|
console.log(error)
|
|
210
209
|
}
|
|
211
|
-
}
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
ucFirst
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
215
|
</script>
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<AwPage
|
|
3
|
-
:title="$t('aw.nuxt_admin.title')"
|
|
4
|
-
:breadcrumb="{ href: '/admin/users' }"
|
|
5
|
-
>
|
|
2
|
+
<AwPage :title="$t('Settings')" :breadcrumb="{ href: '/admin/users' }">
|
|
6
3
|
<template #buttons>
|
|
7
4
|
<AwPageMenuButtons
|
|
8
5
|
:items="[
|
|
9
6
|
{
|
|
10
|
-
text: $t('
|
|
7
|
+
text: $t('Edit'),
|
|
11
8
|
icon: 'edit',
|
|
12
9
|
href: `/admin/users/${model.id}/edit`,
|
|
13
10
|
cta: true,
|
|
@@ -29,38 +26,38 @@
|
|
|
29
26
|
<AwBadge
|
|
30
27
|
v-if="$auth.user.id === model.id"
|
|
31
28
|
color="mono-400"
|
|
32
|
-
:text="$t('
|
|
29
|
+
:text="$t('You')"
|
|
33
30
|
/>
|
|
34
31
|
</template>
|
|
35
32
|
<template #options>
|
|
36
33
|
<AwLabel
|
|
37
34
|
:color="model.$.status === 'blocked' ? 'error' : 'success'"
|
|
38
|
-
:label="$t(
|
|
35
|
+
:label="$t(ucFirst(model.$.status))"
|
|
39
36
|
/>
|
|
40
37
|
</template>
|
|
41
38
|
<AwGrid>
|
|
42
|
-
<AwInfo :label="$t('
|
|
39
|
+
<AwInfo :label="$t('Gender')">
|
|
43
40
|
{{ model.$.profile.sex }}
|
|
44
41
|
</AwInfo>
|
|
45
|
-
<AwInfo :label="$t('
|
|
42
|
+
<AwInfo :label="$t('First name')">
|
|
46
43
|
{{ model.$.profile.first_name }}
|
|
47
44
|
</AwInfo>
|
|
48
|
-
<AwInfo :label="$t('
|
|
45
|
+
<AwInfo :label="$t('Last name')">
|
|
49
46
|
{{ model.$.profile.last_name }}
|
|
50
47
|
</AwInfo>
|
|
51
|
-
<AwInfo :label="$t('
|
|
48
|
+
<AwInfo :label="$t('Email')">
|
|
52
49
|
{{ model.$.email }}
|
|
53
50
|
</AwInfo>
|
|
54
|
-
<AwInfo :label="$t('
|
|
51
|
+
<AwInfo :label="$t('Phone')">
|
|
55
52
|
{{ model.$.profile.phone }}
|
|
56
53
|
</AwInfo>
|
|
57
|
-
<AwInfo :label="$t('
|
|
54
|
+
<AwInfo :label="$t('Position')">
|
|
58
55
|
{{ model.$.profile.position }}
|
|
59
56
|
</AwInfo>
|
|
60
|
-
<AwInfo :label="$t('
|
|
57
|
+
<AwInfo :label="$t('Role')">
|
|
61
58
|
{{ model.$.role.name }}
|
|
62
59
|
</AwInfo>
|
|
63
|
-
<AwInfo :label="$t('
|
|
60
|
+
<AwInfo :label="$t('Description')">
|
|
64
61
|
{{ model.$.profile.description }}
|
|
65
62
|
</AwInfo>
|
|
66
63
|
</AwGrid>
|
|
@@ -69,19 +66,19 @@
|
|
|
69
66
|
<template #aside v-if="isCurrentUser">
|
|
70
67
|
<AwGrid>
|
|
71
68
|
<AwIsland
|
|
72
|
-
:title="$t('
|
|
69
|
+
:title="$t('Change password')"
|
|
73
70
|
tag="NLink"
|
|
74
71
|
:to="`/admin/users/${model.id}/security`"
|
|
75
72
|
show-arrow
|
|
76
73
|
/>
|
|
77
74
|
<AwIsland
|
|
78
|
-
:title="$t('
|
|
75
|
+
:title="$t('Two-factor authentication')"
|
|
79
76
|
tag="NLink"
|
|
80
77
|
:to="`/admin/users/${model.id}/2fa`"
|
|
81
78
|
show-arrow
|
|
82
79
|
/>
|
|
83
80
|
<!-- <AwIsland
|
|
84
|
-
:title="$t('
|
|
81
|
+
:title="$t('Social authentication')"
|
|
85
82
|
tag="NLink"
|
|
86
83
|
:to="`/admin/users/${model.id}/social`"
|
|
87
84
|
show-arrow
|
|
@@ -95,6 +92,7 @@
|
|
|
95
92
|
import { mapGetters } from 'vuex'
|
|
96
93
|
import { pathOr } from 'rambdax'
|
|
97
94
|
import User from '@awes-io/nuxt-admin/src/collections/User'
|
|
95
|
+
import { ucFirst } from '@AwUtils/string'
|
|
98
96
|
|
|
99
97
|
export default {
|
|
100
98
|
name: 'AdminUserOverviewPage',
|
|
@@ -135,7 +133,9 @@ export default {
|
|
|
135
133
|
this.model.avatar = null
|
|
136
134
|
this.model.sync('avatar')
|
|
137
135
|
return this.$auth.fetchUser()
|
|
138
|
-
}
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
ucFirst
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<AwPage
|
|
3
|
-
:title="$t('
|
|
3
|
+
:title="$t('Set password')"
|
|
4
4
|
container="small"
|
|
5
5
|
:breadcrumb="{ href: `/admin/users/${model.id}` }"
|
|
6
6
|
>
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
type="password"
|
|
11
11
|
v-model="model.password"
|
|
12
12
|
name="password"
|
|
13
|
-
:label="$t('
|
|
13
|
+
:label="$t('Password')"
|
|
14
14
|
:error="model.errors.password"
|
|
15
15
|
/>
|
|
16
16
|
<AwPassword
|
|
17
17
|
type="password"
|
|
18
18
|
v-model="model.password_confirmation"
|
|
19
19
|
name="password_confirmation"
|
|
20
|
-
:label="$t('
|
|
20
|
+
:label="$t('Password confirmation')"
|
|
21
21
|
:error="model.errors.password"
|
|
22
22
|
/>
|
|
23
23
|
<AwButton
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
:loading="model.saving"
|
|
26
26
|
:disabled="!model.changed()"
|
|
27
27
|
>
|
|
28
|
-
{{ $t('
|
|
28
|
+
{{ $t('Update') }}
|
|
29
29
|
</AwButton>
|
|
30
30
|
</AwGrid>
|
|
31
31
|
</AwCard>
|
package/src/pages/users/_id.vue
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<AwPage :title="$t('
|
|
2
|
+
<AwPage :title="$t('Users')">
|
|
3
3
|
<template #buttons>
|
|
4
4
|
<AwPageMenuButtons
|
|
5
5
|
:items="[
|
|
6
6
|
{
|
|
7
|
-
text: $t('
|
|
7
|
+
text: $t('New user'),
|
|
8
8
|
href: '/admin/users/add',
|
|
9
9
|
icon: 'plus',
|
|
10
10
|
cta: true
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
text: $t('
|
|
13
|
+
text: $t('Roles'),
|
|
14
14
|
href: '/admin/roles'
|
|
15
15
|
}
|
|
16
16
|
]"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
:watch-params="['status', 'search']"
|
|
31
31
|
class="mt-8"
|
|
32
32
|
>
|
|
33
|
-
<AwTableCol :title="$t('
|
|
33
|
+
<AwTableCol :title="$t('User')">
|
|
34
34
|
<template #default="{ cell }">
|
|
35
35
|
<AwUserpic
|
|
36
36
|
:src="cell.avatar"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
<AwBadge
|
|
43
43
|
v-if="$auth.user.id === cell.id"
|
|
44
44
|
color="mono-400"
|
|
45
|
-
:text="$t('
|
|
45
|
+
:text="$t('You')"
|
|
46
46
|
/>
|
|
47
47
|
</template>
|
|
48
48
|
</AwUserpic>
|
|
@@ -50,24 +50,24 @@
|
|
|
50
50
|
</AwTableCol>
|
|
51
51
|
<AwTableCol
|
|
52
52
|
field="status"
|
|
53
|
-
:title="$t('
|
|
53
|
+
:title="$t('Status')"
|
|
54
54
|
:orderable="{ templateValue: 'status' }"
|
|
55
55
|
>
|
|
56
56
|
<template #default="{ cell }">
|
|
57
57
|
<AwLabel
|
|
58
58
|
:color="cell === 'blocked' ? 'error' : 'success'"
|
|
59
|
-
:label="$t(
|
|
59
|
+
:label="$t(ucFirst(cell))"
|
|
60
60
|
/>
|
|
61
61
|
</template>
|
|
62
62
|
</AwTableCol>
|
|
63
63
|
<AwTableCol
|
|
64
64
|
field="role.name"
|
|
65
65
|
:orderable="{ templateValue: 'role_name' }"
|
|
66
|
-
:title="$t('
|
|
66
|
+
:title="$t('Role')"
|
|
67
67
|
/>
|
|
68
68
|
<AwTableCol
|
|
69
69
|
field="last_activity"
|
|
70
|
-
:title="$t('
|
|
70
|
+
:title="$t('Last activity')"
|
|
71
71
|
:orderable="{ templateValue: 'last_login_at' }"
|
|
72
72
|
>
|
|
73
73
|
<template #default="{ cell }">
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
|
|
81
81
|
<script>
|
|
82
82
|
import Users from '@awes-io/nuxt-admin/src/collections/Users'
|
|
83
|
+
import { ucFirst } from '@AwUtils/string'
|
|
83
84
|
|
|
84
85
|
export default {
|
|
85
86
|
name: 'Users',
|
|
@@ -94,11 +95,11 @@ export default {
|
|
|
94
95
|
filters() {
|
|
95
96
|
return [
|
|
96
97
|
{
|
|
97
|
-
text: this.$t('
|
|
98
|
+
text: this.$t('Active'),
|
|
98
99
|
href: { query: { status: 'active' } }
|
|
99
100
|
},
|
|
100
101
|
{
|
|
101
|
-
text: this.$t('
|
|
102
|
+
text: this.$t('All'),
|
|
102
103
|
href: { query: {} }
|
|
103
104
|
}
|
|
104
105
|
]
|
|
@@ -108,7 +109,9 @@ export default {
|
|
|
108
109
|
methods: {
|
|
109
110
|
showUser(cell) {
|
|
110
111
|
this.$router.push(`/admin/users/${cell.id}`)
|
|
111
|
-
}
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
ucFirst
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
</script>
|