mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 06:19:51 +00:00
perf: filter gateway using new params
This commit is contained in:
@@ -61,7 +61,7 @@ export default {
|
||||
row['auto_config'].ansible_enabled &&
|
||||
row['auto_config'].ping_enabled,
|
||||
callback: ({ row }) => {
|
||||
if (row.platform.name === 'Gateway') {
|
||||
if (row.platform.name.startsWith('Gateway')) {
|
||||
this.GatewayVisible = true
|
||||
const port = row.protocols.find(item => item.name === 'ssh').port
|
||||
if (!port) {
|
||||
|
@@ -191,7 +191,7 @@ export default {
|
||||
row?.auto_config?.ansible_enabled &&
|
||||
row?.auto_config?.ping_enabled,
|
||||
callback: ({ row }) => {
|
||||
if (row.platform.name === 'Gateway') {
|
||||
if (row.platform.name.startsWith('Gateway')) {
|
||||
this.GatewayVisible = true
|
||||
const port = row.protocols.find(item => item.name === 'ssh').port
|
||||
if (!port) {
|
||||
|
@@ -30,7 +30,7 @@ export default {
|
||||
domain_enabled: true
|
||||
},
|
||||
canSelect: (row) => {
|
||||
return row.platform?.name !== 'Gateway'
|
||||
return !row.platform?.name.startsWith('Gateway')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -25,7 +25,7 @@ export default {
|
||||
return {
|
||||
tableConfig: {
|
||||
category: 'all',
|
||||
url: `/api/v1/assets/assets/?domain=${this.$route.params.id}&exclude_platform=Gateway`,
|
||||
url: `/api/v1/assets/assets/?domain=${this.$route.params.id}&is_gateway=0`,
|
||||
tableConfig: {
|
||||
columnsMeta: {
|
||||
actions: {
|
||||
|
@@ -39,7 +39,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
tableConfig: {
|
||||
url: `/api/v1/assets/gateways/?domain=${this.$route.params.id}&platform=Gateway`,
|
||||
url: `/api/v1/assets/gateways/?domain=${this.$route.params.id}`,
|
||||
columnsExclude: [
|
||||
'info', 'spec_info', 'auto_config'
|
||||
],
|
||||
@@ -174,7 +174,7 @@ export default {
|
||||
name: 'GatewayAdd',
|
||||
title: this.$t('Add'),
|
||||
callback: function() {
|
||||
this.AddGatewaySetting.AddGatewayDialogVisible = true
|
||||
this.AddGatewaySetting.addGatewayDialogVisible = true
|
||||
}.bind(this)
|
||||
}
|
||||
]
|
||||
@@ -183,7 +183,7 @@ export default {
|
||||
cell: '',
|
||||
visible: false,
|
||||
AddGatewaySetting: {
|
||||
AddGatewayDialogVisible: false
|
||||
addGatewayDialogVisible: false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -68,7 +68,7 @@ export default {
|
||||
domain_enabled: true
|
||||
},
|
||||
canSelect: (row) => {
|
||||
return row.platform?.name !== 'Gateway' && this.object.assets.map(item => item.id).indexOf(row.id) === -1
|
||||
return !row.platform?.name.startsWith('Gateway') && this.object.assets.map(item => item.id).indexOf(row.id) === -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<Dialog
|
||||
v-if="setting.AddGatewayDialogVisible"
|
||||
v-if="setting.addGatewayDialogVisible"
|
||||
:destroy-on-close="true"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:title="$tc('AddGatewayInDomain')"
|
||||
:visible.sync="setting.AddGatewayDialogVisible"
|
||||
:visible.sync="setting.addGatewayDialogVisible"
|
||||
after
|
||||
custom-class="asset-select-dialog"
|
||||
top="15vh"
|
||||
@@ -31,7 +31,7 @@ export default {
|
||||
setting: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return { AddGatewayDialogVisible: false }
|
||||
return { addGatewayDialogVisible: false }
|
||||
}
|
||||
},
|
||||
object: {
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
multiple: true,
|
||||
clearable: true,
|
||||
ajax: {
|
||||
url: '/api/v1/assets/assets/?domain_enabled=true&platform=Gateway'
|
||||
url: '/api/v1/assets/assets/?domain_enabled=true&is_gateway=1'
|
||||
},
|
||||
disabledValues: this.object.gateways.map(item => item.id)
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onSubmitSuccess(res) {
|
||||
this.setting.AddGatewayDialogVisible = false
|
||||
this.setting.addGatewayDialogVisible = false
|
||||
this.$emit('close', res)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user