mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-09 11:19:11 +00:00
Compare commits
80 Commits
pr@dev@per
...
v4.10.2-lt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8c943fbf5 | ||
|
|
3934b45367 | ||
|
|
0c5e84d1e3 | ||
|
|
18a3f42717 | ||
|
|
68030d98b2 | ||
|
|
a861f77609 | ||
|
|
e58ec6057c | ||
|
|
7ab20c5885 | ||
|
|
e47ddb5355 | ||
|
|
56aa3caa83 | ||
|
|
19b1dc0dbc | ||
|
|
77ef172a23 | ||
|
|
4596887bf1 | ||
|
|
0a3dc30c85 | ||
|
|
51d24bc8e5 | ||
|
|
1b15a4d043 | ||
|
|
7d3f818242 | ||
|
|
4e26f18d77 | ||
|
|
b22613617a | ||
|
|
e971cbf4a8 | ||
|
|
4672abae35 | ||
|
|
ba36d72602 | ||
|
|
4bfbbba4c5 | ||
|
|
ea038ce43a | ||
|
|
e16b19666c | ||
|
|
c7f5409eb6 | ||
|
|
fdbd7d2222 | ||
|
|
ddbaeeafea | ||
|
|
efb0e9dacb | ||
|
|
f6f8301ad5 | ||
|
|
9a63ae63d4 | ||
|
|
1e007ccda3 | ||
|
|
d1d0b06b53 | ||
|
|
5fb70d2f24 | ||
|
|
b54a95430f | ||
|
|
4d8b4c45af | ||
|
|
a6d642df60 | ||
|
|
2e74f1522f | ||
|
|
fe615e0314 | ||
|
|
09f734e6fc | ||
|
|
3117046342 | ||
|
|
b68aecb5cc | ||
|
|
1c9b155d97 | ||
|
|
75b1be9864 | ||
|
|
615c3c1cf4 | ||
|
|
4d82231af4 | ||
|
|
c6cf6571b6 | ||
|
|
8ea990d070 | ||
|
|
f4a32170d5 | ||
|
|
073508675e | ||
|
|
1d6ca0a93a | ||
|
|
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 |
@@ -1,221 +0,0 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:close-on-click-modal="false"
|
||||
:title="$t('AssetAccount')"
|
||||
custom-class="account-select-dialog"
|
||||
top="2vh"
|
||||
v-bind="$attrs"
|
||||
width="1000px"
|
||||
@cancel="handleCancel"
|
||||
@close="handleClose"
|
||||
@confirm="handleConfirm"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<AssetTreeTable
|
||||
ref="ListPage"
|
||||
:header-actions="headerActions"
|
||||
:node-url="baseNodeUrl"
|
||||
:sync-select-to-url="false"
|
||||
:table-config="tableConfig"
|
||||
:tree-setting="iTreeSetting"
|
||||
:tree-url="`${baseNodeUrl}children/tree/`"
|
||||
:url="baseUrl"
|
||||
class="tree-table"
|
||||
v-bind="$attrs"
|
||||
@loaded="handleTableLoaded"
|
||||
v-on="$listeners"
|
||||
/>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AssetTreeTable from '@/components/Apps/AssetTreeTable/index.vue'
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
|
||||
export default {
|
||||
componentName: 'AssetSelectDialog',
|
||||
components: { AssetTreeTable, Dialog },
|
||||
props: {
|
||||
baseUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/accounts/accounts/'
|
||||
},
|
||||
baseNodeUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/nodes/'
|
||||
},
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
canSelect: {
|
||||
type: Function,
|
||||
default(row, index) {
|
||||
return true
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
type: [Boolean, Function],
|
||||
default: false
|
||||
},
|
||||
treeSetting: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
isLoaded: false,
|
||||
dialogVisible: false,
|
||||
rowSelected: _.cloneDeep(this.value) || [],
|
||||
rowsAdd: [],
|
||||
tableConfig: {
|
||||
url: this.baseUrl,
|
||||
hasTree: true,
|
||||
canSelect: this.canSelect,
|
||||
columns: [
|
||||
{
|
||||
prop: 'name',
|
||||
label: this.$t('Name'),
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
prop: 'username',
|
||||
label: this.$t('Username'),
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop: 'asset.name',
|
||||
label: this.$t('Asset'),
|
||||
sortable: 'custom',
|
||||
formatter: function(row) {
|
||||
return row.asset.name
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'asset.platform.name',
|
||||
label: this.$t('Platform'),
|
||||
sortable: true,
|
||||
formatter: function(row) {
|
||||
return row.asset.platform.name
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'secret_type.label',
|
||||
label: this.$t('SecretType'),
|
||||
sortable: true,
|
||||
formatter: function(row) {
|
||||
return row.secret_type.label
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'actions',
|
||||
has: false
|
||||
}
|
||||
],
|
||||
listeners: {
|
||||
'toggle-row-selection': (isSelected, row) => {
|
||||
if (isSelected) {
|
||||
vm.addRowToSelect(row)
|
||||
} else {
|
||||
vm.removeRowFromSelect(row)
|
||||
}
|
||||
}
|
||||
}
|
||||
// theRowDefaultIsSelected: (row) => {
|
||||
// return this.value.indexOf(row.id) > -1
|
||||
// }
|
||||
},
|
||||
headerActions: {
|
||||
hasLeftActions: false,
|
||||
hasRightActions: false,
|
||||
hasLabelSearch: true,
|
||||
searchConfig: {
|
||||
getUrlQuery: false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iTreeSetting() {
|
||||
return { ...this.treeSetting, selectSyncToRoute: false }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTableLoaded() {
|
||||
this.isLoaded = true
|
||||
},
|
||||
handleClose() {
|
||||
this.$refs.ListPage.$refs.TreeList.componentKey += 1
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$emit('confirm', this.rowSelected, this.rowsAdd)
|
||||
if (this.rowSelected.length > 0) {
|
||||
this.handleClose()
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$emit('cancel')
|
||||
this.handleClose()
|
||||
},
|
||||
addRowToSelect(row) {
|
||||
this.rowSelected.push(row.username)
|
||||
this.rowsAdd.push(row)
|
||||
// const selectValueIndex = this.rowSelected.indexOf(row.id)
|
||||
// if (selectValueIndex === -1) {
|
||||
// this.rowSelected.push(row.id)
|
||||
// this.rowsAdd.push(row)
|
||||
// }
|
||||
},
|
||||
removeRowFromSelect(row) {
|
||||
const selectValueIndex = this.rowSelected.indexOf(row.username)
|
||||
this.rowSelected.splice(selectValueIndex, 1)
|
||||
// const selectValueIndex = this.rowSelected.indexOf(row.id)
|
||||
// if (selectValueIndex > -1) {
|
||||
// this.rowSelected.splice(selectValueIndex, 1)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page ::v-deep .page-heading {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__wrapper ::v-deep .el-dialog__body {
|
||||
padding: 0 0 0 3px;
|
||||
|
||||
.tree-table {
|
||||
.search {
|
||||
}
|
||||
|
||||
.left {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.right {
|
||||
min-height: 500px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.mini {
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.transition-box {
|
||||
padding: 10px 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.page ::v-deep .treebox .ztree {
|
||||
|
||||
}
|
||||
|
||||
.account-select-dialog ::v-deep .el-icon-circle-check {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@@ -1,23 +1,25 @@
|
||||
<template>
|
||||
<tr>
|
||||
<td>{{ getActionTitle(action) }}</td>
|
||||
<td>
|
||||
{{ getActionTitle(action) }}
|
||||
<el-tooltip v-if="action.attrs.showTip" :content="action.attrs.tip" :open-delay="500" effect="dark">
|
||||
<i class="fa fa-question-circle-o" />
|
||||
</el-tooltip>
|
||||
</td>
|
||||
<td>
|
||||
<span slot="reference">
|
||||
<component
|
||||
:is="iType"
|
||||
v-model="action.attrs.model"
|
||||
:title="label"
|
||||
v-bind="action.attrs"
|
||||
v-on="callbacks"
|
||||
>
|
||||
{{ label }}
|
||||
</component>
|
||||
</span>
|
||||
<el-popover
|
||||
:content="action.attrs.tip"
|
||||
:disabled="!action.attrs.showTip"
|
||||
placement="left-end"
|
||||
trigger="hover"
|
||||
>
|
||||
<span slot="reference">
|
||||
<component
|
||||
:is="iType"
|
||||
v-model="action.attrs.model"
|
||||
:title="label"
|
||||
v-bind="action.attrs"
|
||||
v-on="callbacks"
|
||||
>
|
||||
{{ label }}
|
||||
</component>
|
||||
</span>
|
||||
</el-popover>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
@@ -196,23 +196,18 @@ export default {
|
||||
}
|
||||
|
||||
let title = this.title
|
||||
|
||||
if (!title && this.resource) {
|
||||
title = this.resource
|
||||
}
|
||||
|
||||
if (!title) {
|
||||
title = this.$route.meta?.title
|
||||
title = title.replace('List', '').replace('列表', '')
|
||||
title = _.trimEnd(title, 's')
|
||||
}
|
||||
|
||||
if (!title) {
|
||||
title = this.$t('NoTitle')
|
||||
}
|
||||
|
||||
let actionLabel = ''
|
||||
|
||||
if (action === 'clone' || action === 'create') {
|
||||
actionLabel = this.$t('Create')
|
||||
} else if (action === 'update') {
|
||||
@@ -220,9 +215,7 @@ export default {
|
||||
} else if (action === 'detail') {
|
||||
actionLabel = this.$t('Detail')
|
||||
}
|
||||
|
||||
title = actionLabel + this.$t('WordSep') + toLowerCaseExcludeAbbr(title)
|
||||
|
||||
return title
|
||||
},
|
||||
getDefaultDrawer(action) {
|
||||
|
||||
@@ -244,10 +244,12 @@ export default {
|
||||
delete routeFilter.search
|
||||
}
|
||||
const asFilterTags = _.cloneDeep(this.filterTags)
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
getValueLabel(key, value) {
|
||||
for (const field of this.options) {
|
||||
|
||||
@@ -33,8 +33,8 @@ export default {
|
||||
return this.$t('PasswordExpired')
|
||||
}
|
||||
if (securityPasswordExpirationTime - intervalTime <= 5) {
|
||||
return this.$t('PasswordWillExpiredPrefixMsg') + ' ' +
|
||||
(securityPasswordExpirationTime - intervalTime) + ' ' +
|
||||
return this.$t('PasswordWillExpiredPrefixMsg') +
|
||||
(securityPasswordExpirationTime - intervalTime) +
|
||||
this.$t('PasswordWillExpiredSuffixMsg')
|
||||
}
|
||||
return false
|
||||
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
})
|
||||
},
|
||||
handleConfirm() {
|
||||
const url = `/api/v1/accounts/gathered-accounts/${this.account.id}/`
|
||||
const url = '/api/v1/accounts/gathered-accounts/'
|
||||
this.$axios.delete(url, {
|
||||
params: {
|
||||
username: this.account.username,
|
||||
|
||||
@@ -98,21 +98,6 @@ export default {
|
||||
this.updateTaskData({ 'release_assets': val })
|
||||
}.bind(this)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('IsAlwaysUpdate'),
|
||||
type: 'switch',
|
||||
attrs: {
|
||||
showTip: true,
|
||||
tip: this.$t('IsAlwaysUpdateHelpTip'),
|
||||
model: this.object.task.is_always_update,
|
||||
disabled: !this.hasEditPerm()
|
||||
},
|
||||
callbacks: {
|
||||
change: function(val) {
|
||||
this.updateTaskData({ 'is_always_update': val })
|
||||
}.bind(this)
|
||||
}
|
||||
}
|
||||
],
|
||||
quickExecuteActions: [
|
||||
|
||||
@@ -27,14 +27,8 @@
|
||||
<el-button size="mini" type="primary" @click="showTemplateDialog=true">
|
||||
{{ $t('TemplateAdd') }}
|
||||
</el-button>
|
||||
<span v-if="showAddAccount">
|
||||
<el-button size="mini" type="primary" @click="showAccountSelectDialog=true">
|
||||
{{ $t('AssetAccount') }}
|
||||
</el-button>
|
||||
</span>
|
||||
<span class="help-block">
|
||||
{{ addTemplateHelpText }}
|
||||
{{ addAccountSelectHelpText }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
@@ -79,15 +73,6 @@
|
||||
>
|
||||
<ListTable ref="templateTable" v-bind="accountTemplateTable" />
|
||||
</Dialog>
|
||||
<AccountSelectDialog
|
||||
v-if="showAccountSelectDialog"
|
||||
:value="value"
|
||||
:visible.sync="showAccountSelectDialog"
|
||||
v-bind="$attrs"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
v-on="$listeners"
|
||||
/>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
@@ -107,11 +92,9 @@ import {
|
||||
} from '@/views/perms/const'
|
||||
import ListTable from '@/components/Table/ListTable'
|
||||
import Dialog from '@/components/Dialog'
|
||||
import AccountSelectDialog from '@/components/Apps/AccountSelect/dialog.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
AccountSelectDialog,
|
||||
TagInput,
|
||||
ListTable,
|
||||
Dialog
|
||||
@@ -146,16 +129,6 @@ export default {
|
||||
default() {
|
||||
return this.$t('TemplateHelpText')
|
||||
}
|
||||
},
|
||||
addAccountSelectHelpText: {
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('AccountSelectHelpText')
|
||||
}
|
||||
},
|
||||
showAddAccount: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -167,7 +140,6 @@ export default {
|
||||
VIRTUAL: virtual,
|
||||
EXCLUDE: NotAccount,
|
||||
showTemplateDialog: false,
|
||||
showAccountSelectDialog: false,
|
||||
realRadioSelected: this.ALL,
|
||||
realChoices: realChoices,
|
||||
virtualChecked: false,
|
||||
@@ -308,19 +280,6 @@ export default {
|
||||
|
||||
this.$emit('input', choicesSelected)
|
||||
this.$emit('change', choicesSelected)
|
||||
},
|
||||
handleConfirm(valueSelected, rowsAdd) {
|
||||
if (valueSelected === undefined) { return }
|
||||
const newUsernames = [...new Set(rowsAdd.map(row => row.username))]
|
||||
this.specAccountsInput = [...new Set([...this.specAccountsInput, ...newUsernames])]
|
||||
this.outputValue()
|
||||
setTimeout(() => {
|
||||
this.showAccountSelectDialog = false
|
||||
this.outputValue()
|
||||
}, 100)
|
||||
},
|
||||
handleCancel() {
|
||||
this.showAccountSelectDialog = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -374,33 +333,4 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.el-dialog__wrapper ::v-deep .el-dialog__body {
|
||||
padding: 0 0 0 3px;
|
||||
|
||||
.tree-table {
|
||||
.left {
|
||||
padding: 5px 0;
|
||||
|
||||
.ztree {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
.transition-box {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.mini {
|
||||
padding-top: 8px;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.transition-box {
|
||||
padding: 10px 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -42,16 +42,9 @@ export default {
|
||||
'applet.display_name', 'applet.version',
|
||||
'date_updated', 'status', 'actions'
|
||||
],
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: [
|
||||
'applet.display_name', 'status', 'actions'
|
||||
]
|
||||
},
|
||||
columnsMeta: {
|
||||
'applet.display_name': {
|
||||
label: this.$t('DisplayName'),
|
||||
width: '160px',
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
drawer: true,
|
||||
@@ -68,7 +61,7 @@ export default {
|
||||
label: this.$t('Version')
|
||||
},
|
||||
status: {
|
||||
label: this.$t('Status'),
|
||||
label: this.$t('PublishStatus'),
|
||||
formatter: (row) => {
|
||||
const typeMapper = {
|
||||
'pending': 'success',
|
||||
@@ -84,7 +77,7 @@ export default {
|
||||
label: this.$t('Date')
|
||||
},
|
||||
actions: {
|
||||
width: '138px',
|
||||
width: '160px',
|
||||
formatterArgs: {
|
||||
hasUpdate: false,
|
||||
hasDelete: false,
|
||||
|
||||
Reference in New Issue
Block a user