mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-08 02:18:44 +00:00
Compare commits
46 Commits
pr@pam@sty
...
v3.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3717089c4c | ||
|
|
c2706bbafa | ||
|
|
d65f5326ae | ||
|
|
5e048b5537 | ||
|
|
5199bfb144 | ||
|
|
415e01984a | ||
|
|
bca21fb11e | ||
|
|
f1d4bbe23c | ||
|
|
c425d3842a | ||
|
|
86147dc48e | ||
|
|
656a76dae9 | ||
|
|
bad88b1543 | ||
|
|
71c58dcf8f | ||
|
|
7e953296c5 | ||
|
|
e381a32954 | ||
|
|
a4c239a79f | ||
|
|
645b3d96c4 | ||
|
|
36aea652d6 | ||
|
|
1a42ce90ab | ||
|
|
31a401b55d | ||
|
|
582a84178d | ||
|
|
9b9f7c936c | ||
|
|
2a6100957f | ||
|
|
16606d6a27 | ||
|
|
0a612f50e6 | ||
|
|
fe36fa9390 | ||
|
|
ba109900ec | ||
|
|
ec7768267f | ||
|
|
cc58b374ab | ||
|
|
04ffbb8fd6 | ||
|
|
49880f6739 | ||
|
|
e6f98d58c4 | ||
|
|
fd1f16d43c | ||
|
|
968b2415b1 | ||
|
|
776090d6ba | ||
|
|
3a37952288 | ||
|
|
62b8fc0e3b | ||
|
|
b2028869cb | ||
|
|
5277a725f8 | ||
|
|
f137788c1a | ||
|
|
f7d17c8de7 | ||
|
|
feea70b0be | ||
|
|
04696ef3d6 | ||
|
|
1731f4f788 | ||
|
|
6f25d93909 | ||
|
|
46461ec324 |
@@ -13,7 +13,7 @@ import { UpdateToken } from '@/components/FormFields'
|
||||
import Select2 from '@/components/FormFields/Select2'
|
||||
import AssetSelect from '@/components/AssetSelect'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
import { RequiredChange } from '@/components/DataForm/rules'
|
||||
import { RequiredChange, Required } from '@/components/DataForm/rules'
|
||||
|
||||
export default {
|
||||
name: 'AccountCreateForm',
|
||||
@@ -67,6 +67,7 @@ export default {
|
||||
],
|
||||
fieldsMeta: {
|
||||
assets: {
|
||||
rules: [Required],
|
||||
component: AssetSelect,
|
||||
label: this.$t('assets.Asset'),
|
||||
el: {
|
||||
|
||||
@@ -12,14 +12,17 @@
|
||||
>
|
||||
{{ v }}
|
||||
</el-tag>
|
||||
<el-input
|
||||
<component
|
||||
:is="component"
|
||||
ref="SearchInput"
|
||||
v-model.trim="filterValue"
|
||||
:fetch-suggestions="autocomplete"
|
||||
:placeholder="this.$t('common.EnterToContinue')"
|
||||
class="search-input"
|
||||
@blur="focus = false"
|
||||
@change="handleConfirm"
|
||||
@focus="focus = true"
|
||||
@select="handleSelect"
|
||||
@keyup.enter.native="handleConfirm"
|
||||
/>
|
||||
</div>
|
||||
@@ -41,13 +44,18 @@ export default {
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: () => i18n.t('perms.Input')
|
||||
},
|
||||
autocomplete: {
|
||||
type: Function,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filterTags: this.value,
|
||||
focus: false,
|
||||
filterValue: ''
|
||||
filterValue: '',
|
||||
component: this.autocomplete ? 'el-autocomplete' : 'el-input'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -55,6 +63,10 @@ export default {
|
||||
this.filterTags.splice(this.filterTags.indexOf(tag), 1)
|
||||
this.$emit('change', this.filterTags)
|
||||
},
|
||||
handleSelect(item) {
|
||||
this.filterValue = item.value
|
||||
this.handleConfirm()
|
||||
},
|
||||
handleConfirm() {
|
||||
if (this.filterValue === '') return
|
||||
if (!this.filterTags.includes(this.filterValue)) {
|
||||
|
||||
@@ -55,14 +55,14 @@ export default {
|
||||
toolbar: [
|
||||
{
|
||||
tip: this.$tc('ops.ScrollToTop'),
|
||||
icon: 'fa fa-upload',
|
||||
icon: 'fa fa-arrow-up',
|
||||
callback: () => {
|
||||
this.xterm.scrollToTop()
|
||||
}
|
||||
},
|
||||
{
|
||||
tip: this.$tc('ops.ScrollToBottom'),
|
||||
icon: 'fa fa-download',
|
||||
icon: 'fa fa-arrow-down',
|
||||
callback: () => {
|
||||
this.xterm.scrollToBottom()
|
||||
}
|
||||
@@ -108,10 +108,10 @@ export default {
|
||||
}
|
||||
|
||||
.actions {
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
z-index: 2;
|
||||
margin-top: 4px;
|
||||
text-align: right;
|
||||
background-color: #FFF;
|
||||
padding-right: 5px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
|
||||
@@ -290,6 +290,7 @@
|
||||
"Domain": "Domain",
|
||||
"DomainDetail": "Domain detail",
|
||||
"DomainHelpMessage": "The domain function is added to address the fact that some environments (such as the hybrid cloud) cannot be connected directly by jumping on the gateway server.\nJMS => Domain gateway => Target assets",
|
||||
"WebHelpMessage": "Web type assets depend on remote applications. Please go to System Settings to configure the publisher in the remote application.",
|
||||
"FullName": "Full name",
|
||||
"Gateway": "Gateway",
|
||||
"GatewayList": "Gateway",
|
||||
@@ -999,7 +1000,7 @@
|
||||
"ManualInput": "Manual input",
|
||||
"SameAccount": "Same account",
|
||||
"SpecifyAccounts": "Specify accounts",
|
||||
"AccountsHelp": "All accounts: accounts exists on the asset; Specify accounts: specify accounts by username;Manual input: username/password; Same account: The account username name same with login user",
|
||||
"AccountsHelp": "All accounts: accounts exists on the asset; Specify accounts: specify the user name of the account under the asset;Manual input: username/password; Same account: The account username name same with login user",
|
||||
"Input": "Input",
|
||||
"permAccount": "Accounts",
|
||||
"Actions": "Actions",
|
||||
@@ -2061,4 +2062,4 @@
|
||||
"PublishStatus": "Publish status",
|
||||
"NoPublished": "Unpublished"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,6 +283,7 @@
|
||||
"Domain": "ドメイン",
|
||||
"DomainDetail": "ドメインの詳細",
|
||||
"DomainHelpMessage": "ドメイン機能は、一部の環境 (ハイブリッドクラウドなど) が直接接続できないことを解決するために追加された機能で、ゲートウェイサーバを介してジャンプ登録を行うのが原理です。JMS => ドメインゲートウェイ => ターゲット資産",
|
||||
"WebHelpMessage": "Web タイプ資産はリモートアプリケーションに依存しており、システム設定のリモートアプリケーションでパブリッシャを構成してください。",
|
||||
"FullName": "フルネーム",
|
||||
"Gateway": "ゲートウェイ",
|
||||
"GatewayProtocolHelpText": "SSHゲートウェイ、プロキシSSH、RDP、VNCをサポート",
|
||||
@@ -997,7 +998,7 @@
|
||||
"ManualInput": "手動入力",
|
||||
"SameAccount": "同じ名前のアカウント",
|
||||
"SpecifyAccounts": "入力の指定",
|
||||
"AccountsHelp": "すべてのアカウント: アカウントはアセットに存在します。 アカウントの指定: ユーザー名でアカウントを指定します。手入力: ユーザー名/パスワード; 同一アカウント:ログインユーザーと同じアカウントのユーザー名",
|
||||
"AccountsHelp": "すべてのアカウント: アカウントはアセットに存在します。 アカウントの指定: 資産の下のアカウントのユーザー名を指定します。手入力: ユーザー名/パスワード; 同一アカウント:ログインユーザーと同じアカウントのユーザー名",
|
||||
"Input": "入力",
|
||||
"permAccount": "認定アカウント",
|
||||
"Actions": "アクション",
|
||||
@@ -2051,4 +2052,4 @@
|
||||
"PublishStatus": "投稿ステータス",
|
||||
"NoPublished": "未発表"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,6 +297,7 @@
|
||||
"Domain": "网域",
|
||||
"DomainDetail": "网域详情",
|
||||
"DomainHelpMessage": "网域功能是为了解决部分环境(如:混合云)无法直接连接而新增的功能,原理是通过网关服务器进行跳转登录。JMS => 网域网关 => 目标资产",
|
||||
"WebHelpMessage": "Web 类型资产依赖于远程应用,请前往系统设置在远程应用中配置发布机。",
|
||||
"FullName": "全称",
|
||||
"Gateway": "网关",
|
||||
"GatewayProtocolHelpText": "SSH网关,支持代理SSH,RDP和VNC",
|
||||
@@ -989,7 +990,7 @@
|
||||
},
|
||||
"perms": {
|
||||
"": "",
|
||||
"AccountsHelp": "所有账号: 资产上添加的账号; 指定账号:指定账号的用户名;手动输入: 用户名/密码 手动输入; 同名账号: 与被授权人用户名相同的账号;",
|
||||
"AccountsHelp": "所有账号: 资产上添加的账号; 指定账号:指定资产下账号的用户名;手动输入: 用户名/密码 手动输入; 同名账号: 与被授权人用户名相同的账号;",
|
||||
"AllAccounts": "所有账号",
|
||||
"ManualInput": "手动输入",
|
||||
"SameAccount": "同名账号",
|
||||
|
||||
@@ -10,7 +10,7 @@ function getPropOrg() {
|
||||
if (defaultOrg) {
|
||||
return defaultOrg
|
||||
}
|
||||
return orgs.filter(item => !item['is_root'])[0]
|
||||
return orgs.filter(item => !item['is_root'] && item.id !== SYSTEM_ORG_ID)[0]
|
||||
}
|
||||
|
||||
async function change2PropOrg() {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Message } from '@/utils/Message'
|
||||
import store from '@/store'
|
||||
import axiosRetry from 'axios-retry'
|
||||
import router from '@/router'
|
||||
import { DEFAULT_ORG_ID } from '@/utils/org'
|
||||
import { DEFAULT_ORG_ID, SYSTEM_ORG_ID } from '@/utils/org'
|
||||
|
||||
// create an axios instance
|
||||
const service = axios.create({
|
||||
@@ -25,7 +25,7 @@ function beforeRequestAddToken(config) {
|
||||
const queryOrgId = router.currentRoute.query?.oid
|
||||
const storeOrgId = store.getters.currentOrg?.id
|
||||
let orgId = queryOrgId || storeOrgId
|
||||
if (!store.getters.publicSettings?.XPACK_ENABLED) {
|
||||
if (!store.getters.publicSettings?.XPACK_ENABLED && orgId !== SYSTEM_ORG_ID) {
|
||||
orgId = DEFAULT_ORG_ID
|
||||
}
|
||||
if (orgId) {
|
||||
|
||||
@@ -27,7 +27,8 @@ export default {
|
||||
width: '100px'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
helpMessage: this.$t('assets.DomainHelpMessage')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-alert v-if="helpMessage" type="success">
|
||||
<span class="announcement-main" v-html="helpMessage" />
|
||||
</el-alert>
|
||||
<ListTable ref="ListTable" :header-actions="iHeaderActions" :table-config="iTableConfig" />
|
||||
<PlatformDialog :category="category" :visible.sync="showPlatform" />
|
||||
<AssetBulkUpdateDialog
|
||||
@@ -52,6 +55,10 @@ export default {
|
||||
addExtraMoreActions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
helpMessage: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -3,9 +3,8 @@ import rules from '@/components/DataForm/rules'
|
||||
import { JsonEditor } from '@/components/FormFields'
|
||||
import { assetFieldsMeta } from '@/views/assets/const'
|
||||
|
||||
const assetMeta = assetFieldsMeta()
|
||||
|
||||
export const platformFieldsMeta = (vm) => {
|
||||
const assetMeta = assetFieldsMeta(vm)
|
||||
return {
|
||||
automation: {
|
||||
initial: {
|
||||
|
||||
@@ -29,6 +29,7 @@ export const filterSelectValues = (values) => {
|
||||
export const assetFieldsMeta = (vm) => {
|
||||
const platformProtocols = []
|
||||
const secretTypes = []
|
||||
const platformType = vm?.$route.query.platform_type
|
||||
return {
|
||||
address: {
|
||||
rules: [rules.IpCheck, rules.specialEmojiCheck]
|
||||
@@ -58,9 +59,8 @@ export const assetFieldsMeta = (vm) => {
|
||||
platform: {
|
||||
el: {
|
||||
multiple: false,
|
||||
disabled: true,
|
||||
ajax: {
|
||||
url: '/api/v1/assets/platforms/',
|
||||
url: `/api/v1/assets/platforms/?type=${platformType}`,
|
||||
transformOption: (item) => {
|
||||
return { label: item.name, value: item.id }
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<script>
|
||||
import { GenericCreateUpdatePage } from '@/layout/components'
|
||||
import AssetSelect from '@/components/AssetSelect'
|
||||
import { JsonEditor } from '@/components/FormFields'
|
||||
import CodeEditor from '@/components/FormFields/CodeEditor'
|
||||
import { CronTab } from '@/components'
|
||||
import i18n from '@/i18n/i18n'
|
||||
@@ -30,7 +29,6 @@ export default {
|
||||
[this.$t('common.Basic'), ['name', 'type', 'instant']],
|
||||
[this.$t('common.Task'), ['module', 'args', 'playbook', 'chdir', 'timeout']],
|
||||
[this.$t('ops.Asset'), ['assets', 'runas', 'runas_policy']],
|
||||
[this.$t('ops.Parameter'), ['use_parameter_define', 'parameters_define']],
|
||||
[this.$t('ops.Plan'), ['run_after_save', 'is_periodic', 'crontab']],
|
||||
[this.$t('common.Other'), ['comment']]
|
||||
],
|
||||
@@ -134,13 +132,6 @@ export default {
|
||||
return true
|
||||
}
|
||||
},
|
||||
parameters_define: {
|
||||
label: '',
|
||||
component: JsonEditor,
|
||||
hidden: (formValue) => {
|
||||
return !formValue.use_parameter_define
|
||||
}
|
||||
},
|
||||
chdir: {
|
||||
helpText: i18n.t('ops.ChdirHelpText'),
|
||||
hidden: (formValue) => {
|
||||
@@ -153,13 +144,6 @@ export default {
|
||||
return this.instantTask
|
||||
}
|
||||
},
|
||||
use_parameter_define: {
|
||||
label: this.$t('ops.UseParameterDefine'),
|
||||
type: 'switch',
|
||||
hidden: () => {
|
||||
return this.instantTask
|
||||
}
|
||||
},
|
||||
is_periodic: {
|
||||
type: 'switch',
|
||||
hidden: () => {
|
||||
|
||||
@@ -91,7 +91,15 @@ export default {
|
||||
type: 'input',
|
||||
label: this.$t('perms.Account'),
|
||||
component: AccountFormatter,
|
||||
helpText: this.$t('perms.AccountsHelp')
|
||||
helpText: this.$t('perms.AccountsHelp'),
|
||||
el: {
|
||||
assets: [],
|
||||
nodes: []
|
||||
},
|
||||
hidden: (formValue) => {
|
||||
this.fieldsMeta.accounts.el.assets = formValue.assets
|
||||
this.fieldsMeta.accounts.el.nodes = formValue.nodes
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
label: this.$t('perms.Actions'),
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
</el-checkbox-group>
|
||||
<TagInput
|
||||
v-if="showSpecAccounts"
|
||||
:autocomplete="autocomplete"
|
||||
:value="specAccountsInput"
|
||||
@change="handleTagChange"
|
||||
/>
|
||||
@@ -20,13 +21,7 @@
|
||||
|
||||
<script>
|
||||
import { TagInput } from '@/components/FormFields'
|
||||
import {
|
||||
AllAccount,
|
||||
SPECAccount,
|
||||
SameUSER,
|
||||
ManualINPUT,
|
||||
AccountLabelMapper
|
||||
} from '@/views/perms/const'
|
||||
import { AccountLabelMapper, AllAccount, ManualINPUT, SameUSER, SPECAccount } from '@/views/perms/const'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -36,9 +31,18 @@ export default {
|
||||
value: {
|
||||
type: [Array],
|
||||
default: () => []
|
||||
},
|
||||
assets: {
|
||||
type: [Array],
|
||||
default: () => []
|
||||
},
|
||||
nodes: {
|
||||
type: [Array],
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
const choices = [
|
||||
{
|
||||
label: AccountLabelMapper[AllAccount],
|
||||
@@ -64,7 +68,27 @@ export default {
|
||||
choicesSelected: [],
|
||||
defaultChoices: [this.ALL],
|
||||
specAccountsInput: [],
|
||||
showSpecAccounts: false
|
||||
showSpecAccounts: false,
|
||||
autocomplete: (query, cb) => {
|
||||
this.$axios.get('/api/v1/accounts/accounts/username-suggestions/', {
|
||||
params: {
|
||||
username: query,
|
||||
assets: this.assets.slice(0, 20).join(','),
|
||||
nodes: this.nodes.slice(0, 20).map(item => {
|
||||
if (typeof item === 'object') {
|
||||
return item.pk
|
||||
} else {
|
||||
return item.pk
|
||||
}
|
||||
}).join(',')
|
||||
}
|
||||
}).then(res => {
|
||||
const data = res
|
||||
.filter(item => vm.value.indexOf(item) === -1)
|
||||
.map(v => ({ value: v, label: v }))
|
||||
cb(data)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
Reference in New Issue
Block a user