@pubinfo-pr/module-crypto 0.187.1 → 0.189.1

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.
@@ -0,0 +1,218 @@
1
+ import { n as getCryptoGetCryptoConfig, r as postCryptoEditCryptoConfig, t as ctx } from "./index.js";
2
+ import { n as useToggle, t as drawerCryptoUrl_default } from "./drawerCryptoUrl-DiezF2QX.js";
3
+ import { PubinfoIcon, useAuth } from "pubinfo-pr";
4
+ import { Button, CheckableTag, Form, FormItem, Space, Switch } from "ant-design-vue/es";
5
+ import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, onMounted, openBlock, reactive, ref, resolveDirective, toDisplayString, unref, withCtx, withDirectives } from "vue";
6
+ import { PlusCircleOutlined, QuestionCircleOutlined } from "@ant-design/icons-vue";
7
+ import { ProTable } from "@pubinfo/pro-components";
8
+ import { Modal, message } from "ant-design-vue";
9
+ import './setting.css';let ACTION = /* @__PURE__ */ function(e) {
10
+ return e.ADD = "新增", e.EDIT = "编辑", e.REMOVE = "删除", e.ENABLE = "启用", e.DISABLE = "停用", e;
11
+ }({});
12
+ var _hoisted_1 = {
13
+ "w-full": "",
14
+ "h-full": "",
15
+ "pt-10px": "",
16
+ "px-10px": "",
17
+ "overflow-auto": ""
18
+ }, _hoisted_2 = {
19
+ "h-full": "",
20
+ "min-w-1130px": ""
21
+ }, _hoisted_3 = { class: "pt-20px pl-20px h-161px flex flex-col bg-[#ffffff] box-border bg-[url('@/assets/images/crypto-setting-bg.png')] bg-cover text-[#4e5969] dark:text-[#C9CDD4]" }, _hoisted_4 = { class: "flex items-center" }, _hoisted_5 = { class: "p-5px bg-[#f2f3f5] rounded-5px flex items-center" }, _hoisted_6 = { class: "flex items-center ml-15px text-[#a3a4a8]" }, _hoisted_7 = { class: "h-[calc(100%-165px)]" }, _hoisted_8 = ["onClick"], _hoisted_9 = { class: "ml-4px" }, _hoisted_10 = ["onClick"], _hoisted_11 = { class: "ml-4px" }, setting_default = /* @__PURE__ */ ((e, E) => {
22
+ let D = e.__vccOpts || e;
23
+ for (let [e, O] of E) D[e] = O;
24
+ return D;
25
+ })(/* @__PURE__ */ defineComponent({
26
+ __name: "setting",
27
+ setup(M) {
28
+ let R = ref(), z = ref(), B = ref(), V = { style: { width: "auto" } }, H = { span: 24 }, { auth: U } = useAuth(), W = reactive({
29
+ isCrypto: !0,
30
+ mode: !0,
31
+ whiteListUrls: []
32
+ }), [G, K] = useToggle(!1);
33
+ onMounted(q);
34
+ async function q() {
35
+ await getCryptoGetCryptoConfig().then((e) => {
36
+ K(!1), e && e.data && e.success && (W.isCrypto = e.data.cryptoEnabled || !1, W.whiteListUrls = e.data.cryptoWhitePath, W.mode = e.data.cryptoMode === void 0 ? !0 : e.data.cryptoMode);
37
+ });
38
+ }
39
+ function J(e, E) {
40
+ E && (W.mode = e, Y());
41
+ }
42
+ async function Y() {
43
+ if (!G.value) {
44
+ K(!0);
45
+ try {
46
+ await z.value?.validate();
47
+ let { isCrypto: e, mode: O, whiteListUrls: k } = W, A = {
48
+ cryptoEnabled: e,
49
+ cryptoMode: O,
50
+ cryptoWhitePath: k
51
+ }, { success: j } = await postCryptoEditCryptoConfig({ json: JSON.stringify(A) });
52
+ j && (message.success("配置更改成功"), ctx.callAsync({
53
+ ...ctx.use(),
54
+ isCrypto: W.isCrypto,
55
+ cryptoMode: W.mode,
56
+ whiteListUrls: W.whiteListUrls
57
+ }, () => {
58
+ q();
59
+ }));
60
+ } catch {
61
+ K(!1);
62
+ }
63
+ }
64
+ }
65
+ let X = [
66
+ {
67
+ minWidth: 60,
68
+ hideInTable: !1,
69
+ title: "url地址",
70
+ dataIndex: "url"
71
+ },
72
+ {
73
+ hideInSearch: !0,
74
+ minWidth: 200,
75
+ title: "描述",
76
+ dataIndex: "description",
77
+ ellipsis: !0
78
+ },
79
+ {
80
+ hideInSearch: !0,
81
+ title: "操作",
82
+ dataIndex: "action",
83
+ width: 200,
84
+ fixed: "right",
85
+ hideInTable() {
86
+ return !U([
87
+ "crypto_url_add",
88
+ "crypto_url_edit",
89
+ "crypto_url_delete"
90
+ ]);
91
+ }
92
+ }
93
+ ];
94
+ function Z(e, E) {
95
+ if (!G.value) switch (e) {
96
+ case ACTION.ADD:
97
+ B.value.open(!1, W.whiteListUrls);
98
+ break;
99
+ case ACTION.EDIT:
100
+ B.value.open(!0, W.whiteListUrls, E);
101
+ break;
102
+ case ACTION.REMOVE:
103
+ Q(W.whiteListUrls || [], E || 0);
104
+ break;
105
+ }
106
+ }
107
+ function Q(e, E) {
108
+ Modal.confirm({
109
+ title: "删除",
110
+ content: "确定要删除该条数据吗?",
111
+ async onOk() {
112
+ e.splice(E, 1), $(e);
113
+ }
114
+ });
115
+ }
116
+ function $(e) {
117
+ W.whiteListUrls = e, Y();
118
+ }
119
+ return (e, E) => {
120
+ let D = Switch, O = FormItem, j = CheckableTag, M = Form, N = PlusCircleOutlined, P = Button, F = PubinfoIcon, I = Space, L = resolveDirective("auth");
121
+ return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [createVNode(M, {
122
+ ref_key: "formRef",
123
+ ref: z,
124
+ model: W,
125
+ "label-col": V,
126
+ "wrapper-col": H,
127
+ class: "safe-rule-form"
128
+ }, {
129
+ default: withCtx(() => [createVNode(O, {
130
+ label: "开启加密",
131
+ name: "isCrypto"
132
+ }, {
133
+ default: withCtx(() => [createVNode(D, {
134
+ checked: W.isCrypto,
135
+ "onUpdate:checked": E[0] ||= (e) => W.isCrypto = e,
136
+ disabled: unref(G),
137
+ onChange: Y
138
+ }, null, 8, ["checked", "disabled"])]),
139
+ _: 1
140
+ }), createVNode(O, {
141
+ label: "模式",
142
+ name: "isCrypto"
143
+ }, {
144
+ default: withCtx(() => [createElementVNode("div", _hoisted_4, [createElementVNode("div", _hoisted_5, [createVNode(j, {
145
+ checked: W.mode,
146
+ disabled: unref(G),
147
+ class: normalizeClass(unref(G) ? "cursor-not-allowed!" : ""),
148
+ onChange: E[1] ||= (e) => !unref(G) && J(!0, e)
149
+ }, {
150
+ default: withCtx(() => E[4] ||= [createTextVNode(" 白名单 ")]),
151
+ _: 1,
152
+ __: [4]
153
+ }, 8, [
154
+ "checked",
155
+ "disabled",
156
+ "class"
157
+ ]), createVNode(j, {
158
+ checked: !W.mode,
159
+ class: normalizeClass(["mr-0px!", unref(G) ? "cursor-not-allowed!" : ""]),
160
+ onChange: E[2] ||= (e) => !unref(G) && J(!1, e)
161
+ }, {
162
+ default: withCtx(() => E[5] ||= [createTextVNode(" 黑名单 ")]),
163
+ _: 1,
164
+ __: [5]
165
+ }, 8, ["checked", "class"])]), createElementVNode("div", _hoisted_6, [createVNode(unref(QuestionCircleOutlined), { class: "mr-5px" }), E[6] ||= createTextVNode("白名单模式下,仅不加密过滤列表中的接口;黑名单模式下,仅加密过滤列表中的接口。 ")])])]),
166
+ _: 1
167
+ })]),
168
+ _: 1
169
+ }, 8, ["model"])]), createElementVNode("div", _hoisted_7, [createVNode(unref(ProTable), {
170
+ ref_key: "tableRef",
171
+ ref: R,
172
+ "row-key": "id",
173
+ "data-source": W.whiteListUrls,
174
+ columns: X,
175
+ "auto-height": "",
176
+ search: !1,
177
+ pagination: !1,
178
+ scroll: { x: 1e3 }
179
+ }, {
180
+ toolbar: withCtx(() => [withDirectives((openBlock(), createBlock(P, {
181
+ type: "primary",
182
+ disabled: unref(G),
183
+ onClick: E[3] ||= (e) => Z(unref(ACTION).ADD)
184
+ }, {
185
+ default: withCtx(() => [createVNode(N), createTextVNode(" " + toDisplayString(unref(ACTION).ADD), 1)]),
186
+ _: 1
187
+ }, 8, ["disabled"])), [[L, "crypto_url_add"]])]),
188
+ bodyCell: withCtx(({ column: e, index: E }) => [e.dataIndex === "action" ? (openBlock(), createBlock(I, { key: 0 }, {
189
+ default: withCtx(() => [withDirectives((openBlock(), createElementBlock("a", {
190
+ class: "flex items-center hover:opacity-80",
191
+ onClick: (e) => Z(unref(ACTION).EDIT, E)
192
+ }, [createVNode(F, {
193
+ name: "edit",
194
+ class: "text-base"
195
+ }), createElementVNode("span", _hoisted_9, toDisplayString(unref(ACTION).EDIT), 1)], 8, _hoisted_8)), [[L, "crypto_url_edit"]]), withDirectives((openBlock(), createElementBlock("span", {
196
+ flex: "",
197
+ "items-center": "",
198
+ "text-red-500": "",
199
+ "hover:cursor-pointer": "",
200
+ "hover:text-red-500": "",
201
+ "hover:opacity-80": "",
202
+ onClick: (e) => Z(unref(ACTION).REMOVE, E)
203
+ }, [createVNode(F, {
204
+ name: "remove",
205
+ class: "text-base"
206
+ }), createElementVNode("span", _hoisted_11, toDisplayString(unref(ACTION).REMOVE), 1)], 8, _hoisted_10)), [[L, "crypto_url_delete"]])]),
207
+ _: 2
208
+ }, 1024)) : createCommentVNode("", !0)]),
209
+ _: 1
210
+ }, 8, ["data-source"])])]), createVNode(drawerCryptoUrl_default, {
211
+ ref_key: "drawerRef",
212
+ ref: B,
213
+ onSubmit: $
214
+ }, null, 512)]);
215
+ };
216
+ }
217
+ }), [["__scopeId", "data-v-89197708"]]);
218
+ export { setting_default as default };
package/dist/setting.css CHANGED
@@ -1 +1 @@
1
- .safe-rule-form .ant-input[data-v-89197708],.safe-rule-form .ant-select[data-v-89197708]{width:90%}.safe-rule-form[data-v-89197708] .ant-tag-checkable-checked{background:#fff;color:#1677ff;font-size:13px}.safe-rule-form[data-v-89197708] .ant-tag-checkable{font-size:13px}
1
+ .safe-rule-form .ant-input[data-v-89197708],.safe-rule-form .ant-select[data-v-89197708]{width:90%}.safe-rule-form[data-v-89197708] .ant-tag-checkable-checked{color:#1677ff;background:#fff;font-size:13px}.safe-rule-form[data-v-89197708] .ant-tag-checkable{font-size:13px}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo-pr/module-crypto",
3
3
  "type": "module",
4
- "version": "0.187.1",
4
+ "version": "0.189.1",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "@ant-design/icons-vue": "^7.0.1",
24
24
  "@pubinfo/pro-components": "^1.8.0",
25
25
  "ant-design-vue": "^4.2.6",
26
- "pubinfo-pr": "0.187.1"
26
+ "pubinfo-pr": "0.189.1"
27
27
  },
28
28
  "dependencies": {
29
29
  "@vueuse/core": "^13.7.0",
@@ -36,7 +36,7 @@
36
36
  "@pubinfo/pro-components": "^1.8.0",
37
37
  "@types/crypto-js": "^4.2.2",
38
38
  "ant-design-vue": "^4.2.6",
39
- "pubinfo-pr": "0.187.1"
39
+ "pubinfo-pr": "0.189.1"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "pubinfo build -w --sourcemap",
package/src/index.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import type { ModuleOptions, RequestMethod } from 'pubinfo-pr';
2
2
  import type { CryptoOptions } from './interface';
3
- import { defineIconModule, defineRouteModule } from 'pubinfo-pr';
4
- import modules from 'virtual:pubinfo-resolver';
5
3
  import { getCryptoGetPublicKeyAndConfig } from './api/modules/crypto';
6
4
  import { apictx } from './apiContext';
7
5
  import { ctx } from './context';
@@ -14,9 +12,6 @@ export function crypto(options: CryptoOptions): ModuleOptions {
14
12
  const { request, cryptoSetting } = options;
15
13
  apictx.set({ request });
16
14
  ctx.set({ isCrypto: false, cryptoMode: false, cryptoSetting: setupAes() });
17
- defineRouteModule('crypto', modules.pages);
18
- defineIconModule('crypto', modules.icons);
19
-
20
15
  return {
21
16
  name: 'pubinfo-pr:crypto',
22
17
  enforce: 'pre',
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./drawerCryptoUrl.vue_vue_type_script_setup_true_lang-CztdWly1.js";
2
- export {
3
- f as default
4
- };
@@ -1,136 +0,0 @@
1
- import { Drawer as L, Form as N, FormItem as O, Input as W, Textarea as $, Space as q, Button as A } from "ant-design-vue/es";
2
- import { isRef as I, shallowRef as j, toValue as h, defineComponent as z, ref as f, createBlock as H, openBlock as J, unref as u, withCtx as l, createVNode as r, createTextVNode as k } from "vue";
3
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
4
- // @__NO_SIDE_EFFECTS__
5
- function U(c = !1, d = {}) {
6
- const {
7
- truthyValue: _ = !0,
8
- falsyValue: v = !1
9
- } = d, g = I(c), o = j(c);
10
- function i(p) {
11
- if (arguments.length)
12
- return o.value = p, o.value;
13
- {
14
- const t = h(_);
15
- return o.value = o.value === t ? h(v) : t, o.value;
16
- }
17
- }
18
- return g ? i : [o, i];
19
- }
20
- const P = /* @__PURE__ */ z({
21
- name: "DrawerCryptoUrl",
22
- __name: "drawerCryptoUrl",
23
- emits: ["submit"],
24
- setup(c, { expose: d, emit: _ }) {
25
- const v = _, g = {
26
- url: [{ required: !0, validator: S, trigger: ["blur", "change"] }]
27
- }, [o, i] = /* @__PURE__ */ U(!1), p = f(), t = f({}), w = f(!1), m = f([]), x = f(0);
28
- function S(a, e, n) {
29
- e ? /^\/(?!.*\*{3})(?:[\w-]+|:\w+|\*{1,2})(?:\/(?:[\w-]+|:\w+|\*{1,2}))*$/.test(e) ? n() : n(new Error("url格式不正确")) : n(new Error("请输入url"));
30
- }
31
- async function T(a, e, n) {
32
- i(!0), m.value = e || [], x.value = n || 0, a ? (w.value = !0, t.value = { ...e?.[n || 0] }) : (w.value = !1, t.value = {});
33
- }
34
- const [V, C] = /* @__PURE__ */ U(!1);
35
- function B() {
36
- p.value?.validate().then(() => {
37
- C(!0);
38
- const a = {
39
- ...t.value
40
- };
41
- w.value ? m.value[x.value] = a : m.value.push(a), C(!1), y(), v("submit", m.value);
42
- });
43
- }
44
- function y() {
45
- i(!1);
46
- }
47
- return d({
48
- open: T
49
- }), (a, e) => {
50
- const n = W, b = O, E = $, D = N, R = A, F = q, G = L;
51
- return J(), H(G, {
52
- open: u(o),
53
- "onUpdate:open": e[3] || (e[3] = (s) => I(o) ? o.value = s : null),
54
- title: "url信息",
55
- placement: "right",
56
- width: 600,
57
- "destroy-on-close": "",
58
- "footer-style": { textAlign: "right" },
59
- onClose: y
60
- }, {
61
- footer: l(() => [
62
- r(F, null, {
63
- default: l(() => [
64
- r(R, { onClick: y }, {
65
- default: l(() => e[4] || (e[4] = [
66
- k(" 取消 ")
67
- ])),
68
- _: 1,
69
- __: [4]
70
- }),
71
- r(R, {
72
- type: "primary",
73
- loading: u(V),
74
- onClick: e[2] || (e[2] = (s) => B())
75
- }, {
76
- default: l(() => e[5] || (e[5] = [
77
- k(" 提交 ")
78
- ])),
79
- _: 1,
80
- __: [5]
81
- }, 8, ["loading"])
82
- ]),
83
- _: 1
84
- })
85
- ]),
86
- default: l(() => [
87
- r(D, {
88
- ref_key: "formRef",
89
- ref: p,
90
- model: u(t),
91
- rules: g,
92
- "label-col": { style: { width: "90px" } }
93
- }, {
94
- default: l(() => [
95
- r(b, {
96
- label: "url地址",
97
- name: "url",
98
- tooltip: "支持url通配符,示例:/api/v1/user/*,/api/login/**"
99
- }, {
100
- default: l(() => [
101
- r(n, {
102
- value: u(t).url,
103
- "onUpdate:value": e[0] || (e[0] = (s) => u(t).url = s),
104
- maxlength: 200
105
- }, null, 8, ["value"])
106
- ]),
107
- _: 1
108
- }),
109
- r(b, {
110
- label: "描述",
111
- name: "description"
112
- }, {
113
- default: l(() => [
114
- r(E, {
115
- value: u(t).description,
116
- "onUpdate:value": e[1] || (e[1] = (s) => u(t).description = s),
117
- rows: 3,
118
- "show-count": "",
119
- maxlength: 200
120
- }, null, 8, ["value"])
121
- ]),
122
- _: 1
123
- })
124
- ]),
125
- _: 1
126
- }, 8, ["model"])
127
- ]),
128
- _: 1
129
- }, 8, ["open"]);
130
- };
131
- }
132
- });
133
- export {
134
- P as _,
135
- U as u
136
- };
@@ -1,267 +0,0 @@
1
- import { Form as G, FormItem as J, Switch as Q, CheckableTag as q, Space as H, Button as K } from "ant-design-vue/es";
2
- import { useAuth as X, PubinfoIcon as Y } from "pubinfo-pr";
3
- import { QuestionCircleOutlined as Z, PlusCircleOutlined as ee } from "@ant-design/icons-vue";
4
- import { defineComponent as te, ref as k, reactive as oe, onMounted as se, resolveDirective as ae, createElementBlock as E, openBlock as u, createElementVNode as d, createVNode as a, withCtx as l, unref as s, normalizeClass as V, createTextVNode as h, createBlock as P, createCommentVNode as re, withDirectives as D, toDisplayString as L } from "vue";
5
- import { ProTable as ne } from "@pubinfo/pro-components";
6
- import { message as ie, Modal as le } from "ant-design-vue";
7
- import { g as ce, p as de, c as B } from "./index.js";
8
- import { u as pe, _ as fe } from "./drawerCryptoUrl.vue_vue_type_script_setup_true_lang-CztdWly1.js";
9
- import './setting.css';var n = /* @__PURE__ */ ((r) => (r.ADD = "新增", r.EDIT = "编辑", r.REMOVE = "删除", r.ENABLE = "启用", r.DISABLE = "停用", r))(n || {});
10
- const ue = {
11
- "w-full": "",
12
- "h-full": "",
13
- "pt-10px": "",
14
- "px-10px": "",
15
- "overflow-auto": ""
16
- }, me = {
17
- "h-full": "",
18
- "min-w-1130px": ""
19
- }, _e = { class: "pt-20px pl-20px h-161px flex flex-col bg-[#ffffff] box-border bg-[url('@/assets/images/crypto-setting-bg.png')] bg-cover text-[#4e5969] dark:text-[#C9CDD4]" }, he = { class: "flex items-center" }, ye = { class: "p-5px bg-[#f2f3f5] rounded-5px flex items-center" }, xe = { class: "flex items-center ml-15px text-[#a3a4a8]" }, be = { class: "h-[calc(100%-165px)]" }, Ce = ["onClick"], ge = { class: "ml-4px" }, ve = ["onClick"], we = { class: "ml-4px" }, ke = /* @__PURE__ */ te({
20
- __name: "setting",
21
- setup(r) {
22
- const y = k(), p = k(), f = k(), x = { style: { width: "auto" } }, O = { span: 24 }, { auth: T } = X(), o = oe({
23
- isCrypto: !0,
24
- mode: !0,
25
- whiteListUrls: []
26
- }), [i, b] = pe(!1);
27
- se(I);
28
- async function I() {
29
- await ce().then((t) => {
30
- b(!1), t && t.data && t.success && (o.isCrypto = t.data.cryptoEnabled || !1, o.whiteListUrls = t.data.cryptoWhitePath, o.mode = t.data.cryptoMode === void 0 ? !0 : t.data.cryptoMode);
31
- });
32
- }
33
- function R(t, e) {
34
- e && (o.mode = t, C());
35
- }
36
- async function C() {
37
- if (!i.value) {
38
- b(!0);
39
- try {
40
- await p.value?.validate();
41
- const {
42
- isCrypto: t,
43
- mode: e,
44
- whiteListUrls: v
45
- } = o, m = {
46
- cryptoEnabled: t,
47
- cryptoMode: e,
48
- cryptoWhitePath: v
49
- }, { success: _ } = await de({ json: JSON.stringify(m) });
50
- _ && (ie.success("配置更改成功"), B.callAsync({ ...B.use(), isCrypto: o.isCrypto, cryptoMode: o.mode, whiteListUrls: o.whiteListUrls }, () => {
51
- I();
52
- }));
53
- } catch {
54
- b(!1);
55
- }
56
- }
57
- }
58
- const A = [
59
- {
60
- minWidth: 60,
61
- hideInTable: !1,
62
- title: "url地址",
63
- dataIndex: "url"
64
- },
65
- {
66
- hideInSearch: !0,
67
- minWidth: 200,
68
- title: "描述",
69
- dataIndex: "description",
70
- ellipsis: !0
71
- },
72
- {
73
- hideInSearch: !0,
74
- title: "操作",
75
- dataIndex: "action",
76
- width: 200,
77
- fixed: "right",
78
- hideInTable() {
79
- return !T([
80
- "crypto_url_add",
81
- "crypto_url_edit",
82
- "crypto_url_delete"
83
- ]);
84
- }
85
- }
86
- ];
87
- function g(t, e) {
88
- if (!i.value)
89
- switch (t) {
90
- case n.ADD:
91
- f.value.open(!1, o.whiteListUrls);
92
- break;
93
- case n.EDIT:
94
- f.value.open(!0, o.whiteListUrls, e);
95
- break;
96
- case n.REMOVE:
97
- W(o.whiteListUrls || [], e || 0);
98
- break;
99
- }
100
- }
101
- function W(t, e) {
102
- le.confirm({
103
- title: "删除",
104
- content: "确定要删除该条数据吗?",
105
- async onOk() {
106
- t.splice(e, 1), U(t);
107
- }
108
- });
109
- }
110
- function U(t) {
111
- o.whiteListUrls = t, C();
112
- }
113
- return (t, e) => {
114
- const v = Q, m = J, _ = q, $ = G, F = ee, N = K, M = Y, j = H, w = ae("auth");
115
- return u(), E("div", ue, [
116
- d("div", me, [
117
- d("div", _e, [
118
- a($, {
119
- ref_key: "formRef",
120
- ref: p,
121
- model: o,
122
- "label-col": x,
123
- "wrapper-col": O,
124
- class: "safe-rule-form"
125
- }, {
126
- default: l(() => [
127
- a(m, {
128
- label: "开启加密",
129
- name: "isCrypto"
130
- }, {
131
- default: l(() => [
132
- a(v, {
133
- checked: o.isCrypto,
134
- "onUpdate:checked": e[0] || (e[0] = (c) => o.isCrypto = c),
135
- disabled: s(i),
136
- onChange: C
137
- }, null, 8, ["checked", "disabled"])
138
- ]),
139
- _: 1
140
- }),
141
- a(m, {
142
- label: "模式",
143
- name: "isCrypto"
144
- }, {
145
- default: l(() => [
146
- d("div", he, [
147
- d("div", ye, [
148
- a(_, {
149
- checked: o.mode,
150
- disabled: s(i),
151
- class: V(s(i) ? "cursor-not-allowed!" : ""),
152
- onChange: e[1] || (e[1] = (c) => !s(i) && R(!0, c))
153
- }, {
154
- default: l(() => e[4] || (e[4] = [
155
- h(" 白名单 ")
156
- ])),
157
- _: 1,
158
- __: [4]
159
- }, 8, ["checked", "disabled", "class"]),
160
- a(_, {
161
- checked: !o.mode,
162
- class: V(["mr-0px!", s(i) ? "cursor-not-allowed!" : ""]),
163
- onChange: e[2] || (e[2] = (c) => !s(i) && R(!1, c))
164
- }, {
165
- default: l(() => e[5] || (e[5] = [
166
- h(" 黑名单 ")
167
- ])),
168
- _: 1,
169
- __: [5]
170
- }, 8, ["checked", "class"])
171
- ]),
172
- d("div", xe, [
173
- a(s(Z), { class: "mr-5px" }),
174
- e[6] || (e[6] = h("白名单模式下,仅不加密过滤列表中的接口;黑名单模式下,仅加密过滤列表中的接口。 "))
175
- ])
176
- ])
177
- ]),
178
- _: 1
179
- })
180
- ]),
181
- _: 1
182
- }, 8, ["model"])
183
- ]),
184
- d("div", be, [
185
- a(s(ne), {
186
- ref_key: "tableRef",
187
- ref: y,
188
- "row-key": "id",
189
- "data-source": o.whiteListUrls,
190
- columns: A,
191
- "auto-height": "",
192
- search: !1,
193
- pagination: !1,
194
- scroll: { x: 1e3 }
195
- }, {
196
- toolbar: l(() => [
197
- D((u(), P(N, {
198
- type: "primary",
199
- disabled: s(i),
200
- onClick: e[3] || (e[3] = (c) => g(s(n).ADD))
201
- }, {
202
- default: l(() => [
203
- a(F),
204
- h(" " + L(s(n).ADD), 1)
205
- ]),
206
- _: 1
207
- }, 8, ["disabled"])), [
208
- [w, "crypto_url_add"]
209
- ])
210
- ]),
211
- bodyCell: l(({ column: c, index: S }) => [
212
- c.dataIndex === "action" ? (u(), P(j, { key: 0 }, {
213
- default: l(() => [
214
- D((u(), E("a", {
215
- class: "flex items-center hover:opacity-80",
216
- onClick: (z) => g(s(n).EDIT, S)
217
- }, [
218
- a(M, {
219
- name: "edit",
220
- class: "text-base"
221
- }),
222
- d("span", ge, L(s(n).EDIT), 1)
223
- ], 8, Ce)), [
224
- [w, "crypto_url_edit"]
225
- ]),
226
- D((u(), E("span", {
227
- flex: "",
228
- "items-center": "",
229
- "text-red-500": "",
230
- "hover:cursor-pointer": "",
231
- "hover:text-red-500": "",
232
- "hover:opacity-80": "",
233
- onClick: (z) => g(s(n).REMOVE, S)
234
- }, [
235
- a(M, {
236
- name: "remove",
237
- class: "text-base"
238
- }),
239
- d("span", we, L(s(n).REMOVE), 1)
240
- ], 8, ve)), [
241
- [w, "crypto_url_delete"]
242
- ])
243
- ]),
244
- _: 2
245
- }, 1024)) : re("", !0)
246
- ]),
247
- _: 1
248
- }, 8, ["data-source"])
249
- ])
250
- ]),
251
- a(fe, {
252
- ref_key: "drawerRef",
253
- ref: f,
254
- onSubmit: U
255
- }, null, 512)
256
- ]);
257
- };
258
- }
259
- }), Ee = (r, y) => {
260
- const p = r.__vccOpts || r;
261
- for (const [f, x] of y)
262
- p[f] = x;
263
- return p;
264
- }, Pe = /* @__PURE__ */ Ee(ke, [["__scopeId", "data-v-89197708"]]);
265
- export {
266
- Pe as default
267
- };