@liujitcn/kratos-admin-system 0.0.49 → 0.0.51
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/README.md +44 -8
- package/dist/package/declarations/src/api/system/admin/v1/base_i18n_custom.d.ts +18 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_redact_output_policy.d.ts +4 -1
- package/dist/package/declarations/src/api/system/admin/v1/base_redact_storage_policy.d.ts +3 -1
- package/dist/package/declarations/src/api/system/admin/v1/base_tenant.d.ts +2 -2
- package/dist/package/declarations/src/api/system/admin/v1/base_tenant_project.d.ts +23 -0
- package/dist/package/declarations/src/api/system/admin/v1/base_tenant_project_grant.d.ts +16 -0
- package/dist/package/declarations/src/components/tenant-project/TenantProjectManager.vue.d.ts +29 -0
- package/dist/package/declarations/src/components/tenant-project/TenantProjectSelect.vue.d.ts +31 -0
- package/dist/package/declarations/src/components/tenant-project/TenantProjectText.vue.d.ts +19 -0
- package/dist/package/declarations/src/components/tenant-project/tenant-project-manager-data.d.ts +14 -0
- package/dist/package/declarations/src/components/tenant-project/tenant-project-manager.d.ts +40 -0
- package/dist/package/declarations/src/components/tenant-project-grant/ProjectGrantDialog.vue.d.ts +8 -0
- package/dist/package/declarations/src/index.d.ts +2 -0
- package/dist/package/declarations/src/locales/generated.d.ts +196 -0
- package/dist/package/declarations/src/rpc/base/v1/config.d.ts +11 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_i18n_custom.d.ts +105 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_output_policy.d.ts +8 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_storage_policy.d.ts +25 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_tenant.d.ts +10 -1
- package/dist/package/declarations/src/rpc/system/admin/v1/base_tenant_project.d.ts +141 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_tenant_project_grant.d.ts +105 -0
- package/dist/package/declarations/src/views/ai/chat/components/SessionPanel.vue.d.ts +2 -2
- package/dist/package/declarations/src/views/ai/chat/components/speech-recognition.d.ts +33 -0
- package/dist/package/declarations/src/views/base/i18n-custom/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/tenant-project/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/base/tenant-project-grant/index.vue.d.ts +3 -0
- package/dist/package/src/api/system/admin/v1/base_i18n_custom.ts +72 -0
- package/dist/package/src/api/system/admin/v1/base_redact_output_policy.ts +7 -0
- package/dist/package/src/api/system/admin/v1/base_redact_storage_policy.ts +7 -0
- package/dist/package/src/api/system/admin/v1/base_tenant.ts +3 -2
- package/dist/package/src/api/system/admin/v1/base_tenant_project.ts +94 -0
- package/dist/package/src/api/system/admin/v1/base_tenant_project_grant.ts +63 -0
- package/dist/package/src/components/tenant-project/TenantProjectManager.vue +431 -0
- package/dist/package/src/components/tenant-project/TenantProjectSelect.vue +83 -0
- package/dist/package/src/components/tenant-project/TenantProjectText.vue +37 -0
- package/dist/package/src/components/tenant-project/tenant-project-manager-data.ts +26 -0
- package/dist/package/src/components/tenant-project/tenant-project-manager.ts +48 -0
- package/dist/package/src/components/tenant-project-grant/ProjectGrantDialog.vue +108 -0
- package/dist/package/src/index.ts +12 -0
- package/dist/package/src/locales/README.md +1 -1
- package/dist/package/src/locales/en-US.json +51 -2
- package/dist/package/src/locales/ja-JP.json +51 -2
- package/dist/package/src/locales/zh-CN.json +51 -2
- package/dist/package/src/locales/zh-TW.json +51 -2
- package/dist/package/src/module.ts +3 -3
- package/dist/package/src/rpc/base/v1/config.ts +12 -0
- package/dist/package/src/rpc/system/admin/v1/base_i18n_custom.ts +126 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_output_policy.ts +9 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_storage_policy.ts +30 -0
- package/dist/package/src/rpc/system/admin/v1/base_tenant.ts +11 -1
- package/dist/package/src/rpc/system/admin/v1/base_tenant_project.ts +166 -0
- package/dist/package/src/rpc/system/admin/v1/base_tenant_project_grant.ts +128 -0
- package/dist/package/src/views/ai/chat/components/XSender.vue +21 -28
- package/dist/package/src/views/ai/chat/components/speech-recognition.ts +156 -0
- package/dist/package/src/views/base/api-log/index.vue +3 -3
- package/dist/package/src/views/base/config/index.vue +3 -3
- package/dist/package/src/views/base/data-access-log/index.vue +3 -3
- package/dist/package/src/views/base/dept/index.vue +10 -45
- package/dist/package/src/views/base/dict/index.vue +3 -3
- package/dist/package/src/views/base/dict/item.vue +3 -3
- package/dist/package/src/views/base/file/index.vue +12 -3
- package/dist/package/src/views/base/i18n-custom/index.vue +321 -0
- package/dist/package/src/views/base/job/index.vue +85 -161
- package/dist/package/src/views/base/login-log/index.vue +13 -4
- package/dist/package/src/views/base/login-policy/index.vue +109 -40
- package/dist/package/src/views/base/menu/index.vue +3 -3
- package/dist/package/src/views/base/message/index.vue +9 -32
- package/dist/package/src/views/base/message-category/index.vue +2 -4
- package/dist/package/src/views/base/oauth-client/index.vue +8 -42
- package/dist/package/src/views/base/online-session/index.vue +8 -27
- package/dist/package/src/views/base/operation-log/index.vue +3 -3
- package/dist/package/src/views/base/permission-log/index.vue +3 -3
- package/dist/package/src/views/base/policy-evaluation-log/index.vue +3 -3
- package/dist/package/src/views/base/post/index.vue +9 -42
- package/dist/package/src/views/base/redact-output-policy/index.vue +19 -7
- package/dist/package/src/views/base/redact-rule/index.vue +70 -53
- package/dist/package/src/views/base/redact-storage-policy/index.vue +18 -7
- package/dist/package/src/views/base/role/index.vue +14 -48
- package/dist/package/src/views/base/tenant/index.vue +163 -19
- package/dist/package/src/views/base/tenant-project/index.vue +12 -0
- package/dist/package/src/views/base/tenant-project-grant/index.vue +338 -0
- package/dist/package/src/views/base/user/index.vue +30 -51
- package/dist/package/src/views/profile/components/login-log.vue +15 -2
- package/dist/package/src/views/profile/components/password.vue +1 -1
- package/dist/package/src/views/profile/components/security.vue +2 -2
- package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +2 -2
- package/dist/package/src/views/tool/code-gen/config.ts +2 -1
- package/package.json +2 -2
- /package/dist/package/declarations/src/components/{ChangePasswordForm.vue.d.ts → account/ChangePasswordForm.vue.d.ts} +0 -0
- /package/dist/package/declarations/src/components/{ForcedPasswordDialog.vue.d.ts → account/ForcedPasswordDialog.vue.d.ts} +0 -0
- /package/dist/package/declarations/src/components/{Ai.vue.d.ts → ai/Ai.vue.d.ts} +0 -0
- /package/dist/package/declarations/src/components/{DynamicI18nCell.vue.d.ts → i18n/DynamicI18nCell.vue.d.ts} +0 -0
- /package/dist/package/declarations/src/components/{DynamicI18nEditor.vue.d.ts → i18n/DynamicI18nEditor.vue.d.ts} +0 -0
- /package/dist/package/declarations/src/components/{dynamicI18n.d.ts → i18n/dynamicI18n.d.ts} +0 -0
- /package/dist/package/declarations/src/components/{LogTable.vue.d.ts → log/LogTable.vue.d.ts} +0 -0
- /package/dist/package/declarations/src/components/{log.d.ts → log/log.d.ts} +0 -0
- /package/dist/package/declarations/src/components/{Notification.vue.d.ts → notification/Notification.vue.d.ts} +0 -0
- /package/dist/package/src/components/{ChangePasswordForm.vue → account/ChangePasswordForm.vue} +0 -0
- /package/dist/package/src/components/{ForcedPasswordDialog.vue → account/ForcedPasswordDialog.vue} +0 -0
- /package/dist/package/src/components/{Ai.vue → ai/Ai.vue} +0 -0
- /package/dist/package/src/components/{DynamicI18nCell.vue → i18n/DynamicI18nCell.vue} +0 -0
- /package/dist/package/src/components/{DynamicI18nEditor.vue → i18n/DynamicI18nEditor.vue} +0 -0
- /package/dist/package/src/components/{dynamicI18n.ts → i18n/dynamicI18n.ts} +0 -0
- /package/dist/package/src/components/{LogTable.vue → log/LogTable.vue} +0 -0
- /package/dist/package/src/components/{log.ts → log/log.ts} +0 -0
- /package/dist/package/src/components/{Notification.vue → notification/Notification.vue} +0 -0
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
v-model="dialog.visible"
|
|
10
10
|
:title="t(dialog.titleKey)"
|
|
11
11
|
width="980px"
|
|
12
|
+
label-width="auto"
|
|
12
13
|
:model="formData"
|
|
13
14
|
:fields="formFields"
|
|
14
15
|
:rules="formRules"
|
|
@@ -19,15 +20,34 @@
|
|
|
19
20
|
<div class="rules-editor">
|
|
20
21
|
<div v-for="(rule, index) in formData.rules" :key="rule.id || index" class="rule-row">
|
|
21
22
|
<el-select v-model="rule.restriction_type" class="rule-type">
|
|
22
|
-
<el-option
|
|
23
|
+
<el-option
|
|
24
|
+
v-for="option in restrictionTypeOptions"
|
|
25
|
+
:key="String(option.value)"
|
|
26
|
+
:label="option.label"
|
|
27
|
+
:value="option.value"
|
|
28
|
+
/>
|
|
23
29
|
</el-select>
|
|
24
30
|
<el-select v-model="rule.restriction_method" class="rule-method">
|
|
25
|
-
<el-option
|
|
31
|
+
<el-option
|
|
32
|
+
v-for="option in restrictionMethodOptions"
|
|
33
|
+
:key="String(option.value)"
|
|
34
|
+
:label="option.label"
|
|
35
|
+
:value="option.value"
|
|
36
|
+
/>
|
|
26
37
|
</el-select>
|
|
27
|
-
<el-input
|
|
38
|
+
<el-input
|
|
39
|
+
v-model="rule.restriction_value"
|
|
40
|
+
class="rule-value"
|
|
41
|
+
:placeholder="rulePlaceholder(rule.restriction_method)"
|
|
42
|
+
/>
|
|
28
43
|
<el-input v-model="rule.reason" class="rule-reason" :placeholder="t('system.base.login_policy.placeholder.reason')" />
|
|
29
44
|
<el-select v-model="rule.status" class="rule-status">
|
|
30
|
-
<el-option
|
|
45
|
+
<el-option
|
|
46
|
+
v-for="option in statusOptions"
|
|
47
|
+
:key="String(option.value)"
|
|
48
|
+
:label="option.label"
|
|
49
|
+
:value="option.value"
|
|
50
|
+
/>
|
|
31
51
|
</el-select>
|
|
32
52
|
<el-button link type="danger" :icon="Delete" @click="removeRule(index)" />
|
|
33
53
|
</div>
|
|
@@ -36,6 +56,9 @@
|
|
|
36
56
|
</el-button>
|
|
37
57
|
</div>
|
|
38
58
|
</template>
|
|
59
|
+
<template #initialPasswordStrength>
|
|
60
|
+
<PasswordStrength :password="formData.initial_password" />
|
|
61
|
+
</template>
|
|
39
62
|
</FormDialog>
|
|
40
63
|
</div>
|
|
41
64
|
</template>
|
|
@@ -46,14 +69,15 @@ import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
|
|
|
46
69
|
import { ElButton, ElMessage, ElMessageBox, ElTag } from "element-plus";
|
|
47
70
|
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
48
71
|
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
72
|
+
import PasswordStrength from "@liujitcn/kratos-admin-core/components/PasswordStrength/index.vue";
|
|
49
73
|
import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
50
74
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
51
75
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
52
76
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
53
77
|
import { PASSWORD_CRYPTO_SCENE, encryptPassword } from "@liujitcn/kratos-admin-core/security";
|
|
78
|
+
import { useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
|
|
54
79
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
55
80
|
import { defBaseLoginPolicyService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_login_policy";
|
|
56
|
-
import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_tenant";
|
|
57
81
|
import { defBaseUserService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_user";
|
|
58
82
|
import type { SelectOptionResponse_Option } from "@liujitcn/kratos-admin-system/rpc/common/v1/common";
|
|
59
83
|
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
@@ -70,7 +94,11 @@ import {
|
|
|
70
94
|
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_login_policy";
|
|
71
95
|
|
|
72
96
|
/** 登录策略表单状态,初始化密码仅在提交时转换为一次性密码密文。 */
|
|
73
|
-
interface BaseLoginPolicyFormState extends Omit<BaseLoginPolicyForm, "initial_password"> {
|
|
97
|
+
interface BaseLoginPolicyFormState extends Omit<BaseLoginPolicyForm, "initial_password" | "tenant_id" | "user_id"> {
|
|
98
|
+
/** 租户作用域目标,未选择时保持未定义。 */
|
|
99
|
+
tenant_id?: number;
|
|
100
|
+
/** 用户作用域目标,未选择时保持未定义。 */
|
|
101
|
+
user_id?: number;
|
|
74
102
|
/** 初始化密码明文只保留在当前表单,留空表示不修改已有值。 */
|
|
75
103
|
initial_password: string;
|
|
76
104
|
}
|
|
@@ -81,9 +109,9 @@ const { BUTTONS } = useAuthButtons();
|
|
|
81
109
|
const proTable = ref<ProTableInstance>();
|
|
82
110
|
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
83
111
|
const dialog = reactive({ visible: false, titleKey: "common.action.create" });
|
|
84
|
-
const tenantOptions = ref<SelectOptionResponse_Option[]>([]);
|
|
85
112
|
const userOptions = ref<SelectOptionResponse_Option[]>([]);
|
|
86
113
|
const formData = reactive<BaseLoginPolicyFormState>(defaultForm());
|
|
114
|
+
const { isDefaultTenant, tenantFormField, loadTenantOptions } = useTenantScope();
|
|
87
115
|
|
|
88
116
|
const scopeTypeOptions = computed<ProFormOption[]>(() => [
|
|
89
117
|
{ label: t("system.base.login_policy.scope.global"), value: BaseLoginPolicyScopeType.BASE_LOGIN_POLICY_SCOPE_TYPE_GLOBAL },
|
|
@@ -91,15 +119,36 @@ const scopeTypeOptions = computed<ProFormOption[]>(() => [
|
|
|
91
119
|
{ label: t("common.field.user"), value: BaseLoginPolicyScopeType.BASE_LOGIN_POLICY_SCOPE_TYPE_USER }
|
|
92
120
|
]);
|
|
93
121
|
const restrictionTypeOptions = computed<ProFormOption[]>(() => [
|
|
94
|
-
{
|
|
95
|
-
|
|
122
|
+
{
|
|
123
|
+
label: t("system.base.login_policy.restriction.blacklist"),
|
|
124
|
+
value: BaseLoginPolicyRestrictionType.BASE_LOGIN_POLICY_RESTRICTION_TYPE_BLACKLIST
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: t("system.base.login_policy.restriction.whitelist"),
|
|
128
|
+
value: BaseLoginPolicyRestrictionType.BASE_LOGIN_POLICY_RESTRICTION_TYPE_WHITELIST
|
|
129
|
+
}
|
|
96
130
|
]);
|
|
97
131
|
const restrictionMethodOptions = computed<ProFormOption[]>(() => [
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
{
|
|
132
|
+
{
|
|
133
|
+
label: t("system.base.login_policy.method.ip"),
|
|
134
|
+
value: BaseLoginPolicyRestrictionMethod.BASE_LOGIN_POLICY_RESTRICTION_METHOD_IP
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: t("system.base.login_policy.method.mac"),
|
|
138
|
+
value: BaseLoginPolicyRestrictionMethod.BASE_LOGIN_POLICY_RESTRICTION_METHOD_MAC
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
label: t("system.base.login_policy.method.region"),
|
|
142
|
+
value: BaseLoginPolicyRestrictionMethod.BASE_LOGIN_POLICY_RESTRICTION_METHOD_REGION
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: t("system.base.login_policy.method.time"),
|
|
146
|
+
value: BaseLoginPolicyRestrictionMethod.BASE_LOGIN_POLICY_RESTRICTION_METHOD_TIME
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
label: t("system.base.login_policy.method.device"),
|
|
150
|
+
value: BaseLoginPolicyRestrictionMethod.BASE_LOGIN_POLICY_RESTRICTION_METHOD_DEVICE
|
|
151
|
+
}
|
|
103
152
|
]);
|
|
104
153
|
const statusOptions = computed<ProFormOption[]>(() => [
|
|
105
154
|
{ label: t("common.status.enabled"), value: Status.STATUS_ENABLE },
|
|
@@ -107,14 +156,15 @@ const statusOptions = computed<ProFormOption[]>(() => [
|
|
|
107
156
|
]);
|
|
108
157
|
|
|
109
158
|
const formFields = computed<ProFormField[]>(() => [
|
|
110
|
-
{ prop: "scope_type", label: t("system.base.login_policy.field.scope_type"), component: "select", options: scopeTypeOptions.value },
|
|
111
159
|
{
|
|
112
|
-
prop: "
|
|
113
|
-
label: t("
|
|
160
|
+
prop: "scope_type",
|
|
161
|
+
label: t("system.base.login_policy.field.scope_type"),
|
|
114
162
|
component: "select",
|
|
115
|
-
options:
|
|
116
|
-
|
|
117
|
-
|
|
163
|
+
options: scopeTypeOptions.value
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
...tenantFormField({ label: t("common.field.tenant"), props: { clearable: true } }),
|
|
167
|
+
visible: model => isDefaultTenant.value && model.scope_type !== BaseLoginPolicyScopeType.BASE_LOGIN_POLICY_SCOPE_TYPE_GLOBAL
|
|
118
168
|
},
|
|
119
169
|
{
|
|
120
170
|
prop: "user_id",
|
|
@@ -178,6 +228,12 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
178
228
|
component: "password",
|
|
179
229
|
props: { placeholder: t("system.base.login_policy.placeholder.initial_password"), showPassword: true }
|
|
180
230
|
},
|
|
231
|
+
{
|
|
232
|
+
prop: "initialPasswordStrength",
|
|
233
|
+
label: t("system.base.login_policy.field.password_strength"),
|
|
234
|
+
component: "slot",
|
|
235
|
+
slotName: "initialPasswordStrength"
|
|
236
|
+
},
|
|
181
237
|
{ prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value },
|
|
182
238
|
{ prop: "rules", label: t("system.base.login_policy.field.rules"), component: "slot", slotName: "rules", colSpan: 24 }
|
|
183
239
|
]);
|
|
@@ -186,15 +242,25 @@ const formRules = computed(() => ({
|
|
|
186
242
|
scope_type: [{ required: true, message: t("system.base.login_policy.validation.scope_type"), trigger: "change" }],
|
|
187
243
|
tenant_id: [{ validator: validateTenant, trigger: "change" }],
|
|
188
244
|
user_id: [{ validator: validateUser, trigger: "change" }],
|
|
189
|
-
max_failed_attempts: [
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
245
|
+
max_failed_attempts: [
|
|
246
|
+
{ required: true, message: t("system.base.login_policy.validation.max_failed_attempts"), trigger: "change" }
|
|
247
|
+
],
|
|
248
|
+
lock_duration_minutes: [
|
|
249
|
+
{ required: true, message: t("system.base.login_policy.validation.lock_duration_minutes"), trigger: "change" }
|
|
250
|
+
],
|
|
251
|
+
password_min_length: [
|
|
252
|
+
{ required: true, message: t("system.base.login_policy.validation.password_min_length"), trigger: "change" }
|
|
253
|
+
],
|
|
254
|
+
password_history_count: [
|
|
255
|
+
{ required: true, message: t("system.base.login_policy.validation.password_history_count"), trigger: "change" }
|
|
256
|
+
],
|
|
193
257
|
password_min_complexity_classes: [
|
|
194
258
|
{ required: true, message: t("system.base.login_policy.validation.password_min_complexity_classes"), trigger: "change" }
|
|
195
259
|
],
|
|
196
|
-
password_max_age_days: [
|
|
197
|
-
|
|
260
|
+
password_max_age_days: [
|
|
261
|
+
{ required: true, message: t("system.base.login_policy.validation.password_max_age_days"), trigger: "change" }
|
|
262
|
+
],
|
|
263
|
+
mfa_remember_days: [{ required: true, message: t("system.base.login_policy.validation.mfa_remember_days"), trigger: "change" }]
|
|
198
264
|
}));
|
|
199
265
|
|
|
200
266
|
const columns = computed<ColumnProps[]>(() => [
|
|
@@ -233,7 +299,12 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
233
299
|
}
|
|
234
300
|
},
|
|
235
301
|
{ prop: "password_min_length", label: t("system.base.login_policy.field.password_min_length"), width: 110, align: "right" },
|
|
236
|
-
{
|
|
302
|
+
{
|
|
303
|
+
prop: "password_history_count",
|
|
304
|
+
label: t("system.base.login_policy.field.password_history_count"),
|
|
305
|
+
width: 110,
|
|
306
|
+
align: "right"
|
|
307
|
+
},
|
|
237
308
|
{
|
|
238
309
|
prop: "password_min_complexity_classes",
|
|
239
310
|
label: t("system.base.login_policy.field.password_min_complexity_classes"),
|
|
@@ -303,13 +374,13 @@ watch(
|
|
|
303
374
|
() => formData.scope_type,
|
|
304
375
|
value => {
|
|
305
376
|
if (value === BaseLoginPolicyScopeType.BASE_LOGIN_POLICY_SCOPE_TYPE_GLOBAL) {
|
|
306
|
-
formData.tenant_id =
|
|
307
|
-
formData.user_id =
|
|
377
|
+
formData.tenant_id = undefined;
|
|
378
|
+
formData.user_id = undefined;
|
|
308
379
|
userOptions.value = [];
|
|
309
380
|
return;
|
|
310
381
|
}
|
|
311
382
|
if (value === BaseLoginPolicyScopeType.BASE_LOGIN_POLICY_SCOPE_TYPE_TENANT) {
|
|
312
|
-
formData.user_id =
|
|
383
|
+
formData.user_id = undefined;
|
|
313
384
|
userOptions.value = [];
|
|
314
385
|
}
|
|
315
386
|
}
|
|
@@ -332,8 +403,8 @@ function defaultForm(): BaseLoginPolicyFormState {
|
|
|
332
403
|
return {
|
|
333
404
|
id: 0,
|
|
334
405
|
scope_type: BaseLoginPolicyScopeType.BASE_LOGIN_POLICY_SCOPE_TYPE_GLOBAL,
|
|
335
|
-
tenant_id:
|
|
336
|
-
user_id:
|
|
406
|
+
tenant_id: undefined,
|
|
407
|
+
user_id: undefined,
|
|
337
408
|
max_failed_attempts: 5,
|
|
338
409
|
lock_duration_minutes: 15,
|
|
339
410
|
allow_concurrent_login: false,
|
|
@@ -384,12 +455,6 @@ async function openDialog(id?: number) {
|
|
|
384
455
|
dialog.visible = true;
|
|
385
456
|
}
|
|
386
457
|
|
|
387
|
-
/** 加载租户选项。 */
|
|
388
|
-
async function loadTenantOptions() {
|
|
389
|
-
const response = await defBaseTenantService.OptionBaseTenant({ keyword: "" });
|
|
390
|
-
tenantOptions.value = response.list ?? [];
|
|
391
|
-
}
|
|
392
|
-
|
|
393
458
|
/** 加载指定租户的用户选项。 */
|
|
394
459
|
async function loadUserOptions(tenantId: number) {
|
|
395
460
|
const response = await defBaseUserService.OptionBaseUser({ keyword: "", tenant_id: tenantId });
|
|
@@ -403,6 +468,8 @@ async function handleSubmit() {
|
|
|
403
468
|
|
|
404
469
|
const baseLoginPolicy: BaseLoginPolicyForm = {
|
|
405
470
|
...formData,
|
|
471
|
+
tenant_id: formData.tenant_id ?? 0,
|
|
472
|
+
user_id: formData.user_id ?? 0,
|
|
406
473
|
initial_password: formData.initial_password
|
|
407
474
|
? await encryptPassword(formData.initial_password, PASSWORD_CRYPTO_SCENE.PASSWORD_CRYPTO_SCENE_CONFIGURE_PASSWORD_POLICY)
|
|
408
475
|
: undefined
|
|
@@ -472,7 +539,8 @@ function scopeTypeLabel(value: BaseLoginPolicyScopeType) {
|
|
|
472
539
|
|
|
473
540
|
/** 输出策略目标名称。 */
|
|
474
541
|
function targetLabel(row: BaseLoginPolicy) {
|
|
475
|
-
if (row.scope_type === BaseLoginPolicyScopeType.BASE_LOGIN_POLICY_SCOPE_TYPE_GLOBAL)
|
|
542
|
+
if (row.scope_type === BaseLoginPolicyScopeType.BASE_LOGIN_POLICY_SCOPE_TYPE_GLOBAL)
|
|
543
|
+
return t("system.base.login_policy.scope.global");
|
|
476
544
|
if (row.scope_type === BaseLoginPolicyScopeType.BASE_LOGIN_POLICY_SCOPE_TYPE_USER) return row.user_name || String(row.user_id);
|
|
477
545
|
return row.tenant_name || String(row.tenant_id);
|
|
478
546
|
}
|
|
@@ -488,7 +556,8 @@ function renderRules(row: BaseLoginPolicy) {
|
|
|
488
556
|
h(
|
|
489
557
|
ElTag,
|
|
490
558
|
{ key: `${rule.id || index}`, size: "small", class: "rule-tag" },
|
|
491
|
-
() =>
|
|
559
|
+
() =>
|
|
560
|
+
`${restrictionTypeLabel(rule.restriction_type)}/${restrictionMethodLabel(rule.restriction_method)}: ${rule.restriction_value}`
|
|
492
561
|
)
|
|
493
562
|
)
|
|
494
563
|
);
|
|
@@ -79,14 +79,14 @@ import { BaseMenuType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/
|
|
|
79
79
|
import { I18nTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
80
80
|
import { normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
81
81
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
82
|
-
import DynamicI18nEditor from "@liujitcn/kratos-admin-system/components/DynamicI18nEditor.vue";
|
|
83
|
-
import DynamicI18nCell from "@liujitcn/kratos-admin-system/components/DynamicI18nCell.vue";
|
|
82
|
+
import DynamicI18nEditor from "@liujitcn/kratos-admin-system/components/i18n/DynamicI18nEditor.vue";
|
|
83
|
+
import DynamicI18nCell from "@liujitcn/kratos-admin-system/components/i18n/DynamicI18nCell.vue";
|
|
84
84
|
import {
|
|
85
85
|
normalizeDynamicI18ns,
|
|
86
86
|
serializeDynamicI18ns,
|
|
87
87
|
type DynamicI18nRecord,
|
|
88
88
|
type DynamicI18nValue
|
|
89
|
-
} from "@liujitcn/kratos-admin-system/components/dynamicI18n";
|
|
89
|
+
} from "@liujitcn/kratos-admin-system/components/i18n/dynamicI18n";
|
|
90
90
|
|
|
91
91
|
defineOptions({
|
|
92
92
|
name: "BaseMenu",
|
|
@@ -150,12 +150,10 @@ import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn
|
|
|
150
150
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
151
151
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
152
152
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
153
|
-
import {
|
|
154
|
-
import { useUserStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
153
|
+
import { useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
|
|
155
154
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
156
155
|
import { defBaseMessageService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_message";
|
|
157
156
|
import { defBaseMessageCategoryService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_message_category";
|
|
158
|
-
import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_tenant";
|
|
159
157
|
import type {
|
|
160
158
|
BaseMessage,
|
|
161
159
|
BaseMessageDetail,
|
|
@@ -189,12 +187,10 @@ type MessageFormState = Omit<BaseMessageForm, "tenant_id" | "category_id"> & {
|
|
|
189
187
|
};
|
|
190
188
|
|
|
191
189
|
const { BUTTONS } = useAuthButtons();
|
|
192
|
-
const
|
|
193
|
-
const isDefaultTenant = computed(() => userStore.userInfo.tenant_code === DEFAULT_TENANT_CODE);
|
|
190
|
+
const { isDefaultTenant, tenantColumns, tenantFormField, loadTenantOptions } = useTenantScope();
|
|
194
191
|
const proTable = ref<ProTableInstance>();
|
|
195
192
|
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
196
193
|
const categoryOptions = ref<ProFormOption[]>([]);
|
|
197
|
-
const tenantOptions = ref<ProFormOption[]>([]);
|
|
198
194
|
const dialog = reactive({ visible: false, titleKey: "common.action.create" });
|
|
199
195
|
const content = reactive<{ visible: boolean; loading: boolean; data?: BaseMessageDetail }>({ visible: false, loading: false });
|
|
200
196
|
const detail = reactive<{ visible: boolean; data?: BaseMessageDetail }>({ visible: false });
|
|
@@ -270,13 +266,12 @@ const rules = computed(() => ({
|
|
|
270
266
|
|
|
271
267
|
const formFields = computed<ProFormField[]>(() => [
|
|
272
268
|
{
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
props: { filterable: true, disabled: Boolean(formState.id), placeholder: t("system.base.message.placeholder.tenant") }
|
|
269
|
+
...tenantFormField({
|
|
270
|
+
label: t("common.field.tenant"),
|
|
271
|
+
disabledOnEdit: true,
|
|
272
|
+
props: { placeholder: t("system.base.message.placeholder.tenant") }
|
|
273
|
+
}),
|
|
274
|
+
labelTooltip: t("system.base.message.tooltip.tenant")
|
|
280
275
|
},
|
|
281
276
|
{
|
|
282
277
|
prop: "category_id",
|
|
@@ -358,18 +353,7 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
358
353
|
|
|
359
354
|
const columns = computed<ColumnProps[]>(() => [
|
|
360
355
|
{ type: "selection", width: 55 },
|
|
361
|
-
...(
|
|
362
|
-
? ([
|
|
363
|
-
{
|
|
364
|
-
prop: "tenant_id",
|
|
365
|
-
label: t("common.field.tenant"),
|
|
366
|
-
minWidth: 120,
|
|
367
|
-
align: "left",
|
|
368
|
-
search: { el: "select" },
|
|
369
|
-
enum: requestTenantOptions
|
|
370
|
-
}
|
|
371
|
-
] satisfies ColumnProps[])
|
|
372
|
-
: []),
|
|
356
|
+
...tenantColumns({ label: t("common.field.tenant"), minWidth: 120 }),
|
|
373
357
|
{
|
|
374
358
|
prop: "title",
|
|
375
359
|
label: t("system.base.message.field.title"),
|
|
@@ -553,13 +537,6 @@ async function requestTable(params: Record<string, unknown>) {
|
|
|
553
537
|
return { data: { list: data.base_messages ?? [], total: data.total } };
|
|
554
538
|
}
|
|
555
539
|
|
|
556
|
-
/** 加载租户选项。 */
|
|
557
|
-
async function loadTenantOptions() {
|
|
558
|
-
if (!isDefaultTenant.value) return;
|
|
559
|
-
const result = await defBaseTenantService.OptionBaseTenant({ keyword: "" });
|
|
560
|
-
tenantOptions.value = result.list.map(item => ({ label: item.label, value: item.value }));
|
|
561
|
-
}
|
|
562
|
-
|
|
563
540
|
/** 加载消息分类选项。 */
|
|
564
541
|
async function loadCategoryOptions() {
|
|
565
542
|
const result = await defBaseMessageCategoryService.OptionBaseMessageCategory({});
|
|
@@ -23,8 +23,7 @@ import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn
|
|
|
23
23
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
24
24
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
25
25
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
26
|
-
import {
|
|
27
|
-
import { useUserStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
26
|
+
import { useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
|
|
28
27
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
29
28
|
import { defBaseMessageCategoryService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_message_category";
|
|
30
29
|
import type {
|
|
@@ -39,8 +38,7 @@ defineOptions({ name: "BaseMessageCategory", inheritAttrs: false });
|
|
|
39
38
|
|
|
40
39
|
/** 消息分类页面表单状态。 */
|
|
41
40
|
const { BUTTONS } = useAuthButtons();
|
|
42
|
-
const
|
|
43
|
-
const isDefaultTenant = computed(() => userStore.userInfo.tenant_code === DEFAULT_TENANT_CODE);
|
|
41
|
+
const { isDefaultTenant } = useTenantScope();
|
|
44
42
|
const proTable = ref<ProTableInstance>();
|
|
45
43
|
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
46
44
|
const dialog = reactive({ visible: false, titleKey: "common.action.create" });
|
|
@@ -34,7 +34,6 @@ import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-c
|
|
|
34
34
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
35
35
|
import { copyText } from "@liujitcn/kratos-admin-core/security";
|
|
36
36
|
import { defOauthClientService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/oauth_client";
|
|
37
|
-
import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_tenant";
|
|
38
37
|
import type { BaseApi } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_api";
|
|
39
38
|
import {
|
|
40
39
|
OauthClientCryptoType,
|
|
@@ -42,10 +41,8 @@ import {
|
|
|
42
41
|
type OauthClientForm,
|
|
43
42
|
type PageOauthClientRequest
|
|
44
43
|
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/oauth_client";
|
|
45
|
-
import type { SelectOptionResponse_Option } from "@liujitcn/kratos-admin-system/rpc/common/v1/common";
|
|
46
44
|
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
47
|
-
import {
|
|
48
|
-
import { DEFAULT_TENANT_CODE, requestTenantOptions } from "@liujitcn/kratos-admin-core/tenant";
|
|
45
|
+
import { useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
|
|
49
46
|
|
|
50
47
|
/** 开放授权客户端表单状态,新增时租户保持未选择。 */
|
|
51
48
|
type OauthClientFormState = Omit<OauthClientForm, "tenant_id"> & {
|
|
@@ -59,12 +56,10 @@ defineOptions({
|
|
|
59
56
|
});
|
|
60
57
|
|
|
61
58
|
const { BUTTONS } = useAuthButtons();
|
|
62
|
-
const
|
|
63
|
-
const isDefaultTenant = computed(() => userStore.userInfo.tenant_code === DEFAULT_TENANT_CODE);
|
|
59
|
+
const { isDefaultTenant, tenantColumns, tenantFormField, loadTenantOptions } = useTenantScope();
|
|
64
60
|
const proTable = ref<ProTableInstance>();
|
|
65
61
|
const formDialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
66
62
|
const apiOptions = ref<BaseApi[]>([]);
|
|
67
|
-
const tenantOptions = ref<SelectOptionResponse_Option[]>([]);
|
|
68
63
|
|
|
69
64
|
const dialog = reactive({
|
|
70
65
|
titleKey: "common.action.create",
|
|
@@ -102,8 +97,6 @@ const transferOptions = computed<ProFormOption[]>(() =>
|
|
|
102
97
|
}))
|
|
103
98
|
);
|
|
104
99
|
|
|
105
|
-
const tenantNameMap = computed(() => new Map(tenantOptions.value.map(item => [item.value, item.label])));
|
|
106
|
-
|
|
107
100
|
const rules = computed(() => ({
|
|
108
101
|
tenant_id: [
|
|
109
102
|
{
|
|
@@ -137,18 +130,7 @@ const rules = computed(() => ({
|
|
|
137
130
|
}));
|
|
138
131
|
|
|
139
132
|
const formFields = computed<ProFormField[]>(() => [
|
|
140
|
-
{
|
|
141
|
-
prop: "tenant_id",
|
|
142
|
-
label: t("common.field.tenant"),
|
|
143
|
-
component: "select",
|
|
144
|
-
props: {
|
|
145
|
-
filterable: true,
|
|
146
|
-
disabled: Boolean(formData.id),
|
|
147
|
-
placeholder: t("common.placeholder.select")
|
|
148
|
-
},
|
|
149
|
-
options: tenantOptions.value,
|
|
150
|
-
visible: () => isDefaultTenant.value
|
|
151
|
-
},
|
|
133
|
+
tenantFormField({ label: t("common.field.tenant"), disabledOnEdit: true, props: { placeholder: t("common.placeholder.select") } }),
|
|
152
134
|
{
|
|
153
135
|
prop: "client_name",
|
|
154
136
|
label: t("system.base.oauth_client.field.client_name"),
|
|
@@ -184,20 +166,7 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
184
166
|
|
|
185
167
|
const columns = computed<ColumnProps[]>(() => [
|
|
186
168
|
{ type: "selection", width: 55 },
|
|
187
|
-
...(
|
|
188
|
-
? ([
|
|
189
|
-
{
|
|
190
|
-
prop: "tenant_id",
|
|
191
|
-
label: t("common.field.tenant"),
|
|
192
|
-
minWidth: 130,
|
|
193
|
-
align: "left",
|
|
194
|
-
search: { el: "select", key: "tenant_id", props: { filterable: true }, order: 1 },
|
|
195
|
-
enum: requestTenantOptions,
|
|
196
|
-
render: scope =>
|
|
197
|
-
tenantNameMap.value.get((scope.row as OauthClient).tenant_id) ?? String((scope.row as OauthClient).tenant_id)
|
|
198
|
-
}
|
|
199
|
-
] satisfies ColumnProps[])
|
|
200
|
-
: []),
|
|
169
|
+
...tenantColumns({ label: t("common.field.tenant"), minWidth: 130, order: 1 }),
|
|
201
170
|
{ prop: "client_id", label: t("system.base.oauth_client.field.client_id"), minWidth: 220 },
|
|
202
171
|
{ prop: "client_name", label: t("system.base.oauth_client.field.client_name"), minWidth: 160, search: { el: "input" } },
|
|
203
172
|
{
|
|
@@ -284,7 +253,10 @@ const headerActions = computed<HeaderActionProps[]>(() => [
|
|
|
284
253
|
]);
|
|
285
254
|
|
|
286
255
|
async function requestOauthClientTable(params: PageOauthClientRequest) {
|
|
287
|
-
const data = await defOauthClientService.PageOauthClient(
|
|
256
|
+
const data = await defOauthClientService.PageOauthClient({
|
|
257
|
+
...buildPageRequest(params),
|
|
258
|
+
tenant_id: isDefaultTenant.value ? params.tenant_id : undefined
|
|
259
|
+
});
|
|
288
260
|
return { data: { list: data.oauth_clients ?? [], total: data.total } };
|
|
289
261
|
}
|
|
290
262
|
|
|
@@ -293,12 +265,6 @@ async function loadApiOptions() {
|
|
|
293
265
|
apiOptions.value = data.base_apis ?? [];
|
|
294
266
|
}
|
|
295
267
|
|
|
296
|
-
async function loadTenantOptions() {
|
|
297
|
-
if (userStore.userInfo.tenant_code !== DEFAULT_TENANT_CODE || tenantOptions.value.length) return;
|
|
298
|
-
const data = await defBaseTenantService.OptionBaseTenant({ keyword: "" });
|
|
299
|
-
tenantOptions.value = data.list ?? [];
|
|
300
|
-
}
|
|
301
|
-
|
|
302
268
|
async function handleOpenDialog(id?: number) {
|
|
303
269
|
await loadTenantOptions();
|
|
304
270
|
await loadApiOptions();
|
|
@@ -15,14 +15,12 @@
|
|
|
15
15
|
<script setup lang="ts">
|
|
16
16
|
import { computed, ref } from "vue";
|
|
17
17
|
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
18
|
-
import type { ColumnProps,
|
|
19
|
-
import {
|
|
20
|
-
import { useUserStore } from "@liujitcn/kratos-admin-core/stores/runtime";
|
|
18
|
+
import type { ColumnProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
19
|
+
import { requestTenantCodeOptions, useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
|
|
21
20
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
22
21
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
23
22
|
import { formatDateTime } from "@liujitcn/kratos-admin-core/format";
|
|
24
23
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
25
|
-
import { defBaseTenantService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_tenant";
|
|
26
24
|
import { defBaseSessionService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_session";
|
|
27
25
|
import type { BaseSession, PageOnlineBaseSessionsRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_session";
|
|
28
26
|
|
|
@@ -30,18 +28,17 @@ defineOptions({ name: "BaseOnlineSession", inheritAttrs: false });
|
|
|
30
28
|
|
|
31
29
|
const { BUTTONS } = useAuthButtons();
|
|
32
30
|
const proTable = ref<ProTableInstance>();
|
|
33
|
-
const
|
|
34
|
-
const isDefaultTenant = computed(() => userStore.userInfo.tenant_code === DEFAULT_TENANT_CODE);
|
|
31
|
+
const { isDefaultTenant, tenantColumns } = useTenantScope();
|
|
35
32
|
|
|
36
33
|
const columns = computed<ColumnProps[]>(() => [
|
|
37
|
-
{
|
|
34
|
+
...tenantColumns({
|
|
38
35
|
prop: "tenant_code",
|
|
39
36
|
label: t("common.field.tenant"),
|
|
40
37
|
minWidth: 130,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
38
|
+
enum: requestTenantCodeOptions,
|
|
39
|
+
searchEl: "select",
|
|
40
|
+
render: scope => String((scope.row as BaseSession).tenant_code ?? "")
|
|
41
|
+
}),
|
|
45
42
|
{
|
|
46
43
|
prop: "user_name",
|
|
47
44
|
label: t("system.base.online_session.field.user_name"),
|
|
@@ -75,22 +72,6 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
75
72
|
}
|
|
76
73
|
]);
|
|
77
74
|
|
|
78
|
-
/** 将租户名称映射到会话使用的租户编码,供下拉筛选与表格展示复用。 */
|
|
79
|
-
async function requestSessionTenantOptions() {
|
|
80
|
-
if (!isDefaultTenant.value) {
|
|
81
|
-
return { data: [{ value: userStore.userInfo.tenant_code, label: userStore.userInfo.tenant_name }] };
|
|
82
|
-
}
|
|
83
|
-
const options: EnumProps[] = [];
|
|
84
|
-
const pageSize = 100;
|
|
85
|
-
for (let pageNum = 1; ; pageNum++) {
|
|
86
|
-
const response = await defBaseTenantService.PageBaseTenant({ code: "", name: "", page_num: pageNum, page_size: pageSize });
|
|
87
|
-
const tenants = response.base_tenants ?? [];
|
|
88
|
-
options.push(...tenants.map(tenant => ({ value: tenant.code, label: tenant.name })));
|
|
89
|
-
if (options.length >= response.total || tenants.length === 0) break;
|
|
90
|
-
}
|
|
91
|
-
return { data: options };
|
|
92
|
-
}
|
|
93
|
-
|
|
94
75
|
/** 查询在线用户会话列表。 */
|
|
95
76
|
async function requestTable(params: Record<string, unknown>) {
|
|
96
77
|
const response = await defBaseSessionService.PageOnlineBaseSessions(
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
import { computed, ref } from "vue";
|
|
7
7
|
import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
8
8
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
9
|
-
import { formatLogDateTime } from "@liujitcn/kratos-admin-system/components/log";
|
|
9
|
+
import { formatLogDateTime } from "@liujitcn/kratos-admin-system/components/log/log";
|
|
10
10
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
11
|
-
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
|
|
12
|
-
import { logDateSearch, logDetailColumn, logEnumLabel, createLogEnumOptions, requestLogTrace } from "@liujitcn/kratos-admin-system/components/log";
|
|
11
|
+
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/log/LogTable.vue";
|
|
12
|
+
import { logDateSearch, logDetailColumn, logEnumLabel, createLogEnumOptions, requestLogTrace } from "@liujitcn/kratos-admin-system/components/log/log";
|
|
13
13
|
import { defBaseOperationLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_operation_log";
|
|
14
14
|
import { BaseLogResult } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
|
|
15
15
|
import { BaseOperationAction } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_operation_log";
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
import { computed, ref } from "vue";
|
|
7
7
|
import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
8
8
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
9
|
-
import { formatLogDateTime } from "@liujitcn/kratos-admin-system/components/log";
|
|
9
|
+
import { formatLogDateTime } from "@liujitcn/kratos-admin-system/components/log/log";
|
|
10
10
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
11
|
-
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
|
|
12
|
-
import { logDateSearch, logDetailColumn, logEnumLabel, createLogEnumOptions, requestLogTrace } from "@liujitcn/kratos-admin-system/components/log";
|
|
11
|
+
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/log/LogTable.vue";
|
|
12
|
+
import { logDateSearch, logDetailColumn, logEnumLabel, createLogEnumOptions, requestLogTrace } from "@liujitcn/kratos-admin-system/components/log/log";
|
|
13
13
|
import { defBasePermissionLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_permission_log";
|
|
14
14
|
import { BaseLogResult } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_log";
|
|
15
15
|
import { BasePermissionAction, BasePermissionTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_permission_log";
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
import { computed, ref } from "vue";
|
|
7
7
|
import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
8
8
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
9
|
-
import { formatLogDateTime } from "@liujitcn/kratos-admin-system/components/log";
|
|
9
|
+
import { formatLogDateTime } from "@liujitcn/kratos-admin-system/components/log/log";
|
|
10
10
|
import { buildPageRequest } from "@liujitcn/kratos-admin-core/table";
|
|
11
|
-
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/LogTable.vue";
|
|
11
|
+
import LogTable, { type LogTableConfig } from "@liujitcn/kratos-admin-system/components/log/LogTable.vue";
|
|
12
12
|
import {
|
|
13
13
|
createLogEnumOptions,
|
|
14
14
|
formatLogCount,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
logDetailColumn,
|
|
18
18
|
logEnumLabel,
|
|
19
19
|
requestLogTrace
|
|
20
|
-
} from "@liujitcn/kratos-admin-system/components/log";
|
|
20
|
+
} from "@liujitcn/kratos-admin-system/components/log/log";
|
|
21
21
|
import { defBasePolicyEvaluationLogService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_policy_evaluation_log";
|
|
22
22
|
import { BasePolicyDecision, BasePolicyEvaluationType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_policy_evaluation_log";
|
|
23
23
|
import type { BasePolicyEvaluationLog, PageBasePolicyEvaluationLogRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_policy_evaluation_log";
|