Merge pull request #554 from jumpserver/dev

Chore: Merge Dev
This commit is contained in:
Jiangjie.Bai 2020-12-17 15:14:11 +08:00 committed by GitHub
commit 6fa7800d6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 60 additions and 213 deletions

View File

@ -199,9 +199,9 @@ export default {
error += `${parseInt(key) + 1}.${str[key][0]} `
})
}
if (field.attrs.error === error) {
error += '.'
}
// if (field.attrs.error === error) {
// error += '.'
// }
field.attrs.error = error
}
}

View File

@ -81,10 +81,6 @@ export default {
deep: true
}
},
mounted() {
this.$log.debug(this.headerActions)
this.$log.debug(this.iTableConfig)
},
methods: {
handleSelectionChange(val) {
this.selectedRows = val

View File

@ -198,6 +198,7 @@
"BadRoleErrorMsg": "请求错误,无该操作权限",
"BadConflictErrorMsg": "正在刷新中,请稍后再试",
"Basic": "基本",
"PleaseAgreeToTheTerms": "请同意条款",
"BasicInfo": "基本信息",
"Cancel": "取消",
"Close": "关闭",

View File

@ -190,6 +190,7 @@
"actionsTips":"Clipboard's copy and paste control only support RDP/VNC protocol.",
"Active": "Active",
"Add": "Add",
"PleaseAgreeToTheTerms": "Please agree to the terms",
"PushSelected":"Push selected",
"UpdateAssetDetail": "Update more detail",
"AddSuccessMsg": "Add success",

View File

@ -9,6 +9,7 @@
:clean-form-value="cleanFormValue"
:get-method="getMethod"
:on-perform-success="onPerformSuccess"
:perform-submit="performSubmit"
/>
</IBox>
</template>
@ -88,6 +89,13 @@ export default {
getMethod() {
return 'put'
},
performSubmit(validValues) {
if (!validValues.terms) {
this.$message.error(this.$t('common.PleaseAgreeToTheTerms'))
return Promise.reject()
}
return this.$axios['put'](this.url, validValues)
},
onPerformSuccess() {
this.$message.success(this.$t('common.updateSuccessMsg'))
setTimeout(() => this.$router.push({ name: 'UserGuide' }), 100)

View File

@ -37,6 +37,7 @@ export default {
actions: {
prop: '',
formatterArgs: {
hasClone: true,
performDelete: function({ row, col, cellValue, reload }) {
this.$axios.delete(
`/api/v1/applications/applications/${row.id}/`

View File

@ -34,6 +34,7 @@ export default {
},
actions: {
formatterArgs: {
hasClone: true,
onUpdate: ({ row }) => {
vm.$router.push({ name: 'RemoteAppUpdate', params: { id: row.id }, query: { type: row.type }})
},

View File

@ -4,7 +4,6 @@
<script>
import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/ListTable/formatters/index'
export default {
components: {
@ -14,49 +13,15 @@ export default {
return {
tableConfig: {
url: '/api/v1/assets/admin-users/',
columns: [
{
prop: 'name',
label: this.$t('common.Name'),
formatter: DetailFormatter,
showOverflowTooltip: true,
sortable: true,
formatterArgs: {
route: 'AdminUserDetail'
}
columns: ['name', 'username', 'assets_amount', 'comment', 'actions'],
columnsMeta: {
username: {
showOverflowTooltip: true
},
{
prop: 'username',
label: this.$t('common.Username'),
showOverflowTooltip: true,
sortable: 'custom'
},
{
prop: 'assets_amount',
label: this.$t('assets.Assets'),
assets_amount: {
width: '80px'
},
{
prop: 'comment',
showOverflowTooltip: true,
label: this.$t('common.Comment'),
sortable: 'custom'
},
{
prop: 'id',
align: 'center',
label: this.$t('common.Action'),
formatter: ActionsFormatter,
width: '200px',
formatterArgs: {
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/assets/admin-users/${id}/`
return this.$axios.delete(url)
}
}
}
]
}
},
updateRoute: 'AdminUserUpdate',
headerActions: {

View File

@ -48,6 +48,7 @@ export default {
},
headerActions: {
hasSearch: true,
hasBulkDelete: false,
createRoute: {
name: 'CommandFilterRulesCreate',
query: {

View File

@ -4,7 +4,7 @@
<script>
import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/ListTable/formatters/index'
import { DetailFormatter } from '@/components/ListTable/formatters/index'
export default {
components: {
@ -14,62 +14,31 @@ export default {
return {
tableConfig: {
url: '/api/v1/assets/cmd-filters/',
columns: [
{
prop: 'name',
label: this.$t('assets.Name'),
formatter: DetailFormatter,
showOverflowTooltip: true,
sortable: true,
formatterArgs: {
route: 'CommandFilterDetail'
}
},
{
prop: 'rules',
columns: ['name', 'rules', 'system_users', 'comment', 'actions'],
columnsMeta: {
rules: {
label: this.$t('assets.Rules'),
formatter: DetailFormatter,
formatterArgs: {
getTitle: ({ cellValue }) => {
return cellValue.length
},
routeQuery: {
activeTab: 'rules'
},
getTitle: ({ cellValue }) => cellValue.length
}
}
},
{
prop: 'system_users',
system_users: {
label: this.$t('assets.SystemUsers'),
formatter: DetailFormatter,
formatterArgs: {
route: 'CommandFilterDetail',
getTitle: ({ cellValue }) => cellValue.length
}
},
{
prop: 'comment',
showOverflowTooltip: true,
label: this.$t('assets.Comment')
},
{
prop: 'id',
align: 'center',
label: this.$t('assets.Action'),
formatter: ActionsFormatter,
width: '200px',
formatterArgs: {
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/assets/cmd-filters/${id}/`
return this.$axios.delete(url).then(res => {
this.$message.success(this.$t('common.deleteSuccessMsg'))
window.location.reload()
}).catch(error => {
this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error))
})
getTitle: ({ cellValue }) => {
return cellValue.length
}
}
}
]
}
},
headerActions: {
hasRightActions: false,

View File

@ -4,7 +4,6 @@
<script>
import { GenericListPage } from '@/layout/components'
import { ActionsFormatter } from '@/components/ListTable/formatters/index'
export default {
components: {
@ -14,39 +13,15 @@ export default {
return {
tableConfig: {
url: '/api/v1/assets/labels/',
columns: [
{
prop: 'name',
label: this.$t('assets.Name'),
showOverflowTooltip: true,
sortable: true
columns: ['name', 'value', 'asset_count', 'actions'],
columnsMeta: {
name: {
formatter: null
},
{
prop: 'value',
label: this.$t('assets.Value'),
showOverflowTooltip: true,
sortable: 'custom'
},
{
prop: 'asset_count',
label: this.$t('assets.Assets'),
width: '80px'
},
{
prop: 'id',
align: 'center',
formatter: ActionsFormatter,
label: this.$t('assets.Action'),
width: '200px',
formatterArgs: {
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/assets/labels/${id}/`
return this.$axios.delete(url)
}
}
asset_count: {
label: this.$t('assets.Assets')
}
]
}
},
headerActions: {
hasRightActions: false,

View File

@ -4,7 +4,6 @@
<script>
import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/ListTable/formatters/index'
export default {
components: {
@ -15,49 +14,13 @@ export default {
tableConfig: {
url: '/api/v1/assets/platforms/',
columns: [
{
prop: 'name',
label: this.$t('assets.Name'),
formatter: DetailFormatter,
showOverflowTooltip: true,
sortable: true,
formatterArgs: {
route: 'PlatformDetail'
}
},
{
prop: 'base',
label: this.$t('assets.BasePlatform'),
sortable: 'custom',
'name', 'base', 'comment', 'actions'
],
columnsMeta: {
base: {
width: '140px'
},
{
prop: 'comment',
showOverflowTooltip: true,
label: this.$t('assets.Comment'),
sortable: 'custom'
},
{
prop: 'id',
align: 'center',
label: this.$t('assets.Action'),
formatter: ActionsFormatter,
width: '200px',
formatterArgs: {
canDelete: (row, vaule) => {
return !row.internal
},
canUpdate: (row, vaule) => {
return !row.internal
},
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/assets/platforms/${id}/`
return this.$axios.delete(url)
}
}
}
]
}
},
headerActions: {
hasRightActions: false,
@ -66,6 +29,7 @@ export default {
hasRefresh: false,
hasSearch: false,
hasMoreActions: false,
hasBulkDelete: false,
createRoute: 'PlatformCreate'
}
}

View File

@ -4,7 +4,6 @@
<script>
import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/ListTable/formatters/index'
export default {
components: {
@ -14,60 +13,21 @@ export default {
return {
tableConfig: {
url: '/api/v1/assets/system-users/',
columns: [
{
prop: 'name',
label: this.$t('common.Name'),
formatter: DetailFormatter,
showOverflowTooltip: true,
sortable: true,
formatterArgs: {
route: 'SystemUserDetail'
}
columns: ['name', 'username', 'protocol', 'login_mode', 'assets_amount', 'comment', 'actions'],
columnsMeta: {
username: {
showOverflowTooltip: true
},
{
prop: 'username',
label: this.$t('common.Username'),
showOverflowTooltip: true,
sortable: 'custom'
},
{
prop: 'protocol',
label: this.$t('assets.Protocol'),
sortable: 'custom',
protocol: {
width: '100px'
},
{
prop: 'login_mode_display',
label: this.$t('assets.LoginModel'),
login_mode: {
width: '120px'
},
{
prop: 'assets_amount',
label: this.$t('assets.Assets'),
assets_amount: {
width: '80px'
},
{
prop: 'comment',
showOverflowTooltip: true,
label: this.$t('common.Comment')
},
{
prop: 'id',
align: 'center',
formatter: ActionsFormatter,
width: '200px',
label: this.$t('common.Action'),
updateRoute: 'SystemUserUpdate',
formatterArgs: {
performDelete: ({ row, col }) => {
const id = row.id
const url = `/api/v1/assets/system-users/${id}/`
return this.$axios.delete(url)
}
}
}
]
}
},
headerActions: {
hasMoreActions: false,

View File

@ -72,6 +72,11 @@ export default {
activeTab: 'RemoteAppPermissionRemoteApp'
}
}
},
actions: {
formatterArgs: {
hasClone: true
}
}
}
},