mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-14 03:46:26 +00:00
Compare commits
490 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce57c6d0a9 | ||
|
|
171ceeef3a | ||
|
|
754e861294 | ||
|
|
e7b37d43f2 | ||
|
|
fd749ef211 | ||
|
|
5667c39bcb | ||
|
|
982ce90a9a | ||
|
|
86ce758adb | ||
|
|
582a84178d | ||
|
|
73de782756 | ||
|
|
9b9f7c936c | ||
|
|
55100e64a1 | ||
|
|
6d74959b64 | ||
|
|
2a6100957f | ||
|
|
6a3f6f8914 | ||
|
|
704ae0b294 | ||
|
|
9bf4597d8d | ||
|
|
16606d6a27 | ||
|
|
bb1d19610e | ||
|
|
ca871b16c4 | ||
|
|
0a612f50e6 | ||
|
|
d566adb644 | ||
|
|
242f958428 | ||
|
|
f97d46814d | ||
|
|
5cc501f5af | ||
|
|
31fd0ecde0 | ||
|
|
9d6ac3907a | ||
|
|
784bd16e87 | ||
|
|
4a11ea2c57 | ||
|
|
4a2ffc754f | ||
|
|
d31929eb33 | ||
|
|
fe36fa9390 | ||
|
|
a97de8afb4 | ||
|
|
ba109900ec | ||
|
|
f8649457d6 | ||
|
|
8863693541 | ||
|
|
c2cbd3f5b0 | ||
|
|
0b84b96afb | ||
|
|
ec7768267f | ||
|
|
4aefb6779f | ||
|
|
06fd007c62 | ||
|
|
6f4e029537 | ||
|
|
cc58b374ab | ||
|
|
07f35dbbb2 | ||
|
|
04ffbb8fd6 | ||
|
|
12a501d559 | ||
|
|
7dcd4490ba | ||
|
|
dd1ac7c7f8 | ||
|
|
471910e0b8 | ||
|
|
a514e88b78 | ||
|
|
b79fefdee8 | ||
|
|
d2b3025709 | ||
|
|
386e2417e3 | ||
|
|
fd57b37cea | ||
|
|
a6222f87d2 | ||
|
|
5cd4e5b40b | ||
|
|
eb3d9089e0 | ||
|
|
56c22cffe6 | ||
|
|
fe1e26957a | ||
|
|
bc366947f0 | ||
|
|
86150cc571 | ||
|
|
f11fc947af | ||
|
|
49880f6739 | ||
|
|
82faf0f99e | ||
|
|
e6f98d58c4 | ||
|
|
3536a94976 | ||
|
|
45276010e0 | ||
|
|
2e47f42366 | ||
|
|
dd6e9a1512 | ||
|
|
fd1f16d43c | ||
|
|
24931a9f5a | ||
|
|
f51924bf1d | ||
|
|
f82257edb8 | ||
|
|
286e9894c0 | ||
|
|
968b2415b1 | ||
|
|
e0f6fb305d | ||
|
|
e0fd33f376 | ||
|
|
7ad86062b4 | ||
|
|
1fce7561db | ||
|
|
3b17235b6e | ||
|
|
52c9b9503b | ||
|
|
48a2b20320 | ||
|
|
e6cc8cd2e8 | ||
|
|
3a183ddf53 | ||
|
|
7eb77487d1 | ||
|
|
a5da581317 | ||
|
|
6bda9a372e | ||
|
|
a8de087137 | ||
|
|
34d9790a04 | ||
|
|
5bfe2497fd | ||
|
|
e16a775037 | ||
|
|
42fab92237 | ||
|
|
e2eac83615 | ||
|
|
04465a1da3 | ||
|
|
2adb1ee980 | ||
|
|
776090d6ba | ||
|
|
2c66bec7c9 | ||
|
|
b10f7faf25 | ||
|
|
450014ab16 | ||
|
|
8ad0d2ac58 | ||
|
|
bd41f96df3 | ||
|
|
3a37952288 | ||
|
|
5346eb1ef1 | ||
|
|
62b8fc0e3b | ||
|
|
f532d624e0 | ||
|
|
4ce6f49b30 | ||
|
|
2fb160b5f7 | ||
|
|
4ed9fb2acc | ||
|
|
722fc083cb | ||
|
|
4356b79ecc | ||
|
|
5eff817b05 | ||
|
|
4f08fef25a | ||
|
|
b2028869cb | ||
|
|
325f21f8b5 | ||
|
|
802d6f6cd3 | ||
|
|
f2120521d6 | ||
|
|
cbdeea9be7 | ||
|
|
8d2d38327a | ||
|
|
5c564c42dc | ||
|
|
0c47f8f962 | ||
|
|
65d625ad3c | ||
|
|
0e65b7f1be | ||
|
|
22cfaf8665 | ||
|
|
b3670fe528 | ||
|
|
2f80b66b07 | ||
|
|
5277a725f8 | ||
|
|
b400c13965 | ||
|
|
c71f0c17fc | ||
|
|
a952477c3b | ||
|
|
1153a3b38b | ||
|
|
2e69cd86aa | ||
|
|
a5ea6360bd | ||
|
|
0639b139d7 | ||
|
|
a8867dee83 | ||
|
|
c4d0462362 | ||
|
|
db97240ad3 | ||
|
|
5b6f06ac0e | ||
|
|
51de827c2b | ||
|
|
49566cdae7 | ||
|
|
b6786687b6 | ||
|
|
c83abe32c6 | ||
|
|
1b19e0201d | ||
|
|
7681250fff | ||
|
|
9fe4e0b613 | ||
|
|
f137788c1a | ||
|
|
2f09c3f355 | ||
|
|
ea047e01d1 | ||
|
|
f7d17c8de7 | ||
|
|
86ead72858 | ||
|
|
48b22edace | ||
|
|
ea682a2aaa | ||
|
|
8b499d8f7f | ||
|
|
25c04e9c05 | ||
|
|
5dca562a12 | ||
|
|
7701bc9b67 | ||
|
|
157bc08f84 | ||
|
|
feea70b0be | ||
|
|
7921f1f9e5 | ||
|
|
a7252d16d1 | ||
|
|
04696ef3d6 | ||
|
|
cdde3799af | ||
|
|
f0b987ed54 | ||
|
|
af60fdabda | ||
|
|
af0d6202bb | ||
|
|
c1e3c23523 | ||
|
|
7232706a7f | ||
|
|
dd2b76473f | ||
|
|
b41c3ac687 | ||
|
|
1731f4f788 | ||
|
|
fa74dad83d | ||
|
|
6f25d93909 | ||
|
|
06a09b90e2 | ||
|
|
3c9767b791 | ||
|
|
da66f5e123 | ||
|
|
e4f33cce14 | ||
|
|
a5b374e524 | ||
|
|
46461ec324 | ||
|
|
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 | ||
|
|
111d3d56e2 | ||
|
|
91c6a4d6b2 | ||
|
|
58ab7139d6 | ||
|
|
81d8cd971c | ||
|
|
ea3e26b92c | ||
|
|
a076a277c9 | ||
|
|
3c9a3b693b | ||
|
|
79f6bea423 | ||
|
|
ea8af7deb3 | ||
|
|
fcfd26c58f | ||
|
|
a6c1e16339 | ||
|
|
c899b209d7 | ||
|
|
bba8f8a9a0 | ||
|
|
d1b620956e | ||
|
|
f260979a11 | ||
|
|
f3bc6bdd46 | ||
|
|
7fe91756c9 | ||
|
|
0fa05aaeb4 | ||
|
|
2183e6bc89 | ||
|
|
1ecc57b21b | ||
|
|
76085f42c5 | ||
|
|
ba0a425359 | ||
|
|
c18f712b84 | ||
|
|
6815d3be13 | ||
|
|
385e654fbe | ||
|
|
09010e4e94 | ||
|
|
f347833ea8 | ||
|
|
ae9c5c389d | ||
|
|
15a53c4b90 | ||
|
|
703898e707 | ||
|
|
fe0d7a7e3f | ||
|
|
09b6bc1c18 | ||
|
|
d1a2564359 | ||
|
|
a3193beabf | ||
|
|
f46a1054ea | ||
|
|
64813f9cb6 | ||
|
|
a6c0207c7e | ||
|
|
bf207285a8 | ||
|
|
dd026f11ee | ||
|
|
a58accca4d | ||
|
|
bb572a3de9 | ||
|
|
8836284b88 | ||
|
|
68d97242cc | ||
|
|
1bb3f0a48e | ||
|
|
7b566ae46f | ||
|
|
9dd89fe7ae | ||
|
|
db67aa9b39 | ||
|
|
df96ce4112 | ||
|
|
4d27014330 | ||
|
|
1cb10902d5 | ||
|
|
b71b602433 | ||
|
|
e39c4fc339 | ||
|
|
9107c6a76a | ||
|
|
55a83a2064 | ||
|
|
92f52b100a | ||
|
|
5cd3aea0a3 | ||
|
|
78b72ec68a | ||
|
|
04c0c10d46 | ||
|
|
c2833cefc2 | ||
|
|
1878376295 | ||
|
|
b25b7dfbc9 | ||
|
|
98c2677571 | ||
|
|
dd58f400a6 | ||
|
|
a0baca0859 | ||
|
|
8f7bcc2e26 | ||
|
|
5835ac7f70 | ||
|
|
fe5941e078 | ||
|
|
b497f80a76 | ||
|
|
8efb405fc0 | ||
|
|
51d0861550 | ||
|
|
3050b09b2d | ||
|
|
aa00f1e4a6 | ||
|
|
c604957e66 | ||
|
|
91d0f6f92b | ||
|
|
f11131e9ad | ||
|
|
db1b02c262 | ||
|
|
2610645703 | ||
|
|
a9ee9ac919 | ||
|
|
b9cd54127c | ||
|
|
b24deb6c1e | ||
|
|
ee901e54d3 | ||
|
|
0b5820edba | ||
|
|
f10118d9d2 | ||
|
|
c7bf054af7 | ||
|
|
fd9916b21b | ||
|
|
e78e0cf132 | ||
|
|
441c1eb91d | ||
|
|
ab4edd37d4 | ||
|
|
def43f8e07 | ||
|
|
ea1148159b | ||
|
|
92a23c6e69 | ||
|
|
d6c3cce161 | ||
|
|
fe5649fbd2 | ||
|
|
e91ca71812 | ||
|
|
4a8305979e | ||
|
|
b81cbb3d16 | ||
|
|
b95867d229 | ||
|
|
1ac9ca4593 | ||
|
|
e59a71285d | ||
|
|
fac0c6ff9a | ||
|
|
688eb5838f | ||
|
|
075ad0358b | ||
|
|
1187892370 | ||
|
|
68e30c29fa | ||
|
|
565ed805da | ||
|
|
59fa4cd6e0 | ||
|
|
547263d44c | ||
|
|
59a0a41586 | ||
|
|
2d887df226 | ||
|
|
03ad4cc73c | ||
|
|
4fd8956b0d | ||
|
|
9d75e2e6fd | ||
|
|
6317400da8 | ||
|
|
7f963e9991 | ||
|
|
8a731937cf | ||
|
|
a593da7fea | ||
|
|
b9547214b7 | ||
|
|
0e7b60a001 | ||
|
|
20f84db466 | ||
|
|
c5495d9846 | ||
|
|
332cd2c073 | ||
|
|
2b4d827789 | ||
|
|
92144e4f69 | ||
|
|
41d42c04a6 | ||
|
|
f4f42639aa | ||
|
|
a37af9ed7d | ||
|
|
1f0fe18533 | ||
|
|
bc21d7ac17 | ||
|
|
922ecbf096 | ||
|
|
a162a206bc | ||
|
|
12a85da6f7 | ||
|
|
585f5e04d6 | ||
|
|
6db90fce09 | ||
|
|
69e392b069 | ||
|
|
e5b2bd7008 | ||
|
|
c6aaaaf1fd | ||
|
|
1ab6ed6109 | ||
|
|
c17d983b2f | ||
|
|
484fb63577 | ||
|
|
2c8d8c6e66 | ||
|
|
5577051416 | ||
|
|
cd51596d45 | ||
|
|
dd5b805da9 | ||
|
|
54097f07be | ||
|
|
ef5c1b2e23 | ||
|
|
f104376e92 | ||
|
|
62ed11e7ec | ||
|
|
3fd8e23c2c | ||
|
|
a93ecac15c | ||
|
|
1fb75fbce0 | ||
|
|
1d594fc594 | ||
|
|
a4abe63ec9 | ||
|
|
4262410038 | ||
|
|
2735d638a2 | ||
|
|
f9bade6a7c | ||
|
|
eaf3c5b013 | ||
|
|
2c2e7d10f9 | ||
|
|
9243a6699c | ||
|
|
e9a2818580 | ||
|
|
4b318c0aaf | ||
|
|
e9211205cb | ||
|
|
e14a31f31c | ||
|
|
b85db6b73f | ||
|
|
6d8dc058cb | ||
|
|
2b3090b44c | ||
|
|
f08b3708d4 | ||
|
|
a8a7538655 | ||
|
|
364f2aaf12 | ||
|
|
dcb87c6216 | ||
|
|
06bd68a874 | ||
|
|
4a2b663220 | ||
|
|
59342b65c8 | ||
|
|
4edd9097ab | ||
|
|
6e10f4ccc1 | ||
|
|
9510dec9e0 | ||
|
|
31bb679a8e | ||
|
|
357b67ffe0 | ||
|
|
07036cdea7 | ||
|
|
ec2674a956 | ||
|
|
e5791c184d | ||
|
|
bcd0384baa | ||
|
|
461a385596 | ||
|
|
0c9440d835 | ||
|
|
9f7c145065 | ||
|
|
05d66c4c4f | ||
|
|
c1498d4de5 | ||
|
|
34f17beb3c | ||
|
|
c6f39c79fa | ||
|
|
ae5005ceef | ||
|
|
dad107d768 | ||
|
|
021dbe6e2e | ||
|
|
8ae14bfb37 | ||
|
|
ea2c3f1a11 | ||
|
|
dadeea6d1e | ||
|
|
05e5bcc10d | ||
|
|
87d211563f | ||
|
|
6b7f868538 | ||
|
|
d3c2d0e7e8 | ||
|
|
088dbc4e42 | ||
|
|
18016ffdba | ||
|
|
b57e65a100 | ||
|
|
8852924d45 | ||
|
|
da1f322e1c | ||
|
|
b22b01529a | ||
|
|
26ba2c091e | ||
|
|
23ee181c63 | ||
|
|
3aca8cdffd | ||
|
|
b5cd17485e | ||
|
|
4db98964dd | ||
|
|
3a1870cae1 | ||
|
|
c36cc7b15f | ||
|
|
07b69ab9a8 | ||
|
|
222eb4fcb0 | ||
|
|
632dc064d9 | ||
|
|
cc513c96f5 | ||
|
|
b3752ba867 | ||
|
|
f18e46ba22 |
2
.github/workflows/release-drafter.yml
vendored
2
.github/workflows/release-drafter.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build it and upload
|
||||
uses: jumpserver/action-build-upload-assets@node10
|
||||
uses: jumpserver/action-build-upload-assets@node14.16
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
||||
31
Dockerfile
31
Dockerfile
@@ -1,23 +1,26 @@
|
||||
FROM node:10 as stage-build
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
ARG NPM_REGISTRY="https://registry.npm.taobao.org"
|
||||
FROM node:14.16 as stage-build
|
||||
ARG TARGETARCH
|
||||
ARG NPM_REGISTRY="https://registry.npmmirror.com"
|
||||
ENV NPM_REGISTY=$NPM_REGISTRY
|
||||
ARG SASS_BINARY_SITE="https://npm.taobao.org/mirrors/node-sass"
|
||||
ENV SASS_BINARY_SITE=$SASS_BINARY_SITE
|
||||
|
||||
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
|
||||
RUN set -ex \
|
||||
&& npm config set registry ${NPM_REGISTRY} \
|
||||
&& yarn config set registry ${NPM_REGISTRY} \
|
||||
&& yarn config set cache-folder /root/.cache/yarn/lina
|
||||
|
||||
ADD package.json yarn.lock /data
|
||||
RUN --mount=type=cache,target=/root/.cache/yarn \
|
||||
yarn install
|
||||
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
ADD . /data
|
||||
RUN cd utils && bash -xieu build.sh build
|
||||
RUN --mount=type=cache,target=/root/.cache/yarn \
|
||||
sed -i "s@Version <strong>.*</strong>@Version <strong>${VERSION}</strong>@g" src/layout/components/Footer/index.vue \
|
||||
&& yarn build
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY --from=stage-build /data/release/lina /opt/lina
|
||||
COPY --from=stage-build /data/lina /opt/lina
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
@@ -19,7 +19,7 @@ VUE_APP_CORE_HOST = 'JUMPSERVER_APIHOST'
|
||||
$ yarn serve
|
||||
|
||||
4. 构建
|
||||
$ yarn build
|
||||
$ yarn build:prod
|
||||
```
|
||||
|
||||
## 生产中部署
|
||||
|
||||
@@ -24,9 +24,9 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
|
||||
)
|
||||
|
||||
app.listen(port, function () {
|
||||
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
|
||||
// debug(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
|
||||
if (report) {
|
||||
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
|
||||
// debug(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
@@ -56,7 +56,7 @@ const responseFake = (url, type, respond) => {
|
||||
url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`),
|
||||
type: type || 'get',
|
||||
response(req, res) {
|
||||
console.log('request invoke:' + req.path)
|
||||
// debug('request invoke:' + req.path)
|
||||
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ module.exports = app => {
|
||||
mockRoutesLength = mockRoutes.mockRoutesLength
|
||||
mockStartIndex = mockRoutes.mockStartIndex
|
||||
|
||||
console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`))
|
||||
// debug(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`))
|
||||
} catch (error) {
|
||||
console.log(chalk.redBright(error))
|
||||
// debug(chalk.redBright(error))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
const tokens = {
|
||||
admin: {
|
||||
token: 'admin-token'
|
||||
@@ -46,7 +45,6 @@ export default [
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// get user info
|
||||
{
|
||||
url: '/vue-admin-template/user/info\.*',
|
||||
|
||||
14
package.json
14
package.json
@@ -7,6 +7,7 @@
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"build:prod": "vue-cli-service build",
|
||||
"build:stage": "vue-cli-service build --mode staging",
|
||||
"preview": "node build/index.js --preview",
|
||||
@@ -25,17 +26,20 @@
|
||||
"axios": "0.21.1",
|
||||
"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",
|
||||
@@ -47,8 +51,8 @@
|
||||
"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",
|
||||
@@ -94,7 +98,7 @@
|
||||
"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>
|
||||
|
||||
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,28 +194,14 @@ 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;
|
||||
.el-select-dropdown__item.hover {
|
||||
background-color: primary;
|
||||
color: white;
|
||||
}
|
||||
|
||||
@@ -222,27 +210,27 @@ td .el-button.el-button--mini {
|
||||
}
|
||||
|
||||
.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: primary;
|
||||
}
|
||||
|
||||
.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 +247,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,21 +330,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--border td:first-child .cell,
|
||||
.el-table--border 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;
|
||||
@@ -417,7 +348,6 @@ a {
|
||||
color: #676a6c;
|
||||
}
|
||||
|
||||
|
||||
.el-table__empty-block {
|
||||
width: 100% !important;
|
||||
}
|
||||
@@ -433,62 +363,101 @@ 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: #606266;
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
.el-input-group__prepend div.el-select .el-input__inner,
|
||||
.el-input-group__prepend div.el-select .el-input__inner:hover {
|
||||
color: #303133;
|
||||
}
|
||||
1
public/theme/element-ui.css
Normal file
1
public/theme/element-ui.css
Normal file
File diff suppressed because one or more lines are too long
@@ -9,3 +9,6 @@ export default {
|
||||
name: 'App'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
||||
@@ -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'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -13,3 +13,9 @@ export function getCurrentOrg() {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
getCurrentOrg,
|
||||
getOrgDetail
|
||||
}
|
||||
|
||||
|
||||
@@ -68,15 +68,21 @@ export function importLdapUser(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getPublicSettings() {
|
||||
export function getPublicSettings(isOpen) {
|
||||
let url
|
||||
if (isOpen) {
|
||||
url = '/api/v1/settings/public/open/'
|
||||
} else {
|
||||
url = '/api/v1/settings/public/'
|
||||
}
|
||||
return request({
|
||||
url: '/api/v1/settings/public/',
|
||||
url: url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function getLogo() {
|
||||
return request({
|
||||
url: '/api/v1/xpack/interface/setting',
|
||||
url: '/api/v1/xpack/interface/setting/',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -69,3 +69,8 @@ export function logout() {
|
||||
export function refreshSessionIdAge() {
|
||||
return getProfile()
|
||||
}
|
||||
|
||||
export default {
|
||||
getProfile,
|
||||
getUserList
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 7.1 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 |
156
src/components/AccountHistoryTable/index.vue
Normal file
156
src/components/AccountHistoryTable/index.vue
Normal file
@@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<div>
|
||||
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" :help-message="title" />
|
||||
<ShowSecretInfo v-if="showViewSecretDialog" :visible.sync="showViewSecretDialog" :account="account" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ActionsFormatter, DetailFormatter, DisplayFormatter } from '@/components/TableFormatters'
|
||||
import ShowSecretInfo from '../AccountListTable/ShowSecretInfo'
|
||||
import { GenericListPage } from '@/layout/components'
|
||||
|
||||
export default {
|
||||
name: 'AccountHistoryTable',
|
||||
components: {
|
||||
GenericListPage,
|
||||
ShowSecretInfo
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
exportUrl: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.url.replace('/assets/accounts-history/', '/assets/account-history-secrets/')
|
||||
}
|
||||
},
|
||||
hasLeftActions: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
otherActions: {
|
||||
type: Array,
|
||||
default: null
|
||||
},
|
||||
hasClone: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
showViewSecretDialog: false,
|
||||
account: {},
|
||||
tableConfig: {
|
||||
url: this.url,
|
||||
permissions: {
|
||||
app: 'assets',
|
||||
resource: 'authbook'
|
||||
},
|
||||
columns: [
|
||||
'hostname', 'ip', 'username', 'version',
|
||||
'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'
|
||||
},
|
||||
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_assethistoryaccountsecret'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
vm.account = row
|
||||
vm.showViewSecretDialog = true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: this.hasLeftActions,
|
||||
hasMoreActions: false,
|
||||
hasCreate: false,
|
||||
hasImport: false,
|
||||
hasExport: this.$hasPerm('assets.view_assethistoryaccountsecret'),
|
||||
exportOptions: {
|
||||
url: this.exportUrl,
|
||||
mfaVerifyRequired: true
|
||||
},
|
||||
searchConfig: {
|
||||
exclude: ['systemuser', 'asset']
|
||||
},
|
||||
hasSearch: true
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('accounts.AccountHistableHelpMessage')
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
url(iNew) {
|
||||
this.$set(this.tableConfig, 'url', iNew)
|
||||
this.$set(this.headerActions.exportOptions, 'url', iNew.replace('/accounts-history/', '/account-history-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: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<MFAVerifyDialog
|
||||
@MFAVerifyDone="getAuthInfo"
|
||||
@MFAVerifyCancel="exit"
|
||||
<UserConfirmDialog
|
||||
:url="url"
|
||||
@UserConfirmDone="getAuthInfo"
|
||||
@UserConfirmCancel="exit"
|
||||
/>
|
||||
<Dialog
|
||||
:title="dialogTitle"
|
||||
@@ -36,12 +37,12 @@
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
import MFAVerifyDialog from '@/components/MFAVerifyDialog'
|
||||
import UserConfirmDialog from '@/components/UserConfirmDialog'
|
||||
export default {
|
||||
name: 'ShowSecretInfo',
|
||||
components: {
|
||||
Dialog,
|
||||
MFAVerifyDialog
|
||||
UserConfirmDialog
|
||||
},
|
||||
props: {
|
||||
account: {
|
||||
@@ -57,16 +58,13 @@ export default {
|
||||
return {
|
||||
dialogTitle: this.$t('common.ViewSecret'),
|
||||
authInfo: {},
|
||||
showAuthInfo: false
|
||||
showAuthInfo: false,
|
||||
url: `/api/v1/assets/account-secrets/${this.account.id}/`
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getAuthInfo()
|
||||
},
|
||||
methods: {
|
||||
getAuthInfo() {
|
||||
const url = `/api/v1/assets/account-secrets/${this.account.id}/`
|
||||
this.$axios.get(url, { disableFlashErrorMsg: true }).then(resp => {
|
||||
this.$axios.get(this.url, { disableFlashErrorMsg: true }).then(resp => {
|
||||
this.authInfo = resp
|
||||
this.showAuthInfo = true
|
||||
})
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
import { UpdateToken, UploadKey } from '@/components/FormFields'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
export default {
|
||||
name: 'UpdateSecretInfo',
|
||||
components: {
|
||||
@@ -61,10 +62,10 @@ export default {
|
||||
handleConfirm() {
|
||||
const data = {}
|
||||
if (this.authInfo.password !== '') {
|
||||
data.password = this.authInfo.password
|
||||
data.password = encryptPassword(this.authInfo.password)
|
||||
}
|
||||
if (this.authInfo.private_key !== '') {
|
||||
data.private_key = this.authInfo.private_key
|
||||
data.private_key = encryptPassword(this.authInfo.private_key)
|
||||
if (this.authInfo.passphrase) data.passphrase = this.authInfo.passphrase
|
||||
}
|
||||
this.$axios.patch(
|
||||
|
||||
@@ -13,6 +13,7 @@ import ShowSecretInfo from './ShowSecretInfo'
|
||||
import UpdateSecretInfo from './UpdateSecretInfo'
|
||||
import { connectivityMeta } from './const'
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
// import i18n from '@/i18n/i18n'
|
||||
|
||||
export default {
|
||||
name: 'AccountListTable',
|
||||
@@ -109,7 +110,10 @@ export default {
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
vm.account = row
|
||||
vm.showViewSecretDialog = true
|
||||
vm.showViewSecretDialog = false
|
||||
setTimeout(() => {
|
||||
vm.showViewSecretDialog = true
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -146,11 +150,20 @@ export default {
|
||||
vm.showUpdateSecretDialog = false
|
||||
setTimeout(() => {
|
||||
vm.showUpdateSecretDialog = true
|
||||
console.log('Show update1: ', vm.showUpdateSecretDialog)
|
||||
})
|
||||
console.log('Show update2: ', vm.showUpdateSecretDialog)
|
||||
}
|
||||
}
|
||||
// {
|
||||
// name: 'History',
|
||||
// title: i18n.t('common.History'),
|
||||
// can: this.$hasPerm('assets.view_assethistoryaccount') && !this.$store.getters.currentOrgIsRoot,
|
||||
// callback: ({ row }) => {
|
||||
// this.$router.push({
|
||||
// name: 'AssetAccountHistoryList',
|
||||
// query: { id: row.id }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -158,7 +171,8 @@ export default {
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: this.hasLeftActions,
|
||||
hasMoreActions: false,
|
||||
hasMoreActions: true,
|
||||
hasCreate: false,
|
||||
hasImport: false,
|
||||
hasExport: this.$hasPerm('assets.view_assetaccountsecret'),
|
||||
exportOptions: {
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
:title="title"
|
||||
@close="onClose"
|
||||
>
|
||||
<span class="announcement-main"> {{ announcement.content }}</span>
|
||||
<span class="announcement-main">{{ announcement.content }}</span>
|
||||
<span v-if="announcement.link">
|
||||
<el-link :href="announcement.link" target="_blank" class="link-more">
|
||||
{{ $t('common.ViewMore') }}
|
||||
</el-link>
|
||||
<i class="fa fa-share-square-o" />
|
||||
<i class="fa fa-external-link" />
|
||||
</span>
|
||||
</el-alert>
|
||||
</template>
|
||||
@@ -60,6 +60,7 @@ export default {
|
||||
}
|
||||
.announcement-main {
|
||||
word-wrap:break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.link-more {
|
||||
font-size: 10px;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<MFAVerifyDialog
|
||||
@MFAVerifyDone="getAuthInfo"
|
||||
@MFAVerifyCancel="exit"
|
||||
<UserConfirmDialog
|
||||
:url="url"
|
||||
@UserConfirmDone="getAuthInfo"
|
||||
@UserConfirmCancel="exit"
|
||||
/>
|
||||
<Dialog
|
||||
:title="dialogTitle"
|
||||
@@ -33,12 +34,12 @@
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
import MFAVerifyDialog from '@/components/MFAVerifyDialog'
|
||||
import UserConfirmDialog from '@/components/UserConfirmDialog'
|
||||
export default {
|
||||
name: 'ShowSecretInfo',
|
||||
components: {
|
||||
Dialog,
|
||||
MFAVerifyDialog
|
||||
UserConfirmDialog
|
||||
},
|
||||
props: {
|
||||
account: {
|
||||
@@ -54,16 +55,13 @@ export default {
|
||||
return {
|
||||
dialogTitle: this.$t('common.ViewSecret'),
|
||||
authInfo: {},
|
||||
showAuthInfo: false
|
||||
showAuthInfo: false,
|
||||
url: `/api/v1/applications/account-secrets/${this.account.id}/`
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getAuthInfo()
|
||||
},
|
||||
methods: {
|
||||
getAuthInfo() {
|
||||
const url = `/api/v1/applications/account-secrets/${this.account.id}/`
|
||||
this.$axios.get(url, { disableFlashErrorMsg: true }).then(resp => {
|
||||
this.$axios.get(this.url, { disableFlashErrorMsg: true }).then(resp => {
|
||||
this.authInfo = resp
|
||||
this.showAuthInfo = true
|
||||
})
|
||||
|
||||
@@ -38,6 +38,10 @@ export default {
|
||||
hasClone: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
systemUserDisabled: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -84,7 +88,7 @@ export default {
|
||||
showOverflowTooltip: true,
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
can: this.$hasPerm('assets.view_systemuser'),
|
||||
can: this.systemUserDisabled && this.$hasPerm('assets.view_systemuser'),
|
||||
getTitle({ row }) {
|
||||
return row.systemuser_display
|
||||
},
|
||||
|
||||
@@ -75,6 +75,8 @@ export default {
|
||||
showMenu: false,
|
||||
showRefresh: true,
|
||||
showAssets: false,
|
||||
showSearch: true,
|
||||
customTreeHeader: true,
|
||||
url: '/api/v1/assets/assets/?fields_size=mini',
|
||||
nodeUrl: '/api/v1/assets/nodes/',
|
||||
// ?assets=0不显示资产. =1显示资产
|
||||
|
||||
@@ -78,15 +78,22 @@ export default {
|
||||
},
|
||||
_cleanFormValue(form, remoteMeta) {
|
||||
for (const [k, v] of Object.entries(remoteMeta)) {
|
||||
if (v.default === undefined) {
|
||||
continue
|
||||
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)
|
||||
}
|
||||
const valueSet = form[k]
|
||||
if (valueSet !== undefined) {
|
||||
continue
|
||||
}
|
||||
if (v.type === 'nested object' && typeof valueSet === 'object') {
|
||||
this._cleanFormValue(valueSet, v.children)
|
||||
if (v.default === undefined) {
|
||||
continue
|
||||
}
|
||||
form[k] = v.default
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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 { assignIfNot } from '@/utils/common'
|
||||
|
||||
@@ -45,7 +46,8 @@ export class FormFieldGenerator {
|
||||
}
|
||||
break
|
||||
case 'boolean':
|
||||
type = 'checkbox'
|
||||
type = ''
|
||||
field.component = Swicher
|
||||
break
|
||||
case 'nested object':
|
||||
type = 'nestedField'
|
||||
|
||||
@@ -85,6 +85,9 @@ export default {
|
||||
{ label: i18n.t('common.No'), value: false }
|
||||
]
|
||||
}
|
||||
if (option.value === 'id') {
|
||||
option.label = 'ID'
|
||||
}
|
||||
vm.internalOptions.push(option)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<script>
|
||||
import DataZTree from '../DataZTree'
|
||||
import $ from '@/utils/jquery-vendor'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AutoDataZTree',
|
||||
@@ -37,6 +38,10 @@ export default {
|
||||
showCreate: true,
|
||||
showDelete: true,
|
||||
showUpdate: true,
|
||||
showSearch: false,
|
||||
// 自定义header
|
||||
customTreeHeader: false,
|
||||
customTreeHeaderName: this.$t('assets.AssetTree'),
|
||||
async: {
|
||||
enable: true,
|
||||
url: (process.env.VUE_APP_ENV === 'production') ? (`${this.setting.treeUrl}`) : (`${process.env.VUE_APP_BASE_API}${this.setting.treeUrl}`),
|
||||
@@ -66,6 +71,9 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'currentOrg'
|
||||
]),
|
||||
treeSetting() {
|
||||
this.$log.debug('Settings: ', this.setting)
|
||||
return _.merge(this.defaultSetting, this.setting)
|
||||
@@ -82,8 +90,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
refreshTree: function() {
|
||||
const refreshIconRef = $('#tree-refresh')
|
||||
refreshIconRef.click()
|
||||
// const refreshIconRef = $('#tree-refresh')
|
||||
// refreshIconRef.click()
|
||||
},
|
||||
editTreeNode: function() {
|
||||
this.hideRMenu()
|
||||
@@ -112,16 +120,17 @@ export default {
|
||||
}
|
||||
let url = ''
|
||||
const query = Object.assign({}, this.$route.query)
|
||||
const objectId = treeNode.meta.data.id
|
||||
if (treeNode.meta.type === 'node') {
|
||||
this.currentNode = treeNode
|
||||
this.currentNodeId = treeNode.meta.data.id
|
||||
query['node'] = this.currentNodeId
|
||||
query['asset'] = ''
|
||||
url = `${this.setting.url}${combinator}node_id=${treeNode.meta.data.id}&show_current_asset=${show_current_asset}`
|
||||
url = `${this.setting.url}${combinator}node_id=${objectId}&show_current_asset=${show_current_asset}`
|
||||
} else if (treeNode.meta.type === 'asset') {
|
||||
query['asset'] = treeNode.meta.data.id
|
||||
query['node'] = ''
|
||||
url = `${this.setting.url}${combinator}asset_id=${treeNode.meta.data.id}&show_current_asset=${show_current_asset}`
|
||||
url = `${this.setting.url}${combinator}asset_id=${objectId}&show_current_asset=${show_current_asset}`
|
||||
}
|
||||
this.$router.push({ query })
|
||||
this.$emit('urlChange', url)
|
||||
@@ -151,11 +160,12 @@ export default {
|
||||
url,
|
||||
{ 'value': treeNode.name }
|
||||
).then(res => {
|
||||
let assetsAmount = treeNode.meta.data.assetsAmount
|
||||
let assetsAmount = treeNode.meta.data['assetsAmount']
|
||||
if (!assetsAmount) {
|
||||
assetsAmount = 0
|
||||
}
|
||||
treeNode.name = treeNode.name + ' (' + assetsAmount + ')'
|
||||
treeNode.meta.data = res
|
||||
this.zTree.updateNode(treeNode)
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
}).finally(() => { this.refreshTree() })
|
||||
@@ -170,7 +180,7 @@ export default {
|
||||
const rMenuID = this.$refs.dataztree.$refs.ztree.iRMenuID
|
||||
const zTreeID = this.$refs.dataztree.$refs.ztree.iZTreeID
|
||||
const offset = $(`#${zTreeID}`).offset()
|
||||
const scrollTop = document.querySelector('.treebox').scrollTop
|
||||
const scrollTop = document.querySelector('.treebox')?.scrollTop
|
||||
x -= offset.left
|
||||
// Tmp
|
||||
y -= (offset.top + scrollTop) / 3 - 10
|
||||
@@ -190,7 +200,7 @@ export default {
|
||||
return
|
||||
}
|
||||
// 屏蔽收藏资产
|
||||
if (treeNode.id === '-12') {
|
||||
if (treeNode?.id === '-12') {
|
||||
return
|
||||
}
|
||||
if (!treeNode && event.target.tagName.toLowerCase() !== 'button' && $(event.target).parents('a').length === 0) {
|
||||
@@ -227,7 +237,7 @@ export default {
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + error))
|
||||
}).finally(() => this.refreshTree())
|
||||
}).finally()
|
||||
},
|
||||
createTreeNode: function() {
|
||||
this.hideRMenu()
|
||||
@@ -243,13 +253,14 @@ export default {
|
||||
id: data['key'],
|
||||
name: data['value'],
|
||||
pId: parentNode.id,
|
||||
isParent: true,
|
||||
meta: {
|
||||
data: data
|
||||
data: data,
|
||||
type: 'node'
|
||||
}
|
||||
}
|
||||
newNode.checked = this.zTree.getSelectedNodes()[0].checked
|
||||
this.zTree.addNodes(parentNode, 0, newNode)
|
||||
// vm.$refs.dataztree.refresh()
|
||||
const node = this.zTree.getNodeByParam('id', newNode.id, parentNode)
|
||||
this.currentNodeId = node.meta.data.id || newNode.id
|
||||
this.zTree.editName(node)
|
||||
|
||||
@@ -238,7 +238,7 @@ export default {
|
||||
updateContabValue(name, value, from) {
|
||||
this.contabValueObj[name] = value
|
||||
if (from && from !== name) {
|
||||
console.log(`来自组件 ${from} 改变了 ${name} ${value}`)
|
||||
// debug(`来自组件 ${from} 改变了 ${name} ${value}`)
|
||||
this.changeRadio(name, value)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -53,7 +53,7 @@ export default {
|
||||
}
|
||||
} catch (error) {
|
||||
this.isShow = false
|
||||
console.log(error, 'error')
|
||||
// debug(error, 'error')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div :class="grouped ? 'el-button-group' : 'el-button-ungroup'">
|
||||
<div :class="grouped ? 'el-button-group' : 'el-button-ungroup'" class="layout">
|
||||
<template v-for="action in iActions">
|
||||
<el-dropdown
|
||||
v-if="action.dropdown"
|
||||
@@ -13,9 +13,14 @@
|
||||
<el-button :size="size" v-bind="cleanButtonAction(action)">
|
||||
{{ action.title }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-menu slot="dropdown" style="overflow: auto;max-height: 60vh">
|
||||
<template v-for="option in action.dropdown">
|
||||
<div v-if="option.group" :key="'group:'+option.name" class="dropdown-menu-title" style="width:130px">
|
||||
<div
|
||||
v-if="option.group"
|
||||
:key="'group:'+option.name"
|
||||
class="dropdown-menu-title"
|
||||
style="width:130px"
|
||||
>
|
||||
{{ option.group }}
|
||||
</div>
|
||||
<el-dropdown-item
|
||||
@@ -149,6 +154,11 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.layout {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.dropdown-menu-title {
|
||||
text-align: left;
|
||||
font-size: 12px;
|
||||
@@ -165,7 +175,7 @@ export default {
|
||||
}
|
||||
|
||||
.el-button-ungroup .action-item {
|
||||
margin-left: 4px
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.el-button-ungroup .action-item:first-child {
|
||||
|
||||
@@ -146,7 +146,7 @@ export default {
|
||||
* - el-form 的 resetFields 不会触发 input & change 事件,无法监听
|
||||
* - bug1: https://github.com/FEMessage/el-data-table/issues/176#issuecomment-587280825
|
||||
* - bug2:
|
||||
* 0. 建议先在监听器 watch.value 里 console.log(v.name, oldV.name)
|
||||
* 0. 建议先在监听器 watch.value 里 // debug(v.name, oldV.name)
|
||||
* 1. 打开 basic 示例
|
||||
* 2. 在 label 为 name 的输入框里输入 1,此时 log:'1' ''
|
||||
* 3. 点击 reset 按钮,此时 log 两条数据: '1' '1', '' ''
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<template>
|
||||
<ElFormRender
|
||||
ref="form"
|
||||
:class="mobile? 'mobile' : 'desktop'"
|
||||
:content="fields"
|
||||
:form="basicForm"
|
||||
label-position="right"
|
||||
:label-position="labelPosition"
|
||||
label-width="20%"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
@@ -13,7 +14,7 @@
|
||||
<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-for="button in moreButtons" :key="button.title" size="small" v-bind="button" :loading="button.loading" @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>
|
||||
@@ -68,6 +69,14 @@ export default {
|
||||
basicForm: this.form
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
mobile() {
|
||||
return this.$store.state.app.device === 'mobile'
|
||||
},
|
||||
labelPosition() {
|
||||
return this.mobile ? 'top' : 'right'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取表单数据
|
||||
submitForm(formName, addContinue) {
|
||||
@@ -88,38 +97,46 @@ export default {
|
||||
},
|
||||
handleClick(button) {
|
||||
const callback = button.callback || function(values, form) {
|
||||
// console.log('Click ', button.title, ': ', values)
|
||||
// debug('Click ', button.title, ': ', values)
|
||||
}
|
||||
const form = this.$refs['form']
|
||||
const values = form.getFormValue()
|
||||
callback(values, form)
|
||||
callback(values, form, button)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.el-form ::v-deep .el-form-item {
|
||||
.el-form ::v-deep .el-form-item {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.el-form ::v-deep .el-form-item__content {
|
||||
.el-form ::v-deep .el-form-item__content {
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.el-form ::v-deep .el-form-item__label {
|
||||
.mobile.el-form ::v-deep .el-form-item__content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-form ::v-deep .el-form-item__label {
|
||||
padding: 0 30px 0 0;
|
||||
}
|
||||
|
||||
.el-form ::v-deep .el-form-item__error {
|
||||
.el-form ::v-deep .el-form-item__error {
|
||||
position: inherit;
|
||||
}
|
||||
|
||||
.el-form ::v-deep .form-group-header {
|
||||
.el-form ::v-deep .form-group-header {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.el-form ::v-deep .help-block {
|
||||
.el-form.mobile ::v-deep .form-group-header {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.el-form ::v-deep .help-block {
|
||||
display: block;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 10px;
|
||||
@@ -127,8 +144,8 @@ export default {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
.el-form ::v-deep .help-block a {
|
||||
color: #1c84c6;
|
||||
.el-form ::v-deep .help-block a {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
.form-buttons {
|
||||
padding-top: 10px;
|
||||
|
||||
@@ -14,10 +14,23 @@ export const EmailCheck = {
|
||||
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 default {
|
||||
Required,
|
||||
RequiredChange,
|
||||
EmailCheck
|
||||
EmailCheck,
|
||||
specialEmojiCheck
|
||||
}
|
||||
|
||||
export const JsonRequired = {
|
||||
@@ -32,3 +45,20 @@ export const JsonRequired = {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const JsonRequiredUserNameMapped = {
|
||||
required: true,
|
||||
trigger: 'change',
|
||||
validator: (rule, value, callback) => {
|
||||
try {
|
||||
JSON.parse(value)
|
||||
const hasUserName = _.map(JSON.parse(value), (value) => value)
|
||||
if (!hasUserName.includes('username')) {
|
||||
callback(new Error(i18n.t('common.requiredHasUserNameMapped')))
|
||||
}
|
||||
callback()
|
||||
} catch (e) {
|
||||
callback(new Error(i18n.t('common.InvalidJson')))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,50 @@
|
||||
<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">
|
||||
<div
|
||||
v-if="treeSetting.customTreeHeader"
|
||||
class="tree-header treebox"
|
||||
>
|
||||
<div class="content">
|
||||
<span class="title">
|
||||
{{ treeSetting.customTreeHeaderName }}
|
||||
</span>
|
||||
<span class="tree-banner-icon-zone">
|
||||
<a id="searchIcon" class="tree-search special">
|
||||
<i
|
||||
class="fa fa-search tree-banner-icon"
|
||||
@click.stop="treeSearch"
|
||||
/>
|
||||
<input
|
||||
id="searchInput"
|
||||
v-model="treeSearchValue"
|
||||
type="text"
|
||||
autocomplete="off"
|
||||
class="tree-input"
|
||||
>
|
||||
</a>
|
||||
<i
|
||||
class="fa fa-refresh tree-banner-icon"
|
||||
style="margin-right: 2px;"
|
||||
@click.stop="refresh"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<ul v-show="loading" 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>
|
||||
<ul v-show="!loading" :id="iZTreeID" class="ztree" />
|
||||
<div v-if="treeSetting.treeUrl===''" class="tree-empty">
|
||||
{{ this.$t('common.tree.Empty') }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="treebox">
|
||||
<ul v-show="loading" class="ztree">
|
||||
{{ this.$t('common.tree.Loading') }}...
|
||||
</ul>
|
||||
<ul v-show="!loading" :id="iZTreeID" class="ztree" />
|
||||
<div v-if="treeSetting.treeUrl===''" class="tree-empty">
|
||||
{{ this.$t('common.tree.Empty') }}
|
||||
<a id="tree-refresh"><i class="fa fa-refresh" /></a>
|
||||
</div>
|
||||
</div>
|
||||
<div :id="iRMenuID" class="rMenu">
|
||||
@@ -24,6 +60,7 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import $ from '@/utils/jquery-vendor.js'
|
||||
import '@ztree/ztree_v3/js/jquery.ztree.all.min.js'
|
||||
import '@ztree/ztree_v3/js/jquery.ztree.exhide.min.js'
|
||||
import '@/styles/ztree.css'
|
||||
import axiosRetry from 'axios-retry'
|
||||
|
||||
@@ -45,7 +82,8 @@ export default {
|
||||
zTree: '',
|
||||
rMenu: '',
|
||||
init: false,
|
||||
loading: false
|
||||
loading: false,
|
||||
treeSearchValue: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -54,8 +92,9 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.refresh = this.refresh
|
||||
window.treeSearch = this.treeSearch
|
||||
this.initTree()
|
||||
// $('.treebox').css('height', window.innerHeight - 60)
|
||||
},
|
||||
beforeDestroy() {
|
||||
$.fn.zTree.destroy(this.iZTreeID)
|
||||
@@ -82,9 +121,7 @@ export default {
|
||||
retryDelay: () => { return 5000 }
|
||||
}
|
||||
}).then(res => {
|
||||
if (!res) {
|
||||
res = []
|
||||
}
|
||||
if (!res) res = []
|
||||
if (res.length === 0) {
|
||||
res.push({
|
||||
name: this.$t('common.tree.Empty')
|
||||
@@ -94,15 +131,13 @@ export default {
|
||||
if (this.init) {
|
||||
vm.zTree.destroy()
|
||||
}
|
||||
|
||||
this.zTree = $.fn.zTree.init($(`#${this.iZTreeID}`), this.treeSetting, res)
|
||||
if (!this.treeSetting.customTreeHeader) {
|
||||
this.rootNodeAddDom(this.zTree)
|
||||
}
|
||||
// 手动上报事件, 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}`)
|
||||
@@ -115,43 +150,196 @@ export default {
|
||||
vm.init = true
|
||||
})
|
||||
},
|
||||
rootNodeAddDom: function(ztree, callback) {
|
||||
const vm = this
|
||||
const refreshIcon = "<a id='tree-refresh'><i class='fa fa-refresh'></i></a>"
|
||||
rootNodeAddDom(ztree) {
|
||||
const { showSearch, showRefresh } = this.treeSetting
|
||||
const searchIcon = `<a class="tree-search" id="searchIcon">
|
||||
<i class='fa fa-search tree-banner-icon' onclick="treeSearch()" /></i>
|
||||
<input type="text" autocomplete="off" id="searchInput" class="tree-input" />
|
||||
</a>`
|
||||
const refreshIcon = "<a id='tree-refresh' onclick='refresh()'><i class='fa fa-refresh'></i></a>"
|
||||
const treeActions = `${showSearch ? searchIcon : ''}${showRefresh ? refreshIcon : ''}`
|
||||
const icons = `<span class="">${treeActions}</span>`
|
||||
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 $rootNodeRef = $('#' + rootNode.tId + '_a')
|
||||
$rootNodeRef.after(icons)
|
||||
}
|
||||
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()
|
||||
refresh() {
|
||||
this.treeSearchValue = ''
|
||||
const result = this.treeSetting?.callback?.refresh()
|
||||
if (result && result.then) {
|
||||
result.finally(() => {
|
||||
this.initTree()
|
||||
})
|
||||
} else {
|
||||
this.initTree()
|
||||
}
|
||||
},
|
||||
treeSearch() {
|
||||
const searchIcon = document.getElementById(`searchIcon`)
|
||||
const searchInput = document.getElementById(`searchInput`)
|
||||
searchIcon.classList.toggle('active')
|
||||
searchInput.focus()
|
||||
searchInput.onclick = (e) => {
|
||||
e.stopPropagation()
|
||||
}
|
||||
searchInput.onblur = (e) => {
|
||||
e.stopPropagation()
|
||||
if (!(e.target.value)) {
|
||||
searchIcon.classList.toggle('active')
|
||||
}
|
||||
}
|
||||
searchInput.oninput = _.debounce((e) => {
|
||||
e.stopPropagation()
|
||||
const value = e.target.value || ''
|
||||
if (this.treeSetting.async.enable) {
|
||||
this.filterAssetsServer(value)
|
||||
} else {
|
||||
this.filterTree(value)
|
||||
}
|
||||
}, 600)
|
||||
},
|
||||
getCheckedNodes: function() {
|
||||
return this.zTree.getCheckedNodes(true)
|
||||
},
|
||||
recurseParent(node) {
|
||||
const parentNode = node.getParentNode()
|
||||
if (parentNode && parentNode.pId) {
|
||||
return [parentNode, ...this.recurseParent(parentNode)]
|
||||
} else if (parentNode) {
|
||||
return [parentNode]
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
},
|
||||
recurseChildren(node) {
|
||||
if (!node.isParent) {
|
||||
return []
|
||||
}
|
||||
const children = node.children
|
||||
if (!children) {
|
||||
return []
|
||||
}
|
||||
let allChildren = []
|
||||
children.forEach((n) => {
|
||||
allChildren = [...children, ...this.recurseChildren(n)]
|
||||
})
|
||||
return allChildren
|
||||
},
|
||||
groupBy(array, filter) {
|
||||
const groups = {}
|
||||
array.forEach(function(o) {
|
||||
const group = JSON.stringify(filter(o))
|
||||
groups[group] = groups[group] || []
|
||||
groups[group].push(o)
|
||||
})
|
||||
return Object.keys(groups).map(function(group) {
|
||||
return groups[group]
|
||||
})
|
||||
},
|
||||
filterTree(keyword, tree = this.zTree) {
|
||||
if (!this.zTree) return
|
||||
const searchNode = tree.getNodesByFilter((node) => node.id === 'search')
|
||||
if (searchNode) tree.removeNode(searchNode[0])
|
||||
const nodes = tree.transformToArray(tree.getNodes())
|
||||
if (!keyword) {
|
||||
tree.showNodes(nodes)
|
||||
return
|
||||
}
|
||||
|
||||
if (!keyword) {
|
||||
if (tree.hiddenNodes) {
|
||||
tree.showNodes(tree.hiddenNodes)
|
||||
tree.hiddenNodes = null
|
||||
}
|
||||
if (tree.expandNodes) {
|
||||
tree.expandNodes.forEach((node) => {
|
||||
if (node.id !== nodes[0].id) {
|
||||
tree.expandNode(node, false)
|
||||
}
|
||||
})
|
||||
tree.expandNodes = null
|
||||
}
|
||||
return null
|
||||
}
|
||||
let shouldShow = []
|
||||
const matchedNodes = tree.getNodesByFilter((node) => {
|
||||
return node.name.toLowerCase().indexOf(keyword.toLowerCase()) > -1
|
||||
})
|
||||
|
||||
if (matchedNodes.length < 1) {
|
||||
let name = this.$t('common.Search')
|
||||
const assetsAmount = matchedNodes.length
|
||||
name = `${name} (${assetsAmount})`
|
||||
const newNode = { id: 'search', name: name, isParent: false, open: false }
|
||||
tree.addNodes(null, newNode)
|
||||
}
|
||||
|
||||
matchedNodes.forEach((node) => {
|
||||
const parents = this.recurseParent(node)
|
||||
const children = this.recurseChildren(node)
|
||||
shouldShow = [...shouldShow, ...parents, ...children, node]
|
||||
})
|
||||
|
||||
tree.hiddenNodes = nodes
|
||||
tree.expandNodes = shouldShow
|
||||
tree.hideNodes(nodes)
|
||||
tree.showNodes(shouldShow)
|
||||
for (const node of shouldShow) {
|
||||
if (node.isParent) {
|
||||
tree.expandNode(node, true)
|
||||
}
|
||||
}
|
||||
},
|
||||
filterAssetsServer(keyword) {
|
||||
if (!this.zTree) return
|
||||
let searchNode = this.zTree.getNodesByFilter((node) => node.id === 'search')
|
||||
if (searchNode) {
|
||||
this.zTree.removeChildNodes(searchNode[0])
|
||||
this.zTree.removeNode(searchNode[0])
|
||||
}
|
||||
const treeNodes = this.zTree.getNodes()
|
||||
if (!keyword) {
|
||||
if (treeNodes.length !== 0) {
|
||||
this.zTree.showNodes(treeNodes)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (treeNodes.length !== 0) {
|
||||
this.zTree.hideNodes(treeNodes)
|
||||
}
|
||||
|
||||
let treeUrl = this.treeSetting.treeUrl
|
||||
const filterField = treeUrl.includes('?') ? `&search=${keyword}` : `?search=${keyword}`
|
||||
if (treeUrl.indexOf('assets/nodes/children/tree') > -1) {
|
||||
treeUrl = treeUrl + '&all=all'
|
||||
}
|
||||
const searchUrl = `${treeUrl}${filterField}`
|
||||
this.$axios.get(searchUrl).then(nodes => {
|
||||
let name = this.$t('common.Search')
|
||||
const assetsAmount = nodes.length
|
||||
name = `${name} (${assetsAmount})`
|
||||
const newNode = { id: 'search', name: name, isParent: true, open: true, zAsync: true }
|
||||
searchNode = this.zTree.addNodes(null, newNode)[0]
|
||||
searchNode.zAsync = true
|
||||
const nodesGroupByOrg = this.groupBy(nodes, (node) => {
|
||||
return node.meta.data.org_name
|
||||
})
|
||||
|
||||
for (const item of nodesGroupByOrg) {
|
||||
this.zTree.addNodes(searchNode, item)
|
||||
}
|
||||
searchNode.open = true
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
<style lang='scss' scoped>
|
||||
div.rMenu {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
@@ -191,7 +379,7 @@ export default {
|
||||
top: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
.ztree ::v-deep .fa-refresh {
|
||||
.ztree ::v-deep .fa {
|
||||
font: normal normal normal 14px/1 FontAwesome !important;
|
||||
}
|
||||
.dropdown a:hover {
|
||||
@@ -218,4 +406,106 @@ export default {
|
||||
height: 80vh;
|
||||
overflow: auto;
|
||||
}
|
||||
::v-deep #tree-refresh {
|
||||
margin-left: 3px;
|
||||
}
|
||||
::v-deep .tree-banner-icon-zone {
|
||||
position: absolute;
|
||||
right: 7px;
|
||||
height: 30px;
|
||||
overflow: hidden;
|
||||
.fa {
|
||||
color: #838385!important;;
|
||||
&:hover {
|
||||
color: #606266!important;;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .tree-search {
|
||||
position: relative;
|
||||
top: -2px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: inline-block;
|
||||
border-radius: 12px;
|
||||
vertical-align: sub;
|
||||
transition: .25s;
|
||||
overflow: hidden;
|
||||
.fa {
|
||||
width: 13px!important;
|
||||
}
|
||||
.fa-search {
|
||||
padding-top: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .tree-search .tree-banner-icon {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left: 6px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 12px;
|
||||
padding: 10px 6px;
|
||||
overflow: hidden;
|
||||
background-color: transparent!important;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::v-deep .tree-search.active {
|
||||
width: 160px;
|
||||
background-color: #ffffff!important;
|
||||
}
|
||||
|
||||
::v-deep .tree-search.active:hover {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
::v-deep .tree-search input {
|
||||
position: relative;
|
||||
left: 20px;
|
||||
width: 133px;
|
||||
height: 100%;
|
||||
background-color: #ffffff!important;
|
||||
color: #606266;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
.tree-header {
|
||||
position: relative;
|
||||
.title {
|
||||
font-weight: 500;
|
||||
}
|
||||
.content {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
border-radius: 3px;
|
||||
padding: 0 5px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
background-color: #D7D8DC;
|
||||
.rotate {
|
||||
transition: all .1.8s;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
.fa-caret-down {
|
||||
font-size: 16px;
|
||||
}
|
||||
.special {
|
||||
top: 1px!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.tree-empty {
|
||||
margin-left: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
defaultCallback: function(action) {
|
||||
// console.log(action)
|
||||
// debug(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:top="top"
|
||||
:width="iWidth"
|
||||
class="dialog"
|
||||
v-bind="$attrs"
|
||||
append-to-body
|
||||
:append-to-body="false"
|
||||
:modal-append-to-body="false"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<slot />
|
||||
@@ -39,6 +41,10 @@ export default {
|
||||
type: String,
|
||||
default: '3vh'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '60%'
|
||||
},
|
||||
showConfirm: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
@@ -58,6 +64,11 @@ export default {
|
||||
return {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iWidth() {
|
||||
return this.$store.getters.isMobile ? '80%' : this.width
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onCancel() {
|
||||
this.$emit('cancel')
|
||||
|
||||
@@ -91,18 +91,22 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
<style lang='scss' scoped>
|
||||
.datepicker{
|
||||
width: 233px;
|
||||
&>>> .el-range__icon {
|
||||
margin-top: 2px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
&>>> .el-range-input {
|
||||
width: 49%;
|
||||
}
|
||||
}
|
||||
.el-input__inner{
|
||||
border: 1px solid #dcdee2;
|
||||
border-radius: 3px;
|
||||
height: 36px;
|
||||
height: 32x;
|
||||
}
|
||||
/*.el-date-editor ::v-deep .el-input__icon{*/
|
||||
/* line-height: 28px;*/
|
||||
/*}*/
|
||||
.el-date-editor ::v-deep .el-range-separator{
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/styles/variables.scss";
|
||||
.json-editor {
|
||||
&>>> .jsoneditor {
|
||||
border: 1px solid #e5e6e7;
|
||||
@@ -66,8 +67,8 @@ export default {
|
||||
display: none;
|
||||
}
|
||||
&>>> .jsoneditor-menu {
|
||||
background: #1ab394;
|
||||
border-bottom: 1px solid #1ab394;
|
||||
background: var(--color-primary);
|
||||
border-bottom: 1px solid var(--color-primary);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<password
|
||||
<Password
|
||||
:value="value"
|
||||
v-bind="iAttrs"
|
||||
class="el-input password-input"
|
||||
@@ -32,7 +32,8 @@ export default {
|
||||
const defaultAttrs = {
|
||||
secureLength: 7,
|
||||
defaultClass: 'el-input__inner',
|
||||
toggle: true
|
||||
toggle: true,
|
||||
showStrengthMeter: false
|
||||
}
|
||||
return Object.assign(defaultAttrs, this.attrs)
|
||||
}
|
||||
@@ -46,17 +47,16 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/styles/element-variables.scss";
|
||||
.password-input >>> .Password__badge--error {
|
||||
background-color: $--color-danger;
|
||||
background-color: var(--color-danger);
|
||||
}
|
||||
.password-input >>> .Password__strength-meter--fill[data-score="4"] {
|
||||
background: $--color-primary;
|
||||
background: var(--color-success);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.password-input >>> .Password__badge--success {
|
||||
background: $--color-primary;
|
||||
background: var(--color-success);
|
||||
}
|
||||
|
||||
.password-input >>> .Password__strength-meter {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<el-switch
|
||||
v-model="iValue"
|
||||
:active-color="activeColor"
|
||||
inactive-color="#dcdfe6"
|
||||
:class="type"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
/>
|
||||
@@ -26,21 +26,6 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
activeColor() {
|
||||
// $--color-primary: #1ab394;
|
||||
// $--color-success: #1c84c6;
|
||||
// $--color-info: #23c6c8;
|
||||
// $--color-warning: #f8ac59;
|
||||
// $--color-danger: #ed5565;
|
||||
switch (this.type) {
|
||||
case 'primary':
|
||||
return '#1ab394'
|
||||
case 'danger':
|
||||
return '#ed5565'
|
||||
default:
|
||||
return '#1ab394'
|
||||
}
|
||||
},
|
||||
iValue: {
|
||||
set: function(newValue) {
|
||||
this.$emit('input', newValue)
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<template>
|
||||
<div class="upload-key">
|
||||
<input ref="upLoadFile" type="file" style="display: none" @change="onChange">
|
||||
<el-button size="mini" @click.native.stop="onUpLoad">
|
||||
<el-button v-if="!fingerprint" size="mini" @click.native.stop="onUpLoad">
|
||||
{{ this.$t('common.SelectFile') }}
|
||||
</el-button>
|
||||
<span v-else>
|
||||
<el-button type="text" icon="el-icon-edit" @click.native.stop="onUpLoad">
|
||||
{{ this.$t('common.Update') }}
|
||||
</el-button>
|
||||
<span v-if="!fileName" class="fingerprint">{{ fingerprint }}</span>
|
||||
</span>
|
||||
<span>{{ fileName }}</span>
|
||||
<div v-if="tip !== ''">{{ tip }}</div>
|
||||
</div>
|
||||
@@ -12,10 +18,6 @@
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
// value: {
|
||||
// type: String,
|
||||
// default: () => ''
|
||||
// },
|
||||
tip: {
|
||||
type: String,
|
||||
default: () => ''
|
||||
@@ -23,6 +25,10 @@ export default {
|
||||
toFormat: {
|
||||
type: String,
|
||||
default: () => 'string'
|
||||
},
|
||||
fingerprint: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -44,7 +50,7 @@ export default {
|
||||
const reader = new FileReader()
|
||||
reader.onload = function() {
|
||||
let result = this.result
|
||||
if (vm.toFormat === 'object') {
|
||||
if (vm.toFormat === 'object' && vm.fileName.endsWith('.json')) {
|
||||
result = JSON.parse(result)
|
||||
}
|
||||
vm.$emit('input', result)
|
||||
@@ -58,4 +64,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fingerprint {
|
||||
font-size: 12px
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -66,6 +66,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
attrs: {
|
||||
showStrengthMeter: true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -21,12 +21,13 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/styles/variables.scss";
|
||||
.hamburger {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
font-size: 20px;
|
||||
color: rgb(167, 177, 194);
|
||||
color: $menuText;
|
||||
}
|
||||
.hamburger.is-active {
|
||||
transform: rotate(180deg);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<MFAVerifyDialog
|
||||
<UserConfirmDialog
|
||||
v-if="mfaDialogShow"
|
||||
@MFAVerifyDone="showExportDialog"
|
||||
@MFAVerifyCancel="handleExportCancel"
|
||||
:url="url"
|
||||
@UserConfirmDone="showExportDialog"
|
||||
@UserConfirmCancel="handleExportCancel"
|
||||
/>
|
||||
<Dialog
|
||||
v-if="exportDialogShow"
|
||||
@@ -31,7 +32,7 @@
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
import MFAVerifyDialog from '@/components/MFAVerifyDialog'
|
||||
import UserConfirmDialog from '@/components/UserConfirmDialog'
|
||||
import { createSourceIdCache } from '@/api/common'
|
||||
import * as queryUtil from '@/components/DataTable/compenents/el-data-table/utils/query'
|
||||
|
||||
@@ -39,7 +40,7 @@ export default {
|
||||
name: 'ExportDialog',
|
||||
components: {
|
||||
Dialog,
|
||||
MFAVerifyDialog
|
||||
UserConfirmDialog
|
||||
},
|
||||
props: {
|
||||
selectedRows: {
|
||||
@@ -92,11 +93,11 @@ export default {
|
||||
return this.selectedRows.length > 0
|
||||
},
|
||||
tableQuery() {
|
||||
const listTableRef = this.$parent.$parent.$parent.$parent
|
||||
const listTableRef = this.$parent?.$parent?.$parent?.$parent
|
||||
if (!listTableRef) {
|
||||
return {}
|
||||
}
|
||||
const query = listTableRef.dataTable.getQuery()
|
||||
const query = listTableRef?.dataTable?.getQuery() || {}
|
||||
delete query['limit']
|
||||
delete query['offset']
|
||||
delete query['date_from']
|
||||
@@ -199,8 +200,11 @@ export default {
|
||||
this.mfaDialogShow = false
|
||||
},
|
||||
handleExportCancel() {
|
||||
this.exportDialogShow = false
|
||||
this.mfaDialogShow = false
|
||||
const vm = this
|
||||
setTimeout(() => {
|
||||
vm.exportDialogShow = false
|
||||
vm.mfaDialogShow = false
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,18 +83,18 @@ export default {
|
||||
default: () => ''
|
||||
},
|
||||
canImportCreate: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
type: [Boolean, Function],
|
||||
default: false
|
||||
},
|
||||
canImportUpdate: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showImportDialog: false,
|
||||
importOption: 'create',
|
||||
importOption: this.canImportCreate && this.canImportUpdate ? 'create' : this.canImportCreate ? 'create' : 'update',
|
||||
errorMsg: '',
|
||||
loadStatus: false,
|
||||
importTypeOption: 'csv',
|
||||
@@ -205,8 +205,9 @@ export default {
|
||||
}
|
||||
return this.url.indexOf('?') === -1 ? `${this.url}?${query}` : `${this.url}&${query}`
|
||||
},
|
||||
// eslint-disable-next-line handle-callback-err
|
||||
catchError(error) {
|
||||
console.log(error)
|
||||
// debug(error)
|
||||
},
|
||||
onSuccess(msg) {
|
||||
this.errorMsg = ''
|
||||
@@ -232,7 +233,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
@import "~@/styles/element-variables.scss";
|
||||
@import "~@/styles/variables.scss";
|
||||
.error-msg {
|
||||
color: $--color-danger;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-col :md="8" :sm="24">
|
||||
<div class="tableFilter">
|
||||
<el-radio-group v-model="importStatusFilter" size="small">
|
||||
<el-radio-button label="all">{{ $t('common.Total') }}</el-radio-button>
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8" style="text-align: center">
|
||||
<el-col :md="8" :sm="24" style="text-align: center">
|
||||
<span class="summary-item summary-total"> {{ $t('common.Total') }}: {{ totalCount }}</span>
|
||||
<span class="summary-item summary-success"> {{ $t('common.Success') }}: {{ successCount }}</span>
|
||||
<span class="summary-item summary-failed"> {{ $t('common.Failed') }}: {{ failedCount }}</span>
|
||||
@@ -202,11 +202,14 @@ export default {
|
||||
}]
|
||||
for (const item of tableTitles) {
|
||||
const dataItemLens = tableData.map(d => {
|
||||
const prop = item[1]
|
||||
const itemColData = d[prop]
|
||||
if (!d) {
|
||||
return 0
|
||||
}
|
||||
const prop = item[1]
|
||||
const itemColData = d[prop]
|
||||
if (typeof itemColData === 'boolean') {
|
||||
return 5 // boolean is 5 characters long 并且 boolean.length 是 undefined
|
||||
}
|
||||
if (typeof itemColData !== 'number' && (!itemColData || !itemColData.length)) {
|
||||
return 0
|
||||
}
|
||||
@@ -405,7 +408,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/styles/element-variables.scss";
|
||||
@import "~@/styles/variables.scss";
|
||||
.summary-item {
|
||||
padding: 0 10px
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
createRoute: {
|
||||
type: [String, Object, Function],
|
||||
default: function() {
|
||||
return this.$route.name.replace('List', 'Create')
|
||||
return this.$route.name?.replace('List', 'Create')
|
||||
}
|
||||
},
|
||||
createInNewPage: {
|
||||
|
||||
@@ -76,6 +76,14 @@ export default {
|
||||
extraRightSideActions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
canCreate: {
|
||||
type: [Boolean, Function],
|
||||
default: false
|
||||
},
|
||||
canBulkUpdate: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -102,7 +110,11 @@ export default {
|
||||
return this.selectedRows.length > 0
|
||||
},
|
||||
iImportOptions() {
|
||||
return assignIfNot(this.importOptions, { url: this.tableUrl })
|
||||
return assignIfNot(this.importOptions, {
|
||||
url: this.tableUrl,
|
||||
canImportCreate: this.canCreate,
|
||||
canImportUpdate: this.canBulkUpdate
|
||||
})
|
||||
},
|
||||
iExportOptions() {
|
||||
const options = assignIfNot(this.exportOptions, { url: this.tableUrl })
|
||||
@@ -164,8 +176,4 @@ export default {
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
.export-item {
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="table-header clearfix">
|
||||
<div class="table-header clearfix" :class="device">
|
||||
<slot name="header">
|
||||
<LeftSide v-if="hasLeftActions" style="float: left" :class="'left-side ' + device" :selected-rows="selectedRows" :table-url="tableUrl" v-bind="$attrs" v-on="$listeners" />
|
||||
<RightSide v-if="hasRightActions" style="float: right" :selected-rows="selectedRows" :table-url="tableUrl" v-bind="$attrs" v-on="$listeners" />
|
||||
<div style="display: flex;flex-direction: row" class="search" :class="hasLeftActions ? 'right' : 'left'">
|
||||
<LeftSide v-if="hasLeftActions" class="left-side" :selected-rows="selectedRows" :table-url="tableUrl" v-bind="$attrs" v-on="$listeners" />
|
||||
<RightSide v-if="hasRightActions" class="right-side" :selected-rows="selectedRows" :table-url="tableUrl" v-bind="$attrs" v-on="$listeners" />
|
||||
<div class="search" :class="searchClass">
|
||||
<AutoDataSearch v-if="hasSearch" class="right-side-item action-search" v-bind="iSearchTableConfig" @tagSearch="handleTagSearch" />
|
||||
<DatetimeRangePicker v-if="hasDatePicker" v-bind="datePicker" class="datepicker" @dateChange="handleDateChange" />
|
||||
</div>
|
||||
@@ -77,6 +77,9 @@ export default {
|
||||
return 'mobile'
|
||||
}
|
||||
return ''
|
||||
},
|
||||
searchClass() {
|
||||
return this.hasLeftActions ? 'right' : 'left'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -124,6 +127,10 @@ export default {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.action-search >>> .el-cascader {
|
||||
line-height: 32px !important;
|
||||
}
|
||||
|
||||
.right-side-actions {
|
||||
display: flex;
|
||||
padding-left: 10px;
|
||||
@@ -143,11 +150,43 @@ export default {
|
||||
.datepicker{
|
||||
margin-left: 10px;
|
||||
}
|
||||
.table-header {
|
||||
line-height: 32px;
|
||||
}
|
||||
.left-side {
|
||||
float: left;
|
||||
display: block;
|
||||
}
|
||||
.right-side {
|
||||
float: right;
|
||||
}
|
||||
.search {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.mobile .search {
|
||||
display: inherit;
|
||||
}
|
||||
.mobile .search .datepicker {
|
||||
margin-left: 0;
|
||||
}
|
||||
.search.left {
|
||||
float: left;
|
||||
}
|
||||
.search.right {
|
||||
float: right;
|
||||
}
|
||||
.mobile .search.right {
|
||||
float: none;
|
||||
}
|
||||
.mobile .search.right .action-search {
|
||||
width: 100%;
|
||||
}
|
||||
.mobile .right-side {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.filter-field.right-side-item.action-search {
|
||||
height: 34px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export function cleanActions(actions, canDefaults, { selectedRows, reloadTable }) {
|
||||
// console.log('Start clean actions: ', selectedRows.length, reloadTable)
|
||||
// debug('Start clean actions: ', selectedRows.length, reloadTable)
|
||||
const cleanedActions = []
|
||||
const cloneActions = _.cloneDeep(actions)
|
||||
cloneActions.forEach((action) => {
|
||||
|
||||
@@ -66,15 +66,16 @@ export default {
|
||||
canCreate: { action: 'add', checkRoot: true },
|
||||
canBulkDelete: { action: 'delete', checkRoot: false },
|
||||
canBulkUpdate: { action: 'change', checkRoot: true },
|
||||
hasImport: { action: 'add', checkRoot: true },
|
||||
hasImport: { action: 'add|change', checkRoot: true },
|
||||
hasExport: { action: 'view', checkRoot: false }
|
||||
}
|
||||
const defaults = {}
|
||||
for (const [k, v] of Object.entries(actions)) {
|
||||
defaults[k] = this.hasActionPerm(v.action)
|
||||
let hasPerm = v.action.split('|').some(i => this.hasActionPerm(i.trim()))
|
||||
if (v.checkRoot) {
|
||||
defaults[k] = defaults[k] && !this.currentOrgIsRoot
|
||||
hasPerm = hasPerm && !this.currentOrgIsRoot
|
||||
}
|
||||
defaults[k] = hasPerm
|
||||
}
|
||||
return Object.assign(defaults, this.headerActions)
|
||||
},
|
||||
@@ -83,15 +84,22 @@ export default {
|
||||
extraQuery: this.extraQuery
|
||||
})
|
||||
const formatterArgs = {
|
||||
'columnsMeta.actions.formatterArgs.canUpdate': 'change',
|
||||
'columnsMeta.actions.formatterArgs.canUpdate': () => {
|
||||
return this.hasActionPerm('change') && !this.currentOrgIsRoot
|
||||
},
|
||||
'columnsMeta.actions.formatterArgs.canDelete': 'delete',
|
||||
'columnsMeta.actions.formatterArgs.canClone': 'add',
|
||||
'columnsMeta.actions.formatterArgs.canClone': () => {
|
||||
return this.hasActionPerm('add') && !this.currentOrgIsRoot
|
||||
},
|
||||
'columnsMeta.name.formatterArgs.can': 'view'
|
||||
}
|
||||
|
||||
for (const [arg, action] of Object.entries(formatterArgs)) {
|
||||
const notSet = _.get(config, arg) === undefined
|
||||
const isFunction = typeof action === 'function'
|
||||
if (notSet) {
|
||||
_.set(config, arg, this.hasActionPerm(action))
|
||||
const hasActionPerm = isFunction ? action() : this.hasActionPerm(action)
|
||||
_.set(config, arg, hasActionPerm)
|
||||
}
|
||||
}
|
||||
this.$log.debug('Header actions', this.headerActions)
|
||||
@@ -192,6 +200,15 @@ export default {
|
||||
& >>> .el-table__header thead > tr > th {
|
||||
background-color: white;
|
||||
}
|
||||
&>>> .el-table__row .cell {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
&>>> .el-table__expanded-cell pre {
|
||||
max-height: 500px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
}
|
||||
|
||||
//修改颜色
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:title="$t('common.MFAVerify')"
|
||||
:width="'50'"
|
||||
:show-confirm="false"
|
||||
:show-cancel="false"
|
||||
:visible.sync="visible"
|
||||
:destroy-on-close="true"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4">
|
||||
<div style="line-height: 34px;text-align: center">MFA</div>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-input v-model="MFAToken" />
|
||||
<span class="help-tips help-block">{{ $t('common.MFARequireForSecurity') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button size="mini" type="primary" style="line-height:20px " @click="verifyMFA">
|
||||
{{ this.$t('common.Confirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
|
||||
export default {
|
||||
name: 'MFAVerifyDialog',
|
||||
components: {
|
||||
Dialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
MFAToken: '',
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
if (!val) {
|
||||
this.$emit('MFAVerifyCancel', true)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$axios.get('/api/v1/authentication/otp/verify/', { disableFlashErrorMsg: true }).then(() => {
|
||||
this.$emit('MFAVerifyDone', true)
|
||||
}).catch(err => {
|
||||
this.$log.debug('Verify otp code error: ', err)
|
||||
this.visible = true
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
verifyMFA() {
|
||||
if (this.MFAToken.length !== 6) {
|
||||
return this.$message.error(this.$tc('common.MFAErrorMsg'))
|
||||
}
|
||||
this.$axios.post(
|
||||
`/api/v1/authentication/otp/verify/`, {
|
||||
code: this.MFAToken
|
||||
}
|
||||
).then(res => {
|
||||
this.$emit('MFAVerifyDone', true)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -61,10 +61,6 @@ const defaultDeleteCallback = function({ row, col, cellValue, reload }) {
|
||||
done()
|
||||
reload()
|
||||
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
||||
} catch (error) {
|
||||
if (!error.response || !error.response.data || !error.response.data.msg) {
|
||||
this.$message.error(this.$t('common.deleteErrorMsg') + ' ' + error)
|
||||
}
|
||||
} finally {
|
||||
instance.confirmButtonLoading = false
|
||||
}
|
||||
@@ -149,6 +145,7 @@ export default {
|
||||
v.fa = this.cleanValue(v, 'fa')
|
||||
v.order = v.order || 100
|
||||
v.tip = this.cleanValue(v, 'tip')
|
||||
v.title = this.cleanValue(v, 'title')
|
||||
return v
|
||||
})
|
||||
actions = actions.filter((v) => v.has)
|
||||
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
}
|
||||
// const locale = this.$i18n.locale
|
||||
// const value = dt.toLocaleString(locale, { hourCycle: 'h23' })
|
||||
// console.log(this.$i18n.locale)
|
||||
// debug(this.$i18n.locale)
|
||||
return {
|
||||
value: value
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<el-link class="detail" :disabled="disabled" :type="col.type || 'success'" @click="goDetail">{{ iTitle }}</el-link>
|
||||
<el-link
|
||||
class="detail"
|
||||
:disabled="disabled"
|
||||
:type="col.type || 'info'"
|
||||
@click="goDetail"
|
||||
>
|
||||
{{ iTitle }}
|
||||
</el-link>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
82
src/components/TableFormatters/ShowKeyCopyFormatter.vue
Normal file
82
src/components/TableFormatters/ShowKeyCopyFormatter.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<span>{{ currentValue }}</span>
|
||||
<span class="right">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
placement="top"
|
||||
:content="this.$t('common.View')"
|
||||
>
|
||||
<i class="el-icon-view" @click="onShow()" />
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
placement="top"
|
||||
:content="this.$t('common.Copy')"
|
||||
>
|
||||
<i class="el-icon-copy-document" @click="onCopy()" />
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseFormatter from './base'
|
||||
|
||||
export default {
|
||||
name: 'ShowKeyCopyFormatter',
|
||||
extends: BaseFormatter,
|
||||
proops: {
|
||||
cellValue: {
|
||||
type: String,
|
||||
default: () => ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentValue: this.switchShowValue()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
switchShowValue() {
|
||||
return '******' + this.cellValue.replace(/[\w-]/g, '')
|
||||
},
|
||||
onShow() {
|
||||
const { currentValue, cellValue, switchShowValue } = this
|
||||
this.currentValue = currentValue === cellValue ? switchShowValue() : cellValue
|
||||
},
|
||||
onCopy: _.throttle(function() {
|
||||
const inputDom = document.createElement('input')
|
||||
inputDom.id = 'creatInputDom'
|
||||
inputDom.value = this.cellValue
|
||||
document.body.appendChild(inputDom)
|
||||
inputDom.select()
|
||||
document?.execCommand('copy')
|
||||
this.$message({
|
||||
message: this.$t('common.CopySuccess'),
|
||||
type: 'success',
|
||||
duration: 1400
|
||||
})
|
||||
document.body.removeChild(inputDom)
|
||||
}, 1800)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
.right {
|
||||
float: right;
|
||||
font-size: 15px;
|
||||
cursor: pointer;
|
||||
.el-icon-view, .el-icon-copy-document {
|
||||
&:hover {
|
||||
color: #1c84c6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
61
src/components/TableFormatters/TwoTabFormatter.vue
Normal file
61
src/components/TableFormatters/TwoTabFormatter.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<el-row :gutter="10">
|
||||
<div v-if="isAllEmpty()" style="text-align: center">
|
||||
{{ this.$t('common.NoContent') }}
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-col :span="rightEmpty() ? 24 : 12">
|
||||
<div v-if="!leftEmpty()">
|
||||
<el-tag type="primary" effect="dark" :closable="false" style="width: 100%;">{{ row.leftTitle }}</el-tag>
|
||||
<div v-for="(value, key, index) in row.left" :key="index">
|
||||
<el-tag type="primary"><strong>{{ key }}: </strong>{{ value }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="leftEmpty() ? 24 : 12">
|
||||
<div v-if="!rightEmpty()">
|
||||
<el-tag type="primary" effect="dark" :closable="false" style="width: 100%;">{{ row.rightTitle }}</el-tag>
|
||||
<div v-for="(value, key, index) in row.right" :key="index">
|
||||
<el-tag type="primary"><strong>{{ key }}: </strong>{{ value }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</div>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'TwoTabFormatter',
|
||||
props: {
|
||||
row: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isEmpty(content) {
|
||||
return !content || JSON.stringify(content) === '{}'
|
||||
},
|
||||
leftEmpty() {
|
||||
return this.isEmpty(this.row.left)
|
||||
},
|
||||
rightEmpty() {
|
||||
return this.isEmpty(this.row.right)
|
||||
},
|
||||
isAllEmpty() {
|
||||
return this.leftEmpty() && this.rightEmpty()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-tag{
|
||||
width: 100%;
|
||||
white-space: normal;
|
||||
height:auto;
|
||||
}
|
||||
</style>
|
||||
@@ -7,10 +7,12 @@ import DeleteActionFormatter from './DeleteActionFormatter'
|
||||
import DateFormatter from './DateFormatter'
|
||||
import SystemUserFormatter from './GrantedSystemUsersShowFormatter'
|
||||
import ShowKeyFormatter from '@/components/TableFormatters/ShowKeyFormatter'
|
||||
import ShowKeyCopyFormatter from './ShowKeyCopyFormatter'
|
||||
import DialogDetailFormatter from './DialogDetailFormatter'
|
||||
import EditableInputFormatter from './EditableInputFormatter'
|
||||
import StatusFormatter from './StatusFormatter'
|
||||
import TagsFormatter from './TagsFormatter'
|
||||
import TwoTabFormatter from './TwoTabFormatter'
|
||||
|
||||
export default {
|
||||
DetailFormatter,
|
||||
@@ -21,11 +23,13 @@ export default {
|
||||
DateFormatter,
|
||||
SystemUserFormatter,
|
||||
ShowKeyFormatter,
|
||||
ShowKeyCopyFormatter,
|
||||
DialogDetailFormatter,
|
||||
ArrayFormatter,
|
||||
EditableInputFormatter,
|
||||
StatusFormatter,
|
||||
TagsFormatter
|
||||
TagsFormatter,
|
||||
TwoTabFormatter
|
||||
}
|
||||
|
||||
export {
|
||||
@@ -37,9 +41,11 @@ export {
|
||||
DateFormatter,
|
||||
SystemUserFormatter,
|
||||
ShowKeyFormatter,
|
||||
ShowKeyCopyFormatter,
|
||||
DialogDetailFormatter,
|
||||
ArrayFormatter,
|
||||
EditableInputFormatter,
|
||||
StatusFormatter,
|
||||
TagsFormatter
|
||||
TagsFormatter,
|
||||
TwoTabFormatter
|
||||
}
|
||||
|
||||
@@ -106,35 +106,9 @@ export default {
|
||||
handler(val) {
|
||||
if (val && val.length > 0) {
|
||||
const routeFilter = this.checkInTableColumns()
|
||||
const routerSearch = routeFilter.search || {}
|
||||
let routerSearchAttrs = []
|
||||
if (typeof routerSearch?.value === 'string') {
|
||||
routerSearchAttrs = routerSearch?.value?.split(',') || []
|
||||
}
|
||||
|
||||
for (const attr of routerSearchAttrs) {
|
||||
routeFilter[`search_${attr}`] = {
|
||||
...routerSearch,
|
||||
value: attr
|
||||
}
|
||||
}
|
||||
if (routerSearchAttrs.length !== 0) {
|
||||
delete routeFilter.search
|
||||
}
|
||||
|
||||
const asFilterTags = _.cloneDeep(this.filterTags)
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
if (Object.keys(routeFilter).length > 0) {
|
||||
setTimeout(() => {
|
||||
return this.$emit('tagSearch', this.filterMaps)
|
||||
}, 490)
|
||||
}
|
||||
this.filterTagSearch(routeFilter)
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
@@ -149,43 +123,90 @@ export default {
|
||||
methods: {
|
||||
// 获取url中的查询条件,判断是不是包含在当前查询条件里
|
||||
checkInTableColumns() {
|
||||
const searchFieldOptions = {}
|
||||
const queryInfoValues = this.options.map((i) => i.value)
|
||||
const routeQuery = this.getUrlQuery ? this.$route?.query : {}
|
||||
const routeQueryKeys = Object.keys(routeQuery)
|
||||
const routeQueryKeysLength = routeQueryKeys.length
|
||||
const keys = {}
|
||||
if (routeQueryKeysLength < 1) {
|
||||
return keys
|
||||
}
|
||||
for (const [key, value] of Object.entries(routeQuery)) {
|
||||
let valueDecode = decodeURI(value)
|
||||
const isSearch = key !== 'search'
|
||||
const curOptions = this.options || []
|
||||
const routeQueryKeysLength = Object.keys(routeQuery).length
|
||||
if (routeQueryKeysLength < 1) return searchFieldOptions
|
||||
|
||||
for (let k = 0, len = curOptions.length; k < len; k++) {
|
||||
const cur = curOptions[k]
|
||||
if (cur?.type === 'boolean') {
|
||||
for (const [key, value] of Object.entries(routeQuery)) {
|
||||
const valueDecode = decodeURI(value)
|
||||
const isSearch = key === 'search'
|
||||
|
||||
if (isSearch) {
|
||||
searchFieldOptions[key] = {
|
||||
key,
|
||||
label: '',
|
||||
value: valueDecode
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if (queryInfoValues.includes(key)) {
|
||||
searchFieldOptions[key] = this.getInQueryInfoFields(key, value)
|
||||
}
|
||||
}
|
||||
return searchFieldOptions
|
||||
},
|
||||
getInQueryInfoFields(key, value) {
|
||||
let searchFieldOption = {}
|
||||
let valueDecode = decodeURI(value)
|
||||
const currentOptions = this.options || []
|
||||
|
||||
for (let k = 0, len = currentOptions.length; k < len; k++) {
|
||||
const current = currentOptions[k]
|
||||
if (key === current.value) {
|
||||
const curChildren = current.children || []
|
||||
if (current?.type === 'boolean') {
|
||||
valueDecode = !!valueDecode
|
||||
}
|
||||
if (key === cur.value || !isSearch) {
|
||||
const curChildren = cur.children || []
|
||||
keys[key] = {
|
||||
...cur,
|
||||
key,
|
||||
label: isSearch ? cur.label : '',
|
||||
value: valueDecode
|
||||
}
|
||||
if (isSearch && curChildren.length > 0) {
|
||||
for (const item of curChildren) {
|
||||
if (valueDecode === item.value) {
|
||||
keys[key].valueLabel = item.label
|
||||
break
|
||||
}
|
||||
searchFieldOption = {
|
||||
...current,
|
||||
key,
|
||||
label: current.label,
|
||||
value: valueDecode
|
||||
}
|
||||
if (curChildren.length > 0) {
|
||||
for (const item of curChildren) {
|
||||
if (valueDecode === item.value) {
|
||||
searchFieldOption.valueLabel = item.label
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
return keys
|
||||
|
||||
return searchFieldOption
|
||||
},
|
||||
filterTagSearch(routeFilter) {
|
||||
const routerSearch = routeFilter.search || {}
|
||||
let routerSearchAttrs = []
|
||||
if (typeof routerSearch?.value === 'string') {
|
||||
routerSearchAttrs = routerSearch?.value?.split(',') || []
|
||||
}
|
||||
|
||||
for (const attr of routerSearchAttrs) {
|
||||
routeFilter[`search_${attr}`] = {
|
||||
...routerSearch,
|
||||
value: attr
|
||||
}
|
||||
}
|
||||
|
||||
if (routerSearchAttrs.length !== 0) {
|
||||
delete routeFilter.search
|
||||
}
|
||||
const asFilterTags = _.cloneDeep(this.filterTags)
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
if (Object.keys(routeFilter).length > 0) {
|
||||
setTimeout(() => {
|
||||
return this.$emit('tagSearch', this.filterMaps)
|
||||
}, 490)
|
||||
}
|
||||
},
|
||||
getValueLabel(key, value) {
|
||||
for (const field of this.options) {
|
||||
|
||||
@@ -77,7 +77,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// console.log(this.treeSetting)
|
||||
// debug(this.treeSetting)
|
||||
},
|
||||
methods: {
|
||||
handleUrlChange(url) {
|
||||
@@ -113,12 +113,13 @@ export default {
|
||||
float: right;
|
||||
text-align: center;
|
||||
padding: 5px 0;
|
||||
background-color: #1ab394;
|
||||
border-color: #1ab394;
|
||||
background-color: var(--color-primary);
|
||||
border-color: var(--color-primary);
|
||||
color: #FFFFFF;
|
||||
border-radius: 3px;
|
||||
line-height: 1.428;
|
||||
cursor:pointer;
|
||||
height: 30px;
|
||||
}
|
||||
.el-tree{
|
||||
background-color: inherit !important;
|
||||
@@ -134,5 +135,8 @@ export default {
|
||||
}
|
||||
.transition-box.left {
|
||||
background: #f3f3f3;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 3px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
230
src/components/UserConfirmDialog/index.vue
Normal file
230
src/components/UserConfirmDialog/index.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:title="title"
|
||||
:width="'36%'"
|
||||
:show-confirm="false"
|
||||
:show-cancel="false"
|
||||
:visible.sync="visible"
|
||||
:destroy-on-close="true"
|
||||
v-bind="$attrs"
|
||||
class="dialog-content"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<div v-if="ConfirmType === 'relogin'">
|
||||
<el-row :gutter="24" style="margin: 0 auto;">
|
||||
<el-col :md="24" :sm="24">
|
||||
<el-alert
|
||||
:title="this.$t('auth.ReLoginTitle')"
|
||||
type="info"
|
||||
center
|
||||
:closable="false"
|
||||
style="margin-bottom: 20px;"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="margin: 0 auto;">
|
||||
<el-col :md="24" :sm="24">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
style="width: 100%; line-height:20px;"
|
||||
@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 :span="24" :md="24" :sm="24" class="add">
|
||||
<el-select
|
||||
v-model="Select"
|
||||
:disabled="ConfirmType === 'password'"
|
||||
style="width: 100%; margin-bottom: 20px;"
|
||||
@change="helpText(Select)"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, i) of Content"
|
||||
:key="i"
|
||||
:label="item.display_name"
|
||||
:value="item.name"
|
||||
:disabled="item.disabled"
|
||||
/>
|
||||
</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="SecretKey" :show-password="showPassword" :placeholder="HelpText" />
|
||||
<span v-if="Select === 'sms'" style="margin: -1px 0 0 20px;">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
style="line-height:20px; float: right;"
|
||||
:disabled="smsBtndisabled"
|
||||
@click="sendChallengeCode"
|
||||
>
|
||||
{{ smsBtnText }}
|
||||
</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" style="margin: 0 auto;">
|
||||
<el-col :md="24" :sm="24">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
style="width: 100%; line-height:20px;"
|
||||
@click="userConfirm"
|
||||
>
|
||||
{{ this.$t('common.Confirm') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
|
||||
export default {
|
||||
name: 'UserConfirmDialog',
|
||||
components: {
|
||||
Dialog
|
||||
},
|
||||
props: {
|
||||
url: {
|
||||
type: String,
|
||||
default: () => ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
smsWidth: 0,
|
||||
Select: '',
|
||||
Level: null,
|
||||
HelpText: '',
|
||||
smsBtnText: '',
|
||||
smsBtndisabled: false,
|
||||
ConfirmType: '',
|
||||
Content: null,
|
||||
SecretKey: '',
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
showPassword() {
|
||||
if (this.ConfirmType === 'password') {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
if (!val) {
|
||||
this.$emit('UserConfirmCancel', true)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.smsBtnText = this.$t('common.SendVerificationCode')
|
||||
this.$axios.get(`${this.url}`, { disableFlashErrorMsg: true }).then(
|
||||
() => { this.$emit('UserConfirmDone', true) }).catch((err) => {
|
||||
const confirm_type = err.response.data.code
|
||||
this.$axios.get('/api/v1/authentication/confirm/', { params: { confirm_type: confirm_type }}).then((data) => {
|
||||
this.ConfirmType = data.confirm_type
|
||||
this.Content = data.content
|
||||
if (this.ConfirmType === 'relogin') {
|
||||
this.$axios.post(
|
||||
`/api/v1/authentication/confirm/`,
|
||||
{
|
||||
confirm_type: this.ConfirmType,
|
||||
secret_key: ''
|
||||
},
|
||||
{ disableFlashErrorMsg: true },
|
||||
).then(() => { this.$emit('UserConfirmDone', true) }).catch(() => {
|
||||
this.title = this.$t('auth.NeedReLogin')
|
||||
this.visible = true
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.ConfirmType === 'mfa') {
|
||||
this.Select = this.Content.filter(item => !item.disabled)[0].name
|
||||
if (this.Select === 'sms') {
|
||||
this.smsWidth = 6
|
||||
}
|
||||
this.HelpText = this.Content.filter(item => !item.disabled)[0].placeholder
|
||||
} else if (this.ConfirmType === 'password') {
|
||||
this.Select = this.$t('setting.password')
|
||||
this.HelpText = this.$t('common.PasswordRequireForSecurity')
|
||||
this.Content = [{ 'name': 'password' }]
|
||||
}
|
||||
this.title = this.$t('common.CurrentUserVerify')
|
||||
this.visible = true
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
helpText(val) {
|
||||
this.HelpText = this.Content.filter(item => item.name === val)[0]?.placeholder
|
||||
if (val === 'sms') {
|
||||
this.smsWidth = 6
|
||||
} else {
|
||||
this.smsWidth = 0
|
||||
}
|
||||
},
|
||||
logOut() {
|
||||
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${this.$route.fullPath}`
|
||||
},
|
||||
sendChallengeCode() {
|
||||
this.$axios.post(
|
||||
`/api/v1/authentication/mfa/select/`, {
|
||||
type: 'sms'
|
||||
}
|
||||
).then(res => {
|
||||
this.$message.success(this.$t('common.VerificationCodeSent'))
|
||||
let time = 60
|
||||
const interval = setInterval(() => {
|
||||
this.smsBtnText = this.$t('common.Pending') + `: ${time}`
|
||||
this.smsBtndisabled = true
|
||||
time -= 1
|
||||
|
||||
if (time === 0) {
|
||||
this.smsBtnText = this.$t('common.SendVerificationCode')
|
||||
this.smsBtndisabled = false
|
||||
clearInterval(interval)
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
},
|
||||
userConfirm() {
|
||||
if (this.Select === 'otp' && this.SecretKey.length !== 6) {
|
||||
return this.$message.error(this.$t('common.MFAErrorMsg'))
|
||||
}
|
||||
this.$axios.post(
|
||||
`/api/v1/authentication/confirm/`, {
|
||||
confirm_type: this.ConfirmType,
|
||||
mfa_type: this.ConfirmType === 'password' ? undefined : this.Select,
|
||||
secret_key: this.SecretKey
|
||||
}
|
||||
).then(res => {
|
||||
this.$emit('UserConfirmDone', true)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-content >>> .el-dialog__footer{
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.dialog-content >>> .el-dialog{
|
||||
padding: 8px;
|
||||
}
|
||||
</style>
|
||||
@@ -25,6 +25,6 @@ export { default as UploadField } from './FormFields/UploadField'
|
||||
export { default as AccountListTable } from './AccountListTable/index'
|
||||
export { default as AppAccountListTable } from './AppAccountListTable'
|
||||
export { default as AssetRelationCard } from './AssetRelationCard'
|
||||
export { default as MFAVerifyDialog } from './MFAVerifyDialog'
|
||||
export { default as UserConfirmDialog } from './UserConfirmDialog'
|
||||
export { default as Announcement } from './Announcement'
|
||||
export { default as CronTab } from './CronTab'
|
||||
|
||||
@@ -4,8 +4,7 @@ import NProgress from 'nprogress' // progress bar
|
||||
import 'nprogress/nprogress.css' // progress bar style
|
||||
import { startup } from '@/utils/startup'
|
||||
import store from '@/store'
|
||||
import { getPropView, hasRouteViewPerm, isSameView } from '@/utils/jms'
|
||||
import Vue from 'vue'
|
||||
import { isSameView } from '@/utils/jms'
|
||||
|
||||
NProgress.configure({
|
||||
showSpinner: false
|
||||
@@ -19,7 +18,7 @@ router.beforeEach(async(to, from, next) => {
|
||||
next()
|
||||
} catch (e) {
|
||||
const msg = 'Start service error: ' + e
|
||||
console.log(e)
|
||||
// debug(e)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -30,35 +29,15 @@ function generateViewRoutesIfChange({ to, from }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function changeCurrentViewIfNeed({ to, from, next }) {
|
||||
if (!to.path || isSameView(to, from)) {
|
||||
return
|
||||
}
|
||||
const hasPerm = hasRouteViewPerm(to)
|
||||
Vue.$log.debug('Change has current view, has perm: ', hasPerm)
|
||||
if (hasPerm) {
|
||||
return
|
||||
}
|
||||
const view = getPropView()
|
||||
Vue.$log.debug('Get prop view and goto: ', view)
|
||||
next(`/${view}`)
|
||||
}
|
||||
|
||||
function setPageTitle() {
|
||||
const currentRoute = router.currentRoute
|
||||
const loginTitle = store.getters.publicSettings['LOGIN_TITLE']
|
||||
const loginTitle = store.getters.publicSettings['INTERFACE']['login_title']
|
||||
const routeTitle = currentRoute.meta.title
|
||||
if (routeTitle) {
|
||||
document.title = routeTitle + ' - ' + loginTitle
|
||||
}
|
||||
}
|
||||
|
||||
router.beforeResolve(async(to, from, next) => {
|
||||
/* must call `next` */
|
||||
await changeCurrentViewIfNeed({ to, from, next })
|
||||
next()
|
||||
})
|
||||
|
||||
router.afterEach(async(to, from) => {
|
||||
// finish progress bar
|
||||
await setPageTitle()
|
||||
|
||||
@@ -26,5 +26,19 @@ export default {
|
||||
year: 'numeric', month: 'short', day: 'numeric',
|
||||
hour: 'numeric', minute: 'numeric', hour12: true
|
||||
}
|
||||
},
|
||||
'ja': {
|
||||
short: {
|
||||
year: 'numeric', month: 'short', day: 'numeric'
|
||||
},
|
||||
medium: {
|
||||
year: 'numeric', month: '2-digit', day: '2-digit',
|
||||
hour: '2-digit', minute: '2-digit', second: '2-digit',
|
||||
hourCycle: 'h23', hour12: false
|
||||
},
|
||||
long: {
|
||||
year: 'numeric', month: 'short', day: 'numeric',
|
||||
hour: 'numeric', minute: 'numeric', hour12: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,12 @@ import date from './date'
|
||||
import VueCookie from 'vue-cookie'
|
||||
|
||||
Vue.use(VueI18n)
|
||||
const cookieLang = VueCookie.get('django_language')
|
||||
const browserLang = navigator.systemLanguage || navigator.language
|
||||
let lang = cookieLang || browserLang || 'zh'
|
||||
lang = lang.slice(0, 2)
|
||||
const i18n = new VueI18n({
|
||||
locale: (VueCookie.get('django_language') || 'zh-hans') === 'zh-hans' ? 'cn' : 'en',
|
||||
locale: lang,
|
||||
fallbackLocale: 'en',
|
||||
silentFallbackWarn: true,
|
||||
silentTranslationWarn: true,
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{
|
||||
"": "",
|
||||
"accounts": {
|
||||
"AccountHistableHelpMessage": "Record the historical version of the current account",
|
||||
"PleaseClickLeftAssetToViewAssetAccount": "Asset account list, please click on the assets on the left to view",
|
||||
"PleaseClickLeftApplicationToViewApplicationAccount": "Application account list, please click on the application on the left to view",
|
||||
"PleaseClickLeftAssetToViewGatheredUser": "Gathered user list, please click on the assets on the left to view"
|
||||
},
|
||||
"acl": {
|
||||
"name": "Name",
|
||||
"ip_group_help_text": "The format is a comma-separated string, * means match all. Example: 192.168.10.1, 192.168.1.0/24, 10.1.1.1-10.1.1.20, 2001:db8:2de::e13, 2001:db8:1a:1110::/64",
|
||||
"username": "Username",
|
||||
"ip_group": "IP group",
|
||||
"action": "Action",
|
||||
@@ -46,6 +48,7 @@
|
||||
"sqlserver": "SQLServer",
|
||||
"redis": "Redis",
|
||||
"mongodb": "MongoDB",
|
||||
"clickhouse": "ClickHouse",
|
||||
"k8s": "kubernetes"
|
||||
},
|
||||
"applicationsCategory": {
|
||||
@@ -97,6 +100,7 @@
|
||||
"Action": "Action",
|
||||
"ActiveSelected": "Active selected",
|
||||
"AdminUser": "Admin user",
|
||||
"AssetTree": "Asset tree",
|
||||
"ReplaceNodeAssetsAdminUser":"Replace node assets admin user with this",
|
||||
"AdminUserDetail": "Admin user detail",
|
||||
"DynamicUsername": "Dynamic username",
|
||||
@@ -125,7 +129,7 @@
|
||||
"Charset": "Charset",
|
||||
"CmdFilter": "CmdFilter",
|
||||
"CommandFilterDetail": "Command filter detail",
|
||||
"CommandFilterHelpMessage": "System user bound some command filter, each command filter has some rules, When user login asset with this system user, then run a command, The command will be filter by rules, higher priority rule run first, When a rule matched, if rule action is allow, then allow command execute, else if action is deny, then command with be deny, else match next rule, if none matched, allowed",
|
||||
"CommandFilterHelpMessage": "The system user supports binding multiple command filters to achieve the effect of prohibiting the input of certain commands; multiple rules can be configured in the filter. When the system user is used to connect to the asset, the input command takes effect according to the priority of the rules configured in the filter. <br>Example: The first matched rule is \"Allow\", the command is executed, the first matched rule is \"Forbidden\", the command execution is prohibited; if the last rule is not matched, it is allowed to be executed.",
|
||||
"CommandFilterRuleContentHelpText": "One line one command",
|
||||
"CommandFilterRulePriorityHelpText": "1-100, the higher will be match first",
|
||||
"CommandFilterRules": "Command filter rules",
|
||||
@@ -242,13 +246,25 @@
|
||||
"View": "View",
|
||||
"LoginIP": "Login IP",
|
||||
"LoginCity": "Login city",
|
||||
"LoginDate": "Login date"
|
||||
"LoginDate": "Login date",
|
||||
"BeforeChange": "Before change",
|
||||
"AfterChange": "After change"
|
||||
},
|
||||
"auth": {
|
||||
"LoginRequiredMsg": "You account has logout, Please login again",
|
||||
"ReLogin": "Re-Login"
|
||||
"ReLogin": "Re-Login",
|
||||
"ReLoginTitle": "The current three-party login user (cas/saml) is not bound to MFA and does not support password verification. Please login again",
|
||||
"NeedReLogin": "Need Re-Login",
|
||||
"ReLoginErr": "Login time has exceeded 5 minutes, please login again"
|
||||
},
|
||||
"common": {
|
||||
"NoContent": "No content",
|
||||
"NeedAddAppsOrSystemUserErrMsg": "Please add apps or system user",
|
||||
"VerificationCodeSent": "The verification code has been sent",
|
||||
"SendVerificationCode": "Send verification code",
|
||||
"History": "History",
|
||||
"ChangeViewHelpText": "Click to change view",
|
||||
"Component": "component",
|
||||
"PrivateCloud": "Private cloud",
|
||||
"PublicCloud": "Public cloud",
|
||||
"Correlation": "Correlation",
|
||||
@@ -256,6 +272,12 @@
|
||||
"IPLoginLimit": "IP login limit",
|
||||
"Setting": "Setting",
|
||||
"Certificate": "Certificate",
|
||||
"CACertificate": "CA Certificate",
|
||||
"ClientCertificate": "Client certificate",
|
||||
"CertificateKey": "Certificate key file",
|
||||
"AllowInvalidCert": "Allow invalid cert",
|
||||
"UseSSL": "Use SSL/TLS",
|
||||
"SecretKey": "Secret key",
|
||||
"Scope": "Type",
|
||||
"Builtin": "Builtin",
|
||||
"DateCreated": "Date created",
|
||||
@@ -267,6 +289,7 @@
|
||||
"Database": "Database",
|
||||
"Params": "Params",
|
||||
"MFAVerify": "Verify MFA",
|
||||
"CurrentUserVerify": "Verify Current User",
|
||||
"ViewSecret": "View secret",
|
||||
"ConnectWebSocketError": "Connect Websocket failed",
|
||||
"Nothing": "Nothing",
|
||||
@@ -314,12 +337,15 @@
|
||||
"Delete": "Delete",
|
||||
"Disable": "Disable",
|
||||
"Download": "Download",
|
||||
"Copy": "Copy",
|
||||
"CopySuccess": "Copy success",
|
||||
"Enable": "Enable",
|
||||
"On/Off": "On/Off",
|
||||
"EnterForSearch": "Press enter to search",
|
||||
"Export": "Export",
|
||||
"Import": "Import",
|
||||
"ContinueImport": "ContinueImport",
|
||||
"ImportAll": "Import All",
|
||||
"Continue": "Continue",
|
||||
"Stop": "Stop",
|
||||
"Finished": "Finished",
|
||||
@@ -393,6 +419,7 @@
|
||||
"disableSelected": "Disable selected",
|
||||
"disableSuccessMsg": "Disable success",
|
||||
"fieldRequiredError": "This field is required",
|
||||
"requiredHasUserNameMapped": "The mapping of the username field must be included, such as {'uid': 'username'}",
|
||||
"getErrorMsg": "Get failed",
|
||||
"fileType": "File type",
|
||||
"Status": "Status",
|
||||
@@ -409,15 +436,18 @@
|
||||
"downloadImportTemplateMsg": "Download import template",
|
||||
"downloadUpdateTemplateMsg": "Download update template",
|
||||
"onlyCSVFilesTips": "Only csv supported",
|
||||
"ImportFail": "Import fail",
|
||||
"updateSuccessMsg": "Update success, total: {count}",
|
||||
"dragUploadFileInfo": "Drag file here or click to upload",
|
||||
"dragUploadFileInfo": "Drag file here or click here to upload",
|
||||
"uploadCsvLth10MHelpText": "csv/xlsx files with a size less than 10M",
|
||||
"hasImportErrorItemMsg": "There is an error item, click the x icon to view the details, and continue to import after editing"
|
||||
},
|
||||
"isValid": "Is valid",
|
||||
"nav": {
|
||||
"TempPassword": "Temporary password",
|
||||
"ConnectionToken": "Connection token",
|
||||
"APIKey": "API Key",
|
||||
"Workspace": "Workbench",
|
||||
"Workbench": "Workbench",
|
||||
"Navigation": "Navigation",
|
||||
"Console": "Console",
|
||||
"Audits": "Audit",
|
||||
@@ -429,6 +459,7 @@
|
||||
"Logout": "Logout",
|
||||
"Profile": "Profile",
|
||||
"Support": "Support",
|
||||
"Download": "Download",
|
||||
"UserPage": "User page",
|
||||
"View": "View",
|
||||
"EnterpriseEdition": "Enterprise edition"
|
||||
@@ -498,6 +529,7 @@
|
||||
},
|
||||
"Cycle": "Cycle",
|
||||
"FormatError": "Format error",
|
||||
"NotSpecialEmoji": "Special emoticons are not allowed",
|
||||
"WeekCronSelect": {
|
||||
"Monday": "Monday",
|
||||
"Tuesday": "Tuesday",
|
||||
@@ -534,6 +566,7 @@
|
||||
"Monthly": "Monthly",
|
||||
"OnlineSessions": "Online sessions",
|
||||
"OnlineUsers": "Online users",
|
||||
"ConnectUsers": "Connect users",
|
||||
"TimesWeekUnit": "times/week",
|
||||
"TopAssetsOfWeek": "Top assets of week",
|
||||
"TopUsersOfWeek": "Top user of week",
|
||||
@@ -651,6 +684,11 @@
|
||||
},
|
||||
"route": {
|
||||
"": "",
|
||||
"AssignedTicketList": "Assigned tickets",
|
||||
"CreateEndpoint": "Create endpoint",
|
||||
"UpdateEndpoint": "Update endpoint",
|
||||
"CreateEndpointRule": "Create endpoint rule",
|
||||
"UpdateEndpointRule": "Update endpoint rule",
|
||||
"SystemSetting": "System setting",
|
||||
"Index": "Index",
|
||||
"Role": "Role",
|
||||
@@ -665,6 +703,7 @@
|
||||
"SessionDetail": "SessionDetail",
|
||||
"Accounts": "Accounts",
|
||||
"AssetAccount": "Asset Account",
|
||||
"AssetHistoryAccount": "Asset History Account",
|
||||
"ApplicationAccount": "Application Account",
|
||||
"Ticket": "Tickets",
|
||||
"CommandConfirm": "Command confirm",
|
||||
@@ -682,7 +721,7 @@
|
||||
"AssetPermissionUpdate": "Asset permissions update",
|
||||
"AssetUpdate": "Asset update",
|
||||
"Assets": "Assets",
|
||||
"LogsAudits": "Logs audit",
|
||||
"LogsAudit": "Logs audit",
|
||||
"SessionsAudit": "Sessions audit",
|
||||
"SessionList": "Session list",
|
||||
"BatchCommand": "Batch Command",
|
||||
@@ -745,7 +784,7 @@
|
||||
"OperateLog": "Operation Logs",
|
||||
"PasswordChangeLog": "Password Update Logs",
|
||||
"Perms": "Permissions",
|
||||
"PersonalInformationImprovement": "PersonalInformationImprovement",
|
||||
"PersonalInformationImprovement": "Personal information improvement",
|
||||
"PlatformCreate": "Platform create",
|
||||
"PlatformDetail": "Platform detail",
|
||||
"PlatformList": "Platforms",
|
||||
@@ -767,6 +806,7 @@
|
||||
"Activity": "Activity",
|
||||
"SessionOffline": "Sessions offline",
|
||||
"SessionOnline": "Sessions online",
|
||||
"RecentSession": "Recent session",
|
||||
"Sessions": "Sessions",
|
||||
"Settings": "Settings",
|
||||
"SystemUserCreate": "System user create",
|
||||
@@ -878,21 +918,30 @@
|
||||
"UseProtocol": "Use protocol",
|
||||
"SessionState": "Session state",
|
||||
"Monitor": "Monitor",
|
||||
"XRDPNotSupport": "RDP Client session not support now",
|
||||
"RazorNotSupport": "RDP Client session not support now",
|
||||
"sessionMonitor": "Session Monitor",
|
||||
"TerminateTaskSendSuccessMsg": "Terminate task has been send, Please check later",
|
||||
"helpText": {
|
||||
"esUrl": "Tip: If you have multiple hosts, use comma (, ) to split (eg: http://www.jumpserver.a.com, http://www.jumpserver.b.com)",
|
||||
"esIndex":"Es provides the default index: jumpserver",
|
||||
"esIndex":"Es provides the default index: jumpserver. If you choose to build an index by date, this blank is the index prefix",
|
||||
"esDocType": "Es provides the default document type: command"
|
||||
}
|
||||
},
|
||||
"setting": {
|
||||
"OAuth2LogoTip": "Tip: Authentication Service Provider (recommended image size: 64px*64px)",
|
||||
"EndpointListHelpMessage": "The service endpoint is the address (port) for the user to access the service. When the user connects to the asset, the service endpoint will be selected according to the endpoint rules and asset tags, and the connection will be established as the access entry to realize the distributed connection of assets.",
|
||||
"EndpointRuleListHelpMessage": "For the service endpoint selection strategy, two types are currently supported: <br>1. Specify the endpoint according to the endpoint rule (current page); <br>2. Select the endpoint through the asset tag. The tag name is fixed to endpoint, and the value is the name of the `endpoint`. <br>Two methods preferentially use label matching, because the IP segment may conflict, and the label method exists as a supplement to the rules.",
|
||||
"EnableKoKoSSHHelpText": "Enabled, connect assets to display SSH Client pull-up method",
|
||||
"SettingInEndpointHelpText": "Configure the service address and port in System Settings / Terminal Settings / Service Endpoints",
|
||||
"Feature": "Feature",
|
||||
"SMSProvider": "SMS provider",
|
||||
"SMSProvider": "SMS provider / Protocol",
|
||||
"SMS": "SMS",
|
||||
"AlibabaCloud": "Alibaba cloud",
|
||||
"TencentCloud": "Tencent cloud",
|
||||
"HuaweiCloud": "Huawei cloud",
|
||||
"SignChannelNum": "Signature Channel Number",
|
||||
"AppEndpoint": "App access address",
|
||||
"CMPP2": "CMPP v2.0",
|
||||
"VerifySignTmpl": "Verification code template",
|
||||
"Radius": "Radius",
|
||||
"Enable": "Enable",
|
||||
@@ -946,9 +995,12 @@
|
||||
"authLdapServerUri": "LDAP server",
|
||||
"authLdapUserAttrMap": "User attr map",
|
||||
"authUserAttrMap": "User attr map",
|
||||
"authUserAttrMapHelpText": "Mapping relationship { idp_key: sp_key}",
|
||||
"authUserAttrMapHelpText": "The key on the left is the JumpServer user property, and the value on the right is the authenticated platform user property",
|
||||
"SAML2": "SAML2",
|
||||
"OAuth2": "OAuth2",
|
||||
"enableSAML2Auth": "Enable SAML2 Auth",
|
||||
"enableOAuth2Auth": "Enable OAuth2 Auth",
|
||||
"tokenHTTPMethod": "Token Obtaining Method",
|
||||
"SAML2Auth": "SAML2 Auth",
|
||||
"authSAML2Xml": "IDP metadata XML",
|
||||
"authSAML2MetadataUrl": "IDP metadata URL",
|
||||
@@ -982,7 +1034,9 @@
|
||||
"LDAPUser": "LDAP User",
|
||||
"InsecureCommandAlert": "Insecure command alert",
|
||||
"helpText": {
|
||||
"TempPassword": "For a while, there is a period of 300 seconds, failure immediately after use",
|
||||
"ApiKeyList": "The API key is used to sign the request header. The header of each request is different. Please refer to the usage documentation",
|
||||
"ConnectionTokenList": "The connection token is a kind of authentication information that combines authentication and connection assets. It allows users to log in to assets with one click. Currently supported components include: KoKo, Lion, Magnus, Razor, etc.",
|
||||
"authLdapSearchFilter": "Choice may be (cn|uid|sAMAccountName)=%(user)s)",
|
||||
"authLdapSearchOu": "Use | split User OUs",
|
||||
"authLdapUserAttrMap": "User attr map present how to map LDAP user attr to jumpserver, username, name, email is jumpserver attr",
|
||||
@@ -1057,16 +1111,23 @@
|
||||
"refreshLdapCache":"Refreshing Ldap cache ",
|
||||
"LicenseExpired": "License expired",
|
||||
"LicenseWillBe": "License will expire at ",
|
||||
"Expire": "",
|
||||
"LicenseReachedAssetAmountLimit": "The number of assets has exceeded the license limit",
|
||||
"LicenseForTest": "Testing license, This license is only for testing",
|
||||
"Expire": "Expire",
|
||||
"WeCom": "WeCom",
|
||||
"DingTalk": "DingTalk",
|
||||
"dingTalkTest": "Test",
|
||||
"weComTest": "Test",
|
||||
"FeiShu": "FeiShu",
|
||||
"feiShuTest": "Test",
|
||||
"setting": "Setting"
|
||||
"setting": "Setting",
|
||||
"SystemTools": "System Tools",
|
||||
"basicTools": "Basic Tools",
|
||||
"destinationIP": "Destination IP",
|
||||
"testPort": "Test Port",
|
||||
"testTools": "Test",
|
||||
"testHelpText": "Please enter the destination address for testing"
|
||||
},
|
||||
|
||||
"tickets": {
|
||||
"PermissionName": "Permission name",
|
||||
"Accept": "Accept",
|
||||
@@ -1080,6 +1141,7 @@
|
||||
"OpenTicket": "Open Ticket",
|
||||
"HandleTicket": "Handle Ticket",
|
||||
"FinishedTicket": "Finished Ticket",
|
||||
"CheckViewAcceptor": "Click to view the acceptor",
|
||||
"Assignees": "Assignees",
|
||||
"Close": "Close",
|
||||
"OpenStatus":"Open",
|
||||
@@ -1093,6 +1155,10 @@
|
||||
"reply": "Reply",
|
||||
"status": "Status",
|
||||
"title": "Title",
|
||||
"RelevantApp": "App",
|
||||
"RelevantAsset": "Asset",
|
||||
"RelevantCommand": "Command",
|
||||
"RelevantSystemUser": "System user",
|
||||
"type": "Type",
|
||||
"user": "User",
|
||||
"Status": "Status",
|
||||
@@ -1264,12 +1330,14 @@
|
||||
"Sender": "Sender",
|
||||
"MarkAsRead": "Mark as read",
|
||||
"OneClickRead": "Currently read",
|
||||
"AllClickRead": "All read",
|
||||
"OneClickReadMsg": "Are you sure you want to mark the current information as read?",
|
||||
"NoUnreadMsg": "No unread messages",
|
||||
"SiteMessage": "Site messages",
|
||||
"SMS": "SMS"
|
||||
},
|
||||
"xpack": {
|
||||
"Images": "Images",
|
||||
"NavHelp": "Navigation Link",
|
||||
"helpDocument": "Docs link",
|
||||
"helpSupport": "Support link",
|
||||
@@ -1359,13 +1427,20 @@
|
||||
"IPNetworkSegment": "Ip Network Segment",
|
||||
"Aliyun": "Ali Cloud",
|
||||
"Qcloud": "Tencent Cloud",
|
||||
"QcloudLighthouse": "Tencent Cloud(Lighthouse)",
|
||||
"QingyunPrivatecloud": "Qingyun Private Cloud",
|
||||
"HuaweiPrivatecloud": "Huawei Private Cloud",
|
||||
"OpenStack": "OpenStack",
|
||||
"CTYunPrivate": "CTYun Private Cloud",
|
||||
"GCP": "Google Cloud Platform",
|
||||
"FC": "Fusion Compute",
|
||||
"LAN": "LAN",
|
||||
"AWS_China": "AWS(China)",
|
||||
"AWS_Int": "AWS(International)",
|
||||
"HuaweiCloud": "Huawei Cloud",
|
||||
"BaiduCloud": "Baidu Cloud",
|
||||
"JDCloud": "JD Cloud",
|
||||
"KingSoftCloud": "KingSoft Cloud",
|
||||
"Azure":"Azure(China)",
|
||||
"Azure_Int": "Azure(International)",
|
||||
"HostnameStrategy": "Used to produce the asset hostname. For example, 1. Instance name (instanceDemo);2. Instance name and Partial IP (instanceDemo-250.1)",
|
||||
@@ -1432,6 +1507,8 @@
|
||||
"License": "License",
|
||||
"LicenseDetail": "License detail",
|
||||
"ComponentMonitor": "System Monitor",
|
||||
"Endpoint": "Endpoint",
|
||||
"EndpointRule": "Endpoint rule",
|
||||
"ServiceRatio": "Service ratio",
|
||||
"LoadStatus":"Status",
|
||||
"NormalLoad":"Normal",
|
||||
@@ -1487,6 +1564,9 @@
|
||||
"technologyConsult": "Technology Consult",
|
||||
"RegularlyPerform": "Regularly perform",
|
||||
"CyclePerform": "Cycle perform",
|
||||
"ModifyTheme": "Modify theme",
|
||||
"ClassicGreen": "Classic green",
|
||||
"ChinaRed": "China red",
|
||||
"HelpText": {
|
||||
"CrontabOfCreateUpdatePage": "For example: every Sunday at 03:05 execute <5 3 * * 0> <br/> Using the 5-bit Linux crontab expression <minute hour day month week> (<a href=\"https://tool.lu/crontab/\" target=\"_blank\"> Online tool </a>) <br/> If both regularly perform and cycle perform execution are set, use regularly perform first",
|
||||
"IntervalOfCreateUpdatePage": "Unit: hour",
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
|
||||
import enLocale from 'element-ui/lib/locale/lang/en'
|
||||
import zh from './cn.json'
|
||||
import jaLocale from 'element-ui/lib/locale/lang/ja'
|
||||
import zh from './zh.json'
|
||||
import en from './en.json'
|
||||
import ja from './ja.json'
|
||||
|
||||
export default {
|
||||
cn: {
|
||||
zh: {
|
||||
...zhLocale,
|
||||
...zh
|
||||
},
|
||||
en: {
|
||||
...enLocale,
|
||||
...en
|
||||
},
|
||||
ja: {
|
||||
...jaLocale,
|
||||
...ja
|
||||
}
|
||||
}
|
||||
|
||||
1621
src/i18n/langs/ja.json
Normal file
1621
src/i18n/langs/ja.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,8 @@ import json
|
||||
i18n_report_path = '/tmp/abc.json'
|
||||
lang_paths = {
|
||||
'cn': 'cn.json',
|
||||
'en': 'en.json'
|
||||
'en': 'en.json',
|
||||
'ja': 'ja.json'
|
||||
}
|
||||
|
||||
|
||||
@@ -51,5 +52,5 @@ def remove_keys(lang):
|
||||
f.write(data)
|
||||
|
||||
|
||||
for i in ['cn', 'en']:
|
||||
for i in ['cn', 'en', 'ja']:
|
||||
remove_keys(i)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"": "",
|
||||
"accounts": {
|
||||
"AccountHistableHelpMessage": "记录当前账号的历史版本",
|
||||
"PleaseClickLeftAssetToViewAssetAccount": "资产账号列表,点击左侧资产进行查看",
|
||||
"PleaseClickLeftApplicationToViewApplicationAccount": "应用账号列表,点击左侧应用进行查看",
|
||||
"PleaseClickLeftAssetToViewGatheredUser": "收集用户列表,点击左侧资产进行查看"
|
||||
@@ -51,6 +52,7 @@
|
||||
"sqlserver": "SQLServer",
|
||||
"redis": "Redis",
|
||||
"mongodb": "MongoDB",
|
||||
"clickhouse": "ClickHouse",
|
||||
"k8s": "Kubernetes"
|
||||
},
|
||||
"applicationsCategory": {
|
||||
@@ -109,6 +111,7 @@
|
||||
"AssetDetail": "资产详情",
|
||||
"AssetList": "资产列表",
|
||||
"ReplaceNodeAssetsAdminUser":"替换节点资产的管理员",
|
||||
"AssetTree": "资产树",
|
||||
"AssetListHelpMessage": "左侧是资产树,右击可以新建、删除、更改树节点,授权资产也是以节点方式组织的,右侧是属于该节点下的资产\n",
|
||||
"TestGatewayTestConnection":"测试连接网关",
|
||||
"TestGatewayHelpMessage": "如果使用了nat端口映射,请设置为ssh真实监听的端口",
|
||||
@@ -127,7 +130,7 @@
|
||||
"Charset": "字符集",
|
||||
"CmdFilter": "命令过滤器",
|
||||
"CommandFilterDetail": "命令过滤器详情",
|
||||
"CommandFilterHelpMessage": "系统用户可以绑定一些命令过滤器,一个过滤器可以定义一些规则 当用户使用这个系统用户登录资产,然后执行一个命令 这个命令需要被绑定过滤器的所有规则匹配,高优先级先被匹配, 当一个规则匹配到了,如果规则的动作是允许,这个命令会被放行, 如果规则的动作是禁止,命令将会被禁止执行, 否则就匹配下一个规则,如果最后没有匹配到规则,则允许执行",
|
||||
"CommandFilterHelpMessage": "系统用户支持绑定多个命令过滤器实现禁止输入某些命令的效果;过滤器中可配置多个规则,在使用该系统用户连接资产时,输入的命令按照过滤器中配置的规则优先级生效。<br>例:首先匹配到的规则是“允许”,则该命令执行,首先匹配到的规则为“禁止”,则禁止该命令执行;如果最后未匹配到规则,则允许执行。",
|
||||
"CommandFilterRuleContentHelpText": "每行一个命令",
|
||||
"CommandFilterRulePriorityHelpText": "优先级可选范围为1-100,1最低优先级,100最高优先级",
|
||||
"CommandFilterRules": "命令过滤器规则",
|
||||
@@ -247,13 +250,25 @@
|
||||
"SystemUserName": "系统用户名",
|
||||
"LoginIP": "登录IP",
|
||||
"LoginCity": "登录城市",
|
||||
"LoginDate": "登录日期"
|
||||
"LoginDate": "登录日期",
|
||||
"BeforeChange": "变更前",
|
||||
"AfterChange": "变更后"
|
||||
},
|
||||
"auth": {
|
||||
"LoginRequiredMsg": "账号已退出,请重新登录",
|
||||
"ReLogin": "重新登录"
|
||||
"ReLogin": "重新登录",
|
||||
"ReLoginTitle": "当前三方登录用户(CAS/SAML),未绑定 MFA 且不支持密码校验,请重新登录。",
|
||||
"NeedReLogin": "需要重新登录",
|
||||
"ReLoginErr": "登录时长已超过 5 分钟,请重新登录"
|
||||
},
|
||||
"common": {
|
||||
"NoContent": "暂无内容",
|
||||
"NeedAddAppsOrSystemUserErrMsg": "需要添加应用或系统用户",
|
||||
"VerificationCodeSent": "验证码已发送",
|
||||
"SendVerificationCode": "发送验证码",
|
||||
"History": "历史",
|
||||
"ChangeViewHelpText": "点击切换不同视图",
|
||||
"Component": "组件",
|
||||
"PrivateCloud": "私有云",
|
||||
"PublicCloud": "公有云",
|
||||
"Correlation": "关联",
|
||||
@@ -261,6 +276,12 @@
|
||||
"IPLoginLimit": "IP 登录限制",
|
||||
"Setting": "设置",
|
||||
"Certificate": "证书",
|
||||
"CACertificate": "CA 证书",
|
||||
"ClientCertificate": "客户端证书",
|
||||
"CertificateKey": "证书秘钥文件",
|
||||
"AllowInvalidCert": "忽略证书检查",
|
||||
"UseSSL": "使用 SSL/TLS",
|
||||
"SecretKey": "密钥",
|
||||
"Scope": "类别",
|
||||
"Builtin": "内置",
|
||||
"DateCreated": "创建日期",
|
||||
@@ -275,6 +296,7 @@
|
||||
"DateUpdated": "更新日期",
|
||||
"ApprovaLevel": "审批信息",
|
||||
"MFAVerify": "验证 MFA",
|
||||
"CurrentUserVerify": "验证当前用户",
|
||||
"ViewSecret": "查看密码",
|
||||
"ConnectWebSocketError": "连接 WebSocket 失败",
|
||||
"Action": "动作",
|
||||
@@ -326,12 +348,15 @@
|
||||
"Delete": "删除",
|
||||
"Disable": "禁用",
|
||||
"Download": "下载",
|
||||
"Copy": "复制",
|
||||
"CopySuccess": "复制成功",
|
||||
"Enable": "启用",
|
||||
"On/Off": "启/停",
|
||||
"EnterForSearch": "按回车进行搜索",
|
||||
"Export": "导出",
|
||||
"Import": "导入",
|
||||
"ContinueImport": "继续导入",
|
||||
"ImportAll": "导入全部",
|
||||
"Continue": "继续",
|
||||
"Stop": "停止",
|
||||
"Finished": "完成",
|
||||
@@ -402,6 +427,7 @@
|
||||
"disableSelected": "禁用所选",
|
||||
"disableSuccessMsg": "禁用成功",
|
||||
"fieldRequiredError": "这个字段是必填项",
|
||||
"requiredHasUserNameMapped": "必须包含 username 字段的映射,如 { 'uid': 'username' }",
|
||||
"getErrorMsg": "获取失败",
|
||||
"MFAErrorMsg": "MFA错误,请检查",
|
||||
"Total": "总共",
|
||||
@@ -420,16 +446,19 @@
|
||||
"downloadImportTemplateMsg": "下载创建模板",
|
||||
"downloadUpdateTemplateMsg": "下载更新模板",
|
||||
"onlyCSVFilesTips": "仅支持csv文件导入",
|
||||
"ImportFail": "导入失败",
|
||||
"updateSuccessMsg": "导入更新成功,总共:{count}",
|
||||
"uploadCsvLth10MHelpText": "只能上传 csv/xlsx, 且不超过 10M",
|
||||
"dragUploadFileInfo": "将文件拖到此处,或点击上传",
|
||||
"dragUploadFileInfo": "将文件拖到此处,或点击此处上传",
|
||||
"hasImportErrorItemMsg": "存在导入失败项,点击左侧 x 查看失败原因,点击表格编辑后,可以继续导入失败项"
|
||||
},
|
||||
"fileType": "文件类型",
|
||||
"isValid": "有效",
|
||||
"nav": {
|
||||
"TempPassword": "临时密码",
|
||||
"ConnectionToken": "连接令牌",
|
||||
"APIKey": "API Key",
|
||||
"Workspace": "工作台",
|
||||
"Workbench": "工作台",
|
||||
"Navigation": "导航",
|
||||
"Console": "控制台",
|
||||
"Audits": "审计台",
|
||||
@@ -441,6 +470,7 @@
|
||||
"Logout": "退出登录",
|
||||
"Profile": "个人信息",
|
||||
"Support": "支持",
|
||||
"Download": "下载",
|
||||
"UserPage": "用户视图",
|
||||
"View": "视图",
|
||||
"EnterpriseEdition": "企业版"
|
||||
@@ -474,6 +504,7 @@
|
||||
"InvalidJson": "不是合法 JSON",
|
||||
"time_period": "时段",
|
||||
"FormatError": "格式错误",
|
||||
"NotSpecialEmoji": "不允许输入特殊表情符号",
|
||||
"WeekCronSelect": {
|
||||
"Monday": "星期一",
|
||||
"Tuesday": "星期二",
|
||||
@@ -545,6 +576,7 @@
|
||||
"Monthly": "按月",
|
||||
"OnlineSessions": "在线会话",
|
||||
"OnlineUsers": "在线用户",
|
||||
"ConnectUsers": "连接用户",
|
||||
"TimesWeekUnit": "次/周",
|
||||
"TopAssetsOfWeek": "周资产 TOP10",
|
||||
"TopUsersOfWeek": "周用户 TOP10",
|
||||
@@ -661,6 +693,10 @@
|
||||
},
|
||||
"route": {
|
||||
"": "",
|
||||
"CreateEndpoint": "创建端点",
|
||||
"UpdateEndpoint": "更新端点",
|
||||
"CreateEndpointRule": "创建端点规则",
|
||||
"UpdateEndpointRule": "更新端点规则",
|
||||
"Index": "首页",
|
||||
"SystemSetting": "系统设置",
|
||||
"WorkBench": "工作台",
|
||||
@@ -677,8 +713,11 @@
|
||||
"TicketFlowUpdate": "更新审批流",
|
||||
"Accounts": "账号管理",
|
||||
"AssetAccount": "资产账号",
|
||||
"AssetHistoryAccount": "资产历史账号",
|
||||
"ApplicationAccount": "应用账号",
|
||||
"Ticket":"工单",
|
||||
"MyTickets": "我的申请",
|
||||
"AssignedTicketList": "待我审批",
|
||||
"SessionDetail": "会话详情",
|
||||
"CommandConfirm": "命令复核",
|
||||
"AdminUserCreate": "创建管理用户",
|
||||
@@ -783,6 +822,7 @@
|
||||
"Detail": "详情",
|
||||
"SessionOffline": "历史会话",
|
||||
"SessionOnline": "在线会话",
|
||||
"RecentSession": "最近会话",
|
||||
"Sessions": "会话管理",
|
||||
"Settings": "系统设置",
|
||||
"SystemUserCreate": "创建系统用户",
|
||||
@@ -899,19 +939,28 @@
|
||||
"UseProtocol": "使用协议",
|
||||
"SessionState": "会话状态",
|
||||
"Monitor": "监控",
|
||||
"XRDPNotSupport": "RDP 客户端会话, 暂不支持监控",
|
||||
"RazorNotSupport": "RDP 客户端会话, 暂不支持监控",
|
||||
"sessionMonitor": "监控",
|
||||
"TerminateTaskSendSuccessMsg": "终断任务已下发,请稍后刷新查看",
|
||||
"helpText": {
|
||||
"esUrl": "提示:如果有多台主机,请使用逗号 ( , ) 进行分割。(eg: http://www.jumpserver.a.com:3000,http://www.jumpserver.b.com:3000)",
|
||||
"esIndex": "es提供默认index:jumpserver",
|
||||
"esDocType": "es默认文档类型:command"
|
||||
"esIndex": "es 提供默认 index:jumpserver。如果开启按日期建立索引,那么输入的值会作为索引前缀",
|
||||
"esDocType": "es 默认文档类型:command"
|
||||
}
|
||||
},
|
||||
"setting": {
|
||||
"OAuth2LogoTip": "提示:认证服务提供商(建议图片大小为: 64px*64px)",
|
||||
"EndpointListHelpMessage": "服务端点是用户访问服务的地址(端口),当用户在连接资产时,会根据端点规则和资产标签选择服务端点,作为访问入口建立连接,实现分布式连接资产",
|
||||
"EndpointRuleListHelpMessage": "对于服务端点选择策略,目前支持两种:<br>1、根据端点规则指定端点(当前页面);<br>2、通过资产标签选择端点,标签名固定是 endpoint,值是端点的名称。<br>两种方式优先使用标签匹配,因为 IP 段可能冲突,标签方式是作为规则的补充存在的。",
|
||||
"EnableKoKoSSHHelpText": "开启时连接资产会显示 SSH Client 拉起方式",
|
||||
"SettingInEndpointHelpText": "在 系统设置 / 终端设置 / 服务端点 中配置服务地址和端口",
|
||||
"Feature": "功能",
|
||||
"AlibabaCloud": "阿里云",
|
||||
"TencentCloud": "腾讯云",
|
||||
"HuaweiCloud": "华为云",
|
||||
"SignChannelNum": "签名通道号",
|
||||
"AppEndpoint": "应用接入地址",
|
||||
"CMPP2": "CMPP v2.0",
|
||||
"Radius": "Radius",
|
||||
"VerifySignTmpl": "验证码短信模板",
|
||||
"Enable": "启用",
|
||||
@@ -969,9 +1018,10 @@
|
||||
"authLdapServerUri": "LDAP地址",
|
||||
"authLdapUserAttrMap": "用户属性映射",
|
||||
"authUserAttrMap": "用户属性映射",
|
||||
"authUserAttrMapHelpText": "映射关系 {idp:sp}",
|
||||
"SAML2": "SAML2",
|
||||
"enableSAML2Auth": "开启 SAML2 认证",
|
||||
"authUserAttrMapHelpText": "左侧的键为 JumpServer 用户属性,右侧的值为认证平台用户属性",
|
||||
"OAuth2": "OAuth2",
|
||||
"enableOAuth2Auth": "开启 OAuth2 认证",
|
||||
"tokenHTTPMethod": "Token 获取方法",
|
||||
"SAML2Auth": "SAML2 认证",
|
||||
"authSAML2Xml": "IDP metadata XML",
|
||||
"authSAML2MetadataUrl": "IDP metadata URL",
|
||||
@@ -1008,7 +1058,9 @@
|
||||
"LDAPServerInfo": "LDAP 服务器",
|
||||
"LDAPUser": "LDAP 用户",
|
||||
"helpText": {
|
||||
"TempPassword": "临时密码有效期为 300 秒,使用后立刻失效",
|
||||
"ApiKeyList": "使用api key签名请求头,每个请求的头部是不一样的, 请查阅使用文档",
|
||||
"ConnectionTokenList": "连接令牌是将身份验证和连接资产结合起来使用的一种认证信息,支持用户一键登录到资产,目前支持的组件包括:KoKo、Lion、Magnus、Razor 等",
|
||||
"authLdapSearchFilter": "可能的选项是(cn或uid或sAMAccountName=%(user)s)",
|
||||
"authLdapSearchOu": "使用|分隔各OU",
|
||||
"authLdapUserAttrMap": "用户属性映射代表怎样将LDAP中用户属性映射到jumpserver用户上,username, name,email 是jumpserver的属性",
|
||||
@@ -1085,6 +1137,8 @@
|
||||
"refreshLdapCache":"刷新Ldap缓存,请稍后",
|
||||
"LicenseExpired": "许可证已经过期",
|
||||
"LicenseWillBe": "许可证即将在 ",
|
||||
"LicenseReachedAssetAmountLimit": "资产数量已经超过许可证数量限制",
|
||||
"LicenseForTest": "测试用途许可证, 本许可证仅用于 开发、测试(PoC)和演示",
|
||||
"Expire": " 过期",
|
||||
"WeCom": "企业微信",
|
||||
"DingTalk": "钉钉",
|
||||
@@ -1094,7 +1148,14 @@
|
||||
"SMS": "短信设置",
|
||||
"feiShuTest": "测试",
|
||||
"setting": "设置",
|
||||
"SMSProvider": "短信服务商"
|
||||
"SMSProvider": "短信服务商",
|
||||
"SystemTools": "系统工具",
|
||||
"basicTools": "基本工具",
|
||||
"destinationIP": "目的地址",
|
||||
"testPort": "端口",
|
||||
"testTools": "测试",
|
||||
"testHelpText": "请输入目的地址进行测试",
|
||||
"SMSProvider": "短信服务商 / 协议"
|
||||
},
|
||||
"tickets": {
|
||||
"OneAssigneeType": "一级受理人类型",
|
||||
@@ -1116,8 +1177,8 @@
|
||||
"Assignee": "处理人",
|
||||
"Assignees": "待处理人",
|
||||
"Close": "关闭",
|
||||
"OpenStatus":"开启",
|
||||
"CloseStatus":"关闭",
|
||||
"OpenStatus":"审批中",
|
||||
"CloseStatus":"已完成",
|
||||
"Comment": "备注",
|
||||
"MyTickets": "我发起的",
|
||||
"RequestPerm":"授权申请",
|
||||
@@ -1126,6 +1187,10 @@
|
||||
"reply": "回复",
|
||||
"status": "状态",
|
||||
"title": "标题",
|
||||
"RelevantApp": "应用",
|
||||
"RelevantAsset": "资产",
|
||||
"RelevantCommand": "命令",
|
||||
"RelevantSystemUser": "系统用户",
|
||||
"action": "动作",
|
||||
"type": "类型",
|
||||
"user": "用户",
|
||||
@@ -1136,6 +1201,7 @@
|
||||
"OpenTicket": "创建工单",
|
||||
"HandleTicket": "处理工单",
|
||||
"FinishedTicket": "完成工单",
|
||||
"CheckViewAcceptor": "点击查看受理人",
|
||||
"IP": "IP",
|
||||
"Hostname": "主机名",
|
||||
"Asset": "资产",
|
||||
@@ -1194,7 +1260,7 @@
|
||||
"DatePasswordLastUpdated": "最后更新密码日期",
|
||||
"DatePasswordUpdated": "密码更新日期",
|
||||
"DescribeOfGuide": "欢迎使用JumpServer堡垒机系统,获取更多信息请点击",
|
||||
"Email": "邮件",
|
||||
"Email": "邮箱",
|
||||
"Phone": "手机号",
|
||||
"WeCom": "企业微信",
|
||||
"DingTalk": "钉钉",
|
||||
@@ -1304,12 +1370,14 @@
|
||||
"Sender": "发送人",
|
||||
"MarkAsRead": "标记已读",
|
||||
"OneClickRead": "当前已读",
|
||||
"AllClickRead": "全部已读",
|
||||
"OneClickReadMsg": "你确定要将当前信息标记为已读吗?",
|
||||
"NoUnreadMsg": "暂无未读消息",
|
||||
"SiteMessage": "站内信",
|
||||
"SMS": "短信"
|
||||
},
|
||||
"xpack": {
|
||||
"Images": "图片",
|
||||
"NavHelp": "导航栏链接",
|
||||
"helpDocument": "文档链接",
|
||||
"helpSupport": "支持链接",
|
||||
@@ -1402,13 +1470,20 @@
|
||||
"IPNetworkSegment": "IP网段",
|
||||
"Aliyun": "阿里云",
|
||||
"Qcloud": "腾讯云",
|
||||
"QcloudLighthouse": "腾讯云(轻量应用服务器)",
|
||||
"QingyunPrivatecloud": "青云私有云",
|
||||
"HuaweiPrivatecloud": "华为私有云",
|
||||
"CTYunPrivate": "天翼私有云",
|
||||
"OpenStack": "OpenStack",
|
||||
"GCP": "谷歌云",
|
||||
"FC": "Fusion Compute",
|
||||
"LAN": "局域网",
|
||||
"AWS_China": "AWS(中国)",
|
||||
"AWS_Int": "AWS(国际)",
|
||||
"HuaweiCloud": "华为云",
|
||||
"BaiduCloud": "百度云",
|
||||
"JDCloud": "京东云",
|
||||
"KingSoftCloud": "金山云",
|
||||
"Azure":"Azure(中国)",
|
||||
"Azure_Int": "Azure(国际)",
|
||||
"HostnameStrategy": "用于生成资产主机名。例如:1. 实例名称 (instanceDemo);2. 实例名称和部分IP(后两位) (instanceDemo-250.1)",
|
||||
@@ -1477,6 +1552,8 @@
|
||||
"InterfaceSettings": "界面设置",
|
||||
"License": "许可证",
|
||||
"ComponentMonitor": "组件监控",
|
||||
"Endpoint": "服务端点",
|
||||
"EndpointRule": "端点规则",
|
||||
"ServiceRatio": "组件负载统计",
|
||||
"LoadStatus":"组件状态",
|
||||
"NormalLoad":"正常",
|
||||
@@ -1488,7 +1565,7 @@
|
||||
"NoLicense": "暂无许可证",
|
||||
"Node": "节点",
|
||||
"Organization": {
|
||||
"AllOrganization": "所有组织",
|
||||
"AllOrganization": "组织列表",
|
||||
"OrganizationCreate": "创建组织",
|
||||
"OrganizationLists": "组织列表",
|
||||
"OrganizationDetail": "组织详情",
|
||||
@@ -1533,6 +1610,9 @@
|
||||
"technologyConsult": "技术咨询",
|
||||
"RegularlyPerform": "定期执行",
|
||||
"CyclePerform": "周期执行",
|
||||
"ModifyTheme": "修改主题",
|
||||
"ClassicGreen": "经典绿",
|
||||
"ChinaRed": "中国红",
|
||||
"HelpText": {
|
||||
"CrontabOfCreateUpdatePage": "例如:每周日 03:05 执行 <5 3 * * 0> <br/> 使用5位 Linux crontab 表达式 <分 时 日 月 星期> (<a href=\"https://tool.lu/crontab/\" target=\"_blank\">在线工具</a>) <br/> 如果同时设置了定期执行和周期执行,优先使用定期执行",
|
||||
"IntervalOfCreateUpdatePage": "单位:时",
|
||||
@@ -1 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1645509697274" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2361" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M867.046319 156.952658 156.952658 156.952658c-49.040926 0-88.317465 39.720653-88.317465 88.76158l-0.444115 532.570501c0 49.040926 39.720653 88.76158 88.76158 88.76158l710.09366 0c49.040926 0 88.76158-39.720653 88.76158-88.76158L955.807898 245.714238C955.808922 196.673311 916.087245 156.952658 867.046319 156.952658zM867.046319 334.476841l-355.047342 221.903949-355.047342-221.903949 0-88.76158 355.047342 221.903949 355.047342-221.903949L867.046319 334.476841z" p-id="2362"></path></svg>
|
||||
<svg t="1659513943772" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5163" width="200" height="200"><path d="M1024 146.285714v731.428572H0V146.285714h1024z m-149.942857 94.573715L512 602.88l-362.057143-362.057143L98.267429 292.571429 512 706.340571 925.769143 292.571429l-51.748572-51.712z" fill="#7c7e7f" p-id="5164"></path></svg>
|
||||
|
Before Width: | Height: | Size: 865 B After Width: | Height: | Size: 377 B |
@@ -1,11 +1,9 @@
|
||||
<template>
|
||||
<div class="footer" :style="style">
|
||||
<div class="pull-right">
|
||||
Version <strong> dev </strong> <span v-if="!publicSettings.XPACK_LICENSE_IS_VALID"> GPLv2. </span>
|
||||
</div>
|
||||
<div style="padding-left:20px;">
|
||||
{{ publicSettings.XPACK_LICENSE_INFO.corporation }}
|
||||
<div class="footer" :class="device" :style="style">
|
||||
<div class="pull-right version">
|
||||
Version <strong> dev </strong> <span v-if="!publicSettings.XPACK_LICENSE_IS_VALID"> GPLv3. </span>
|
||||
</div>
|
||||
<div>{{ corporation }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -27,7 +25,10 @@ export default {
|
||||
if (this.device === 'mobile') {
|
||||
return ''
|
||||
}
|
||||
return this.sidebar.opened ? ('margin-left: 210px;') : ('margin-left: 54px')
|
||||
return this.sidebar.opened ? ('margin-left: 220px;') : ('margin-left: 54px')
|
||||
},
|
||||
corporation() {
|
||||
return this.publicSettings.XPACK_LICENSE_INFO.corporation
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,9 +39,9 @@ export default {
|
||||
height: 35px !important;
|
||||
}
|
||||
.pull-right {
|
||||
float: right!important;
|
||||
float: right
|
||||
}
|
||||
.footer{
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
@@ -55,4 +56,11 @@ export default {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
.mobile.footer {
|
||||
text-align: center;
|
||||
}
|
||||
.mobile.footer .pull-right{
|
||||
float: none;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
<script>
|
||||
import AutoDataForm from '@/components/AutoDataForm'
|
||||
import { getUpdateObjURL } from '@/utils/common'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
|
||||
export default {
|
||||
name: 'GenericCreateUpdateForm',
|
||||
components: {
|
||||
@@ -87,7 +89,7 @@ export default {
|
||||
createSuccessNextRoute: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
const routeName = this.$route.name.replace('Create', 'List')
|
||||
const routeName = this.$route.name?.replace('Create', 'List')
|
||||
return { name: routeName }
|
||||
}
|
||||
},
|
||||
@@ -95,15 +97,14 @@ export default {
|
||||
updateSuccessNextRoute: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
const routeName = this.$route.name.replace('Update', 'List')
|
||||
const routeName = this.$route.name?.replace('Update', 'List')
|
||||
return { name: routeName }
|
||||
}
|
||||
},
|
||||
objectDetailRoute: {
|
||||
type: Object,
|
||||
default: function() {
|
||||
const routeName = this.$route.name
|
||||
.replace('Update', 'Detail')
|
||||
const routeName = this.$route.name?.replace('Update', 'Detail')
|
||||
.replace('Create', 'Detail')
|
||||
return { name: routeName }
|
||||
}
|
||||
@@ -136,6 +137,16 @@ export default {
|
||||
if (params.id) {
|
||||
url = getUpdateObjURL(url, params.id)
|
||||
}
|
||||
|
||||
const clone_from = this.$route.query['clone_from']
|
||||
const query = clone_from ? `clone_from=${clone_from}` : ''
|
||||
if (query) {
|
||||
if (url.indexOf('?') === -1) {
|
||||
url = `${url}?${query}`
|
||||
} else {
|
||||
url = `${url}&${query}`
|
||||
}
|
||||
}
|
||||
return url
|
||||
}
|
||||
},
|
||||
@@ -218,6 +229,14 @@ export default {
|
||||
hasDetailInMsg: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
encryptedFields: {
|
||||
type: Array,
|
||||
default: () => ['password', 'token', 'private_key']
|
||||
},
|
||||
needGetObjectDetail: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -265,10 +284,27 @@ export default {
|
||||
isUpdateMethod() {
|
||||
return ['put', 'patch'].indexOf(this.method.toLowerCase()) > -1
|
||||
},
|
||||
encryptFields(values) {
|
||||
// 批量提交,clean 后可能是个数组
|
||||
if (values instanceof Array) {
|
||||
return values.map((item) => this.encryptFields(item))
|
||||
}
|
||||
values = { ...values }
|
||||
for (const field of this.encryptedFields) {
|
||||
let value = values[field]
|
||||
if (!value || typeof value !== 'string') {
|
||||
continue
|
||||
}
|
||||
value = encryptPassword(value)
|
||||
values[field] = value
|
||||
}
|
||||
return values
|
||||
},
|
||||
handleSubmit(values, formName, addContinue) {
|
||||
let handler = this.onSubmit || this.defaultOnSubmit
|
||||
handler = handler.bind(this)
|
||||
values = this.cleanFormValue(values)
|
||||
values = this.encryptFields(values)
|
||||
return handler(values, formName, addContinue)
|
||||
},
|
||||
defaultOnSubmit(validValues, formName, addContinue) {
|
||||
@@ -280,7 +316,7 @@ export default {
|
||||
},
|
||||
async getFormValue() {
|
||||
const cloneFrom = this.$route.query['clone_from']
|
||||
if (!this.isUpdateMethod() && !cloneFrom) {
|
||||
if ((!this.isUpdateMethod() && !cloneFrom) || !this.needGetObjectDetail) {
|
||||
return Object.assign(this.form, this.initial)
|
||||
}
|
||||
let object = this.object
|
||||
@@ -290,9 +326,9 @@ export default {
|
||||
const url = `${curUrl}${cloneFrom}/${query ? ('?' + query) : ''}`
|
||||
object = await this.getObjectDetail(url)
|
||||
if (object['name']) {
|
||||
object.name = this.$t('common.cloneFrom') + ' ' + object.name
|
||||
object.name = this.$t('common.cloneFrom') + object.name
|
||||
} else if (object['hostname']) {
|
||||
object.hostname = this.$t('common.cloneFrom') + ' ' + object.hostname
|
||||
object.hostname = this.$t('common.cloneFrom') + object.hostname
|
||||
}
|
||||
} else {
|
||||
object = await this.getObjectDetail(this.iUrl)
|
||||
|
||||
@@ -197,6 +197,10 @@ export default {
|
||||
if (typeof route === 'string') {
|
||||
route = { name: route, params: {}}
|
||||
}
|
||||
route = {
|
||||
...route,
|
||||
query: this.$route.query || {}
|
||||
}
|
||||
route.params.id = id
|
||||
this.$router.push(route)
|
||||
},
|
||||
|
||||
@@ -7,15 +7,22 @@
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-row :gutter="20">
|
||||
<el-col :md="4" :sm="24">
|
||||
<div class="select-prop-label">
|
||||
<label>{{ selectPropertiesLabel }}</label>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-col :md="18" :sm="24">
|
||||
<el-checkbox-group v-model="checkedFields" @change="handleCheckedFieldsChange">
|
||||
<el-checkbox v-for="(value, name) in iFormSetting.fieldsMeta" :key="name" :checked="true" :label="name">{{ value.label }}</el-checkbox>
|
||||
<el-checkbox
|
||||
v-for="(value, name) in iFormSetting.fieldsMeta"
|
||||
:key="name"
|
||||
:checked="true"
|
||||
:label="name"
|
||||
>
|
||||
{{ value.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -90,12 +97,13 @@ export default {
|
||||
getDefaultFormSetting() {
|
||||
const vm = this
|
||||
return {
|
||||
submitMethod: () => 'post',
|
||||
cleanFormValue: function(value) {
|
||||
needGetObjectDetail: false,
|
||||
submitMethod: () => 'patch',
|
||||
cleanFormValue: (value) => {
|
||||
const filterValue = {}
|
||||
Object.keys(value).filter((key) => vm.checkedFields.includes(key)).forEach((key) => {
|
||||
filterValue[key] = value[key]
|
||||
})
|
||||
Object.keys(value)
|
||||
.filter((key) => vm.checkedFields?.includes(key))
|
||||
.forEach((key) => { filterValue[key] = value[key] })
|
||||
const formValue = []
|
||||
let object = {}
|
||||
for (const row of vm.selectedRows) {
|
||||
|
||||
@@ -7,9 +7,21 @@
|
||||
<i class="el-icon-arrow-down el-icon--right" />
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-user" command="profile">{{ $t('common.nav.Profile') }}</el-dropdown-item>
|
||||
<el-dropdown-item v-if="$hasPerm('authentication.view_accesskey')" icon="el-icon-key" command="apiKey">{{ $t('common.nav.APIKey') }}</el-dropdown-item>
|
||||
<el-dropdown-item divided command="logout"><svg-icon icon-class="logout" style="margin-right: 4px" />{{ $t('common.nav.Logout') }}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-user" command="profile">
|
||||
{{ $t('common.nav.Profile') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="$hasPerm('authentication.view_accesskey')" icon="el-icon-key" command="apiKey">
|
||||
{{ $t('common.nav.APIKey') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="$store.getters.publicSettings.AUTH_TEMP_TOKEN && $hasPerm('authentication.view_temptoken')" icon="el-icon-magic-stick" command="tempPassword">
|
||||
{{ $t('common.nav.TempPassword') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="$hasPerm('authentication.view_connectiontoken')" icon="el-icon-place" command="connectionToken">
|
||||
{{ $t('common.nav.ConnectionToken') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided command="logout"><svg-icon icon-class="logout" style="margin-right: 4px" />
|
||||
{{ $t('common.nav.Logout') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
@@ -28,11 +40,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'currentUser',
|
||||
'currentRole',
|
||||
'currentOrgRoles',
|
||||
'orgs',
|
||||
'currentOrgPerms'
|
||||
'currentUser'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
@@ -50,6 +58,11 @@ export default {
|
||||
case 'apiKey':
|
||||
this.$router.push('/profile/key')
|
||||
break
|
||||
case 'tempPassword':
|
||||
this.$router.push('/profile/temp-password')
|
||||
break
|
||||
case 'connectionToken':
|
||||
this.$router.push('/profile/connection-token')
|
||||
}
|
||||
},
|
||||
logout() {
|
||||
@@ -60,9 +73,12 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.header-avatar {
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
height: 24px;
|
||||
width: 24px;
|
||||
margin-right: 5px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.mobile .header-avatar {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="docs">{{ $t('common.nav.Docs') }}</el-dropdown-item>
|
||||
<el-dropdown-item command="support">{{ $t('common.nav.Support') }}</el-dropdown-item>
|
||||
<el-dropdown-item command="toolsDownload">{{ $t('common.nav.Download') }}</el-dropdown-item>
|
||||
<el-dropdown-item v-if="!hasLicence" command="enterprise">{{ $t('common.nav.EnterpriseEdition') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
@@ -43,6 +44,9 @@ export default {
|
||||
case 'enterprise':
|
||||
window.open('https://jumpserver.org/enterprise.html', '_blank')
|
||||
break
|
||||
case 'toolsDownload':
|
||||
window.open('/core/download/', '_blank')
|
||||
break
|
||||
default:
|
||||
window.open(this.URLSite.HELP_DOCUMENT_URL, '_blank')
|
||||
break
|
||||
|
||||
@@ -25,6 +25,11 @@ export default {
|
||||
title: '中文(简体)',
|
||||
code: 'cn',
|
||||
cookieCode: 'zh-hans' // cookie code是为了让后端知道当前语言
|
||||
},
|
||||
{
|
||||
title: '日本語',
|
||||
code: 'ja',
|
||||
cookieCode: 'ja' // cookie code是为了让后端知道当前语言
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -58,6 +63,8 @@ export default {
|
||||
changeMomentLang() {
|
||||
if (this.currentLang.code.indexOf('en') > -1) {
|
||||
this.$moment.locale('en')
|
||||
} else if (this.currentLang.code.indexOf('ja') > -1) {
|
||||
this.$moment.locale('ja')
|
||||
} else {
|
||||
this.$moment.locale('zh-cn')
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-select
|
||||
:value="currentOrg.id"
|
||||
:value="currentOrgId"
|
||||
class="org-select organization"
|
||||
filterable
|
||||
:placeholder="$t('common.Select')"
|
||||
@@ -11,7 +11,7 @@
|
||||
</template>
|
||||
|
||||
<el-option-group
|
||||
v-for="group in orgOption"
|
||||
v-for="group in orgGroups"
|
||||
:key="group.label"
|
||||
:label="group.label"
|
||||
class="option-group"
|
||||
@@ -29,7 +29,6 @@
|
||||
</span>
|
||||
<span>{{ item.name }}</span>
|
||||
</el-option>
|
||||
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</template>
|
||||
@@ -55,15 +54,10 @@ export default {
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'currentOrg',
|
||||
'currentRole',
|
||||
'orgs'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
'usingOrgs',
|
||||
'currentViewRoute'
|
||||
]),
|
||||
orgActionsGroup() {
|
||||
const orgActions = {
|
||||
label: this.$t('xpack.Organization.OrganizationList'),
|
||||
options: [
|
||||
@@ -82,21 +76,44 @@ export default {
|
||||
]
|
||||
}
|
||||
const hasPerms = this.$hasPerm('orgs.view_organization | orgs.add_organization')
|
||||
this.orgOption = [
|
||||
(hasPerms && orgActions),
|
||||
{
|
||||
label: this.$t('xpack.Organization.AllOrganization'),
|
||||
options: this.orgs
|
||||
}
|
||||
const isConsole = this.currentViewRoute.name === 'console'
|
||||
return hasPerms && isConsole ? orgActions : {}
|
||||
},
|
||||
orgChoicesGroup() {
|
||||
return {
|
||||
label: this.$t('xpack.Organization.AllOrganization'),
|
||||
options: this.usingOrgs
|
||||
}
|
||||
},
|
||||
orgGroups() {
|
||||
return [
|
||||
this.orgActionsGroup,
|
||||
this.orgChoicesGroup
|
||||
]
|
||||
},
|
||||
currentOrgId() {
|
||||
const usingOrgIds = this.usingOrgs.map(o => o.id)
|
||||
let currentOrgId = this.currentOrg.id
|
||||
const find = usingOrgIds.indexOf(currentOrgId) > -1
|
||||
if (!find) {
|
||||
currentOrgId = null
|
||||
}
|
||||
return currentOrgId
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeOrg(orgId) {
|
||||
if (orgId === 'create') {
|
||||
this.$router.push({ name: 'OrganizationCreate' })
|
||||
} else if (orgId === 'list') {
|
||||
this.$router.push({ name: 'OrganizationList' })
|
||||
} else {
|
||||
orgUtil.changeOrg(orgId)
|
||||
const org = this.usingOrgs.find(item => item.id === orgId)
|
||||
|
||||
switch (orgId) {
|
||||
case 'create':
|
||||
this.$router.push({ name: 'OrganizationCreate' })
|
||||
break
|
||||
case 'list':
|
||||
this.$router.push({ name: 'OrganizationList' })
|
||||
break
|
||||
default:
|
||||
orgUtil.changeOrg(org)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +121,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '~@/styles/element-variables.scss';
|
||||
@import '~@/styles/variables.scss';
|
||||
|
||||
.org-select {
|
||||
padding: 0 10px 0 18px;
|
||||
@@ -146,25 +163,25 @@ export default {
|
||||
background-color: rgba(144, 147, 152, .5);
|
||||
}
|
||||
|
||||
& > > > .el-input__prefix {
|
||||
&>>> .el-input__prefix {
|
||||
left: 8px
|
||||
}
|
||||
|
||||
& > > > .el-input--prefix .el-input__inner {
|
||||
&>>> .el-input--prefix .el-input__inner {
|
||||
line-height: 35px !important;
|
||||
height: 35px !important;
|
||||
}
|
||||
|
||||
& > > > .fa-sitemap {
|
||||
&>>> .fa-sitemap {
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
& > > > .el-input__icon {
|
||||
color: #606266;
|
||||
&>>> .el-input__icon {
|
||||
color: #606266!important;
|
||||
}
|
||||
}
|
||||
|
||||
.option-group > > > .el-select-group__title {
|
||||
.option-group >>> .el-select-group__title {
|
||||
color: #909399 !important;
|
||||
padding-left: 15px;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
</el-link>
|
||||
</el-badge>
|
||||
<el-drawer
|
||||
class="drawer"
|
||||
:visible.sync="show"
|
||||
:before-close="handleClose"
|
||||
:modal="false"
|
||||
@@ -17,7 +18,7 @@
|
||||
<div slot="title">
|
||||
<span>{{ $t('notifications.SiteMessage') }}</span>
|
||||
<div v-if="unreadMsgCount !== 0" class="msg-list-all-read-btn" @click.stop="oneClickRead(messages)">
|
||||
<a> {{ $t('notifications.OneClickRead') }}</a>
|
||||
<a style="vertical-align: sub;"> {{ $t('notifications.AllClickRead') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="unreadMsgCount !== 0" class="msg-list">
|
||||
@@ -30,18 +31,20 @@
|
||||
@mouseleave="hoverMsgId = ''"
|
||||
@click="showMsgDetail(msg)"
|
||||
>
|
||||
<div class="msg-item-head">
|
||||
<span class="msg-item-head-type">
|
||||
<el-row :gutter="10" class="msg-item-head">
|
||||
<el-col :span="15" class="msg-item-head-type">
|
||||
<i :class="msg['has_read'] ? 'fa-envelope-open-o' : 'fa-envelope'" class="fa msg-icon" />
|
||||
{{ msg.subject }}
|
||||
</span>
|
||||
<span v-if="hoverMsgId !== msg.id || msg['has_read']" class="msg-item-head-time">
|
||||
{{ formatDate(msg.date_created) }}
|
||||
</span>
|
||||
<div v-else class="msg-item-read-btn" @click.stop="markAsRead([msg])">
|
||||
<a>{{ $t('notifications.MarkAsRead') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<span v-if="hoverMsgId !== msg.id || msg['has_read']" class="msg-item-head-time">
|
||||
{{ formatDate(msg.date_created) }}
|
||||
</span>
|
||||
<span v-else class="msg-item-read-btn" @click.stop="markAsRead([msg])">
|
||||
<a>{{ $t('notifications.MarkAsRead') }}</a>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="msg-item-txt">
|
||||
<span v-html="msg.message" />
|
||||
</div>
|
||||
@@ -95,7 +98,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
width() {
|
||||
return this.$store.state.app.device === 'mobile' ? '70%' : '20%'
|
||||
return this.$store.state.app.device === 'mobile' ? '70%' : '380px'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -137,13 +140,22 @@ export default {
|
||||
confirmButtonClass: 'el-button--danger',
|
||||
beforeClose: async(action, instance, done) => {
|
||||
if (action !== 'confirm') return done()
|
||||
this.markAsRead(msgs)
|
||||
this.markAsReadAll(msgs)
|
||||
done()
|
||||
}
|
||||
}).catch(() => {
|
||||
/* 取消*/
|
||||
})
|
||||
},
|
||||
markAsReadAll(msgs) {
|
||||
const url = `/api/v1/notifications/site-message/mark-as-read-all/`
|
||||
this.$axios.patch(url, {}).then(res => {
|
||||
this.msgDetailVisible = false
|
||||
this.getMessages()
|
||||
}).catch(err => {
|
||||
this.$message(err.detail)
|
||||
})
|
||||
},
|
||||
markAsRead(msgs) {
|
||||
const url = `/api/v1/notifications/site-message/mark-as-read/`
|
||||
const msgIds = []
|
||||
@@ -192,6 +204,9 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.drawer {
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
.el-badge ::v-deep .el-badge__content.is-fixed{
|
||||
top:10px;
|
||||
}
|
||||
@@ -257,7 +272,7 @@ export default {
|
||||
|
||||
.msg-item-head-type {
|
||||
float: left;
|
||||
width: 220px;
|
||||
//width: 220px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align: middle;
|
||||
@@ -294,6 +309,9 @@ export default {
|
||||
.msg-detail-txt {
|
||||
margin-bottom: 20px;
|
||||
line-height: 25px;
|
||||
&>>> a {
|
||||
color: var(--color-success)!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,35 +1,45 @@
|
||||
<template>
|
||||
<el-menu
|
||||
default-active="activeIndex"
|
||||
class="menu-main"
|
||||
mode="horizontal"
|
||||
@select="handleSelectView"
|
||||
<el-tooltip
|
||||
v-model="iShowTip"
|
||||
:manual="true"
|
||||
:content="tipText"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<el-submenu
|
||||
index="2"
|
||||
popper-class="view-switcher"
|
||||
<el-menu
|
||||
:default-active="currentViewRoute.name"
|
||||
class="menu-main"
|
||||
:class="mode"
|
||||
:mode="mode"
|
||||
@select="handleSelectView"
|
||||
>
|
||||
<template slot="title">
|
||||
<span class="title-label">
|
||||
<i class="fa fa-bars" />
|
||||
<span>{{ $t('common.nav.View') }}</span>
|
||||
</span>
|
||||
</template>
|
||||
<el-menu-item
|
||||
v-for="view of views"
|
||||
:key="view.name"
|
||||
v-perms="view.perms"
|
||||
:index="view.name"
|
||||
<el-submenu
|
||||
index="2"
|
||||
popper-class="view-switcher"
|
||||
>
|
||||
<i class="icons" :class="view.meta.icon" />
|
||||
<span slot="title" class="icons-title">{{ view.meta.title }}</span>
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
<template slot="title">
|
||||
<span class="title-label">
|
||||
<i class="fa fa-bars" />
|
||||
<span>{{ $t('common.nav.View') }}</span>
|
||||
</span>
|
||||
</template>
|
||||
<el-menu-item
|
||||
v-for="view of views"
|
||||
:key="view.name"
|
||||
:index="view.name"
|
||||
>
|
||||
<i v-if="mode === 'horizontal'" class="icons" :class="view.meta.icon" />
|
||||
<span slot="title" class="icons-title">{{ view.meta.title }}</span>
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import store from '@/store'
|
||||
|
||||
export default {
|
||||
name: 'ViewSwitcher',
|
||||
@@ -37,19 +47,31 @@ export default {
|
||||
showTitle: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'horizontal'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
tipText: this.$t('common.ChangeViewHelpText'),
|
||||
showTip: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'currentViewRoute'
|
||||
'currentViewRoute',
|
||||
'viewRoutes'
|
||||
]),
|
||||
views() {
|
||||
return this.$store.state.permission.addRoutes.filter(
|
||||
item => item.meta?.showNavSwitcher
|
||||
)
|
||||
return this.viewRoutes.filter((item) => {
|
||||
let show = item.meta?.showNavSwitcher
|
||||
if (typeof show === 'function') {
|
||||
show = show()
|
||||
}
|
||||
return show
|
||||
})
|
||||
},
|
||||
viewsMapper() {
|
||||
const mapper = {}
|
||||
@@ -60,13 +82,48 @@ export default {
|
||||
},
|
||||
currentView() {
|
||||
return this.viewsMapper[this.currentViewRoute.name]
|
||||
},
|
||||
tipHasRead: {
|
||||
set(val) {
|
||||
localStorage.setItem('viewSwitcherTip', val)
|
||||
},
|
||||
get() {
|
||||
return localStorage.getItem('viewSwitcherTip')
|
||||
}
|
||||
},
|
||||
iShowTip: {
|
||||
get() {
|
||||
if (this.mode !== 'horizontal') {
|
||||
return false
|
||||
}
|
||||
if (this.views.length < 1) {
|
||||
return false
|
||||
}
|
||||
if (this.tipHasRead) {
|
||||
return false
|
||||
}
|
||||
return this.showTip
|
||||
},
|
||||
set(val) {
|
||||
this.showTip = val
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile/i.test(navigator.userAgent)) {
|
||||
this.showTip = false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSelectView(key, keyPath) {
|
||||
async handleSelectView(key, keyPath) {
|
||||
const routeName = this.viewsMapper[key] || '/'
|
||||
localStorage.setItem('PreView', key)
|
||||
// Next 之前要重置 init 状态,否则这些路由守卫就不走了
|
||||
await store.dispatch('app/reset')
|
||||
if (!this.tipHasRead) {
|
||||
this.tipHasRead = '1'
|
||||
this.iShowTip = false
|
||||
}
|
||||
this.$router.push(routeName)
|
||||
}
|
||||
}
|
||||
@@ -96,7 +153,6 @@ export default {
|
||||
padding: 10px 10px;
|
||||
text-align: center;
|
||||
height: 70px;
|
||||
width: 70px;
|
||||
&:hover {
|
||||
color: inherit;
|
||||
i {
|
||||
@@ -104,10 +160,10 @@ export default {
|
||||
}
|
||||
}
|
||||
&:first-child {
|
||||
margin-left: 20px;
|
||||
margin-left: 16px;
|
||||
}
|
||||
&:last-child {
|
||||
margin-right: 20px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
}
|
||||
.el-submenu.is-opened {
|
||||
@@ -131,4 +187,7 @@ export default {
|
||||
.el-menu-item.is-active {
|
||||
font-weight: bold;
|
||||
}
|
||||
.menu-main.mobile-view-switch >>> .el-submenu__icon-arrow {
|
||||
right: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<SystemSetting />
|
||||
</el-tooltip>
|
||||
</li>
|
||||
<li v-if="this.$hasLicense() && this.$hasPerm('tickets.view_ticket')" class="header-item header-hover">
|
||||
<li v-if="ticketsEnabled" class="header-item header-hover">
|
||||
<Tickets />
|
||||
</li>
|
||||
<li class="header-item active-menu">
|
||||
@@ -69,7 +69,12 @@ export default {
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar', 'publicSettings', 'currentOrgRoles', 'currentViewRoute'
|
||||
])
|
||||
]),
|
||||
ticketsEnabled() {
|
||||
return this.publicSettings['TICKETS_ENABLED'] &&
|
||||
this.$hasLicense() &&
|
||||
this.$hasPerm('tickets.view_ticket')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleSideBar() {
|
||||
@@ -82,20 +87,27 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/styles/variables.scss";
|
||||
$header-height: 55px;
|
||||
.navbar {
|
||||
position: relative;
|
||||
height: 55px;
|
||||
height: $header-height;
|
||||
line-height: $header-height;
|
||||
overflow: hidden;
|
||||
background: #f3f3f4;
|
||||
|
||||
.navbar-left {
|
||||
float: left;
|
||||
.left-item {
|
||||
line-height: 55px;
|
||||
line-height: $header-height;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
|
||||
&>>> .el-submenu__title {
|
||||
font-family: "open sans","Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
padding: 0 14px;
|
||||
padding: 0 8px;
|
||||
line-height: $header-height;
|
||||
height: $header-height;
|
||||
}
|
||||
&>>> .org-select {
|
||||
padding: 0;
|
||||
@@ -105,15 +117,17 @@ export default {
|
||||
.navbar-right {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
|
||||
height: 55px;
|
||||
line-height: 55px;
|
||||
.header-hover {
|
||||
line-height: 56px!important;
|
||||
&:hover {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
}
|
||||
|
||||
.header-item {
|
||||
line-height: 55px;
|
||||
line-height: $header-height;
|
||||
display: inline-block;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
@@ -151,8 +165,8 @@ export default {
|
||||
padding: 0 10px!important;
|
||||
line-height: 30px;
|
||||
border-radius: 4px;
|
||||
border-color: #1ab394;
|
||||
background-color: #1ab394;
|
||||
border-color: $--color-primary;
|
||||
background-color: $--color-primary;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
transition: .2s;
|
||||
|
||||
@@ -31,10 +31,10 @@ export default {
|
||||
]),
|
||||
// eslint-disable-next-line vue/return-in-computed-property
|
||||
logoTextSrc() {
|
||||
return this.publicSettings.LOGO_URLS.logo_index
|
||||
return this.publicSettings['INTERFACE']['logo_index']
|
||||
},
|
||||
logoSrc() {
|
||||
return this.publicSettings.LOGO_URLS.logo_logout
|
||||
return this.publicSettings['INTERFACE']['logo_logout']
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -4,15 +4,28 @@
|
||||
<div class="nav-logo">
|
||||
<Logo v-if="showLogo" :collapse="isCollapse" />
|
||||
</div>
|
||||
<div class="nav-title" :class="{'collapsed': isCollapse}">
|
||||
{{ isTitle }}
|
||||
</div>
|
||||
<div class="active-mobile">
|
||||
<ViewSwitcher />
|
||||
<Organization class="organization" />
|
||||
<ViewSwitcher mode="vertical" class="mobile-view-switch" />
|
||||
<Organization v-if="$hasLicense()" class="organization" />
|
||||
</div>
|
||||
<div class="nav-title" :class="{'collapsed': isCollapse}">
|
||||
<svg-icon
|
||||
v-if="isRouteMeta.view === 'settings'"
|
||||
icon-class="setting-fill"
|
||||
style="margin-right: 0;"
|
||||
/>
|
||||
<i
|
||||
v-else
|
||||
class="fa"
|
||||
:class="isRouteMeta.icon"
|
||||
/>
|
||||
<span
|
||||
v-show="!isCollapse"
|
||||
style="margin-left: 3px;"
|
||||
>{{ isRouteMeta.title || '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<el-scrollbar class="menu-wrap" wrap-class="scrollbar-wrapper">
|
||||
<el-menu
|
||||
class="left-menu"
|
||||
:default-active="activeMenu"
|
||||
@@ -45,10 +58,10 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
import Logo from './Logo'
|
||||
import SidebarItem from './SidebarItem'
|
||||
import variables from '@/styles/variables.scss'
|
||||
import Hamburger from '@/components/Hamburger'
|
||||
import ViewSwitcher from '../NavHeader/ViewSwitcher'
|
||||
import Organization from '../NavHeader/Organization'
|
||||
import variables from '@/styles/variables.scss'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -98,8 +111,8 @@ export default {
|
||||
isCollapse() {
|
||||
return !this.sidebar.opened
|
||||
},
|
||||
isTitle() {
|
||||
return this.currentViewRoute.meta?.title || ''
|
||||
isRouteMeta() {
|
||||
return this.currentViewRoute.meta || {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -110,8 +123,10 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/styles/variables.scss";
|
||||
.nav-header {
|
||||
background-image: url('~@/assets/img/header-profile.png');
|
||||
overflow: hidden;
|
||||
background: $subMenuBg url('~@/assets/img/header-profile.png') no-repeat center center;
|
||||
}
|
||||
|
||||
.nav-logo {
|
||||
@@ -120,16 +135,17 @@ export default {
|
||||
|
||||
.nav-title {
|
||||
box-sizing: border-box;
|
||||
height: 55px;
|
||||
padding: 17px 0 17px 22px;
|
||||
margin: 17px 0 17px 20px;
|
||||
font-size: 15px;
|
||||
font-weight: 460;
|
||||
color: #fff;
|
||||
//background: #293846;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collapsed {
|
||||
padding: 6px 12px!important;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.organizations {
|
||||
@@ -140,7 +156,7 @@ export default {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background-color: #293846;
|
||||
background-color: $subMenuBg;
|
||||
|
||||
.toggle-bar {
|
||||
width: 55px;
|
||||
@@ -155,7 +171,7 @@ export default {
|
||||
}
|
||||
|
||||
.toggle-bar:hover {
|
||||
background-color: rgb(59, 76, 91);
|
||||
background-color: $subMenuHover;
|
||||
}
|
||||
|
||||
.hamburger-container {
|
||||
@@ -174,6 +190,9 @@ export default {
|
||||
&>>> .menu-main {
|
||||
margin-left: -10px;
|
||||
}
|
||||
&>>> .title-label {
|
||||
color: white !important;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 992px) {
|
||||
.active-mobile {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<template>
|
||||
<div v-if="!loading">
|
||||
<el-alert v-if="isExpire" type="error">
|
||||
{{ isExpire }}
|
||||
<el-alert v-if="licenseMsg" type="error">
|
||||
{{ licenseMsg }} !
|
||||
<router-link :to="{ name: 'License' }" style="padding-left: 5px">
|
||||
{{ $t('common.View') }} <i class="fa fa-external-link" />
|
||||
</router-link>
|
||||
</el-alert>
|
||||
</div>
|
||||
</template>
|
||||
@@ -11,7 +14,7 @@ import { toSafeLocalDateStr } from '@/utils/common'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'LicenseExpireTip',
|
||||
name: 'LicenseRelatedTip',
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
@@ -23,8 +26,15 @@ export default {
|
||||
'publicSettings',
|
||||
'currentUser'
|
||||
]),
|
||||
isExpire() {
|
||||
if (!this.publicSettings.XPACK_ENABLED || this.currentUser.role !== 'Admin') {
|
||||
licenseMsg() {
|
||||
if (this.expireMsg) {
|
||||
return this.expireMsg
|
||||
} else {
|
||||
return this.reachLimitsMsg
|
||||
}
|
||||
},
|
||||
expireMsg() {
|
||||
if (!this.publicSettings['XPACK_ENABLED'] || !this.$hasPerm('settings.change_license')) {
|
||||
return false
|
||||
}
|
||||
const intervalDays = this.getIntervalDays(this.licenseData.date_expired)
|
||||
@@ -35,10 +45,22 @@ export default {
|
||||
return this.$t('setting.LicenseWillBe') + this.licenseData.date_expired + this.$t('setting.Expire')
|
||||
}
|
||||
return false
|
||||
},
|
||||
reachLimitsMsg() {
|
||||
if (!this.publicSettings['XPACK_ENABLED'] || !this.$hasPerm('settings.change_license')) {
|
||||
return false
|
||||
}
|
||||
if (this.licenseData.corporation === 'FIT2CLOUD') {
|
||||
return this.$t('setting.LicenseForTest')
|
||||
}
|
||||
if (this.licenseData['current_asset_count'] > this.licenseData.asset_count) {
|
||||
return this.$t('setting.LicenseReachedAssetAmountLimit')
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.publicSettings.XPACK_ENABLED && this.currentUser.role === 'Admin') {
|
||||
if (this.publicSettings['XPACK_ENABLED'] && this.$hasPerm('settings.change_license')) {
|
||||
this.$axios.get('/api/v1/xpack/license/detail').then(res => {
|
||||
this.licenseData = res
|
||||
}).finally(() => {
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.wrapper-content {
|
||||
padding: 20px 25px 40px;
|
||||
padding: 20px 25px 10px;
|
||||
}
|
||||
|
||||
.wrapper-content >>> .el-alert {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<slot name="globalNotification">
|
||||
<LicenseExpireTip />
|
||||
<LicenseRelatedTip />
|
||||
<PasswordExpireTip />
|
||||
</slot>
|
||||
<div class="page-heading">
|
||||
@@ -21,12 +21,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LicenseExpireTip from '@/layout/components/Page/LicenseExpireTip'
|
||||
import LicenseRelatedTip from '@/layout/components/Page/LicenseRelatedTip'
|
||||
import PasswordExpireTip from '@/layout/components/Page/PasswordExpireTip'
|
||||
export default {
|
||||
name: 'PageHeading',
|
||||
components: {
|
||||
LicenseExpireTip,
|
||||
LicenseRelatedTip,
|
||||
PasswordExpireTip
|
||||
},
|
||||
props: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-alert v-if="isExpire" type="error">
|
||||
{{ isExpire }}
|
||||
<el-alert v-if="expireMsg" type="error">
|
||||
{{ expireMsg }}
|
||||
</el-alert>
|
||||
</div>
|
||||
</template>
|
||||
@@ -22,7 +22,7 @@ export default {
|
||||
'publicSettings',
|
||||
'currentUser'
|
||||
]),
|
||||
isExpire() {
|
||||
expireMsg() {
|
||||
// 用户来源不是Local时不显示密码过期提示
|
||||
if (this.currentUser.source !== 'local') {
|
||||
return false
|
||||
@@ -33,7 +33,9 @@ export default {
|
||||
return this.$t('users.passwordExpired')
|
||||
}
|
||||
if (securityPasswordExpirationTime - intervalTime <= 5) {
|
||||
return this.$t('users.passwordWillExpiredPrefixMsg') + (securityPasswordExpirationTime - intervalTime) + this.$t('users.passwordWillExpiredSuffixMsg')
|
||||
return this.$t('users.passwordWillExpiredPrefixMsg') +
|
||||
(securityPasswordExpirationTime - intervalTime) +
|
||||
this.$t('users.passwordWillExpiredSuffixMsg')
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
</template>
|
||||
</PageHeading>
|
||||
<PageContent>
|
||||
<el-alert v-if="helpMessage" type="success"> <span v-html="helpMessage" /> </el-alert>
|
||||
<el-alert v-if="helpMessage" type="success">
|
||||
<span class="announcement-main" v-html="helpMessage" />
|
||||
</el-alert>
|
||||
<slot />
|
||||
</PageContent>
|
||||
</div>
|
||||
@@ -34,7 +36,6 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
iTitle() {
|
||||
// return ''
|
||||
return this.title || this.$route.meta.title
|
||||
}
|
||||
}
|
||||
@@ -42,6 +43,10 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
height: calc(100vh - 55px - 41px);
|
||||
overflow: auto;
|
||||
}
|
||||
@media print {
|
||||
.disabled-when-print{
|
||||
display: none;
|
||||
@@ -52,5 +57,9 @@ export default {
|
||||
.print-margin{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.announcement-main {
|
||||
word-wrap:break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -30,8 +30,12 @@
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</el-tabs>
|
||||
<transition name="fade-transform" mode="out-in">
|
||||
<slot />
|
||||
<transition name="fade-transform" mode="out-in" appear>
|
||||
<slot>
|
||||
<keep-alive>
|
||||
<component :is="computeActiveComponent" />
|
||||
</keep-alive>
|
||||
</slot>
|
||||
</transition>
|
||||
</div>
|
||||
</Page>
|
||||
@@ -76,9 +80,19 @@ export default {
|
||||
}
|
||||
})
|
||||
return map
|
||||
},
|
||||
computeActiveComponent() {
|
||||
let needActiveComponent = ''
|
||||
for (const i of this.submenu) {
|
||||
if (i.component && (i.name === this.iActiveMenu)) {
|
||||
needActiveComponent = i.component
|
||||
break
|
||||
}
|
||||
}
|
||||
return needActiveComponent
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
created() {
|
||||
this.iActiveMenu = this.getPropActiveTab()
|
||||
},
|
||||
methods: {
|
||||
@@ -103,10 +117,10 @@ export default {
|
||||
]
|
||||
|
||||
for (const preTab of preActiveTabs) {
|
||||
const currentTab = typeof preTab === 'object' ? preTab.name : preTab
|
||||
const currentTab = typeof preTab === 'object' ? preTab?.name : preTab
|
||||
for (const tabName of this.tabIndices) {
|
||||
const currentTabName = tabName?.name || ''
|
||||
if (currentTab && currentTabName && currentTab.toLowerCase() === currentTabName.toLowerCase()) {
|
||||
if (currentTab?.toLowerCase() === currentTabName?.toLowerCase()) {
|
||||
return currentTabName
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,6 +200,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/styles/variables.scss";
|
||||
.tags-view-container {
|
||||
height: 34px;
|
||||
width: 100%;
|
||||
@@ -228,9 +229,9 @@ export default {
|
||||
margin-right: 15px;
|
||||
}
|
||||
&.active {
|
||||
background-color: #1AB394;
|
||||
background-color: $--color-primary;
|
||||
color: #fff;
|
||||
border-color: #1AB394;
|
||||
border-color: $--color-primary;
|
||||
&::before {
|
||||
content: "";
|
||||
background: #fff;
|
||||
|
||||
11
src/main.js
11
src/main.js
@@ -3,9 +3,7 @@ import Vue from 'vue'
|
||||
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
|
||||
|
||||
import ElementUI from 'element-ui'
|
||||
import 'elementCss'
|
||||
import locale from 'elementLocale'
|
||||
|
||||
import '@/styles/index.scss' // global css
|
||||
|
||||
import App from './App'
|
||||
@@ -48,7 +46,6 @@ Vue.use(require('vue-moment'), {
|
||||
moment
|
||||
})
|
||||
|
||||
// logger
|
||||
import VueLogger from 'vuejs-logger'
|
||||
import loggerOptions from './utils/logger'
|
||||
Vue.use(VueLogger, loggerOptions)
|
||||
@@ -57,14 +54,14 @@ import ECharts from 'vue-echarts'
|
||||
Vue.component('echarts', ECharts)
|
||||
|
||||
import service from '@/utils/request'
|
||||
Vue.prototype.$axios = service
|
||||
|
||||
// lodash
|
||||
// import _ from 'lodash'
|
||||
window._ = require('lodash')
|
||||
// Vue.set(Vue.prototype, '_', _)
|
||||
|
||||
// if the table component cannot access `this.$axios`, it cannot send request
|
||||
Vue.prototype.$axios = service
|
||||
import { Message } from '@/utils/Message'
|
||||
Vue.prototype.$message = Message
|
||||
|
||||
// 注册全局事件总线
|
||||
Vue.prototype.$eventBus = new Vue()
|
||||
new Vue({
|
||||
|
||||
@@ -4,6 +4,7 @@ import i18n from '@/i18n/i18n'
|
||||
import SessionRoutes from './sessions'
|
||||
import LogRoutes from './logs'
|
||||
import empty from '@/layout/empty'
|
||||
import store from '@/store'
|
||||
|
||||
export default {
|
||||
path: '/audit/',
|
||||
@@ -13,8 +14,10 @@ export default {
|
||||
meta: {
|
||||
title: i18n.t('common.nav.Audits'),
|
||||
icon: 'el-icon-s-claim',
|
||||
showNavSwitcher: true,
|
||||
permissions: ['rbac.view_audit'],
|
||||
showNavSwitcher: () => {
|
||||
return store.getters.auditOrgs.length > 0
|
||||
},
|
||||
permissions: [],
|
||||
view: 'audit'
|
||||
},
|
||||
children: [
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user