Compare commits

..

135 Commits

Author SHA1 Message Date
Bai
a048edf24f fix: approve ticket special account not found 2024-12-18 16:06:34 +08:00
wangruidong
a9ba931bba perf: Add 'labels' column to AssetPermission and Domain tables 2024-12-18 10:55:48 +08:00
wangruidong
23fae59411 feat: Add permission checks for platform editing 2024-12-17 19:10:27 +08:00
Chenyang Shen
320613d15d Merge pull request #4520 from jumpserver/pr@dev@feat_add_translate
feat: add translate
2024-12-17 17:42:07 +08:00
Aaron3S
57ea32e785 feat: add translate 2024-12-17 17:40:44 +08:00
Eric
3e3f80c59b perf: component names use the same letter case 2024-12-17 16:21:31 +08:00
feng
c15ba5b078 fix: tag search display error 2024-12-17 10:32:18 +08:00
wangruidong
651888faab perf: Add 'labels' column to UserGroupList table 2024-12-16 19:00:00 +08:00
feng626
d220047fe2 Revert "perf: Platform global"
This reverts commit bbe80f0292.
2024-12-16 14:09:49 +08:00
feng
bbe80f0292 perf: Platform global 2024-12-16 11:40:35 +08:00
feng
41e73a2c9b perf: Firefox unable to download file 2024-12-13 12:51:52 +08:00
feng
7d89cf9f45 perf: Re-login after csrf expires 2024-12-13 10:23:36 +08:00
Bai
8a048f692f fix: remove log 2024-12-12 18:49:39 +08:00
Bai
800317346c fix: current org is system and no preorg user logout error 2024-12-12 11:35:31 +08:00
wangruidong
4a1e2db7ca fix: Org admin view platform perms 2024-12-11 19:12:57 +08:00
Bai
6702d94ba1 fix: org changed error 2024-12-11 10:37:56 +08:00
Bai
a87d04fb9d fix: user login always change to system org 2024-12-10 19:14:13 +08:00
zhaojisen
367db0daf1 fixed: Fixed a text wrap issue 2024-12-10 16:05:55 +08:00
zhaojisen
583b28a6c4 fixed: Fixed an organization error after entering Settings under Global Organization manually 2024-12-09 17:19:37 +08:00
Chenyang Shen
ec5f2e69eb Merge pull request #4498 from jumpserver/pr@dev@feat_change_face_context_url
feat: change face context url
2024-12-09 16:55:22 +08:00
Aaron3S
d058f0e777 feat: change face context url 2024-12-09 16:53:52 +08:00
老广
89befaad43 Create llm-code-review.yml 2024-12-09 16:20:12 +08:00
zhaojisen
548d0e0670 perf:Optimize the execution efficiency of all and reverse selection 2024-12-05 12:39:17 +08:00
zhaojisen
7b862ee0e1 fixed: Fixed an issue where all select a large number of data cards died 2024-12-04 16:58:45 +08:00
fit2bot
d4e37e9418 fixed: Fixed an issue where multiple selections across pages could not be reversed (#4482)
* fixed: Fixed an issue where multiple selections across pages could not be reversed

* fixed: Fixed an issue where multiple selections across pages could not be reversed

---------

Co-authored-by: zhaojisen <1301338853@qq.com>
2024-12-04 15:08:23 +08:00
Bai
b53b1d1e58 perf: languages settings 2024-12-03 17:01:12 +08:00
fit2bot
0342c73f07 feat: Vault adds Amazon Secrets Manager (#4455)
Co-authored-by: jiangweidong <1053570670@qq.com>
2024-11-29 18:03:26 +08:00
Aaron3S
727d9037d1 feat: move face setting to profile 2024-11-28 18:23:59 +08:00
Bai
b24c244186 perf: remove email format check for email host account 2024-11-27 19:13:28 +08:00
fit2bot
d365aea6a0 perf: add nec and facelive for monitor (#4468)
* perf: add nec and facelive for monitor

* perf: add nec and facelive component log

---------

Co-authored-by: Eric <xplzv@126.com>
2024-11-27 18:51:18 +08:00
zhaojisen
115f1171ad fixed: Fixed an issue with button text overflow in QuickActions 2024-11-27 11:13:51 +08:00
wangruidong
b2b477d4e0 fix: Creating an asset form does not allow deleting the default protocol 2024-11-27 11:01:02 +08:00
wangruidong
1e37ecff11 perf: Add variable management to Job and Adhoc details 2024-11-26 15:05:17 +08:00
wangruidong
9cf87404be perf: Add viewAssetOnlineSessionInfo conf 2024-11-25 15:32:21 +08:00
dependabot[bot]
2e51b0dea1 chore(deps): bump elliptic from 6.5.4 to 6.6.0
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.4 to 6.6.0.
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.4...v6.6.0)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-22 15:25:22 +08:00
wangruidong
a1f20c6f92 fix: adhoc and playbook detail page display many '-' 2024-11-22 15:24:21 +08:00
wangruidong
6b6a60b84f refactor: Component name and API endpoint 2024-11-22 15:03:23 +08:00
zhaojisen
4e999176ed fixed: Fixed an issue where the Form button was hidden 2024-11-22 14:51:40 +08:00
wangruidong
76ff273ec7 fix: run playbook job with no variable 2024-11-21 22:01:02 +08:00
wangruidong
475a77497f fix: disable job has no perms 2024-11-21 18:57:14 +08:00
Bai
5d1301c871 fix: public playbook variables are not displayed by other users 2024-11-21 17:50:59 +08:00
zhaojisen
772f40e13d fixed: Fixed an issue where the Form button was hidden 2024-11-21 14:44:29 +08:00
wangruidong
1b2f7ad28c fix: default value not display 2024-11-21 14:26:39 +08:00
wangruidong
84778881f6 fix: playbook job clone variable error 2024-11-20 23:06:24 +08:00
wangruidong
d6d0338666 perf: Add default value col in Variable & refactor JobUpdateCreate 2024-11-20 21:51:15 +08:00
wangruidong
de6f477d05 fix: playbook clone with variable 2024-11-20 15:35:34 +08:00
wangruidong
03e07ee280 fix: Add error handling in VariableCreateUpdateForm and wrap text in ItemValue 2024-11-20 10:55:51 +08:00
wangruidong
35e2273603 perf: Enhance MFA settings and display 2024-11-20 10:12:56 +08:00
zhaojisen
7a138388b2 fixed: Fixes ESLint issues 2024-11-19 18:05:13 +08:00
Bai
b1f42dd6bf perf: License info remove subscription id 2024-11-19 17:48:49 +08:00
wangruidong
2eeba4ee4f fix: playbook set variable perms 2024-11-19 10:12:52 +08:00
fit2bot
d91579e848 fixed: Fixed an issue where the number of commands overlaps with whether there are command fields (#4437)
* fixed: Fixed an issue where the number of commands overlaps with whether there are command fields

* fixed: Fixed an issue where the number of commands overlaps with whether there are command fields

---------

Co-authored-by: zhaojisen <1301338853@qq.com>
2024-11-18 16:13:06 +08:00
wangruidong
13751f14f3 perf: Variable table overflow show tooltip and CodeEditor cursor position 2024-11-18 15:09:51 +08:00
wangruidong
7ea00e17bd perf: Cancel template selection if the command is empty 2024-11-15 17:58:32 +08:00
wangruidong
ec78370ecc fix: duplicate variable names and job audit perms issue 2024-11-15 16:01:41 +08:00
Aaron3S
c9f62ae5d3 feat: 添加人脸识别 MFA 2024-11-13 17:42:29 +08:00
halo
b80b69dd26 perf: VAULT_BACKEND cannot be modified from the frontend 2024-11-13 17:30:48 +08:00
wangruidong
ac49415061 fix: Solve audit job and variable bugs 2024-11-13 17:30:20 +08:00
wangruidong
9edb64837d fix: Job create cannot be saved without setting interval 2024-11-12 15:37:18 +08:00
wangruidong
671fa65930 perf: Admin and auditor can view and stop task 2024-11-12 11:20:06 +08:00
Eric
0da81ea60d perf: add vnc port for endpoint 2024-11-11 21:58:21 +08:00
Halo
c610d396d6 feat: azure key vault (#4418) 2024-11-11 19:42:16 +08:00
feng
0ed02ca7f7 fix: Modify the platform protocol cursor disappears 2024-11-08 16:48:50 +08:00
feng
c22981e2c1 perf: Translate 2024-11-08 15:34:21 +08:00
fit2bot
b0af35a4b9 perf: Create a job that supports adding node parameters (#4412)
* perf: Create a job that supports adding node parameters

* feat: add variables component

* perf: Update file tip position

* feat: Add variable support to job from template

* feat: Parameters can be set when running job

* feat: Supports setting  variable type

* feat: Supports running adhoc with parameters

* feat: Supports running playbook with parameters

* feat: Support setting variables for scheduled tasks

* perf: Translate

---------

Co-authored-by: wangruidong <940853815@qq.com>
2024-11-07 10:41:07 +08:00
jiangweidong
1d16a165a5 perf: optimization 2024-11-06 15:06:27 +08:00
jiangweidong
f1f4242ad6 perf: Supports automatic release of assets and prevents accidental release of network errors 2024-11-06 15:06:27 +08:00
老广
bff8f10cd5 Create llm-code-review.yml 2024-11-05 18:23:09 +08:00
Bai
305e44ea1c feat: modify asset permission default expired from settings 2024-11-01 18:23:38 +08:00
feng
a636bb2037 perf: List preference translate 2024-10-18 14:32:45 +08:00
fit2bot
9b6f54c1ed perf: update placeholder (#4409)
* perf: update passkey create

* perf: update placeholder

---------

Co-authored-by: ibuler <ibuler@qq.com>
2024-10-17 11:10:18 +08:00
feng
611341307b fix: ticket duplicate submission 2024-10-16 19:09:18 +08:00
ibuler
f8479c53ff perf: update passkey create 2024-10-16 18:51:56 +08:00
wangruidong
e25bf46659 perf: url is null set remote false 2024-10-16 18:36:12 +08:00
wangruidong
6d07307e56 perf: users use Select2 2024-10-16 16:54:34 +08:00
wangruidong
6fb7fe8fa1 fix: interval field check 2024-10-16 11:01:44 +08:00
zhaojisen
19cd497095 fixed: Restores remote application styles 2024-10-15 17:06:06 +08:00
wangruidong
d858489367 fix: modify getPreference url 2024-10-15 14:13:10 +08:00
feng
341a30ba06 perf: The platform gets activeMenu and adds a default value 2024-10-15 11:32:51 +08:00
ZhaoJiSen
8390fb7429 Merge pull request #4398 from jumpserver/pr@dev@help_tip
perf: Help text automatic line wrapping
2024-10-12 14:40:43 +08:00
feng
5389f1d011 perf: Help text automatic line wrapping 2024-10-12 14:39:15 +08:00
ZhaoJiSen
bde642570f Merge pull request #4397 from jumpserver/pr@dev@perf_reveiver
style: Set special receiver to optimize the scroll wheel display
2024-10-12 11:35:16 +08:00
zhaojisen
3e7b970fe7 style: Set special receiver to optimize the scroll wheel display 2024-10-12 11:32:05 +08:00
ZhaoJiSen
2421e822b4 Merge pull request #4396 from jumpserver/pr@dev@perf_number_style
style: Optimize the number field style
2024-10-11 18:19:35 +08:00
zhaojisen
b2e474e3f6 style: Optimize the number field style 2024-10-11 18:15:46 +08:00
ZhaoJiSen
541836390a Merge pull request #4394 from jumpserver/pr@dev@fix_tab_change
fixed: Fixed command filtering and command group tab switching issues
2024-10-10 18:55:00 +08:00
zhaojisen
bb92e3f22b fixed: Fixed command filtering and command group tab switching issues 2024-10-10 18:51:50 +08:00
ZhaoJiSen
c9ad797b40 Merge pull request #4393 from jumpserver/pr@dev@fix_quick_job_node
fixed: Fixed the shortcut command selection node issue
2024-10-10 18:39:34 +08:00
zhaojisen
2a08310efc fixed: Fixed the shortcut command selection node issue 2024-10-10 18:37:47 +08:00
zhaojisen
3b2803b9a1 fixed: Fixed the shortcut command selection node issue 2024-10-10 18:36:33 +08:00
wangruidong
1b8ac9112e fix: user lack permission to view the type tree 2024-10-10 17:11:13 +08:00
ZhaoJiSen
9cc3dd4de9 Merge pull request #4390 from jumpserver/pr@dev@fix_add_lineHeight
style: Add Line Height
2024-10-10 14:40:30 +08:00
zhaojisen
120ef70eb1 style: Add Line Height 2024-10-10 14:36:01 +08:00
ZhaoJiSen
541f4ebc62 Merge pull request #4389 from jumpserver/pr@dev@fix_remote_app
style: Adjusting the styles of the remote application
2024-10-10 14:17:52 +08:00
zhaojisen
a47636abc7 style: Adjusting the styles of the remote application 2024-10-10 14:11:53 +08:00
ZhaoJiSen
78f6f4b36a Merge pull request #4388 from jumpserver/pr@dev@fix_comments_style
fixed: Fixed the presentation format of asset notes
2024-10-10 11:23:16 +08:00
zhaojisen
5abc0b77cf fixed: Fixed the presentation format of asset notes 2024-10-10 11:18:49 +08:00
ZhaoJiSen
464638e782 Merge pull request #4387 from jumpserver/pr@dev@fix_input_border
style: Fixed the display of the account number input box
2024-10-10 10:46:23 +08:00
zhaojisen
37cfeb2077 style: Fixed the display of the account number input box 2024-10-10 10:43:09 +08:00
ZhaoJiSen
44e297f01a Merge pull request #4386 from jumpserver/pr@dev@fix_tooltip_position
fixed: Fixed issue with sidebar toolTip placement
2024-10-10 09:50:33 +08:00
zhaojisen
febc283e36 fixed: Fixed issue with sidebar toolTip placement 2024-10-10 09:47:05 +08:00
ZhaoJiSen
dae33f55e8 Merge pull request #4385 from jumpserver/pr@dev@fix_special_chara
fixed: Fixed + and - not being special characters
2024-10-09 18:38:23 +08:00
zhaojisen
c62cd27690 fixed: Fixed + and - not being special characters 2024-10-09 18:34:31 +08:00
ZhaoJiSen
83443f8187 Merge pull request #4383 from jumpserver/pr@dev@fix_tab_refresh
fixed: Fixed An issue where adding a tag to asset does not work
2024-10-09 17:26:08 +08:00
zhaojisen
cb46f393e0 fixed: Fixed An issue where adding a tag to asset does not work 2024-10-09 17:17:12 +08:00
wangruidong
ddf5ac2151 fix: Determine the asset connection opening method based on the settings 2024-10-09 16:44:25 +08:00
wangruidong
88173f852a perf: Default endpoint cannot be disabled 2024-10-09 16:43:16 +08:00
wangruidong
d5f16e90e2 perf: add created_by field 2024-10-09 16:15:36 +08:00
ZhaoJiSen
d1c0aca4ff Merge pull request #4380 from jumpserver/pr@dev@fix_font_size
fixed: Fixed an issue where the font size of the resource is too large due to the parent element's font size being overridden
2024-10-09 14:47:42 +08:00
zhaojisen
a42edf17ec fixed: Fixed an issue where the font size of the resource is too large due to the parent element's font size being overridden 2024-10-09 14:32:06 +08:00
feng
dac5dfcd1c perf: Optimize file audit download prompt 2024-09-29 16:12:41 +08:00
ZhaoJiSen
8e6ca146e1 Merge pull request #4353 from jumpserver/dependabot/npm_and_yarn/serve-static-1.16.0
chore(deps-dev): bump serve-static from 1.15.0 to 1.16.0
2024-09-29 10:16:07 +08:00
ZhaoJiSen
9c06d36eab Merge pull request #4351 from jumpserver/dependabot/npm_and_yarn/path-to-regexp-3.3.0
chore(deps): bump path-to-regexp from 2.4.0 to 3.3.0
2024-09-29 10:14:32 +08:00
wisonic
ab7bd574f8 fix: assets proportion tooltip cause page bounced at first time 2024-09-27 17:34:25 +08:00
wangruidong
6007dc8621 perf: Endpoint add is_active field 2024-09-27 16:00:40 +08:00
wangruidong
a0e7c48dc9 perf: adhoc can clone 2024-09-27 14:12:13 +08:00
wangruidong
71dea791bf fix: xterm output truncate 2024-09-26 17:17:23 +08:00
ZhaoJiSen
e1b9184f41 Merge pull request #4372 from jumpserver/pr@dev@fix_perm_list_tree
fixed: Fixed an issue with draggable Tree nodes under asset authorization
2024-09-26 17:02:08 +08:00
zhaojisen
730d47f02a fixed: Fixed an issue with draggable Tree nodes under asset authorization 2024-09-26 16:59:18 +08:00
feng
e82ec68935 perf: The maximum length of the randomly generated password is changed to 36 2024-09-25 10:54:05 +08:00
feng
e8e5975d7f fix: fix after successfully creating an asset, the asset list cannot be partially refreshed 2024-09-24 15:44:55 +08:00
ZhaoJiSen
3cb9dec978 Merge pull request #4366 from jumpserver/pr@dev@fix_style_fix
style: Restoring styles
2024-09-19 18:21:50 +08:00
zhaojisen
c025441075 style: Restoring styles 2024-09-19 18:20:41 +08:00
wangruidong
050b50fa74 fix: playbook template clone error 2024-09-19 15:07:31 +08:00
ibuler
e26befabc3 perf: filter gateway using new params 2024-09-19 11:24:51 +08:00
wangruidong
8545fc6136 fix: session is_locked show value 2024-09-19 11:20:54 +08:00
ZhaoJiSen
e343e0df9d Merge pull request #4363 from jumpserver/pr@dev@perf_remote_app
style: Adjust the remote application page layout
2024-09-18 21:16:47 +08:00
zhaojisen
74519e6f3c style: Adjust the remote application page layout 2024-09-18 21:15:49 +08:00
feng
1305f90372 perf: TimerExecution translate 2024-09-18 15:06:06 +08:00
feng
bbc3f53c0a perf: User details community version removes user acl 2024-09-18 11:11:53 +08:00
ZhaoJiSen
aa605adbc7 Merge pull request #4359 from jumpserver/pr@dev@fix_show_NaN
fixed: Fixed NaN issue when setting timing interval
2024-09-17 13:42:51 +08:00
zhaojisen
49ea7d0969 fixed: Fixed NaN issue when setting timing interval 2024-09-17 13:34:51 +08:00
feng
4221bdb2ab perf: Postgresql add ssl mode 2024-09-13 17:49:05 +08:00
dependabot[bot]
af4010e299 chore(deps-dev): bump serve-static from 1.15.0 to 1.16.0
Bumps [serve-static](https://github.com/expressjs/serve-static) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/expressjs/serve-static/releases)
- [Changelog](https://github.com/expressjs/serve-static/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/serve-static/compare/v1.15.0...1.16.0)

---
updated-dependencies:
- dependency-name: serve-static
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-12 02:22:33 +00:00
dependabot[bot]
879df90503 chore(deps): bump path-to-regexp from 2.4.0 to 3.3.0
Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) from 2.4.0 to 3.3.0.
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v2.4.0...v3.3.0)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-11 18:05:18 +00:00
302 changed files with 3750 additions and 8434 deletions

View File

@@ -0,0 +1,28 @@
name: LLM Code Review
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
llm-code-review:
runs-on: ubuntu-latest
steps:
- uses: fit2cloud/LLM-CodeReview-Action@main
env:
GITHUB_TOKEN: ${{ secrets.FIT2CLOUDRD_LLM_CODE_REVIEW_TOKEN }}
OPENAI_API_KEY: ${{ secrets.ALIYUN_LLM_API_KEY }}
LANGUAGE: English
OPENAI_API_ENDPOINT: https://dashscope.aliyuncs.com/compatible-mode/v1
MODEL: qwen2-1.5b-instruct
PROMPT: "Please check the following code differences for any irregularities, potential issues, or optimization suggestions, and provide your answers in English."
top_p: 1
temperature: 1
# max_tokens: 10000
MAX_PATCH_LENGTH: 10000
IGNORE_PATTERNS: "/node_modules,*.md,/dist,/.github"
FILE_PATTERNS: "*.java,*.go,*.py,*.vue,*.ts,*.js,*.css,*.scss,*.html"

28
.github/workflows/llm-code-review.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: LLM Code Review
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
llm-code-review:
runs-on: ubuntu-latest
steps:
- uses: fit2cloud/LLM-CodeReview-Action@main
env:
GITHUB_TOKEN: ${{ secrets.FIT2CLOUDRD_LLM_CODE_REVIEW_TOKEN }}
OPENAI_API_KEY: ${{ secrets.ALIYUN_LLM_API_KEY }}
LANGUAGE: English
OPENAI_API_ENDPOINT: https://dashscope.aliyuncs.com/compatible-mode/v1
MODEL: qwen2-1.5b-instruct
PROMPT: "Please check the following code differences for any irregularities, potential issues, or optimization suggestions, and provide your answers in English."
top_p: 1
temperature: 1
# max_tokens: 10000
MAX_PATCH_LENGTH: 10000
IGNORE_PATTERNS: "/node_modules,*.md,/dist,/.github"
FILE_PATTERNS: "*.java,*.go,*.py,*.vue,*.ts,*.js,*.css,*.scss,*.html"

View File

@@ -66,7 +66,7 @@
"normalize.css": "7.0.0",
"npm": "^7.8.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"path-to-regexp": "3.3.0",
"v-sanitize": "^0.0.13",
"vue": "2.6.10",
"vue-codemirror": "4.0.6",
@@ -117,10 +117,10 @@
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
"serve-static": "^1.13.2",
"serve-static": "^1.16.0",
"strip-ansi": "^7.1.0",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.4",
"svgo": "1.2.2",
"vue-i18n-extract": "^1.1.1",
"vue-template-compiler": "2.6.10"
},

View File

@@ -2,70 +2,37 @@
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta content="0" http-equiv="Expires">
<meta content="no-cache" http-equiv="Pragma">
<meta content="no-cache" http-equiv="Cache-control">
<meta content="no-cache" http-equiv="Cache">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<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>
<link href="<%= BASE_URL %>theme/element-ui.css" rel="stylesheet">
<style>
#loading {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: white;
z-index: 9999;
}
.spinner {
width: 50px;
height: 50px;
border: 5px solid rgba(0, 0, 0, 0.1);
border-radius: 50%;
border-top-color: #3498db;
animation: spin 1s infinite linear;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
</style>
<link rel="stylesheet" href="<%= BASE_URL %>theme/element-ui.css">
</head>
<body>
<noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<script>
window.onload = function () {
if (location.pathname === '/') {
location.pathname = '/ui/'
}
const pathname = window.location.pathname
if (pathname.startsWith('/core')) {
return
}
if (pathname.indexOf('/ui') === -1) {
window.location.href = window.location.origin + '/ui/#' + pathname
}
if (pathname.startsWith('/ui/#/chat')) {
window.location.href = window.location.origin + pathname
}
window.onload = function() {
if (location.pathname === '/') {
location.pathname = '/ui/'
}
const pathname = window.location.pathname
if (pathname.startsWith('/core')) {
return
}
if(pathname.indexOf('/ui') === -1) {
window.location.href = window.location.origin + '/ui/#' + pathname
}
if (pathname.startsWith('/ui/#/chat')) {
window.location.href = window.location.origin + pathname
}
}
</script>
<div id="app">
</div>
<div id="loading">
<div class="spinner"></div>
</div>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@@ -53,7 +53,7 @@ export function createJob(form) {
})
}
export function StopJob(form) {
export function stopJob(form) {
return request({
url: '/api/v1/ops/job-executions/stop/',
method: 'post',
@@ -71,3 +71,10 @@ export function JobUploadFile(form) {
})
}
export function auditUpdateJob(id, form) {
return request({
url: `/api/v1/audits/jobs/${id}/`,
method: 'patch',
data: form
})
}

View File

@@ -15,6 +15,7 @@ export function testEmailSetting(data) {
data: data
})
}
export function importLicense(formData) {
return request({
url: '/api/v1/xpack/license/import',
@@ -25,6 +26,7 @@ export function importLicense(formData) {
data: formData
})
}
export function testLdapSetting(data, refresh = true) {
let url = '/api/v1/settings/ldap/testing/config/'
if (refresh) {
@@ -96,9 +98,17 @@ export function getPublicSettings(isOpen) {
method: 'get'
})
}
export function getLogo() {
return request({
url: '/api/v1/xpack/interface/setting/',
method: 'get'
})
}
export function getPreference() {
return request({
url: '/api/v1/users/preference/?category=luna',
method: 'get'
})
}

View File

@@ -163,8 +163,7 @@ export const accountFieldsMeta = (vm) => {
!automation.ansible_enabled ||
!vm.$hasPerm('accounts.push_account') ||
(formValue.secret_type === 'ssh_key' && vm.iPlatform.type.value === 'windows') ||
vm.addTemplate ||
!formValue.secret_reset
vm.addTemplate
}
},
params: {

View File

@@ -65,8 +65,7 @@ export default {
[this.$t('Basic'), ['assets', 'name', 'username', 'privileged', 'su_from', 'su_from_username']],
[this.$t('Secret'), [
'secret_type', 'password', 'ssh_key', 'token',
'access_key', 'passphrase', 'api_key',
'secret_reset'
'access_key', 'passphrase', 'api_key'
]],
[this.$t('Other'), ['push_now', 'params', 'on_invalid', 'is_active', 'comment']]
],

View File

@@ -1,6 +1,6 @@
<template v-if="iVisible">
<template>
<Dialog
v-if="origin !== 'pam'"
v-if="iVisible"
:close-on-click-modal="false"
:destroy-on-close="true"
:show-cancel="false"
@@ -21,33 +21,15 @@
@edit="editAccount"
/>
</Dialog>
<Drawer
v-else
:title="title"
@close-drawer="iVisible = false"
>
<AccountCreateUpdateForm
v-if="!loading"
ref="form"
:account="account"
:add-template="addTemplate"
:asset="asset"
@add="addAccount"
@edit="editAccount"
/>
</Drawer>
</template>
<script>
import Drawer from '@/components/Drawer/index.vue'
import Dialog from '@/components/Dialog/index.vue'
import AccountCreateUpdateForm from '@/components/Apps/AccountCreateUpdateForm/index.vue'
export default {
name: 'CreateAccountDialog',
components: {
Drawer,
Dialog,
AccountCreateUpdateForm
},
@@ -73,10 +55,6 @@ export default {
default: function() {
return this.$t('AddAccount')
}
},
origin: {
type: String,
default: ''
}
},
data() {
@@ -128,8 +106,6 @@ export default {
}
}).catch(error => {
this.iVisible = true
console.log(this.iVisible)
console.log(this.origin)
this.handleResult(null, error)
})
},

View File

@@ -1,11 +1,6 @@
<template>
<div>
<ListTable
ref="ListTable"
:header-actions="headerActions"
:quick-filters="quickFilters"
:table-config="tableConfig"
/>
<ListTable ref="ListTable" :header-actions="headerActions" :table-config="tableConfig" />
<ViewSecret
v-if="showViewSecretDialog"
:account="account"
@@ -21,7 +16,6 @@
<AccountCreateUpdate
v-if="showAddDialog"
:account="account"
:origin="origin"
:asset="iAsset"
:title="accountCreateUpdateTitle"
:visible.sync="showAddDialog"
@@ -31,7 +25,6 @@
<AccountCreateUpdate
v-if="showAddTemplateDialog"
:account="account"
:origin="origin"
:add-template="true"
:asset="iAsset"
:title="accountCreateByTemplateTitle"
@@ -56,9 +49,7 @@
<script>
import ListTable from '@/components/Table/ListTable/index.vue'
import {
ActionsFormatter, PlatformFormatter, SecretViewerFormatter
} from '@/components/Table/TableFormatters'
import { ActionsFormatter } from '@/components/Table/TableFormatters'
import ViewSecret from './ViewSecret.vue'
import UpdateSecretInfo from './UpdateSecretInfo.vue'
import AccountCreateUpdate from './AccountCreateUpdate.vue'
@@ -98,7 +89,7 @@ export default {
},
hasClone: {
type: Boolean,
default: true
default: false
},
asset: {
type: Object,
@@ -128,7 +119,7 @@ export default {
columnsDefault: {
type: Array,
default: () => ([
'name', 'username', 'secret', 'asset', 'platform', 'date_updated', 'connect'
'name', 'username', 'asset', 'date_updated'
])
},
headerExtraActions: {
@@ -138,10 +129,6 @@ export default {
extraQuery: {
type: Object,
default: () => ({})
},
origin: {
type: String,
default: ''
}
},
data() {
@@ -158,131 +145,6 @@ export default {
iAsset: this.asset,
account: {},
secretUrl: '',
quickFilters: [
{
label: '最近(7天)',
options: [
{
label: '最近发现',
filter: {
latest_discovery: '1'
}
},
{
label: '最近被登录',
filter: {
latest_accessed: '1'
}
},
{
label: '最近修改',
filter: {
latest_updated: '1'
}
},
{
label: '最近改密',
filter: {
latest_secret_changed: '1'
}
},
{
label: '最近改密失败',
filter: {
latest_secret_changed_failed: '1'
}
}
]
},
{
label: '风险账号',
options: [
{
label: '僵尸账号',
filter: {
risk: 'zombie'
}
},
{
label: '幽灵账号',
filter: {
risk: 'ghost'
}
},
{
label: '弱密码',
filter: {
risk: 'week_password'
}
},
{
label: '空密码',
filter: {
has_secret: 'false'
}
},
{
label: '长时间未改密',
filter: {
long_time_no_change_secret: 'true'
}
},
{
label: '长时间未验证',
filter: {
long_time_no_verify: 'true'
}
}
]
},
{
label: '账号类型',
options: [
{
label: '全部',
filter: {
category: ''
}
},
{
label: ' 主机',
filter: {
category: 'host'
}
},
{
label: '数据库',
filter: {
category: 'database'
}
},
{
label: '云',
filter: {
category: 'cloud'
}
},
{
label: '网络设备',
filter: {
category: 'device'
}
},
{
label: 'Web',
filter: {
category: 'website'
}
},
{
label: '其他',
filter: {
category: 'custom'
}
}
]
}
],
tableConfig: {
url: this.url,
permissions: {
@@ -291,7 +153,6 @@ export default {
},
extraQuery: this.extraQuery,
columnsExclude: ['spec_info'],
columnsAdd: ['secret', 'platform', 'connect'],
columnsShow: {
min: ['name', 'username', 'actions'],
default: this.columnsDefault
@@ -311,27 +172,6 @@ export default {
}
}
},
secret: {
formatter: SecretViewerFormatter,
formatterArgs: {
secretFrom: 'api',
hasDownload: false,
actionLeft: true
}
},
connect: {
label: this.$t('Connect'),
width: '80px',
formatter: () => {
return (
<span className='connect'>
<el-button type='primary' size='mini' plain>
<i className='fa fa-desktop'/>
</el-button>
</span>
)
}
},
asset: {
formatter: function(row) {
const to = {
@@ -345,13 +185,6 @@ export default {
}
}
},
platform: {
label: this.$t('Platform'),
formatter: PlatformFormatter,
formatterArgs: {
platformAttr: 'asset.platform'
}
},
username: {
width: '120px'
},
@@ -384,8 +217,7 @@ export default {
formatterArgs: {
hasUpdate: false, // can set function(row, value)
hasDelete: false, // can set function(row, value)
hasClone: false,
canClone: true,
hasClone: this.hasClone,
moreActionsTitle: this.$t('More'),
extraActions: [
{
@@ -423,7 +255,7 @@ export default {
},
{
name: 'Test',
title: this.$t('验证密文'),
title: this.$t('Test'),
can: ({ row }) =>
!this.$store.getters.currentOrgIsRoot &&
this.$hasPerm('accounts.verify_account') &&
@@ -451,26 +283,6 @@ export default {
this.$message.success(this.$tc('ClearSuccessMsg'))
})
}
},
{
name: 'SecretHistory',
title: '密文历史'
},
{
name: 'CopyToOther',
title: '复制到其他资产',
type: 'primary',
divided: true
},
{
name: 'MoveToOther',
title: '移动到其他资产',
type: 'primary'
},
{
name: 'Clone',
title: this.$t('Duplicate'),
divided: true
}
]
}
@@ -538,8 +350,8 @@ export default {
icon: 'fa-link',
can: ({ selectedRows }) => {
return selectedRows.length > 0 &&
['clickhouse', 'redis', 'website', 'chatgpt'].indexOf(selectedRows[0].asset.type.value) === -1 &&
!this.$store.getters.currentOrgIsRoot
['clickhouse', 'redis', 'website', 'chatgpt'].indexOf(selectedRows[0].asset.type.value) === -1 &&
!this.$store.getters.currentOrgIsRoot
},
callback: function({ selectedRows }) {
const ids = selectedRows.map(v => {
@@ -699,5 +511,4 @@ export default {
.cell a {
color: var(--color-info);
}
</style>

View File

@@ -4,7 +4,7 @@
<script>
import { GenericListTableDialog } from '@/layout/components'
import { SecretViewerFormatter } from '@/components/Table/TableFormatters'
import { ShowKeyCopyFormatter } from '@/components/Table/TableFormatters'
export default {
components: {
@@ -33,7 +33,7 @@ export default {
columnsMeta: {
secret: {
label: this.$t('Password'),
formatter: SecretViewerFormatter,
formatter: ShowKeyCopyFormatter,
formatterArgs: {
hasDownload: false,
name: this.account.name

View File

@@ -18,7 +18,7 @@
<span>{{ account['username'] }}</span>
</el-form-item>
<el-form-item :label="secretTypeLabel">
<SecretViewerFormatter
<ShowKeyCopyFormatter
:cell-value="secretInfo.secret"
:col="{ formatterArgs: {
name: account['name'],
@@ -60,7 +60,7 @@
<script>
import Dialog from '@/components/Dialog/index.vue'
import PasswordHistoryDialog from './PasswordHistoryDialog.vue'
import { SecretViewerFormatter } from '@/components/Table/TableFormatters'
import { ShowKeyCopyFormatter } from '@/components/Table/TableFormatters'
import { encryptPassword } from '@/utils/crypto'
export default {
@@ -68,7 +68,7 @@ export default {
components: {
Dialog,
PasswordHistoryDialog,
SecretViewerFormatter
ShowKeyCopyFormatter
},
props: {
account: {

View File

@@ -32,6 +32,10 @@ export default {
type: String,
default: '/api/v1/assets/assets/'
},
typeUrl: {
type: String,
default: '/api/v1/assets/nodes/category/tree/'
},
nodeUrl: {
type: String,
default: '/api/v1/assets/nodes/'
@@ -105,9 +109,9 @@ export default {
showAssets: false,
showSearch: false,
customTreeHeaderName: this.$t('TypeTree'),
url: '/api/v1/assets/nodes/category/tree/',
url: this.typeUrl,
nodeUrl: this.treeSetting?.nodeUrl || this.nodeUrl,
treeUrl: `/api/v1/assets/nodes/category/tree/?assets=${showAssets ? '1' : '0'}&count_resource=${this.treeSetting.countResource || 'asset'}`,
treeUrl: `${this.typeUrl}?assets=${showAssets ? '1' : '0'}&count_resource=${this.treeSetting.countResource || 'asset'}`,
callback: {
onSelected: (event, treeNode) => this.getAssetsUrl(treeNode)
}

View File

@@ -12,7 +12,7 @@
>
<el-form :model="secretInfo" class="password-form" label-position="right" label-width="100px">
<el-form-item :label="$tc('OldSecret')">
<SecretViewerFormatter
<ShowKeyCopyFormatter
:cell-value="secretInfo.old_secret"
:col="{ formatterArgs: {
name: 'old_secret'
@@ -20,7 +20,7 @@
/>
</el-form-item>
<el-form-item :label="$tc('NewSecret')">
<SecretViewerFormatter
<ShowKeyCopyFormatter
:cell-value="secretInfo.new_secret"
:col="{ formatterArgs: {
name: 'new_secret'
@@ -34,13 +34,13 @@
<script>
import Dialog from '@/components/Dialog/index.vue'
import { SecretViewerFormatter } from '@/components/Table/TableFormatters'
import { ShowKeyCopyFormatter } from '@/components/Table/TableFormatters'
export default {
name: 'RecordViewSecret',
components: {
Dialog,
SecretViewerFormatter
ShowKeyCopyFormatter
},
props: {
visible: {

View File

@@ -1,7 +1,7 @@
<template>
<div>
<el-row :gutter="20">
<el-col :md="16" :sm="24" class="resource-activity">
<el-col :md="16" :sm="24">
<IBox :title="title" class="block" v-bind="$attrs">
<el-timeline>
<el-timeline-item

View File

@@ -8,7 +8,7 @@
:visible.sync="visible"
class="dialog-content"
v-bind="$attrs"
width="600px"
width="740px"
@confirm="visible = false"
v-on="$listeners"
>
@@ -52,11 +52,21 @@
<el-row :gutter="24" style="margin: 0 auto;">
<el-col :md="24" :sm="24" style="display: flex; align-items: center; margin-bottom: 20px;">
<el-input
v-if="subTypeSelected !== 'face'"
v-model="secretValue"
:placeholder="inputPlaceholder"
:show-password="showPassword"
@keyup.enter.native="handleConfirm"
/>
<iframe
v-if="isFaceCaptureVisible && subTypeSelected ==='face' && faceCaptureUrl"
:src="faceCaptureUrl"
allow="camera"
sandbox="allow-scripts allow-same-origin"
style="width: 100%; height: 800px;border: none;"
/>
<span v-if="subTypeSelected === 'sms'" style="margin: -1px 0 0 20px;">
<el-button
:disabled="smsBtnDisabled"
@@ -72,9 +82,24 @@
</el-row>
<el-row :gutter="24" style="margin: 10px auto;">
<el-col :md="24" :sm="24">
<el-button class="confirm-btn" size="mini" type="primary" @click="handleConfirm">
<el-button
v-if="subTypeSelected!=='face'"
class="confirm-btn"
size="mini"
type="primary"
@click="handleConfirm"
>
{{ this.$t('Confirm') }}
</el-button>
<el-button
v-if="subTypeSelected==='face'&&!isFaceCaptureVisible"
class="confirm-btn"
size="mini"
type="primary"
@click="handleFaceCapture"
>
开始人脸识别
</el-button>
</el-col>
</el-row>
</div>
@@ -113,7 +138,10 @@ export default {
visible: false,
callback: null,
cancel: null,
processing: false
processing: false,
isFaceCaptureVisible: false,
faceToken: null,
faceCaptureUrl: null
}
},
computed: {
@@ -129,6 +157,10 @@ export default {
},
methods: {
handleSubTypeChange(val) {
if (val !== 'face') {
this.isFaceCaptureVisible = false
}
this.inputPlaceholder = this.subTypeChoices.filter(item => item.name === val)[0]?.placeholder
this.smsWidth = val === 'sms' ? 6 : 0
},
@@ -192,6 +224,29 @@ export default {
this.$message.error(this.$tc('FailedToSendVerificationCode'))
})
},
startFaceCapture() {
const url = '/api/v1/authentication/face/context/'
this.$axios.post(url).then(data => {
const token = data['token']
this.faceCaptureUrl = '/facelive/capture?token=' + token
this.isFaceCaptureVisible = true
const timer = setInterval(() => {
this.$axios.get(url + `?token=${token}`).then(data => {
if (data['is_finished']) {
clearInterval(timer)
this.isFaceCaptureVisible = false
this.handleConfirm()
}
})
}, 1000)
}).catch(() => {
this.$message.error(this.$tc('FailedToStartFaceCapture'))
})
},
handleFaceCapture() {
this.startFaceCapture()
},
handleConfirm() {
if (this.confirmTypeRequired === 'relogin') {
return this.logout()
@@ -214,6 +269,8 @@ export default {
})
}).catch((err) => {
this.$message.error(err.message || this.$tc('ConfirmFailed'))
this.faceCaptureUrl = null
this.isFaceCaptureVisible = false
})
}
}
@@ -221,21 +278,21 @@ export default {
</script>
<style lang="scss" scoped>
.dialog-content ::v-deep .el-dialog__footer {
padding: 0;
}
.dialog-content ::v-deep .el-dialog__footer {
padding: 0;
}
.dialog-content ::v-deep .el-dialog {
padding: 8px;
.dialog-content ::v-deep .el-dialog {
padding: 8px;
.el-dialog__body {
padding-top: 30px;
padding-bottom: 30px;
}
.el-dialog__body {
padding-top: 30px;
padding-bottom: 30px;
}
}
.confirm-btn {
width: 100%;
line-height: 20px;
}
.confirm-btn {
width: 100%;
line-height: 20px;
}
</style>

View File

@@ -0,0 +1,111 @@
<template>
<AutoDataForm
ref="AutoDataForm"
class="variable-add"
:submit-btn-text="submitBtnText"
v-bind="$data"
@submit="confirm"
/>
</template>
<script>
import AutoDataForm from '@/components/Form/AutoDataForm/index.vue'
export default {
name: 'VariableCreateForm',
components: {
AutoDataForm
},
props: {
variable: {
type: Object,
default: () => ({})
}
},
data() {
return {
submitBtnText: this.$t('Confirm'),
url: '/api/v1/ops/variables/',
form: Object.assign({ 'on_invalid': 'error' }, this.variable || {}),
fields: [
['', ['name', 'var_name', 'type', 'text_default_value', 'select_default_value', 'extra_args', 'tips', 'required']]
],
fieldsMeta: {
text_default_value: {
label: this.$t('DefaultValue'),
hidden: (formValue) => {
return formValue.type !== 'text'
},
el: {
type: 'input'
}
},
select_default_value: {
label: this.$t('DefaultValue'),
hidden: (formValue) => {
return formValue.type !== 'select'
},
el: { type: 'input' }
},
extra_args: {
hidden: (formValue) => {
return formValue.type !== 'select'
},
el: { type: 'textarea', rows: 4, placeholder: this.$t('ExtraArgsPlaceholder') },
rules: [
{
validator: (rule, value, callback) => {
try {
const lines = value.split('\n')
const regex = /^[^:]+:[^:]+$/
for (const line of lines) {
if (!regex.test(line.trim())) {
callback(new Error(this.$t('ExtraArgsFormatError')))
}
}
} catch (e) {
callback(new Error(this.$t('ExtraArgsFormatError')))
}
callback()
}
}
]
}
},
hasSaveContinue: false,
method: 'get'
}
},
methods: {
confirm(form) {
if (this.variable?.name) {
this.$emit('edit', form)
} else {
this.$emit('add', form)
}
}
}
}
</script>
<style lang='scss' scoped>
.variable-add {
::v-deep .el-form-item {
margin-bottom: 5px;
.help-block {
margin-bottom: 5px;
}
}
::v-deep .form-group-header {
.hr-line-dashed {
margin: 5px 0;
}
h3 {
margin-bottom: 10px;
}
}
}
</style>

View File

@@ -0,0 +1,74 @@
<template>
<AutoDataForm
ref="AutoDataForm"
class="variable-set"
:submit-btn-text="submitBtnText"
v-bind="$data"
:fields="fields"
@submit="confirm"
/>
</template>
<script>
import AutoDataForm from '@/components/Form/AutoDataForm/index.vue'
export default {
name: 'VariableSetForm',
components: {
AutoDataForm
},
props: {
formData: {
type: Array,
default: () => ([])
},
queryParam: {
type: String,
default: ''
}
},
data() {
return {
submitBtnText: this.$t('Confirm'),
// 防止缓存form remoteMeta
url: `/api/v1/ops/variables/form-data/?t=${new Date().getTime()}&` + this.queryParam,
form: {},
hasSaveContinue: false,
method: 'get',
hasReset: false
}
},
computed: {
fields() {
return [['', this.formData.map(item => item.var_name)]]
}
},
methods: {
confirm(form) {
this.$emit('confirm', form)
}
}
}
</script>
<style lang='scss' scoped>
.variable-set {
::v-deep .el-form-item {
margin-bottom: 5px;
.help-block {
margin-bottom: 5px;
}
}
::v-deep .form-group-header {
.hr-line-dashed {
margin: 5px 0;
}
h3 {
margin-bottom: 10px;
}
}
}
</style>

View File

@@ -78,7 +78,7 @@ export default {
formatterData = data
}
return (
<span>{formatterData}</span>
<span style={{ whiteSpace: 'pre-wrap', wordBreak: 'break-word', lineHeight: '1.2' }}>{formatterData}</span>
)
}
if (this.value instanceof Array) {
@@ -92,7 +92,7 @@ export default {
)
}
return (
<span title={this.displayValue}>{this.displayValue}</span>
<span style='white-space: pre-wrap;' title={this.displayValue}>{this.displayValue}</span>
)
}
}

View File

@@ -1,20 +1,21 @@
<template>
<div>
<div class="summary-header">
<span class="title">{{ title }}</span>
<el-card shadow="never">
<div slot="header" class="summary-header">
<span class="header-title">{{ title }}</span>
</div>
<slot>
<h3 class="no-margins ">
<span class="num" @click="handleClick">
{{ iCount }}
</span>
</h3>
<h1 class="no-margins">
<span v-if="body.disabled" class="disabled-link">{{ body.count }}</span>
<router-link v-else :to="body.route">
<span>{{ body.count }}</span>
</router-link>
</h1>
<small>{{ body.comment }}</small>
</slot>
</div>
</el-card>
</template>
<script>
export default {
name: 'SummaryCard',
props: {
@@ -22,85 +23,56 @@ export default {
type: String,
default: ''
},
body: {
rightSideLabel: {
type: Object,
default: () => ({})
},
count: {
type: [Number, String],
default: 0
},
route: {
type: [String, Object],
default: ''
},
callback: {
type: Function,
default: () => {
}
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {}
},
computed: {
iCount() {
return this.body.count || this.count
},
iRoute() {
return this.body.route || this.route
},
iDisabled() {
return this.body.disabled === undefined ? this.disabled : this.body.disabled
}
},
methods: {
handleClick() {
if (this.iDisabled) {
return
}
if (this.iRoute) {
this.$router.push(this.iRoute)
return
}
this.callback.bind(this)()
this.$emit('click')
body: {
type: Object,
default: () => ({})
}
}
}
</script>
<style lang="scss" scoped>
.summary-header {
//color: var(--color-icon-primary);
.pull-right {
float: right !important;
}
.title {
font-style: normal;
.header-title {
font-size: 14px;
margin: 0 0 7px;
font-weight: 600;
font-size: 12px;
text-transform: uppercase;
line-height: 1.2;
}
}
.no-margins {
margin: 0 !important;
.num {
font-style: normal;
font-weight: 500;
font-size: 24px;
line-height: 40px;
color: var(--color-text-primary);
cursor: pointer;
&:hover {
color: var(--color-primary);
}
.right-side ::v-deep .el-tag {
font-weight: 600;
padding: 3px 8px;
text-shadow: none;
line-height: 1;
}
h1 {
font-size: 30px;
font-weight: 100;
}
.el-card__body {
background-color: #ffffff;
color: inherit;
padding: 15px 20px 20px 20px !important;
border-color: #e7eaec;
border-image: none;
border-style: solid solid none;
border-width: 1px 0;
}
.no-margins {
margin: 0 !important;
}
.disabled-link {
color: #428bca;
}
}
</style>

View File

@@ -29,13 +29,7 @@
>
{{ option.group }}
</div>
<el-tooltip
:key="option.name"
:content="option.tip"
:disabled="!option.tip"
:open-delay="500"
placement="top"
>
<el-tooltip :key="option.name" :content="option.tip" :disabled="!option.tip" :open-delay="500" placement="top">
<el-dropdown-item
:key="option.name"
:command="[option, action]"
@@ -258,10 +252,7 @@ $color-drop-menu-border: #e4e7ed;
display: flex;
align-items: center;
padding: 2px 6px;
&:not(.is-plain) {
color: $btn-text-color;
}
color: $btn-text-color;
* {
vertical-align: baseline !important;

View File

@@ -1,62 +0,0 @@
<template>
<Dialog
:visible="iVisible"
height="300"
title="Processing"
width="300"
>
<div id="load">
<div class="spinner" />
</div>
</Dialog>
</template>
<script>
import Dialog from './index.vue'
export default {
name: 'ProcessingDialog',
components: { Dialog },
props: {
visible: {
type: Boolean,
default: false
}
},
data() {
return {}
},
computed: {
iVisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
}
}
</script>
<style lang="scss" scoped>
.spinner {
width: 100px;
height: 100px;
border: 5px solid rgba(0, 0, 0, 0.1);
border-radius: 50%;
border-top-color: #3498db;
animation: spin 1s infinite linear;
}
#load {
display: flex;
justify-content: center;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
</style>

View File

@@ -1,96 +0,0 @@
<template>
<Dialog
:show-cancel="false"
:title="title"
:visible.sync="visible"
:close-on-click-modal="false"
width="700px"
@close="onClose"
@confirm="visible = false"
>
<el-alert type="warning" :closable="false">
{{ warningText }}
<div class="secret">
<div class="row">
<span class="col">ID:</span>
<span class="value">{{ keyInfo.id }}</span>
<i class="el-icon-copy-document copy-icon" @click="handleCopy(keyInfo.id)" />
</div>
<div class="row">
<span class="col">Secret:</span>
<span class="value">{{ keyInfo.secret }}</span>
<i class="el-icon-copy-document copy-icon" @click="handleCopy(keyInfo.secret)" />
</div>
</div>
</el-alert>
</Dialog>
</template>
<script>
import i18n from '@/i18n/i18n'
import { copy } from '@/utils/common'
import Dialog from '@/components/Dialog/index'
export default {
name: 'Secret',
components: {
Dialog
},
props: {
title: {
type: String,
default: () => i18n.t('CreateAccessKey')
},
warningText: {
type: String,
default: () => i18n.t('ApiKeyWarning')
}
},
data() {
return {
keyInfo: { id: '', secret: '' },
visible: false
}
},
methods: {
show(data) {
this.keyInfo = data
this.visible = true
},
onClose() {
this.$emit('close')
},
handleCopy(value) {
copy(value)
}
}
}
</script>
<style lang='scss' scoped>
.secret {
color: #2b2f3a;
margin-top: 20px;
}
.row {
margin-bottom: 10px;
}
.col {
width: 100px;
text-align: left;
display: inline-block;
}
.copy-icon {
margin-left: 5px;
cursor: pointer;
transition: color 0.2s;
}
.value {
font-weight: 600;
}
</style>

View File

@@ -123,6 +123,7 @@ export default {
&__body {
padding: 20px 30px;
font-size: 13px;
&:has(.el-table) {
background: #f3f3f4;

View File

@@ -1,106 +0,0 @@
<template>
<el-drawer
ref="drawer"
size="61.8%"
direction="rtl"
custom-class="drawer"
:title="title"
:before-close="handleClose"
:visible.sync="dialog"
:wrapper-closable="true"
>
<div class="drawer__content">
<slot name="default" />
</div>
</el-drawer>
</template>
<script>
export default {
props: {
title: {
type: String,
default: function() {
return this.$t('AddAccount')
}
}
},
data() {
return {
dialog: true,
loading: false,
formLabelWidth: '80px'
}
},
methods: {
handleClose(done) {
this.$emit('close-drawer')
done()
},
cancelForm() {
this.loading = false
this.dialog = false
}
}
}
</script>
<style scoped lang='scss'>
::v-deep .drawer {
min-width: 565px;
.el-drawer__header {
margin-bottom: 20px;
span {
font-size: 16px;
font-weight: 800;
color: var(--color-text-primary);
}
}
.el-drawer__body {
.drawer__content {
height: 100%;
.el-form {
position: relative;
display: flex;
flex-wrap: nowrap;
flex-direction: column;
justify-content: flex-start;
margin: unset !important;
padding-right: 50px;
height: 100%;
.el-form-item {
margin: 5px 0 5px 0;
}
.form-buttons {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
display: flex;
flex-wrap: nowrap;
padding: 0 10px 0 10px;
.el-form-item__content {
width: 100%;
display: flex;
margin: unset !important;
justify-content: center;
.el-button {
width: 50%;
border-radius: 10px;
}
}
}
}
}
}
}
</style>

View File

@@ -7,7 +7,7 @@
v-bind="$attrs"
v-on="$listeners"
>
<span
<div
v-for="(group, i) in groups"
:key="'group-'+group.name"
:slot="'id:'+group.name"
@@ -18,7 +18,7 @@
:index="i"
:line="i !== 0 && !groupHidden(groups[i - 1], i - 1)"
/>
</span>
</div>
</DataForm>
</template>

View File

@@ -1,12 +1,12 @@
import Vue from 'vue'
import ObjectSelect2 from '@/components/Form/FormFields/NestedObjectSelect2.vue'
import NestedField from '@/components/Form/AutoDataForm/components/NestedField.vue'
import Switcher from '@/components/Form/FormFields/Switcher.vue'
import rules from '@/components/Form/DataForm/rules'
import BasicTree from '@/components/Form/FormFields/BasicTree.vue'
import JsonEditor from '@/components/Form/FormFields/JsonEditor.vue'
import { assignIfNot, toSentenceCase } from '@/utils/common'
import TagInput from '@/components/Form/FormFields/TagInput.vue'
import TransferSelect from '@/components/Form/FormFields/TransferSelect.vue'
import i18n from '@/i18n/i18n'
export class FormFieldGenerator {
@@ -64,9 +64,8 @@ export class FormFieldGenerator {
}
break
case 'boolean':
type = 'checkbox'
// field.component = Switcher
// field.type = 'checkbox'
type = ''
field.component = Switcher
break
case 'list':
type = 'input'
@@ -135,9 +134,6 @@ export class FormFieldGenerator {
case 'comment':
field.el.type = 'textarea'
break
case 'users':
field.component = TransferSelect
field.el.label = field.label
}
return field
}

View File

@@ -17,7 +17,7 @@
placement="right"
popper-class="help-tips"
>
<div slot="content" v-sanitize="data.helpTip" /> <!-- Noncompliant -->
<div slot="content" v-sanitize="data.helpTip" class="help-tip-content" /> <!-- Noncompliant -->
<i class="fa fa-question-circle-o help-tip-icon" />
</el-tooltip>
</template>
@@ -71,7 +71,6 @@
<el-tooltip v-if="opt.tip" :content="opt.tip" :open-delay="500" placement="top">
<i class="el-icon-warning-outline" />
</el-tooltip>
<span v-if="data.helpText">{{ data.helpText }}</span>
</el-checkbox>
<!-- WARNING: radio label 属性来表示 value 的含义 -->
<!-- FYI: radio value 属性可以在没有 radio-group 时用来关联到同一个 v-model -->
@@ -88,7 +87,7 @@
</el-radio>
</template>
</custom-component>
<div v-if="data.helpText" :class="data.type" class="help-block">
<div v-if="data.helpText" class="help-block">
<el-alert
v-if="data.helpText.startsWith('!')"
:closable="false"
@@ -316,10 +315,6 @@ export default {
::v-deep .el-alert__icon {
font-size: 16px
}
&.checkbox {
//display: inline;
}
}
.help-tip-icon {
@@ -327,4 +322,9 @@ export default {
cursor: pointer;
}
}
.help-tip-content {
white-space: pre-wrap;
word-wrap: break-word;
}
</style>

View File

@@ -245,7 +245,7 @@ export default {
},
set(val) {
this.$emit('update:value', val)
this.$emit('change', val)
this.$emit('input', val)
}
},
iOptions() {

View File

@@ -15,6 +15,7 @@ export default {
},
data() {
return {
defaultValue: 24,
displayMapper: {
'second': this.$t('Second'), // 'sec' is the default value of 'unit
'min': this.$t('Minute'), // 'min' is the default value of 'unit

View File

@@ -5,9 +5,7 @@
v-bind="iAttrs"
@input="handleInput"
v-on="$listeners"
>
hello
</Password>
/>
</template>
<script>

View File

@@ -48,28 +48,29 @@ export default {
type: 'input-number',
el: {
min: 8,
max: 30
max: 36,
size: 'mini'
}
},
{
id: 'uppercase',
label: this.$t('Uppercase'),
type: 'checkbox'
type: 'switch'
},
{
id: 'lowercase',
label: this.$t('Lowercase'),
type: 'checkbox'
type: 'switch'
},
{
id: 'digit',
label: this.$t('Digit'),
type: 'checkbox'
type: 'switch'
},
{
id: 'symbol',
label: this.$t('SpecialSymbol'),
type: 'checkbox'
type: 'switch'
},
{
id: 'exclude_symbols',

View File

@@ -1,5 +1,5 @@
<template>
<div v-if="!loading" :class="showSetting ? 'show-setting' : 'hide-setting'">
<div :class="showSetting ? 'show-setting' : 'hide-setting'">
<div v-for="(item, index) in items" :key="item.name" class="protocol-item">
<el-input
v-model="item.port"
@@ -114,8 +114,7 @@ export default {
name: '',
items: [],
currentProtocol: {},
showDialog: false,
loading: false
showDialog: false
}
},
computed: {
@@ -144,10 +143,8 @@ export default {
watch: {
choices: {
handler(value, oldValue) {
this.loading = true
setTimeout(() => {
this.setDefaultItems(value)
this.loading = false
},)
},
deep: true,

View File

@@ -1,5 +1,5 @@
<template>
<div class="update-token">
<div>
<el-button v-show="!isShow" icon="el-icon-edit" type="text" @click="isShow=true">
{{ text }}
</el-button>
@@ -8,19 +8,14 @@
v-model.trim="curValue"
:placeholder="placeholder"
:type="type"
class="password-input"
autocomplete="new-password"
show-password
@change="onChange"
/>
<el-button size="small" type="text" @click="randomPassword">
<i class="fa fa-retweet" />
</el-button>
</div>
</template>
<script>
import { randomString } from '@/utils/string'
export default {
props: {
value: {
@@ -60,24 +55,7 @@ export default {
methods: {
onChange(e) {
this.$emit('input', this.curValue)
},
randomPassword() {
this.curValue = randomString(24, true)
this.$emit('input', this.curValue)
}
}
}
</script>
<style lang='scss' scoped>
.password-input {
width: calc(100% - 50px);
}
.update-token {
i {
color: var(--color-text-secondary);
font-size: 14px;
}
}
</style>

View File

@@ -8,7 +8,7 @@
<div v-if="tip !== ''" class="help-block">{{ tip }}</div>
<input v-model="value" hidden type="text" v-on="$listeners">
<div>
<img v-if="preview" :class="showBG ? 'show-bg' : ''" :src="preview" v-bind="$attrs" alt="">
<img :class="showBG ? 'show-bg' : ''" :src="preview" v-bind="$attrs">
</div>
</div>
</template>

View File

@@ -42,7 +42,7 @@ export default {
patterns.push([/\d/, i18n.t('NUMBER_REQUIRED')])
}
if (passwordRule['SECURITY_PASSWORD_SPECIAL_CHAR']) {
const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~@#¥……&*()——|{}【】‘;:”“'。,、?]")
const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~@#¥……&*()——|{}【】‘;:”“'。,、?_+-]")
patterns.push([pattern, i18n.t('SPECIAL_CHAR_REQUIRED')])
}
for (const [pattern, msg] of patterns) {

View File

@@ -39,6 +39,22 @@ export default {
</script>
<style scoped>
html:lang(en) .quick-actions ::v-deep button {
width: 80px;
}
html:lang(ja) .quick-actions ::v-deep button {
width: 100px;
}
html:lang(zh-tw) .quick-actions ::v-deep button {
width: 65px;
}
html:lang(zh-cn) .quick-actions ::v-deep button {
width: 65px;
}
.quick-actions ::v-deep table {
width: 100%;
}
@@ -58,7 +74,6 @@ export default {
.quick-actions ::v-deep button {
padding: 4px 5px;
font-size: 13px;
width: 65px;
span {
overflow: hidden;

View File

@@ -3,7 +3,7 @@
v-if="showColumnSettingPopover"
:cancel-title="$tc('RestoreDefault')"
:destroy-on-close="true"
:title="$tc('TableSetting')"
:title="$tc('ListPreference')"
:visible.sync="showColumnSettingPopover"
top="10%"
width="50%"

View File

@@ -348,8 +348,6 @@ export default {
let configColumns = config.columns || allColumnNames
const columnsExclude = config.columnsExclude || []
const columnsAdd = config.columnsAdd || []
configColumns = configColumns.concat(columnsAdd)
configColumns = configColumns.filter(item => !columnsExclude.includes(item))
// 解决后端 API 返回字段中包含 actions 的问题;

View File

@@ -1,32 +0,0 @@
<template>
<div>
<CardTable
ref="table"
:columns="3"
:sub-component="subComponent"
v-bind="$attrs"
/>
</div>
</template>
<script type="text/jsx">
import CardTable from '@/components/Table/CardTable'
import CardPanel from './components/CardPanel.vue'
export default {
name: 'SmallCard',
components: {
CardTable
},
data() {
return {
subComponent: CardPanel
}
},
methods: {
reloadTable() {
this.$refs.table.reloadTable()
}
}
}
</script>

View File

@@ -1,176 +0,0 @@
<template>
<div class="account-panel">
<el-row :gutter="20">
<el-col :span="21">
<div class="title">
<span>{{ object.name }}</span>
</div>
</el-col>
<el-col v-if="iActions.length !== 0" :span="3" @click.native="handleClick($event)">
<el-dropdown>
<el-link :underline="false" type="primary">
<i class="el-icon-more el-icon--right" style="color: var(--color-text-primary)" />
</el-link>
<el-dropdown-menu default="dropdown">
<el-dropdown-item
v-for="action in iActions"
:key="action.name"
:disabled="action.disabled"
@click.native="action.callback(object)"
>
<i v-if="action.icon" :class="action.icon" /> {{ action.name }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-row>
<el-divider />
<el-row :gutter="20" class="panel-content">
<el-col :span="6" class="panel-image">
<el-image :src="imageUrl" fit="contain" />
</el-col>
<el-col :span="18" class="panel-info">
<InfoPanel
v-for="(obj, index) in getInfos(object)"
:key="index"
:content="obj.content"
:title="obj.title"
/>
</el-col>
</el-row>
</div>
</template>
<script>
import InfoPanel from './InfoPanel'
export default {
name: 'CardPanel',
components: {
InfoPanel
},
props: {
tableConfig: {
type: Object,
default: () => ({})
},
object: {
type: Object,
required: true
},
actions: {
type: Array,
default: () => []
},
infos: {
type: Array,
default: () => []
},
getImage: {
type: Function,
default: (obj) => ''
},
getInfos: {
type: Function,
default: (obj) => []
},
handleUpdate: {
type: Function,
default: () => {}
}
},
data() {
return {
defaultActions: [
{
id: 'update',
name: this.$tc('Update'),
icon: 'el-icon-edit',
callback: this.handleUpdate,
disabled: this.isDisabled('change')
},
{
id: 'delete',
name: this.$tc('Delete'),
icon: 'el-icon-delete',
callback: this.handleDelete,
disabled: this.isDisabled('delete')
}
]
}
},
computed: {
imageUrl() {
return this.getImage(this.object)
},
iActions() {
const mergedActions = new Map()
this.defaultActions.forEach(a => {
mergedActions.set(a.id, { ...a })
})
this.actions.forEach(a => {
mergedActions.set(a.id, { ...a })
})
return Array.from(mergedActions.values())
}
},
methods: {
isDisabled(action) {
const app = this.tableConfig.permissions?.app
const resource = this.tableConfig.permissions?.resource
return !this.$hasPerm(`${app}.${action}_${resource}`)
},
handleClick(event) {
event.stopPropagation()
},
handleDelete() {
const url = this.tableConfig.url
this.$confirm(this.$tc('DeleteConfirmMessage'), this.$tc('Delete'), {
confirmButtonText: this.$tc('Confirm'),
cancelButtonText: this.$tc('Cancel'),
type: 'warning'
}).then(() => {
this.$axios.delete(`${url}${this.object.id}/`).then(() => {
this.$message({
type: 'success',
message: this.$tc('DeleteSuccess')
})
this.$emit('refresh')
})
})
}
}
}
</script>
<style lang="scss" scoped>
.account-panel {
display: flex;
flex-direction: column;
//height: 100%;
cursor: pointer;
.title {
text-align: left;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.panel-content {
display: flex;
height: 100px;
padding: 10px 0;
.panel-image {
margin: auto 5px;
}
}
.el-divider--horizontal {
margin: 5px 0;
}
}
</style>

View File

@@ -10,7 +10,7 @@
<IBox v-if="totalData.length === 0">
<el-empty :description="$t('NoData')" :image-size="200" class="no-data" style="padding: 20px" />
</IBox>
<el-col v-for="(d, index) in totalData" :key="index" :lg="24 / columns" :md="12" :sm="24" style="min-width: 335px;">
<el-col v-for="(d, index) in totalData" :key="index" :lg="8" :md="12" :sm="24" style="min-width: 335px;">
<el-card
:body-style="{ 'text-align': 'center', 'padding': '15px' }"
:class="{'is-disabled': isDisabled(d)}"
@@ -19,14 +19,7 @@
@click.native="onView(d)"
>
<keep-alive>
<component
:is="subComponent"
v-if="subComponent"
:object="d"
:table-config="tableConfig"
v-bind="subComponentProps"
@refresh="getList"
/>
<component :is="subComponent" v-if="subComponent" :object="d" @refresh="getList" />
<slot v-else :index="index" :item="d">
<span v-if="d.edition === 'enterprise'" class="enterprise">
{{ $t('Enterprise') }}
@@ -92,10 +85,6 @@ export default {
},
props: {
// 定义 table 的配置
columns: {
type: Number,
default: 3
},
tableConfig: {
type: Object,
default: () => ({})
@@ -111,10 +100,6 @@ export default {
subComponent: {
type: Object,
default: () => null
},
subComponentProps: {
type: Object,
default: () => ({})
}
},
data() {

View File

@@ -14,7 +14,7 @@
@select="selectStrategy.onSelect"
v-on="$listeners"
@selection-change="selectStrategy.onSelectionChange"
@select-all="selectStrategy.onSelectAll($event, canSelect)"
@select-all="handleSelectAll($event, canSelect)"
@sort-change="onSortChange"
>
<!--TODO 不用jsx写, 感觉template逻辑有点不清晰了-->
@@ -1106,6 +1106,12 @@ export default {
this.page = val
this.getList()
},
handleSelectAll(e, canSelect) {
this.loading = true
this.selectStrategy.onSelectAll(e, canSelect, () => {
this.loading = false
})
},
/**
* 切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否
*

View File

@@ -6,6 +6,8 @@
* 多选策略接口
*/
class StrategyAbstract {
cachedSelectedData = []
constructor(elDataTable) {
this.elDataTable = elDataTable
// 绑定this后可直接在template中使用
@@ -34,12 +36,14 @@ class StrategyNormal extends StrategyAbstract {
onSelectionChange(val) {
this.elDataTable.selected = val
}
/**
* toggleRowSelection和clearSelection的表现与el-table一致
*/
toggleRowSelection(...args) {
return this.elTable.toggleRowSelection(...args)
}
clearSelection() {
return this.elTable.clearSelection()
}
@@ -50,12 +54,12 @@ class StrategyNormal extends StrategyAbstract {
*/
class StrategyPersistSelection extends StrategyAbstract {
/**
* el-tableselection-change事件不适用于开启跨页保存的情况。
* 比如当开启persistSelection时发生以下两个场景
* el-tableselection-change 事件不适用于开启跨页保存的情况。
* 比如,当开启 persistSelection时发生以下两个场景
* 1. 用户点击翻页
* 2. 用户点击行首的切换全选项按钮,清空当前页多选项数据
* 其中场景1应该保持selected不变而场景2只应该从selected移除当前页所有行保留其他页面的多选状态。
* 但el-tableselection-change事件在两个场景中无差别发生所以这里不处理这个事件
* 其中场景 1 应该保持 selected 不变;而场景 2 只应该从 selected 移除当前页所有行,保留其他页面的多选状态。
* 但 el-tableselection-change 事件在两个场景中无差别发生,所以这里不处理这个事件
*/
/**
@@ -63,53 +67,108 @@ class StrategyPersistSelection extends StrategyAbstract {
*/
onSelect(selection, row) {
const isChosen = selection.indexOf(row) > -1
this.toggleRowSelection(row, isChosen)
}
/**
* 用户切换当前页的多选
*/
onSelectAll(selection, selectable = () => true) {
const isSelected = !!selection.length
this.elDataTable.data.forEach(r => {
onSelectAll(selection, selectable = () => true, callback) {
const { id, selected, data } = this.elDataTable
const selectedIds = new Set(selected.map(r => r[id]))
// 获取当前所有已选择的项
const selectedRows = data.filter(r => selection.includes(r))
// 判断是否已全选
const isSelected = data.every(r => selectable(r) && selectedRows.includes(r))
const rowsToSelect = []
const rowsToDeselect = []
data.forEach(r => {
if (selectable(r)) {
this.toggleRowSelection(r, isSelected)
const isRowSelected = selectedIds.has(r[id])
if (isSelected && !isRowSelected) {
rowsToSelect.push(r)
} else if (!isSelected && isRowSelected) {
rowsToDeselect.push(r)
}
}
})
if (isSelected) {
rowsToSelect.forEach(row => {
selected.push(row)
selectedIds.add(row[id])
})
rowsToDeselect.forEach(row => {
this.elDataTable.toggleRowSelection(row, true)
})
} else {
rowsToDeselect.forEach(row => {
const index = selected.findIndex(item => item[id] === row[id])
if (index !== -1) {
selected.splice(index, 1)
}
selectedIds.delete(row[id])
})
rowsToSelect.forEach(row => {
this.elDataTable.toggleRowSelection(row, false)
})
}
// this.elTable.selected = Array.from(selectedIds).map(id => {
// return data.find(r => r[id] === id)
// })
callback()
}
/**
* toggleRowSelectionclearSelection管理elDataTableselected数组
* 记得最后要将状态同步到el-table中
* toggleRowSelectionclearSelection 管理 elDataTableselected 数组
* 记得最后要将状态同步到 el-table
*/
toggleRowSelection(row, isSelected) {
const { id, selected } = this.elDataTable
const foundIndex = selected.findIndex(r => r[id] === row[id])
if (typeof isSelected === 'undefined') {
isSelected = foundIndex <= -1
}
if (isSelected && foundIndex === -1) {
selected.push(row)
} else if (!isSelected && foundIndex > -1) {
selected.splice(foundIndex, 1)
}
this.elDataTable.$emit('toggle-row-selection', isSelected, row)
this.updateElTableSelection()
}
clearSelection() {
this.elDataTable.selected = []
this.updateElTableSelection()
}
/**
* 将selected状态同步到el-table中
*/
updateElTableSelection() {
const { data, id, selected } = this.elDataTable
// 历史勾选的行已经不在当前页了所以要将当前页的行数据和selected合并
const mergeData = _.uniqWith([...data, ...selected], _.isEqual)
mergeData.forEach(r => {
const isSelected = !!selected.find(r2 => r[id] === r2[id])
if (!this.elTable) {
return
}
this.elTable.toggleRowSelection(r, isSelected)
})
}

View File

@@ -1,263 +0,0 @@
<template>
<div v-if="filters || summary" :class="isExpand ? 'expand': 'shrink' " class="quick-filter">
<div v-show="isExpand" class="quick-filter-wrap">
<div v-if="filters" class="quick-filter-zone">
<div v-for="category in iFilters" :key="category.label" class="item-zone">
<div>
<h5>{{ category.label }}</h5>
<div class="filter-options">
<span
v-for="option in category.options"
:key="option.label"
:class="option.active ? 'active' : ''"
class="item"
@click="handleFilterClick(option)"
>
{{ option.label }}
<i class="el-icon-circle-check" />
</span>
</div>
</div>
</div>
</div>
<div v-if="summary" class="summary-zone">
<span v-for="item of iSummary" :key="item.title" class="summary-block">
<SummaryCard
:class="item.active ? 'active' : ''"
:count="item.count"
:title="item.title"
@click="handleFilterClick(item)"
/>
</span>
</div>
</div>
<div class="expand-bar-wrap">
<div class="expand-bar" @click="toggle">
<i :class="isExpand ? 'expand': 'shrink' " class="fa fa-angle-double-up" />
<span v-show="!isExpand"> 展开过滤器 </span>
</div>
</div>
</div>
</template>
<script>
import SummaryCard from '@/components/Cards/SummaryCard'
export default {
name: 'QuickFilter',
components: { SummaryCard },
props: {
filters: {
type: Array,
default: () => []
},
summary: {
type: Array,
default: null
},
expand: {
type: Boolean,
default: true
}
},
data() {
return {
isExpand: this.expand,
iFilters: this.cleanFilters(),
iSummary: this.cleanSummary(),
filtered: {},
activeFilters: []
}
},
computed: {},
watch: {
isExpand(val) {
this.$emit('expand', val)
}
},
mounted() {
},
methods: {
cleanSummary() {
if (!this.summary) {
return []
}
return this.summary.map(item => {
return {
category: 'summary',
label: item.title,
...item,
filter: item.filter || {},
active: false
}
})
},
cleanFilters() {
if (!this.filters) {
return []
}
return this.filters.map(category => {
return {
...category,
options: category.options.map(option => {
return {
category: category.label,
...option,
active: false,
filter: option.filter || {}
}
})
}
})
},
toggle() {
this.isExpand = !this.isExpand
},
handleFilterClick(option) {
if (!option.active) {
this.activeFilters = this.activeFilters.filter(item => {
const conflict = Object.keys(item.filter).some(key => {
return Object.keys(option.filter).includes(key)
})
if (conflict) {
item.active = false
}
return !conflict
})
this.activeFilters.push(option)
} else {
this.activeFilters = this.activeFilters.filter(item => {
return item.label !== option.label && item.category !== option.category
})
}
option.active = !option.active
this.activeFilters.forEach(item => {
this.filtered = { ...item.filter }
})
this.$emit('filter', this.filtered)
}
}
}
</script>
<style lang='scss' scoped>
.quick-filter {
background: white;
padding: 10px 10px 10px 20px;
margin-bottom: 10px;
display: flex;
place-content: stretch flex-end;
justify-content: center;
align-content: stretch;
box-shadow: 0 1px 1px 0 rgba(54, 58, 80, .32);
&.shrink {
background: inherit;
padding: 0;
margin-bottom: 0;
box-shadow: none;
}
.quick-filter-wrap {
display: inline-block;
width: calc(100% - 70px);
.summary-zone {
padding-top: 10px;
display: flex;
justify-content: space-between;
}
.summary-block {
.active {
::v-deep .no-margins .num {
color: var(--color-primary);
&::after {
content: "\e720";
font-family: element-icons !important;
font-size: 13px;
line-height: 1;
}
}
}
}
.quick-filter-zone {
display: flex;
justify-content: flex-start;
flex-wrap: wrap; /* 允许 item-zone 换行 */
gap: 10px;
h5 {
font-weight: 600;
text-transform: uppercase;
font-size: 12px;
margin-bottom: .5rem;
line-height: 1.2;
display: inline-block;
}
.item-zone {
margin-right: 30px;
margin-bottom: 5px;
}
.item {
display: inline-block;
margin-right: 5px;
color: #303133;
font-size: 12px;
cursor: pointer;
i {
visibility: hidden;
margin-left: -3px;
}
&.active {
color: var(--color-primary);
font-weight: 500;
i {
visibility: visible;
}
}
&:hover {
color: var(--color-primary);
}
}
ul {
list-style: none outside none;
margin-block-start: 0;
padding-left: 0;
}
}
}
}
.filter-options {
display: block;
}
.expand-bar-wrap {
margin: auto 0;
min-width: 60px;
.expand-bar {
float: right;
display: block;
cursor: pointer;
i {
padding: 5px;
&.shrink {
transform: rotate(180deg);
}
}
}
}
</style>

View File

@@ -1,37 +1,25 @@
<template>
<div>
<DataActions
v-if="hasLeftActions && iActions.length > 0"
:actions="iActions"
class="header-action"
v-bind="$attrs"
/>
<Drawer v-if="showDrawer" @close-drawer="handleCloseDrawer">
<component :is="dynamicTemplateComponent" />
</Drawer>
</div>
<DataActions
v-if="hasLeftActions && iActions.length > 0"
:actions="iActions"
class="header-action"
v-bind="$attrs"
/>
</template>
<script>
import { cleanActions } from './utils'
import { createSourceIdCache } from '@/api/common'
import { getErrorResponseMsg } from '@/utils/common'
import i18n from '@/i18n/i18n'
import Drawer from '@/components/Drawer/index.vue'
import DataActions from '@/components/DataActions/index.vue'
import AccountTemplateCreate from '@/views/accounts/AccountTemplate/AccountTemplateCreateUpdate.vue'
import { createSourceIdCache } from '@/api/common'
import { cleanActions } from './utils'
import { getErrorResponseMsg } from '@/utils/common'
const defaultTrue = { type: [Boolean, Function, String], default: true }
const defaultFalse = { type: [Boolean, Function, String], default: false }
export default {
name: 'LeftSide',
components: {
Drawer,
DataActions,
AccountTemplateCreate
DataActions
},
props: {
hasLeftActions: defaultTrue,
@@ -102,8 +90,6 @@ export default {
data() {
const vm = this
return {
showDrawer: false,
dynamicTemplateComponent: null,
defaultMoreActions: [
{
title: this.$t('DeleteSelected'),
@@ -208,7 +194,6 @@ export default {
methods: {
handleCreate() {
let route
if (typeof this.createRoute === 'string') {
route = { name: this.createRoute }
route.name = this.createRoute
@@ -217,27 +202,14 @@ export default {
} else if (typeof this.createRoute === 'object') {
route = this.createRoute
}
this.$log.debug('handle create')
if (this.createInNewPage) {
const { href } = this.$router.resolve(route)
window.open(href, '_blank')
} else {
if (route.isPam) {
this.showDrawer = true
this.dynamicTemplateComponent = route.name
return
}
this.$router.push(route)
}
},
handleCloseDrawer() {
this.showDrawer = false
this.dynamicTemplateComponent = null
},
defaultBulkDeleteCallback({ selectedRows, reloadTable }) {
const msg = this.$t('DeleteWarningMsg') + ' ' + selectedRows.length + ' ' + this.$t('Rows') + ' ?'
const title = this.$tc('Info')
@@ -276,17 +248,3 @@ export default {
}
}
</script>
<style scoped lang="scss">
::v-deep .ibox {
height: 100% !important;
margin: unset !important;
border: unset !important;
.el-card__body {
padding-top: unset !important;
padding-bottom: unset !important;
height: 100% !important;
}
}
</style>

View File

@@ -106,7 +106,7 @@ export default {
{
name: 'actionSetting',
icon: 'system-setting',
tip: this.$t('TableSetting'),
tip: this.$t('ListPreference'),
has: this.hasColumnSetting,
callback: this.handleTableSettingClick.bind(this)
},
@@ -185,6 +185,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
padding-left: 10px;
height: 30px;
line-height: 30px;

View File

@@ -1,5 +1,5 @@
<template>
<div :class="device" class="table-header clearfix container">
<div :class="device" class="table-header clearfix">
<slot name="header">
<LeftSide
v-if="hasLeftActions"
@@ -10,7 +10,6 @@
v-on="$listeners"
@init-actions-done="handleActionsDone"
/>
<RightSide
v-if="hasRightActions"
:selected-rows="selectedRows"
@@ -19,7 +18,6 @@
v-bind="$attrs"
v-on="$listeners"
/>
<div :class="searchClass" class="search">
<LabelSearch
v-if="hasLabelSearch"
@@ -160,7 +158,7 @@ $headerHeight: 30px;
.table-header {
.left-side {
display: block;
//float: left;
float: left;
::v-deep .action-item.el-dropdown > .el-button {
height: 100%;
@@ -168,14 +166,13 @@ $headerHeight: 30px;
}
.right-side {
//float: right;
float: right;
height: 30px;
}
.search {
display: flex;
flex-direction: row;
justify-content: flex-end;
.right-side-item.action-search {
border: 1px solid var(--color-border);
@@ -184,60 +181,65 @@ $headerHeight: 30px;
}
.search.left {
float: left;
padding: 0 !important;
gap: 10px;
}
.search.right {
display: flex;
flex-wrap: wrap;
padding-right: 10px;
float: right;
}
}
.container {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 10px 0;
&.mobile {
justify-content: flex-start;
.left-side {
gap: 0;
}
.search {
justify-content: flex-start;
gap: 10px;
}
}
}
.left-side {
order: 1;
}
.search {
order: 2;
flex-grow: 1; /* This allows it to grow and fill available space */
}
.right-side {
order: 3;
}
/* When .left-side is not present, adjust the layout */
.container:not(:has(.left-side)) .search {
margin-right: auto; /* Pushes .search to the left */
justify-content: flex-start;
}
.export-item {
display: block;
padding: 5px 20px;
}
.mobile .search {
display: inherit;
}
.mobile .search .datepicker {
margin-left: 0;
}
.mobile .search.right {
clear: both;
float: none;
padding-top: 10px;
.label-search {
margin-right: 0;
::v-deep .el-button.label-button {
border: 1px solid var(--color-border);
}
::v-deep .label-cascader {
display: block;
width: 100%;
}
}
}
.mobile .search.right .action-search {
display: inline-block;
width: 100%;
margin-top: 5px;
}
.mobile .right-side {
padding-top: 3px;
}
@media (max-width: 481px) {
.mobile .right-side {
float: left;
margin-left: -15px;
}
.mobile .left-side {
width: 100%;
}
}
</style>

View File

@@ -1,6 +1,5 @@
<template>
<div>
<QuickFilter :filters="quickFilters" :summary="quickSummary" @filter="filter" />
<TableAction
v-if="hasActions"
:date-pick="handleDateChange"
@@ -32,13 +31,11 @@ import IBox from '../../IBox/index.vue'
import TableAction from './TableAction/index.vue'
import Emitter from '@/mixins/emitter'
import AutoDataTable from '../AutoDataTable/index.vue'
import QuickFilter from './QuickFilter.vue'
import { getDayEnd, getDaysAgo } from '@/utils/time'
export default {
name: 'ListTable',
components: {
QuickFilter,
AutoDataTable,
TableAction,
IBox
@@ -54,14 +51,6 @@ export default {
headerActions: {
type: Object,
default: () => ({})
},
quickFilters: {
type: Array,
default: () => null
},
quickSummary: {
type: Array,
default: () => null
}
},
data() {
@@ -219,25 +208,6 @@ export default {
})
},
methods: {
handleQuickFilter(option) {
if (option.route) {
this.$router.push(option.route)
return
}
if (option.filter) {
const filter = { ...option.filter }
if (option.active) {
for (const key in filter) {
filter[key] = ''
}
}
this.filter(option.filter)
return
}
if (option.callback) {
option.callback(option.active)
}
},
handleActionInitialDone() {
setTimeout(() => {
this.actionInit = true

View File

@@ -135,7 +135,7 @@ export default {
{
name: 'clone',
title: this.$t('Duplicate'),
type: 'primary',
type: 'info',
has: colActions.hasClone,
can: colActions.canClone,
callback: colActions.onClone,

View File

@@ -1,158 +0,0 @@
<template>
<span class="conform-td">
<span v-if="iValue === '0'">
<el-dropdown trigger="click" @command="handleRisk">
<el-button class="confirm action" size="mini">
<i class="fa fa-check" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="item of iActions" :key="item.name" :command="item.name">
{{ item.label }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-tooltip :content="$tc('Ignore')" :open-delay="400">
<el-button class="ignore action" size="mini">
<svg-icon icon-class="ignore" />
</el-button>
</el-tooltip>
</span>
<el-tooltip v-else :content="iLabel" :open-delay="400" class="platform-status">
<span v-if="iValue === '1' ">
<i class="fa fa-check color-primary" />
</span>
<span v-else>
<svg-icon icon-class="ignore" />
</span>
</el-tooltip>
<ProcessingDialog :visible="processing" />
</span>
</template>
<script>
import BaseFormatter from './base.vue'
import ProcessingDialog from '@/components/Dialog/ProcessingDialog.vue'
export default {
name: 'ConfirmOrIgnoreFormatter',
components: { ProcessingDialog },
extends: BaseFormatter,
props: {
formatterArgsDefault: {
type: Object,
default() {
return {
confirm: ({ row, cellValue }) => {
},
ignore: ({ row, cellValue }) => {
},
remove: ({ row, cellValue }) => {
},
confirmIcon: 'fa fa-check'
}
}
}
},
data() {
return {
formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs),
processing: false
}
},
computed: {
iValue() {
if (this.cellValueIsLabelChoice()) {
return this.cellValue.value
} else {
return this.cellValue
}
},
iLabel() {
if (this.cellValueIsLabelChoice()) {
return this.cellValue.label
} else {
return this.cellValue
}
},
iActions() {
return this.getActions()
}
},
methods: {
handleRemove() {
this.formatterArgs.remove({ row: this.row, cellValue: this.cellValue })
},
handleRisk(cmd) {
const data = {
asset: this.row.asset.id,
username: this.row.username,
action: cmd,
risk: ''
}
this.processing = true
this.$axios.post(`/api/v1/accounts/account-risks/handle/`, data).then(() => {
if (cmd === 'add_account') {
this.row.present = true
}
this.row.status = { 'value': '1' }
}).finally(() => {
setTimeout(() => {
this.processing = false
}, 500)
})
},
getActions() {
const actions = [
// {
// name: 'disable_account',
// label: this.$t('Disable remote account'),
// has: this.row.remote_present
// },
{
name: 'delete_remote',
label: this.$t('Delete remote account'),
has: this.row.remote_present
},
{
name: 'add_account',
label: this.$t('Add account'),
has: !this.row.present
}
]
return actions.filter(action => {
return action.has
})
}
}
}
</script>
<style lang='scss' scoped>
.action.el-button--mini {
cursor: pointer;
padding: 1px 4px;
&.confirm {
::v-deep i {
color: var(--color-primary);
}
}
&.remove {
::v-deep i {
color: var(--color-danger);
}
}
&.ignore {
::v-deep svg.svg-icon {
}
}
}
.action.ignore {
margin-left: 2px;
}
</style>

View File

@@ -131,6 +131,16 @@ export default {
}
},
computed: {},
watch: {
cellValue: {
handler(newValue) {
if (newValue) {
this.initial = this.formatterArgs.getLabels(this.cellValue)
this.iLabels = [...this.initial]
}
}
}
},
mounted() {
this.initial = this.formatterArgs.getLabels(this.cellValue)
this.iLabels = [...this.initial]

View File

@@ -1,60 +0,0 @@
<template>
<span class="platform-td">
<span class="icon-zone">
<img :src="icon" alt="icon" class="asset-icon">
</span>
<span class="platform-name">{{ value.name }}</span>
</span>
</template>
<script>
import BaseFormatter from './base.vue'
import { loadPlatformIcon } from '@/utils/jms'
export default {
name: 'PlatformFormatter',
extends: BaseFormatter,
props: {
formatterArgsDefault: {
type: Object,
default() {
return {
platformAttr: ''
}
}
}
},
data() {
return {
formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
}
},
computed: {
icon() {
return loadPlatformIcon(this.value.name, this.value.type)
},
value() {
if (!this.formatterArgs.platformAttr) {
return this.cellValue
} else {
return _.get(this.row, this.formatterArgs.platformAttr)
}
}
},
methods: {}
}
</script>
<style scoped>
.icon-zone {
display: inline-block;
width: 1.5em;
}
.asset-icon {
height: 1.5em;
vertical-align: -0.2em;
fill: currentColor;
}
</style>

View File

@@ -1,24 +1,8 @@
<template>
<div class="content">
<span v-if="realValue" :class="formatterArgs.actionLeft ? 'left' : 'right'" class="action">
<template v-for="(item, index) in iActions">
<el-tooltip
v-if="item.has"
:key="index"
:content="item.tooltip"
:open-delay="500"
effect="dark"
placement="top"
>
<i :class="[item.class, item.icon]" class="fa" @click="item.action()" />
</el-tooltip>
</template>
</span>
<el-tooltip
v-if="!isEdit"
:content="currentValue"
:disabled="!isShow"
:open-delay="500"
placement="top"
>
<pre class="text" style="cursor: pointer">{{ currentValue }}</pre>
@@ -32,6 +16,21 @@
size="small"
@blur="onEditBlur"
/>
<span v-if="realValue" class="action">
<template v-for="(item, index) in iActions">
<el-tooltip
v-if="item.has"
:key="index"
:content="item.tooltip"
effect="dark"
open-delay="500"
placement="top"
>
<i :class="[item.class, item.icon]" class="fa" @click="item.action()" />
</el-tooltip>
</template>
</span>
</div>
</template>
@@ -40,7 +39,7 @@ import { copy, downloadText } from '@/utils/common'
import BaseFormatter from '@/components/Table/TableFormatters/base.vue'
export default {
name: 'SecretViewerFormatter',
name: 'ShowKeyCopyFormatter',
extends: BaseFormatter,
props: {
formatterArgsDefault: {
@@ -52,9 +51,7 @@ export default {
hasDownload: true,
hasCopy: true,
hasEdit: true,
defaultShow: false,
secretFrom: 'cellValue', // fromCellValue or api,
actionLeft: false
defaultShow: false
}
}
}
@@ -64,8 +61,7 @@ export default {
isEdit: false,
realValue: this.cellValue,
formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs || {}),
isShow: false,
getIt: false
isShow: false
}
},
computed: {
@@ -111,9 +107,6 @@ export default {
tooltip: this.$t('Copy')
}
]
if (this.formatterArgs.actionLeft) {
actions.reverse()
}
return actions
},
currentValue() {
@@ -124,45 +117,20 @@ export default {
}
}
},
watch: {
cellValue: {
handler: function(val) {
this.realValue = val
},
immediate: true
}
},
mounted() {
this.isShow = this.formatterArgs.defaultShow
if (this.formatterArgs.secretFrom !== 'cellValue') {
this.realValue = '--'
}
},
methods: {
async getAccountSecret() {
if (this.formatterArgs.secretFrom === 'cellValue' || this.getIt) {
return
}
const res = await this.$axios.get(`/api/v1/accounts/account-secrets/${this.row.id}/`)
this.realValue = res.secret
},
async onShow() {
await this.getAccountSecret()
onShow() {
this.isShow = !this.isShow
setTimeout(() => {
this.isShow = false
}, 10000)
},
async onCopy() {
await this.getAccountSecret()
onCopy() {
copy(this.realValue)
},
async onDownload() {
await this.getAccountSecret()
onDownload() {
downloadText(this.realValue, this.name + '.txt')
},
async onEdit() {
await this.getAccountSecret()
onEdit() {
this.isEdit = !this.isEdit
if (this.isEdit) {
this.$nextTick(() => {
@@ -178,7 +146,7 @@ export default {
</script>
<style lang="scss" scoped>
.content {
display: inline-block;
display: flex;
width: 100%;
overflow: hidden;
//white-space: nowrap;
@@ -187,7 +155,6 @@ export default {
.text {
flex: 1;
display: inline;
margin: 0;
padding: 0;
overflow: hidden;
@@ -196,17 +163,13 @@ export default {
}
.action {
font-size: 13px;
float: right;
font-size: 15px;
cursor: pointer;
margin-left: 1px;
display: inline;
&.right {
float: right;
}
margin-left: 5px;
.fa {
margin-right: 5px;
margin-right: 10px;
&:hover {
color: var(--color-primary);

View File

@@ -24,6 +24,9 @@ export default {
},
isDisplay(row) {
return true
},
callback({ row }) {
return null
}
}
}
@@ -49,10 +52,11 @@ export default {
methods: {
onChange(val) {
this.$axios.patch(this.patchUrl, this.patchData).then(res => {
this.$message.success(this.$t('updateSuccessMsg'))
this.formatterArgs.callback(this.row)
this.$message.success(this.$t('UpdateSuccessMsg'))
}).catch(err => {
this.value = !val
this.$message.error(this.$t('updateErrorMsg' + ' ' + err))
this.$message.error(this.$t('UpdateErrorMsg' + ' ' + err))
})
}
}

View File

@@ -47,11 +47,6 @@ export default {
return {
formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
}
},
methods: {
cellValueIsLabelChoice() {
return typeof this.cellValue === 'object' && this.cellValue['value'] !== undefined
}
}
}
</script>

View File

@@ -6,7 +6,7 @@ import ActionsFormatter from './ActionsFormatter.vue'
import DeleteActionFormatter from './DeleteActionFormatter.vue'
import DateFormatter from './DateFormatter.vue'
import AccountShowFormatter from './GrantedAccountShowFormatter.vue'
import SecretViewerFormatter from './SecretViewerFormatter.vue'
import ShowKeyCopyFormatter from './ShowKeyCopyFormatter.vue'
import DialogDetailFormatter from './DialogDetailFormatter.vue'
import EditableInputFormatter from './EditableInputFormatter.vue'
import StatusFormatter from './StatusFormatter.vue'
@@ -18,8 +18,6 @@ import ProtocolsFormatter from './ProtocolsFormatter.vue'
import TagChoicesFormatter from './TagChoicesFormatter.vue'
import SwitchFormatter from './SwitchFormatter.vue'
import AccountInfoFormatter from './AccountInfoFormatter.vue'
import PlatformFormatter from './PlatformFormatter.vue'
import DiscoverConfirmFormatter from './DiscoverConfirmFormatter.vue'
export default {
DetailFormatter,
@@ -29,7 +27,7 @@ export default {
DeleteActionFormatter,
DateFormatter,
AccountShowFormatter,
SecretViewerFormatter,
ShowKeyCopyFormatter,
DialogDetailFormatter,
ArrayFormatter,
EditableInputFormatter,
@@ -41,9 +39,7 @@ export default {
TagChoicesFormatter,
LabelsFormatter,
SwitchFormatter,
PlatformFormatter,
AccountInfoFormatter,
DiscoverConfirmFormatter
AccountInfoFormatter
}
export {
@@ -54,7 +50,7 @@ export {
DeleteActionFormatter,
DateFormatter,
AccountShowFormatter,
SecretViewerFormatter,
ShowKeyCopyFormatter,
DialogDetailFormatter,
ArrayFormatter,
EditableInputFormatter,
@@ -66,7 +62,5 @@ export {
TagChoicesFormatter,
LabelsFormatter,
SwitchFormatter,
PlatformFormatter,
DiscoverConfirmFormatter,
AccountInfoFormatter
}

View File

@@ -202,9 +202,10 @@ export default {
label: current.label,
value: valueDecode
}
if (curChildren.length > 0) {
for (const item of curChildren) {
if (valueDecode === item.value) {
if (valueDecode === String(item.value)) {
searchFieldOption.valueLabel = item.label
break
}

View File

@@ -43,8 +43,6 @@
:key="componentKey"
ref="ListTable"
:header-actions="headerActions"
:quick-filters="quickFilters"
:quick-summary="quickSummary"
:table-config="iTableConfig"
v-on="$listeners"
/>
@@ -245,7 +243,7 @@ $origin-color: #ffffff;
text-align: center;
padding: 5px 0;
border: 1px solid #DCDFE6;
background-color: #f3f3f3;
background-color: #fff;
border-radius: 2px;
cursor: pointer;
height: 30px;

View File

@@ -1,22 +1,15 @@
<template>
<DataZTree ref="dataztree" :setting="treeSetting" class="data-z-tree" v-on="$listeners">
<slot slot="rMenu">
<div v-if="menu && menu.length > 0">
<span v-for="item in menu" :key="item.id">
<li
v-if="hasMenuItem(item)"
:id="item.id"
:key="item.id"
:class="{ 'disabled': checkDisabled(item) }"
class="rmenu"
tabindex="-1"
@click="onMenuItemClick(item)"
>
<Icon :icon="item.icon" class="icon" /> {{ item.name }}
</li>
<li v-if="item.divided" class="divider" />
</span>
</div>
<slot v-if="treeSetting.hasRightMenu" slot="rMenu">
<li v-if="treeSetting.showCreate" id="m_create" class="rmenu" tabindex="-1" @click="createTreeNode">
<i class="fa fa-plus-square-o" /> {{ this.$t('CreateNode') }}
</li>
<li v-if="treeSetting.showUpdate" id="m_edit" class="rmenu" tabindex="-1" @click="editTreeNode">
<i class="fa fa-pencil-square-o" /> {{ this.$t('RenameNode') }}
</li>
<li v-if="treeSetting.showDelete" id="m_del" class="rmenu" tabindex="-1" @click="removeTreeNode">
<i class="fa fa-minus-square" /> {{ this.$t('DeleteNode') }}
</li>
<slot name="rMenu" />
</slot>
</DataZTree>
@@ -24,15 +17,13 @@
<script>
import DataZTree from '../DataZTree/index.vue'
import Icon from '@/components/Widgets/Icon'
import $ from '@/utils/jquery-vendor'
import { mapGetters } from 'vuex'
export default {
name: 'AutoDataZTree',
components: {
DataZTree,
Icon
DataZTree
},
props: {
setting: {
@@ -43,32 +34,7 @@ export default {
},
data() {
return {
defaultMenu: [
{
id: 'm_create',
name: this.$t('CreateNode'),
icon: 'fa-plus-square-o',
callback: this.createTreeNode,
has: () => this.setting.showCreate
},
{
id: 'm_edit',
name: this.$t('RenameNode'),
icon: 'fa-pencil-square-o',
callback: this.editTreeNode,
has: () => this.setting.showUpdate
},
{
id: 'm_del',
name: this.$t('DeleteNode'),
icon: 'fa-minus-square',
callback: this.removeTreeNode,
has: () => this.setting.showDelete
}
],
defaultSetting: {
showDefaultMenu: true,
showMenu: false,
showCreate: true,
showDelete: true,
showUpdate: true,
@@ -114,49 +80,12 @@ export default {
},
rMenu() {
return this.$refs.dataztree.rMenu
},
menu() {
let menu = []
if (this.setting.showDefaultMenu) {
menu = menu.concat(this.defaultMenu)
}
if (this.setting.menu && this.setting.menu.length > 0) {
menu = menu.concat(this.setting.menu)
}
return menu
}
},
beforeDestroy() {
$('body').unbind('mousedown')
},
methods: {
checkDisabled(item) {
let disabled = item.disabled
if (typeof disabled === 'function') {
disabled = disabled(this.currentNode)
}
if (typeof disabled === 'undefined') {
disabled = false
}
return disabled
},
hasMenu(node) {
return false
},
hasMenuItem(item) {
let has = item.has
if (typeof has === 'function') {
has = has(this.currentNode)
}
if (typeof has === 'undefined') {
has = true
}
return has
},
onMenuItemClick(item) {
item.callback(this.currentNode)
this.hideRMenu()
},
onAsyncSuccess(event, treeId, treeNode, msg) {
const nodes = JSON.parse(msg)
nodes.forEach((node) => {
@@ -186,7 +115,7 @@ export default {
if (this.rMenu) this.rMenu.css({ 'visibility': 'hidden' })
$('body').unbind('mousedown', this.onBodyMouseDown)
},
// Request URL: http://localhost/api/v1/assets/assets/?node_id=ID&show_current_asset=null&draw=2&limit=15&offset=0&_=1587022917769
// Request URL: http://localhost/api/v1/assets/assets/?node_id=d8212328-538d-41a6-bcfd-1e8cc7e3aed4&show_current_asset=null&draw=2&limit=15&offset=0&_=1587022917769
onSelected: function(event, treeNode) {
const show_current_asset = this.$cookie.get('show_current_asset') || '0'
if (!this.setting.url) {
@@ -262,8 +191,6 @@ export default {
const offset = $(`#${zTreeID}`).offset()
const scrollTop = document.querySelector('.treebox')?.scrollTop
x -= offset.left
x = x < 0 ? 0 : x
// Tmp
y -= (offset.top + scrollTop) / 3 - 10
x += document.body.scrollLeft
@@ -272,22 +199,15 @@ export default {
if (y + $(`#${rMenuID} ul`).height() >= window.innerHeight) {
y -= $(`#${rMenuID} ul`).height()
}
y = y < 0 ? 0 : y
this.rMenu.css({ 'top': y + 'px', 'left': x + 'px', 'visibility': 'visible' })
$(`#${rMenuID} ul`).show()
$('body').bind('mousedown', this.onBodyMouseDown)
},
onRightClick: function(event, treeId, treeNode) {
let showMenu = this.setting.showMenu
if (typeof showMenu === 'function') {
showMenu = showMenu(treeNode)
}
if (!showMenu) {
if (!this.setting.showMenu) {
return
}
this.currentNode = treeNode
this.currentNodeId = treeNode.meta.data.id
// 屏蔽收藏资产
if (treeNode?.id === '-12') {
return
@@ -401,14 +321,9 @@ export default {
background-color: #f5f7fa;
}
.icon {
width: 15px;
display: inline-block;
}
.data-z-tree {
::v-deep {
.icon {
.fa {
width: 10px;
margin-right: 3px;
}

View File

@@ -29,7 +29,6 @@
<a id="tree-refresh"><i class="fa fa-refresh" /></a>
</div>
</div>
<div :id="iRMenuID" class="rMenu">
<ul class="dropdown-menu menu-actions">
<slot name="rMenu" />
@@ -50,7 +49,8 @@ import axiosRetry from 'axios-retry'
const defaultObject = {
type: Object,
default: () => ({})
default: () => {
}
}
export default {
name: 'ZTree',
@@ -90,12 +90,6 @@ export default {
window.removeEventListener('resize', this.updateTreeHeight)
},
methods: {
onMenuClick(menu) {
if (menu.disabled) {
return
}
menu.callback()
},
updateTreeHeight: _.debounce(function() {
const tree = document.getElementById(this.iZTreeID)
if (!tree) {
@@ -112,8 +106,8 @@ export default {
}
}
// 使用 table 的高度
const zTreeRect = tree.getBoundingClientRect()
tree.style.height = `calc(100vh - ${zTreeRect.top}px - 30px - 25px)`
const ztreeRect = tree.getBoundingClientRect()
tree.style.height = `calc(100vh - ${ztreeRect.top}px - 30px - 25px)`
}, 100),
async initTree(refresh = false) {
const vm = this
@@ -162,6 +156,9 @@ export default {
if (this.treeSetting.showMenu) {
this.rMenu = $(`#${this.iRMenuID}`)
}
if (this.treeSetting?.otherMenu) {
$('.menu-actions').append(this.otherMenu)
}
},
onSearch() {
this.showTreeSearch = !this.showTreeSearch
@@ -438,24 +435,6 @@ div.rMenu li {
list-style: none outside none;
}
.menu-item {
font-size: 12px;
padding: 0 16px;
position: relative;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #606266;
height: 24px;
line-height: 24px;
box-sizing: border-box;
cursor: pointer;
i {
width: 15px;
}
}
.dropdown-menu {
border: medium none;
min-width: 160px;
@@ -472,8 +451,7 @@ div.rMenu li {
text-shadow: none;
top: 100%;
z-index: 1000;
max-height: 320px;
min-height: 150px;
height: 300px;
overflow: auto;
}

View File

@@ -1,7 +1,4 @@
import i18n from '@/i18n/i18n'
import CronTab from '@/components/Form/FormFields/CronTab/index.vue'
import InputWithUnit from '@/components/Form/FormFields/InputWithUnit.vue'
import store from '@/store'
export const strMatchValues = ['exact', 'not', 'in', 'contains', 'startswith', 'endswith', 'regex']
export const typeMatchMapper = {
@@ -29,49 +26,3 @@ export const attrMatchOptions = [
{ label: i18n.t('GreatEqualThan'), value: 'gte' },
{ label: i18n.t('LessEqualThan'), value: 'lte' }
]
export const crontab = {
type: 'cronTab',
component: CronTab,
label: i18n.t('Crontab'),
hidden: (formValue) => {
return formValue.is_periodic === false
},
helpText: i18n.t('CrontabHelpText'),
helpTip: i18n.t('CrontabHelpTip')
}
const validatorInterval = (rule, value, callback) => {
if (parseInt(value) < 1) {
return callback(new Error(i18n.t('EnsureThisValueIsGreaterThanOrEqualTo1')))
}
callback()
}
export const interval = {
label: i18n.t('Interval'),
hidden: (formValue) => {
return formValue.is_periodic === false
},
component: InputWithUnit,
el: {
unit: 'hour'
},
rules: [
{ validator: validatorInterval }
]
}
export const is_periodic = {
type: 'checkbox',
hidden: (formValue) => {
return !store.getters.hasValidLicense
}
}
export const periodicMeta = {
is_periodic,
interval,
crontab
}

View File

@@ -30,7 +30,7 @@ export { default as AccountListTable } from './Apps/AccountListTable/AccountList
export { default as AssetRelationCard } from './Apps/AssetRelationCard'
export { default as UserConfirmDialog } from './Apps/UserConfirmDialog'
export { default as Announcement } from './Widgets/Announcement'
export { default as CronTab } from './Form/FormFields/CronTab'
export { default as CronTab } from './Form/CronTab'
export { default as Pagination } from './Table/Pagination'
export { default as Tooltip } from './Widgets/Tooltip'
export { default as ResourceActivity } from './Apps/ResourceActivity'

View File

@@ -1,12 +1,17 @@
import VueCookie from 'vue-cookie'
import store from '@/store'
export function getLangCode() {
export function getLangCode(withInternalCode = false) {
const cookieLang = VueCookie.get('django_language')
const browserLang = navigator.systemLanguage || navigator.language || navigator.userLanguage
let lang = cookieLang || browserLang || 'en'
lang = lang.replace('-', '_')
if (lang !== 'zh_hant') {
lang = lang.slice(0, 2)
let lang = cookieLang || navigator.language.toLowerCase()
if (withInternalCode) {
const languages = store.getters.publicSettings['LANGUAGES']
for (const langObj of languages) {
if (langObj['other_codes'].indexOf(lang) > -1) {
lang = langObj['code']
break
}
}
}
return lang
}

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="138px" height="134px" viewBox="0 0 138 134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>activity</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="activity" fill="#3E3A39" fill-rule="nonzero">
<path d="M125.454545,123.012 C125.454545,123.30102 125.310273,123.469176 125.435727,123.484941 L12.7900909,123.553255 C12.7399091,123.521725 12.5454545,123.332549 12.5454545,123.012 L12.5454545,44.6614118 L125.454545,44.6614118 L125.454545,123.012 Z M12.5454545,18.865098 C12.5454545,18.5813333 12.6709091,18.4131765 12.5642727,18.386902 L37.6363636,18.386902 L37.6363636,21.0196078 C37.6363636,23.9218101 40.4447593,26.2745098 43.9090909,26.2745098 C47.3734225,26.2745098 50.1818182,23.9218101 50.1818182,21.0196078 L50.1818182,18.3921569 L87.8181818,18.3921569 L87.8181818,21.0196078 C87.8181818,23.9218101 90.6265775,26.2745098 94.0909091,26.2745098 C97.5552407,26.2745098 100.363636,23.9218101 100.363636,21.0196078 L100.363636,18.3921569 L125.260091,18.3921569 C125.385308,18.5275639 125.454545,18.6938135 125.454545,18.865098 L125.454545,34.1568627 L12.5454545,34.1568627 L12.5454545,18.865098 Z M125.423182,7.88235294 L100.363636,7.88235294 L100.363636,5.25490196 C100.363636,2.35269975 97.5552407,0 94.0909091,0 C90.6265775,0 87.8181818,2.35269975 87.8181818,5.25490196 L87.8181818,7.88235294 L50.1818182,7.88235294 L50.1818182,5.25490196 C50.1818182,2.35269975 47.3734225,0 43.9090909,0 C40.4447593,0 37.6363636,2.35269975 37.6363636,5.25490196 L37.6363636,7.88235294 L12.489,7.88235294 C5.60154545,7.88235294 0,12.811451 0,18.865098 L0,123.017255 C0,129.076157 5.60781818,134 12.4952727,134 L125.504727,134 C132.392182,134 138,129.076157 138,123.017255 L138,18.865098 C138,12.8061961 132.360818,7.87709804 125.423182,7.87709804 L125.423182,7.88235294 Z" id="形状"></path>
<path d="M44.3,76.5714286 L94.7,76.5714286 C98.1793939,76.5714286 101,74.2049337 101,71.2857143 C101,68.3664949 98.1793939,66 94.7,66 L44.3,66 C40.8206061,66 38,68.3664949 38,71.2857143 C38,74.2049337 40.8206061,76.5714286 44.3,76.5714286 M44.3,103 L94.7,103 C98.1793939,103 101,100.633505 101,97.7142857 C101,94.7950663 98.1793939,92.4285714 94.7,92.4285714 L44.3,92.4285714 C40.8206061,92.4285714 38,94.7950663 38,97.7142857 C38,100.633505 40.8206061,103 44.3,103" id="形状"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -1,7 +0,0 @@
<svg t="1730795663037" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="53312" width="200" height="200">
<path d="M81.4592 150.4768c-44.544 0-80.6912 35.0208-80.6912 78.2848v712.704c0 43.2128 36.1472 78.2848 80.6912 78.2848h686.6432c44.5952 0 80.7424-35.072 80.7424-78.336v-71.8848h90.3168c44.544 0 80.6912-35.0208 80.6912-78.2848V78.5408c0-43.2128-36.1472-78.2848-80.6912-78.2848H252.416c-44.544 0-80.6912 35.072-80.6912 78.336v71.8848H81.4592zM848.896 800.3584V228.7616c0-43.264-36.1472-78.336-80.7424-78.336H243.0976V69.2736h710.144v731.136h-104.448zM72.0896 941.4656V219.648h705.4336v731.136H72.0896v-9.3184z"
fill="#333333" p-id="53313"></path>
<path d="M215.1936 716.8a35.1232 35.1232 0 0 0-35.6352 34.6112c0 19.1488 15.9232 34.6112 35.6352 34.6112h203.3664a35.1232 35.1232 0 0 0 35.6864-34.6112 35.1232 35.1232 0 0 0-35.6864-34.56H215.1936z m0-186.9824a35.1232 35.1232 0 0 0-35.6352 34.56c0 19.0976 15.9232 34.6112 35.6352 34.6112h389.4272a35.1232 35.1232 0 0 0 35.6352-34.6112 35.1232 35.1232 0 0 0-35.6352-34.56H215.1936z m0-180.224a35.1232 35.1232 0 0 0-35.6352 34.56c0 19.1488 15.9232 34.6112 35.6352 34.6112h389.4272a35.1232 35.1232 0 0 0 35.6352-34.6112 35.1232 35.1232 0 0 0-35.6352-34.56H215.1936z"
fill="#333333" p-id="53314"></path>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="162px" height="176px" viewBox="0 0 162 176" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组" fill="#2C2C2C" fill-rule="nonzero">
<path d="M145.273438,109.375 C142.304688,109.375 139.882812,111.796875 139.882812,114.765625 L139.882812,164.316406 L10.78125,164.316406 L10.78125,87.3046875 L91.1132813,87.3046875 C94.0820313,87.3046875 96.5039063,84.8828125 96.5039063,81.9140625 C96.5039063,78.9453125 94.0820313,76.5234375 91.1132813,76.5234375 L31.25,76.5234375 L31.25,50.4296875 C31.25,28.5742188 49.0234375,10.8007813 70.8984375,10.8007813 L78.90625,10.8007813 C100.761719,10.8007813 118.535156,28.5742188 118.535156,50.4296875 L118.535156,54.609375 L118.554688,54.609375 C118.730469,57.421875 121.074219,59.6484375 123.925781,59.6484375 C126.894531,59.6484375 129.316406,57.2460938 129.316406,54.2578125 C129.316406,54.1210938 129.316406,53.984375 129.296875,53.8476563 L129.296875,50.4101563 C129.296875,22.6757813 106.621094,0 78.8867188,0 L70.8789063,0 C43.1445313,0 20.46875,22.6757813 20.46875,50.4101563 L20.46875,76.5039063 L5.390625,76.5039063 C2.421875,76.5039063 0,78.9257812 0,81.8945313 L0,170 C0,172.96875 2.421875,175.390625 5.390625,175.390625 C6.03515625,175.390625 6.66015625,175.273438 7.24609375,175.058594 L143.417969,175.058594 C144.003906,175.273438 144.609375,175.390625 145.273438,175.390625 C148.242188,175.390625 150.664063,172.96875 150.664063,170 L150.664063,114.746094 C150.644531,111.796875 148.222656,109.375 145.273438,109.375 Z" id="路径"></path>
<path d="M159.648438,56.9335938 C157.558594,54.84375 154.121094,54.84375 152.03125,56.9335938 L76.8945312,132.050781 C74.8046875,134.140625 74.8046875,137.578125 76.8945312,139.667969 C78.984375,141.757813 82.421875,141.757813 84.5117188,139.667969 L159.628906,64.5507813 C161.738281,62.4414063 161.738281,59.0234375 159.648438,56.9335938 Z" id="路径"></path>
</g>
</g>
</svg>
<svg width="40px" height="44px" viewBox="0 0 40 44" version="1.1" xmlns="http://www.w3.org/2000/svg"
>
<path d="M30.2706254,38.229976 C30.2706254,39.3606857 29.7535516,39.817019 28.4764414,39.817019 L5.16450885,39.817019 C3.87961144,39.817019 3.36253758,39.3606857 3.36253758,38.229976 L3.36253758,25.2564058 C3.36253758,24.1256961 3.88116889,23.6678054 5.16450885,23.6678054 L26.9080879,23.6678054 L26.9080879,20.3052678 L3.6179596,20.3052678 C1.39859136,20.3052678 0,21.7038592 0,23.9232274 L0,39.5600395 C0,41.7794077 1.39859136,43.1779991 3.6179596,43.1779991 L30.0229907,43.1779991 C32.2330142,43.1779991 33.6316056,41.7794077 33.6316056,39.5600395 L33.6316056,29.0488 L30.269068,29.0488 L30.269068,38.229976 L30.2706254,38.229976 Z"
id="路径"></path>
<path d="M15.4763873,27.703162 C15.4755615,27.5244652 15.54618,27.3528466 15.6725391,27.2264875 C15.7988982,27.1001284 15.9705168,27.0295099 16.1492136,27.0303357 L17.4948516,27.0303357 C17.8639676,27.0303357 18.1676706,27.3324885 18.1676706,27.703162 L18.1676706,35.7816624 C18.1668142,36.1528948 17.866084,36.453625 17.4948516,36.4544887 L16.1492136,36.4544887 C15.9705168,36.4553145 15.7988982,36.384696 15.6725391,36.2583369 C15.54618,36.1319778 15.4755615,35.9603592 15.4763873,35.7816624 L15.4763873,27.703162 L15.4763873,27.703162 Z M39.5047548,15.4429045 C39.1907428,15.1267586 38.7635683,14.9489692 38.3179768,14.9489692 C37.8723853,14.9489692 37.4452109,15.1267586 37.1311989,15.4429045 L22.3821341,30.1919693 C21.9578609,30.6170771 21.7926087,31.2362399 21.9486262,31.8162251 C22.1046438,32.3962103 22.5582284,32.8489044 23.1385191,33.0037818 C23.7188098,33.1586592 24.3376467,32.9921905 24.7619198,32.5670827 L39.5047548,17.8242477 C39.8217544,17.5091076 40,17.0805683 40,16.6335761 C40,16.1865839 39.8217544,15.7580447 39.5047548,15.4429045 L39.5047548,15.4429045 Z M10.0876127,20.3068253 L10.0876127,10.6973501 C10.0876127,6.72273414 13.107511,3.48790758 16.8204751,3.48790758 C20.5334393,3.48790758 23.5455503,6.72273414 23.5455503,10.6973501 L23.5455503,16.2730261 L26.9080879,16.2730261 L26.9080879,10.2176551 C26.9532494,6.58243177 25.0397574,3.20385387 21.8988728,1.37308023 C18.7579882,-0.45769341 14.8751748,-0.45769341 11.7342902,1.37308023 C8.59340562,3.20385387 6.67991361,6.58243177 6.72507515,10.2176551 L6.72507515,23.6678054 L26.9080879,23.6678054 L26.9080879,20.3052678 L10.0876127,20.3052678 L10.0876127,20.3068253 Z"
id="形状"></path>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="175px" height="172px" viewBox="0 0 175 172" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组" fill="#000000" fill-rule="nonzero">
<path d="M173.785375,165.454861 L123.361962,115.009064 C137.448412,98.2738101 143.521494,75.2018529 137.651474,52.4540759 C128.018006,15.1217873 89.8109099,-7.40014283 52.4770224,2.22233315 C34.3936829,6.89116772 19.2091781,18.3220175 9.72181048,34.4071119 C0.234442898,50.4958037 -2.41955769,69.3134455 2.24727825,87.3967849 C6.91431399,105.480124 18.3433652,120.666428 34.432057,130.153995 C45.3350648,136.583636 57.4928218,139.875204 69.8298572,139.875204 C75.6914829,139.875204 81.5950804,139.12991 87.4219298,137.628528 C99.4151984,134.532427 109.877505,128.483928 118.240035,120.466763 L168.495562,170.744875 C169.224268,171.475579 170.183418,171.840932 171.140568,171.840932 C172.097719,171.840932 173.054871,171.475579 173.785575,170.744875 C175.246584,169.283466 175.246584,166.916271 173.785375,165.454861 Z M85.551198,130.380442 C69.402147,134.552413 52.5955419,132.177823 38.2312808,123.705967 C23.865021,115.234111 13.6597404,101.677103 9.49156634,85.5262533 C5.32319251,69.3790011 7.69418489,52.5743947 16.1660409,38.2099337 C24.6396958,23.8418753 38.1985029,13.6347956 54.3475538,9.47021928 C59.5606195,8.12213334 64.7902738,7.47916928 69.9393825,7.47916928 C97.7275421,7.47916928 123.148307,26.2018753 130.407185,54.3242083 C135.890068,75.5734013 129.699865,97.1395794 115.85805,112.213559 C115.752321,112.298502 115.649591,112.388841 115.551457,112.486774 C115.398161,112.64007 115.264852,112.804958 115.143734,112.976043 C107.36301,121.170886 97.2760486,127.355893 85.551198,130.380442 Z" id="形状"></path>
<path d="M91.6046937,27.1300456 C86.1485929,23.9152253 79.7609238,23.0164347 73.6272824,24.5947646 C71.6270386,25.1136128 70.4234546,27.1520308 70.940304,29.1538736 C71.4553548,31.1559162 73.492174,32.3505062 75.4976142,31.8426505 C84.1721329,29.6031689 93.0403202,34.8382195 95.2798019,43.5073419 C95.7145072,45.1951976 97.2342767,46.3130396 98.9001472,46.3130396 C99.2089378,46.3130396 99.5229249,46.2764644 99.8371118,46.1925212 C101.837156,45.6774705 103.04094,43.6388527 102.52409,41.6370099 C100.940364,35.5031687 97.0625933,30.3484636 91.6046937,27.1300456 Z" id="路径"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -1,5 +0,0 @@
<svg t="1730113499097" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1649"
width="200" height="200">
<path d="M512 0C229.234286 0 0 229.234286 0 512s229.234286 512 512 512 512-229.234286 512-512S794.765714 0 512 0zM109.714286 512a400.514286 400.514286 0 0 1 81.68-243.017143l563.622857 563.622857A400.514286 400.514286 0 0 1 512 914.285714C289.828571 914.285714 109.714286 734.171429 109.714286 512z m722.891428 243.017143L268.982857 191.394286A400.514286 400.514286 0 0 1 512 109.714286c222.171429 0 402.285714 180.114286 402.285714 402.285714a400.514286 400.514286 0 0 1-81.68 243.017143z"
p-id="1650"></path>
</svg>

Before

Width:  |  Height:  |  Size: 684 B

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="40px" height="48px" viewBox="0 0 40 48" version="1.1" xmlns="http://www.w3.org/2000/svg"
>
<path d="M36.0001406,20.0002344 L36.0001406,16.000375 C36.0001406,7.17752804 28.8226126,0 20.0002344,0 C11.1778562,0 4.00032813,7.17752804 4.00032813,15.9999062 L4.00032813,19.9997656 L0,19.9997656 L0,48.0001875 L40,48.0001875 L40,20.0002344 L36.0001406,20.0002344 Z M8.0001875,15.9999062 C8.0001875,9.3830054 13.3833335,3.99985937 20.0002344,3.99985937 C26.6171352,3.99985937 32.0002813,9.3830054 32.0002813,15.9999062 L32.0002813,19.9997656 L8.0001875,19.9997656 L8.0001875,15.9999062 Z M36.0006094,44.0003281 L4.00032813,44.0003281 L4.00032813,24.0000938 L36.0006094,24.0000938 L36.0006094,44.0003281 Z"
id="形状"></path>
<path d="M20.0002344,40 C22.2094618,40 24.0000938,38.2088993 24.0000938,36.0001406 C24.0000938,34.5231036 23.1905593,33.2476299 21.9999297,32.5548147 L21.9999297,27.9999531 L18.0000703,27.9999531 L18.0000703,32.5548147 C16.8094407,33.2476299 15.9999062,34.5231036 15.9999062,36.0001406 C16.000375,38.209368 17.791007,40 20.0002344,40 L20.0002344,40 Z"
id="路径"></path>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="184px" height="184px" viewBox="0 0 184 184" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组" fill="#333333" fill-rule="nonzero">
<path d="M91.6666666,183.341458 C41.0405646,183.341458 -6.9388939e-15,142.300894 -6.9388939e-15,91.6747917 C0.0535397665,70.505775 7.41237071,50.0040719 20.8333332,33.6331251 C23.6218122,30.2086156 27.7168568,28.1082053 32.125,27.8414583 C36.6727552,27.6410729 41.0978101,29.347664 44.3333332,32.5497917 L97.5416666,85.7997917 C100.373139,89.1061274 100.182768,94.0347428 97.1046929,97.112818 C94.0266177,100.190893 89.0980023,100.381265 85.7916666,97.5497917 L33.0833332,44.8831251 C22.4640203,58.1678232 16.6752268,74.6673541 16.6666666,91.6747917 C16.634797,112.309451 25.1059247,132.045685 40.0857285,146.237078 C55.0655324,160.428471 75.2305194,167.821188 95.8333332,166.674792 C133.947312,164.34614 164.338015,133.955437 166.666667,95.8414583 C167.813062,75.2386445 160.420346,55.0736575 146.228953,40.0938537 C132.03756,25.1140498 112.301325,16.6429221 91.6666666,16.6747917 C85.0987008,16.6886637 78.5594988,17.5428207 72.2083332,19.2164583 C67.9277344,19.9697568 63.787032,17.3066153 62.6970126,13.0991407 C61.6069933,8.89166618 63.9337598,4.55301463 68.0416666,3.13312512 C96.4092432,-4.47902134 126.706595,1.9631523 149.522872,20.4586022 C172.33915,38.9540521 184.910974,67.2627144 183.333333,96.5914583 C180.529036,143.291305 143.283179,180.537161 96.5833332,183.341458 L91.6666666,183.341458 Z" id="路径"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="200px" height="200px" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组" fill="#272636" fill-rule="nonzero">
<path d="M196.888904,59.872974 L154.191511,102.570368 C150.259952,106.501926 143.890605,106.501926 139.959046,102.570368 L97.2672057,59.872974 C93.3356471,55.9469684 93.3356471,49.5720682 97.2672057,45.6460625 L139.959046,2.94866895 C143.890605,-0.982889648 150.259952,-0.982889648 154.191511,2.94866895 L196.888904,45.6460625 C200.820463,49.5720682 200.820463,55.9469684 196.888904,59.872974 Z M147.155798,10.7062783 L105.024815,52.8372609 L147.155798,94.9682436 L189.28678,52.8372609 L147.155798,10.7062783 Z M72.1896365,199.993059 L11.1060979,199.993059 C4.96997871,199.993059 0,195.02308 0,188.886961 L0,127.803422 C0,121.672856 4.96997871,116.697324 11.1060979,116.697324 L72.1896365,116.697324 C78.3202027,116.697324 83.2957346,121.672856 83.2957346,127.803422 L83.2957346,188.886961 C83.2957346,195.02308 78.3202027,199.993059 72.1896365,199.993059 Z M72.1896365,127.803422 L11.1060979,127.803422 L11.1060979,188.886961 L72.1896365,188.886961 L72.1896365,127.803422 Z M72.1896365,100.038177 L11.1060979,100.038177 C4.96997871,100.038177 0,95.0681984 0,88.9320793 L0,27.8485406 C0,21.7179744 4.96997871,16.7424426 11.1060979,16.7424426 L72.1896365,16.7424426 C78.3202027,16.7424426 83.2957346,21.7179744 83.2957346,27.8485406 L83.2957346,88.9320793 C83.2957346,95.0681984 78.3202027,100.038177 72.1896365,100.038177 Z M72.1896365,27.8485406 L11.1060979,27.8485406 L11.1060979,88.9320793 L72.1896365,88.9320793 L72.1896365,27.8485406 Z M111.060979,116.697324 L172.144518,116.697324 C178.275084,116.697324 183.250616,121.672856 183.250616,127.803422 L183.250616,188.886961 C183.250616,195.02308 178.275084,199.993059 172.144518,199.993059 L111.060979,199.993059 C104.92486,199.993059 99.9548814,195.02308 99.9548814,188.886961 L99.9548814,127.803422 C99.9548814,121.672856 104.92486,116.697324 111.060979,116.697324 Z M111.060979,188.886961 L172.144518,188.886961 L172.144518,127.803422 L111.060979,127.803422 L111.060979,188.886961 Z" id="形状"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -52,7 +52,7 @@ export default {
<style lang="scss" scoped>
.app-main {
background-color: #f3f3f4;
height: 100% !important;
height: 100vh !important;
width: 100%;
position: relative;
overflow: auto;

View File

@@ -124,7 +124,7 @@ export default {
}
},
cloneNameSuffix: {
type: [String, Number],
type: String,
default: function() {
return this.$t('Duplicate').toLowerCase()
}
@@ -372,7 +372,7 @@ export default {
name = object['hostname']
attr = 'hostname'
}
object[attr] = name + '-' + this.cloneNameSuffix.toString()
object[attr] = name + '-' + this.cloneNameSuffix
} else {
object = await this.getObjectDetail(this.iUrl)
}

View File

@@ -71,7 +71,7 @@ export default {
},
async logout() {
const currentOrg = this.$store.getters.currentOrg
if (currentOrg.autoEnter) {
if (currentOrg.autoEnter || currentOrg.is_system) {
await this.$store.dispatch('users/setCurrentOrg', this.$store.getters.preOrg)
}
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${this.$route.fullPath}`

View File

@@ -25,7 +25,6 @@ export default {
return {
langCookeName: 'django_language', // 后端Django需要的COOKIE KEY
supportLanguages: [],
currentLangCode: '',
defaultLang: {
title: 'English',
code: 'en',
@@ -41,41 +40,25 @@ export default {
}, {})
},
currentLang() {
const lang = this.supportedLangMapper[this.currentLangCode] || this.defaultLang
return lang
const lang = getLangCode(true)
return this.supportedLangMapper[lang] || this.defaultLang
}
},
mounted() {
this.currentLangCode = getLangCode()
this.supportLanguages = store.getters.publicSettings['LANGUAGES'].map(item => {
let code = item.code.replace('-', '_')
if (code !== 'zh_hant') {
code = code.slice(0, 2)
}
return {
title: item.name,
code: code,
code: item.code,
cookieCode: item.code
}
})
this.changeMomentLang()
},
methods: {
changeLang() {
if (this.currentLang.code !== this.$i18n.locale) {
this.changeLangTo(this.currentLang)
}
},
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 if (this.currentLang.code.indexOf('zh_hant') > -1) {
this.$moment.locale('zh-tw')
} else {
this.$moment.locale('zh-cn')
}
const lang = getLangCode()
this.$moment.locale(lang)
document.documentElement.lang = lang
},
changeLangTo(item) {
this.$axios.get(`/core/i18n/${item.cookieCode}/`).then(() => {

View File

@@ -82,7 +82,7 @@ export default {
]
}
const hasPerms = this.$hasPerm('orgs.view_organization | orgs.add_organization')
const isConsole = ['console'].includes(this.currentViewRoute.name)
const isConsole = this.currentViewRoute.name === 'console'
return hasPerms && isConsole ? orgActions : {}
},
orgChoicesGroup() {

View File

@@ -115,7 +115,6 @@ export default {
this.tipHasRead = '1'
this.iShowTip = false
}
console.log('Route to: ', routeName)
this.$router.push(routeName)
this.$emit('view-change', routeName)
}

View File

@@ -24,7 +24,7 @@
<li class="header-item active-menu">
<Help />
</li>
<li v-if="!isMobile" class="header-item language">
<li class="header-item">
<Language />
</li>
<li class="header-item header-profile">
@@ -76,7 +76,7 @@ export default {
},
computed: {
...mapGetters([
'sidebar', 'publicSettings', 'currentOrgRoles', 'currentViewRoute', 'isMobile'
'sidebar', 'publicSettings', 'currentOrgRoles', 'currentViewRoute'
]),
ticketsEnabled() {
return this.publicSettings['TICKETS_ENABLED'] &&
@@ -176,7 +176,7 @@ export default {
// 未找到与之对应的
& ::v-deep .el-submenu__title {
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
padding: 0 8px;
line-height: $headerHeight;
height: $headerHeight;

View File

@@ -116,7 +116,6 @@ export default {
<style lang="scss" scoped>
.page {
height: calc(100vh - 50px);
overflow-y: hidden;
overflow-x: hidden;
@@ -132,7 +131,6 @@ export default {
::v-deep > div {
margin-bottom: 50px;
height: 100%;
}
}
}

View File

@@ -193,14 +193,14 @@ export default {
}
::v-deep .page-content {
overflow-y: hidden !important;
overflow-y: hidden;
padding: 0;
}
.tab-page-content {
padding: 10px 30px 22px;
overflow-y: auto;
height: calc(100vh - 130px);
height: calc(100% - 50px);
.el-alert {
margin-top: 0;

View File

@@ -92,15 +92,6 @@ new Vue({
i18n,
router,
store,
mounted() {
// 移除加载页面
const loadingElement = document.getElementById('loading')
if (loadingElement) {
setTimeout(() => {
loadingElement.style.display = 'none'
}, 500)
}
},
render: h => h(App)
})

View File

@@ -80,15 +80,5 @@ export default [
}
}
]
},
{
path: 'job-execution-log',
name: 'JobExecutionLog',
component: () => import('@/views/audits/JobExecutionLogList'),
meta: {
title: i18n.t('JobExecutionLog'),
icon: 'task',
permissions: ['audits.view_joblog']
}
}
]

View File

@@ -3,6 +3,7 @@ import i18n from '@/i18n/i18n'
import SessionRoutes from './sessions'
import LogRoutes from './audits'
import JobRoutes from './jobs'
import empty from '@/layout/empty'
import store from '@/store'
@@ -54,6 +55,18 @@ export default {
permissions: []
},
children: LogRoutes
},
{
path: '/audit/jobs',
component: empty,
redirect: '',
name: 'AuditsJobs',
meta: {
title: i18n.t('JobsAudit'),
icon: 'job',
permissions: ['audits.view_joblog']
},
children: JobRoutes
}
]
}

53
src/router/audit/jobs.js Normal file
View File

@@ -0,0 +1,53 @@
import i18n from '@/i18n/i18n'
import empty from '@/layout/empty'
export default [
{
path: 'job-list',
name: 'JobList',
component: empty,
redirect: {
name: 'JobList'
},
meta: {
title: i18n.t('JobList'),
icon: 'task',
permissions: ['audits.view_joblog']
},
children: [
{
path: '',
name: 'AuditJobList',
component: () => import('@/views/audits/JobPeriodTaskList'),
meta: {
title: i18n.t('JobList'),
permissions: []
}
}
]
},
{
path: 'job-execution-log',
name: 'JobExecutionLog',
component: empty,
redirect: {
name: 'AuditJobExecutionLog'
},
meta: {
title: i18n.t('JobExecutionLog'),
icon: 'history',
permissions: ['audits.view_joblog']
},
children: [
{
path: '',
name: 'AuditJobExecutionLog',
component: () => import('@/views/audits/JobExecutionLogList'),
meta: {
title: i18n.t('JobExecutionLog'),
permissions: ['audits.view_joblog']
}
}
]
}
]

View File

@@ -67,57 +67,382 @@ export default [
}
}
]
},
{
path: 'account-template',
component: empty,
redirect: {
name: 'AccountTemplateList'
},
meta: {
title: i18n.t('AccountTemplate'),
app: 'accounts',
icon: 'template',
permissions: ['accounts.view_accounttemplate']
},
children: [
{
path: '',
name: 'AccountTemplateList',
component: () => import('@/views/accounts/AccountTemplate/AccountTemplateList'),
meta: {
menuTitle: i18n.t('MenuAccountTemplates'),
title: i18n.t('AccountTemplateList'),
permissions: ['accounts.view_accounttemplate']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountTemplate/AccountTemplateCreateUpdate.vue'),
name: 'AccountTemplateCreate',
meta: {
title: i18n.t('CreateAccountTemplate'),
action: 'create'
},
hidden: true
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountTemplate/AccountTemplateCreateUpdate.vue'),
name: 'AccountTemplateUpdate',
meta: {
title: i18n.t('UpdateAccountTemplate'),
action: 'update'
},
hidden: true
},
{
path: ':id',
component: () => import('@/views/accounts/AccountTemplate/AccountTemplateDetail/index.vue'),
name: 'AccountTemplateDetail',
meta: { title: i18n.t('AccountTemplate') },
hidden: true
}
]
},
{
path: 'automations',
component: empty,
name: 'AccountAutomation',
meta: {
title: i18n.t('Automations'),
name: 'Automations',
icon: 'automation',
permissions: []
},
children: [
{
path: 'account-push',
name: 'AccountPush',
component: empty,
redirect: {
name: 'AccountPushList'
},
meta: {
app: 'accounts',
name: 'BaseAccountPushList',
resource: 'pushaccountautomation'
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountPush/index.vue'),
name: 'AccountPushList',
meta: {
title: i18n.t('AccountPushList'),
menuTitle: i18n.t('AccountPushList'),
permissions: ['accounts.view_pushaccountautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'),
name: 'AccountPushCreate',
hidden: true,
meta: {
title: i18n.t('AccountPushCreate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.add_pushaccountautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'),
name: 'AccountPushUpdate',
hidden: true,
meta: {
title: i18n.t('AccountPushUpdate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.change_pushaccountautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'),
name: 'AccountPushDetail',
hidden: true,
meta: {
title: i18n.t('AccountPushList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountautomation']
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue'),
name: 'AccountPushExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'),
name: 'AccountPushExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_pushaccountexecution']
}
}
]
},
{
path: 'account-change-secret',
name: 'AccountChangeSecret',
component: empty,
redirect: {
name: 'AccountChangeSecretList'
},
meta: {
title: i18n.t('BaseAccountChangeSecret'),
app: 'accounts',
licenseRequired: true
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountChangeSecret/index.vue'),
name: 'AccountChangeSecretList',
meta: {
menuTitle: i18n.t('ChangeCredentials'),
title: i18n.t('AccountChangeSecret'),
permissions: ['accounts.view_changesecretautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue'),
name: 'AccountChangeSecretCreate',
hidden: true,
meta: {
title: i18n.t('AssetChangeSecretCreate'),
permissions: ['accounts.add_changesecretautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue'),
name: 'AccountChangeSecretUpdate',
hidden: true,
meta: {
title: i18n.t('AssetChangeSecretUpdate'),
permissions: ['accounts.change_changesecretautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/index.vue'),
name: 'AccountChangeSecretDetail',
hidden: true,
meta: {
title: i18n.t('AccountChangeSecret'),
permissions: ['accounts.view_changesecretautomation']
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionList.vue'),
name: 'AccountChangeSecretExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
permissions: ['accounts.view_changesecretexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionDetail/index.vue'),
name: 'AccountChangeSecretExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
permissions: ['accounts.view_changesecretexecution']
}
}
]
},
{
path: 'account-gather',
component: empty,
redirect: {
name: 'AccountGatherList'
},
name: 'AccountGather',
meta: {
title: i18n.t('AccountGatherList'),
app: 'accounts',
// activeMenu: '/console/accounts/automations',
licenseRequired: true
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountGather/index.vue'),
name: 'AccountGatherList',
meta: {
menuTitle: i18n.t('GatherAccounts'),
title: i18n.t('AccountGatherTaskList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheredaccount']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountGather/TaskCreateUpdate'),
name: 'AccountGatherTaskCreate',
hidden: true,
meta: {
title: i18n.t('AccountGatherTaskCreate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.add_gatheraccountsautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountGather/TaskDetail/index'),
name: 'AccountGatherTaskDetail',
hidden: true,
meta: {
title: i18n.t('AccountGatherTaskDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheraccountsautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountGather/TaskCreateUpdate'),
name: 'AccountGatherTaskUpdate',
hidden: true,
meta: {
title: i18n.t('AccountGatherTaskUpdate'),
action: 'update',
permissions: ['accounts.change_gatheraccountsautomation'],
activeMenu: '/accounts/account-gather'
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountGather/TaskDetail/TaskExecutionList.vue'),
name: 'AccountGatherTaskExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheraccountsexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountGather/TaskDetail/AccountGatherExecutionDetail/index.vue'),
name: 'AccountGatherExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheraccountsexecution']
}
}
]
},
{
path: 'account-backup',
component: empty,
name: 'AccountBackup',
redirect: {
name: 'AccountBackupList'
},
meta: {
title: i18n.t('AccountBackup'),
app: 'accounts',
resource: 'accountbackupautomation',
licenseRequired: true
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountBackup/index.vue'),
name: 'AccountBackupList',
meta: {
menuTitle: i18n.t('AccountBackup'),
title: i18n.t('AccountBackupList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_accountbackupautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupCreate',
meta: {
title: i18n.t('AccountBackupCreate'),
// activeMenu: '/console/accounts/automations',
action: 'create'
},
hidden: true
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupUpdate',
meta: {
title: i18n.t('AccountBackupUpdate'),
// activeMenu: '/console/accounts/automations',
action: 'update'
},
hidden: true
},
{
path: ':id',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/index.vue'),
name: 'AccountBackupDetail',
// activeMenu: '/console/accounts/automations',
meta: {
title: i18n.t('AccountBackupDetail'),
activeMenu: '/console/accounts/automations'
},
hidden: true
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionList.vue'),
name: 'AccountBackupExecutionList',
meta: { title: i18n.t('ExecutionDetail') },
hidden: true
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionDetail/index.vue'),
name: 'AccountBackupExecutionDetail',
meta: { title: i18n.t('ExecutionDetail') },
hidden: true
}
]
}
]
}
// {
// path: 'account-template',
// component: empty,
// redirect: {
// name: 'AccountTemplateList'
// },
// meta: {
// title: i18n.t('AccountTemplate'),
// app: 'accounts',
// icon: 'template',
// permissions: ['accounts.view_accounttemplate']
// },
// children: [
// {
// path: '',
// name: 'AccountTemplateList',
// component: () => import('@/views/accounts/AccountTemplate/AccountTemplateList'),
// meta: {
// menuTitle: i18n.t('MenuAccountTemplates'),
// title: i18n.t('AccountTemplateList'),
// permissions: ['accounts.view_accounttemplate']
// }
// },
// {
// path: 'create',
// component: () => import('@/views/accounts/AccountTemplate/AccountTemplateCreateUpdate.vue'),
// name: 'AccountTemplateCreate',
// meta: {
// title: i18n.t('CreateAccountTemplate'),
// action: 'create'
// },
// hidden: true
// },
// {
// path: ':id/update',
// component: () => import('@/views/accounts/AccountTemplate/AccountTemplateCreateUpdate.vue'),
// name: 'AccountTemplateUpdate',
// meta: {
// title: i18n.t('UpdateAccountTemplate'),
// action: 'update'
// },
// hidden: true
// },
// {
// path: ':id',
// component: () => import('@/views/accounts/AccountTemplate/AccountTemplateDetail/Application.vue'),
// name: 'AccountTemplateDetail',
// meta: { title: i18n.t('AccountTemplate') },
// hidden: true
// }
// ]
// }
]

View File

@@ -2,7 +2,6 @@ import i18n from '@/i18n/i18n'
import empty from '@/layout/empty'
import XPackRoutes from './xpack'
const globalSubmenu = () => import('@/layout/globalOrg.vue')
export default [
{
path: 'assets',
@@ -294,12 +293,11 @@ export default [
},
{
path: 'platforms',
component: globalSubmenu,
component: empty,
meta: {
permissions: ['assets.view_platform'],
resource: 'platform',
icon: 'platform',
disableOrgsChange: true
icon: 'platform'
},
redirect: '',
children: [

View File

@@ -27,7 +27,7 @@ export default {
children: [
{
path: '/console/dashboard',
component: () => import('@/views/dashboard/Console/index.vue'),
component: () => import('@/views/dashboard/Console/index'),
name: 'AdminDashboard',
meta: {
icon: 'dashboard',

View File

@@ -32,7 +32,6 @@ import workbenchViewRoutes from './workbench'
import ticketsRoutes from './tickets'
import settingsRoutes from './settings'
import profileRoutes from './profile'
import pamViewRoutes from './pam'
import { getPropView } from '@/utils/jms'
import store from '@/store'
@@ -93,7 +92,6 @@ export const viewRoutes = [
consoleViewRoutes,
auditViewRoutes,
workbenchViewRoutes,
pamViewRoutes,
ticketsRoutes,
settingsRoutes,
profileRoutes

View File

@@ -1,54 +0,0 @@
import empty from '@/layout/empty.vue'
import i18n from '@/i18n/i18n'
export default [
{
path: 'sessions',
name: 'AccountSession',
component: empty,
meta: {
app: 'terminal',
name: 'BaseAccountSession',
icon: 'session',
resource: 'session',
permissions: []
},
children: [
{
path: '',
component: () => import('@/views/sessions/SessionList/index.vue'),
name: 'AccountSessionList',
meta: {
title: i18n.t('AccountSessions'),
permissions: []
}
}
]
},
{
path: 'activity',
name: 'AccountActivity',
component: empty,
redirect: {
name: 'AccountPushList'
},
meta: {
app: 'accounts',
name: 'BaseAccountActivity',
icon: 'activity',
resource: 'operate-logs'
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountActivity/AccountActivityList.vue'),
name: 'AccountActivityList',
meta: {
title: i18n.t('AccountActivity'),
permissions: ['audits.view_operatelog']
}
}
]
}
]

View File

@@ -1,235 +0,0 @@
import empty from '@/layout/empty.vue'
import i18n from '@/i18n/i18n'
export default [
{
path: 'account-discovery',
component: empty,
redirect: {
name: 'AccountDiscoverList'
},
name: 'AccountDiscover',
meta: {
title: i18n.t('AccountDiscoverList'),
app: 'accounts',
icon: 'discovery'
// activeMenu: '/console/accounts/automations',
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountDiscover/index.vue'),
name: 'AccountDiscoverList',
meta: {
title: i18n.t('DiscoverAccounts'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheredaccount']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountDiscover/TaskCreateUpdate'),
name: 'AccountDiscoverTaskCreate',
hidden: true,
meta: {
title: i18n.t('AccountDiscoverTaskCreate'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.add_gatheraccountsautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountDiscover/TaskDetail/index'),
name: 'AccountDiscoverTaskDetail',
hidden: true,
meta: {
title: i18n.t('AccountDiscoverTaskDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheraccountsautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountDiscover/TaskCreateUpdate'),
name: 'AccountDiscoverTaskUpdate',
hidden: true,
meta: {
title: i18n.t('AccountDiscoverTaskUpdate'),
action: 'update',
permissions: ['accounts.change_gatheraccountsautomation'],
activeMenu: '/accounts/account-gather'
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountDiscover/TaskExecutionList.vue'),
name: 'AccountDiscoverTaskExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheraccountsexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountDiscover/ExecutionDetail/index.vue'),
name: 'AccountDiscoverExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_gatheraccountsexecution']
}
}
]
},
{
path: 'account-change-secret',
name: 'AccountChangeSecret',
component: empty,
redirect: {
name: 'AccountChangeSecretList'
},
meta: {
title: i18n.t('BaseAccountChangeSecret'),
icon: 'change-password',
app: 'accounts'
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountChangeSecret/index.vue'),
name: 'AccountChangeSecretList',
meta: {
menuTitle: i18n.t('ChangeSecret'),
title: i18n.t('AccountChangeSecret'),
permissions: ['accounts.view_changesecretautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue'),
name: 'AccountChangeSecretCreate',
hidden: true,
meta: {
title: i18n.t('AssetChangeSecretCreate'),
permissions: ['accounts.add_changesecretautomation']
}
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretCreateUpdate.vue'),
name: 'AccountChangeSecretUpdate',
hidden: true,
meta: {
title: i18n.t('AssetChangeSecretUpdate'),
permissions: ['accounts.change_changesecretautomation']
}
},
{
path: ':id',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/index.vue'),
name: 'AccountChangeSecretDetail',
hidden: true,
meta: {
title: i18n.t('AccountChangeSecret'),
permissions: ['accounts.view_changesecretautomation']
}
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionList.vue'),
name: 'AccountChangeSecretExecutionList',
hidden: true,
meta: {
title: i18n.t('ExecutionList'),
permissions: ['accounts.view_changesecretexecution']
}
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionDetail/index.vue'),
name: 'AccountChangeSecretExecutionDetail',
hidden: true,
meta: {
title: i18n.t('ExecutionDetail'),
permissions: ['accounts.view_changesecretexecution']
}
}
]
},
{
path: 'account-backup',
component: empty,
name: 'AccountBackup',
redirect: {
name: 'AccountBackupList'
},
meta: {
title: i18n.t('AccountBackup'),
app: 'accounts',
icon: 'backup',
resource: 'accountbackupautomation'
},
children: [
{
path: '',
component: () => import('@/views/accounts/AccountBackup/index.vue'),
name: 'AccountBackupList',
meta: {
menuTitle: i18n.t('AccountBackup'),
title: i18n.t('AccountBackupList'),
// activeMenu: '/console/accounts/automations',
permissions: ['accounts.view_accountbackupautomation']
}
},
{
path: 'create',
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupCreate',
meta: {
title: i18n.t('AccountBackupCreate'),
// activeMenu: '/console/accounts/automations',
action: 'create'
},
hidden: true
},
{
path: ':id/update',
component: () => import('@/views/accounts/AccountBackup/AccountBackupCreateUpdate.vue'),
name: 'AccountBackupUpdate',
meta: {
title: i18n.t('AccountBackupUpdate'),
// activeMenu: '/console/accounts/automations',
action: 'update'
},
hidden: true
},
{
path: ':id',
component: () => import('@/views/accounts/AccountBackup/AccountBackupDetail/index.vue'),
name: 'AccountBackupDetail',
meta: {
title: i18n.t('AccountBackupDetail'),
activeMenu: '/console/accounts/automations'
},
hidden: true
},
{
path: 'executions',
component: () => import('@/views/accounts/AccountBackup/AccountBackupExecution/AccountBackupExecutionList.vue'),
name: 'AccountBackupExecutionList',
meta: { title: i18n.t('ExecutionDetail') },
hidden: true
},
{
path: 'executions/:id',
component: () => import('@/views/accounts/AccountBackup/AccountBackupExecution/AccountBackupExecutionDetail/index.vue'),
name: 'AccountBackupExecutionDetail',
meta: { title: i18n.t('ExecutionDetail') },
hidden: true
}
]
}
]

View File

@@ -1,89 +0,0 @@
import Layout from '@/layout'
import i18n from '@/i18n/i18n'
import empty from '@/layout/empty'
import automations from './automations'
import integrations from './integrations'
import security from './security'
import activity from './activity'
export default {
path: '/pam/',
name: 'pam',
component: Layout,
redirect: '/pam/dashboard',
meta: {
title: i18n.t('PAM'),
icon: 'pam',
type: 'view',
showNavSwitcher: true,
permissions: [],
view: 'pam'
},
children: [
{
path: '/pam/dashboard',
component: () => import('@/views/dashboard/Pam/index'),
name: 'PamDashboard',
meta: {
icon: 'dashboard',
title: i18n.t('Dashboard'),
permissions: []
}
},
{
path: '/pam/accounts',
name: 'PamAccounts',
component: () => import('@/views/pam/Account/index.vue'),
meta: {
title: i18n.t('Accounts'),
icon: 'accounts',
permissions: []
}
},
{
path: '/pam/automations',
name: 'AccountAutomation',
component: empty,
meta: {
title: i18n.t('Automation'),
icon: 'accounts',
permissions: []
},
children: automations
},
{
path: '/pam/security',
name: 'AccountSecurity',
component: empty,
meta: {
title: i18n.t('Security'),
icon: 'accounts',
permissions: []
},
children: security
},
{
path: '/pam/integrations',
name: 'Integrations',
component: empty,
meta: {
title: i18n.t('Integration'),
icon: 'accounts',
permissions: []
},
children: integrations
},
{
path: '/pam/activity',
name: 'AccountActivity',
component: empty,
meta: {
title: i18n.t('Activity'),
icon: 'accounts',
permissions: []
},
children: activity
}
]
}

Some files were not shown because too many files have changed in this diff Show More