mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-08 10:33:57 +00:00
Compare commits
2012 Commits
v2.23.0
...
pr@dev@per
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e777ea67d | ||
|
|
a290e15b90 | ||
|
|
b47f396cd4 | ||
|
|
085554ef7f | ||
|
|
a62884564c | ||
|
|
a9c0d0677c | ||
|
|
5449d74d53 | ||
|
|
dc401f80b9 | ||
|
|
379cd2386a | ||
|
|
4e7bdb9c69 | ||
|
|
41449fb538 | ||
|
|
a75488217c | ||
|
|
8e32792696 | ||
|
|
b47caf0287 | ||
|
|
715ae856f0 | ||
|
|
19ae27e6c2 | ||
|
|
2132bacff5 | ||
|
|
e57c5a20d0 | ||
|
|
3d35f0aafe | ||
|
|
68ac03db9e | ||
|
|
7b5471a451 | ||
|
|
7f052ac85e | ||
|
|
64e75eb9ff | ||
|
|
8e75e5d5e3 | ||
|
|
1810e6833c | ||
|
|
8c7c012785 | ||
|
|
378d82518a | ||
|
|
728b04c8e3 | ||
|
|
b8611f095a | ||
|
|
f49a1184e2 | ||
|
|
77a4441018 | ||
|
|
18f1f0de79 | ||
|
|
d252c7dd08 | ||
|
|
e5547f8a4c | ||
|
|
63d6578991 | ||
|
|
da00ae84a8 | ||
|
|
74a905ee85 | ||
|
|
a03e985df3 | ||
|
|
2d6005a4e0 | ||
|
|
c4ca28d2d9 | ||
|
|
3934c17f52 | ||
|
|
51717f8583 | ||
|
|
67e99702c1 | ||
|
|
27ce5a3785 | ||
|
|
49122bb213 | ||
|
|
263c4d3f89 | ||
|
|
2ed203dc32 | ||
|
|
742a06ea2d | ||
|
|
1ad4e2c62e | ||
|
|
7e29a3e836 | ||
|
|
3a66e8323c | ||
|
|
4852e3d26a | ||
|
|
80509dc15f | ||
|
|
601bd4740c | ||
|
|
62be5885db | ||
|
|
62e49567cc | ||
|
|
f2eff11d66 | ||
|
|
ae61586f95 | ||
|
|
a08fbc3b77 | ||
|
|
53d130f1cf | ||
|
|
c05992ce50 | ||
|
|
52522b7095 | ||
|
|
af3f6c5900 | ||
|
|
7b15ca4955 | ||
|
|
031016330a | ||
|
|
e274640d2e | ||
|
|
bd3352424c | ||
|
|
f8ec2bce0c | ||
|
|
81f34f0154 | ||
|
|
759e205bfb | ||
|
|
fc5029e88a | ||
|
|
6fa8052878 | ||
|
|
0dc62712d4 | ||
|
|
23b08590cf | ||
|
|
8d8ab483e1 | ||
|
|
fb757686e3 | ||
|
|
6a8161dcaf | ||
|
|
ae2391f07f | ||
|
|
50a9ce35ad | ||
|
|
2d2a4be3a2 | ||
|
|
e055429ff2 | ||
|
|
8727bac560 | ||
|
|
fd018dc5ac | ||
|
|
4c3673aef2 | ||
|
|
4eb61373e0 | ||
|
|
8e8dd38e2e | ||
|
|
f8b7720e2c | ||
|
|
50af6fe017 | ||
|
|
8bc617c4a7 | ||
|
|
f75d69601b | ||
|
|
f54d819ec8 | ||
|
|
c50db4089c | ||
|
|
a6d7cc1215 | ||
|
|
f6a2fcbbea | ||
|
|
071822e665 | ||
|
|
063dc9f8e1 | ||
|
|
66e90f189c | ||
|
|
bdd1a86568 | ||
|
|
01d0c9a0c2 | ||
|
|
d42bd25371 | ||
|
|
2d07b10961 | ||
|
|
77fb9ef528 | ||
|
|
b5950b795b | ||
|
|
097817e02c | ||
|
|
cf7a77ce2e | ||
|
|
e72850bff8 | ||
|
|
4669cbfc83 | ||
|
|
cf8ad2a581 | ||
|
|
b776d0157b | ||
|
|
9aaee957af | ||
|
|
0bc681ea08 | ||
|
|
ea89ce1796 | ||
|
|
e8a37a9c5b | ||
|
|
1350573ee2 | ||
|
|
ba83bb14f3 | ||
|
|
7ae5adf49c | ||
|
|
85a1385b4b | ||
|
|
4da8eb12dc | ||
|
|
bf1be51c39 | ||
|
|
3bbe9eccc1 | ||
|
|
65e84b9b41 | ||
|
|
0619900fd7 | ||
|
|
9ecc759dac | ||
|
|
946787e876 | ||
|
|
54c30fcc0d | ||
|
|
83d730cf0f | ||
|
|
7f7173432d | ||
|
|
c1e5f1c1ce | ||
|
|
ca3a99a5cf | ||
|
|
95831c3ff7 | ||
|
|
b5abf3e6ad | ||
|
|
9e4f519fc5 | ||
|
|
b712ec4183 | ||
|
|
35936ad01e | ||
|
|
de5aed0f58 | ||
|
|
5cb8cec835 | ||
|
|
d66b2a8a87 | ||
|
|
d06637afd4 | ||
|
|
b27d88859f | ||
|
|
61580e096b | ||
|
|
da5d67ccbe | ||
|
|
85a88616b0 | ||
|
|
3d3dfcafd3 | ||
|
|
d51e025f04 | ||
|
|
e78d201bd5 | ||
|
|
e1836eb1c6 | ||
|
|
085447255b | ||
|
|
e3da28221e | ||
|
|
b276bbad34 | ||
|
|
f534b292ce | ||
|
|
a02e5363e0 | ||
|
|
a0dbb3d7b0 | ||
|
|
b6e955f4b7 | ||
|
|
902662681c | ||
|
|
0196d42ffc | ||
|
|
a0a7590769 | ||
|
|
b18c045a1b | ||
|
|
e0411010d1 | ||
|
|
757c48ebc8 | ||
|
|
38ea835df5 | ||
|
|
869b94d365 | ||
|
|
25a8f43345 | ||
|
|
7f2cb97bd7 | ||
|
|
580c005bc6 | ||
|
|
e22d46bb38 | ||
|
|
8d7dd81ebd | ||
|
|
d5aa439fee | ||
|
|
095492e5a3 | ||
|
|
a4e2cadedd | ||
|
|
29b35ff2a9 | ||
|
|
4b137f855e | ||
|
|
d836b46966 | ||
|
|
f9d7d68c77 | ||
|
|
cafc5879a0 | ||
|
|
2ec88c3591 | ||
|
|
c37212a5ce | ||
|
|
f9c334b003 | ||
|
|
d43d4137d7 | ||
|
|
614565ba9c | ||
|
|
575015616f | ||
|
|
26fac22b82 | ||
|
|
40b7c62099 | ||
|
|
017486e961 | ||
|
|
7bb4567345 | ||
|
|
76c78df007 | ||
|
|
ff6ac297b9 | ||
|
|
6b953506e4 | ||
|
|
7ec130f033 | ||
|
|
2f9e00de2e | ||
|
|
e479dbfcb5 | ||
|
|
1e5b6f970d | ||
|
|
e7222fb63c | ||
|
|
f9617a92a8 | ||
|
|
38e1b070cf | ||
|
|
f75d97305f | ||
|
|
7df0cc78b1 | ||
|
|
a8a90930b9 | ||
|
|
69dbf2f5da | ||
|
|
fc8339d659 | ||
|
|
eada8d319d | ||
|
|
11940428a0 | ||
|
|
af2544e24b | ||
|
|
4546952388 | ||
|
|
a0c849f29d | ||
|
|
fb9cd1614a | ||
|
|
c1543183a2 | ||
|
|
03dc3e993c | ||
|
|
8719ffee8e | ||
|
|
cc60f2c1f5 | ||
|
|
f042692dbf | ||
|
|
3d8dc619ad | ||
|
|
b223c73a47 | ||
|
|
53e313517d | ||
|
|
56bea8eaf4 | ||
|
|
992025e618 | ||
|
|
205d301578 | ||
|
|
4daccc9df3 | ||
|
|
ac802fff59 | ||
|
|
a6b0da60a3 | ||
|
|
45c860797a | ||
|
|
e636aa24c8 | ||
|
|
86b37eeeba | ||
|
|
61cf9e7f14 | ||
|
|
344e49e7ec | ||
|
|
3ebdacafd0 | ||
|
|
e1ae467823 | ||
|
|
65c1ab450b | ||
|
|
cbe3efdb18 | ||
|
|
e5eaa5bcfa | ||
|
|
df687c0c06 | ||
|
|
1cc00517f5 | ||
|
|
f3a6d6c02b | ||
|
|
7bf33a9011 | ||
|
|
7948a59b80 | ||
|
|
af9f715357 | ||
|
|
202f8a357c | ||
|
|
3e75c781b3 | ||
|
|
3c3ed27eb2 | ||
|
|
fd0e23e35f | ||
|
|
c09a2df142 | ||
|
|
36737a6f25 | ||
|
|
e4af9ccc1e | ||
|
|
3c256c6fdc | ||
|
|
1e36f59b23 | ||
|
|
aec6ee8376 | ||
|
|
526b049495 | ||
|
|
5bef5a59a9 | ||
|
|
1e371a4e32 | ||
|
|
0f6fd0ed70 | ||
|
|
fc1aefbb54 | ||
|
|
7561f1224d | ||
|
|
0932132add | ||
|
|
8492882633 | ||
|
|
11698255f6 | ||
|
|
53eee6c857 | ||
|
|
f2bc4d6f22 | ||
|
|
e50b16b13b | ||
|
|
232c30cadb | ||
|
|
3142da16ae | ||
|
|
741f8b847e | ||
|
|
b6d00a1784 | ||
|
|
2f122f7fbe | ||
|
|
c3c46b759e | ||
|
|
a1c4013a69 | ||
|
|
8aa9690a61 | ||
|
|
30c0100a0b | ||
|
|
134dd17f3f | ||
|
|
505642baec | ||
|
|
c08964ee34 | ||
|
|
9df443667c | ||
|
|
8fd8e9c1d4 | ||
|
|
aa3ab5e138 | ||
|
|
a7df8706e5 | ||
|
|
c200781322 | ||
|
|
75c7778a10 | ||
|
|
c30e919573 | ||
|
|
ffff648e6d | ||
|
|
981e676fa2 | ||
|
|
664855d4b0 | ||
|
|
c79637095a | ||
|
|
2a96abdd4a | ||
|
|
9541b97b23 | ||
|
|
52518a9ff3 | ||
|
|
24a1c11288 | ||
|
|
313aebaf50 | ||
|
|
5c6373e689 | ||
|
|
09fe3ea107 | ||
|
|
ccf081b608 | ||
|
|
80ce3293a1 | ||
|
|
4ed282ff2b | ||
|
|
dd8957cb69 | ||
|
|
36c687b854 | ||
|
|
e22ecb6fe8 | ||
|
|
b77440284f | ||
|
|
93d866328c | ||
|
|
42c7b278c5 | ||
|
|
14ba501f2b | ||
|
|
f072546083 | ||
|
|
8f9ebcdfa9 | ||
|
|
7b76917768 | ||
|
|
e4d4bc84b6 | ||
|
|
62cf19e70e | ||
|
|
2cb36f89f0 | ||
|
|
9946ad75ad | ||
|
|
abd8919225 | ||
|
|
6e5e760689 | ||
|
|
1235895973 | ||
|
|
59f9025e42 | ||
|
|
d06bda6d40 | ||
|
|
a8099089b2 | ||
|
|
fd0c14e1c0 | ||
|
|
9a04c81238 | ||
|
|
f1b3e5038f | ||
|
|
f6fe08607b | ||
|
|
6f2ca3e26a | ||
|
|
3ed9ac0d9b | ||
|
|
821ed14f40 | ||
|
|
6f0ee734e5 | ||
|
|
9a5b174eb1 | ||
|
|
c27e1c97f2 | ||
|
|
1b4e01d19e | ||
|
|
28c836b1f6 | ||
|
|
fc85eaf6b9 | ||
|
|
678d17a4e7 | ||
|
|
ddf9780f9c | ||
|
|
d47bd4acad | ||
|
|
09dabb5d3f | ||
|
|
9eea051884 | ||
|
|
f6a3eb1349 | ||
|
|
433f3a34cb | ||
|
|
aa790944f6 | ||
|
|
57167fc821 | ||
|
|
fb70719cba | ||
|
|
5988892840 | ||
|
|
af11e1bf0c | ||
|
|
09416b13d3 | ||
|
|
478745f534 | ||
|
|
3de2bf73ea | ||
|
|
3b877739a3 | ||
|
|
06899d6932 | ||
|
|
6f3d21bb77 | ||
|
|
b7da517ad7 | ||
|
|
598b6b12e8 | ||
|
|
400ceac737 | ||
|
|
34de6d8775 | ||
|
|
080542633a | ||
|
|
653f26137b | ||
|
|
c86f0cc08d | ||
|
|
541c6c5fe5 | ||
|
|
c36a210cd4 | ||
|
|
b9f26df5e6 | ||
|
|
dd0baa7b00 | ||
|
|
524105278b | ||
|
|
2656546e3b | ||
|
|
ecaf1ceace | ||
|
|
cf515a18de | ||
|
|
a0ab7d3f32 | ||
|
|
467c3f7288 | ||
|
|
f68eaee8c8 | ||
|
|
163f661386 | ||
|
|
e54bc076d6 | ||
|
|
1fbf04ae51 | ||
|
|
f002c4aa3d | ||
|
|
f67bd39067 | ||
|
|
5c60624b2d | ||
|
|
488684f293 | ||
|
|
5c511345bf | ||
|
|
be85a91ccd | ||
|
|
94a02a2e7e | ||
|
|
e60a33a2b1 | ||
|
|
8449dafd55 | ||
|
|
a787737290 | ||
|
|
fa517c8325 | ||
|
|
0748b6ce0c | ||
|
|
59ee3eff17 | ||
|
|
5cc17de1e0 | ||
|
|
42aacd9df5 | ||
|
|
bb27171b09 | ||
|
|
ccc163ef07 | ||
|
|
e63630fce7 | ||
|
|
17748c56c9 | ||
|
|
d880e5cb8c | ||
|
|
310fe8068a | ||
|
|
8670c3988d | ||
|
|
b5144625ee | ||
|
|
58b6d75ccf | ||
|
|
c9ec67cc50 | ||
|
|
e4d1533091 | ||
|
|
97440860d9 | ||
|
|
3dd31dc76e | ||
|
|
1822d72a9b | ||
|
|
3267839327 | ||
|
|
17d73f2b3c | ||
|
|
ec49241272 | ||
|
|
c2e10b8a34 | ||
|
|
29813e7ce1 | ||
|
|
919d95b56b | ||
|
|
5f95fc0422 | ||
|
|
49a4000086 | ||
|
|
9c7818313e | ||
|
|
705e236279 | ||
|
|
d4ecb33c78 | ||
|
|
67e45ad284 | ||
|
|
8cb72c3d82 | ||
|
|
b65a007d37 | ||
|
|
e487ee24af | ||
|
|
bfbc78e342 | ||
|
|
54879a8174 | ||
|
|
36634a2ce5 | ||
|
|
07920a4917 | ||
|
|
25932587a5 | ||
|
|
d98534d039 | ||
|
|
6cb5d6ac46 | ||
|
|
fab461c10d | ||
|
|
644980bc40 | ||
|
|
a56e3843bf | ||
|
|
5ca188c014 | ||
|
|
510cf48def | ||
|
|
e64fdab7fc | ||
|
|
aaec496642 | ||
|
|
80c05c9b65 | ||
|
|
c9159838f5 | ||
|
|
b8e005f4b1 | ||
|
|
6e73ded101 | ||
|
|
6926556fa3 | ||
|
|
24971c1112 | ||
|
|
763792f42e | ||
|
|
0ff28d2626 | ||
|
|
f607eeda42 | ||
|
|
c0145f4ec4 | ||
|
|
7c995c005b | ||
|
|
21f4f003bb | ||
|
|
fbbac6cea5 | ||
|
|
302400e350 | ||
|
|
b2120678dd | ||
|
|
03c7755703 | ||
|
|
21373574de | ||
|
|
342ee31c72 | ||
|
|
7aa8afec44 | ||
|
|
d6b54c9879 | ||
|
|
b1952a180f | ||
|
|
d3a7fb63b9 | ||
|
|
53cfdbd3a1 | ||
|
|
41cd77d75e | ||
|
|
15ac510c6f | ||
|
|
31e005eca7 | ||
|
|
842ea3cbf3 | ||
|
|
9f893af74b | ||
|
|
5274dc4e6b | ||
|
|
64441e4836 | ||
|
|
43997eeac1 | ||
|
|
1b95af54c1 | ||
|
|
e79f95a822 | ||
|
|
fb85e168e7 | ||
|
|
521cafa2af | ||
|
|
bb9f905dd4 | ||
|
|
3eda4381bb | ||
|
|
080acf57f7 | ||
|
|
9c137e6763 | ||
|
|
75f5363602 | ||
|
|
32f6d5dc4a | ||
|
|
21265aa983 | ||
|
|
e11441e5a7 | ||
|
|
e7624f47bf | ||
|
|
7276b19a92 | ||
|
|
32fa172197 | ||
|
|
aa80a07bfc | ||
|
|
fd97a6c4a2 | ||
|
|
9b355a2942 | ||
|
|
0431f7108a | ||
|
|
3500ab89f5 | ||
|
|
fcdcf29efa | ||
|
|
49d74271c8 | ||
|
|
9a7eca3cf8 | ||
|
|
dc686f2af7 | ||
|
|
172c6d69a1 | ||
|
|
3f2a846184 | ||
|
|
48ac797b59 | ||
|
|
92962bdc5a | ||
|
|
ca4889a19a | ||
|
|
e4631a5309 | ||
|
|
62eced61d2 | ||
|
|
7a8df3fb7b | ||
|
|
91ef3cfaab | ||
|
|
c92843e973 | ||
|
|
47372df4d2 | ||
|
|
143e913554 | ||
|
|
61b2b0fb23 | ||
|
|
54ac31920c | ||
|
|
4eaeff0a18 | ||
|
|
08c16aae72 | ||
|
|
bf5e218edc | ||
|
|
e8dbd99f74 | ||
|
|
9ab2acfa5b | ||
|
|
d3cbb48e05 | ||
|
|
170dde2ba5 | ||
|
|
021eb1fd5b | ||
|
|
1b2c85d86d | ||
|
|
2434e434b7 | ||
|
|
3a5aa7bf90 | ||
|
|
dbe4c232c1 | ||
|
|
3294495577 | ||
|
|
05e7e6dd06 | ||
|
|
936de3c9fb | ||
|
|
51dac8ca30 | ||
|
|
89b3ea51f5 | ||
|
|
bdfc608534 | ||
|
|
667514e90b | ||
|
|
83a116c094 | ||
|
|
211933349e | ||
|
|
ec51b243b1 | ||
|
|
80eb072c1b | ||
|
|
ce08fd57c6 | ||
|
|
40ccab1a19 | ||
|
|
8489d94643 | ||
|
|
72693af5fd | ||
|
|
1fdcf9ff75 | ||
|
|
c4ad25bfe3 | ||
|
|
d6a7d93398 | ||
|
|
43b2ad3104 | ||
|
|
2209eea890 | ||
|
|
1a56546d2e | ||
|
|
fa52226958 | ||
|
|
42ee6c0848 | ||
|
|
49f63d638c | ||
|
|
7e6d78d223 | ||
|
|
a99a5a6312 | ||
|
|
e80b162eca | ||
|
|
fabf60ac47 | ||
|
|
14b5eb5239 | ||
|
|
e365eaef8a | ||
|
|
d14cbce2d6 | ||
|
|
f29f88b78b | ||
|
|
40ccff9685 | ||
|
|
b85de1de33 | ||
|
|
640e758016 | ||
|
|
09bd49941f | ||
|
|
edc74c8dfb | ||
|
|
fcd7d17ef1 | ||
|
|
574b7b54c5 | ||
|
|
f486da0018 | ||
|
|
1598b4e4ad | ||
|
|
4556d3f4fe | ||
|
|
e521868cd2 | ||
|
|
d3d6a0e890 | ||
|
|
fd4223e107 | ||
|
|
152301b0f3 | ||
|
|
cb7a492b74 | ||
|
|
80dd8a23ec | ||
|
|
41729ebe53 | ||
|
|
da3e6aff76 | ||
|
|
7ff8114850 | ||
|
|
43eaaf3eba | ||
|
|
26d8154db8 | ||
|
|
673198af07 | ||
|
|
b14630c33a | ||
|
|
187a0824fc | ||
|
|
e180fbd2a5 | ||
|
|
90ebb0ff0b | ||
|
|
c922fa99fd | ||
|
|
5e3917d61c | ||
|
|
57702bcef3 | ||
|
|
a055b4fe45 | ||
|
|
7305bf772c | ||
|
|
3a4c579c6c | ||
|
|
4ce651e319 | ||
|
|
c3adfe7031 | ||
|
|
b7868e804d | ||
|
|
3ea8239c77 | ||
|
|
ddb7369994 | ||
|
|
97b0260921 | ||
|
|
213f896ab8 | ||
|
|
9ef79e677c | ||
|
|
8e03194a65 | ||
|
|
4c6f9d6490 | ||
|
|
95e14227f0 | ||
|
|
1bf5e9c3bc | ||
|
|
0b52dfd852 | ||
|
|
7cc3a7f9a1 | ||
|
|
74df2dc164 | ||
|
|
b40e6bb412 | ||
|
|
10c9a54896 | ||
|
|
1f4d211c32 | ||
|
|
b736a3aeb8 | ||
|
|
b3050e62b3 | ||
|
|
675fd1ba9f | ||
|
|
b1579b1fbd | ||
|
|
84d4aebdeb | ||
|
|
6b1c0590ce | ||
|
|
b7fd52fa6e | ||
|
|
904dbd6d5e | ||
|
|
c6c693d112 | ||
|
|
3f946f9ada | ||
|
|
35482abf7a | ||
|
|
8b77b3a6df | ||
|
|
8240f56ecd | ||
|
|
77dd600393 | ||
|
|
1149195a23 | ||
|
|
800162ce27 | ||
|
|
9b473a8729 | ||
|
|
c553a09cb4 | ||
|
|
2702257d71 | ||
|
|
d41162a89b | ||
|
|
60999a7533 | ||
|
|
09f20e8149 | ||
|
|
bb631556ba | ||
|
|
32f708a014 | ||
|
|
249cc67140 | ||
|
|
301d3a79b7 | ||
|
|
d5d86afed7 | ||
|
|
6e4ea15d82 | ||
|
|
79aa64c999 | ||
|
|
fa405f4cce | ||
|
|
3fa2cfd860 | ||
|
|
6dad655704 | ||
|
|
2a6406a8fb | ||
|
|
eca3685899 | ||
|
|
afc4bea076 | ||
|
|
ace2568028 | ||
|
|
0382bab537 | ||
|
|
5f535d8bae | ||
|
|
48fe080009 | ||
|
|
e4cab9c2a4 | ||
|
|
61a6b45051 | ||
|
|
03cda9a47a | ||
|
|
f00f679bd2 | ||
|
|
2340efedf5 | ||
|
|
3d0b722409 | ||
|
|
777d31e562 | ||
|
|
47d602302f | ||
|
|
87002430f4 | ||
|
|
1bb0bce869 | ||
|
|
9e74a49644 | ||
|
|
29d40f4d54 | ||
|
|
dd0314d235 | ||
|
|
fd3260faff | ||
|
|
c05f0275de | ||
|
|
ed13ab3fdd | ||
|
|
5938ddbb35 | ||
|
|
99672fc645 | ||
|
|
3a73cb900d | ||
|
|
87196e0cd1 | ||
|
|
7c171b3a76 | ||
|
|
3694a27752 | ||
|
|
b5b6b5227d | ||
|
|
5ac365a990 | ||
|
|
2361b16c30 | ||
|
|
023fb03490 | ||
|
|
4a0d104a96 | ||
|
|
f85351b163 | ||
|
|
140ad7cac4 | ||
|
|
d0b4b488b1 | ||
|
|
da69186239 | ||
|
|
2ea6058113 | ||
|
|
8913a5ea87 | ||
|
|
de5ff58d18 | ||
|
|
b658e37fcb | ||
|
|
99efbd153f | ||
|
|
09a0630c6b | ||
|
|
cc7dd80a8a | ||
|
|
a1906fd925 | ||
|
|
f48632d7f7 | ||
|
|
f3d31a3f0f | ||
|
|
7aaec2ea43 | ||
|
|
40b7dbc211 | ||
|
|
1cec999bfd | ||
|
|
b33f598742 | ||
|
|
19b2b55051 | ||
|
|
b6235ec7dd | ||
|
|
108a39472a | ||
|
|
63c97e18ad | ||
|
|
19f46b098a | ||
|
|
03ad5239e9 | ||
|
|
720a076648 | ||
|
|
80eef76604 | ||
|
|
feb9c65733 | ||
|
|
7597112520 | ||
|
|
d54044760d | ||
|
|
b369d2d22a | ||
|
|
2e3db496c0 | ||
|
|
97e2f23093 | ||
|
|
42b79c3e30 | ||
|
|
d2fe84a81e | ||
|
|
c3bb902e67 | ||
|
|
dde98e470b | ||
|
|
822fa9714c | ||
|
|
90659afc36 | ||
|
|
7310cbe636 | ||
|
|
0857007e15 | ||
|
|
41b00cb293 | ||
|
|
89466a0995 | ||
|
|
800315fb7c | ||
|
|
8b037e8bac | ||
|
|
085f7e68ef | ||
|
|
5c075a5a7d | ||
|
|
01bc2b838a | ||
|
|
0d495e979d | ||
|
|
6d66419fa6 | ||
|
|
96f629a1b7 | ||
|
|
35df28ea90 | ||
|
|
ca98a8ee2e | ||
|
|
dc09364348 | ||
|
|
423601d840 | ||
|
|
09ee34f0d3 | ||
|
|
98fef43ece | ||
|
|
41bb35f7c6 | ||
|
|
827339ad0e | ||
|
|
9dbdc559cd | ||
|
|
bce328a440 | ||
|
|
84e9cf1ac3 | ||
|
|
5fd5834c8d | ||
|
|
73a783bb97 | ||
|
|
1a5dd023e8 | ||
|
|
e4e011e183 | ||
|
|
4b594290e9 | ||
|
|
c71a0f2a75 | ||
|
|
fd6ab841bf | ||
|
|
2cf27f08b9 | ||
|
|
97f531bbec | ||
|
|
ac7d5e216e | ||
|
|
ee8b373e77 | ||
|
|
ecd1da5fc4 | ||
|
|
cdcf340a75 | ||
|
|
d8941c14b8 | ||
|
|
bb3ca059b0 | ||
|
|
d994a01a10 | ||
|
|
bb432dff18 | ||
|
|
9ce7311f6d | ||
|
|
a468e04bad | ||
|
|
a5dcc8be52 | ||
|
|
f905ed0065 | ||
|
|
0f80375242 | ||
|
|
ed8c9df4c3 | ||
|
|
7bc9f2f75b | ||
|
|
b0c635463a | ||
|
|
5ccf713ef3 | ||
|
|
16e92e925c | ||
|
|
a2ec7d3ccd | ||
|
|
ae3e072275 | ||
|
|
9e195dd1d9 | ||
|
|
8432299660 | ||
|
|
b9f41570bf | ||
|
|
5ead251ea7 | ||
|
|
fc10a77372 | ||
|
|
41ef8c6e97 | ||
|
|
ef0658de24 | ||
|
|
fedb068221 | ||
|
|
5a66c39313 | ||
|
|
ce6ca288b7 | ||
|
|
65541a7001 | ||
|
|
24a5c6be43 | ||
|
|
020c7ec9fa | ||
|
|
f12707d958 | ||
|
|
82c2e20fce | ||
|
|
11f0ee12cf | ||
|
|
ca64c0b219 | ||
|
|
e34c6fc843 | ||
|
|
51e139712d | ||
|
|
9daf001312 | ||
|
|
27353ee0c2 | ||
|
|
b6643d89c0 | ||
|
|
9503586b8a | ||
|
|
317735c69a | ||
|
|
5c26000f90 | ||
|
|
139a47b858 | ||
|
|
2f2e05101b | ||
|
|
36f7d9711d | ||
|
|
4e89c8d53f | ||
|
|
5902475778 | ||
|
|
abdba774cc | ||
|
|
c1d10322cb | ||
|
|
90fdf4982e | ||
|
|
f5e5d431c7 | ||
|
|
9d9fb51a7d | ||
|
|
997b5d8d19 | ||
|
|
ea19dd8e0a | ||
|
|
983663a3fa | ||
|
|
3809519331 | ||
|
|
fe7d20778d | ||
|
|
f6bf8b3193 | ||
|
|
5d5ee3cdaa | ||
|
|
ed4da2ab50 | ||
|
|
9c8ed912bb | ||
|
|
c58551adea | ||
|
|
f44618d915 | ||
|
|
aeb26c748a | ||
|
|
c75f0b1312 | ||
|
|
6138fe2e35 | ||
|
|
8d3f99392f | ||
|
|
2fd4792ed4 | ||
|
|
757a822e34 | ||
|
|
03ffe4a911 | ||
|
|
3b83ecd85d | ||
|
|
80145dc114 | ||
|
|
5612f432a5 | ||
|
|
023fd55a70 | ||
|
|
897f3881b2 | ||
|
|
730aa548d4 | ||
|
|
f1a3d775cc | ||
|
|
71d79ec6ef | ||
|
|
4118a21d1d | ||
|
|
be87eec4e5 | ||
|
|
230433de05 | ||
|
|
e3fdf1cc41 | ||
|
|
f1f4ba5dfa | ||
|
|
d9d5de5102 | ||
|
|
7bf74d8727 | ||
|
|
937bdcf5c7 | ||
|
|
0a86240f90 | ||
|
|
ea3c28791d | ||
|
|
1ff829182b | ||
|
|
23fea1bf99 | ||
|
|
496605c539 | ||
|
|
051784e52b | ||
|
|
dcd6fa977d | ||
|
|
411987fb69 | ||
|
|
ac88b70b1c | ||
|
|
36e053068e | ||
|
|
7944c4a414 | ||
|
|
325c2b45e4 | ||
|
|
477fd5164e | ||
|
|
acfdb04b09 | ||
|
|
50073f0512 | ||
|
|
6ab61215b5 | ||
|
|
b5d4bfd488 | ||
|
|
24297dbead | ||
|
|
ad0c17610e | ||
|
|
a54f6f3a89 | ||
|
|
3212260d8e | ||
|
|
8ec7cd3c3c | ||
|
|
32c09c896c | ||
|
|
71c1d77498 | ||
|
|
06fc05e6b3 | ||
|
|
6b491ef696 | ||
|
|
5e23ae7926 | ||
|
|
f62c6b980e | ||
|
|
d930e09065 | ||
|
|
10a6dae2cf | ||
|
|
c099a16a49 | ||
|
|
198e6a11d2 | ||
|
|
8c66e20961 | ||
|
|
0393128be5 | ||
|
|
69ff6be5f4 | ||
|
|
8685362344 | ||
|
|
7ea68e9a09 | ||
|
|
ebede00841 | ||
|
|
73ce298d6a | ||
|
|
69cd561dc0 | ||
|
|
7af1a55e2a | ||
|
|
c1272d9a9f | ||
|
|
f3e28f7cd4 | ||
|
|
412a7ceba1 | ||
|
|
73bf34c422 | ||
|
|
3d2b139214 | ||
|
|
658f0ff587 | ||
|
|
621893fdcc | ||
|
|
a6e94b4173 | ||
|
|
f9098c3203 | ||
|
|
b1c0218ad9 | ||
|
|
4058843b1a | ||
|
|
7deaf27526 | ||
|
|
fceb5904fe | ||
|
|
fa86225ae3 | ||
|
|
7fe43ca0ff | ||
|
|
6511aca103 | ||
|
|
833d530c2f | ||
|
|
3acd8d179e | ||
|
|
828bb76057 | ||
|
|
d4ab4e3c7b | ||
|
|
0346630f02 | ||
|
|
d74e70893e | ||
|
|
55c6202c5e | ||
|
|
63cb48ed23 | ||
|
|
c2d552362a | ||
|
|
364c8998fa | ||
|
|
8cb4f9ccda | ||
|
|
b46021db49 | ||
|
|
7552fd7637 | ||
|
|
6eaa21bf66 | ||
|
|
a0658d93d8 | ||
|
|
8d87c89da2 | ||
|
|
6621da8639 | ||
|
|
6e8c93657e | ||
|
|
0b5d7c8ca1 | ||
|
|
71c86a637c | ||
|
|
4dc1102629 | ||
|
|
7fdd463201 | ||
|
|
f3616f06e8 | ||
|
|
c1f0fbbfd9 | ||
|
|
3597c52af8 | ||
|
|
38eb45cc81 | ||
|
|
94b23241eb | ||
|
|
a851ccdfe7 | ||
|
|
4b7b3b3507 | ||
|
|
70a45bdb03 | ||
|
|
7644313bbf | ||
|
|
e067419e00 | ||
|
|
cadf057518 | ||
|
|
4d534dabba | ||
|
|
e60e95c899 | ||
|
|
413e8dcf7f | ||
|
|
a0b6e9c00c | ||
|
|
25e649b4d8 | ||
|
|
1146d9763a | ||
|
|
afa8cbac88 | ||
|
|
2f97fbe65e | ||
|
|
002efbc506 | ||
|
|
f67aa65fa2 | ||
|
|
983cd266f5 | ||
|
|
0fcd2c990b | ||
|
|
0bb8bb9c01 | ||
|
|
c8eead9f82 | ||
|
|
29012dd05f | ||
|
|
73dd61762f | ||
|
|
0fedd033d3 | ||
|
|
fc6ce53b8a | ||
|
|
02a735c53a | ||
|
|
d6208eabd3 | ||
|
|
08faad0f41 | ||
|
|
a7ac4120f9 | ||
|
|
16236dda09 | ||
|
|
0746879dd5 | ||
|
|
dabd26b604 | ||
|
|
d6f0bcdb16 | ||
|
|
e560455ef8 | ||
|
|
fe5111a105 | ||
|
|
9924e5a0d9 | ||
|
|
3131bfa683 | ||
|
|
5841095e08 | ||
|
|
8c64b81a12 | ||
|
|
846c040cd6 | ||
|
|
d316d1bf1f | ||
|
|
d0cd7915b7 | ||
|
|
4cac6970f6 | ||
|
|
f1f9a02816 | ||
|
|
34ad979dd0 | ||
|
|
5e1971bfb8 | ||
|
|
a085b9b10a | ||
|
|
7c81c913cb | ||
|
|
a65436c16b | ||
|
|
40216397a6 | ||
|
|
7608b23131 | ||
|
|
940ff7acfa | ||
|
|
b2fa253fb4 | ||
|
|
1f5670bc39 | ||
|
|
f6125f0e75 | ||
|
|
0929d38d3e | ||
|
|
11cba07198 | ||
|
|
8a36398cb7 | ||
|
|
703f33629a | ||
|
|
c716b20887 | ||
|
|
41b333212d | ||
|
|
932cd5fb36 | ||
|
|
a3b62efa1c | ||
|
|
282e7cce8c | ||
|
|
59fa67a999 | ||
|
|
c297c15139 | ||
|
|
c5434df5e4 | ||
|
|
5e8197cd88 | ||
|
|
651cb6c806 | ||
|
|
1ea005efaf | ||
|
|
adbaefece9 | ||
|
|
1e1533a0c9 | ||
|
|
93431df62b | ||
|
|
76fcef69a4 | ||
|
|
c05437f58c | ||
|
|
90ac325cbb | ||
|
|
26508ae87b | ||
|
|
385764c3be | ||
|
|
fea6155306 | ||
|
|
174e7cb0e3 | ||
|
|
413feb6372 | ||
|
|
494bb8ddcc | ||
|
|
71e73e9302 | ||
|
|
7a5bd01ed5 | ||
|
|
b6d9a20d8f | ||
|
|
7d53d444bd | ||
|
|
a8a726216e | ||
|
|
b6258dd32c | ||
|
|
5a0d0f98d3 | ||
|
|
b2cf5c3442 | ||
|
|
47fe93cd19 | ||
|
|
f8b9b9e664 | ||
|
|
2045351ebd | ||
|
|
265870eff7 | ||
|
|
63e51e0e45 | ||
|
|
858333bc57 | ||
|
|
965c6d4c92 | ||
|
|
e82d444cf3 | ||
|
|
d144cd6809 | ||
|
|
49abdf52c2 | ||
|
|
e5c9e339e9 | ||
|
|
d4debd20c4 | ||
|
|
ddd607e1ca | ||
|
|
4755bbd549 | ||
|
|
5566435964 | ||
|
|
6e29d1a1a7 | ||
|
|
4f7f8e8315 | ||
|
|
9b79f46920 | ||
|
|
722dd4ad66 | ||
|
|
c8f038aad8 | ||
|
|
59336c3418 | ||
|
|
5d028394d1 | ||
|
|
19212545c1 | ||
|
|
199d4abeb7 | ||
|
|
cdd8bd0477 | ||
|
|
3b87a0f0f7 | ||
|
|
2ffbad8593 | ||
|
|
d42caccff8 | ||
|
|
8f4f34dc9f | ||
|
|
c2dfb09ec8 | ||
|
|
89f524b186 | ||
|
|
db6d36390e | ||
|
|
2695aeb5a9 | ||
|
|
c385fd2f15 | ||
|
|
3d7ca884da | ||
|
|
c4b3f3a58a | ||
|
|
2e92cc02ea | ||
|
|
0a230dcea1 | ||
|
|
5bc0de8cff | ||
|
|
f647472325 | ||
|
|
24682d70ce | ||
|
|
91b1ae1766 | ||
|
|
7671c7ec72 | ||
|
|
4847564447 | ||
|
|
ac462e3a8e | ||
|
|
8469df52e2 | ||
|
|
9650c32faf | ||
|
|
129d8badd0 | ||
|
|
02b5df25f0 | ||
|
|
00fb4ffc85 | ||
|
|
44ca4e7620 | ||
|
|
39d213d149 | ||
|
|
bea73cd9c8 | ||
|
|
8fe24a56ef | ||
|
|
723088b122 | ||
|
|
db7d64b9a1 | ||
|
|
45cfece1c0 | ||
|
|
9b5e964c68 | ||
|
|
1b0c89a704 | ||
|
|
2b78e0bae5 | ||
|
|
c661177de8 | ||
|
|
02bf964622 | ||
|
|
86baf16f2d | ||
|
|
548ce2f981 | ||
|
|
f473d47028 | ||
|
|
6e76bcb0f4 | ||
|
|
51101eba54 | ||
|
|
3dd4ccba17 | ||
|
|
c3be0b01ca | ||
|
|
bf9a2179ae | ||
|
|
5e0cfdbfcd | ||
|
|
bfe9747658 | ||
|
|
39ef4b08f8 | ||
|
|
f039d13bd2 | ||
|
|
1f95761d38 | ||
|
|
c3e865b407 | ||
|
|
d4fe97860a | ||
|
|
041801a319 | ||
|
|
1e474b25f3 | ||
|
|
222e230cc2 | ||
|
|
53f48e7483 | ||
|
|
4470dc96b7 | ||
|
|
e998f92045 | ||
|
|
62b88c2a0b | ||
|
|
f865af018f | ||
|
|
84c5a9a019 | ||
|
|
43fae83603 | ||
|
|
065d6f7ba8 | ||
|
|
2e6bb9ab66 | ||
|
|
d2226c0b00 | ||
|
|
b84bcfcfaa | ||
|
|
c1ff1575a4 | ||
|
|
a716cb1357 | ||
|
|
a02697d3aa | ||
|
|
a50b658f28 | ||
|
|
179f74dbd0 | ||
|
|
35f1f1f92c | ||
|
|
f81128227c | ||
|
|
0a7caf71c7 | ||
|
|
2d34c6962b | ||
|
|
8797e8e869 | ||
|
|
f416fdc875 | ||
|
|
90e8c21182 | ||
|
|
a10e922a7c | ||
|
|
49b1a3a29b | ||
|
|
f4c16a5377 | ||
|
|
675c6586d2 | ||
|
|
9570fc1cb6 | ||
|
|
cce5caec06 | ||
|
|
64f521ba00 | ||
|
|
834739a878 | ||
|
|
8b29be3f72 | ||
|
|
4d4e4299ab | ||
|
|
5d8e623e1e | ||
|
|
f8c74c21b9 | ||
|
|
1b6a2938f4 | ||
|
|
5bac6e3936 | ||
|
|
fd18581841 | ||
|
|
e380a9d0b0 | ||
|
|
8e67f5544d | ||
|
|
b2323784ae | ||
|
|
48387ed576 | ||
|
|
d4b101d4b0 | ||
|
|
063c19996b | ||
|
|
bf55efeb56 | ||
|
|
b2fe96600f | ||
|
|
13a1356093 | ||
|
|
51c6f4321c | ||
|
|
49c8b24f6c | ||
|
|
f86af9c8b8 | ||
|
|
b709333b1b | ||
|
|
5cf26dbd86 | ||
|
|
0ba28e14c8 | ||
|
|
2457a88778 | ||
|
|
48aac68248 | ||
|
|
c39b5a5d79 | ||
|
|
de7005a82d | ||
|
|
70f76fd592 | ||
|
|
7c5b9e128c | ||
|
|
de0e824b30 | ||
|
|
870c84d318 | ||
|
|
016846b5b4 | ||
|
|
4af8304798 | ||
|
|
1399f1d197 | ||
|
|
e8487b4786 | ||
|
|
a70b53b6e6 | ||
|
|
00fe260108 | ||
|
|
03a88069db | ||
|
|
6322b27c94 | ||
|
|
ab85118e68 | ||
|
|
bacac276ff | ||
|
|
d0fa87009d | ||
|
|
17d79f4de9 | ||
|
|
7e5fcfe8d5 | ||
|
|
6a57f5bfdf | ||
|
|
0e576754bb | ||
|
|
b54952855b | ||
|
|
15e650ef28 | ||
|
|
d6de7cce24 | ||
|
|
8ecd2cfc6a | ||
|
|
4409c3e1d3 | ||
|
|
ac747bcf05 | ||
|
|
6def65bb0d | ||
|
|
92677c4ad2 | ||
|
|
847d3a331b | ||
|
|
51d30f3275 | ||
|
|
0f0d959118 | ||
|
|
3582ca7c17 | ||
|
|
6fd267a80a | ||
|
|
932a5e2d47 | ||
|
|
1d91d4d065 | ||
|
|
fa42ea7cdf | ||
|
|
9e9dea6e57 | ||
|
|
a18520276a | ||
|
|
667f163853 | ||
|
|
4c49d0b32d | ||
|
|
b7cd39d373 | ||
|
|
4b06a29f10 | ||
|
|
ae4962eb45 | ||
|
|
19b7a36aa1 | ||
|
|
1040cca267 | ||
|
|
58e8145f0e | ||
|
|
5b3dc2bc48 | ||
|
|
8d3a3587d1 | ||
|
|
b0731d4fbd | ||
|
|
4b57c78c8e | ||
|
|
241eef173f | ||
|
|
b0b2954311 | ||
|
|
83c21e2304 | ||
|
|
30369de1f5 | ||
|
|
1f5a8f7694 | ||
|
|
6e060c9038 | ||
|
|
70da1a3a5b | ||
|
|
9d7244131f | ||
|
|
9f0923c955 | ||
|
|
c383c2cc54 | ||
|
|
586f8c2c18 | ||
|
|
40554eb93e | ||
|
|
963fc97f61 | ||
|
|
049bc928ce | ||
|
|
288afeeb1f | ||
|
|
6661583a0f | ||
|
|
8f5df65f0e | ||
|
|
5112af8ba1 | ||
|
|
0f39a1c1fa | ||
|
|
07f23e4d3b | ||
|
|
6f7e1dbf18 | ||
|
|
960f5a6c66 | ||
|
|
0cf1d64e32 | ||
|
|
fda8c36867 | ||
|
|
4bf9d9081e | ||
|
|
54a38cd645 | ||
|
|
66c4d3da91 | ||
|
|
46e79e5a53 | ||
|
|
9436ee048d | ||
|
|
2da9fcdedd | ||
|
|
0b34504abf | ||
|
|
610f056dfd | ||
|
|
49f1ca2329 | ||
|
|
494138719f | ||
|
|
291b15956b | ||
|
|
fa72cd0f7b | ||
|
|
5cd45f3493 | ||
|
|
3befab9964 | ||
|
|
ff219c0675 | ||
|
|
2f79fa2d50 | ||
|
|
ff182a23e8 | ||
|
|
71ac63b0c5 | ||
|
|
8675da453f | ||
|
|
1c2a8690fc | ||
|
|
afe21f9930 | ||
|
|
311b15cd1c | ||
|
|
bbe2346bd0 | ||
|
|
2e7df28b9e | ||
|
|
1401875bca | ||
|
|
de176466df | ||
|
|
6ce2a475a9 | ||
|
|
ac998a6082 | ||
|
|
a6467ee773 | ||
|
|
77fc2dee89 | ||
|
|
ef82831e99 | ||
|
|
7a4ec597dd | ||
|
|
05c2425bc6 | ||
|
|
e7619d01a7 | ||
|
|
be6e1a3449 | ||
|
|
4a003cf617 | ||
|
|
5bcb6eafb1 | ||
|
|
5c0d0cf598 | ||
|
|
46e1fd4d0b | ||
|
|
295198bad0 | ||
|
|
92e5475afb | ||
|
|
026f78f686 | ||
|
|
42b89944df | ||
|
|
7a877b0d9b | ||
|
|
e5189ed623 | ||
|
|
a4f59d6096 | ||
|
|
2470f8cba7 | ||
|
|
9cb97c68ed | ||
|
|
7f8dd45c21 | ||
|
|
39fa5bb997 | ||
|
|
0d69a3ee9a | ||
|
|
f9ea0cd1a1 | ||
|
|
ad51b03296 | ||
|
|
cb6139c736 | ||
|
|
4bae678f69 | ||
|
|
e8ae9e2fe5 | ||
|
|
d3f4c62550 | ||
|
|
06e7e4482c | ||
|
|
3099889cff | ||
|
|
e842246202 | ||
|
|
406d159852 | ||
|
|
e3ad602add | ||
|
|
8019d4457b | ||
|
|
7e4d2ac1d0 | ||
|
|
1401b59b13 | ||
|
|
efdfd0af67 | ||
|
|
3e1af7ef57 | ||
|
|
f6724b2d8c | ||
|
|
ea611a518d | ||
|
|
6b550a2cfa | ||
|
|
fe7997b7b1 | ||
|
|
3ea28ee963 | ||
|
|
f18a7fe6fa | ||
|
|
cece17cbe6 | ||
|
|
d808aca25e | ||
|
|
eb90e036ca | ||
|
|
559fc8b837 | ||
|
|
059aa62ed8 | ||
|
|
6e6dfc6912 | ||
|
|
6200512cae | ||
|
|
171ee84c1b | ||
|
|
5a27662f47 | ||
|
|
a569ffa003 | ||
|
|
1ea52433d5 | ||
|
|
a9f65ddc81 | ||
|
|
222c76bdae | ||
|
|
7d46392174 | ||
|
|
13089e80f8 | ||
|
|
a484fc4e2a | ||
|
|
8f9c186343 | ||
|
|
c9065c88f3 | ||
|
|
52e34c5e75 | ||
|
|
a4acc55994 | ||
|
|
2c2fac2ac1 | ||
|
|
2ded71fa90 | ||
|
|
9a5700b48b | ||
|
|
0bc3a9f0e7 | ||
|
|
2ff292b55f | ||
|
|
1f8ef33c5c | ||
|
|
b37ef2d144 | ||
|
|
b045fb1c8a | ||
|
|
9b3c75f0a6 | ||
|
|
3e171e20c3 | ||
|
|
a6200e07f3 | ||
|
|
a4ec078c17 | ||
|
|
ab5f6abd9e | ||
|
|
b3d41b5fc2 | ||
|
|
ad870fe837 | ||
|
|
88c4d9e56f | ||
|
|
b4414bcaf2 | ||
|
|
3212d90436 | ||
|
|
117b237bda | ||
|
|
0616b0bc7c | ||
|
|
4e04675dfe | ||
|
|
6a5cf5f35d | ||
|
|
d0f9b272f1 | ||
|
|
2e7ffb217e | ||
|
|
c16be0a85c | ||
|
|
15cf13d4de | ||
|
|
6257b7fdc1 | ||
|
|
3b17b44de5 | ||
|
|
7a724e76b7 | ||
|
|
8b3399351c | ||
|
|
3d9b034ab8 | ||
|
|
bd1fb83325 | ||
|
|
b20386cd18 | ||
|
|
c4512dc3a9 | ||
|
|
7064a48744 | ||
|
|
4e1ade34b8 | ||
|
|
4a014a338d | ||
|
|
523c31d3ad | ||
|
|
7a627a5bfc | ||
|
|
9864d43e95 | ||
|
|
cf2a16a746 | ||
|
|
25df2096fd | ||
|
|
47f5cd892a | ||
|
|
2aa3451c24 | ||
|
|
f3f679831b | ||
|
|
4bf00fac7c | ||
|
|
e867277a7f | ||
|
|
c9a3fe625c | ||
|
|
7e3db76c9f | ||
|
|
5fef193029 | ||
|
|
2289b43516 | ||
|
|
affca62d1a | ||
|
|
3041dee3ce | ||
|
|
ecde3f6375 | ||
|
|
b2823f6978 | ||
|
|
06b0b748a7 | ||
|
|
6313184711 | ||
|
|
a04c613905 | ||
|
|
26d106ca9e | ||
|
|
6ce6fd6c21 | ||
|
|
5c68d786ce | ||
|
|
ac5ec22d5e | ||
|
|
bb431bf58b | ||
|
|
bb7030d6e7 | ||
|
|
08e5996705 | ||
|
|
01e4edc7d8 | ||
|
|
524e3499a1 | ||
|
|
1b417549d6 | ||
|
|
443617e66e | ||
|
|
df5f1097e6 | ||
|
|
5a8e4027c6 | ||
|
|
77d1acd691 | ||
|
|
615df0e77a | ||
|
|
4496f58d84 | ||
|
|
90d5022933 | ||
|
|
c3a298739b | ||
|
|
2775d32ca0 | ||
|
|
2aa712f72b | ||
|
|
48e64534b4 | ||
|
|
504d0050c8 | ||
|
|
d840d2d38d | ||
|
|
891309ee9f | ||
|
|
e307ec2744 | ||
|
|
1aa325b429 | ||
|
|
5bf3f726e8 | ||
|
|
906ef63a50 | ||
|
|
dbc5656555 | ||
|
|
91a2cc075a | ||
|
|
098eabf308 | ||
|
|
5de8c055c1 | ||
|
|
3acb1b9a10 | ||
|
|
929a394bee | ||
|
|
e835e0a671 | ||
|
|
2b1c44b6f5 | ||
|
|
fbc94ac4f2 | ||
|
|
14a76db7d8 | ||
|
|
f2cec72378 | ||
|
|
2fe14c7257 | ||
|
|
5cebef0f59 | ||
|
|
49eeb7e8a2 | ||
|
|
bba4750ec3 | ||
|
|
8049e0d965 | ||
|
|
45ff13c7ce | ||
|
|
449d4ae18e | ||
|
|
db457d169c | ||
|
|
17efdb8096 | ||
|
|
f13031d120 | ||
|
|
d751a23df1 | ||
|
|
b8b22a6f8e | ||
|
|
b891be3607 | ||
|
|
a4840aa2a6 | ||
|
|
b1c2645ab0 | ||
|
|
3d90ee0b41 | ||
|
|
3da57560e7 | ||
|
|
d4dbd8a535 | ||
|
|
791f173cea | ||
|
|
7b5ab3defe | ||
|
|
a272fbb542 | ||
|
|
d754acf77d | ||
|
|
454ef107ae | ||
|
|
68b1234e81 | ||
|
|
6349ae2c17 | ||
|
|
ca9c467644 | ||
|
|
b2e87d7457 | ||
|
|
ba6750d7d6 | ||
|
|
d6518019dd | ||
|
|
fa77a95d93 | ||
|
|
d66c6b59a2 | ||
|
|
9e3fbbad10 | ||
|
|
9623264e56 | ||
|
|
bef1e8f49a | ||
|
|
47ef7120f7 | ||
|
|
7f0924fb52 | ||
|
|
7312a899e1 | ||
|
|
94955cb0d8 | ||
|
|
2ec9c02d0c | ||
|
|
208c7c0aa8 | ||
|
|
5e321e9a27 | ||
|
|
1dfe004370 | ||
|
|
5aec4f3f44 | ||
|
|
b12aaf003e | ||
|
|
1c80faede4 | ||
|
|
4c8819c039 | ||
|
|
d3c297d24f | ||
|
|
18150eb8ab | ||
|
|
1c00db1978 | ||
|
|
0ea46e9ee2 | ||
|
|
70e9b26c4d | ||
|
|
6af2ee0555 | ||
|
|
b68a3b27fa | ||
|
|
3ee819dd4c | ||
|
|
de29a07c35 | ||
|
|
59bbd4d743 | ||
|
|
790a3573e9 | ||
|
|
023f4fde09 | ||
|
|
e29a4db922 | ||
|
|
df06fbe85e | ||
|
|
7a315a056a | ||
|
|
e51d13a47b | ||
|
|
917c22a9eb | ||
|
|
650b5ded35 | ||
|
|
92c53cbfc1 | ||
|
|
2ce02c54b6 | ||
|
|
2ed6ddb92a | ||
|
|
efdbc001ff | ||
|
|
bbc43b7ec6 | ||
|
|
41d07fd670 | ||
|
|
66a33d0c44 | ||
|
|
179c420e9d | ||
|
|
bd4811c485 | ||
|
|
7ea639c078 | ||
|
|
105230eeb0 | ||
|
|
93ec844121 | ||
|
|
fd84c73d6b | ||
|
|
1af963337b | ||
|
|
c99505f39f | ||
|
|
d886a5e607 | ||
|
|
cc21e63b5b | ||
|
|
d18cd3d254 | ||
|
|
b01133020d | ||
|
|
cc9b4ea2bd | ||
|
|
006477172b | ||
|
|
3b2f4cddea | ||
|
|
01fb9f5411 | ||
|
|
4281e02f95 | ||
|
|
fc0ee3d4f8 | ||
|
|
f79121724d | ||
|
|
f50191d538 | ||
|
|
5b1bc4478c | ||
|
|
bb910aa447 | ||
|
|
f13afff928 | ||
|
|
a003e20e51 | ||
|
|
33d5d725d3 | ||
|
|
8fb0485887 | ||
|
|
4850dce79b | ||
|
|
2097e8a361 | ||
|
|
ad27c4b9fe | ||
|
|
2230177680 | ||
|
|
1279015c28 | ||
|
|
23c66964cd | ||
|
|
a180265585 | ||
|
|
4af602b706 | ||
|
|
d445019131 | ||
|
|
f97105ede0 | ||
|
|
76a63f2be5 | ||
|
|
b5d30129f2 | ||
|
|
26c021fc77 | ||
|
|
672db6380d | ||
|
|
feb428356c | ||
|
|
212c4e5bd7 | ||
|
|
1029d0cfa1 | ||
|
|
e55272180d | ||
|
|
332112e4dd | ||
|
|
5f65099af5 | ||
|
|
ebe85219eb | ||
|
|
a8a1c99312 | ||
|
|
adec7f4020 | ||
|
|
02e744d833 | ||
|
|
e70b5cb2c4 | ||
|
|
30213bc4c0 | ||
|
|
acc919b0e7 | ||
|
|
8e21eb0a97 | ||
|
|
3fa33e482a | ||
|
|
d88ff02fa8 | ||
|
|
d46e49df2a | ||
|
|
608b8b727f | ||
|
|
fd3191ad09 | ||
|
|
0b270fe3bb | ||
|
|
9ad0ee6c24 | ||
|
|
c05a01e46f | ||
|
|
4f68d57666 | ||
|
|
fd05028cff | ||
|
|
a28dd9cf6f | ||
|
|
7e7bcae8e7 | ||
|
|
218ef50ff7 | ||
|
|
18a9d99f08 | ||
|
|
53a763f3c1 | ||
|
|
cfd1b1e550 | ||
|
|
f8b6df9487 | ||
|
|
6d8b45817e | ||
|
|
fc9b44db21 | ||
|
|
100405e080 | ||
|
|
4b84a77a5a | ||
|
|
119b494cc6 | ||
|
|
95945a3b20 | ||
|
|
1b613a82f9 | ||
|
|
c691a93ee5 | ||
|
|
73de782756 | ||
|
|
55100e64a1 | ||
|
|
6d74959b64 | ||
|
|
16e7e548b3 | ||
|
|
3704e4d478 | ||
|
|
c16ff3e894 | ||
|
|
47006a2a88 | ||
|
|
952a968d3c | ||
|
|
d7f3274b59 | ||
|
|
cfedd153c8 | ||
|
|
b21d1533de | ||
|
|
6a3f6f8914 | ||
|
|
704ae0b294 | ||
|
|
9bf4597d8d | ||
|
|
5f7237309c | ||
|
|
e30b15ceec | ||
|
|
2d62fc5429 | ||
|
|
cd710f37a5 | ||
|
|
b55d2208ae | ||
|
|
ec8a3cee21 | ||
|
|
1c30a646dc | ||
|
|
24357c486a | ||
|
|
f6d00a5030 | ||
|
|
b52cd1200a | ||
|
|
1819dfb311 | ||
|
|
eeb1aed26a | ||
|
|
b63d6cd748 | ||
|
|
bb1d19610e | ||
|
|
da808ca007 | ||
|
|
aa351f0c2d | ||
|
|
ca871b16c4 | ||
|
|
9636cbace0 | ||
|
|
188ff04ec7 | ||
|
|
057bb73405 | ||
|
|
5d2e826bae | ||
|
|
166adbb7ba | ||
|
|
8213aa8a68 | ||
|
|
fc08f54394 | ||
|
|
9ec45a889f | ||
|
|
ae6c7d33a8 | ||
|
|
21b61f22f7 | ||
|
|
9516fb4963 | ||
|
|
d566adb644 | ||
|
|
242f958428 | ||
|
|
a5a3a47a69 | ||
|
|
8b38d45883 | ||
|
|
5d8a9251e5 | ||
|
|
84fb2da1d2 | ||
|
|
46d61151f2 | ||
|
|
bd84b44175 | ||
|
|
253673fc9a | ||
|
|
7f6f9ec285 | ||
|
|
88d108f85c | ||
|
|
a9925bcf28 | ||
|
|
f601a45700 | ||
|
|
283d321307 | ||
|
|
ef27cd7862 | ||
|
|
4c1be1aa68 | ||
|
|
eb550aeec3 | ||
|
|
14c4d4fe00 | ||
|
|
eec62c12ff | ||
|
|
b84e191d31 | ||
|
|
ac7994b631 | ||
|
|
ab345ee4ef | ||
|
|
beced802f0 | ||
|
|
b4331b7758 | ||
|
|
ae112ab7d9 | ||
|
|
f97d46814d | ||
|
|
84985b85e0 | ||
|
|
78d4867f25 | ||
|
|
dbf44cdfd8 | ||
|
|
73d03fecaf | ||
|
|
392ab31b1f | ||
|
|
f05c773bc7 | ||
|
|
3b8ae66db5 | ||
|
|
03ee1b0513 | ||
|
|
5cc501f5af | ||
|
|
f013194265 | ||
|
|
9322c4e7ae | ||
|
|
aafc6af69c | ||
|
|
fbcb522f6c | ||
|
|
31fd0ecde0 | ||
|
|
9d6ac3907a | ||
|
|
784bd16e87 | ||
|
|
4a11ea2c57 | ||
|
|
4f628e9b33 | ||
|
|
3366540521 | ||
|
|
262f77da9c | ||
|
|
cde1c8bf79 | ||
|
|
c39f0a0aba | ||
|
|
476cfb1f9c | ||
|
|
e6915c669b | ||
|
|
b2987e1d4f | ||
|
|
5eb6a4307d | ||
|
|
a26b42fef8 | ||
|
|
24c8661453 | ||
|
|
4f2a8149fe | ||
|
|
aba8a3cc55 | ||
|
|
7f6edc2749 | ||
|
|
7f28629748 | ||
|
|
2ac9b885c9 | ||
|
|
6d756eab5d | ||
|
|
8649bb86e9 | ||
|
|
7b0e41d478 | ||
|
|
3127afbbc2 | ||
|
|
0d993c0b90 | ||
|
|
424f688406 | ||
|
|
f2f0661ed3 | ||
|
|
14fd1a06fd | ||
|
|
4a2ffc754f | ||
|
|
4c94694e78 | ||
|
|
f1b5a26f2d | ||
|
|
357daf2756 | ||
|
|
97f708b9ef | ||
|
|
91f6fe3965 | ||
|
|
85abb5937c | ||
|
|
c03b08e8f2 | ||
|
|
f5cc891cc4 | ||
|
|
89de63edcd | ||
|
|
8551426619 | ||
|
|
d8deab799e | ||
|
|
f4b09a76b8 | ||
|
|
32ec05e04c | ||
|
|
ca6e20573f | ||
|
|
ae7e8df986 | ||
|
|
dc90a13671 | ||
|
|
f294cb4e9a | ||
|
|
ba5a19582e | ||
|
|
da4cc3de20 | ||
|
|
7b6ccf3f30 | ||
|
|
13122b07d4 | ||
|
|
4effc3c3b4 | ||
|
|
fcc74f0ca3 | ||
|
|
8950d57ff8 | ||
|
|
d31929eb33 | ||
|
|
6398c54b49 | ||
|
|
0da88c6a61 | ||
|
|
e62bffd20a | ||
|
|
537cb70a89 | ||
|
|
173bbe52bd | ||
|
|
b924fdc308 | ||
|
|
84a04ecfca | ||
|
|
3935643e35 | ||
|
|
91df9c8f1e | ||
|
|
e8db62f900 | ||
|
|
a97de8afb4 | ||
|
|
239d06bbcc | ||
|
|
f8649457d6 | ||
|
|
8863693541 | ||
|
|
47a423284b | ||
|
|
c2cbd3f5b0 | ||
|
|
0b84b96afb | ||
|
|
2669c8fff0 | ||
|
|
4aefb6779f | ||
|
|
06fd007c62 | ||
|
|
6f4e029537 | ||
|
|
07f35dbbb2 | ||
|
|
ebaf97a495 | ||
|
|
12a501d559 | ||
|
|
7dcd4490ba | ||
|
|
dd1ac7c7f8 | ||
|
|
471910e0b8 | ||
|
|
4afb282ca2 | ||
|
|
a514e88b78 | ||
|
|
25f4f15e76 | ||
|
|
60286f69ad | ||
|
|
addd22ec6c | ||
|
|
b79fefdee8 | ||
|
|
0bab09e48e | ||
|
|
d2b3025709 | ||
|
|
cf234ca067 | ||
|
|
a908cc61c9 | ||
|
|
386e2417e3 | ||
|
|
fd57b37cea | ||
|
|
b19c79f48c | ||
|
|
a6222f87d2 | ||
|
|
5cd4e5b40b | ||
|
|
eb3d9089e0 | ||
|
|
14f0fe1160 | ||
|
|
21c8fd6e98 | ||
|
|
803ff92976 | ||
|
|
5d74a975df | ||
|
|
25802db0d8 | ||
|
|
537a3d3ce8 | ||
|
|
56c22cffe6 | ||
|
|
fe1e26957a | ||
|
|
bc366947f0 | ||
|
|
86150cc571 | ||
|
|
a0e124717b | ||
|
|
320ba89aea | ||
|
|
f11fc947af | ||
|
|
8514444508 | ||
|
|
b194c0100f | ||
|
|
d7dedf15f1 | ||
|
|
c491fb6c40 | ||
|
|
0e3af4df5d | ||
|
|
32188dcef4 | ||
|
|
0a199a2588 | ||
|
|
8f1893f665 | ||
|
|
4f765fe527 | ||
|
|
7eeb917e16 | ||
|
|
93d8d0f5bf | ||
|
|
6db7cb4a6e | ||
|
|
602ea51bbf | ||
|
|
ec3eab6e72 | ||
|
|
a8bb7811ed | ||
|
|
82faf0f99e | ||
|
|
9ef9e656e2 | ||
|
|
c4bc4a1d9b | ||
|
|
f50445032f | ||
|
|
3536a94976 | ||
|
|
45276010e0 | ||
|
|
2e47f42366 | ||
|
|
dd6e9a1512 | ||
|
|
af00517102 | ||
|
|
9a3c251867 | ||
|
|
daa662ac27 | ||
|
|
24931a9f5a | ||
|
|
f51924bf1d | ||
|
|
f82257edb8 | ||
|
|
286e9894c0 | ||
|
|
0157c42c52 | ||
|
|
ccfb7356eb | ||
|
|
7fa7096d91 | ||
|
|
e0f6fb305d | ||
|
|
e0fd33f376 | ||
|
|
c5972f1b59 | ||
|
|
c2d97b58ee | ||
|
|
c97b3ffbdf | ||
|
|
7ad86062b4 | ||
|
|
3ec02a299c | ||
|
|
1fce7561db | ||
|
|
3b17235b6e | ||
|
|
52c9b9503b | ||
|
|
48a2b20320 | ||
|
|
e6cc8cd2e8 | ||
|
|
3a183ddf53 | ||
|
|
7eb77487d1 | ||
|
|
2cffb5c952 | ||
|
|
a5da581317 | ||
|
|
03ca2d614f | ||
|
|
17bf2b0611 | ||
|
|
8c178d92de | ||
|
|
c0a3251f44 | ||
|
|
bfdc6b4504 | ||
|
|
6bda9a372e | ||
|
|
a8de087137 | ||
|
|
bfdf09908e | ||
|
|
80afe04aa9 | ||
|
|
a9e38b2be6 | ||
|
|
22738982cb | ||
|
|
757c6ef44c | ||
|
|
bf6025c971 | ||
|
|
4252fb6533 | ||
|
|
e451930e7b | ||
|
|
09d6f7b82b | ||
|
|
0f9bcda6ca | ||
|
|
cd367fb0d5 | ||
|
|
cd7010dccb | ||
|
|
3136319352 | ||
|
|
eb00b5f1ca | ||
|
|
b4377e0746 | ||
|
|
5f1d67ee21 | ||
|
|
e932cb2456 | ||
|
|
85abefff74 | ||
|
|
34d9790a04 | ||
|
|
5bfe2497fd | ||
|
|
e16a775037 | ||
|
|
ee4a9a967b | ||
|
|
a3d3dcc44c | ||
|
|
75fbfab95d | ||
|
|
d48a61c597 | ||
|
|
42fab92237 | ||
|
|
e2eac83615 | ||
|
|
04465a1da3 | ||
|
|
2adb1ee980 | ||
|
|
01919a496e | ||
|
|
2c66bec7c9 | ||
|
|
b10f7faf25 | ||
|
|
450014ab16 | ||
|
|
8ad0d2ac58 | ||
|
|
bd41f96df3 | ||
|
|
5346eb1ef1 | ||
|
|
f532d624e0 | ||
|
|
4ce6f49b30 | ||
|
|
2fb160b5f7 | ||
|
|
4ed9fb2acc | ||
|
|
722fc083cb | ||
|
|
1bfe5eed15 | ||
|
|
4356b79ecc | ||
|
|
5eff817b05 | ||
|
|
4f08fef25a | ||
|
|
325f21f8b5 | ||
|
|
802d6f6cd3 | ||
|
|
f2120521d6 | ||
|
|
cbdeea9be7 | ||
|
|
8d2d38327a | ||
|
|
5c564c42dc | ||
|
|
0c47f8f962 | ||
|
|
65d625ad3c | ||
|
|
0e65b7f1be | ||
|
|
22cfaf8665 | ||
|
|
b3670fe528 | ||
|
|
d311884ec0 | ||
|
|
2f80b66b07 | ||
|
|
b400c13965 | ||
|
|
c71f0c17fc | ||
|
|
a952477c3b | ||
|
|
1291b693f0 | ||
|
|
1153a3b38b | ||
|
|
2e69cd86aa | ||
|
|
df15fd497d | ||
|
|
a5ea6360bd | ||
|
|
0639b139d7 | ||
|
|
23ec8e4687 | ||
|
|
2f7e3bbc85 | ||
|
|
690757b225 | ||
|
|
a8867dee83 | ||
|
|
c4d0462362 | ||
|
|
db97240ad3 | ||
|
|
5b6f06ac0e | ||
|
|
d3e3561407 | ||
|
|
51de827c2b | ||
|
|
49566cdae7 | ||
|
|
b6786687b6 | ||
|
|
2e7c48a999 | ||
|
|
c83abe32c6 | ||
|
|
1b19e0201d | ||
|
|
7681250fff | ||
|
|
9fe4e0b613 | ||
|
|
2f09c3f355 | ||
|
|
ea047e01d1 | ||
|
|
76d9a69220 | ||
|
|
6388eed6e3 | ||
|
|
86ead72858 | ||
|
|
48b22edace | ||
|
|
ea682a2aaa | ||
|
|
8b499d8f7f | ||
|
|
25c04e9c05 | ||
|
|
5dca562a12 | ||
|
|
7701bc9b67 | ||
|
|
157bc08f84 | ||
|
|
7921f1f9e5 | ||
|
|
90d737773d | ||
|
|
a7252d16d1 | ||
|
|
4f23c40598 | ||
|
|
cdde3799af | ||
|
|
f0b987ed54 | ||
|
|
af60fdabda | ||
|
|
af0d6202bb | ||
|
|
c1e3c23523 | ||
|
|
7232706a7f | ||
|
|
dd2b76473f | ||
|
|
b41c3ac687 | ||
|
|
fa74dad83d | ||
|
|
06a09b90e2 | ||
|
|
3c9767b791 | ||
|
|
da66f5e123 | ||
|
|
e4f33cce14 | ||
|
|
a5b374e524 | ||
|
|
0dfcf42635 | ||
|
|
0aa42bc72a | ||
|
|
cbf76c17d5 | ||
|
|
216a2df6da | ||
|
|
0b2db0615e | ||
|
|
3544fe5bfa | ||
|
|
2cd30fc9d8 | ||
|
|
71bbe7b0c5 | ||
|
|
29f1523113 | ||
|
|
6b5981e3af | ||
|
|
273a6cbb3b | ||
|
|
6c78f04d12 | ||
|
|
1b86b4e4cd | ||
|
|
94d3560410 | ||
|
|
897749547d | ||
|
|
6fb34451d9 | ||
|
|
3fba41b27b | ||
|
|
6c5f991494 | ||
|
|
e80499b7b4 | ||
|
|
732788ac72 | ||
|
|
5a63cd253d | ||
|
|
bc17b5c504 | ||
|
|
5dfcfd7b71 | ||
|
|
39766553fa | ||
|
|
b6be60c584 | ||
|
|
a6d9bd1ab3 | ||
|
|
940a3c50f3 | ||
|
|
ca45f61c2c | ||
|
|
7644bffe12 | ||
|
|
ba1923cd21 | ||
|
|
e0dc7ab451 | ||
|
|
3a1f0b6d38 | ||
|
|
13b91a541c | ||
|
|
0cd96e1d82 | ||
|
|
efe6247dbc | ||
|
|
b8b7c73bb1 | ||
|
|
3b1ea689d1 | ||
|
|
c5a611af06 | ||
|
|
ef41dc809c | ||
|
|
bc0ca617a1 | ||
|
|
d25620ecfe | ||
|
|
bc9d0aeeb3 | ||
|
|
bbd2951496 | ||
|
|
0d80eca595 | ||
|
|
d8cf5ad553 | ||
|
|
ec9b8f0005 | ||
|
|
d98c961fd8 | ||
|
|
639122aeca | ||
|
|
45852eb4b9 | ||
|
|
24e716df5d | ||
|
|
fbda43b9dd | ||
|
|
e5f18fa2bb | ||
|
|
a3e97cb039 | ||
|
|
f4292796fc | ||
|
|
bc991fe762 | ||
|
|
3de65f9a5b | ||
|
|
000c8da6ae | ||
|
|
bc253c26b9 | ||
|
|
abc3738309 | ||
|
|
c305ca2e22 | ||
|
|
6618afc72f | ||
|
|
ab4b4d5230 | ||
|
|
be842a3e3a | ||
|
|
114704f668 | ||
|
|
5f8b3f1986 | ||
|
|
4b376b65b3 | ||
|
|
f5c7abcbd8 | ||
|
|
bb91fbb327 | ||
|
|
c3cc54a2d2 | ||
|
|
109b40f3b2 | ||
|
|
47a3005b6a | ||
|
|
7c6530d9e8 | ||
|
|
8e57d76713 | ||
|
|
8f6c9af3fb | ||
|
|
2719925f8b | ||
|
|
51c7a3e8cc | ||
|
|
0946fedce2 | ||
|
|
8b11146e44 | ||
|
|
263ab8c913 | ||
|
|
33b8e7a21b | ||
|
|
ccecaf7aae | ||
|
|
fc8d9b4509 | ||
|
|
25999801d5 | ||
|
|
763c8338ef | ||
|
|
340516297b | ||
|
|
069ba9cfc4 | ||
|
|
4c88a331d5 | ||
|
|
d7016c5de2 | ||
|
|
3d41215a63 | ||
|
|
57e5452220 | ||
|
|
cc94eb6d4e | ||
|
|
0b82947e8f | ||
|
|
e4507e35fd | ||
|
|
40fd62cd2b | ||
|
|
5e8c1b4881 | ||
|
|
5f984ecbe6 | ||
|
|
91c6a4d6b2 | ||
|
|
3c9a3b693b | ||
|
|
7bb16515b1 | ||
|
|
c18f712b84 | ||
|
|
fe0d7a7e3f | ||
|
|
a3193beabf | ||
|
|
9dd89fe7ae | ||
|
|
db67aa9b39 | ||
|
|
df96ce4112 | ||
|
|
4d27014330 | ||
|
|
36bb2cf62f | ||
|
|
d7f7650e3a | ||
|
|
348847e196 | ||
|
|
95b2650a8a | ||
|
|
14935cb2f7 | ||
|
|
f059640602 | ||
|
|
22fe547215 | ||
|
|
2612134273 | ||
|
|
9630d8200c | ||
|
|
0a5bfa5a55 | ||
|
|
29e51e92a4 | ||
|
|
bd935e9dc2 | ||
|
|
2edee985fa | ||
|
|
7afa58319f | ||
|
|
7d3d4ab73c |
@@ -4,11 +4,17 @@ root = true
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
|
||||
[*.{js,jsx,ts,tsx,vue}]
|
||||
indent_size = 2
|
||||
|
||||
[*.py]
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
32
.github/workflows/jms-build-test.yml
vendored
Normal file
32
.github/workflows/jms-build-test.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: "Run Build Test"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- pr@*
|
||||
- repr@*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: docker/setup-qemu-action@v2
|
||||
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
|
||||
- uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: jumpserver/lina:test
|
||||
file: Dockerfile
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- uses: LouisBrunner/checks-action@v1.5.0
|
||||
if: always()
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: Check Build
|
||||
conclusion: ${{ job.status }}
|
||||
35
.github/workflows/release-drafter.yml
vendored
35
.github/workflows/release-drafter.yml
vendored
@@ -31,16 +31,29 @@ jobs:
|
||||
config-name: release-config.yml
|
||||
version: ${{ steps.get_version.outputs.TAG }}
|
||||
tag: ${{ steps.get_version.outputs.TAG }}
|
||||
|
||||
build-and-release:
|
||||
needs: create-realese
|
||||
name: Build and Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build it and upload
|
||||
uses: jumpserver/action-build-upload-assets@node10
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16.20'
|
||||
- name: Install dependencies
|
||||
run: yarn install
|
||||
- name: Build web
|
||||
run: |
|
||||
sed -i "s@version-dev@${{ steps.get_version.outputs.TAG }}@g" src/layout/components/NavHeader/About.vue
|
||||
yarn build
|
||||
- name: Create Upload Assets
|
||||
run: |
|
||||
rm -rf build/*
|
||||
mv lina lina-${{ steps.get_version.outputs.VERSION }}
|
||||
tar -czf lina-${{ steps.get_version.outputs.VERSION }}.tar.gz lina-${{ steps.get_version.outputs.VERSION }}
|
||||
echo $(md5sum lina-${{ steps.get_version.outputs.VERSION }}.tar.gz | awk '{print $1}') > build/lina-${{ steps.get_version.outputs.VERSION }}.tar.gz.md5
|
||||
mv lina-${{ steps.get_version.outputs.VERSION }}.tar.gz build/
|
||||
- name: Release Upload Assets
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
draft: true
|
||||
files: |
|
||||
build/lina-${{ steps.get_version.outputs.TAG }}.tar.gz
|
||||
build/lina-${{ steps.get_version.outputs.TAG }}.tar.gz.md5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create-realese.outputs.upload_url }}
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@ tests/**/coverage/
|
||||
*.njsproj
|
||||
*.sln
|
||||
.env.development
|
||||
.python-version
|
||||
|
||||
44
Dockerfile
44
Dockerfile
@@ -1,23 +1,39 @@
|
||||
FROM node:10 as stage-build
|
||||
ARG NPM_REGISTRY="https://registry.npm.taobao.org"
|
||||
ENV NPM_REGISTY=$NPM_REGISTRY
|
||||
ARG SASS_BINARY_SITE="https://npm.taobao.org/mirrors/node-sass"
|
||||
ENV SASS_BINARY_SITE=$SASS_BINARY_SITE
|
||||
FROM node:16.20-bullseye-slim as stage-build
|
||||
ARG TARGETARCH
|
||||
|
||||
ARG DEPENDENCIES=" \
|
||||
g++ \
|
||||
make \
|
||||
python3"
|
||||
|
||||
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=lina \
|
||||
sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
|
||||
&& rm -f /etc/apt/apt.conf.d/docker-clean \
|
||||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
|
||||
&& echo "no" | dpkg-reconfigure dash \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ARG NPM_REGISTRY="https://registry.npmmirror.com"
|
||||
RUN set -ex \
|
||||
&& npm config set registry ${NPM_REGISTRY} \
|
||||
&& yarn config set registry ${NPM_REGISTRY}
|
||||
|
||||
WORKDIR /data
|
||||
|
||||
RUN npm config set sass_binary_site=${SASS_BINARY_SITE}
|
||||
RUN npm config set registry ${NPM_REGISTRY}
|
||||
RUN yarn config set registry ${NPM_REGISTRY}
|
||||
COPY package.json yarn.lock /data/
|
||||
RUN yarn install
|
||||
RUN npm rebuild node-sass
|
||||
ADD package.json yarn.lock /data
|
||||
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=lina \
|
||||
yarn install
|
||||
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
ADD . /data
|
||||
RUN cd utils && bash -xieu build.sh build
|
||||
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=lina \
|
||||
sed -i "s@version-dev@${VERSION}@g" src/layout/components/NavHeader/About.vue \
|
||||
&& yarn build
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY --from=stage-build /data/release/lina /opt/lina
|
||||
FROM nginx:1.24-bullseye
|
||||
COPY --from=stage-build /data/lina /opt/lina
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
27
package.json
27
package.json
@@ -5,19 +5,22 @@
|
||||
"author": "Pan <panfree23@gmail.com>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
"serve": "vue-cli-service serve",
|
||||
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
|
||||
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
|
||||
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
|
||||
"build:prod": "vue-cli-service build",
|
||||
"build:stage": "vue-cli-service build --mode staging",
|
||||
"preview": "node build/index.js --preview",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
"fix": "eslint --ext .js,.vue --fix src",
|
||||
"test:unit": "jest --clearCache && vue-cli-service test:unit",
|
||||
"test:ci": "npm run lint && npm run test:unit",
|
||||
"svgo": "svgo -f src/icons/svg --config=src/icas/svgo.yml",
|
||||
"vue-i18n-extract": "vue-i18n-extract",
|
||||
"vue-i18n-report": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json'",
|
||||
"vue-i18n-report-json": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -o /tmp/abc.json",
|
||||
"vue-i18n-report-add-miss": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -a"
|
||||
"vue-i18n-report-add-miss": "vue-i18n-extract report -v './src/**/*.?(js|vue)' -l './src/i18n/langs/**/*.json' -a",
|
||||
"diff-i18n": "python ./src/i18n/langs/i18n-util.py diff en ja",
|
||||
"apply-i18n": "python ./src/i18n/langs/i18n-util.py apply en ja"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
|
||||
@@ -26,18 +29,19 @@
|
||||
"axios-retry": "^3.1.9",
|
||||
"cron-parser": "^4.0.0",
|
||||
"crypto-js": "^4.1.1",
|
||||
"css-color-function": "^1.3.3",
|
||||
"deepmerge": "^4.2.2",
|
||||
"echarts": "^4.7.0",
|
||||
"element-ui": "2.13.2",
|
||||
"eslint-plugin-html": "^6.0.0",
|
||||
"install": "^0.13.0",
|
||||
"jquery": "^3.5.0",
|
||||
"jquery": "^3.6.1",
|
||||
"js-cookie": "2.2.0",
|
||||
"jsencrypt": "^3.2.1",
|
||||
"krry-transfer": "^1.7.3",
|
||||
"less": "^3.10.3",
|
||||
"less-loader": "^5.0.0",
|
||||
"lodash": "^4.17.15",
|
||||
"lodash": "^4.17.21",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"lodash.frompairs": "^4.0.1",
|
||||
"lodash.get": "^4.4.2",
|
||||
@@ -49,24 +53,26 @@
|
||||
"lodash.set": "^4.3.2",
|
||||
"lodash.topairs": "^4.3.0",
|
||||
"lodash.values": "^4.3.0",
|
||||
"moment": "^2.29.1",
|
||||
"moment-parseformat": "^3.0.0",
|
||||
"moment": "^2.29.4",
|
||||
"moment-parseformat": "^4.0.0",
|
||||
"normalize.css": "7.0.0",
|
||||
"npm": "^7.8.0",
|
||||
"nprogress": "0.2.0",
|
||||
"path-to-regexp": "2.4.0",
|
||||
"vue": "2.6.10",
|
||||
"vue-codemirror-lite": "^1.0.4",
|
||||
"vue-codemirror": "4.0.6",
|
||||
"vue-cookie": "^1.1.4",
|
||||
"vue-echarts": "^5.0.0-beta.0",
|
||||
"vue-i18n": "^8.15.5",
|
||||
"vue-json-editor": "^1.4.3",
|
||||
"vue-markdown": "^2.2.4",
|
||||
"vue-moment": "^4.1.0",
|
||||
"vue-password-strength-meter": "^1.7.2",
|
||||
"vue-router": "3.0.6",
|
||||
"vue-select": "^3.9.5",
|
||||
"vuejs-logger": "^1.5.4",
|
||||
"vuex": "3.1.0",
|
||||
"xss": "^1.0.14",
|
||||
"xterm": "^4.5.0",
|
||||
"xterm-addon-fit": "^0.3.0",
|
||||
"zxcvbn": "^4.4.2"
|
||||
@@ -90,13 +96,14 @@
|
||||
"eslint": "^5.15.3",
|
||||
"eslint-plugin-vue": "5.2.2",
|
||||
"eslint-plugin-vue-i18n": "^0.3.0",
|
||||
"github-markdown-css": "^5.1.0",
|
||||
"html-webpack-plugin": "3.2.0",
|
||||
"husky": "^4.2.3",
|
||||
"less-loader": "^5.0.0",
|
||||
"lint-staged": "^10.1.2",
|
||||
"mockjs": "1.0.1-beta3",
|
||||
"runjs": "^4.3.2",
|
||||
"sass": "^1.26.10",
|
||||
"sass": "~1.32.6",
|
||||
"sass-loader": "^7.1.0",
|
||||
"script-ext-html-webpack-plugin": "2.1.3",
|
||||
"script-loader": "0.7.2",
|
||||
|
||||
@@ -9,23 +9,7 @@
|
||||
<meta http-equiv="Cache" content="no-cache">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<title><%= webpackConfig.name %></title>
|
||||
<style>
|
||||
::-webkit-scrollbar {
|
||||
width:14px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
border-radius:10px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 8px;
|
||||
box-shadow: 8px 10px 20px #C6C6C6 inset;
|
||||
border: 3px solid rgba(0, 0, 0, 0);
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
box-shadow: 8px 10px 20px #878787 inset;
|
||||
}
|
||||
|
||||
</style>
|
||||
<link rel="stylesheet" href="<%= BASE_URL %>theme/element-ui.css">
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
@@ -33,9 +17,15 @@
|
||||
</noscript>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
const baseUrl = "/ui/"
|
||||
if (location.pathname === '/' && baseUrl !== '/') {
|
||||
location.pathname = baseUrl
|
||||
if (location.pathname === '/') {
|
||||
location.pathname = '/ui/'
|
||||
}
|
||||
const pathname = window.location.pathname
|
||||
if (pathname.startsWith('/core')) {
|
||||
return
|
||||
}
|
||||
if(pathname.indexOf('/ui') === -1) {
|
||||
window.location.href = window.location.origin + '/ui/#' + pathname
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
23
public/theme/README.md
Normal file
23
public/theme/README.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# 主题颜色
|
||||
```
|
||||
alpha-1: "rgba(64, 158, 255, 0.1)"
|
||||
alpha-2: "rgba(64, 158, 255, 0.2)"
|
||||
alpha-3: "rgba(64, 158, 255, 0.3)"
|
||||
alpha-4: "rgba(64, 158, 255, 0.4)"
|
||||
alpha-5: "rgba(64, 158, 255, 0.5)"
|
||||
alpha-6: "rgba(64, 158, 255, 0.6)"
|
||||
alpha-7: "rgba(64, 158, 255, 0.7)"
|
||||
alpha-8: "rgba(64, 158, 255, 0.8)"
|
||||
alpha-9: "rgba(64, 158, 255, 0.9)"
|
||||
light-1: "#53a8ff"
|
||||
light-2: "#66b1ff"
|
||||
light-3: "#79bbff"
|
||||
light-4: "#8cc5ff"
|
||||
light-5: "#a0cfff"
|
||||
light-6: "#b3d8ff"
|
||||
light-7: "#c6e2ff"
|
||||
light-8: "#d9ecff"
|
||||
light-9: "#ecf5ff"
|
||||
primary: "#409EFF"
|
||||
```
|
||||
primary是初始主题颜色,其他颜色均属于primary的系列颜色
|
||||
@@ -1,66 +1,84 @@
|
||||
// cover some element-ui styles
|
||||
/* 这里只写element-variables里面改不动的、且和主题系列颜色相关的样式!!! */
|
||||
/* 主题相关看该文件夹下的README.md */
|
||||
|
||||
/* info type special treatment */
|
||||
.el-button--info {
|
||||
background-color: info;
|
||||
border-color: info;
|
||||
}
|
||||
|
||||
.el-button--text {
|
||||
padding: 5px
|
||||
}
|
||||
|
||||
.el-button--text:hover {
|
||||
background-color: rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
.el-button--success {
|
||||
background-color: success;
|
||||
border-color: success;
|
||||
}
|
||||
|
||||
.el-alert--info.is-light {
|
||||
background-color: light-9;
|
||||
color: light-2;
|
||||
border: 1px solid;
|
||||
}
|
||||
|
||||
.el-alert--info .el-alert__description {
|
||||
color: light-2;
|
||||
}
|
||||
|
||||
.el-pagination.is-background .el-pager li:not(.disabled):hover {
|
||||
color: white;
|
||||
background-color: primary;
|
||||
}
|
||||
|
||||
.el-pagination.is-background .btn-next,
|
||||
.el-pagination.is-background .btn-prev,
|
||||
.el-pagination.is-background .el-pager li {
|
||||
margin: 0 5px;
|
||||
background-color: white;
|
||||
color: #606266;
|
||||
min-width: 28px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #DCDFE6;
|
||||
font-size: 12px;
|
||||
line-height: 26px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.el-breadcrumb__inner,
|
||||
.el-breadcrumb__inner a {
|
||||
font-weight: 400 !important;
|
||||
}
|
||||
|
||||
$--color-primary: #1ab394;
|
||||
$--color-success: #1c84c6;
|
||||
$--color-info: #23c6c8;
|
||||
$--color-warning: #f8ac59;
|
||||
$--color-danger: #ed5565;
|
||||
|
||||
$--color-link: #1c84c6;
|
||||
$--color-link-highlight: #23527c;
|
||||
|
||||
$--color-text-primary: #303133;
|
||||
/// color|1|Font Color|2
|
||||
$--color-text-regular: #606266;
|
||||
|
||||
.el-upload {
|
||||
input[type="file"] {
|
||||
display: none !important;
|
||||
}
|
||||
.el-upload input[type="file"] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.el-upload__input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
// to fixed https://github.com/ElemeFE/element/issues/2461
|
||||
.el-dialog {
|
||||
transform: none;
|
||||
left: 0;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
// refine element ui upload
|
||||
.upload-container {
|
||||
.el-upload {
|
||||
.upload-container .el-upload {
|
||||
width: 100%;
|
||||
|
||||
.el-upload-dragger {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// dropdown
|
||||
.el-dropdown-menu {
|
||||
a {
|
||||
display: block
|
||||
}
|
||||
.upload-container .el-upload .el-upload-dragger {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.el-dropdown-menu a {
|
||||
display: block
|
||||
}
|
||||
|
||||
.el-table th > .cell {
|
||||
color: rgb(104, 106, 108);
|
||||
}
|
||||
|
||||
// to fix el-date-picker css style
|
||||
.el-range-separator {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
@@ -111,22 +129,6 @@ td .el-button.el-button--mini {
|
||||
border-left-color: rgb(220, 223, 230);
|
||||
}
|
||||
|
||||
.el-alert--success.is-light {
|
||||
border: #bce8f1 solid 1px;
|
||||
}
|
||||
|
||||
.el-alert--info.is-light {
|
||||
border: #bce8f1 solid 1px;
|
||||
}
|
||||
|
||||
.el-alert--warning.is-light {
|
||||
border: #faebcc solid 1px;
|
||||
}
|
||||
|
||||
.el-alert--error.is-light {
|
||||
border: #f1dfe2 solid 1px;
|
||||
}
|
||||
|
||||
.el-alert__content {
|
||||
line-height: 1.5;
|
||||
}
|
||||
@@ -140,32 +142,32 @@ td .el-button.el-button--mini {
|
||||
}
|
||||
|
||||
.el-card.primary > .el-card__header {
|
||||
background-color: $--color-primary;
|
||||
border-color: $--color-primary;
|
||||
background-color: primary;
|
||||
border-color: primary;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.el-card.success > .el-card__header {
|
||||
background-color: $--color-success;
|
||||
border-color: $--color-success;
|
||||
background-color: success;
|
||||
border-color: success;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.el-card.info > .el-card__header {
|
||||
background-color: $--color-info;
|
||||
border-color: $--color-info;
|
||||
background-color: info;
|
||||
border-color: info;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.el-card.warning > .el-card__header {
|
||||
background-color: $--color-warning;
|
||||
border-color: $--color-warning;
|
||||
background-color: warning;
|
||||
border-color: warning;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.el-card.danger > .el-card__header {
|
||||
background-color: $--color-danger;
|
||||
border-color: $--color-danger;
|
||||
background-color: danger;
|
||||
border-color: danger;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
@@ -192,57 +194,42 @@ td .el-button.el-button--mini {
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
|
||||
.el-select-dropdown__item.selected {
|
||||
font-weight: 400;
|
||||
color: $--color-text-primary;
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
|
||||
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected {
|
||||
color: #606266;
|
||||
background-color: #ddd;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
//.el-select-dropdown.is-multiple .el-select-dropdown__item.selected {
|
||||
// color: #606266;
|
||||
// background-color: #ddd;
|
||||
// font-weight: 400;
|
||||
//}
|
||||
|
||||
.el-select-dropdown__item.hover, .el-select-dropdown__item:hover {
|
||||
background-color: $--color-primary;
|
||||
.option-group .el-select-dropdown__item.hover, .option-group .el-select-dropdown__item.selected {
|
||||
background-color: primary;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.option-group:has(.hover) .el-select-dropdown__item.selected {
|
||||
background-color: light-2;
|
||||
}
|
||||
|
||||
|
||||
.el-select-dropdown__item.is-disabled:hover{
|
||||
color:#c0c4cc;
|
||||
}
|
||||
|
||||
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected::after {
|
||||
color: $--color-primary;
|
||||
color: primary;
|
||||
}
|
||||
|
||||
.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover {
|
||||
color: white;
|
||||
background-color: $--color-primary;
|
||||
background-color: light-4;
|
||||
}
|
||||
|
||||
.el-tag.el-tag--info {
|
||||
background-color: #f1f1f1;
|
||||
border-color: #e5e6e7;
|
||||
color: #333333;
|
||||
background-color: #f1f1f1!important;
|
||||
border-color: #e5e6e7!important;
|
||||
color: #333333!important;
|
||||
}
|
||||
|
||||
.el-tag.el-tag--info .el-tag__close {
|
||||
color: #333333;
|
||||
color: #333333!important;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.el-tag.el-tag--info.is-hit {
|
||||
border-color: #e5e6e7;
|
||||
border-color: #e5e6e7!important;
|
||||
}
|
||||
|
||||
.el-tag.el-tag--info .el-tag__close:hover {
|
||||
@@ -259,120 +246,71 @@ td .el-button.el-button--mini {
|
||||
border-top-color: #676a6c;
|
||||
}
|
||||
|
||||
.text-link {
|
||||
color: info!important;
|
||||
}
|
||||
|
||||
.text-link:hover {
|
||||
color: info!important;
|
||||
filter: opacity(65%)!important;
|
||||
}
|
||||
|
||||
.text-danger {
|
||||
color: $--color-danger;
|
||||
color: danger;
|
||||
}
|
||||
|
||||
.text-primary {
|
||||
color: $--color-primary;
|
||||
color: primary;
|
||||
}
|
||||
|
||||
.text-info {
|
||||
color: $--color-info;
|
||||
color: info;
|
||||
}
|
||||
|
||||
.text-warning {
|
||||
color: $--color-warning;
|
||||
color: warning;
|
||||
}
|
||||
|
||||
.text-success {
|
||||
color: $--color-success;
|
||||
color: success;
|
||||
}
|
||||
|
||||
.el-radio__input.is-checked+.el-radio__label {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.el-radio__input.is-checked .el-radio__inner {
|
||||
border-color: #409EFF;
|
||||
background-color: #409EFF;
|
||||
}
|
||||
|
||||
.el-checkbox__input.is-checked .el-checkbox__inner {
|
||||
border-color: #409EFF;
|
||||
background-color: #409EFF;
|
||||
}
|
||||
|
||||
.el-radio__inner:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.el-textarea__inner {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner {
|
||||
border-color: #409EFF;
|
||||
background-color: #409EFF;
|
||||
}
|
||||
|
||||
.el-checkbox__input.is-checked+.el-checkbox__label {
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.el-checkbox__inner:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.el-checkbox__input.is-focus .el-checkbox__inner {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.el-pagination.is-background .btn-next, .el-pagination.is-background .btn-prev, .el-pagination.is-background .el-pager li {
|
||||
margin: 0 5px;
|
||||
background-color: white;
|
||||
color: #606266;
|
||||
min-width: 28px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #DCDFE6;
|
||||
font-size: 12px;
|
||||
line-height: 26px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.el-pagination.is-background .el-pager li:not(.disabled):hover {
|
||||
color: white;
|
||||
background-color: $--color-primary;
|
||||
}
|
||||
|
||||
.el-pagination.is-background .number {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-card.primary .el-card__header {
|
||||
background-color: primary;
|
||||
}
|
||||
|
||||
.el-card.success .el-card__header {
|
||||
background-color: success;
|
||||
}
|
||||
|
||||
.el-card.info .el-card__header {
|
||||
background-color: info;
|
||||
}
|
||||
|
||||
.el-card.warning .el-card__header {
|
||||
background-color: warning;
|
||||
}
|
||||
|
||||
.el-card.danger .el-card__header {
|
||||
background-color: danger;
|
||||
}
|
||||
|
||||
.el-message-box__headerbtn .el-message-box__close {
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.el-card.primary {
|
||||
.el-card__header {
|
||||
background-color: $--color-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.el-card.success {
|
||||
.el-card__header {
|
||||
background-color: $--color-success;
|
||||
}
|
||||
}
|
||||
|
||||
.el-card.info {
|
||||
.el-card__header {
|
||||
background-color: $--color-info;
|
||||
}
|
||||
}
|
||||
|
||||
.el-card.warning {
|
||||
.el-card__header {
|
||||
background-color: $--color-warning;
|
||||
}
|
||||
}
|
||||
|
||||
.el-card.danger {
|
||||
.el-card__header {
|
||||
background-color: $--color-danger;
|
||||
}
|
||||
}
|
||||
|
||||
.el-tooltip__popper.is-light {
|
||||
background: #FFF;
|
||||
border: 1px solid #e7eaec;
|
||||
@@ -391,22 +329,13 @@ td .el-button.el-button--mini {
|
||||
border-bottom: 1px solid #e7e7e7 !important;
|
||||
}
|
||||
|
||||
.el-table .cell, .el-table--border td:first-child .cell, .el-table--border th:first-child .cell {
|
||||
.el-table .cell,
|
||||
.el-table td:first-child .cell,
|
||||
.el-table th:first-child .cell {
|
||||
padding-left: 10px;
|
||||
padding-right: 14px;
|
||||
}
|
||||
|
||||
.el-tag--dark.el-tag--info {
|
||||
background-color: #23c6c8;
|
||||
border-color: #23c6c8;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $--color-link !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.el-tag--default.el-tag--dark {
|
||||
background-color: #d1dade;
|
||||
color: #5e5e5e;
|
||||
@@ -417,7 +346,6 @@ a {
|
||||
color: #676a6c;
|
||||
}
|
||||
|
||||
|
||||
.el-table__empty-block {
|
||||
width: 100% !important;
|
||||
}
|
||||
@@ -433,62 +361,146 @@ a {
|
||||
color: #000;
|
||||
font-size: 22px;
|
||||
font-weight: 800;
|
||||
//color: red;
|
||||
}
|
||||
|
||||
.el-tag--default.el-tag--dark {
|
||||
background-color: #d1dade;
|
||||
color: #5e5e5e;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
color: #676a6c;
|
||||
}
|
||||
|
||||
.el-table__empty-block {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-dialog__headerbtn .el-dialog__close {
|
||||
font-size: 21px;
|
||||
font-weight: 700;
|
||||
color: #000;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
.el-dialog__headerbtn:focus .el-dialog__close, .el-dialog__headerbtn:hover .el-dialog__close {
|
||||
color: #000;
|
||||
font-size: 22px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.el-button--danger.is-plain {
|
||||
color: $--color-danger;
|
||||
color: danger;
|
||||
background: #ffffff;
|
||||
border-color: $--color-danger;
|
||||
border-color: danger;
|
||||
}
|
||||
|
||||
.el-button--danger.is-plain.is-disabled,
|
||||
.el-button--danger.is-plain.is-disabled:active,
|
||||
.el-button--danger.is-plain.is-disabled:focus,
|
||||
.el-button--danger.is-plain.is-disabled:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.el-alert .el-alert__description {
|
||||
margin: 1px 0 0;
|
||||
}
|
||||
|
||||
.el-input-group__prepend div.el-select .el-input__inner {
|
||||
color: $--color-text-primary;
|
||||
}
|
||||
|
||||
.el-input-group__prepend div.el-select .el-input__inner:hover {
|
||||
color: $--color-text-primary;
|
||||
}
|
||||
|
||||
.el-table {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.el-table-filter__list-item:hover {
|
||||
color: $--color-text-primary;
|
||||
}
|
||||
|
||||
|
||||
.el-dialog {
|
||||
// 居中弹框
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin: 0 !important;
|
||||
transform: translate(-50%, -50%);
|
||||
// 防止超出视窗
|
||||
max-height: calc(100% - 30px);
|
||||
max-width: calc(100% - 30px);
|
||||
//实现body内部滚动
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.el-dialog__body {
|
||||
max-height: 90vh;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.el-button--text {
|
||||
color: $--color-link;
|
||||
padding: 5px;
|
||||
.el-dialog .el-dialog__body {
|
||||
max-height: 90vh;
|
||||
overflow: auto;
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.el-button--text:hover {
|
||||
color: $--color-link-highlight;
|
||||
background-color: rgba(0,0,0,.05)
|
||||
.el-dialog .el-dialog__body form {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.el-dialog .el-dialog__footer {
|
||||
padding: 10px 30px 30px;
|
||||
}
|
||||
|
||||
.el-cascader {
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.el-input__icon {
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.el-checkbox__input.is-checked+.el-checkbox__label {
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.el-select-dropdown__item.selected {
|
||||
font-weight: 400;
|
||||
color: white;
|
||||
background-color: primary;
|
||||
}
|
||||
|
||||
.el-input-group__prepend div.el-select .el-input__inner,
|
||||
.el-input-group__prepend div.el-select .el-input__inner:hover {
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.el-input-group__append, .el-input-group__prepend {
|
||||
color: primary
|
||||
}
|
||||
|
||||
.el-input.is-disabled .el-input__inner {
|
||||
color: $--color-text-primary;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.el-step__description.is-finish {
|
||||
color: #676a6c;
|
||||
}
|
||||
|
||||
.el-alert {
|
||||
border: solid 1px #e7eaec;
|
||||
}
|
||||
|
||||
.el-alert.el-alert--success.is-light {
|
||||
border-color: var(--color-success-light);
|
||||
}
|
||||
|
||||
.el-alert.el-alert--primary.is-light {
|
||||
border-color: var(--color-primary-light);
|
||||
}
|
||||
|
||||
.el-alert.el-alert--info.is-light {
|
||||
border-color: var(--color-info-light);
|
||||
}
|
||||
|
||||
.el-alert.el-alert--warning.is-light {
|
||||
border-color: var(--color-warning-light);
|
||||
}
|
||||
|
||||
.el-alert.el-alert--error.is-light {
|
||||
border-color: var(--color-danger-light);
|
||||
}
|
||||
|
||||
#nprogress .bar {
|
||||
background: light-5!important;
|
||||
}
|
||||
|
||||
#nprogress .peg {
|
||||
box-shadow: 0 0 10px light-5, 0 0 5px light-5!important;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
14
src/App.vue
14
src/App.vue
@@ -1,11 +1,21 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view />
|
||||
<router-view v-if="isRouterAlive" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'App'
|
||||
name: 'App',
|
||||
computed: {
|
||||
...mapState({
|
||||
isRouterAlive: state => state.common.isRouterAlive
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
||||
@@ -40,3 +40,10 @@ export function getCommandFilterList(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getCategoryTypes() {
|
||||
return request({
|
||||
url: '/api/v1/assets/categories/',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function createSourceIdCache(ids) {
|
||||
ids = ids.map(item => {
|
||||
if (typeof item === 'object' && item.id) {
|
||||
return item.id
|
||||
} else {
|
||||
return item
|
||||
}
|
||||
})
|
||||
return request({
|
||||
url: '/api/v1/common/resources/cache/',
|
||||
method: 'post',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function postInterface(formData) {
|
||||
export function updateInterface(formData) {
|
||||
return request({
|
||||
url: '/api/v1/xpack/interface/setting',
|
||||
url: '/api/v1/xpack/interface/setting/',
|
||||
method: 'put',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
@@ -12,15 +12,15 @@ export function postInterface(formData) {
|
||||
}
|
||||
export function getInterfaceInfo() {
|
||||
return request({
|
||||
url: '/api/v1/xpack/interface/setting',
|
||||
url: '/api/v1/xpack/interface/setting/',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function restoreInterface() {
|
||||
return request({
|
||||
url: '/api/v1/xpack/interface/restore',
|
||||
method: 'get'
|
||||
url: '/api/v1/xpack/interface/setting/restore/',
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -34,3 +34,10 @@ export function importLicense(formData) {
|
||||
data: formData
|
||||
})
|
||||
}
|
||||
|
||||
export function previewThemes() {
|
||||
return request({
|
||||
url: `/api/v1/xpack/interface/setting/themes/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getTaskDetail(id) {
|
||||
return request({
|
||||
url: `/api/v1/ops/tasks/${id}/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getAdhocDetail(id) {
|
||||
return request({
|
||||
url: `/api/v1/ops/adhoc/${id}/`,
|
||||
@@ -20,3 +13,42 @@ export function getHistoryExecutionDetail(id) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getTaskDetail(id) {
|
||||
return request({
|
||||
url: `/api/v1/ops/job-execution/task-detail/${id}/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getJob(id) {
|
||||
return request({
|
||||
url: `/api/v1/ops/jobs/${id}/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function uploadPlaybook(form) {
|
||||
return request({
|
||||
url: '/api/v1/ops/playbooks/',
|
||||
method: 'post',
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
data: form
|
||||
})
|
||||
}
|
||||
|
||||
export function renameFile(playbookId, node) {
|
||||
return request({
|
||||
url: `/api/v1/ops/playbook/${playbookId}/file/`,
|
||||
method: 'patch',
|
||||
data: node
|
||||
})
|
||||
}
|
||||
|
||||
export function createJob(form) {
|
||||
return request({
|
||||
url: '/api/v1/ops/jobs/',
|
||||
method: 'post',
|
||||
data: form
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getAssetPermissionDetail(id) {
|
||||
return request({
|
||||
url: `/api/v1/perms/asset-permissions/${id}/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getRemoteAppPermissionDetail(id) {
|
||||
return request({
|
||||
url: `/api/v1/perms/remote-app-permissions/${id}/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getDatabaseAppPermissionDetail(id) {
|
||||
return request({
|
||||
url: `/api/v1/perms/database-app-permissions/${id}/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserAssetGrantedSystemUsers(userId, assetId) {
|
||||
return request({
|
||||
url: `/api/v1/perms/users/${userId}/assets/${assetId}/system-users/?cache_policy=1`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getMyAssetGrantedSystemUsers(userId, assetId) {
|
||||
return request({
|
||||
url: `/api/v1/perms/users/assets/${assetId}/system-users/?cache_policy=1`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserGroupAssetGrantedSystemUsers(gId, assetId) {
|
||||
return request({
|
||||
url: `/api/v1/perms/user-groups/${gId}/assets/${assetId}/system-users/?cache_policy=1`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -8,24 +8,11 @@ export function terminateSession(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getSessionDetail(id) {
|
||||
export function toggleLockSession(data) {
|
||||
return request({
|
||||
url: `/api/v1/terminal/sessions/${id}/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getSessionCommands(id) {
|
||||
return request({
|
||||
url: `/api/v1/terminal/commands/?session_id=${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getTerminalDetail(id) {
|
||||
return request({
|
||||
url: `/api/v1/terminal/terminals/${id}/`,
|
||||
method: 'get'
|
||||
url: '/api/v1/terminal/tasks/toggle-lock-session/',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +25,28 @@ export function importLicense(formData) {
|
||||
data: formData
|
||||
})
|
||||
}
|
||||
export function testLdapSetting(data) {
|
||||
return request({
|
||||
disableFlashErrorMsg: true,
|
||||
url: '/api/v1/settings/ldap/testing/config/',
|
||||
method: 'post',
|
||||
data: data
|
||||
export function testLdapSetting(data, refresh = true) {
|
||||
let url = '/api/v1/settings/ldap/testing/config/'
|
||||
if (refresh) {
|
||||
url = url + '?refresh=1'
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
disableFlashErrorMsg: true,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data: data
|
||||
}).then(res => {
|
||||
if (res.status !== 'running') {
|
||||
resolve(res)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
resolve(testLdapSetting(data, false))
|
||||
}, 1000)
|
||||
}
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -82,7 +98,7 @@ export function getPublicSettings(isOpen) {
|
||||
}
|
||||
export function getLogo() {
|
||||
return request({
|
||||
url: '/api/v1/xpack/interface/setting',
|
||||
url: '/api/v1/xpack/interface/setting/',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
BIN
src/assets/img/avatar.png
Normal file
BIN
src/assets/img/avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
BIN
src/assets/img/header-profile.png
Executable file → Normal file
BIN
src/assets/img/header-profile.png
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/img/logo_text_green.png
Normal file
BIN
src/assets/img/logo_text_green.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@@ -1,82 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<UserConfirmDialog
|
||||
@UserConfirmDone="getAuthInfo"
|
||||
@UserConfirmCancel="exit"
|
||||
/>
|
||||
<Dialog
|
||||
:title="dialogTitle"
|
||||
:show-confirm="false"
|
||||
:show-cancel="false"
|
||||
:destroy-on-close="true"
|
||||
:width="'50'"
|
||||
:visible.sync="showAuthInfo"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<div>
|
||||
<el-form label-position="right" label-width="80px" :model="authInfo">
|
||||
<el-form-item :label="this.$t('assets.Hostname')">
|
||||
<el-input v-model="account.hostname" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.Username')">
|
||||
<el-input v-model="account['username']" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.Password')">
|
||||
<el-input v-model="authInfo.password" type="password" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('users.SSHKey')">
|
||||
<el-input v-model="authInfo['private_key']" class="item-textarea" type="textarea" show-password />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
import UserConfirmDialog from '@/components/UserConfirmDialog'
|
||||
export default {
|
||||
name: 'ShowSecretInfo',
|
||||
components: {
|
||||
Dialog,
|
||||
UserConfirmDialog
|
||||
},
|
||||
props: {
|
||||
account: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogTitle: this.$t('common.ViewSecret'),
|
||||
authInfo: {},
|
||||
showAuthInfo: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAuthInfo() {
|
||||
const url = `/api/v1/assets/account-secrets/${this.account.id}/`
|
||||
this.$axios.get(url, { disableFlashErrorMsg: true }).then(resp => {
|
||||
this.authInfo = resp
|
||||
this.showAuthInfo = true
|
||||
})
|
||||
},
|
||||
exit() {
|
||||
this.$emit('update:visible', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.item-textarea >>> .el-textarea__inner {
|
||||
height: 110px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,36 +0,0 @@
|
||||
import { toSafeLocalDateStr } from '@/utils/common'
|
||||
import ChoicesFormatter from '@/components/TableFormatters/ChoicesFormatter'
|
||||
import i18n from '@/i18n/i18n'
|
||||
|
||||
export const connectivityMeta = {
|
||||
label: i18n.t('assets.Reachable'),
|
||||
formatter: ChoicesFormatter,
|
||||
formatterArgs: {
|
||||
iconChoices: {
|
||||
ok: 'fa-check',
|
||||
failed: 'fa-times',
|
||||
unknown: 'fa-circle-o'
|
||||
},
|
||||
classChoices: {
|
||||
ok: 'text-primary',
|
||||
failed: 'text-danger',
|
||||
unknown: 'text-warning'
|
||||
},
|
||||
hasTips: true,
|
||||
getTips: ({ row, cellValue }) => {
|
||||
const mapper = {
|
||||
'ok': i18n.t('assets.Reachable'),
|
||||
'failed': i18n.t('assets.Unreachable'),
|
||||
'unknown': i18n.t('assets.Unknown')
|
||||
}
|
||||
let tips = mapper[cellValue]
|
||||
if (row['date_verified']) {
|
||||
const datetime = toSafeLocalDateStr(row['date_verified'])
|
||||
tips += '<br> ' + datetime
|
||||
}
|
||||
return tips
|
||||
}
|
||||
},
|
||||
width: '90px',
|
||||
align: 'center'
|
||||
}
|
||||
@@ -1,198 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||
<ShowSecretInfo v-if="showViewSecretDialog" :visible.sync="showViewSecretDialog" :account="account" />
|
||||
<UpdateSecretInfo v-if="showUpdateSecretDialog" :visible.sync="showUpdateSecretDialog" :account="account" @updateAuthDone="onUpdateAuthDone" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ListTable from '@/components/ListTable/index'
|
||||
import { ActionsFormatter, DetailFormatter, DisplayFormatter } from '@/components/TableFormatters'
|
||||
import ShowSecretInfo from './ShowSecretInfo'
|
||||
import UpdateSecretInfo from './UpdateSecretInfo'
|
||||
import { connectivityMeta } from './const'
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
|
||||
export default {
|
||||
name: 'AccountListTable',
|
||||
components: {
|
||||
ListTable,
|
||||
UpdateSecretInfo,
|
||||
ShowSecretInfo
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
exportUrl: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.url.replace('/assets/accounts/', '/assets/account-secrets/')
|
||||
}
|
||||
},
|
||||
hasLeftActions: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
otherActions: {
|
||||
type: Array,
|
||||
default: null
|
||||
},
|
||||
hasClone: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
showViewSecretDialog: false,
|
||||
showUpdateSecretDialog: false,
|
||||
account: {},
|
||||
tableConfig: {
|
||||
url: this.url,
|
||||
permissions: {
|
||||
app: 'assets',
|
||||
resource: 'authbook'
|
||||
},
|
||||
columns: [
|
||||
'hostname', 'ip', 'username', 'version', 'connectivity',
|
||||
'systemuser', 'date_created', 'date_updated', 'actions'
|
||||
],
|
||||
columnsShow: {
|
||||
min: ['username', 'actions'],
|
||||
default: ['hostname', 'ip', 'username', 'version', 'actions']
|
||||
},
|
||||
columnsMeta: {
|
||||
hostname: {
|
||||
prop: 'hostname',
|
||||
label: this.$t('assets.Hostname'),
|
||||
showOverflowTooltip: true,
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
can: this.$hasPerm('assets.view_asset'),
|
||||
getRoute({ row }) {
|
||||
return {
|
||||
name: 'AssetDetail',
|
||||
params: { id: row.asset }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
ip: {
|
||||
width: '120px'
|
||||
},
|
||||
username: {
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
systemuser: {
|
||||
formatter: DisplayFormatter
|
||||
},
|
||||
version: {
|
||||
width: '70px'
|
||||
},
|
||||
connectivity: connectivityMeta,
|
||||
actions: {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: false, // can set function(row, value)
|
||||
hasDelete: false, // can set function(row, value)
|
||||
hasClone: this.hasClone,
|
||||
moreActionsTitle: this.$t('common.More'),
|
||||
extraActions: [
|
||||
{
|
||||
name: 'View',
|
||||
title: this.$t('common.View'),
|
||||
can: this.$hasPerm('assets.view_assetaccountsecret'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
vm.account = row
|
||||
vm.showViewSecretDialog = true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
title: this.$t('common.Delete'),
|
||||
can: this.$hasPerm('assets.delete_authbook'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
this.$axios.delete(`/api/v1/assets/accounts/${row.id}/`).then(() => {
|
||||
this.$message.success(this.$tc('common.deleteSuccessMsg'))
|
||||
this.$refs.ListTable.reloadTable()
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Test',
|
||||
title: this.$t('common.Test'),
|
||||
can: this.$hasPerm('assets.test_authbook'),
|
||||
callback: ({ row }) => {
|
||||
this.$axios.post(
|
||||
`/api/v1/assets/accounts/${row.id}/verify/`,
|
||||
{ action: 'test' }
|
||||
).then(res => {
|
||||
openTaskPage(res['task'])
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
title: this.$t('common.Update'),
|
||||
can: this.$hasPerm('assets.change_assetaccountsecret') && !this.$store.getters.currentOrgIsRoot,
|
||||
callback: ({ row }) => {
|
||||
vm.account = row
|
||||
vm.showUpdateSecretDialog = false
|
||||
setTimeout(() => {
|
||||
vm.showUpdateSecretDialog = true
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: this.hasLeftActions,
|
||||
hasMoreActions: true,
|
||||
hasCreate: false,
|
||||
hasImport: false,
|
||||
hasExport: this.$hasPerm('assets.view_assetaccountsecret'),
|
||||
exportOptions: {
|
||||
url: this.exportUrl,
|
||||
mfaVerifyRequired: true
|
||||
},
|
||||
searchConfig: {
|
||||
exclude: ['systemuser', 'asset']
|
||||
},
|
||||
hasSearch: true
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
url(iNew) {
|
||||
this.$set(this.tableConfig, 'url', iNew)
|
||||
this.$set(this.headerActions.exportOptions, 'url', iNew.replace('/accounts/', '/account-secrets/'))
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.otherActions) {
|
||||
const actionColumn = this.tableConfig.columns[this.tableConfig.columns.length - 1]
|
||||
for (const item of this.otherActions) {
|
||||
actionColumn.formatterArgs.extraActions.push(item)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onUpdateAuthDone(account) {
|
||||
Object.assign(this.account, account)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
|
||||
</style>
|
||||
@@ -18,16 +18,16 @@ export default {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
moreActionBtn: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
moreActionsTitle: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('common.MoreActions')
|
||||
}
|
||||
},
|
||||
moreActionsType: {
|
||||
type: String,
|
||||
default: 'default'
|
||||
},
|
||||
moreActionsPlacement: {
|
||||
type: String,
|
||||
default: 'bottom'
|
||||
@@ -43,14 +43,21 @@ export default {
|
||||
return actions
|
||||
},
|
||||
iMoreAction() {
|
||||
return {
|
||||
const defaultBtn = {
|
||||
name: 'moreActions',
|
||||
title: this.iMoreActionsTitle,
|
||||
title: this.$t('common.MoreActions'),
|
||||
type: 'primary',
|
||||
plain: true
|
||||
}
|
||||
const btn = {
|
||||
...defaultBtn,
|
||||
...this.moreActionBtn,
|
||||
dropdown: this.moreActions || []
|
||||
}
|
||||
},
|
||||
iMoreActionsTitle() {
|
||||
return this.moreActionsTitle || this.$t('common.MoreActions')
|
||||
if (this.moreActionsTitle) {
|
||||
btn.title = this.moreActionsTitle
|
||||
}
|
||||
return btn
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<UserConfirmDialog
|
||||
@UserConfirmDone="getAuthInfo"
|
||||
@UserConfirmCancel="exit"
|
||||
/>
|
||||
<Dialog
|
||||
:title="dialogTitle"
|
||||
:show-confirm="false"
|
||||
:show-cancel="false"
|
||||
:destroy-on-close="true"
|
||||
:width="'50'"
|
||||
:visible.sync="showAuthInfo"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<div>
|
||||
<el-form label-position="right" label-width="80px" :model="authInfo">
|
||||
<el-form-item :label="this.$t('applications.appName')">
|
||||
<el-input v-model="account['app_display']" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.Username')">
|
||||
<el-input v-model="account['username']" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.Password')">
|
||||
<el-input v-model="authInfo.password" type="password" show-password />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
import UserConfirmDialog from '@/components/UserConfirmDialog'
|
||||
export default {
|
||||
name: 'ShowSecretInfo',
|
||||
components: {
|
||||
Dialog,
|
||||
UserConfirmDialog
|
||||
},
|
||||
props: {
|
||||
account: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogTitle: this.$t('common.ViewSecret'),
|
||||
authInfo: {},
|
||||
showAuthInfo: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAuthInfo() {
|
||||
const url = `/api/v1/applications/account-secrets/${this.account.id}/`
|
||||
this.$axios.get(url, { disableFlashErrorMsg: true }).then(resp => {
|
||||
this.authInfo = resp
|
||||
this.showAuthInfo = true
|
||||
})
|
||||
},
|
||||
exit() {
|
||||
this.$emit('update:visible', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,31 +0,0 @@
|
||||
import { ChoicesFormatter } from '@/components/TableFormatters'
|
||||
import { toSafeLocalDateStr } from '@/utils/common'
|
||||
import i18n from '@/i18n/i18n'
|
||||
|
||||
export const connectivityMeta = {
|
||||
label: i18n.t('assets.Reachable'),
|
||||
formatter: ChoicesFormatter,
|
||||
formatterArgs: {
|
||||
iconChoices: {
|
||||
ok: 'fa-check text-primary',
|
||||
failed: 'fa-times text-danger',
|
||||
unknown: 'fa-circle text-warning'
|
||||
},
|
||||
hasTips: true,
|
||||
getTips: ({ row, cellValue }) => {
|
||||
const mapper = {
|
||||
'ok': i18n.t('assets.Reachable'),
|
||||
'failed': i18n.t('assets.Unreachable'),
|
||||
'unknown': i18n.t('assets.Unknown')
|
||||
}
|
||||
let tips = mapper[cellValue]
|
||||
if (row['date_verified']) {
|
||||
const datetime = toSafeLocalDateStr(row['date_verified'])
|
||||
tips += '<br> ' + datetime
|
||||
}
|
||||
return tips
|
||||
}
|
||||
},
|
||||
width: '90px',
|
||||
align: 'center'
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||
<ShowSecretInfo v-if="showViewSecretDialog" :visible.sync="showViewSecretDialog" :account="account" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ListTable from '@/components/ListTable/index'
|
||||
import { ActionsFormatter, DetailFormatter } from '@/components/TableFormatters'
|
||||
import ShowSecretInfo from './ShowSecretInfo'
|
||||
|
||||
export default {
|
||||
name: 'Detail',
|
||||
components: {
|
||||
ListTable,
|
||||
ShowSecretInfo
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
exportUrl: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.url.replace('/applications/accounts/', '/applications/account-secrets/')
|
||||
}
|
||||
},
|
||||
hasLeftActions: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
otherActions: {
|
||||
type: Array,
|
||||
default: null
|
||||
},
|
||||
hasClone: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
systemUserDisabled: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showViewSecretDialog: false,
|
||||
showUpdateSecretDialog: false,
|
||||
account: {},
|
||||
tableConfig: {
|
||||
url: this.url,
|
||||
columns: [
|
||||
'app_display', 'username', 'category_display',
|
||||
'type_display', 'systemuser', 'actions'
|
||||
],
|
||||
columnsMeta: {
|
||||
app_display: {
|
||||
showOverflowTooltip: true,
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
getRoute({ row }) {
|
||||
switch (row['category']) {
|
||||
case 'remote_app':
|
||||
return {
|
||||
name: 'RemoteAppDetail',
|
||||
params: { id: row.app }
|
||||
}
|
||||
case 'db':
|
||||
return {
|
||||
name: 'DatabaseAppDetail',
|
||||
params: { id: row.app }
|
||||
}
|
||||
default:
|
||||
return {
|
||||
name: 'KubernetesAppDetail',
|
||||
params: { id: row.app }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
username: {
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
systemuser: {
|
||||
showOverflowTooltip: true,
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
can: this.systemUserDisabled && this.$hasPerm('assets.view_systemuser'),
|
||||
getTitle({ row }) {
|
||||
return row.systemuser_display
|
||||
},
|
||||
getRoute({ row }) {
|
||||
return {
|
||||
name: 'SystemUserDetail',
|
||||
params: { id: row.systemuser }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: false, // can set function(row, value)
|
||||
hasDelete: false, // can set function(row, value)
|
||||
hasClone: this.hasClone,
|
||||
moreActionsTitle: this.$t('common.More'),
|
||||
extraActions: [
|
||||
{
|
||||
name: 'View',
|
||||
title: this.$t('common.View'),
|
||||
type: 'primary',
|
||||
can: this.$hasPerm('applications.view_applicationaccountsecret'),
|
||||
callback: function({ row }) {
|
||||
this.account = row
|
||||
this.showViewSecretDialog = true
|
||||
}.bind(this)
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
title: this.$t('common.Update'),
|
||||
can: !this.$store.getters.currentOrgIsRoot,
|
||||
callback: function({ row }) {
|
||||
this.$message.success(this.$tc('applications.updateAccountMsg'))
|
||||
}.bind(this)
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: this.hasLeftActions,
|
||||
hasMoreActions: false,
|
||||
hasImport: false,
|
||||
hasExport: this.$hasPerm('applications.view_applicationaccountsecret'),
|
||||
exportOptions: {
|
||||
url: this.exportUrl,
|
||||
mfaVerifyRequired: true
|
||||
},
|
||||
searchConfig: {
|
||||
exclude: ['systemuser', 'app']
|
||||
},
|
||||
hasSearch: true
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
url(iNew) {
|
||||
this.$set(this.tableConfig, 'url', iNew)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.otherActions) {
|
||||
const actionColumn = this.tableConfig.columns[this.tableConfig.columns.length - 1]
|
||||
for (const item of this.otherActions) {
|
||||
actionColumn.formatterArgs.extraActions.push(item)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onUpdateAuthDone(account) {
|
||||
Object.assign(this.account, account)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
|
||||
</style>
|
||||
325
src/components/Apps/AccountCreateUpdateForm/index.vue
Normal file
325
src/components/Apps/AccountCreateUpdateForm/index.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<template>
|
||||
<AutoDataForm
|
||||
v-if="!loading"
|
||||
ref="AutoDataForm"
|
||||
v-bind="$data"
|
||||
@submit="confirm"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AutoDataForm from '@/components/Form/AutoDataForm/index.vue'
|
||||
import { UpdateToken, UploadSecret } from '@/components/Form/FormFields'
|
||||
import Select2 from '@/components/Form/FormFields/Select2.vue'
|
||||
import AssetSelect from '@/components/Apps/AssetSelect/index.vue'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
import { Required, RequiredChange } from '@/components/Form/DataForm/rules'
|
||||
import AutomationParamsForm from '@/views/assets/Platform/AutomationParamsSetting.vue'
|
||||
|
||||
export default {
|
||||
name: 'AccountCreateForm',
|
||||
components: {
|
||||
AutoDataForm
|
||||
},
|
||||
props: {
|
||||
asset: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
platform: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
account: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
// 默认组件密码加密
|
||||
encryptPassword: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
addTemplate: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
usernameChanged: false,
|
||||
defaultPrivilegedAccounts: ['root', 'administrator'],
|
||||
iPlatform: {
|
||||
automation: {},
|
||||
su_enabled: false,
|
||||
protocols: [
|
||||
{
|
||||
name: 'ssh',
|
||||
secret_types: ['password', 'ssh_key', 'token', 'access_key', 'api_key']
|
||||
}
|
||||
]
|
||||
},
|
||||
url: '/api/v1/accounts/accounts/',
|
||||
form: Object.assign({ 'on_invalid': 'error' }, this.account || {}),
|
||||
encryptedFields: ['secret'],
|
||||
fields: [
|
||||
[this.$t('assets.Asset'), ['assets']],
|
||||
[this.$t('accounts.AccountTemplate'), ['template']],
|
||||
[this.$t('common.Basic'), ['name', 'username', 'privileged', 'su_from', 'su_from_username']],
|
||||
[this.$t('assets.Secret'), [
|
||||
'secret_type', 'password', 'ssh_key', 'token',
|
||||
'access_key', 'passphrase', 'api_key'
|
||||
]],
|
||||
[this.$t('common.Other'), ['push_now', 'params', 'on_invalid', 'is_active', 'comment']]
|
||||
],
|
||||
fieldsMeta: {
|
||||
assets: {
|
||||
rules: [Required],
|
||||
component: AssetSelect,
|
||||
label: this.$t('assets.Asset'),
|
||||
el: {
|
||||
multiple: false
|
||||
},
|
||||
hidden: () => {
|
||||
return this.platform || this.asset
|
||||
}
|
||||
},
|
||||
template: {
|
||||
component: Select2,
|
||||
rules: [Required],
|
||||
el: {
|
||||
multiple: false,
|
||||
ajax: {
|
||||
url: '/api/v1/accounts/account-templates/',
|
||||
transformOption: (item) => {
|
||||
return { label: item.name, value: item.id }
|
||||
}
|
||||
}
|
||||
},
|
||||
hidden: () => {
|
||||
return this.platform || this.asset || !this.addTemplate
|
||||
}
|
||||
},
|
||||
on_invalid: {
|
||||
rules: [Required],
|
||||
label: this.$t('accounts.AccountPolicy'),
|
||||
helpText: this.$t('accounts.BulkCreateStrategy'),
|
||||
hidden: () => {
|
||||
return this.platform || this.asset
|
||||
}
|
||||
},
|
||||
name: {
|
||||
rules: [RequiredChange],
|
||||
on: {
|
||||
input: ([value], updateForm) => {
|
||||
if (!this.usernameChanged) {
|
||||
if (!this.account?.name) {
|
||||
updateForm({ username: value })
|
||||
}
|
||||
const maybePrivileged = this.defaultPrivilegedAccounts.includes(value)
|
||||
if (maybePrivileged) {
|
||||
updateForm({ privileged: true })
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
hidden: () => {
|
||||
return this.addTemplate
|
||||
}
|
||||
},
|
||||
username: {
|
||||
el: {
|
||||
disabled: !!this.account?.name
|
||||
},
|
||||
on: {
|
||||
input: ([value], updateForm) => {
|
||||
this.usernameChanged = true
|
||||
},
|
||||
change: ([value], updateForm) => {
|
||||
const maybePrivileged = this.defaultPrivilegedAccounts.includes(value)
|
||||
if (maybePrivileged) {
|
||||
updateForm({ privileged: true })
|
||||
}
|
||||
}
|
||||
},
|
||||
hidden: () => {
|
||||
return this.addTemplate
|
||||
}
|
||||
},
|
||||
privileged: {
|
||||
hidden: () => {
|
||||
return this.addTemplate
|
||||
}
|
||||
},
|
||||
su_from: {
|
||||
component: Select2,
|
||||
hidden: (formValue) => {
|
||||
return !this.asset?.id || !this.iPlatform.su_enabled
|
||||
},
|
||||
el: {
|
||||
multiple: false,
|
||||
clearable: true,
|
||||
ajax: {
|
||||
url: `/api/v1/accounts/accounts/su-from-accounts/?account=${this.account?.id || ''}&asset=${this.asset?.id || ''}`,
|
||||
transformOption: (item) => {
|
||||
return { label: `${item.name}(${item.username})`, value: item.id }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
su_from_username: {
|
||||
label: this.$t('assets.UserSwitchFrom'),
|
||||
hidden: (formValue) => {
|
||||
return this.platform || this.asset || this.addTemplate
|
||||
}
|
||||
},
|
||||
password: {
|
||||
label: this.$t('assets.Password'),
|
||||
component: UpdateToken,
|
||||
hidden: (formValue) => formValue.secret_type !== 'password' || this.addTemplate
|
||||
},
|
||||
ssh_key: {
|
||||
label: this.$t('assets.PrivateKey'),
|
||||
component: UploadSecret,
|
||||
hidden: (formValue) => formValue.secret_type !== 'ssh_key' || this.addTemplate
|
||||
},
|
||||
passphrase: {
|
||||
label: this.$t('assets.Passphrase'),
|
||||
component: UpdateToken,
|
||||
hidden: (formValue) => formValue.secret_type !== 'ssh_key' || this.addTemplate
|
||||
},
|
||||
token: {
|
||||
label: this.$t('assets.Token'),
|
||||
component: UploadSecret,
|
||||
hidden: (formValue) => formValue.secret_type !== 'token' || this.addTemplate
|
||||
},
|
||||
access_key: {
|
||||
id: 'access_key',
|
||||
label: this.$t('assets.AccessKey'),
|
||||
component: UploadSecret,
|
||||
hidden: (formValue) => formValue.secret_type !== 'access_key' || this.addTemplate
|
||||
},
|
||||
api_key: {
|
||||
id: 'api_key',
|
||||
label: this.$t('assets.ApiKey'),
|
||||
component: UploadSecret,
|
||||
hidden: (formValue) => formValue.secret_type !== 'api_key' || this.addTemplate
|
||||
},
|
||||
secret_type: {
|
||||
type: 'radio-group',
|
||||
options: [],
|
||||
hidden: () => {
|
||||
return this.addTemplate
|
||||
}
|
||||
},
|
||||
push_now: {
|
||||
helpText: this.$t('accounts.AccountPush.WindowsPushHelpText'),
|
||||
hidden: (formValue) => {
|
||||
const automation = this.iPlatform.automation || {}
|
||||
return !automation.push_account_enabled ||
|
||||
!automation.ansible_enabled ||
|
||||
!this.$hasPerm('accounts.push_account') ||
|
||||
(formValue.secret_type === 'ssh_key' && this.iPlatform.type.value === 'windows') ||
|
||||
this.addTemplate
|
||||
}
|
||||
},
|
||||
params: {
|
||||
label: this.$t('assets.PushParams'),
|
||||
component: AutomationParamsForm,
|
||||
el: {
|
||||
method: this.asset?.auto_config?.push_account_method
|
||||
},
|
||||
hidden: (formValue) => {
|
||||
const automation = this.iPlatform.automation || {}
|
||||
return !formValue.push_now ||
|
||||
!automation.push_account_enabled ||
|
||||
!automation.ansible_enabled ||
|
||||
!this.$hasPerm('accounts.push_account') ||
|
||||
this.addTemplate
|
||||
}
|
||||
},
|
||||
comment: {
|
||||
hidden: () => {
|
||||
return this.addTemplate
|
||||
}
|
||||
}
|
||||
},
|
||||
hasSaveContinue: false
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
try {
|
||||
await this.getPlatform()
|
||||
this.setSecretTypeOptions()
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getPlatform() {
|
||||
if (this.platform) {
|
||||
this.iPlatform = this.platform
|
||||
}
|
||||
if (!this.asset || !this.asset.platform) {
|
||||
return
|
||||
}
|
||||
const platformId = this.asset.platform.id
|
||||
this.iPlatform = await this.$axios.get(`/api/v1/assets/platforms/${platformId}/`)
|
||||
},
|
||||
setSecretTypeOptions() {
|
||||
const choices = [
|
||||
{
|
||||
label: this.$t('assets.Password'),
|
||||
value: 'password'
|
||||
},
|
||||
{
|
||||
label: this.$t('assets.SSHKey'),
|
||||
value: 'ssh_key'
|
||||
},
|
||||
{
|
||||
label: this.$t('assets.Token'),
|
||||
value: 'token'
|
||||
},
|
||||
{
|
||||
label: this.$t('assets.AccessKey'),
|
||||
value: 'access_key'
|
||||
},
|
||||
{
|
||||
label: this.$t('assets.ApiKey'),
|
||||
value: 'api_key'
|
||||
}
|
||||
]
|
||||
const secretTypes = []
|
||||
this.iPlatform.protocols?.forEach(p => {
|
||||
secretTypes.push(...p['secret_types'])
|
||||
})
|
||||
if (!this.form?.secret_type) {
|
||||
this.form.secret_type = secretTypes[0]
|
||||
}
|
||||
this.fieldsMeta.secret_type.options = choices.filter(item => {
|
||||
return secretTypes.indexOf(item.value) > -1
|
||||
})
|
||||
},
|
||||
confirm(form) {
|
||||
const secretType = form.secret_type || 'password'
|
||||
form.secret = form[secretType]
|
||||
form.secret = this.encryptPassword ? encryptPassword(form.secret) : form.secret
|
||||
|
||||
// 如果不删除会明文显示
|
||||
delete form[secretType]
|
||||
|
||||
if (!form.secret) {
|
||||
delete form['secret']
|
||||
}
|
||||
if (this.account?.name) {
|
||||
this.$emit('edit', form)
|
||||
} else {
|
||||
this.$emit('add', form)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
167
src/components/Apps/AccountListTable/AccountCreateUpdate.vue
Normal file
167
src/components/Apps/AccountListTable/AccountCreateUpdate.vue
Normal file
@@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<GenericCreateUpdateDrawer v-bind="$attrs">
|
||||
<AccountCreateUpdateForm
|
||||
v-if="!loading"
|
||||
ref="form"
|
||||
:account="account"
|
||||
:add-template="addTemplate"
|
||||
:asset="asset"
|
||||
@add="addAccount"
|
||||
@edit="editAccount"
|
||||
/>
|
||||
</GenericCreateUpdateDrawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import GenericCreateUpdateDrawer from '@/layout/components/GenericCreateUpdateDrawer/index.vue'
|
||||
import AccountCreateUpdateForm from '@/components/Apps/AccountCreateUpdateForm/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'CreateAccountDialog',
|
||||
components: {
|
||||
AccountCreateUpdateForm,
|
||||
GenericCreateUpdateDrawer
|
||||
},
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
addTemplate: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
asset: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
account: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return this.$t('assets.AddAccount')
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
platform: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
protocols() {
|
||||
return this.asset ? this.asset.protocol : []
|
||||
},
|
||||
iVisible: {
|
||||
get() {
|
||||
return this.visible
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:visible', val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addAccount(form) {
|
||||
const formValue = Object.assign({}, form)
|
||||
let data, url, iVisible
|
||||
if (this.asset) {
|
||||
data = {
|
||||
asset: this.asset.id,
|
||||
...formValue
|
||||
}
|
||||
iVisible = false
|
||||
url = `/api/v1/accounts/accounts/`
|
||||
} else {
|
||||
iVisible = true
|
||||
data = formValue
|
||||
url = `/api/v1/accounts/accounts/bulk/`
|
||||
if (data.assets.length === 0) {
|
||||
this.$message.error(this.$tc('assets.PleaseSelectAsset'))
|
||||
return
|
||||
}
|
||||
}
|
||||
this.$axios.post(url, data, {
|
||||
disableFlashErrorMsg: iVisible
|
||||
}).then((data) => {
|
||||
this.handleResult(data, null)
|
||||
this.iVisible = iVisible
|
||||
if (!iVisible) {
|
||||
this.$emit('add', true)
|
||||
}
|
||||
}).catch(error => {
|
||||
this.iVisible = true
|
||||
this.handleResult(null, error)
|
||||
})
|
||||
},
|
||||
editAccount(form) {
|
||||
const data = { ...form }
|
||||
this.$axios.patch(`/api/v1/accounts/accounts/${this.account.id}/`, data).then(() => {
|
||||
this.iVisible = false
|
||||
this.$emit('add', true)
|
||||
this.$message.success(this.$tc('common.updateSuccessMsg'))
|
||||
}).catch(error => this.setFieldError(error))
|
||||
},
|
||||
handleResult(resp, error) {
|
||||
let bulkCreate = !this.asset
|
||||
if (error && !Array.isArray(error?.response?.data)) {
|
||||
bulkCreate = false
|
||||
}
|
||||
if (resp && !Array.isArray(resp)) {
|
||||
bulkCreate = false
|
||||
}
|
||||
if (!bulkCreate) {
|
||||
if (!error) {
|
||||
this.$message.success(this.$tc('common.createSuccessMsg'))
|
||||
} else {
|
||||
this.setFieldError(error)
|
||||
}
|
||||
} else {
|
||||
let result
|
||||
if (error) {
|
||||
result = error.response.data
|
||||
} else {
|
||||
result = resp
|
||||
}
|
||||
this.$emit('bulk-create-done', result)
|
||||
}
|
||||
},
|
||||
setFieldError(error) {
|
||||
const response = error.response
|
||||
const data = response.data
|
||||
const refsAutoDataForm = this.$refs.form.$refs.AutoDataForm
|
||||
if (response.status === 400) {
|
||||
for (const key of Object.keys(data)) {
|
||||
let err = ''
|
||||
let current = key
|
||||
let errorTips = data[current]
|
||||
if (errorTips instanceof Array) {
|
||||
errorTips = _.filter(errorTips, (item) => Object.keys(item).length > 0)
|
||||
for (const i of errorTips) {
|
||||
if (i instanceof Object) {
|
||||
err += i?.port?.join(',')
|
||||
} else {
|
||||
err += errorTips
|
||||
}
|
||||
}
|
||||
} else {
|
||||
err = errorTips
|
||||
}
|
||||
if (current === 'secret') {
|
||||
current = refsAutoDataForm.form.secret_type?.value || key
|
||||
}
|
||||
refsAutoDataForm.setFieldError(current, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
428
src/components/Apps/AccountListTable/AccountList.vue
Normal file
428
src/components/Apps/AccountListTable/AccountList.vue
Normal file
@@ -0,0 +1,428 @@
|
||||
<template>
|
||||
<div>
|
||||
<ListTable ref="ListTable" :header-actions="headerActions" :table-config="tableConfig" />
|
||||
<ViewSecret
|
||||
v-if="showViewSecretDialog"
|
||||
:account="account"
|
||||
:url="secretUrl"
|
||||
:visible.sync="showViewSecretDialog"
|
||||
/>
|
||||
<UpdateSecretInfo
|
||||
v-if="showUpdateSecretDialog"
|
||||
:account="account"
|
||||
:visible.sync="showUpdateSecretDialog"
|
||||
@updateAuthDone="onUpdateAuthDone"
|
||||
/>
|
||||
<AccountCreateUpdate
|
||||
:url="url"
|
||||
:asset="iAsset"
|
||||
:account="account"
|
||||
:add-template="addTemplate"
|
||||
:title="accountCreateUpdateTitle"
|
||||
@add="addAccountSuccess"
|
||||
@bulk-create-done="showBulkCreateResult($event)"
|
||||
/>
|
||||
<ResultDialog
|
||||
v-if="showResultDialog"
|
||||
:result="createAccountResults"
|
||||
:visible.sync="showResultDialog"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ListTable from '@/components/Table/ListTable/index.vue'
|
||||
import { ActionsFormatter } from '@/components/Table/TableFormatters'
|
||||
import ViewSecret from './ViewSecret.vue'
|
||||
import UpdateSecretInfo from './UpdateSecretInfo.vue'
|
||||
import AccountCreateUpdate from './AccountCreateUpdate.vue'
|
||||
import { connectivityMeta } from './const'
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
import ResultDialog from './BulkCreateResultDialog.vue'
|
||||
|
||||
export default {
|
||||
name: 'AccountListTable',
|
||||
components: {
|
||||
ResultDialog,
|
||||
ListTable,
|
||||
UpdateSecretInfo,
|
||||
ViewSecret,
|
||||
AccountCreateUpdate
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
exportUrl: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.url.replace('/accounts/accounts/', '/accounts/account-secrets/')
|
||||
}
|
||||
},
|
||||
hasLeftActions: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
otherActions: {
|
||||
type: Array,
|
||||
default: null
|
||||
},
|
||||
hasClone: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
asset: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
columns: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
hasExport: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
hasImport: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
hasDeleteAction: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
columnsMeta: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
}
|
||||
},
|
||||
columnsDefault: {
|
||||
type: Array,
|
||||
default: () => ([
|
||||
'name', 'username', 'asset', 'privileged',
|
||||
'secret_type', 'is_active', 'date_updated'
|
||||
])
|
||||
},
|
||||
headerExtraActions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
showViewSecretDialog: false,
|
||||
showUpdateSecretDialog: false,
|
||||
showResultDialog: false,
|
||||
showAddDialog: false,
|
||||
showAddTemplateDialog: false,
|
||||
createAccountResults: [],
|
||||
addTemplate: false,
|
||||
accountCreateUpdateTitle: this.$t('assets.AddAccount'),
|
||||
iAsset: this.asset,
|
||||
account: {},
|
||||
secretUrl: '',
|
||||
tableConfig: {
|
||||
url: this.url,
|
||||
permissions: {
|
||||
app: 'assets',
|
||||
resource: 'account'
|
||||
},
|
||||
extraQuery: {
|
||||
order: '-date_updated'
|
||||
},
|
||||
columnsExclude: ['spec_info'],
|
||||
columnsShow: {
|
||||
min: ['name', 'username', 'actions'],
|
||||
default: this.columnsDefault
|
||||
},
|
||||
columnsMeta: {
|
||||
name: {
|
||||
formatter: function(row) {
|
||||
const to = {
|
||||
name: 'AssetAccountDetail',
|
||||
params: { id: row.id }
|
||||
}
|
||||
if (vm.$hasPerm('accounts.view_account')) {
|
||||
return <router-link to={to}>{row.name}</router-link>
|
||||
} else {
|
||||
return <span>{row.name}</span>
|
||||
}
|
||||
}
|
||||
},
|
||||
asset: {
|
||||
label: this.$t('assets.Asset'),
|
||||
formatter: function(row) {
|
||||
const to = {
|
||||
name: 'AssetDetail',
|
||||
params: { id: row.asset.id }
|
||||
}
|
||||
if (vm.$hasPerm('assets.view_asset')) {
|
||||
return <router-link to={to}>{row.asset.name}</router-link>
|
||||
} else {
|
||||
return <span>{row.asset.name}</span>
|
||||
}
|
||||
}
|
||||
},
|
||||
secret_type: {
|
||||
width: '100px',
|
||||
formatter: function(row) {
|
||||
return row.secret_type.label
|
||||
}
|
||||
},
|
||||
source: {
|
||||
formatter: function(row) {
|
||||
return row.source.label
|
||||
}
|
||||
},
|
||||
has_secret: {
|
||||
width: '100px',
|
||||
formatterArgs: {
|
||||
showFalse: false
|
||||
}
|
||||
},
|
||||
privileged: {
|
||||
label: this.$t('assets.Privileged'),
|
||||
width: '120px',
|
||||
formatterArgs: {
|
||||
showText: false,
|
||||
showFalse: false
|
||||
}
|
||||
},
|
||||
connectivity: connectivityMeta,
|
||||
actions: {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: false, // can set function(row, value)
|
||||
hasDelete: false, // can set function(row, value)
|
||||
hasClone: this.hasClone,
|
||||
moreActionsTitle: this.$t('common.More'),
|
||||
extraActions: [
|
||||
{
|
||||
name: 'View',
|
||||
title: this.$t('common.View'),
|
||||
can: this.$hasPerm('accounts.view_accountsecret'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
// debugger
|
||||
vm.secretUrl = `/api/v1/accounts/account-secrets/${row.id}/`
|
||||
vm.account = row
|
||||
vm.showViewSecretDialog = false
|
||||
setTimeout(() => {
|
||||
vm.showViewSecretDialog = true
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'ClearSecret',
|
||||
title: this.$t('common.ClearSecret'),
|
||||
can: this.$hasPerm('accounts.change_account'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
this.$axios.patch(
|
||||
`/api/v1/accounts/accounts/clear-secret/`,
|
||||
{ account_ids: [row.id] }
|
||||
).then(() => {
|
||||
this.$message.success(this.$tc('common.ClearSuccessMsg'))
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Test',
|
||||
title: this.$t('common.Test'),
|
||||
can: ({ row }) =>
|
||||
!this.$store.getters.currentOrgIsRoot &&
|
||||
this.$hasPerm('accounts.change_account') &&
|
||||
row.asset['auto_config'].ansible_enabled &&
|
||||
row.asset['auto_config'].ping_enabled,
|
||||
callback: ({ row }) => {
|
||||
this.$axios.post(
|
||||
`/api/v1/accounts/accounts/tasks/`,
|
||||
{ action: 'verify', accounts: [row.id] }
|
||||
).then(res => {
|
||||
openTaskPage(res['task'])
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
title: this.$t('common.Update'),
|
||||
can: this.$hasPerm('accounts.change_account') && !this.$store.getters.currentOrgIsRoot,
|
||||
callback: ({ row, col }) => {
|
||||
const data = {
|
||||
...this.asset,
|
||||
...row.asset
|
||||
}
|
||||
vm.account = row
|
||||
vm.iAsset = data
|
||||
vm.showAddDialog = false
|
||||
vm.addTemplate = false
|
||||
vm.accountCreateUpdateTitle = this.$t('assets.UpdateAccount')
|
||||
setTimeout(() => {
|
||||
vm.$eventBus.$emit('showCreateUpdateDrawer', 'update', { url: this.url, row, col })
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
...this.columnsMeta
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: this.hasLeftActions,
|
||||
hasMoreActions: true,
|
||||
hasCreate: false,
|
||||
hasImport: this.hasImport,
|
||||
hasExport: this.hasExport && this.$hasPerm('accounts.view_accountsecret'),
|
||||
handleImportClick: ({ selectedRows }) => {
|
||||
this.$eventBus.$emit('showImportDialog', {
|
||||
selectedRows,
|
||||
url: '/api/v1/accounts/accounts/',
|
||||
name: this?.name
|
||||
})
|
||||
},
|
||||
exportOptions: {
|
||||
url: this.exportUrl,
|
||||
mfaVerifyRequired: true,
|
||||
tips: this.$t('accounts.AccountExportTips')
|
||||
},
|
||||
importOptions: {
|
||||
canImportCreate: this.$hasPerm('accounts.add_account'),
|
||||
canImportUpdate: this.$hasPerm('accounts.change_account')
|
||||
},
|
||||
extraActions: [
|
||||
{
|
||||
name: 'add',
|
||||
title: this.$t('common.Add'),
|
||||
type: 'primary',
|
||||
can: () => {
|
||||
return vm.$hasPerm('accounts.add_account') && !this.$store.getters.currentOrgIsRoot
|
||||
},
|
||||
callback: async() => {
|
||||
await this.getAssetDetail()
|
||||
setTimeout(() => {
|
||||
vm.iAsset = this.asset
|
||||
vm.account = {}
|
||||
vm.addTemplate = false
|
||||
vm.accountCreateUpdateTitle = this.$t('assets.AddAccount')
|
||||
vm.$eventBus.$emit('showCreateUpdateDrawer', 'create', { url: vm.url })
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'add-template',
|
||||
title: this.$t('common.TemplateAdd'),
|
||||
has: !(this.platform || this.asset),
|
||||
can: () => {
|
||||
return vm.$hasPerm('accounts.add_account') && !this.$store.getters.currentOrgIsRoot
|
||||
},
|
||||
callback: async() => {
|
||||
await this.getAssetDetail()
|
||||
setTimeout(() => {
|
||||
vm.iAsset = this.asset
|
||||
vm.account = {}
|
||||
vm.addTemplate = true
|
||||
vm.accountCreateUpdateTitle = this.$t('assets.AddAccount')
|
||||
vm.$eventBus.$emit('showCreateUpdateDrawer', 'create', { url: vm.url })
|
||||
})
|
||||
}
|
||||
},
|
||||
...this.headerExtraActions
|
||||
],
|
||||
extraMoreActions: [
|
||||
{
|
||||
name: 'ClearSecrets',
|
||||
title: this.$t('common.ClearSecret'),
|
||||
type: 'primary',
|
||||
fa: 'clean',
|
||||
can: ({ selectedRows }) => {
|
||||
return selectedRows.length > 0 && vm.$hasPerm('accounts.change_account')
|
||||
},
|
||||
callback: function({ selectedRows }) {
|
||||
const ids = selectedRows.map(v => { return v.id })
|
||||
this.$axios.patch(
|
||||
'/api/v1/accounts/accounts/clear-secret/',
|
||||
{ account_ids: ids }).then(() => {
|
||||
this.$message.success(this.$tc('common.ClearSuccessMsg'))
|
||||
}).catch(err => {
|
||||
this.$message.error(this.$tc('common.bulkClearErrorMsg' + ' ' + err))
|
||||
})
|
||||
}.bind(this)
|
||||
}
|
||||
],
|
||||
canBulkDelete: vm.$hasPerm('accounts.delete_account'),
|
||||
searchConfig: {
|
||||
getUrlQuery: false,
|
||||
exclude: ['asset']
|
||||
},
|
||||
hasSearch: true
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
url(iNew) {
|
||||
this.$set(this.tableConfig, 'url', iNew)
|
||||
this.$set(this.headerActions.exportOptions, 'url', iNew.replace(/(.*)accounts/, '$1account-secrets'))
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.columns.length > 0) {
|
||||
this.tableConfig.columns = this.columns
|
||||
}
|
||||
if (this.otherActions) {
|
||||
const actionColumn = this.tableConfig.columns[this.tableConfig.columns.length - 1]
|
||||
for (const item of this.otherActions) {
|
||||
actionColumn.formatterArgs.extraActions.push(item)
|
||||
}
|
||||
}
|
||||
if (this.hasDeleteAction) {
|
||||
this.tableConfig.columnsMeta.actions.formatterArgs.extraActions.push(
|
||||
{
|
||||
name: 'Delete',
|
||||
title: this.$t('common.Delete'),
|
||||
can: this.$hasPerm('accounts.delete_account'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
this.$axios.delete(`/api/v1/accounts/accounts/${row.id}/`).then(() => {
|
||||
this.$message.success(this.$tc('common.deleteSuccessMsg'))
|
||||
this.$refs.ListTable.reloadTable()
|
||||
})
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onUpdateAuthDone(account) {
|
||||
Object.assign(this.account, account)
|
||||
},
|
||||
addAccountSuccess() {
|
||||
this.$refs.ListTable.reloadTable()
|
||||
},
|
||||
async getAssetDetail() {
|
||||
const { query: { asset }} = this.$route
|
||||
if (asset) {
|
||||
this.iAsset = await this.$axios.get(`/api/v1/assets/assets/${asset}/`)
|
||||
}
|
||||
},
|
||||
refresh() {
|
||||
this.$refs.ListTable.reloadTable()
|
||||
},
|
||||
showBulkCreateResult(results) {
|
||||
this.showResultDialog = false
|
||||
this.createAccountResults = results
|
||||
setTimeout(() => {
|
||||
this.showResultDialog = true
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.cell a {
|
||||
color: var(--color-info);
|
||||
}
|
||||
</style>
|
||||
120
src/components/Apps/AccountListTable/BulkCreateResultDialog.vue
Normal file
120
src/components/Apps/AccountListTable/BulkCreateResultDialog.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:show-cancel="false"
|
||||
:title="title"
|
||||
v-bind="$attrs"
|
||||
@confirm="closeDialog"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<el-alert style="margin-bottom: 10px" type="success">
|
||||
<span v-for="item of summary" :key="item.key"><b>{{ item.label }}</b>: {{ item.value }} </span>
|
||||
</el-alert>
|
||||
<DataTable :config="config" />
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
import DataTable from '@/components/Table/DataTable/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'ResultDialog',
|
||||
components: {
|
||||
DataTable,
|
||||
Dialog
|
||||
},
|
||||
props: {
|
||||
result: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const errorProp = this.$t('common.Error')
|
||||
const stateMap = {
|
||||
'created': this.$tc('common.Created'),
|
||||
'updated': this.$tc('common.Updated'),
|
||||
'skipped': this.$tc('common.Skipped')
|
||||
}
|
||||
const stateClsMap = {
|
||||
'created': 'color-primary',
|
||||
'updated': 'color-success',
|
||||
'skipped': 'color-default'
|
||||
}
|
||||
return {
|
||||
title: this.$t('accounts.AddAccountResult'),
|
||||
config: {
|
||||
columns: [
|
||||
{
|
||||
prop: 'asset',
|
||||
label: this.$t('assets.Asset')
|
||||
},
|
||||
{
|
||||
prop: 'state',
|
||||
label: this.$t('common.Status'),
|
||||
width: '200px',
|
||||
formatter: (row) => {
|
||||
if (row.error) {
|
||||
return <span class='color-error'>{ errorProp }: { row.error }</span>
|
||||
} else if (row.state) {
|
||||
const colorCls = stateClsMap[row.state]
|
||||
const state = stateMap[row.state]
|
||||
return <span class={ colorCls }>{ state }</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
totalData: this.result
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
summary() {
|
||||
const labels = {
|
||||
total: this.$tc('common.Total'),
|
||||
created: this.$tc('common.Created'),
|
||||
updated: this.$tc('common.Updated'),
|
||||
skipped: this.$tc('common.Skipped'),
|
||||
error: this.$tc('common.Error')
|
||||
}
|
||||
const grouped = _.groupBy(this.result, 'state')
|
||||
const groupedLength = _.mapValues(grouped, 'length')
|
||||
groupedLength['total'] = this.result.length
|
||||
return _.map(groupedLength, (value, key) => {
|
||||
return {
|
||||
label: labels[key],
|
||||
value: value,
|
||||
key: key
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
closeDialog() {
|
||||
this.$emit('update:visible', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.color-error {
|
||||
color: var(--color-danger);
|
||||
}
|
||||
|
||||
.color-primary {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.color-success {
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
.color-default {
|
||||
}
|
||||
|
||||
::v-deep .el-data-table .el-table .el-table__row > td > div > span {
|
||||
white-space: inherit;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<GenericListTableDialog :visible.sync="iVisible" v-bind="config" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { GenericListTableDialog } from '@/layout/components'
|
||||
import { ShowKeyCopyFormatter } from '@/components/Table/TableFormatters'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GenericListTableDialog
|
||||
},
|
||||
props: {
|
||||
account: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
title: this.$t('accounts.HistoryPassword'),
|
||||
visible: false,
|
||||
width: '60%',
|
||||
tableConfig: {
|
||||
id: 'history_date',
|
||||
url: `/api/v1/accounts/account-secrets/${this.account.id}/histories/`,
|
||||
columns: ['secret', 'version', 'history_date'],
|
||||
columnsMeta: {
|
||||
secret: {
|
||||
label: this.$t('assets.Password'),
|
||||
formatter: ShowKeyCopyFormatter,
|
||||
formatterArgs: {
|
||||
hasDownload: false,
|
||||
name: this.account.name
|
||||
}
|
||||
},
|
||||
history_date: {
|
||||
label: this.$t('accounts.HistoryDate')
|
||||
},
|
||||
secret_type: {
|
||||
width: '200px'
|
||||
},
|
||||
version: {
|
||||
width: '100px'
|
||||
},
|
||||
actions: {
|
||||
has: false
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: false,
|
||||
hasSearch: false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iVisible: {
|
||||
get() {
|
||||
return this.visible
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:visible', val)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,27 +1,27 @@
|
||||
<template>
|
||||
<Dialog
|
||||
width="50"
|
||||
:title="this.$t('assets.UpdateAssetUserToken')"
|
||||
:visible.sync="visible"
|
||||
:destroy-on-close="true"
|
||||
@confirm="handleConfirm()"
|
||||
:title="$tc('assets.UpdateAssetUserToken')"
|
||||
:visible.sync="visible"
|
||||
width="50"
|
||||
@cancel="handleCancel()"
|
||||
@confirm="handleConfirm()"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<el-form label-position="right" label-width="90px">
|
||||
<el-form-item :label="this.$t('assets.Hostname')">
|
||||
<el-input v-model="account.hostname" readonly />
|
||||
<el-form-item :label="$tc('assets.Name')">
|
||||
<el-input v-model="account['asset_name']" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.Username')">
|
||||
<el-form-item :label="$tc('assets.Username')">
|
||||
<el-input v-model="account['username']" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.Password')">
|
||||
<el-form-item :label="$tc('assets.Password')">
|
||||
<UpdateToken v-model="authInfo.password" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.SSHSecretKey')">
|
||||
<el-form-item :label="$tc('assets.SSHSecretKey')">
|
||||
<UploadKey @input="getFile" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.Passphrase')">
|
||||
<el-form-item :label="$tc('assets.Passphrase')">
|
||||
<UpdateToken v-model="authInfo.passphrase" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -29,9 +29,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
import { UpdateToken, UploadKey } from '@/components/FormFields'
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
import { UpdateToken, UploadKey } from '@/components/Form/FormFields'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
|
||||
export default {
|
||||
name: 'UpdateSecretInfo',
|
||||
components: {
|
||||
@@ -51,7 +52,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
authInfo: {
|
||||
secretInfo: {
|
||||
password: '',
|
||||
private_key: '',
|
||||
passphrase: ''
|
||||
@@ -61,15 +62,15 @@ export default {
|
||||
methods: {
|
||||
handleConfirm() {
|
||||
const data = {}
|
||||
if (this.authInfo.password !== '') {
|
||||
data.password = encryptPassword(this.authInfo.password)
|
||||
if (this.secretInfo.password !== '') {
|
||||
data.password = encryptPassword(this.secretInfo.password)
|
||||
}
|
||||
if (this.authInfo.private_key !== '') {
|
||||
data.private_key = encryptPassword(this.authInfo.private_key)
|
||||
if (this.authInfo.passphrase) data.passphrase = this.authInfo.passphrase
|
||||
if (this.secretInfo.private_key !== '') {
|
||||
data.private_key = encryptPassword(this.secretInfo.private_key)
|
||||
if (this.secretInfo.passphrase) data.passphrase = this.secretInfo.passphrase
|
||||
}
|
||||
this.$axios.patch(
|
||||
`/api/v1/assets/accounts/${this.account.id}/`,
|
||||
`/api/v1/accounts/accounts/${this.account.id}/`,
|
||||
data,
|
||||
{ disableFlashErrorMsg: true }
|
||||
).then(res => {
|
||||
@@ -87,7 +88,7 @@ export default {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
getFile(file) {
|
||||
this.authInfo.private_key = file
|
||||
this.secretInfo.private_key = file
|
||||
}
|
||||
}
|
||||
}
|
||||
209
src/components/Apps/AccountListTable/ViewSecret.vue
Normal file
209
src/components/Apps/AccountListTable/ViewSecret.vue
Normal file
@@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<div>
|
||||
<Dialog
|
||||
:destroy-on-close="true"
|
||||
:show-cancel="false"
|
||||
:title="title"
|
||||
:visible.sync="showSecret"
|
||||
:width="'50'"
|
||||
v-bind="$attrs"
|
||||
@confirm="accountConfirmHandle"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<el-form :model="secretInfo" class="password-form" label-position="right" label-width="100px">
|
||||
<el-form-item :label="$tc('assets.Name')">
|
||||
<span>{{ account['name'] }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$tc('assets.Username')">
|
||||
<span>{{ account['username'] }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="secretTypeLabel">
|
||||
<ShowKeyCopyFormatter
|
||||
:cell-value="secretInfo.secret"
|
||||
:col="{ formatterArgs: {
|
||||
name: account['name'],
|
||||
secretType: secretType || ''
|
||||
}}"
|
||||
@input="onShowKeyCopyFormatterChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="secretType === 'ssh_key'" :label="$tc('assets.sshKeyFingerprint')">
|
||||
<span>{{ sshKeyFingerprint }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$tc('common.DateCreated')">
|
||||
<span>{{ account['date_created'] | date }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$tc('common.DateUpdated')">
|
||||
<span>{{ account['date_updated'] | date }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showPasswordRecord" v-perms="'accounts.view_accountsecret'" :label="$tc('accounts.PasswordRecord')">
|
||||
<el-link
|
||||
:underline="false"
|
||||
type="success"
|
||||
@click="showHistoryDialog"
|
||||
>
|
||||
<span style="padding-right: 30px">
|
||||
{{ versions }}
|
||||
</span>
|
||||
</el-link>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</Dialog>
|
||||
<PasswordHistoryDialog
|
||||
v-if="showPasswordHistoryDialog"
|
||||
:account="account"
|
||||
:visible.sync="showPasswordHistoryDialog"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
import PasswordHistoryDialog from './PasswordHistoryDialog.vue'
|
||||
import { ShowKeyCopyFormatter } from '@/components/Table/TableFormatters'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
|
||||
export default {
|
||||
name: 'ShowSecretInfo',
|
||||
components: {
|
||||
Dialog,
|
||||
PasswordHistoryDialog,
|
||||
ShowKeyCopyFormatter
|
||||
},
|
||||
props: {
|
||||
account: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return this.$tc('assets.AccountDetail')
|
||||
}
|
||||
},
|
||||
showPasswordRecord: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modifiedSecret: '',
|
||||
secretInfo: {},
|
||||
versions: '-',
|
||||
showSecret: false,
|
||||
mfaDialogVisible: true,
|
||||
sshKeyFingerprint: '-',
|
||||
historyCount: 0,
|
||||
showPasswordHistoryDialog: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
secretTypeLabel() {
|
||||
return this.account['secret_type'].label || 'Password'
|
||||
},
|
||||
secretType() {
|
||||
return this.account['secret_type'].value
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.showPasswordRecord) {
|
||||
const url = `/api/v1/accounts/account-secrets/${this.account.id}/histories/?limit=1`
|
||||
this.$axios.get(url, { disableFlashErrorMsg: true }).then(resp => {
|
||||
this.versions = resp.count
|
||||
this.showSecretDialog()
|
||||
})
|
||||
} else {
|
||||
this.showSecretDialog()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
accountConfirmHandle() {
|
||||
this.modifiedSecret && this.onChangeSecretSubmit()
|
||||
this.showSecret = false
|
||||
this.mfaDialogVisible = false
|
||||
},
|
||||
onChangeSecretSubmit() {
|
||||
const params = {
|
||||
name: this.secretInfo.name,
|
||||
secret: encryptPassword(this.modifiedSecret)
|
||||
}
|
||||
this.$axios.patch(`/api/v1/accounts/accounts/${this.account.id}/`, params).then(() => {
|
||||
this.$message.success(this.$tc('common.updateSuccessMsg'))
|
||||
})
|
||||
},
|
||||
showSecretDialog() {
|
||||
return this.$axios.get(this.url, { disableFlashErrorMsg: true }).then((res) => {
|
||||
this.secretInfo = res
|
||||
this.sshKeyFingerprint = res?.spec_info?.ssh_key_fingerprint || '-'
|
||||
this.showSecret = true
|
||||
})
|
||||
},
|
||||
exit() {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
showHistoryDialog() {
|
||||
this.showPasswordHistoryDialog = true
|
||||
},
|
||||
onShowKeyCopyFormatterChange(value) {
|
||||
if (value === this.secretInfo.secret) return
|
||||
this.modifiedSecret = value
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.item-textarea >>> .el-textarea__inner {
|
||||
height: 110px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
padding: 5px 0;
|
||||
margin-bottom: 0;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
>>> .el-form-item__label {
|
||||
padding-right: 20px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
>>> .el-form-item__content {
|
||||
line-height: 30px;
|
||||
|
||||
pre {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
margin-bottom: 8px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
.title {
|
||||
color: #303133;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
26
src/components/Apps/AccountListTable/const.js
Normal file
26
src/components/Apps/AccountListTable/const.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import i18n from '@/i18n/i18n'
|
||||
import { ChoicesFormatter } from '@/components/Table/TableFormatters'
|
||||
|
||||
export const connectivityMeta = {
|
||||
label: i18n.t('assets.Connectivity'),
|
||||
formatter: ChoicesFormatter,
|
||||
formatterArgs: {
|
||||
faChoices: {
|
||||
'-': '',
|
||||
ok: 'fa-check-circle',
|
||||
err: 'fa-times-circle'
|
||||
},
|
||||
classChoices: {
|
||||
ok: 'text-primary',
|
||||
err: 'text-danger'
|
||||
},
|
||||
getText({ cellValue }) {
|
||||
if (cellValue?.value === '-' || cellValue?.value === 'unknown') {
|
||||
return '-'
|
||||
} else {
|
||||
return cellValue?.label
|
||||
}
|
||||
}
|
||||
},
|
||||
width: '100px'
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<IBox :fa="icon" :type="type" :title="title" v-bind="$attrs">
|
||||
<IBox :fa="icon" :title="title" :type="type" v-bind="$attrs">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<AssetSelect ref="assetSelect" :disabled="disabled" :can-select="canSelect" />
|
||||
<AssetSelect ref="assetSelect" :can-select="canSelect" :disabled="disabled" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<el-button :type="type" size="small" :disabled="disabled" @click="addObjects">{{ $t('common.Add') }}</el-button>
|
||||
<el-button :disabled="disabled" :type="type" size="small" @click="addObjects">{{ $t('common.Add') }}</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -16,8 +16,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IBox from '@/components/IBox'
|
||||
import AssetSelect from '@/components/AssetSelect'
|
||||
import IBox from '@/components/IBox/index.vue'
|
||||
import AssetSelect from '@/components/Apps/AssetSelect/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'AssetRelationCard',
|
||||
192
src/components/Apps/AssetSelect/dialog.vue
Normal file
192
src/components/Apps/AssetSelect/dialog.vue
Normal file
@@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:title="$tc('assets.Assets')"
|
||||
custom-class="asset-select-dialog"
|
||||
top="1vh"
|
||||
v-bind="$attrs"
|
||||
width="80vw"
|
||||
@cancel="handleCancel"
|
||||
@close="handleClose"
|
||||
@confirm="handleConfirm"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<AssetTreeTable
|
||||
ref="ListPage"
|
||||
:header-actions="headerActions"
|
||||
:node-url="baseNodeUrl"
|
||||
:table-config="tableConfig"
|
||||
:tree-url="`${baseNodeUrl}children/tree/`"
|
||||
:url="baseUrl"
|
||||
class="tree-table"
|
||||
v-bind="$attrs"
|
||||
/>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AssetTreeTable from '@/components/Apps/AssetTreeTable/index.vue'
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
|
||||
export default {
|
||||
componentName: 'AssetSelectDialog',
|
||||
components: { AssetTreeTable, Dialog },
|
||||
props: {
|
||||
baseUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/assets/'
|
||||
},
|
||||
baseNodeUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/nodes/'
|
||||
},
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
canSelect: {
|
||||
type: Function,
|
||||
default(row, index) {
|
||||
return true
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
type: [Boolean, Function],
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
dialogVisible: false,
|
||||
rowSelected: _.cloneDeep(this.value) || [],
|
||||
rowsAdd: [],
|
||||
tableConfig: {
|
||||
url: this.baseUrl,
|
||||
hasTree: true,
|
||||
canSelect: this.canSelect,
|
||||
columns: [
|
||||
{
|
||||
prop: 'name',
|
||||
label: this.$t('assets.Name'),
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'address',
|
||||
label: this.$t('assets.ipDomain'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'platform',
|
||||
label: this.$t('assets.Platform'),
|
||||
sortable: true,
|
||||
formatter: function(row) {
|
||||
return row.platform.name
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'protocols',
|
||||
formatter: function(row) {
|
||||
const data = row.protocols?.map(p => {
|
||||
return <el-tag size='mini'>{p.name}/{p.port} </el-tag>
|
||||
})
|
||||
return <span> {data} </span>
|
||||
},
|
||||
label: this.$t('assets.Protocols')
|
||||
},
|
||||
{
|
||||
prop: 'actions',
|
||||
has: false
|
||||
}
|
||||
],
|
||||
listeners: {
|
||||
'toggle-row-selection': (isSelected, row) => {
|
||||
if (isSelected) {
|
||||
vm.addRowToSelect(row)
|
||||
} else {
|
||||
vm.removeRowFromSelect(row)
|
||||
}
|
||||
}
|
||||
},
|
||||
theRowDefaultIsSelected: (row) => {
|
||||
return this.value.indexOf(row.id) > -1
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: false,
|
||||
hasRightActions: false,
|
||||
searchConfig: {
|
||||
getUrlQuery: false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.$eventBus.$emit('treeComponentKey')
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$emit('confirm', this.rowSelected, this.rowsAdd)
|
||||
if (this.rowSelected.length > 0) {
|
||||
this.handleClose()
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$emit('cancel')
|
||||
this.handleClose()
|
||||
},
|
||||
addRowToSelect(row) {
|
||||
const selectValueIndex = this.rowSelected.indexOf(row.id)
|
||||
if (selectValueIndex === -1) {
|
||||
this.rowSelected.push(row.id)
|
||||
this.rowsAdd.push(row)
|
||||
}
|
||||
},
|
||||
removeRowFromSelect(row) {
|
||||
const selectValueIndex = this.rowSelected.indexOf(row.id)
|
||||
if (selectValueIndex > -1) {
|
||||
this.rowSelected.splice(selectValueIndex, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page ::v-deep .page-heading {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__wrapper ::v-deep .el-dialog__body {
|
||||
padding: 0 0 0 3px;
|
||||
|
||||
.tree-table {
|
||||
.search {
|
||||
}
|
||||
|
||||
.left {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.right {
|
||||
height: calc(100vh - 200px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.mini {
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.transition-box {
|
||||
padding: 10px 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.page ::v-deep .treebox .ztree {
|
||||
|
||||
}
|
||||
|
||||
.asset-select-dialog ::v-deep .el-icon-circle-check {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
154
src/components/Apps/AssetSelect/index.vue
Normal file
154
src/components/Apps/AssetSelect/index.vue
Normal file
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<div class="asset-select-formatter">
|
||||
<Select2
|
||||
ref="select2"
|
||||
v-model="select2Config.value"
|
||||
v-bind="select2Config"
|
||||
@input="onInputChange"
|
||||
v-on="$listeners"
|
||||
@focus.stop="handleFocus"
|
||||
/>
|
||||
<AssetSelectDialog
|
||||
v-if="dialogVisible"
|
||||
ref="dialog"
|
||||
:base-node-url="baseNodeUrl"
|
||||
:base-url="baseUrl"
|
||||
:tree-url-query="treeUrlQuery"
|
||||
:value="value"
|
||||
:visible.sync="dialogVisible"
|
||||
v-bind="$attrs"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
v-on="$listeners"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Select2 from '@/components/Form/FormFields/Select2.vue'
|
||||
import AssetSelectDialog from './dialog.vue'
|
||||
import { b } from 'css-color-function/lib/adjusters'
|
||||
|
||||
export default {
|
||||
componentName: 'AssetSelect',
|
||||
components: { AssetSelectDialog, Select2 },
|
||||
props: {
|
||||
baseUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/assets/'
|
||||
},
|
||||
baseNodeUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/nodes/'
|
||||
},
|
||||
treeUrlQuery: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const iValue = []
|
||||
for (const item of this.value) {
|
||||
if (typeof item === 'object') {
|
||||
iValue.push(item.id)
|
||||
} else {
|
||||
iValue.push(item)
|
||||
}
|
||||
}
|
||||
return {
|
||||
dialogVisible: false,
|
||||
initialValue: _.cloneDeep(iValue),
|
||||
select2Config: {
|
||||
value: iValue,
|
||||
multiple: true,
|
||||
clearable: true,
|
||||
ajax: {
|
||||
url: this.baseUrl,
|
||||
transformOption: (item) => {
|
||||
return { label: item.name + '(' + item.address + ')', value: item.id }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
b,
|
||||
handleFocus() {
|
||||
this.$refs.select2.selectRef.blur()
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleConfirm(valueSelected, rowsAdd) {
|
||||
if (valueSelected === undefined) {
|
||||
return
|
||||
}
|
||||
this.$refs.select2.iValue = valueSelected
|
||||
this.addRowsToSelect(rowsAdd)
|
||||
this.onInputChange(valueSelected)
|
||||
this.dialogVisible = false
|
||||
},
|
||||
handleCancel() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
onInputChange(val) {
|
||||
this.$emit('change', val)
|
||||
},
|
||||
addToSelect(options, row) {
|
||||
const selectOptionsHas = options.find(item => item.value === row.id)
|
||||
// 如果select2的options中没有,那么可能无法显示正常的值
|
||||
if (selectOptionsHas === undefined) {
|
||||
const option = {
|
||||
label: `${row.name}(${row.address})`,
|
||||
value: row.id
|
||||
}
|
||||
options.push(option)
|
||||
}
|
||||
},
|
||||
addRowsToSelect(rows) {
|
||||
const outSelectOptions = this.$refs.select2.options
|
||||
for (const row of rows) {
|
||||
this.addToSelect(outSelectOptions, row)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.page ::v-deep .page-heading {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__wrapper ::v-deep .el-dialog__body {
|
||||
padding: 0 0 0 3px;
|
||||
|
||||
.tree-table {
|
||||
.left {
|
||||
padding: 5px;
|
||||
|
||||
.ztree {
|
||||
height: calc(100vh - 250px) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.mini {
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.transition-box {
|
||||
padding: 10px 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.page ::v-deep .treebox {
|
||||
height: inherit !important;
|
||||
}
|
||||
</style>
|
||||
175
src/components/Apps/AssetTreeTable/index.vue
Normal file
175
src/components/Apps/AssetTreeTable/index.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<TreeTable
|
||||
ref="TreeList"
|
||||
:active-menu.sync="treeTableConfig.activeMenu"
|
||||
:table-config="tableConfig"
|
||||
:tree-tab-config="treeTableConfig"
|
||||
component="TabTree"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<template #table>
|
||||
<slot name="table" />
|
||||
</template>
|
||||
<div slot="rMenu" slot-scope="{data}">
|
||||
<slot :data="data" name="rMenu" />
|
||||
</div>
|
||||
</TreeTable>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TreeTable from '../../Table/TreeTable/index.vue'
|
||||
import { setRouterQuery, setUrlParam } from '@/utils/common'
|
||||
import $ from '@/utils/jquery-vendor'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TreeTable
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/assets/'
|
||||
},
|
||||
nodeUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/nodes/'
|
||||
},
|
||||
treeUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/nodes/children/tree/'
|
||||
},
|
||||
treeUrlQuery: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
treeSetting: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
tableConfig: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
showAssets: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const showAssets = this.treeSetting?.showAssets || this.showAssets
|
||||
const treeUrlQuery = this.setTreeUrlQuery()
|
||||
const assetTreeUrl = `${this.treeUrl}?assets=${showAssets ? '1' : '0'}&${treeUrlQuery}`
|
||||
|
||||
return {
|
||||
treeTabConfig: {
|
||||
activeMenu: 'CustomTree',
|
||||
submenu: [
|
||||
{
|
||||
title: this.$t('assets.AssetTree'),
|
||||
name: 'CustomTree',
|
||||
treeSetting: {
|
||||
showAssets,
|
||||
showMenu: false,
|
||||
showRefresh: true,
|
||||
showCreate: true,
|
||||
showUpdate: true,
|
||||
showDelete: true,
|
||||
hasRightMenu: true,
|
||||
showSearch: true,
|
||||
url: this.url,
|
||||
nodeUrl: this.nodeUrl,
|
||||
treeUrl: assetTreeUrl,
|
||||
callback: {
|
||||
onSelected: (event, treeNode) => this.getAssetsUrl(treeNode)
|
||||
},
|
||||
...this.treeSetting
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('assets.BuiltinTree'),
|
||||
name: 'BuiltinTree',
|
||||
treeSetting: {
|
||||
showRefresh: true,
|
||||
showAssets: false,
|
||||
showSearch: false,
|
||||
customTreeHeaderName: this.$t('assets.BuiltinTree'),
|
||||
url: '/api/v1/assets/nodes/category/tree/',
|
||||
nodeUrl: this.treeSetting?.nodeUrl || this.nodeUrl,
|
||||
treeUrl: `/api/v1/assets/nodes/category/tree/?assets=${showAssets ? '1' : '0'}&count_resource=${this.treeSetting.countResource || 'asset'}`,
|
||||
callback: {
|
||||
onSelected: (event, treeNode) => this.getAssetsUrl(treeNode)
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
treeTableConfig() {
|
||||
if (this.treeSetting.notShowBuiltinTree) {
|
||||
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
||||
this.treeTabConfig.submenu.splice(1, 1)
|
||||
}
|
||||
return this.treeTabConfig
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.decorateRMenu()
|
||||
const treeSetting = this.treeTabConfig.submenu[0].treeSetting
|
||||
treeSetting.hasRightMenu = !this.currentOrgIsRoot
|
||||
treeSetting.showCreate = this.$hasPerm('assets.add_node')
|
||||
treeSetting.showUpdate = this.$hasPerm('assets.change_node')
|
||||
treeSetting.showDelete = this.$hasPerm('assets.delete_node')
|
||||
},
|
||||
methods: {
|
||||
setTreeUrlQuery() {
|
||||
let str = ''
|
||||
for (const key in this.treeUrlQuery) {
|
||||
str += `${key}=${this.treeUrlQuery[key]}&`
|
||||
}
|
||||
str = str.substr(0, str.length - 1)
|
||||
|
||||
return str
|
||||
},
|
||||
decorateRMenu() {
|
||||
const show_current_asset = this.$cookie.get('show_current_asset') || '0'
|
||||
if (show_current_asset === '1') {
|
||||
$('#m_show_asset_all_children_node').css('color', '#606266')
|
||||
$('#m_show_asset_only_current_node').css('color', 'green')
|
||||
} else {
|
||||
$('#m_show_asset_all_children_node').css('color', 'green')
|
||||
$('#m_show_asset_only_current_node').css('color', '#606266')
|
||||
}
|
||||
},
|
||||
getAssetsUrl(treeNode) {
|
||||
let url = this.treeSetting?.url || this.url
|
||||
if (treeNode.meta.type === 'node') {
|
||||
const nodeId = treeNode.meta.data.id
|
||||
url = setUrlParam(url, 'node_id', nodeId)
|
||||
url = setUrlParam(url, 'asset_id', '')
|
||||
} else if (treeNode.meta.type === 'asset') {
|
||||
const assetId = treeNode.meta.data?.id || treeNode.id
|
||||
url = setUrlParam(url, 'node_id', '')
|
||||
url = setUrlParam(url, 'asset_id', assetId)
|
||||
} else if (treeNode.meta.type === 'category') {
|
||||
url = setUrlParam(url, 'category', treeNode.meta.category)
|
||||
} else if (treeNode.meta.type === 'type') {
|
||||
url = setUrlParam(url, 'category', treeNode.meta.category)
|
||||
url = setUrlParam(url, 'type', treeNode.meta._type)
|
||||
} else if (treeNode.meta.type === 'platform') {
|
||||
url = setUrlParam(url, 'platform', treeNode.id)
|
||||
}
|
||||
const query = this.setTreeUrlQuery()
|
||||
url = query ? `${url}&${query}` : url
|
||||
this.$set(this.tableConfig, 'url', url)
|
||||
setRouterQuery(this, url)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
|
||||
</style>
|
||||
203
src/components/Apps/AutomationParams/index.vue
Normal file
203
src/components/Apps/AutomationParams/index.vue
Normal file
@@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-button
|
||||
:disabled="isDisabled"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="onOpenDialog"
|
||||
>
|
||||
{{ $tc('common.Setting') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<Dialog
|
||||
v-if="visible"
|
||||
:destroy-on-close="true"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:title="title"
|
||||
:visible.sync="visible"
|
||||
v-bind="$attrs"
|
||||
width="60%"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<AutoDataForm
|
||||
ref="autoDataForm"
|
||||
:form="form"
|
||||
class="data-form"
|
||||
v-bind="config"
|
||||
@submit="onSubmit"
|
||||
/>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '../../Dialog'
|
||||
import AutoDataForm from '../../Form/AutoDataForm'
|
||||
|
||||
export default {
|
||||
componentName: 'AutomationParams',
|
||||
components: {
|
||||
Dialog,
|
||||
AutoDataForm
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return this.$t('assets.PushParams')
|
||||
}
|
||||
},
|
||||
assets: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
nodes: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
platforms: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
method: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
default: `/api/v1/assets/platform-automation-methods/`
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
remoteMeta: {},
|
||||
visible: false,
|
||||
isDisabled: true,
|
||||
form: this.value,
|
||||
config: {
|
||||
url: this.url,
|
||||
hasSaveContinue: false,
|
||||
hasButtons: true,
|
||||
method: 'get',
|
||||
fields: [],
|
||||
fieldsMeta: {}
|
||||
},
|
||||
onFieldChangeHandler: _.debounce(vm.handleFieldChange, 1000)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
refForm() {
|
||||
return this.$refs.autoDataForm
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
nodes: {
|
||||
handler() {
|
||||
this.onFieldChangeHandler()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
assets: {
|
||||
handler() {
|
||||
this.onFieldChangeHandler()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
platforms: {
|
||||
handler(newVal) {
|
||||
this.onFieldChangeHandler()
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.getUrlMeta()
|
||||
},
|
||||
methods: {
|
||||
async getUrlMeta() {
|
||||
const data = await this.$store.dispatch('common/getUrlMeta', { url: this.url })
|
||||
this.remoteMeta = data.actions[this.config.method.toUpperCase()] || {}
|
||||
},
|
||||
async getFilterPlatforms() {
|
||||
return await this.$axios.post(
|
||||
'/api/v1/assets/platforms/filter-nodes-assets/',
|
||||
{
|
||||
'node_ids': this.nodes,
|
||||
'asset_ids': this.assets,
|
||||
'platform_ids': this.platforms.map(i => i.id || i.pk || i)
|
||||
}
|
||||
)
|
||||
},
|
||||
async handleFieldChange() {
|
||||
const platforms = await this.getFilterPlatforms()
|
||||
let pushAccountMethods = platforms.map(i => i.automation[this.method])
|
||||
pushAccountMethods = _.uniq(pushAccountMethods)
|
||||
// 检测是否有可设置的推送方式
|
||||
const hasCanSettingPushMethods = _.intersection(pushAccountMethods, Object.keys(this.remoteMeta))
|
||||
this.setFormConfig(hasCanSettingPushMethods)
|
||||
this.isDisabled = hasCanSettingPushMethods.length <= 0
|
||||
},
|
||||
setFormConfig(methods) {
|
||||
const newForm = {}
|
||||
const fields = []
|
||||
const fieldsMeta = {}
|
||||
this.config.fields = []
|
||||
// Todo: 未来改成后端处理,生成 serializer, 这里就不用判断类型了
|
||||
const typeMapper = {
|
||||
'string': 'input',
|
||||
'boolean': 'switch'
|
||||
}
|
||||
|
||||
for (const method of methods) {
|
||||
const filterField = this.remoteMeta[method] || {}
|
||||
// 修改资产、节点时不点击设置按钮也需要获取form表单值暴露出去
|
||||
if (this.form.hasOwnProperty(method)) {
|
||||
newForm[method] = this.form[method]
|
||||
}
|
||||
fields.push([filterField.label, [method]])
|
||||
fieldsMeta[method] = {
|
||||
fields: [],
|
||||
fieldsMeta: {}
|
||||
}
|
||||
if (Object.keys(filterField?.children || {}).length > 0) {
|
||||
for (const [k, v] of Object.entries(filterField.children)) {
|
||||
const item = {
|
||||
...v,
|
||||
type: typeMapper[v.type] || 'input'
|
||||
}
|
||||
delete item.default
|
||||
fieldsMeta[method].fields.push(k)
|
||||
fieldsMeta[method].fieldsMeta[k] = item
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.form = newForm
|
||||
this.config.fields = fields
|
||||
this.config.fieldsMeta = fieldsMeta
|
||||
},
|
||||
onOpenDialog() {
|
||||
this.visible = true
|
||||
},
|
||||
onSubmit(form) {
|
||||
this.form = form
|
||||
this.$emit('input', form)
|
||||
setTimeout(() => {
|
||||
this.visible = false
|
||||
}, 100)
|
||||
this.$log.debug('Auto push form:', form)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
97
src/components/Apps/BlockedIPs/BlockedIPList.vue
Normal file
97
src/components/Apps/BlockedIPs/BlockedIPList.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ListTable from '@/components/Table/ListTable/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'BlockedIPList',
|
||||
components: {
|
||||
ListTable
|
||||
},
|
||||
props: {
|
||||
object: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
tableConfig: {
|
||||
url: '/api/v1/settings/security/block-ip/',
|
||||
columns: [
|
||||
'ip', 'actions'
|
||||
],
|
||||
columnsMeta: {
|
||||
ip: {
|
||||
label: this.$t('assets.ip')
|
||||
},
|
||||
actions: {
|
||||
formatterArgs: {
|
||||
hasDelete: false,
|
||||
hasUpdate: false,
|
||||
hasClone: false,
|
||||
extraActions: [
|
||||
{
|
||||
name: 'UnlockIP',
|
||||
title: this.$t('setting.Unblock'),
|
||||
can: this.$hasPerm('settings.change_security'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
this.$axios.post(
|
||||
'/api/v1/settings/security/unlock-ip/',
|
||||
{ ips: [row.ip] }
|
||||
).then(() => {
|
||||
vm.$message.success(this.$tc('common.UnlockSuccessMsg'))
|
||||
vm.$refs.ListTable.reloadTable()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasExport: false,
|
||||
hasImport: false,
|
||||
hasCreate: false,
|
||||
hasSearch: false,
|
||||
hasRefresh: true,
|
||||
hasBulkDelete: false,
|
||||
hasBulkUpdate: false,
|
||||
hasLeftActions: true,
|
||||
hasRightActions: true,
|
||||
extraMoreActions: [
|
||||
{
|
||||
name: 'UnlockSelected',
|
||||
title: this.$t('setting.BulkUnblock'),
|
||||
type: 'primary',
|
||||
can: ({ selectedRows }) => {
|
||||
return selectedRows.length > 0
|
||||
},
|
||||
callback: function({ selectedRows }) {
|
||||
vm.$axios.post(
|
||||
'/api/v1/settings/security/unlock-ip/',
|
||||
{
|
||||
ips: selectedRows.map(v => { return v.ip })
|
||||
}
|
||||
).then(res => {
|
||||
vm.$message.success(vm.$tc('common.UnlockSuccessMsg'))
|
||||
vm.$refs.ListTable.reloadTable()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
|
||||
</style>
|
||||
75
src/components/Apps/BlockedIPs/index.vue
Normal file
75
src/components/Apps/BlockedIPs/index.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="onOpenDialog"
|
||||
>{{ $tc('common.View') }}</el-button>
|
||||
</div>
|
||||
<Dialog
|
||||
v-if="visible"
|
||||
:visible.sync="visible"
|
||||
:title="title"
|
||||
width="40%"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:destroy-on-close="true"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<BlockedIPList />
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Dialog } from '@/components'
|
||||
import BlockedIPList from '@/components/Apps/BlockedIPs/BlockedIPList'
|
||||
|
||||
export default {
|
||||
componentName: 'BlockedIPs',
|
||||
components: {
|
||||
BlockedIPList,
|
||||
Dialog
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return this.$t('setting.BlockedIPS')
|
||||
}
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
default: `/api/v1/assets/platform-automation-methods/`
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
remoteMeta: {},
|
||||
visible: false,
|
||||
form: this.value,
|
||||
config: {
|
||||
url: this.url,
|
||||
hasSaveContinue: false,
|
||||
hasButtons: true,
|
||||
fields: [],
|
||||
fieldsMeta: {}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpenDialog() {
|
||||
this.visible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
92
src/components/Apps/GatewayDialog/index.vue
Normal file
92
src/components/Apps/GatewayDialog/index.vue
Normal file
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<Dialog
|
||||
v-if="iVisible"
|
||||
:destroy-on-close="true"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:title="$tc('assets.TestGatewayTestConnection')"
|
||||
:visible.sync="iVisible"
|
||||
top="35vh"
|
||||
width="40%"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :md="4" :sm="24">
|
||||
<div style="line-height: 34px">{{ $t('assets.SSHPort') }}</div>
|
||||
</el-col>
|
||||
<el-col :md="14" :sm="24">
|
||||
<el-input v-model="port" />
|
||||
<span class="help-tips help-block">{{ $t('assets.TestGatewayHelpMessage') }}</span>
|
||||
</el-col>
|
||||
<el-col :md="4" :sm="24">
|
||||
<el-button
|
||||
:loading="loading"
|
||||
size="mini"
|
||||
style="line-height:20px "
|
||||
type="primary"
|
||||
@click="dialogConfirm"
|
||||
>
|
||||
{{ this.$t('common.Confirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
|
||||
export default {
|
||||
name: 'GatewayDialog',
|
||||
components: {
|
||||
Dialog
|
||||
},
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
port: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
cell: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
iVisible: {
|
||||
get() {
|
||||
return this.visible
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:visible', val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dialogConfirm() {
|
||||
if (isNaN(this.port)) {
|
||||
return this.$message.error(this.$tc('common.TestPortErrorMsg'))
|
||||
}
|
||||
this.$axios.post(
|
||||
`/api/v1/assets/gateways/${this.cell}/test-connective/`,
|
||||
{ port: this.port }
|
||||
)
|
||||
.then((res) => {
|
||||
openTaskPage(res['task'])
|
||||
}).finally(() => {
|
||||
this.iVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<TreeTable :table-config="tableConfig" :header-actions="headerActions" :tree-setting="treeSetting" />
|
||||
<TreeTable :header-actions="headerActions" :table-config="tableConfig" :tree-setting="treeSetting" />
|
||||
</template>
|
||||
|
||||
<script type="text/jsx">
|
||||
import { DetailFormatter, SystemUserFormatter } from '@/components/TableFormatters'
|
||||
import TreeTable from '../TreeTable'
|
||||
import TreeTable from '../../Table/TreeTable/index.vue'
|
||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||
|
||||
export default {
|
||||
name: 'GrantedAssets',
|
||||
@@ -35,7 +35,7 @@ export default {
|
||||
getShowUrl: {
|
||||
type: Function,
|
||||
default({ row, col }) {
|
||||
return this.tableUrl.replace('/assets/', `/assets/${row.id}/system-users/?cache_policy=1`)
|
||||
return this.tableUrl.replace('/assets/', `/assets/${row.id}/accounts/`)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -57,34 +57,22 @@ export default {
|
||||
tableConfig: {
|
||||
url: this.tableUrl,
|
||||
hasTree: true,
|
||||
columns: [
|
||||
{
|
||||
prop: 'hostname',
|
||||
label: this.$t('assets.Hostname'),
|
||||
columnsExclude: ['spec_info'],
|
||||
columnShow: {
|
||||
min: ['name', 'address', 'accounts'],
|
||||
default: ['name', 'address', 'accounts', 'actions']
|
||||
},
|
||||
columnsMeta: {
|
||||
name: {
|
||||
formatter: DetailFormatter,
|
||||
sortable: true,
|
||||
formatterArgs: {
|
||||
route: 'AssetDetail'
|
||||
},
|
||||
showOverflowTooltip: true
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'ip',
|
||||
label: this.$t('assets.IP'),
|
||||
width: '140px',
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'systemUsers',
|
||||
label: this.$t('assets.SystemUsers'),
|
||||
align: 'center',
|
||||
formatter: SystemUserFormatter,
|
||||
formatterArgs: {
|
||||
getUrl: this.getShowUrl.bind(this)
|
||||
},
|
||||
showOverflowTooltip: true
|
||||
actions: {
|
||||
has: false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: false,
|
||||
71
src/components/Apps/ManyJsonTabs/AssetJsonTab.vue
Normal file
71
src/components/Apps/ManyJsonTabs/AssetJsonTab.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<el-row :gutter="24">
|
||||
<el-col :md="20" :sm="22">
|
||||
<ListTable v-bind="config" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ListTable from '@/components/Table/ListTable/index.vue'
|
||||
import { toM2MJsonParams } from '@/utils/jms'
|
||||
|
||||
export default {
|
||||
name: 'AssetJsonTab',
|
||||
components: {
|
||||
ListTable
|
||||
},
|
||||
props: {
|
||||
object: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const [key, value] = toM2MJsonParams(this.object.assets)
|
||||
return {
|
||||
config: {
|
||||
headerActions: {
|
||||
hasLeftActions: false,
|
||||
hasImport: false,
|
||||
hasExport: false
|
||||
},
|
||||
tableConfig: {
|
||||
url: `/api/v1/assets/assets/?${key}=${value}`,
|
||||
columns: ['name', 'address', 'platform',
|
||||
'type', 'is_active'
|
||||
],
|
||||
columnsMeta: {
|
||||
name: {
|
||||
label: this.$t('assets.Asset'),
|
||||
formatter: (row) => {
|
||||
const to = {
|
||||
name: 'AssetDetail',
|
||||
params: { id: row.id }
|
||||
}
|
||||
if (this.$hasPerm('assets.view_asset')) {
|
||||
return <router-link to={to} class='text-link'>{row.name}</router-link>
|
||||
} else {
|
||||
return <span>{row.name}</span>
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
has: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iUrl() {
|
||||
return `/api/v1/users/users/`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
91
src/components/Apps/ManyJsonTabs/UserJsonTab.vue
Normal file
91
src/components/Apps/ManyJsonTabs/UserJsonTab.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<el-row :gutter="24">
|
||||
<el-col :md="20" :sm="22">
|
||||
<ListTable v-bind="config" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ListTable from '@/components/Table/ListTable/index.vue'
|
||||
import { toM2MJsonParams } from '@/utils/jms'
|
||||
|
||||
export default {
|
||||
name: 'User',
|
||||
components: {
|
||||
ListTable
|
||||
},
|
||||
props: {
|
||||
object: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const [key, value] = toM2MJsonParams(this.object.users)
|
||||
return {
|
||||
config: {
|
||||
headerActions: {
|
||||
hasLeftActions: false,
|
||||
hasImport: false,
|
||||
hasExport: false
|
||||
},
|
||||
tableConfig: {
|
||||
url: `/api/v1/users/users/?${key}=${value}`,
|
||||
columns: [
|
||||
'name', 'username', 'groups', 'system_roles',
|
||||
'org_roles', 'source', 'is_valid'
|
||||
],
|
||||
columnsMeta: {
|
||||
name: {
|
||||
label: this.$t('common.Name'),
|
||||
formatter: (row) => {
|
||||
const to = {
|
||||
name: 'UserDetail',
|
||||
params: { id: row.id }
|
||||
}
|
||||
if (this.$hasPerm('users.view_user')) {
|
||||
return <router-link to={to} class='text-link'>{row.name}</router-link>
|
||||
} else {
|
||||
return <span>{row.name}</span>
|
||||
}
|
||||
}
|
||||
},
|
||||
system_roles: {
|
||||
label: this.$t('users.SystemRoles'),
|
||||
formatter: (row) => {
|
||||
return row['system_roles'].map(item => item['display_name']).join(', ') || '-'
|
||||
},
|
||||
filters: [],
|
||||
columnKey: 'system_roles'
|
||||
},
|
||||
org_roles: {
|
||||
label: this.$t('users.OrgRoles'),
|
||||
formatter: (row) => {
|
||||
return row['org_roles'].map(item => item['display_name']).join(', ') || '-'
|
||||
},
|
||||
filters: [],
|
||||
columnKey: 'org_roles',
|
||||
has: () => {
|
||||
return this.$store.getters.hasValidLicense && !this.currentOrgIsRoot
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
has: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iUrl() {
|
||||
return `/api/v1/users/users/`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
92
src/components/Apps/ResourceActivity/index.vue
Normal file
92
src/components/Apps/ResourceActivity/index.vue
Normal file
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :md="12" :sm="24">
|
||||
<IBox :title="title" class="block" v-bind="$attrs">
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-for="(activity, index) in activities"
|
||||
:key="index"
|
||||
:size="activity.size"
|
||||
:timestamp="activity.timestamp"
|
||||
:type="activity.type"
|
||||
placement="bottom"
|
||||
>
|
||||
{{ activity.content }}
|
||||
<el-link
|
||||
v-if="activity['detail_url']"
|
||||
type="primary"
|
||||
@click.native="onClick(activity)"
|
||||
>
|
||||
{{ $tc('common.Detail') }}
|
||||
</el-link>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</IBox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<DiffDetail ref="DetailDialog" :title="$tc('route.OperateLog')" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IBox from '@/components/IBox/index.vue'
|
||||
import DiffDetail from '@/components/Dialog/DiffDetail.vue'
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
|
||||
export default {
|
||||
name: 'ResourceActivity',
|
||||
components: {
|
||||
IBox,
|
||||
DiffDetail
|
||||
},
|
||||
props: {
|
||||
object: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activityUrl: `/api/v1/audits/activities/?resource_id=${this.object.id}`,
|
||||
title: `${this.$t('common.Activity')} - ${this.$t('common.Last30')}`,
|
||||
activities: [
|
||||
{
|
||||
content: this.$t('common.Now'),
|
||||
timestamp: this.$moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
type: 'primary'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getActivities()
|
||||
},
|
||||
methods: {
|
||||
getActivities() {
|
||||
this.$axios.get(this.activityUrl).then(res => {
|
||||
for (const i in res) {
|
||||
this.activities.push(res[i])
|
||||
}
|
||||
})
|
||||
},
|
||||
onClick(activity) {
|
||||
const type = activity['r_type']
|
||||
const taskUrl = activity['detail_url']
|
||||
if (type === 'O') {
|
||||
this.$axios.get(taskUrl).then(
|
||||
res => {
|
||||
this.$refs.DetailDialog.show(res.diff)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
openTaskPage('', 'celery', taskUrl)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
224
src/components/Apps/UserConfirmDialog/index.vue
Normal file
224
src/components/Apps/UserConfirmDialog/index.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:close-on-click-modal="false"
|
||||
:destory-on-close="true"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:title="title"
|
||||
:visible.sync="visible"
|
||||
class="dialog-content"
|
||||
v-bind="$attrs"
|
||||
width="600px"
|
||||
@confirm="visible = false"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<div v-if="confirmTypeRequired === 'relogin'">
|
||||
<el-row :gutter="24" style="margin: 0 auto;">
|
||||
<el-col :md="24" :sm="24">
|
||||
<el-alert
|
||||
:title="$tc('auth.ReLoginTitle')"
|
||||
center
|
||||
style="margin-bottom: 20px;"
|
||||
type="error"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="margin: 0 auto;">
|
||||
<el-col :md="24" :sm="24">
|
||||
<el-button class="confirm-btn" size="mini" type="primary" @click="logout">
|
||||
{{ this.$t('auth.ReLogin') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-row :gutter="24" style="margin: 0 auto;">
|
||||
<el-col :md="24" :sm="24" :span="24" class="add">
|
||||
<el-select
|
||||
v-model="subTypeSelected"
|
||||
style="width: 100%; margin-bottom: 20px;"
|
||||
@change="handleSubTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item of subTypeChoices"
|
||||
:key="item.name"
|
||||
:disabled="item.disabled"
|
||||
:label="item.display_name"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="margin: 0 auto;">
|
||||
<el-col :md="24" :sm="24" style="display: flex; margin-bottom: 20px;">
|
||||
<el-input v-model="secretValue" :placeholder="inputPlaceholder" :show-password="showPassword" />
|
||||
<span v-if="subTypeSelected === 'sms'" style="margin: -1px 0 0 20px;">
|
||||
<el-button
|
||||
:disabled="smsBtnDisabled"
|
||||
size="mini"
|
||||
style="line-height:20px; float: right;"
|
||||
type="primary"
|
||||
@click="sendSMSCode"
|
||||
>
|
||||
{{ smsBtnText }}
|
||||
</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="margin: 10px auto;">
|
||||
<el-col :md="24" :sm="24">
|
||||
<el-button class="confirm-btn" size="mini" type="primary" @click="handleConfirm">
|
||||
{{ this.$t('common.Confirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'UserConfirmDialog',
|
||||
components: {
|
||||
Dialog
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
handler: {
|
||||
type: Function,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: this.$t('common.CurrentUserVerify'),
|
||||
smsWidth: 0,
|
||||
subTypeSelected: '',
|
||||
inputPlaceholder: '',
|
||||
smsBtnText: this.$t('common.SendVerificationCode'),
|
||||
smsBtnDisabled: false,
|
||||
confirmTypeRequired: '',
|
||||
subTypeChoices: [],
|
||||
secretValue: '',
|
||||
visible: false,
|
||||
callback: null,
|
||||
cancel: null,
|
||||
processing: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showPassword() {
|
||||
return this.confirmTypeRequired === 'password'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// const onRecvCallback = _.debounce(this.performConfirm, 500)
|
||||
this.$eventBus.$on('showConfirmDialog', this.performConfirm)
|
||||
},
|
||||
methods: {
|
||||
handleSubTypeChange(val) {
|
||||
this.inputPlaceholder = this.subTypeChoices.filter(item => item.name === val)[0]?.placeholder
|
||||
this.smsWidth = val === 'sms' ? 6 : 0
|
||||
},
|
||||
performConfirm({ response, callback, cancel }) {
|
||||
if (this.processing || this.visible) {
|
||||
return
|
||||
}
|
||||
this.processing = true
|
||||
this.callback = callback
|
||||
this.cancel = cancel
|
||||
this.$log.debug('perform confirm action')
|
||||
const confirmType = response.data?.code
|
||||
const confirmUrl = '/api/v1/authentication/confirm/'
|
||||
this.$axios.get(confirmUrl, { params: { confirm_type: confirmType }}).then((data) => {
|
||||
this.confirmTypeRequired = data.confirm_type
|
||||
|
||||
if (this.confirmTypeRequired === 'relogin') {
|
||||
this.$axios.post(confirmUrl, { 'confirm_type': 'relogin', 'secret_key': 'x' }).then(() => {
|
||||
this.callback()
|
||||
this.visible = false
|
||||
}).catch(() => {
|
||||
this.title = this.$t('auth.NeedReLogin')
|
||||
this.visible = true
|
||||
})
|
||||
}
|
||||
this.subTypeChoices = data.content
|
||||
const defaultSubType = this.subTypeChoices.filter(item => !item.disabled)[0]
|
||||
this.subTypeSelected = defaultSubType.name
|
||||
this.inputPlaceholder = defaultSubType.placeholder
|
||||
this.visible = true
|
||||
}).catch((err) => {
|
||||
const data = err.response?.data
|
||||
const msg = data?.error || data?.detail || data?.msg || this.$t('common.GetConfirmTypeFailed')
|
||||
this.$message.error(msg)
|
||||
this.cancel(err)
|
||||
}).finally(() => {
|
||||
this.processing = false
|
||||
})
|
||||
},
|
||||
logout() {
|
||||
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${this.$route.fullPath}`
|
||||
},
|
||||
sendSMSCode() {
|
||||
this.$axios.post(`/api/v1/authentication/mfa/select/`, { type: 'sms' }).then(res => {
|
||||
this.$message.success(this.$tc('common.VerificationCodeSent'))
|
||||
let time = 60
|
||||
const interval = setInterval(() => {
|
||||
const originText = this.smsBtnText
|
||||
this.smsBtnText = this.$t('common.Pending') + `: ${time}`
|
||||
this.smsBtnDisabled = true
|
||||
time -= 1
|
||||
|
||||
if (time === 0) {
|
||||
this.smsBtnText = originText
|
||||
this.smsBtnDisabled = false
|
||||
clearInterval(interval)
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
},
|
||||
handleConfirm() {
|
||||
if (this.confirmTypeRequired === 'relogin') {
|
||||
return this.logout()
|
||||
}
|
||||
if (this.subTypeSelected === 'otp' && this.secretValue.length !== 6) {
|
||||
return this.$message.error(this.$tc('common.MFAErrorMsg'))
|
||||
}
|
||||
const data = {
|
||||
confirm_type: this.confirmTypeRequired,
|
||||
mfa_type: this.confirmTypeRequired === 'mfa' ? this.subTypeSelected : '',
|
||||
secret_key: this.secretValue
|
||||
}
|
||||
this.$axios.post(`/api/v1/authentication/confirm/`, data).then(res => {
|
||||
this.callback()
|
||||
this.visible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-content >>> .el-dialog__footer {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.dialog-content >>> .el-dialog {
|
||||
padding: 8px;
|
||||
|
||||
.el-dialog__body {
|
||||
padding-top: 30px;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-btn {
|
||||
width: 100%;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -1,206 +0,0 @@
|
||||
<template>
|
||||
<div class="asset-select-dialog">
|
||||
<Select2
|
||||
ref="select2"
|
||||
v-model="select2Config.value"
|
||||
v-bind="select2Config"
|
||||
@input="onInputChange"
|
||||
@focus.stop="handleFocus"
|
||||
v-on="$listeners"
|
||||
/>
|
||||
<Dialog
|
||||
v-if="dialogVisible"
|
||||
:title="this.$t('assets.Assets')"
|
||||
:visible.sync="dialogVisible"
|
||||
custom-class="asset-select-dialog"
|
||||
width="80vw"
|
||||
top="1vh"
|
||||
@confirm="handleConfirm"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<TreeTable
|
||||
ref="ListPage"
|
||||
:tree-setting="treeSetting"
|
||||
:table-config="tableConfig"
|
||||
:header-actions="headerActions"
|
||||
/>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TreeTable from '@/components/TreeTable'
|
||||
import { DetailFormatter } from '@/components/TableFormatters'
|
||||
import Select2 from '@/components/FormFields/Select2'
|
||||
import Dialog from '@/components/Dialog'
|
||||
|
||||
export default {
|
||||
componentName: 'AssetSelect',
|
||||
components: { TreeTable, Select2, Dialog },
|
||||
props: {
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
canSelect: {
|
||||
type: Function,
|
||||
default(row, index) {
|
||||
return true
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
type: [Boolean, Function],
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const select2Config = {
|
||||
value: this.value,
|
||||
multiple: true,
|
||||
clearable: true,
|
||||
ajax: {
|
||||
url: '/api/v1/assets/assets/?fields_size=mini',
|
||||
transformOption: (item) => {
|
||||
return { label: item.hostname + '(' + item.ip + ')', value: item.id }
|
||||
}
|
||||
}
|
||||
}
|
||||
const vm = this
|
||||
return {
|
||||
dialogVisible: false,
|
||||
initialValue: _.cloneDeep(this.value),
|
||||
rowSelected: [],
|
||||
initSelection: null,
|
||||
treeSetting: {
|
||||
showMenu: false,
|
||||
showRefresh: true,
|
||||
showAssets: false,
|
||||
url: '/api/v1/assets/assets/?fields_size=mini',
|
||||
nodeUrl: '/api/v1/assets/nodes/',
|
||||
// ?assets=0不显示资产. =1显示资产
|
||||
treeUrl: '/api/v1/assets/nodes/children/tree/?assets=0'
|
||||
},
|
||||
select2Config: select2Config,
|
||||
dialogSelect2Config: select2Config,
|
||||
tableConfig: {
|
||||
url: '/api/v1/assets/assets/?fields_size=mini',
|
||||
hasTree: true,
|
||||
canSelect: this.canSelect,
|
||||
columns: [
|
||||
{
|
||||
prop: 'hostname',
|
||||
label: this.$t('assets.Hostname'),
|
||||
sortable: true,
|
||||
showOverflowTooltip: true,
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
route: 'AssetDetail'
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'ip',
|
||||
label: this.$t('assets.ipDomain'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'platform',
|
||||
label: this.$t('assets.Platform'),
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'protocols',
|
||||
formatter: function(row) {
|
||||
return <span> {row.protocols.toString()} </span>
|
||||
},
|
||||
label: this.$t('assets.Protocols')
|
||||
}
|
||||
],
|
||||
listeners: {
|
||||
'toggle-row-selection': (isSelected, row) => {
|
||||
if (isSelected) {
|
||||
vm.addRowToSelect(row)
|
||||
} else {
|
||||
vm.removeRowFromSelect(row)
|
||||
}
|
||||
}
|
||||
},
|
||||
theRowDefaultIsSelected: (row) => {
|
||||
return this.value.indexOf(row.id) > -1
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: false,
|
||||
hasRightActions: false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleFocus() {
|
||||
this.$refs.select2.selectRef.blur()
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleConfirm() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.select2.iValue = this.initialValue
|
||||
this.dialogVisible = false
|
||||
},
|
||||
onInputChange(val) {
|
||||
this.$emit('change', val)
|
||||
},
|
||||
addToSelect(options, row) {
|
||||
const selectOptionsHas = options.find(item => item.value === row.id)
|
||||
// 如果select2的options中没有,那么可能无法显示正常的值
|
||||
if (selectOptionsHas === undefined) {
|
||||
const option = {
|
||||
label: `${row.hostname}(${row.ip})`,
|
||||
value: row.id
|
||||
}
|
||||
options.push(option)
|
||||
}
|
||||
},
|
||||
addRowToSelect(row) {
|
||||
const outSelectOptions = this.$refs.select2.options
|
||||
this.addToSelect(outSelectOptions, row)
|
||||
|
||||
const selectValue = this.$refs.select2.iValue
|
||||
const selectValueIndex = selectValue.indexOf(row.id)
|
||||
if (selectValueIndex === -1) {
|
||||
selectValue.push(row.id)
|
||||
}
|
||||
this.onInputChange(selectValue)
|
||||
},
|
||||
removeRowFromSelect(row) {
|
||||
const selectValue = this.$refs.select2.iValue
|
||||
const selectValueIndex = selectValue.indexOf(row.id)
|
||||
if (selectValueIndex > -1) {
|
||||
selectValue.splice(selectValueIndex, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.el-select{
|
||||
width: 100%;
|
||||
}
|
||||
.page ::v-deep .page-heading{
|
||||
display: none;
|
||||
}
|
||||
.el-dialog__wrapper ::v-deep .el-dialog__body{
|
||||
padding: 5px 10px;
|
||||
}
|
||||
.page ::v-deep .treebox {
|
||||
height: inherit !important;
|
||||
}
|
||||
.asset-select-dialog >>> .transition-box:first-child {
|
||||
background-color: #f3f3f3 ;
|
||||
}
|
||||
|
||||
.el-dialog__wrapper ::v-deep .el-dialog__body .wrapper-content {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -1,117 +0,0 @@
|
||||
<template>
|
||||
<DataForm ref="dataForm" v-loading="loading" :fields="totalFields" :form="iForm" v-bind="$attrs" v-on="$listeners">
|
||||
<FormGroupHeader
|
||||
v-for="(group, i) in groups"
|
||||
:slot="'id:'+group.name"
|
||||
:key="'group-'+group.name"
|
||||
:group="group"
|
||||
:index="i"
|
||||
:line="i !== 0"
|
||||
/>
|
||||
</DataForm>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DataForm from '../DataForm'
|
||||
import FormGroupHeader from '@/components/FormGroupHeader'
|
||||
import { FormFieldGenerator } from '@/components/AutoDataForm/utils'
|
||||
export default {
|
||||
name: 'AutoDataForm',
|
||||
components: {
|
||||
DataForm,
|
||||
FormGroupHeader
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
method: {
|
||||
type: String,
|
||||
default: 'post'
|
||||
},
|
||||
fields: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
fieldsMeta: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
remoteMeta: {},
|
||||
totalFields: [],
|
||||
loading: true,
|
||||
groups: [],
|
||||
iForm: this.form,
|
||||
errors: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.optionUrlMetaAndGenerateColumns()
|
||||
},
|
||||
methods: {
|
||||
optionUrlMetaAndGenerateColumns() {
|
||||
this.$store.dispatch('common/getUrlMeta', { url: this.url }).then(data => {
|
||||
this.remoteMeta = data.actions[this.method.toUpperCase()] || {}
|
||||
this.generateColumns()
|
||||
this.cleanFormValue()
|
||||
}).catch(err => {
|
||||
this.$log.error(err)
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
generateColumns() {
|
||||
const generator = new FormFieldGenerator()
|
||||
this.totalFields = generator.generateFields(this.fields, this.fieldsMeta, this.remoteMeta)
|
||||
this.groups = generator.groups
|
||||
this.$log.debug('Total fields: ', this.totalFields)
|
||||
},
|
||||
_cleanFormValue(form, remoteMeta) {
|
||||
for (const [k, v] of Object.entries(remoteMeta)) {
|
||||
if (v.default === undefined) {
|
||||
continue
|
||||
}
|
||||
const valueSet = form[k]
|
||||
if (valueSet !== undefined) {
|
||||
continue
|
||||
}
|
||||
if (v.type === 'nested object' && typeof valueSet === 'object') {
|
||||
this._cleanFormValue(valueSet, v.children)
|
||||
}
|
||||
form[k] = v.default
|
||||
}
|
||||
},
|
||||
cleanFormValue() {
|
||||
this._cleanFormValue(this.iForm, this.remoteMeta)
|
||||
},
|
||||
setFieldError(name, error) {
|
||||
const field = this.totalFields.find((v) => v.prop === name)
|
||||
if (!field) {
|
||||
return
|
||||
}
|
||||
if (field.attrs.error === error) {
|
||||
error += '.'
|
||||
}
|
||||
if (field.type === 'nestedField') {
|
||||
field.el.errors = error
|
||||
} else {
|
||||
field.attrs.error = error
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
106
src/components/Cards/DetailCard/ItemValue.vue
Normal file
106
src/components/Cards/DetailCard/ItemValue.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<script type="text/jsx">
|
||||
import { toSafeLocalDateStr } from '@/utils/common'
|
||||
|
||||
export default {
|
||||
name: 'ItemValue',
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number, Function, Array, Object, Boolean],
|
||||
default: ''
|
||||
},
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
formatter: {
|
||||
type: Function,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formatterData: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
displayValue() {
|
||||
if ([null, undefined, ''].includes(this.value)) {
|
||||
return '-'
|
||||
}
|
||||
if (typeof this.value === 'boolean') {
|
||||
return this.toChoicesDisplay(this.value)
|
||||
} else if (typeof this.value === 'object') {
|
||||
return this.value
|
||||
} else if (this.value instanceof Array) {
|
||||
return this.value.map(item => {
|
||||
if (typeof item === 'object') {
|
||||
return item.label || item.title
|
||||
} else {
|
||||
return item
|
||||
}
|
||||
}).join(', ')
|
||||
} else if (this.isDatetime(this.value)) {
|
||||
return toSafeLocalDateStr(this.value)
|
||||
} else {
|
||||
return this.value
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toChoicesDisplay(value) {
|
||||
if (!value) {
|
||||
return this.$t('common.No')
|
||||
}
|
||||
return this.$t('common.Yes')
|
||||
},
|
||||
isDatetime(value) {
|
||||
if (typeof value !== 'string') {
|
||||
return false
|
||||
}
|
||||
if (value.split(' ').length !== 3) {
|
||||
return false
|
||||
}
|
||||
if (value.split(' ')[1].split(':').length !== 3) {
|
||||
return false
|
||||
}
|
||||
if (isNaN(value) && !isNaN(Date.parse(value))) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
},
|
||||
render(h) {
|
||||
if (typeof this.formatter === 'function') {
|
||||
const data = this.formatter(this.item, this.value)
|
||||
if (data instanceof Promise) {
|
||||
data.then(res => {
|
||||
this.formatterData = res
|
||||
})
|
||||
} else {
|
||||
this.formatterData = data
|
||||
}
|
||||
return (
|
||||
<span>{this.formatterData}</span>
|
||||
)
|
||||
}
|
||||
if (this.value instanceof Array) {
|
||||
const newArr = this.value || []
|
||||
return (
|
||||
<span>
|
||||
{
|
||||
newArr.map((item, index) => <div key={index}>{item.key}:{item.value} </div>)
|
||||
}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<span>{this.displayValue}</span>
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
a {
|
||||
color: var(--color-success);
|
||||
}
|
||||
</style>
|
||||
173
src/components/Cards/DetailCard/auto.vue
Normal file
173
src/components/Cards/DetailCard/auto.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<DetailCard v-if="!loading && hasObject && items.length > 0" :items="items" v-bind="$attrs" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DetailCard from './index.vue'
|
||||
import { copy, toSafeLocalDateStr } from '@/utils/common'
|
||||
|
||||
export default {
|
||||
name: 'AutoDetailCard',
|
||||
components: { DetailCard },
|
||||
props: {
|
||||
object: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
fields: {
|
||||
type: Array,
|
||||
default: null
|
||||
},
|
||||
excludes: {
|
||||
type: Array,
|
||||
default: null
|
||||
},
|
||||
showUndefine: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
formatters: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
nested: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
items: [],
|
||||
loading: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iObject() {
|
||||
if (this.nested) {
|
||||
return this.object[this.nested] || {}
|
||||
} else {
|
||||
return this.object
|
||||
}
|
||||
},
|
||||
hasObject() {
|
||||
return Object.keys(this.iObject).length > 0
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.optionAndGenFields()
|
||||
this.loading = false
|
||||
},
|
||||
methods: {
|
||||
defaultFormatter(fields) {
|
||||
const formatter = {}
|
||||
for (const name of fields) {
|
||||
formatter[name] = function(item, val) {
|
||||
if (val === '-') {
|
||||
return <span>{'-'}</span>
|
||||
}
|
||||
return (<span style={{ cursor: 'pointer' }} onClick={() => copy(val)}>
|
||||
{val}
|
||||
</span>)
|
||||
}
|
||||
}
|
||||
return formatter
|
||||
},
|
||||
async optionAndGenFields() {
|
||||
const data = await this.$store.dispatch('common/getUrlMeta', { url: this.url })
|
||||
let remoteMeta = data.actions['GET'] || {}
|
||||
if (this.nested) {
|
||||
remoteMeta = remoteMeta[this.nested]?.children || {}
|
||||
}
|
||||
let fields = this.fields
|
||||
fields = fields || Object.keys(remoteMeta)
|
||||
const defaultExcludes = ['org_id']
|
||||
const excludes = (this.excludes || []).concat(defaultExcludes)
|
||||
fields = fields.filter(item => !excludes.includes(item))
|
||||
const defaultFormatter = this.defaultFormatter(fields)
|
||||
for (const name of fields) {
|
||||
if (typeof name === 'object') {
|
||||
this.items.push(name)
|
||||
continue
|
||||
}
|
||||
const fieldMeta = remoteMeta[name]
|
||||
if (!fieldMeta) {
|
||||
continue
|
||||
}
|
||||
if (fieldMeta['write_only']) {
|
||||
continue
|
||||
}
|
||||
|
||||
let value = this.iObject[name]
|
||||
const label = fieldMeta.label
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
if (typeof value[0] === 'object') {
|
||||
value.forEach(item => {
|
||||
const fieldName = `${name}.${item.name}`
|
||||
if (excludes.includes(fieldName)) {
|
||||
return
|
||||
}
|
||||
this.items.push({
|
||||
key: item.label,
|
||||
value: item.value
|
||||
})
|
||||
})
|
||||
} else if (typeof value[0] === 'string') {
|
||||
value.forEach((item, index) => {
|
||||
let data = {}
|
||||
if (index === 0) {
|
||||
data = {
|
||||
key: label,
|
||||
value: value[index]
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
value: value[index]
|
||||
}
|
||||
}
|
||||
this.items.push(data)
|
||||
})
|
||||
}
|
||||
continue
|
||||
}
|
||||
if (value === null || value === '') {
|
||||
value = '-'
|
||||
} else if (fieldMeta.type === 'datetime') {
|
||||
value = toSafeLocalDateStr(value)
|
||||
} else if (fieldMeta.type === 'labeled_choice') {
|
||||
value = value?.['label']
|
||||
} else if (fieldMeta.type === 'related_field' || fieldMeta.type === 'nested object') {
|
||||
value = value?.['name']
|
||||
} else if (fieldMeta.type === 'm2m_related_field') {
|
||||
value = value?.map(item => item['name']).join(', ')
|
||||
} else if (fieldMeta.type === 'boolean') {
|
||||
value = value ? this.$t('common.Yes') : this.$t('common.No')
|
||||
}
|
||||
|
||||
if (value === undefined) {
|
||||
if (this.showUndefine) {
|
||||
value = '-'
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
const item = {
|
||||
key: label,
|
||||
value: value,
|
||||
formatter: this.formatters[name] || defaultFormatter[name]
|
||||
}
|
||||
this.items.push(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
82
src/components/Cards/DetailCard/index.vue
Normal file
82
src/components/Cards/DetailCard/index.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<IBox :fa="fa" :title="title">
|
||||
<el-form class="content" label-position="left" label-width="25%">
|
||||
<el-form-item v-for="item in items" :key="item.key" :label="item.key">
|
||||
<ItemValue :value="item.value" class="item-value" v-bind="item" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<slot />
|
||||
</IBox>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IBox from '../../IBox/index.vue'
|
||||
import ItemValue from './ItemValue.vue'
|
||||
|
||||
export default {
|
||||
name: 'DetailCard',
|
||||
components: { IBox, ItemValue },
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('common.BasicInfo')
|
||||
}
|
||||
},
|
||||
fa: {
|
||||
type: String,
|
||||
default: 'fa-info-circle'
|
||||
},
|
||||
items: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
align: {
|
||||
type: String,
|
||||
default: 'left'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-card__body {
|
||||
padding: 20px 40px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
border-bottom: 1px dashed #EBEEF5;
|
||||
padding: 1px 0;
|
||||
margin-bottom: 0;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
}
|
||||
|
||||
>>> .el-form-item__label {
|
||||
padding-right: 8%;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
>>> .el-form-item__content {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
>>> .el-tag--mini {
|
||||
margin-right: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.item-value span {
|
||||
word-break: break-word;
|
||||
}
|
||||
.content {
|
||||
font-size: 13px;
|
||||
line-height: 2.5;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<IBox :fa="icon" :type="type" :title="title" v-bind="$attrs">
|
||||
<table style="width: 100%;table-layout:fixed;" class="CardTable">
|
||||
<IBox :title="title" :type="type" v-bind="$attrs">
|
||||
<table class="CardTable" style="width: 100%;table-layout:fixed;">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<Select2 ref="select2" v-model="select2.value" :disabled="iDisabled" v-bind="select2" />
|
||||
@@ -9,7 +9,7 @@
|
||||
<slot />
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<el-button :type="type" size="small" :loading="submitLoading" :disabled="iDisabled" @click="addObjects">
|
||||
<el-button :disabled="iDisabled" :loading="submitLoading" :type="type" size="small" @click="addObjects">
|
||||
{{ $t('common.Add') }}
|
||||
</el-button>
|
||||
</td>
|
||||
@@ -17,12 +17,12 @@
|
||||
<template v-if="showHasObjects">
|
||||
<tr v-for="obj of iHasObjects" :key="obj.value" class="item">
|
||||
<td style="width: 100%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
|
||||
<el-tooltip style="margin: 4px;" effect="dark" :content="obj.label" placement="left">
|
||||
<el-tooltip :content="obj.label" effect="dark" placement="left" style="margin: 4px;">
|
||||
<b>{{ obj.label }}</b>
|
||||
</el-tooltip>
|
||||
</td>
|
||||
<td>
|
||||
<el-button size="mini" :disabled="iDisabled" type="danger" style="float: right" @click="removeObject(obj)">
|
||||
<el-button :disabled="iDisabled" size="mini" style="float: right" type="danger" @click="removeObject(obj)">
|
||||
<i class="fa fa-minus" />
|
||||
</el-button>
|
||||
</td>
|
||||
@@ -30,7 +30,7 @@
|
||||
</template>
|
||||
<tr v-if="params.hasMore && showHasMore" class="item">
|
||||
<td colspan="2">
|
||||
<el-button :type="type" :disabled="iDisabled" size="small" style="width: 100%" @click="loadMore">
|
||||
<el-button :disabled="iDisabled" :type="type" size="small" style="width: 100%" @click="loadMore">
|
||||
<i class="fa fa-arrow-down" />
|
||||
{{ $t('common.More') }}
|
||||
</el-button>
|
||||
@@ -41,10 +41,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Select2 from '../FormFields/Select2'
|
||||
import IBox from '../IBox'
|
||||
import Select2 from '@/components/Form/FormFields/Select2.vue'
|
||||
import IBox from '../../IBox/index.vue'
|
||||
import { createSourceIdCache } from '@/api/common'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'RelationCard',
|
||||
components: {
|
||||
@@ -117,6 +118,22 @@ export default {
|
||||
that.$message.success(that.$t('common.RemoveSuccessMsg'))
|
||||
}
|
||||
},
|
||||
onDeleteFail: {
|
||||
type: Function,
|
||||
default(error, that) {
|
||||
let msg = ''
|
||||
const data = error.response.data
|
||||
for (const item of Object.keys(data)) {
|
||||
const value = data[item]
|
||||
if (value instanceof Array) {
|
||||
msg = value.join(',')
|
||||
} else {
|
||||
msg = value
|
||||
}
|
||||
}
|
||||
that.$message.error(msg)
|
||||
}
|
||||
},
|
||||
performAdd: {
|
||||
type: Function,
|
||||
default: (objects, that) => {}
|
||||
@@ -248,7 +265,9 @@ export default {
|
||||
removeObject(obj) {
|
||||
this.performDelete(obj, this).then(
|
||||
() => this.onDeleteSuccess(obj, this)
|
||||
)
|
||||
).catch(error => {
|
||||
this.onDeleteFail(error, this)
|
||||
})
|
||||
},
|
||||
addObjects() {
|
||||
const objects = this.$refs.select2.$refs.select.selected.map(item => ({ label: item.label, value: item.value }))
|
||||
@@ -10,7 +10,7 @@
|
||||
placement="bottom-start"
|
||||
@command="handleDropdownCallback"
|
||||
>
|
||||
<el-button :size="size" v-bind="cleanButtonAction(action)">
|
||||
<el-button class="more-action" :size="size" v-bind="cleanButtonAction(action)">
|
||||
{{ action.title }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown" style="overflow: auto;max-height: 60vh">
|
||||
@@ -28,6 +28,10 @@
|
||||
:command="[option, action]"
|
||||
v-bind="option"
|
||||
>
|
||||
<span v-if="option.fa">
|
||||
<i v-if="option.fa.startsWith('fa-')" :class="'fa ' + option.fa" />
|
||||
<svg-icon v-else :icon-class="option.fa" style="font-size: 14px; margin-right: 2px; margin-left: -2px;" />
|
||||
</span>
|
||||
{{ option.title }}
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
@@ -44,7 +48,11 @@
|
||||
>
|
||||
<el-tooltip :disabled="!action.tip" :content="action.tip" placement="top">
|
||||
<span>
|
||||
<i v-if="action.fa" :class="'fa ' + action.fa" />{{ action.title }}
|
||||
<span v-if="action.fa" style="vertical-align: initial;">
|
||||
<i v-if="action.fa.startsWith('fa-')" :class="'fa ' + action.fa" />
|
||||
<svg-icon v-else :icon-class="action.fa" style="font-size: 14px;" />
|
||||
</span>
|
||||
{{ action.title }}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
@@ -153,7 +161,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
.layout {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -181,4 +189,22 @@ export default {
|
||||
.el-button-ungroup .action-item:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
::v-deep .more-batch-processing {
|
||||
&.el-dropdown-menu__item--divided {
|
||||
margin-top: 0;
|
||||
border-top: none;
|
||||
color: #909399;
|
||||
cursor: auto;
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
border-bottom: 1px solid #E4E7ED;
|
||||
&:before {
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
&.el-dropdown-menu__item:not(.is-disabled):hover {
|
||||
color: #909399;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
import i18n from '@/i18n/i18n'
|
||||
|
||||
export const Required = {
|
||||
required: true, message: i18n.t('common.fieldRequiredError'), trigger: 'blur'
|
||||
}
|
||||
|
||||
export const RequiredChange = {
|
||||
required: true, message: i18n.t('common.fieldRequiredError'), trigger: 'change'
|
||||
}
|
||||
|
||||
export const EmailCheck = {
|
||||
type: 'email',
|
||||
message: i18n.t('common.InputEmailAddress'),
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
|
||||
export default {
|
||||
Required,
|
||||
RequiredChange,
|
||||
EmailCheck
|
||||
}
|
||||
|
||||
export const JsonRequired = {
|
||||
required: true,
|
||||
trigger: 'change',
|
||||
validator: (rule, value, callback) => {
|
||||
try {
|
||||
JSON.parse(value)
|
||||
callback()
|
||||
} catch (e) {
|
||||
callback(new Error(i18n.t('common.InvalidJson')))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
.el-data-table ::v-deep .el-pagination{
|
||||
text-align: center !important;
|
||||
}
|
||||
.el-data-table ::v-deep .el-table td{
|
||||
padding: 4px 0;
|
||||
}
|
||||
.el-data-table ::v-deep .el-table th{
|
||||
padding: 4px 0;
|
||||
}
|
||||
.el-data-table ::v-deep .el-form-item{
|
||||
margin-bottom:10px !important ;
|
||||
margin-top:10px;
|
||||
}
|
||||
.el-data-table ::v-deep .el-pagination{
|
||||
padding:15px 0 !important ;
|
||||
}
|
||||
@@ -1,221 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<ul v-show="loading" class="ztree">
|
||||
{{ this.$t('common.tree.Loading') }}...
|
||||
</ul>
|
||||
<div v-show="!loading" class="treebox">
|
||||
<ul :id="iZTreeID" class="ztree">
|
||||
{{ this.$t('common.tree.Loading') }}...
|
||||
</ul>
|
||||
<div v-if="treeSetting.treeUrl===''">
|
||||
{{ this.$t('common.tree.Empty') }}<a id="tree-refresh"><i class="fa fa-refresh" /></a>
|
||||
</div>
|
||||
</div>
|
||||
<div :id="iRMenuID" class="rMenu">
|
||||
<ul class="dropdown-menu menu-actions">
|
||||
<slot name="rMenu" />
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 导入JQuery
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import $ from '@/utils/jquery-vendor.js'
|
||||
import '@ztree/ztree_v3/js/jquery.ztree.all.min.js'
|
||||
import '@/styles/ztree.css'
|
||||
import axiosRetry from 'axios-retry'
|
||||
|
||||
const defaultObject = {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
export default {
|
||||
name: 'ZTree',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
setting: defaultObject
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
iZTreeID: `zTree_${this._uid}`,
|
||||
iRMenuID: `rMenu_${this._uid}`,
|
||||
zTree: '',
|
||||
rMenu: '',
|
||||
init: false,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
treeSetting() {
|
||||
return this.setting
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initTree()
|
||||
// $('.treebox').css('height', window.innerHeight - 60)
|
||||
},
|
||||
beforeDestroy() {
|
||||
$.fn.zTree.destroy(this.iZTreeID)
|
||||
},
|
||||
methods: {
|
||||
initTree: function() {
|
||||
const vm = this
|
||||
let treeUrl
|
||||
if (this.init) {
|
||||
this.loading = true
|
||||
}
|
||||
if (this.init && this.treeSetting.treeUrl.indexOf('/perms/') !== -1 && this.treeSetting.treeUrl.indexOf('rebuild_tree') === -1) {
|
||||
treeUrl = (this.treeSetting.treeUrl.indexOf('?') === -1) ? `${this.treeSetting.treeUrl}?rebuild_tree=1` : `${this.treeSetting.treeUrl}&rebuild_tree=1`
|
||||
} else {
|
||||
treeUrl = this.treeSetting.treeUrl
|
||||
}
|
||||
this.$axios.get(treeUrl, {
|
||||
'axios-retry': {
|
||||
retries: 20,
|
||||
retryCondition: e => {
|
||||
return axiosRetry.isNetworkOrIdempotentRequestError(e) || e.response.status === 409
|
||||
},
|
||||
shouldResetTimeout: true,
|
||||
retryDelay: () => { return 5000 }
|
||||
}
|
||||
}).then(res => {
|
||||
if (!res) {
|
||||
res = []
|
||||
}
|
||||
if (res.length === 0) {
|
||||
res.push({
|
||||
name: this.$t('common.tree.Empty')
|
||||
})
|
||||
}
|
||||
this.treeSetting.treeUrl = treeUrl
|
||||
if (this.init) {
|
||||
vm.zTree.destroy()
|
||||
}
|
||||
this.zTree = $.fn.zTree.init($(`#${this.iZTreeID}`), this.treeSetting, res)
|
||||
// 手动上报事件, Tree加载完成
|
||||
this.$emit('TreeInitFinish', this.zTree)
|
||||
if (this.treeSetting.showRefresh) {
|
||||
this.rootNodeAddDom(
|
||||
this.zTree,
|
||||
this.treeSetting.callback.refresh
|
||||
)
|
||||
}
|
||||
|
||||
if (this.treeSetting.showMenu) {
|
||||
this.rMenu = $(`#${this.iRMenuID}`)
|
||||
}
|
||||
if (this.treeSetting.otherMenu) {
|
||||
$('.menu-actions').append(this.otherMenu)
|
||||
}
|
||||
}).finally(_ => {
|
||||
vm.loading = false
|
||||
vm.init = true
|
||||
})
|
||||
},
|
||||
rootNodeAddDom: function(ztree, callback) {
|
||||
const vm = this
|
||||
const refreshIcon = "<a id='tree-refresh'><i class='fa fa-refresh'></i></a>"
|
||||
const rootNode = ztree.getNodes()[0]
|
||||
let $rootNodeRef
|
||||
if (rootNode) {
|
||||
$rootNodeRef = $('#' + rootNode.tId + '_a')
|
||||
$rootNodeRef.after(refreshIcon)
|
||||
} else {
|
||||
$rootNodeRef = $('#' + ztree.setting.treeId)
|
||||
$rootNodeRef.html(refreshIcon)
|
||||
}
|
||||
const refreshIconRef = $('#tree-refresh')
|
||||
refreshIconRef.bind('click', function() {
|
||||
const result = callback()
|
||||
if (result && result.then) {
|
||||
result.finally(() => {
|
||||
vm.initTree()
|
||||
})
|
||||
} else {
|
||||
vm.initTree()
|
||||
}
|
||||
})
|
||||
},
|
||||
refresh: function() {
|
||||
const refreshIconRef = $('#tree-refresh')
|
||||
refreshIconRef.click()
|
||||
},
|
||||
getCheckedNodes: function() {
|
||||
return this.zTree.getCheckedNodes(true)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
div.rMenu {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
text-align: left;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 999;
|
||||
float: left;
|
||||
padding: 0 0;
|
||||
margin: 2px 0 0;
|
||||
list-style: none;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
.dataTables_wrapper .dataTables_processing {
|
||||
opacity: .9;
|
||||
border: none;
|
||||
}
|
||||
div.rMenu li{
|
||||
margin: 6px 0;
|
||||
cursor: pointer;
|
||||
list-style: none outside none;
|
||||
}
|
||||
.dropdown-menu {
|
||||
border: medium none;
|
||||
min-width: 160px;
|
||||
background-color: #fff;
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 0 3px rgba(86, 96, 117, 0.7);
|
||||
display: block;
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
left: 0;
|
||||
list-style: none outside none;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
text-shadow: none;
|
||||
top: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
.ztree ::v-deep .fa-refresh {
|
||||
font: normal normal normal 14px/1 FontAwesome !important;
|
||||
}
|
||||
.dropdown a:hover {
|
||||
background-color: #f1f1f1
|
||||
}
|
||||
.dropdown-menu > li > a {
|
||||
border-radius: 3px;
|
||||
color: inherit;
|
||||
line-height: 25px;
|
||||
margin: 4px;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
display: block;
|
||||
padding: 3px 20px;
|
||||
clear: both;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.dropdown-menu>li>a:hover, .dropdown-menu>li>a:focus {
|
||||
color: #262626;
|
||||
text-decoration: none;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.treebox {
|
||||
height: 80vh;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -1,57 +0,0 @@
|
||||
<script type="text/jsx">
|
||||
export default {
|
||||
name: 'ItemValue',
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number, Function, Array, Object, Boolean],
|
||||
default: ''
|
||||
},
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
formatter: {
|
||||
type: Function,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toChoicesDisplay(value) {
|
||||
if (!value) {
|
||||
return this.$t('common.No')
|
||||
}
|
||||
return this.$t('common.Yes')
|
||||
}
|
||||
},
|
||||
render(h) {
|
||||
if (typeof this.formatter === 'function') {
|
||||
return this.formatter(this.item, this.value)
|
||||
}
|
||||
if (typeof this.value === 'boolean') {
|
||||
return (
|
||||
<span class='item-value'>{this.toChoicesDisplay(this.value)}</span>
|
||||
)
|
||||
}
|
||||
if (this.value instanceof Array) {
|
||||
const newArr = this.value || []
|
||||
return (
|
||||
<span class='item-value'>
|
||||
{
|
||||
newArr.map((item, index) => <div key={index}>{item.key}:{item.value} </div>)
|
||||
}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<span class='item-value'>{this.value}</span>
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.item-value {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -1,54 +0,0 @@
|
||||
<template>
|
||||
<IBox :title="title" fa="fa-info-circle">
|
||||
<div class="content">
|
||||
<el-row v-if="this.$route.params.id" :gutter="10" class="item">
|
||||
<el-col :span="6"><div :style="{ 'text-align': align }" class="item-label"><label>ID: </label></div></el-col>
|
||||
<el-col :span="18"><div class="item-text">{{ this.$route.params.id }}</div></el-col>
|
||||
</el-row>
|
||||
<el-row v-for="item in items" :key="'card-' + item.key" :gutter="10" class="item">
|
||||
<el-col :span="6">
|
||||
<div :style="{ 'text-align': align }" class="item-label"><label>{{ item.key }}: </label></div>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<div class="item-text">
|
||||
<ItemValue :value="item.value" v-bind="item" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<slot />
|
||||
</div>
|
||||
</IBox>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IBox from '../IBox'
|
||||
import ItemValue from './ItemValue'
|
||||
|
||||
export default {
|
||||
name: 'DetailCard',
|
||||
components: { IBox, ItemValue },
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('common.BasicInfo')
|
||||
}
|
||||
},
|
||||
items: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
align: {
|
||||
type: String,
|
||||
default: 'left'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
font-size: 13px;
|
||||
line-height: 2.5;
|
||||
}
|
||||
</style>
|
||||
105
src/components/Dialog/DiffDetail.vue
Normal file
105
src/components/Dialog/DiffDetail.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<Dialog
|
||||
v-if="detailVisible"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:title="title"
|
||||
:visible.sync="detailVisible"
|
||||
>
|
||||
<div>
|
||||
<div v-if="isEmpty()" style="text-align: center">
|
||||
{{ this.$tc('common.NoContent') }}
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-table
|
||||
:data="diff"
|
||||
class="diffTable"
|
||||
>
|
||||
<el-table-column
|
||||
:label="$tc('audits.ChangeField')"
|
||||
:prop="fieldName"
|
||||
show-overflow-tooltip
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
:label="$tc('audits.BeforeChange')"
|
||||
:prop="leftKeyName"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
:label="$tc('audits.AfterChange')"
|
||||
:prop="rightKeyName"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog/index'
|
||||
|
||||
export default {
|
||||
name: 'DiffDetail',
|
||||
components: {
|
||||
Dialog
|
||||
},
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: () => ''
|
||||
},
|
||||
fieldName: {
|
||||
type: String,
|
||||
default: () => 'field'
|
||||
},
|
||||
leftKeyName: {
|
||||
type: String,
|
||||
default: () => 'before'
|
||||
},
|
||||
rightKeyName: {
|
||||
type: String,
|
||||
default: () => 'after'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
diff: [],
|
||||
detailVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isEmpty() {
|
||||
const content = this.diff
|
||||
return !content || JSON.stringify(content) === '{}'
|
||||
},
|
||||
show(data) {
|
||||
this.diff = data
|
||||
this.detailVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.el-tag {
|
||||
width: 100%;
|
||||
white-space: normal;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.el-table::before {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.diffTable {
|
||||
width: 100%;
|
||||
max-height: 80vh;
|
||||
|
||||
& >>> td {
|
||||
padding: 5px 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,19 +1,21 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:append-to-body="true"
|
||||
:modal-append-to-body="true"
|
||||
:title="title"
|
||||
:top="top"
|
||||
:width="iWidth"
|
||||
class="dialog"
|
||||
v-bind="$attrs"
|
||||
:append-to-body="false"
|
||||
:modal-append-to-body="false"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<slot />
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<slot name="footer">
|
||||
<el-button v-if="showCancel" size="small" @click="onCancel">{{ cancelTitle }}</el-button>
|
||||
<el-button v-if="showConfirm" type="primary" size="small" :loading="loadingStatus" @click="onConfirm">{{ confirmTitle }}</el-button>
|
||||
<el-button v-if="showCancel && showButtons" @click="onCancel">{{ cancelTitle }}</el-button>
|
||||
<el-button v-if="showConfirm && showButtons" :loading="loadingStatus" type="primary" @click="onConfirm">
|
||||
{{ confirmTitle }}
|
||||
</el-button>
|
||||
</slot>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@@ -27,16 +29,6 @@ export default {
|
||||
type: String,
|
||||
default: 'Title'
|
||||
},
|
||||
showCancel: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
cancelTitle: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('common.Cancel')
|
||||
}
|
||||
},
|
||||
top: {
|
||||
type: String,
|
||||
default: '3vh'
|
||||
@@ -49,20 +41,37 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
loadingStatus: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
confirmTitle: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('common.Confirm')
|
||||
}
|
||||
},
|
||||
showCancel: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
cancelTitle: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('common.Cancel')
|
||||
}
|
||||
},
|
||||
showButtons: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
loadingStatus: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
maxWidth: {
|
||||
type: String,
|
||||
default: '1200px'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
iWidth() {
|
||||
@@ -81,12 +90,38 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog >>> .el-dialog__header {
|
||||
/*padding-top: 10px;*/
|
||||
.dialog >>> .el-dialog {
|
||||
border-radius: 0.3em;
|
||||
max-width: 1500px;
|
||||
|
||||
.el-icon-circle-check {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&__header {
|
||||
box-sizing: border-box;
|
||||
padding: 15px 22px;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
&__body {
|
||||
padding: 20px 30px;
|
||||
|
||||
&:has(.el-table) {
|
||||
background: #f3f3f4;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
border-top: 1px solid #dee2e6;
|
||||
padding: 16px;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
padding-right: 20px;
|
||||
.dialog-footer >>> button.el-button {
|
||||
font-size: 13px;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
<template>
|
||||
<DataForm
|
||||
v-if="!loading"
|
||||
:disabled="disabled"
|
||||
:fields="iFields"
|
||||
:form="value"
|
||||
style="margin-left: -26%;margin-right: -6%"
|
||||
v-bind="kwargs"
|
||||
@change="updateValue($event)"
|
||||
@input="updateValue($event)"
|
||||
v-on="$listeners"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DataForm from '@/components/DataForm'
|
||||
import DataForm from '@/components/Form/DataForm/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'NestedField',
|
||||
@@ -28,10 +32,16 @@ export default {
|
||||
errors: {
|
||||
type: [Object, String],
|
||||
default: ''
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
formJson: JSON.stringify(this.value),
|
||||
kwargs: {
|
||||
hasReset: false,
|
||||
hasSaveContinue: false,
|
||||
@@ -60,7 +70,26 @@ export default {
|
||||
return fields
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
const valJson = JSON.stringify(val)
|
||||
// 如果不想等,证明是 value 自己变化导致的, 需要重新渲染
|
||||
if (valJson !== this.formJson) {
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 10)
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateValue(val) {
|
||||
this.formJson = JSON.stringify(val)
|
||||
this.$emit('input', val)
|
||||
},
|
||||
objectToString(obj) {
|
||||
let data = ''
|
||||
// eslint-disable-next-line prefer-const
|
||||
171
src/components/Form/AutoDataForm/index.vue
Normal file
171
src/components/Form/AutoDataForm/index.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<DataForm
|
||||
v-if="!loading"
|
||||
ref="dataForm"
|
||||
:fields="totalFields"
|
||||
:form="iForm"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<span
|
||||
v-for="(group, i) in groups"
|
||||
:key="'group-'+group.name"
|
||||
:slot="'id:'+group.name"
|
||||
>
|
||||
<FormGroupHeader
|
||||
v-if="!groupHidden(group, i)"
|
||||
:group="group"
|
||||
:index="i"
|
||||
:line="i !== 0 && !groupHidden(groups[i - 1], i - 1)"
|
||||
/>
|
||||
</span>
|
||||
</DataForm>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DataForm from '../DataForm/index.vue'
|
||||
import FormGroupHeader from '@/components/Form/FormGroupHeader/index.vue'
|
||||
import { FormFieldGenerator } from '@/components/Form/AutoDataForm/utils'
|
||||
|
||||
export default {
|
||||
name: 'AutoDataForm',
|
||||
components: {
|
||||
DataForm,
|
||||
FormGroupHeader
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
method: {
|
||||
type: String,
|
||||
default: 'post'
|
||||
},
|
||||
fields: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
fieldsMeta: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
remoteMeta: {},
|
||||
totalFields: [],
|
||||
loading: true,
|
||||
groups: [],
|
||||
errors: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataForm() {
|
||||
return this.$refs.dataForm
|
||||
},
|
||||
iForm() {
|
||||
const iForm = {}
|
||||
Object.entries(this.form).forEach(([key, value]) => {
|
||||
// 初始值是 choice 对象
|
||||
if (value && typeof value === 'object' && value.label && value.value !== undefined) {
|
||||
iForm[key] = value.value
|
||||
} else if (Array.isArray(value) && value.length > 0 && typeof value[0] === 'object' &&
|
||||
value[0].label && value[0].value !== undefined) {
|
||||
iForm[key] = value.map(item => item.value)
|
||||
} else {
|
||||
iForm[key] = value
|
||||
}
|
||||
})
|
||||
return iForm
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.optionUrlMetaAndGenerateColumns()
|
||||
},
|
||||
methods: {
|
||||
async optionUrlMetaAndGenerateColumns() {
|
||||
let data = { actions: {}}
|
||||
if (this.url) {
|
||||
data = await this.$store.dispatch('common/getUrlMeta', { url: this.url })
|
||||
}
|
||||
this.remoteMeta = data.actions[this.method.toUpperCase()] || {}
|
||||
this.$emit('afterRemoteMeta', this.remoteMeta)
|
||||
this.generateColumns()
|
||||
this.$emit('afterGenerateColumns', this.totalFields)
|
||||
this.cleanFormValue()
|
||||
this.loading = false
|
||||
},
|
||||
generateColumns() {
|
||||
const generator = new FormFieldGenerator(this.$emit)
|
||||
this.totalFields = generator.generateFields(this.fields, this.fieldsMeta, this.remoteMeta)
|
||||
this.groups = generator.groups
|
||||
this.$log.debug('Total fields: ', this.totalFields)
|
||||
},
|
||||
_cleanFormValue(form, remoteMeta) {
|
||||
if (!form) {
|
||||
form = {}
|
||||
}
|
||||
for (const [k, v] of Object.entries(remoteMeta)) {
|
||||
let valueSet = form[k]
|
||||
if (v.type === 'nested object' && v.children) {
|
||||
// 有一些字段属性时 nested object 类型,但是没有 children,没有children的不需要走递归逻辑,
|
||||
// 比如:认证配置中的属性映射字段
|
||||
if (typeof valueSet !== 'object') {
|
||||
// 处理一些前端没有设置初始值的情况
|
||||
valueSet = {}
|
||||
}
|
||||
form[k] = valueSet
|
||||
this._cleanFormValue(valueSet, v.children)
|
||||
}
|
||||
if (valueSet !== undefined) {
|
||||
continue
|
||||
}
|
||||
if (v.default === undefined) {
|
||||
continue
|
||||
}
|
||||
form[k] = v.default
|
||||
}
|
||||
},
|
||||
cleanFormValue() {
|
||||
this._cleanFormValue(this.iForm, this.remoteMeta)
|
||||
},
|
||||
setFieldError(name, error) {
|
||||
const field = this.totalFields.find((v) => v.prop === name)
|
||||
if (!field) {
|
||||
return
|
||||
}
|
||||
if (field.attrs.error === error) {
|
||||
error += '.'
|
||||
}
|
||||
if (field.type === 'nestedField') {
|
||||
field.el.errors = error
|
||||
} else {
|
||||
field.attrs.error = error
|
||||
}
|
||||
},
|
||||
groupHidden(group, i) {
|
||||
for (const field of group.fields) {
|
||||
let hidden = field.hidden
|
||||
if (typeof hidden === 'function') {
|
||||
hidden = hidden(this.iForm)
|
||||
}
|
||||
if (!hidden) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,26 +1,37 @@
|
||||
import Vue from 'vue'
|
||||
import Select2 from '@/components/FormFields/Select2'
|
||||
import NestedField from '@/components/AutoDataForm/components/NestedField'
|
||||
import Swicher from '@/components/FormFields/Swicher'
|
||||
import rules from '@/components/DataForm/rules'
|
||||
import Select2 from '@/components/Form/FormFields/Select2.vue'
|
||||
import ObjectSelect2 from '@/components/Form/FormFields/NestedObjectSelect2.vue'
|
||||
import NestedField from '@/components/Form/AutoDataForm/components/NestedField.vue'
|
||||
import Switcher from '@/components/Form/FormFields/Switcher.vue'
|
||||
import rules from '@/components/Form/DataForm/rules'
|
||||
import BasicTree from '@/components/Form/FormFields/BasicTree.vue'
|
||||
import JsonEditor from '@/components/Form/FormFields/JsonEditor.vue'
|
||||
import { assignIfNot } from '@/utils/common'
|
||||
import TagInput from '@/components/Form/FormFields/TagInput.vue'
|
||||
|
||||
export class FormFieldGenerator {
|
||||
constructor() {
|
||||
constructor(emit) {
|
||||
this.$emite = emit
|
||||
this.groups = []
|
||||
}
|
||||
|
||||
generateFieldByType(type, field, fieldMeta, fieldRemoteMeta) {
|
||||
switch (type) {
|
||||
case 'labeled_choice':
|
||||
case 'choice':
|
||||
type = 'radio-group'
|
||||
if (!fieldRemoteMeta.read_only) {
|
||||
field.options = fieldRemoteMeta.choices.map(v => {
|
||||
return { label: v.display_name, value: v.value }
|
||||
})
|
||||
// Value 处理事在 AutoDataForm 中处理的
|
||||
if (!fieldRemoteMeta['read_only']) {
|
||||
field.options = fieldRemoteMeta.choices
|
||||
}
|
||||
type = 'radio-group'
|
||||
break
|
||||
case 'multiple choice':
|
||||
field.el.choices = fieldRemoteMeta['choices']
|
||||
field.options = fieldRemoteMeta.choices
|
||||
type = 'checkbox-group'
|
||||
break
|
||||
case 'tree':
|
||||
field.el.tree = fieldRemoteMeta.tree
|
||||
field.component = BasicTree
|
||||
break
|
||||
case 'datetime':
|
||||
type = 'date-picker'
|
||||
@@ -28,12 +39,19 @@ export class FormFieldGenerator {
|
||||
type: 'datetime'
|
||||
}
|
||||
break
|
||||
case 'json':
|
||||
type = 'json-editor'
|
||||
field.component = JsonEditor
|
||||
break
|
||||
case 'field':
|
||||
type = ''
|
||||
field.component = Select2
|
||||
if (fieldRemoteMeta.required) {
|
||||
field.el.clearable = false
|
||||
}
|
||||
if (fieldRemoteMeta.child && fieldRemoteMeta.child.type === 'nested object') {
|
||||
field.component = ObjectSelect2
|
||||
}
|
||||
break
|
||||
case 'string':
|
||||
type = 'input'
|
||||
@@ -47,40 +65,54 @@ export class FormFieldGenerator {
|
||||
break
|
||||
case 'boolean':
|
||||
type = ''
|
||||
field.component = Swicher
|
||||
field.component = Switcher
|
||||
break
|
||||
case 'list':
|
||||
type = 'input'
|
||||
field.component = TagInput
|
||||
break
|
||||
case 'object_related_field':
|
||||
field.component = ObjectSelect2
|
||||
break
|
||||
case 'm2m_related_field':
|
||||
field.component = ObjectSelect2
|
||||
break
|
||||
case 'nested object':
|
||||
type = 'nestedField'
|
||||
field.component = NestedField
|
||||
field.label = ''
|
||||
field.labelWidth = 0
|
||||
field.el = { ...field.el, ...fieldMeta }
|
||||
field.el.fields = this.generateNestFields(field, fieldMeta, fieldRemoteMeta)
|
||||
field.el.errors = {}
|
||||
Vue.$log.debug('All fields in generate: ', field.el.allFields)
|
||||
field.hidden = () => {
|
||||
const hidden = fieldMeta['hiddenFields'] || (() => field.el.fields.length === 0)
|
||||
return hidden(fieldMeta, fieldRemoteMeta, field.el.fields)
|
||||
}
|
||||
break
|
||||
default:
|
||||
type = 'input'
|
||||
break
|
||||
}
|
||||
// 上面重写了 type
|
||||
if (type === 'radio-group') {
|
||||
if (!fieldRemoteMeta.read_only) {
|
||||
const options = fieldRemoteMeta.choices.map(v => {
|
||||
return { label: v.display_name, value: v.value }
|
||||
})
|
||||
if (options.length > 4) {
|
||||
type = 'select'
|
||||
field.el.filterable = true
|
||||
}
|
||||
if (field.options.length > 4) {
|
||||
type = 'select'
|
||||
field.el.filterable = true
|
||||
}
|
||||
}
|
||||
field.type = type
|
||||
return field
|
||||
}
|
||||
|
||||
generateNestFields(field, fieldMeta, fieldRemoteMeta) {
|
||||
const fields = []
|
||||
const nestedFields = fieldMeta.fields || []
|
||||
let nestedFields = fieldMeta.fields || []
|
||||
const nestedFieldsMeta = fieldMeta.fieldsMeta || {}
|
||||
const nestedFieldsRemoteMeta = fieldRemoteMeta.children || {}
|
||||
if (nestedFields === '__all__') {
|
||||
nestedFields = Object.keys(nestedFieldsRemoteMeta)
|
||||
}
|
||||
for (const name of nestedFields) {
|
||||
const f = this.generateField(name, nestedFieldsMeta, nestedFieldsRemoteMeta)
|
||||
fields.push(f)
|
||||
@@ -88,6 +120,7 @@ export class FormFieldGenerator {
|
||||
Vue.$log.debug('NestFields: ', fields)
|
||||
return fields
|
||||
}
|
||||
|
||||
generateFieldByName(name, field) {
|
||||
switch (name) {
|
||||
case 'email':
|
||||
@@ -102,6 +135,7 @@ export class FormFieldGenerator {
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
generateFieldByOther(field, fieldMeta, fieldRemoteMeta) {
|
||||
const filedRules = field.rules || []
|
||||
if (fieldRemoteMeta.required) {
|
||||
@@ -111,15 +145,20 @@ export class FormFieldGenerator {
|
||||
filedRules.push(rules.RequiredChange)
|
||||
}
|
||||
}
|
||||
// 一些 field 有 choices 但不是 choiceField
|
||||
if (fieldRemoteMeta.choices && field.type.indexOf('choice') === -1) {
|
||||
field.el.choices = fieldRemoteMeta.choices
|
||||
}
|
||||
field.rules = filedRules
|
||||
return field
|
||||
}
|
||||
|
||||
generateField(name, fieldsMeta, remoteFieldsMeta) {
|
||||
let field = { id: name, prop: name, el: {}, attrs: {}, rules: [] }
|
||||
const remoteFieldMeta = remoteFieldsMeta[name] || {}
|
||||
const fieldMeta = fieldsMeta[name] || {}
|
||||
field.label = remoteFieldMeta.label
|
||||
field.helpText = remoteFieldMeta.help_text
|
||||
field.helpText = remoteFieldMeta['help_text']
|
||||
field = this.generateFieldByType(remoteFieldMeta.type, field, fieldMeta, remoteFieldMeta)
|
||||
field = this.generateFieldByName(name, field)
|
||||
field = this.generateFieldByOther(field, fieldMeta, remoteFieldMeta)
|
||||
@@ -132,18 +171,25 @@ export class FormFieldGenerator {
|
||||
// Vue.$log.debug('Generate field: ', name, field)
|
||||
return field
|
||||
}
|
||||
|
||||
generateFieldGroup(field, fieldsMeta, remoteFieldsMeta) {
|
||||
const [groupTitle, fields] = field
|
||||
this.groups.push({
|
||||
const _fields = this.generateFields(fields, fieldsMeta, remoteFieldsMeta)
|
||||
const group = {
|
||||
id: groupTitle,
|
||||
title: groupTitle,
|
||||
name: fields[0],
|
||||
fields: fields
|
||||
})
|
||||
return this.generateFields(fields, fieldsMeta, remoteFieldsMeta)
|
||||
fields: _fields,
|
||||
name: _fields[0]?.id
|
||||
}
|
||||
this.groups.push(group)
|
||||
return _fields
|
||||
}
|
||||
|
||||
generateFields(_fields, fieldsMeta, remoteFieldsMeta) {
|
||||
let fields = []
|
||||
if (_fields === '__all__') {
|
||||
_fields = Object.keys(remoteFieldsMeta)
|
||||
}
|
||||
for (let field of _fields) {
|
||||
if (field instanceof Array) {
|
||||
const items = this.generateFieldGroup(field, fieldsMeta, remoteFieldsMeta)
|
||||
@@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane v-if="shouldHide('min')" :label="this.$t('common.CronTab.min')">
|
||||
<el-tab-pane v-if="shouldHide('min')" :label="$tc('common.CronTab.min')">
|
||||
<CrontabMin
|
||||
ref="cronmin"
|
||||
:check="checkNumber"
|
||||
@@ -11,7 +11,7 @@
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane v-if="shouldHide('hour')" :label="this.$t('common.CronTab.hour')">
|
||||
<el-tab-pane v-if="shouldHide('hour')" :label="$tc('common.CronTab.hour')">
|
||||
<CrontabHour
|
||||
ref="cronhour"
|
||||
:check="checkNumber"
|
||||
@@ -20,7 +20,7 @@
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane v-if="shouldHide('day')" :label="this.$t('common.CronTab.day')">
|
||||
<el-tab-pane v-if="shouldHide('day')" :label="$tc('common.CronTab.day')">
|
||||
<CrontabDay
|
||||
ref="cronday"
|
||||
:check="checkNumber"
|
||||
@@ -29,7 +29,7 @@
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane v-if="shouldHide('month')" :label="this.$t('common.CronTab.month')">
|
||||
<el-tab-pane v-if="shouldHide('month')" :label="$tc('common.CronTab.month')">
|
||||
<CrontabMonth
|
||||
ref="cronmonth"
|
||||
:check="checkNumber"
|
||||
@@ -38,7 +38,7 @@
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane v-if="shouldHide('week')" :label="this.$t('common.CronTab.week')">
|
||||
<el-tab-pane v-if="shouldHide('week')" :label="$tc('common.CronTab.week')">
|
||||
<CrontabWeek
|
||||
ref="cronweek"
|
||||
:check="checkNumber"
|
||||
@@ -390,6 +390,7 @@ export default {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.popup-main {
|
||||
position: relative;
|
||||
margin: 10px auto 0;
|
||||
@@ -398,12 +399,14 @@ export default {
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
overflow: hidden;
|
||||
line-height: 34px;
|
||||
padding-top: 6px;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.popup-result {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
@@ -413,6 +416,7 @@ export default {
|
||||
border: 1px solid #dcdfe6;
|
||||
box-shadow: 0 2px 4px 0 rgb(0 0 0 / 12%), 0 0 6px 0 rgb(0 0 0 / 4%);
|
||||
}
|
||||
|
||||
.popup-result .title {
|
||||
position: absolute;
|
||||
top: -17px;
|
||||
@@ -424,11 +428,13 @@ export default {
|
||||
line-height: 30px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.popup-result table {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.popup-result table span {
|
||||
display: block;
|
||||
width: 100%;
|
||||
@@ -439,12 +445,14 @@ export default {
|
||||
overflow: hidden;
|
||||
border: 1px solid #e8e8e8;
|
||||
}
|
||||
|
||||
.popup-result-scroll {
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
height: 10em;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.el-form-item--mini.el-form-item,
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
@@ -25,7 +25,13 @@
|
||||
<el-form-item>
|
||||
<el-radio v-model="radioValue" :label="7">
|
||||
{{ this.$t('common.CronTab.appoint') }}
|
||||
<el-select v-model="checkboxList" clearable :placeholder="this.$t('common.CronTab.manyChoose')" multiple style="width:100%">
|
||||
<el-select
|
||||
v-model="checkboxList"
|
||||
clearable
|
||||
:placeholder="$tc('common.CronTab.manyChoose')"
|
||||
multiple
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option v-for="item in 31" :key="item" :value="item">{{ item }}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
@@ -45,7 +51,8 @@ export default {
|
||||
},
|
||||
check: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -184,6 +191,6 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -25,7 +25,13 @@
|
||||
<el-form-item>
|
||||
<el-radio v-model="radioValue" :label="4">
|
||||
{{ this.$t('common.CronTab.appoint') }}
|
||||
<el-select v-model="checkboxList" clearable :placeholder="this.$t('common.CronTab.manyChoose')" multiple style="width:100%">
|
||||
<el-select
|
||||
v-model="checkboxList"
|
||||
clearable
|
||||
:placeholder="$tc('common.CronTab.manyChoose')"
|
||||
multiple
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option v-for="item in 24" :key="item" :value="item-1">{{ item-1 }}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
@@ -45,7 +51,8 @@ export default {
|
||||
},
|
||||
check: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -153,6 +160,6 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 10px
|
||||
}
|
||||
margin-bottom: 10px
|
||||
}
|
||||
</style>
|
||||
@@ -25,7 +25,14 @@
|
||||
<el-form-item>
|
||||
<el-radio v-model="radioValue" :label="4">
|
||||
{{ this.$t('common.CronTab.appoint') }}
|
||||
<el-select v-model="checkboxList" clearable :placeholder="this.$t('common.CronTab.manyChoose')" multiple style="width:100%" size="small">
|
||||
<el-select
|
||||
v-model="checkboxList"
|
||||
clearable
|
||||
:placeholder="$tc('common.CronTab.manyChoose')"
|
||||
multiple
|
||||
style="width:100%"
|
||||
size="small"
|
||||
>
|
||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item-1 }}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
@@ -46,7 +53,8 @@ export default {
|
||||
},
|
||||
check: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -151,6 +159,6 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -25,7 +25,13 @@
|
||||
<el-form-item>
|
||||
<el-radio v-model="radioValue" :label="4">
|
||||
{{ this.$t('common.CronTab.appoint') }}
|
||||
<el-select v-model="checkboxList" clearable :placeholder="this.$t('common.CronTab.manyChoose')" multiple style="width:100%">
|
||||
<el-select
|
||||
v-model="checkboxList"
|
||||
clearable
|
||||
:placeholder="$tc('common.CronTab.manyChoose')"
|
||||
multiple
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option v-for="item in 12" :key="item" :value="item">{{ item }}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
@@ -45,7 +51,8 @@ export default {
|
||||
},
|
||||
check: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -158,6 +165,6 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<script>
|
||||
import parser from 'cron-parser'
|
||||
import moment from 'moment'
|
||||
import { toSafeLocalDateStr } from '@/utils/common'
|
||||
export default {
|
||||
name: 'CrontabResult',
|
||||
props: {
|
||||
@@ -46,10 +46,10 @@ export default {
|
||||
const rule = 0 + ' ' + this.$options.propsData.ex
|
||||
try {
|
||||
this.resultList = []
|
||||
var interval = parser.parseExpression(rule)
|
||||
const interval = parser.parseExpression(rule)
|
||||
for (let index = 0; index < 5; index++) {
|
||||
const cur = interval.next().toString()
|
||||
this.resultList.push(moment(cur).format('YYYY-MM-DD HH:mm:ss'))
|
||||
this.resultList.push(toSafeLocalDateStr(cur))
|
||||
}
|
||||
} catch (error) {
|
||||
this.isShow = false
|
||||
@@ -18,8 +18,16 @@
|
||||
<el-form-item>
|
||||
<el-radio v-model="radioValue" :label="6">
|
||||
{{ this.$t('common.CronTab.appoint') }}
|
||||
<el-select v-model="checkboxList" clearable :placeholder="this.$t('common.CronTab.manyChoose')" multiple style="width:100%">
|
||||
<el-option v-for="(item,index) of weekList" :key="index" :value="index+1">{{ item }}</el-option>
|
||||
<el-select
|
||||
v-model="checkboxList"
|
||||
clearable
|
||||
:placeholder="$tc('common.CronTab.manyChoose')"
|
||||
multiple
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option v-for="(item,index) of weekList" :key="index" :value="index === 6 ? 0 : (index + 1)">
|
||||
{{ item }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
@@ -39,7 +47,8 @@ export default {
|
||||
},
|
||||
check: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -173,6 +182,6 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="box">
|
||||
<el-input v-model="input" clearable @focus="showDialog" @clear="onClear" />
|
||||
</div>
|
||||
<el-dialog :title="this.$t('common.CronTab.newCron')" :visible.sync="showCron" top="8vh" width="580px" append-to-body>
|
||||
<el-dialog :title="$tc('common.CronTab.newCron')" :visible.sync="showCron" top="8vh" width="580px" append-to-body>
|
||||
<Crontab
|
||||
:expression="expression"
|
||||
@hide="showCron = false"
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
<script>
|
||||
import Crontab from './Crontab.vue'
|
||||
|
||||
export default {
|
||||
components: { Crontab },
|
||||
props: {
|
||||
@@ -51,5 +52,5 @@ export default {
|
||||
<style scoped>
|
||||
.el-dialog__body {
|
||||
padding: 12px 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -43,16 +43,25 @@
|
||||
<template v-for="opt in options">
|
||||
<el-option
|
||||
v-if="data.type === 'select'"
|
||||
:key="opt.value"
|
||||
v-bind="opt"
|
||||
/>
|
||||
<!-- TODO: 支持 el-checkbox-button 变体 -->
|
||||
<el-checkbox
|
||||
v-else-if="data.type === 'checkbox-group'"
|
||||
:key="opt.label"
|
||||
v-bind="opt"
|
||||
/>
|
||||
<el-checkbox-button
|
||||
v-else-if="data.type === 'checkbox-group' && data.style === 'button'"
|
||||
:key="opt.value"
|
||||
v-bind="opt"
|
||||
:label="'value' in opt ? opt.value : opt.label"
|
||||
>
|
||||
{{ opt.value }}
|
||||
{{ opt.label }}
|
||||
</el-checkbox-button>
|
||||
|
||||
<el-checkbox
|
||||
v-else-if="data.type === 'checkbox-group' && data.style !== 'button'"
|
||||
:key="opt.value"
|
||||
v-bind="opt"
|
||||
:label="'value' in opt ? opt.value : opt.label"
|
||||
>
|
||||
{{ opt.label }}
|
||||
</el-checkbox>
|
||||
<!-- WARNING: radio 用 label 属性来表示 value 的含义 -->
|
||||
<!-- FYI: radio 的 value 属性可以在没有 radio-group 时用来关联到同一个 v-model -->
|
||||
@@ -229,7 +238,9 @@ export default {
|
||||
.then(resp => {
|
||||
if (isOptionsCase) {
|
||||
let formRenderer = this.$parent
|
||||
while (formRenderer.$options._componentTag !== 'el-form-renderer') { formRenderer = formRenderer.$parent }
|
||||
while (formRenderer.$options._componentTag !== 'el-form-renderer') {
|
||||
formRenderer = formRenderer.$parent
|
||||
}
|
||||
formRenderer.setOptions(this.prop, resp)
|
||||
} else {
|
||||
this.propsInner = { [prop]: resp }
|
||||
@@ -1,30 +1,60 @@
|
||||
<template>
|
||||
<ElFormRender
|
||||
ref="form"
|
||||
:class="mobile? 'mobile' : 'desktop'"
|
||||
:content="fields"
|
||||
:form="basicForm"
|
||||
:label-position="labelPosition"
|
||||
label-width="20%"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<!-- slot 透传 -->
|
||||
<slot v-for="item in fields" :slot="`id:${item.id}`" :name="`id:${item.id}`" />
|
||||
<slot v-for="item in fields" :slot="`$id:${item.id}`" :name="`$id:${item.id}`" />
|
||||
<div>
|
||||
<ElFormRender
|
||||
ref="form"
|
||||
:class="mobile? 'mobile' : 'desktop'"
|
||||
:content="fields"
|
||||
:form="basicForm"
|
||||
:label-position="labelPosition"
|
||||
class="form-fields"
|
||||
label-width="22%"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<!-- slot 透传 -->
|
||||
<slot v-for="item in fields" :slot="`id:${item.id}`" :name="`id:${item.id}`" />
|
||||
<slot v-for="item in fields" :slot="`$id:${item.id}`" :name="`$id:${item.id}`" />
|
||||
|
||||
<el-form-item v-if="hasButtons" class="form-buttons">
|
||||
<el-button v-for="button in moreButtons" :key="button.title" size="small" v-bind="button" @click="handleClick(button)">{{ button.title }}</el-button>
|
||||
<el-button v-if="defaultButton && hasReset" size="small" @click="resetForm('form')">{{ $t('common.Reset') }}</el-button>
|
||||
<el-button v-if="defaultButton && hasSaveContinue" size="small" @click="submitForm('form', true)">{{ $t('common.SaveAndAddAnother') }}</el-button>
|
||||
<el-button v-if="defaultButton" size="small" :loading="isSubmitting" type="primary" @click="submitForm('form')">{{ $t('common.Submit') }}</el-button>
|
||||
</el-form-item>
|
||||
</ElFormRender>
|
||||
</ElFormRender>
|
||||
<div v-if="hasButtons" class="form-buttons">
|
||||
<el-button
|
||||
v-for="button in moreButtons"
|
||||
:key="button.title"
|
||||
:loading="button.loading"
|
||||
size="small"
|
||||
v-bind="button"
|
||||
@click="handleClick(button)"
|
||||
>
|
||||
{{ button.title }}
|
||||
</el-button>
|
||||
<el-button v-if="defaultButton && hasReset" size="small" @click="resetForm('form')">
|
||||
{{ $t('common.Reset') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="defaultButton && hasSaveContinue"
|
||||
size="small"
|
||||
@click="submitForm('form', true)"
|
||||
>
|
||||
{{ $t('common.SaveAndAddAnother') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="defaultButton"
|
||||
:disabled="!canSubmit"
|
||||
:loading="isSubmitting"
|
||||
:size="submitBtnSize"
|
||||
type="primary"
|
||||
@click="submitForm('form')"
|
||||
>
|
||||
{{ submitBtnText }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ElFormRender from './components/el-form-renderer'
|
||||
import { scrollToError } from '@/utils'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ElFormRender
|
||||
@@ -42,6 +72,20 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
canSubmit: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
submitBtnSize: {
|
||||
type: String,
|
||||
default: 'small'
|
||||
},
|
||||
submitBtnText: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('common.Submit')
|
||||
}
|
||||
},
|
||||
hasSaveContinue: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
@@ -70,6 +114,9 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
elForm() {
|
||||
return this.$refs.form
|
||||
},
|
||||
mobile() {
|
||||
return this.$store.state.app.device === 'mobile'
|
||||
},
|
||||
@@ -92,8 +139,8 @@ export default {
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields()
|
||||
resetForm() {
|
||||
this.$refs['form'].resetFields()
|
||||
},
|
||||
handleClick(button) {
|
||||
const callback = button.callback || function(values, form) {
|
||||
@@ -101,7 +148,10 @@ export default {
|
||||
}
|
||||
const form = this.$refs['form']
|
||||
const values = form.getFormValue()
|
||||
callback(values, form)
|
||||
callback(values, form, button)
|
||||
},
|
||||
getFormValue() {
|
||||
return this.$refs.form.getFormValue()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +163,7 @@ export default {
|
||||
}
|
||||
|
||||
.el-form ::v-deep .el-form-item__content {
|
||||
width: 75%;
|
||||
width: 73%;
|
||||
}
|
||||
|
||||
.mobile.el-form ::v-deep .el-form-item__content {
|
||||
@@ -125,7 +175,7 @@ export default {
|
||||
}
|
||||
|
||||
.el-form ::v-deep .el-form-item__error {
|
||||
position: inherit;
|
||||
position: inherit;
|
||||
}
|
||||
|
||||
.el-form ::v-deep .form-group-header {
|
||||
@@ -144,10 +194,14 @@ export default {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.el-form ::v-deep .help-block a {
|
||||
color: #1c84c6;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.form-buttons {
|
||||
padding-top: 10px;
|
||||
margin-top: 20px;
|
||||
margin-left: 22%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
107
src/components/Form/DataForm/rules/index.js
Normal file
107
src/components/Form/DataForm/rules/index.js
Normal file
@@ -0,0 +1,107 @@
|
||||
import i18n from '@/i18n/i18n'
|
||||
|
||||
export const Required = {
|
||||
required: true, message: i18n.t('common.fieldRequiredError'), trigger: 'blur'
|
||||
}
|
||||
|
||||
export const RequiredChange = {
|
||||
required: true, message: i18n.t('common.fieldRequiredError'), trigger: 'change'
|
||||
}
|
||||
|
||||
export const EmailCheck = {
|
||||
type: 'email',
|
||||
message: i18n.t('common.InputEmailAddress'),
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
|
||||
export const IpCheck = {
|
||||
required: true,
|
||||
validator: (rule, value, callback) => {
|
||||
value = value?.trim()
|
||||
const urlRegExp = /^[\w://.?=&#-]+$/
|
||||
if (urlRegExp.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error(i18n.t('common.FormatError')))
|
||||
}
|
||||
},
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
|
||||
export const specialEmojiCheck = {
|
||||
validator: (rule, value, callback) => {
|
||||
value = value?.trim()
|
||||
if (/[\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/.test(value)) {
|
||||
callback(new Error(i18n.t('common.NotSpecialEmoji')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
|
||||
// 只能输入字母、数字、下划线
|
||||
export const matchAlphanumericUnderscore = {
|
||||
validator: (rule, value, callback) => {
|
||||
value = value?.trim()
|
||||
if (!/^[a-zA-Z0-9_]+$/.test(value)) {
|
||||
callback(new Error(i18n.t('common.notAlphanumericUnderscore')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
|
||||
// 不能包含()
|
||||
export const MatchExcludeParenthesis = {
|
||||
validator: (rule, value, callback) => {
|
||||
value = value?.trim()
|
||||
if (!/^[^()]*$/.test(value)) {
|
||||
callback(new Error(i18n.t('common.notParenthesis')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
|
||||
export default {
|
||||
IpCheck,
|
||||
Required,
|
||||
RequiredChange,
|
||||
EmailCheck,
|
||||
specialEmojiCheck,
|
||||
matchAlphanumericUnderscore,
|
||||
MatchExcludeParenthesis
|
||||
}
|
||||
|
||||
export const JsonRequired = {
|
||||
required: true,
|
||||
trigger: 'change',
|
||||
validator: (rule, value, callback) => {
|
||||
try {
|
||||
typeof value === 'string' ? JSON.parse(value) : value
|
||||
callback()
|
||||
} catch (e) {
|
||||
callback(new Error(i18n.t('common.InvalidJson')))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const JsonRequiredUserNameMapped = {
|
||||
required: true,
|
||||
trigger: 'change',
|
||||
validator: (rule, value, callback) => {
|
||||
try {
|
||||
const v = typeof value === 'string' ? JSON.parse(value) : value
|
||||
const hasUserName = _.map(v, (value) => value)
|
||||
if (!hasUserName.includes('username')) {
|
||||
callback(new Error(i18n.t('common.requiredHasUserNameMapped')))
|
||||
}
|
||||
callback()
|
||||
} catch (e) {
|
||||
callback(new Error(i18n.t('common.InvalidJson')))
|
||||
}
|
||||
}
|
||||
}
|
||||
77
src/components/Form/FormFields/AllOrSpec.vue
Normal file
77
src/components/Form/FormFields/AllOrSpec.vue
Normal file
@@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-radio-group v-model="type" @input="handleTypeChange">
|
||||
<el-radio v-for="tp of types" :key="tp.name" :label="tp.name">
|
||||
{{ tp.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<Select2 v-if="type === 'spec'" v-model="selected" v-bind="select2" @change="onChangeEmit" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Select2 from '@/components/Form/FormFields/Select2.vue'
|
||||
|
||||
export default {
|
||||
name: 'AllOrSpec',
|
||||
components: { Select2 },
|
||||
props: {
|
||||
value: {
|
||||
type: [Array],
|
||||
default: () => ([])
|
||||
},
|
||||
select2: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
resource: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: 'all', // all, selected
|
||||
types: [
|
||||
{ name: 'all', label: this.$t('common.All') },
|
||||
{ name: 'spec', label: this.$t('common.Spec') + this.$t('common.WordSep') + this.resource }
|
||||
],
|
||||
selected: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iValue() {
|
||||
if (this.type === 'all') {
|
||||
return ['all']
|
||||
} else {
|
||||
return this.selected
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value || this.value.length === 0) {
|
||||
return
|
||||
}
|
||||
console.log('Value: ', this.value)
|
||||
if (this.value.indexOf('all') > -1) {
|
||||
this.type = 'all'
|
||||
} else {
|
||||
this.type = 'spec'
|
||||
this.selected = this.value
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onChangeEmit() {
|
||||
this.$emit('input', this.iValue)
|
||||
},
|
||||
handleTypeChange() {
|
||||
this.$emit('input', this.iValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
62
src/components/Form/FormFields/AttrInput.vue
Normal file
62
src/components/Form/FormFields/AttrInput.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<div>
|
||||
<GenericCreateUpdateForm
|
||||
class="attr-form"
|
||||
v-bind="formConfig"
|
||||
@submit="onSubmit"
|
||||
/>
|
||||
<DataTable :config="tableConfig" class="attr-list" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import GenericCreateUpdateForm from '@/layout/components/GenericCreateUpdateForm'
|
||||
import DataTable from '@/components/Table/DataTable/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'AttrInput',
|
||||
components: { DataTable, GenericCreateUpdateForm },
|
||||
props: {
|
||||
formConfig: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
tableConfig: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
beforeSubmit: {
|
||||
type: Function,
|
||||
default: (val) => { return true }
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(value) {
|
||||
if (this.beforeSubmit(value)) {
|
||||
const clonedValue = JSON.parse(JSON.stringify(value))
|
||||
this.tableConfig.totalData.push(clonedValue)
|
||||
this.$emit('submit', this.tableConfig.totalData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.attr-form {
|
||||
>>> .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
>>> .el-form-item__content {
|
||||
width: 100%;
|
||||
}
|
||||
>>> .form-buttons {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
109
src/components/Form/FormFields/BasicTree.vue
Normal file
109
src/components/Form/FormFields/BasicTree.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<el-tree
|
||||
:data="iTree"
|
||||
:default-checked-keys="iValue"
|
||||
:default-expand-all="true"
|
||||
:default-expanded-keys="iValue"
|
||||
:props="defaultProps"
|
||||
:render-content="renderContent"
|
||||
class="el-tree-custom"
|
||||
node-key="value"
|
||||
show-checkbox
|
||||
@check="handleCheckChange"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
tree: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iValue() {
|
||||
return this.value.map(item => {
|
||||
if (item.value) {
|
||||
return item.value
|
||||
}
|
||||
return item
|
||||
})
|
||||
},
|
||||
iTree() {
|
||||
if (!this.readonly) {
|
||||
return this.tree
|
||||
} else {
|
||||
return this.setTreeReadonly(this.tree)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCheckChange(node, { checkedNodes }) {
|
||||
const checkedKeys = checkedNodes
|
||||
.filter(item => !item.children)
|
||||
.map(node => node.value)
|
||||
this.$emit('input', checkedKeys)
|
||||
},
|
||||
setTreeReadonly(tree) {
|
||||
return tree.map(item => {
|
||||
item.disabled = true
|
||||
if (item.children) {
|
||||
item.children = this.setTreeReadonly(item.children)
|
||||
}
|
||||
return item
|
||||
})
|
||||
},
|
||||
renderContent(h, { node, data, store }) {
|
||||
let label = node.label
|
||||
let helpText = ''
|
||||
const regex = /(.*?)\s*\((.*?)\)/
|
||||
const match = label.match(regex)
|
||||
if (match) {
|
||||
label = match[1]
|
||||
helpText = match[2]
|
||||
}
|
||||
|
||||
return (
|
||||
<span >
|
||||
<span>{label} </span>
|
||||
{helpText
|
||||
? (<el-tooltip content={helpText} placement='top'>
|
||||
<i class='fa fa-question-circle-o'></i>
|
||||
</el-tooltip>) : ''}
|
||||
</span>)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.el-tree-custom >>> {
|
||||
.help-tips {
|
||||
margin-left: 10px;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
.el-tree-node__content:hover {
|
||||
background-color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
36
src/components/Form/FormFields/BoolTextReadonly.vue
Normal file
36
src/components/Form/FormFields/BoolTextReadonly.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div>
|
||||
{{ value? trueText : falseText }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Boolean],
|
||||
default: () => false
|
||||
},
|
||||
trueText: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return this.$t('common.Yes')
|
||||
}
|
||||
},
|
||||
falseText: {
|
||||
type: String,
|
||||
default: function() {
|
||||
return this.$t('common.No')
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
289
src/components/Form/FormFields/CodeEditor.vue
Normal file
289
src/components/Form/FormFields/CodeEditor.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<div class="code-editor" style="font-size: 12px">
|
||||
<div class="toolbar">
|
||||
<div
|
||||
v-for="(item,index) in toolbar.left"
|
||||
:key="index"
|
||||
style="display: inline-block; margin: 0 2px"
|
||||
>
|
||||
<el-tooltip :content="item.tip" :disabled="!item.tip" placement="top">
|
||||
<el-button
|
||||
v-if="item.type ==='button'"
|
||||
:disabled="item.disabled"
|
||||
:type="item.el&&item.el.type"
|
||||
size="mini"
|
||||
@click="item.callback()"
|
||||
>
|
||||
<i :class="item.icon" style="margin-right: 4px;" />{{ item.name }}
|
||||
</el-button>
|
||||
<el-autocomplete
|
||||
v-if="item.type === 'input' &&item.el && item.el.autoComplete"
|
||||
v-model="item.value"
|
||||
:placeholder="item.placeholder"
|
||||
:fetch-suggestions="item.el.query"
|
||||
class="inline-input"
|
||||
size="mini"
|
||||
@select="item.callback(item.value)"
|
||||
@change="item.callback(item.value)"
|
||||
/>
|
||||
<el-input
|
||||
v-else-if="item.type==='input'"
|
||||
v-model="item.value"
|
||||
:placeholder="item.placeholder"
|
||||
class="inline-input"
|
||||
size="mini"
|
||||
@change="item.callback(item.value)"
|
||||
/>
|
||||
<div v-if="item.type==='select' && item.el && item.el.create" class="select-content">
|
||||
<span class="filter-label">
|
||||
{{ item.name }}:
|
||||
</span>
|
||||
<el-select
|
||||
v-if="item.type==='select' && item.el && item.el.create"
|
||||
:key="index"
|
||||
v-model="item.value"
|
||||
:allow-create="item.el.create || false"
|
||||
:filterable="item.el.create || false"
|
||||
:multiple="item.el.multiple"
|
||||
:placeholder="item.name"
|
||||
class="autoWidth-select"
|
||||
default-first-option
|
||||
size="mini"
|
||||
@change="item.callback(item.value)"
|
||||
>
|
||||
<template slot="prefix">
|
||||
{{ item.label + ':' + item.value }}
|
||||
</template>
|
||||
<el-option
|
||||
v-for="(option,id) in item.options"
|
||||
:key="id"
|
||||
:label="option.label"
|
||||
:title="option.value"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<el-dropdown
|
||||
v-if="item.type==='select' && (!item.el || !item.el.create) "
|
||||
trigger="click"
|
||||
@command="(command) => {
|
||||
item.value= command
|
||||
item.callback(command)
|
||||
}"
|
||||
>
|
||||
<el-button size="mini" type="default">
|
||||
<b>{{ item.name }}:</b> {{ getLabel(item.value, item.options) }} <i
|
||||
class="el-icon-arrow-down el-icon--right"
|
||||
/>
|
||||
</el-button>
|
||||
<el-dropdown-menu v-slot="dropdown">
|
||||
<el-dropdown-item v-for="(option,i) in item.options" :key="i" :command="option.value">
|
||||
{{ option.label }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
<el-switch
|
||||
v-if="item.type === 'switch'"
|
||||
v-model="item.value"
|
||||
:active-text="item.name"
|
||||
:disabled="item.disabled"
|
||||
@change="item.callback( item.value)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<div class="right-side" style="float: right">
|
||||
<div
|
||||
v-for="(item,index) in toolbar.right"
|
||||
:key="index"
|
||||
style="display: inline-block"
|
||||
>
|
||||
<el-tooltip :content="item.tip">
|
||||
<el-button
|
||||
v-if="item.type ==='button'"
|
||||
:disabled="item.disabled"
|
||||
size="mini"
|
||||
style="background-color: transparent"
|
||||
type="default"
|
||||
@click="item.callback()"
|
||||
>
|
||||
<i v-if="item.icon.startsWith('fa')" :class="'fa ' + item.icon" />
|
||||
<svg-icon v-else :icon-class="item.icon" style="font-size: 14px;" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<codemirror ref="myCm" v-model="iValue" :options="iOptions" class="editor" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { codemirror } from 'vue-codemirror'
|
||||
|
||||
import 'codemirror/mode/shell/shell'
|
||||
import 'codemirror/mode/powershell/powershell'
|
||||
import 'codemirror/mode/python/python'
|
||||
import 'codemirror/mode/yaml/yaml'
|
||||
import 'codemirror/mode/ruby/ruby' // theme css
|
||||
import 'codemirror/theme/base16-light.css'
|
||||
import 'codemirror/theme/idea.css'
|
||||
import 'codemirror/theme/mbo.css'
|
||||
import 'codemirror/theme/duotone-light.css'
|
||||
import 'codemirror/lib/codemirror.css'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
codemirror
|
||||
},
|
||||
props: {
|
||||
toolbar: {
|
||||
type: [Array, Object],
|
||||
default: () => []
|
||||
},
|
||||
value: {
|
||||
type: [String, Object],
|
||||
default: () => ''
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
iValue: {
|
||||
get() {
|
||||
return this.value
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:value', val)
|
||||
this.$emit('change', val)
|
||||
}
|
||||
},
|
||||
iOptions() {
|
||||
const defaultOptions = {
|
||||
tabSize: 4,
|
||||
mode: 'shell',
|
||||
lineNumbers: true,
|
||||
theme: 'idea',
|
||||
placeholder: 'Code goes here...',
|
||||
autofocus: true
|
||||
}
|
||||
return Object.assign(defaultOptions, this.options)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getLabel(value, items) {
|
||||
for (const item of items) {
|
||||
if (item.value === value) {
|
||||
return item.label
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.editor {
|
||||
border: solid 1px #f3f3f3;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
line-height: 29px;
|
||||
vertical-align: bottom;
|
||||
display: inline-block;
|
||||
padding: 3px 3px 3px 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
> > > .CodeMirror pre.CodeMirror-line,
|
||||
> > > .CodeMirror-linenumber.CodeMirror-gutter-elt {
|
||||
line-height: 18px !important;
|
||||
}
|
||||
|
||||
.runas-input {
|
||||
height: 28px;
|
||||
|
||||
> > > {
|
||||
.el-select {
|
||||
width: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right-side {
|
||||
.el-button {
|
||||
border: none;
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
color: #888;
|
||||
background-color: transparent;
|
||||
margin-left: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.autoWidth-select {
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
.autoWidth-select > > > .el-input__prefix {
|
||||
position: relative;
|
||||
left: 0px;
|
||||
box-sizing: border-box;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.autoWidth-select > > > input {
|
||||
position: absolute;
|
||||
padding-left: 0px;
|
||||
border: none;
|
||||
color: #606266;
|
||||
background-color: #e6e6e6;
|
||||
font-size: 12px;
|
||||
font-weight: 470;
|
||||
line-height: 27px;
|
||||
}
|
||||
|
||||
> > > .el-select {
|
||||
top: -1px;
|
||||
|
||||
.el-input .el-select__caret {
|
||||
color: #7a7c7f;
|
||||
}
|
||||
}
|
||||
|
||||
> > > .el-button.el-button--default {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
|
||||
.filter-label {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.select-content {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
padding-left: 15px;
|
||||
font-size: 0;
|
||||
border: 1px solid #DCDFE6;
|
||||
border-radius: 4px;
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
</style>
|
||||
@@ -2,9 +2,9 @@
|
||||
<el-date-picker
|
||||
v-model="value"
|
||||
type="datetimerange"
|
||||
:range-separator="this.$t('common.To')"
|
||||
:start-placeholder="this.$t('common.DateStart')"
|
||||
:end-placeholder="this.$t('common.DateEnd')"
|
||||
:range-separator="$tc('common.To')"
|
||||
:start-placeholder="$tc('common.DateStart')"
|
||||
:end-placeholder="$tc('common.DateEnd')"
|
||||
size="small"
|
||||
:clearable="false"
|
||||
class="datepicker"
|
||||
@@ -41,37 +41,23 @@ export default {
|
||||
shortcuts: [
|
||||
{
|
||||
text: this.$t('common.DateLast24Hours'),
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
onClick: (picker) => this.onShortcutClick(picker, 1)
|
||||
},
|
||||
{
|
||||
text: this.$t('common.DateLastWeek'),
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
onClick: (picker) => this.onShortcutClick(picker, 7)
|
||||
}, {
|
||||
text: this.$t('common.DateLastMonth'),
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
onClick: (picker) => this.onShortcutClick(picker, 30)
|
||||
}, {
|
||||
text: this.$t('common.DateLast3Months'),
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
onClick: (picker) => this.onShortcutClick(picker, 90)
|
||||
}, {
|
||||
text: this.$t('common.DateLastHarfYear'),
|
||||
onClick: (picker) => this.onShortcutClick(picker, 183)
|
||||
}, {
|
||||
text: this.$t('common.DateLastYear'),
|
||||
onClick: (picker) => this.onShortcutClick(picker, 365)
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -86,28 +72,38 @@ export default {
|
||||
this.$log.debug('Date change: ', val)
|
||||
this.$emit('dateChange', val)
|
||||
}
|
||||
},
|
||||
onShortcutClick(picker, day) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * day)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.datepicker{
|
||||
.datepicker {
|
||||
width: 233px;
|
||||
&>>> .el-range__icon {
|
||||
|
||||
& >>> .el-range__icon {
|
||||
margin-top: 2px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
&>>> .el-range-input {
|
||||
|
||||
& >>> .el-range-input {
|
||||
width: 49%;
|
||||
}
|
||||
}
|
||||
.el-input__inner{
|
||||
|
||||
.el-input__inner {
|
||||
border: 1px solid #dcdee2;
|
||||
border-radius: 3px;
|
||||
height: 36px;
|
||||
height: 32px;
|
||||
}
|
||||
.el-date-editor ::v-deep .el-range-separator{
|
||||
|
||||
.el-date-editor ::v-deep .el-range-separator {
|
||||
line-height: 28px;
|
||||
}
|
||||
</style>
|
||||
96
src/components/Form/FormFields/DynamicInput.vue
Normal file
96
src/components/Form/FormFields/DynamicInput.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-for="(command, index) in iValue" :key="index" :prop="'iValue.' + index + '.value'" class="command-item">
|
||||
<el-input v-model="iValue[index]" size="mini">
|
||||
<template slot="prepend"> {{ inputTitle + ' ' + (index + 1) }}</template>
|
||||
</el-input>
|
||||
<div class="input-button">
|
||||
<el-button
|
||||
:disabled="deleteDisabled()"
|
||||
icon="el-icon-minus"
|
||||
size="mini"
|
||||
style="flex-shrink: 0;"
|
||||
type="danger"
|
||||
@click="handleDelete(command)"
|
||||
/>
|
||||
<el-button
|
||||
v-if="index === iValue.length - 1"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
style="flex-shrink: 0;"
|
||||
type="primary"
|
||||
@click="handleAdd()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => ['']
|
||||
},
|
||||
inputTitle: {
|
||||
type: String,
|
||||
default: () => ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
iValue: ['']
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
iValue: {
|
||||
handler(v) {
|
||||
this.$emit('input', Array.from(v))
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.iValue = Array.from(this.value)
|
||||
},
|
||||
methods: {
|
||||
handleDelete(command) {
|
||||
const index = this.iValue.indexOf(command)
|
||||
if (index !== -1) {
|
||||
this.iValue.splice(index, 1)
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
this.iValue.push('')
|
||||
},
|
||||
deleteDisabled() {
|
||||
return this.iValue.length <= 1
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-input {
|
||||
width: 85%;
|
||||
}
|
||||
.command-item {
|
||||
display: flex;
|
||||
margin: 5px 0;
|
||||
}
|
||||
.input-button {
|
||||
margin-top: 2px;
|
||||
display: flex;
|
||||
margin-left: 20px
|
||||
}
|
||||
.input-button ::v-deep .el-button.el-button--mini {
|
||||
height: 25px;
|
||||
padding: 5px;
|
||||
}
|
||||
.el-input-group__append .el-button {
|
||||
font-size: 14px;
|
||||
color: #1a1a1a;
|
||||
padding: 9px 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:destroy-on-close="true"
|
||||
:show-buttons="false"
|
||||
:title="$tc('common.SelectAttrs')"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<div v-if="!loading">
|
||||
<DataForm
|
||||
:form="form"
|
||||
class="attr-form"
|
||||
v-bind="formConfig"
|
||||
@submit="onAttrDialogConfirm"
|
||||
/>
|
||||
</div>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DataForm from '@/components/Form/DataForm/index.vue'
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
import ValueField from '@/components/Form/FormFields/JSONManyToManySelect/ValueField.vue'
|
||||
import { attrMatchOptions, typeMatchMapper } from '@/components/const'
|
||||
|
||||
export default {
|
||||
name: 'AttrFormDialog',
|
||||
components: { Dialog, DataForm },
|
||||
props: {
|
||||
attrs: {
|
||||
type: Array,
|
||||
default: () => ([])
|
||||
},
|
||||
attrsAdded: {
|
||||
type: Array,
|
||||
default: () => ([])
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
loading: true,
|
||||
currentValue: '',
|
||||
formConfig: {
|
||||
// 为了方便更新,避免去取 fields 的索引
|
||||
hasSaveContinue: false,
|
||||
fields: [
|
||||
{
|
||||
id: 'name',
|
||||
label: this.$t('common.AttrName'),
|
||||
type: 'select',
|
||||
options: this.attrs.map(attr => {
|
||||
let disabled = this.attrsAdded.includes(attr.name) && this.form.name !== attr.name
|
||||
if (attr.disabled) {
|
||||
disabled = true
|
||||
}
|
||||
return { label: attr.label, value: attr.name, disabled: disabled }
|
||||
}),
|
||||
on: {
|
||||
change: ([val], updateForm) => {
|
||||
// 变化会影响 match 的选项
|
||||
const attr = this.attrs.find(attr => attr.name === val)
|
||||
if (!attr) return
|
||||
const matchOption = vm.updateMatchOptions(attr)
|
||||
setTimeout(() => {
|
||||
updateForm({ match: matchOption.value })
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'match',
|
||||
label: this.$t('common.Match'),
|
||||
type: 'select',
|
||||
options: attrMatchOptions,
|
||||
on: {
|
||||
change: ([value], updateForm) => {
|
||||
// 变化会影响 value 的选项
|
||||
setTimeout(() => {
|
||||
this.formConfig.fields[2].el.match = value
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'value',
|
||||
label: this.$t('common.AttrValue'),
|
||||
component: ValueField,
|
||||
el: {
|
||||
match: attrMatchOptions[0].value,
|
||||
attr: this.attrs[0]
|
||||
},
|
||||
on: {
|
||||
input: ([value], updateForm) => {
|
||||
vm.currentValue = value
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.form.index === undefined || this.form.index === -1) {
|
||||
Object.assign(this.form, this.getDefaultAttrForm())
|
||||
}
|
||||
this.updateMatchOptions()
|
||||
this.$log.debug('Attr Form config: ', this.formConfig)
|
||||
this.loading = false
|
||||
},
|
||||
methods: {
|
||||
getDefaultAttrForm() {
|
||||
const attrKeys = this.attrs.map(attr => attr.name)
|
||||
const diff = attrKeys.filter(attr => !this.attrsAdded.includes(attr))
|
||||
let name = this.attrs[0].name
|
||||
if (diff.length > 0) {
|
||||
name = diff[0]
|
||||
}
|
||||
return {
|
||||
name: name,
|
||||
match: 'exact',
|
||||
value: '',
|
||||
rel: 'and'
|
||||
}
|
||||
},
|
||||
onAttrDialogConfirm(form) {
|
||||
this.$emit('confirm', form)
|
||||
},
|
||||
updateMatchOptions(attr) {
|
||||
if (!attr) {
|
||||
attr = this.attrs.find(attr => attr.name === this.form.name)
|
||||
}
|
||||
if (!attr) return
|
||||
const attrType = attr.type || 'str'
|
||||
const matchSupports = typeMatchMapper[attrType]
|
||||
attrMatchOptions.forEach((option) => {
|
||||
option.hidden = !matchSupports.includes(option.value)
|
||||
})
|
||||
this.formConfig.fields[2].el.attr = attr
|
||||
const supports = attrMatchOptions.filter(option => !option.hidden)
|
||||
const matchOption = supports.find(item => item.value === this.form.match) || supports[0]
|
||||
this.formConfig.fields[2].el.match = matchOption.value
|
||||
return matchOption
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.attr-form {
|
||||
>>> .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:destroy-on-close="true"
|
||||
:show-buttons="false"
|
||||
:title="$tc('common.MatchResult')"
|
||||
:v-bind="$attrs"
|
||||
:v-on="$listeners"
|
||||
:visible.sync="iVisible"
|
||||
>
|
||||
<ListTable v-bind="attrMatchTableConfig" />
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
import ListTable from '@/components/Table/ListTable/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'AttrMatchResultDialog',
|
||||
components: { ListTable, Dialog },
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
attrs: {
|
||||
type: Array,
|
||||
default: () => ([])
|
||||
},
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrMatchTableConfig: {
|
||||
headerActions: {
|
||||
hasCreate: false,
|
||||
hasImport: false,
|
||||
hasExport: false,
|
||||
hasMoreActions: false
|
||||
},
|
||||
tableConfig: {
|
||||
url: this.url,
|
||||
columns: this.attrs.filter(item => item.inTable).map(item => {
|
||||
return {
|
||||
prop: item.name,
|
||||
label: item.label,
|
||||
formatter: item.formatter
|
||||
}
|
||||
}),
|
||||
columnsMeta: {
|
||||
actions: {
|
||||
has: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iVisible: {
|
||||
set(val) {
|
||||
this.$emit('update:visible', val)
|
||||
},
|
||||
get() {
|
||||
return this.visible
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<div v-if="!loading">
|
||||
<TagInput v-if="type === 'array'" :value="iValue" @input="handleInput" />
|
||||
<Select2 v-else-if="type === 'select'" :value="iValue" v-bind="attr.el" @change="handleInput" @input="handleInput" />
|
||||
<Switcher v-else-if="type === 'bool'" :value="iValue" @change="handleInput" @input="handleInput" />
|
||||
<el-input v-else :value="iValue" @input="handleInput" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TagInput from '@/components/Form/FormFields/TagInput.vue'
|
||||
import Select2 from '@/components/Form/FormFields/Select2.vue'
|
||||
import Switcher from '@/components/Form/FormFields/Switcher.vue'
|
||||
|
||||
export default {
|
||||
name: 'ValueField',
|
||||
components: { Switcher, TagInput, Select2 },
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number, Boolean, Array, Object],
|
||||
default: () => ''
|
||||
},
|
||||
match: {
|
||||
type: String,
|
||||
default: 'exact'
|
||||
},
|
||||
attr: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
type: 'string'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iValue: {
|
||||
get() {
|
||||
const multipleTypes = ['array', 'select']
|
||||
let newValue = this.value
|
||||
if (multipleTypes.includes(this.type)) {
|
||||
if (!Array.isArray(this.value)) {
|
||||
newValue = []
|
||||
}
|
||||
} else if (this.type === 'bool') {
|
||||
newValue = !!this.value
|
||||
} else {
|
||||
if (Array.isArray(this.value)) {
|
||||
newValue = ''
|
||||
} else {
|
||||
newValue = this.value.toString()
|
||||
}
|
||||
}
|
||||
if (this.value !== newValue) {
|
||||
this.handleInput(newValue)
|
||||
}
|
||||
return newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
match() {
|
||||
this.changeValueType()
|
||||
},
|
||||
attr: {
|
||||
handler() {
|
||||
this.changeValueType()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.changeValueType()
|
||||
},
|
||||
methods: {
|
||||
handleInput(value) {
|
||||
this.$emit('input', value)
|
||||
},
|
||||
changeValueType() {
|
||||
this.loading = true
|
||||
this.type = this.getType()
|
||||
this.$nextTick(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getType() {
|
||||
const attrType = this.attr.type || 'str'
|
||||
this.$log.debug('Value field attr type: ', attrType, this.attr, this.match)
|
||||
if (['m2m', 'fk', 'select'].includes(attrType)) {
|
||||
return 'select'
|
||||
} else if (attrType === 'bool') {
|
||||
return 'bool'
|
||||
}
|
||||
if (['in', 'ip_in'].includes(this.match)) {
|
||||
return 'array'
|
||||
} else if (this.match.startsWith('m2m')) {
|
||||
return 'select'
|
||||
} else {
|
||||
return 'string'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<span v-if="attr.type === 'bool'">
|
||||
<i v-if="value" class="fa fa-check text-primary" />
|
||||
<i v-else class="fa fa-times text-danger" />
|
||||
</span>
|
||||
<span v-else :title="value">
|
||||
{{ value }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseFormatter from '@/components/Table/TableFormatters/base.vue'
|
||||
import { setUrlParam } from '@/utils/common'
|
||||
|
||||
export default {
|
||||
name: 'ValueFormatter',
|
||||
extends: BaseFormatter,
|
||||
props: {
|
||||
formatterArgsDefault: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
attrs: {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const formatterArgs = Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
|
||||
return {
|
||||
formatterArgs: formatterArgs,
|
||||
loading: true,
|
||||
attr: {},
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cellValue: {
|
||||
handler() {
|
||||
this.getValue()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
formatterArgs: {
|
||||
handler() {
|
||||
this.getValue()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
row: {
|
||||
handler() {
|
||||
this.getValue()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
this.getValue()
|
||||
}, 100)
|
||||
},
|
||||
methods: {
|
||||
async getValue() {
|
||||
this.attr = this.formatterArgs.attrs.find(attr => attr.name === this.row.name)
|
||||
const match = this.row.match
|
||||
this.$log.debug('ValueFormatter: ', this.attr, this.row.name)
|
||||
if (this.attr.type === 'm2m') {
|
||||
const url = setUrlParam(this.attr.el.url, 'ids', this.cellValue.join(','))
|
||||
const data = await this.$axios.get(url) || []
|
||||
if (data.length > 0) {
|
||||
const displayField = this.attr.el.displayField || 'name'
|
||||
this.value = data.map(item => item[displayField]).join(', ')
|
||||
}
|
||||
} else if (this.attr.type === 'select') {
|
||||
const options = this.attr.el.options || []
|
||||
const items = options.filter(item => this.cellValue.includes(item.value))
|
||||
this.value = items.map(item => item.label).join(', ')
|
||||
} else if (['in', 'ip_in'].includes(match)) {
|
||||
this.value = this.cellValue.join(', ')
|
||||
} else {
|
||||
this.value = this.cellValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user