@fishawack/lab-velocity 2.0.0-beta.43 → 2.0.0-beta.44
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/_Build/vue/components/layout/TokenDisplay.vue +52 -0
- package/_Build/vue/modules/AuthModule/routes/PIntegrations/columns.js +58 -0
- package/_Build/vue/modules/AuthModule/routes/PIntegrations/resource.js +53 -96
- package/_Build/vue/modules/AuthModule/routes/PTeams/columns.js +78 -0
- package/_Build/vue/modules/AuthModule/routes/PTeams/resource.js +205 -290
- package/components/_token-display.scss +41 -0
- package/general.scss +1 -0
- package/index.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
:model-value="true"
|
|
4
|
+
title="Token Created"
|
|
5
|
+
width="560px"
|
|
6
|
+
class="token-display"
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
:close-on-press-escape="false"
|
|
9
|
+
:show-close="false"
|
|
10
|
+
>
|
|
11
|
+
<p class="token-display__warning">
|
|
12
|
+
<strong>The token below will not be shown again.</strong> Ensure
|
|
13
|
+
you've taken a copy before closing this window.
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<div class="token-display__block">
|
|
17
|
+
<div class="token-display__header">
|
|
18
|
+
<span class="token-display__label">Bearer Token</span>
|
|
19
|
+
<el-button size="small" plain @click="copy">
|
|
20
|
+
{{ copied ? "Copied ✓" : "Copy" }}
|
|
21
|
+
</el-button>
|
|
22
|
+
</div>
|
|
23
|
+
<pre class="token-display__value">{{ token }}</pre>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<template #footer>
|
|
27
|
+
<el-button type="primary" @click="$emit('close')">Done</el-button>
|
|
28
|
+
</template>
|
|
29
|
+
</el-dialog>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup>
|
|
33
|
+
import { ref } from "vue";
|
|
34
|
+
import { ElDialog, ElButton } from "element-plus";
|
|
35
|
+
|
|
36
|
+
const props = defineProps({
|
|
37
|
+
token: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
defineEmits(["close"]);
|
|
44
|
+
|
|
45
|
+
const copied = ref(false);
|
|
46
|
+
|
|
47
|
+
async function copy() {
|
|
48
|
+
await navigator.clipboard.writeText(props.token);
|
|
49
|
+
copied.value = true;
|
|
50
|
+
setTimeout(() => (copied.value = false), 2000);
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { h } from "vue";
|
|
2
|
+
|
|
3
|
+
import VelSelect from "../../../../components/form/Select.vue";
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
{
|
|
7
|
+
key: "name",
|
|
8
|
+
sortable: true,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
key: "scopes",
|
|
12
|
+
endpoint: "api/scopes",
|
|
13
|
+
labelKey: "description",
|
|
14
|
+
filterable: true,
|
|
15
|
+
clearable: true,
|
|
16
|
+
multiple: true,
|
|
17
|
+
initial: (props) =>
|
|
18
|
+
props.model?.client?.scopes?.map((id) => ({
|
|
19
|
+
id,
|
|
20
|
+
description: id,
|
|
21
|
+
})) ?? [],
|
|
22
|
+
preparation: ({ form }) => form.scopes.map((d) => d.id),
|
|
23
|
+
render: {
|
|
24
|
+
read: ({ model }) => h("span", model.client?.scopes.join(", ")),
|
|
25
|
+
write: () => h(VelSelect),
|
|
26
|
+
},
|
|
27
|
+
condition: {
|
|
28
|
+
table: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: "client_id",
|
|
33
|
+
label: "Client ID",
|
|
34
|
+
condition: {
|
|
35
|
+
form: false,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: "user_id",
|
|
40
|
+
label: "Created by",
|
|
41
|
+
render: {
|
|
42
|
+
read: ({ model }) => h("span", model?.user?.name ?? "System"),
|
|
43
|
+
},
|
|
44
|
+
condition: {
|
|
45
|
+
form: false,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: "access_logs_count",
|
|
50
|
+
label: "API Calls",
|
|
51
|
+
render: {
|
|
52
|
+
read: ({ model }) => h("span", model?.access_logs_count ?? 0),
|
|
53
|
+
},
|
|
54
|
+
condition: {
|
|
55
|
+
form: false,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
];
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { merge } from "lodash";
|
|
2
|
-
import {
|
|
3
|
-
import { h } from "vue";
|
|
2
|
+
import { h, ref } from "vue";
|
|
4
3
|
|
|
5
|
-
import { columns } from "../../../resource/index.js";
|
|
6
|
-
import
|
|
4
|
+
import { columns, defaultResource } from "../../../resource/index.js";
|
|
5
|
+
import integrationsColumns from "./columns.js";
|
|
6
|
+
import TokenDisplay from "../../../../components/layout/TokenDisplay.vue";
|
|
7
|
+
|
|
8
|
+
const newToken = ref(null);
|
|
7
9
|
|
|
8
10
|
export default [
|
|
9
11
|
"integrations",
|
|
@@ -23,100 +25,55 @@ export default [
|
|
|
23
25
|
edit: ({ $store }) => $store.getters.can("write integrations"),
|
|
24
26
|
delete: ({ $store }) => $store.getters.can("delete integrations"),
|
|
25
27
|
},
|
|
26
|
-
...merge(
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
condition: {
|
|
54
|
-
form: false,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
key: "user_id",
|
|
59
|
-
label: "Created by",
|
|
60
|
-
render: {
|
|
61
|
-
read: ({ model }) =>
|
|
62
|
-
h("span", model?.user?.name ?? "System"),
|
|
63
|
-
},
|
|
64
|
-
condition: {
|
|
65
|
-
form: false,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
key: "access_logs_count",
|
|
70
|
-
label: "API Calls",
|
|
71
|
-
render: {
|
|
72
|
-
read: ({ model }) =>
|
|
73
|
-
h("span", model?.access_logs_count ?? 0),
|
|
74
|
-
},
|
|
75
|
-
condition: {
|
|
76
|
-
form: false,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
]),
|
|
80
|
-
{
|
|
81
|
-
form: {
|
|
82
|
-
submit: async (props) => {
|
|
83
|
-
const { form, resource, $router } = props;
|
|
84
|
-
const hold = JSON.parse(JSON.stringify(form.data()));
|
|
85
|
-
try {
|
|
86
|
-
form.populate(resource.form.preparation(props));
|
|
87
|
-
let res = await form.post(
|
|
88
|
-
`${resource.api.endpoint(props)}`,
|
|
89
|
-
);
|
|
90
|
-
ElMessageBox.alert(
|
|
91
|
-
`<p>The token below will not be shown again. Ensure you've taken a copy before closing this window.<br><br><strong>Token</strong>:</p><p><em>${res.data.token}</em></p>`,
|
|
92
|
-
"Token minted",
|
|
93
|
-
{
|
|
94
|
-
confirmButtonText: "Ok",
|
|
95
|
-
dangerouslyUseHTMLString: true,
|
|
96
|
-
},
|
|
97
|
-
)
|
|
98
|
-
.then(() => {
|
|
99
|
-
$router.replace({
|
|
100
|
-
name: `${resource.name}.show`,
|
|
101
|
-
params: {
|
|
102
|
-
integrationsId: res.data.id,
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
})
|
|
106
|
-
.catch(() => {});
|
|
107
|
-
} catch (e) {
|
|
108
|
-
console.log(e);
|
|
109
|
-
} finally {
|
|
110
|
-
if (
|
|
111
|
-
!form.successful ||
|
|
112
|
-
!form.__options.resetOnSuccess
|
|
113
|
-
) {
|
|
114
|
-
form.populate(hold);
|
|
115
|
-
}
|
|
28
|
+
...merge(columns(integrationsColumns), {
|
|
29
|
+
form: {
|
|
30
|
+
submit: async (props) => {
|
|
31
|
+
const { form, resource, $router, model } = props;
|
|
32
|
+
const hold = JSON.parse(JSON.stringify(form.data()));
|
|
33
|
+
const isEdit = !!model;
|
|
34
|
+
const endpoint = isEdit
|
|
35
|
+
? `${resource.api.endpoint(props)}/${model.id}`
|
|
36
|
+
: `${resource.api.endpoint(props)}`;
|
|
37
|
+
try {
|
|
38
|
+
form.populate(resource.form.preparation(props));
|
|
39
|
+
let res = await form.post(endpoint);
|
|
40
|
+
newToken.value = res.data.token;
|
|
41
|
+
await $router.replace({
|
|
42
|
+
name: `${resource.name}.show`,
|
|
43
|
+
params: {
|
|
44
|
+
integrationsId: res.data.id,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
} catch (e) {
|
|
48
|
+
console.log(e);
|
|
49
|
+
} finally {
|
|
50
|
+
if (
|
|
51
|
+
!form.successful ||
|
|
52
|
+
!form.__options.resetOnSuccess
|
|
53
|
+
) {
|
|
54
|
+
form.populate(hold);
|
|
116
55
|
}
|
|
117
|
-
}
|
|
56
|
+
}
|
|
118
57
|
},
|
|
119
58
|
},
|
|
120
|
-
|
|
59
|
+
show: {
|
|
60
|
+
...defaultResource.show,
|
|
61
|
+
layout: [
|
|
62
|
+
...defaultResource.show.layout,
|
|
63
|
+
() =>
|
|
64
|
+
h({
|
|
65
|
+
setup: () => () => {
|
|
66
|
+
if (!newToken.value) return null;
|
|
67
|
+
return h(TokenDisplay, {
|
|
68
|
+
token: newToken.value,
|
|
69
|
+
onClose: () => {
|
|
70
|
+
newToken.value = null;
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
121
78
|
},
|
|
122
79
|
];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { h } from "vue";
|
|
2
|
+
|
|
3
|
+
import VelSelect from "../../../../components/form/Select.vue";
|
|
4
|
+
import VelFormRole from "../../../../components/layout/FormRole.vue";
|
|
5
|
+
import Chip from "../../../../components/layout/Chip.vue";
|
|
6
|
+
import Chips from "../../../../components/layout/Chips.vue";
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
{
|
|
10
|
+
key: "name",
|
|
11
|
+
sortable: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
key: "description",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
key: "company_id",
|
|
18
|
+
label: "Company",
|
|
19
|
+
endpoint: "api/companies",
|
|
20
|
+
labelKey: "name",
|
|
21
|
+
filterable: true,
|
|
22
|
+
searchParam: "name",
|
|
23
|
+
condition: {
|
|
24
|
+
form: {
|
|
25
|
+
write: ({ $route, model }) =>
|
|
26
|
+
!$route.params.companiesId && !model?.company,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
initial: ({ model, $route }) =>
|
|
30
|
+
model?.company ||
|
|
31
|
+
($route.params.companiesId && {
|
|
32
|
+
id: $route.params.companiesId,
|
|
33
|
+
}),
|
|
34
|
+
preparation: ({ form }) => form.company_id?.id,
|
|
35
|
+
render: {
|
|
36
|
+
read: ({ model }) => h("span", model.company.name),
|
|
37
|
+
write: () => h(VelSelect),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "user_count",
|
|
42
|
+
label: "Users",
|
|
43
|
+
condition: {
|
|
44
|
+
form: false,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: "roles",
|
|
49
|
+
initial: ({ model }) => model?.roles.map((val) => val.id) || [],
|
|
50
|
+
preparation: ({ form }) =>
|
|
51
|
+
form.roles?.map((d) => (typeof d === "object" ? d.value : d)),
|
|
52
|
+
render: {
|
|
53
|
+
read: ({ model }) =>
|
|
54
|
+
h(
|
|
55
|
+
!model.overrides_roles_and_permissions ||
|
|
56
|
+
model.roles.length === 1
|
|
57
|
+
? Chip
|
|
58
|
+
: Chips,
|
|
59
|
+
!model.overrides_roles_and_permissions
|
|
60
|
+
? {
|
|
61
|
+
name: "inherited",
|
|
62
|
+
label: "Inherited",
|
|
63
|
+
}
|
|
64
|
+
: model.roles.length === 1
|
|
65
|
+
? {
|
|
66
|
+
name: model.roles[0].name,
|
|
67
|
+
label: model.roles[0].label,
|
|
68
|
+
}
|
|
69
|
+
: { array: model.roles },
|
|
70
|
+
),
|
|
71
|
+
write: ({ model, form }) =>
|
|
72
|
+
h(VelFormRole, {
|
|
73
|
+
overrides: model?.overrides_roles_and_permissions,
|
|
74
|
+
form,
|
|
75
|
+
}),
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
];
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { merge } from "lodash";
|
|
2
|
-
import { h
|
|
2
|
+
import { h } from "vue";
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import { throttle } from "lodash";
|
|
5
5
|
|
|
6
|
-
import { columns } from "../../../resource/index.js";
|
|
6
|
+
import { columns, defaultResource, meta } from "../../../resource/index.js";
|
|
7
7
|
import userResource from "../PUsers/resource.js";
|
|
8
|
-
import
|
|
8
|
+
import teamsColumns from "./columns.js";
|
|
9
9
|
|
|
10
10
|
import VelFormRole from "../../../../components/layout/FormRole.vue";
|
|
11
|
-
import Chip from "../../../../components/layout/Chip.vue";
|
|
12
|
-
import Chips from "../../../../components/layout/Chips.vue";
|
|
13
11
|
import VelRoleLegend from "../../../../components/layout/RoleLegend.vue";
|
|
14
|
-
|
|
15
12
|
import VelTableSorter from "../../../../components/layout/TableSorter.vue";
|
|
16
13
|
import VelButton from "../../../../components/basic/Button.vue";
|
|
17
14
|
import VelCheckbox from "../../../../components/form/Checkbox.vue";
|
|
18
|
-
import VelSelect from "../../../../components/form/Select.vue";
|
|
19
15
|
|
|
20
16
|
export default [
|
|
21
17
|
"teams",
|
|
@@ -38,298 +34,217 @@ export default [
|
|
|
38
34
|
edit: ({ $store }) => $store.getters.can("write teams"),
|
|
39
35
|
delete: ({ $store }) => $store.getters.can("delete teams"),
|
|
40
36
|
},
|
|
41
|
-
...merge(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
key: "description",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
key: "company_id",
|
|
52
|
-
label: "Company",
|
|
53
|
-
endpoint: "api/companies",
|
|
54
|
-
labelKey: "name",
|
|
55
|
-
filterable: true,
|
|
56
|
-
searchParam: "name",
|
|
57
|
-
condition: {
|
|
58
|
-
form: {
|
|
59
|
-
write: ({ $route, model }) =>
|
|
60
|
-
!$route.params.companiesId && !model?.company,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
initial: ({ model, $route }) =>
|
|
64
|
-
model?.company ||
|
|
65
|
-
($route.params.companiesId && {
|
|
66
|
-
id: $route.params.companiesId,
|
|
37
|
+
...merge(columns(teamsColumns), {
|
|
38
|
+
index: {
|
|
39
|
+
layout: [
|
|
40
|
+
...defaultResource.index.layout,
|
|
41
|
+
() =>
|
|
42
|
+
h(VelRoleLegend, {
|
|
43
|
+
class: "mt-5",
|
|
67
44
|
}),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
key: "roles",
|
|
83
|
-
initial: ({ model }) =>
|
|
84
|
-
model?.roles.map((val) => val.id) || [],
|
|
85
|
-
preparation: ({ form }) =>
|
|
86
|
-
form.roles?.map((d) =>
|
|
87
|
-
typeof d === "object" ? d.value : d,
|
|
88
|
-
),
|
|
89
|
-
render: {
|
|
90
|
-
read: ({ model }) =>
|
|
91
|
-
h(
|
|
92
|
-
!model.overrides_roles_and_permissions ||
|
|
93
|
-
model.roles.length === 1
|
|
94
|
-
? Chip
|
|
95
|
-
: Chips,
|
|
96
|
-
!model.overrides_roles_and_permissions
|
|
97
|
-
? {
|
|
98
|
-
name: "inherited",
|
|
99
|
-
label: "Inherited",
|
|
100
|
-
}
|
|
101
|
-
: model.roles.length === 1
|
|
102
|
-
? {
|
|
103
|
-
name: model.roles[0].name,
|
|
104
|
-
label: model.roles[0].label,
|
|
105
|
-
}
|
|
106
|
-
: { array: model.roles },
|
|
107
|
-
),
|
|
108
|
-
write: ({ model, form }) =>
|
|
109
|
-
h(VelFormRole, {
|
|
110
|
-
overrides:
|
|
111
|
-
model?.overrides_roles_and_permissions,
|
|
112
|
-
form,
|
|
113
|
-
}),
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
]),
|
|
117
|
-
{
|
|
118
|
-
index: {
|
|
119
|
-
layout: [
|
|
120
|
-
...defaultResource.index.layout,
|
|
121
|
-
() =>
|
|
122
|
-
h(VelRoleLegend, {
|
|
123
|
-
class: "mt-5",
|
|
124
|
-
}),
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
show: {
|
|
128
|
-
tabs: [
|
|
129
|
-
...defaultResource.show.tabs,
|
|
130
|
-
({ model }) => ({
|
|
131
|
-
label: "Access control",
|
|
132
|
-
component: h(VelFormRole, {
|
|
133
|
-
overrides:
|
|
134
|
-
model.overrides_roles_and_permissions,
|
|
135
|
-
form: { roles: model.roles.map((d) => d.id) },
|
|
136
|
-
readonly: true,
|
|
137
|
-
}),
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
show: {
|
|
48
|
+
tabs: [
|
|
49
|
+
...defaultResource.show.tabs,
|
|
50
|
+
({ model }) => ({
|
|
51
|
+
label: "Access control",
|
|
52
|
+
component: h(VelFormRole, {
|
|
53
|
+
overrides: model.overrides_roles_and_permissions,
|
|
54
|
+
form: { roles: model.roles.map((d) => d.id) },
|
|
55
|
+
readonly: true,
|
|
138
56
|
}),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
render() {
|
|
186
|
-
return h(
|
|
187
|
-
VelButton,
|
|
188
|
-
{
|
|
189
|
-
tag: "a",
|
|
190
|
-
size: "small",
|
|
191
|
-
type: "warning",
|
|
192
|
-
loading:
|
|
193
|
-
this
|
|
194
|
-
.loading,
|
|
195
|
-
onClick:
|
|
196
|
-
async () => {
|
|
197
|
-
this.loading = true;
|
|
198
|
-
|
|
199
|
-
await axios.delete(
|
|
200
|
-
`api/teams/${$route.params.teamsId}/users/${model.id}`,
|
|
201
|
-
);
|
|
202
|
-
|
|
203
|
-
this.emitter.emit(
|
|
204
|
-
"reload-teams",
|
|
205
|
-
);
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
"Remove",
|
|
209
|
-
);
|
|
210
|
-
},
|
|
57
|
+
}),
|
|
58
|
+
(props) => {
|
|
59
|
+
const { model, $store, $router, $route, ...rest } =
|
|
60
|
+
props;
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
label: "Members",
|
|
64
|
+
component: h({
|
|
65
|
+
data: () => ({
|
|
66
|
+
scoped: true,
|
|
67
|
+
}),
|
|
68
|
+
mounted() {
|
|
69
|
+
this.emitter.on("reload-teams", () => {
|
|
70
|
+
this.reload();
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
beforeUnmount() {
|
|
74
|
+
this.emitter.off("reload-teams");
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
reload: throttle(function () {
|
|
78
|
+
this.$refs.members.reload();
|
|
79
|
+
this.$refs.users.reload();
|
|
80
|
+
}, 1000),
|
|
81
|
+
},
|
|
82
|
+
render() {
|
|
83
|
+
return h("div", [
|
|
84
|
+
h("h3", "Members"),
|
|
85
|
+
(() => {
|
|
86
|
+
const resource = meta(
|
|
87
|
+
...userResource,
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
resource.api.params.index = ({
|
|
91
|
+
$route,
|
|
92
|
+
}) => ({
|
|
93
|
+
include: "company",
|
|
94
|
+
"filter[teams.id]":
|
|
95
|
+
$route.params.teamsId,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
resource.table.actions = [
|
|
99
|
+
({ model }) =>
|
|
100
|
+
h({
|
|
101
|
+
data: () => ({
|
|
102
|
+
loading: false,
|
|
211
103
|
}),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
104
|
+
render() {
|
|
105
|
+
return h(
|
|
106
|
+
VelButton,
|
|
107
|
+
{
|
|
108
|
+
tag: "a",
|
|
109
|
+
size: "small",
|
|
110
|
+
type: "warning",
|
|
111
|
+
loading:
|
|
112
|
+
this
|
|
113
|
+
.loading,
|
|
114
|
+
onClick:
|
|
115
|
+
async () => {
|
|
116
|
+
this.loading = true;
|
|
117
|
+
|
|
118
|
+
await axios.delete(
|
|
119
|
+
`api/teams/${$route.params.teamsId}/users/${model.id}`,
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
this.emitter.emit(
|
|
123
|
+
"reload-teams",
|
|
124
|
+
);
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
"Remove",
|
|
128
|
+
);
|
|
231
129
|
},
|
|
130
|
+
}),
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
const props = {
|
|
134
|
+
model,
|
|
135
|
+
$store,
|
|
136
|
+
$router,
|
|
137
|
+
$route,
|
|
138
|
+
...rest,
|
|
139
|
+
resource,
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
return h(
|
|
143
|
+
VelTableSorter,
|
|
144
|
+
merge(
|
|
145
|
+
resource.index.structure(
|
|
146
|
+
props,
|
|
232
147
|
),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}),
|
|
249
|
-
(() => {
|
|
250
|
-
const resource = meta(
|
|
251
|
-
...userResource,
|
|
252
|
-
);
|
|
253
|
-
|
|
254
|
-
resource.api.params.index = ({
|
|
255
|
-
$route,
|
|
256
|
-
}) => ({
|
|
257
|
-
include: "company",
|
|
258
|
-
"filter[company_id]": this
|
|
259
|
-
.scoped
|
|
260
|
-
? $route.params
|
|
261
|
-
.companiesId
|
|
262
|
-
: null,
|
|
263
|
-
"filter[teams.id]": `!${$route.params.teamsId}`,
|
|
148
|
+
{
|
|
149
|
+
ref: "members",
|
|
150
|
+
},
|
|
151
|
+
),
|
|
152
|
+
);
|
|
153
|
+
})(),
|
|
154
|
+
h("h3", "Users"),
|
|
155
|
+
h(VelCheckbox, {
|
|
156
|
+
label: "Only show users from this company",
|
|
157
|
+
class: "mt-2",
|
|
158
|
+
modelValue: this.scoped,
|
|
159
|
+
"onUpdate:modelValue": (value) => {
|
|
160
|
+
this.scoped = value;
|
|
161
|
+
this.$nextTick(() => {
|
|
162
|
+
this.$refs.users.reload();
|
|
264
163
|
});
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
{
|
|
289
|
-
id: model.id,
|
|
290
|
-
},
|
|
291
|
-
);
|
|
292
|
-
|
|
293
|
-
this.emitter.emit(
|
|
294
|
-
"reload-teams",
|
|
295
|
-
);
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
"Add",
|
|
299
|
-
);
|
|
300
|
-
},
|
|
164
|
+
},
|
|
165
|
+
}),
|
|
166
|
+
(() => {
|
|
167
|
+
const resource = meta(
|
|
168
|
+
...userResource,
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
resource.api.params.index = ({
|
|
172
|
+
$route,
|
|
173
|
+
}) => ({
|
|
174
|
+
include: "company",
|
|
175
|
+
"filter[company_id]": this
|
|
176
|
+
.scoped
|
|
177
|
+
? $route.params.companiesId
|
|
178
|
+
: null,
|
|
179
|
+
"filter[teams.id]": `!${$route.params.teamsId}`,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
resource.table.actions = [
|
|
183
|
+
({ model }) =>
|
|
184
|
+
h({
|
|
185
|
+
data: () => ({
|
|
186
|
+
loading: false,
|
|
301
187
|
}),
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
188
|
+
render() {
|
|
189
|
+
return h(
|
|
190
|
+
VelButton,
|
|
191
|
+
{
|
|
192
|
+
tag: "a",
|
|
193
|
+
size: "small",
|
|
194
|
+
type: "primary",
|
|
195
|
+
loading:
|
|
196
|
+
this
|
|
197
|
+
.loading,
|
|
198
|
+
onClick:
|
|
199
|
+
async () => {
|
|
200
|
+
this.loading = true;
|
|
201
|
+
|
|
202
|
+
await axios.post(
|
|
203
|
+
`api/teams/${$route.params.teamsId}/users`,
|
|
204
|
+
{
|
|
205
|
+
id: model.id,
|
|
206
|
+
},
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
this.emitter.emit(
|
|
210
|
+
"reload-teams",
|
|
211
|
+
);
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
"Add",
|
|
215
|
+
);
|
|
321
216
|
},
|
|
217
|
+
}),
|
|
218
|
+
];
|
|
219
|
+
|
|
220
|
+
const props = {
|
|
221
|
+
model,
|
|
222
|
+
$store,
|
|
223
|
+
$router,
|
|
224
|
+
$route,
|
|
225
|
+
...rest,
|
|
226
|
+
resource,
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
return h(
|
|
230
|
+
VelTableSorter,
|
|
231
|
+
merge(
|
|
232
|
+
resource.index.structure(
|
|
233
|
+
props,
|
|
322
234
|
),
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
235
|
+
{
|
|
236
|
+
ref: "users",
|
|
237
|
+
},
|
|
238
|
+
),
|
|
239
|
+
);
|
|
240
|
+
})(),
|
|
241
|
+
]);
|
|
242
|
+
},
|
|
243
|
+
}),
|
|
244
|
+
};
|
|
245
|
+
},
|
|
246
|
+
],
|
|
332
247
|
},
|
|
333
|
-
),
|
|
248
|
+
}),
|
|
334
249
|
},
|
|
335
250
|
];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.token-display {
|
|
2
|
+
&__warning {
|
|
3
|
+
font-size: 14px;
|
|
4
|
+
color: #606266;
|
|
5
|
+
margin: 0 0 16px;
|
|
6
|
+
line-height: 1.6;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&__block {
|
|
10
|
+
margin-top: 16px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&__header {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
margin-bottom: 8px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&__label {
|
|
21
|
+
font-size: 11px;
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
letter-spacing: 0.08em;
|
|
24
|
+
text-transform: uppercase;
|
|
25
|
+
color: #909399;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__value {
|
|
29
|
+
background: #1a1a2e;
|
|
30
|
+
color: #a8ff78;
|
|
31
|
+
border-radius: 6px;
|
|
32
|
+
padding: 16px 20px;
|
|
33
|
+
font-size: 13px;
|
|
34
|
+
line-height: 1.7;
|
|
35
|
+
overflow-x: auto;
|
|
36
|
+
white-space: pre-wrap;
|
|
37
|
+
word-break: break-all;
|
|
38
|
+
font-family: monospace;
|
|
39
|
+
margin: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
package/general.scss
CHANGED
package/index.js
CHANGED
|
@@ -15,7 +15,9 @@ export { default as UserColumns } from "./_Build/vue/modules/AuthModule/routes/P
|
|
|
15
15
|
export { default as CompanyResource } from "./_Build/vue/modules/AuthModule/routes/PCompanies/resource.js";
|
|
16
16
|
export { default as CompanyColumns } from "./_Build/vue/modules/AuthModule/routes/PCompanies/columns.js";
|
|
17
17
|
export { default as TeamResource } from "./_Build/vue/modules/AuthModule/routes/PTeams/resource.js";
|
|
18
|
+
export { default as TeamColumns } from "./_Build/vue/modules/AuthModule/routes/PTeams/columns.js";
|
|
18
19
|
export { default as IntegrationResource } from "./_Build/vue/modules/AuthModule/routes/PIntegrations/resource.js";
|
|
20
|
+
export { default as IntegrationColumns } from "./_Build/vue/modules/AuthModule/routes/PIntegrations/columns.js";
|
|
19
21
|
|
|
20
22
|
export { default as Button } from "./_Build/vue/components/basic/Button.vue";
|
|
21
23
|
export { default as Link } from "./_Build/vue/components/basic/link.vue";
|
|
@@ -48,6 +50,7 @@ export { default as PageTitle } from "./_Build/vue/components/layout/pageTitle.v
|
|
|
48
50
|
export { default as Alert } from "./_Build/vue/components/layout/Alert.vue";
|
|
49
51
|
export { default as Tooltip } from "./_Build/vue/components/layout/Tooltip.vue";
|
|
50
52
|
export { default as Audit } from "./_Build/vue/components/layout/Audit.vue";
|
|
53
|
+
export { default as TokenDisplay } from "./_Build/vue/components/layout/TokenDisplay.vue";
|
|
51
54
|
export { default as Menu } from "./_Build/vue/components/navigation/Menu.vue";
|
|
52
55
|
export { default as MenuItem } from "./_Build/vue/components/navigation/MenuItem.vue";
|
|
53
56
|
export { default as MenuItemGroup } from "./_Build/vue/components/navigation/MenuItemGroup.vue";
|