mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-15 14:24:39 +00:00
stash it
This commit is contained in:
@@ -54,7 +54,7 @@ export default [
|
||||
{
|
||||
path: '',
|
||||
name: 'HostList',
|
||||
component: () => import('@/views/assets/Asset/AssetList.vue'),
|
||||
component: () => import('@/views/assets/Host/HostList.vue'),
|
||||
meta: { title: i18n.t('route.HostList') }
|
||||
},
|
||||
{
|
||||
|
||||
107
src/views/assets/Host/HostList.vue
Normal file
107
src/views/assets/Host/HostList.vue
Normal file
@@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<GenericListPage
|
||||
:table-config="tableConfig"
|
||||
:header-actions="headerActions"
|
||||
:help-message="notice"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { GenericListPage } from '@/layout/components'
|
||||
import { ActionsFormatter, DetailFormatter, TagsFormatter } from '@/components/TableFormatters'
|
||||
import { connectivityMeta } from '@/components/AccountListTable/const'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GenericListPage
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
tableConfig: {
|
||||
url: '/api/v1/assets/hosts/',
|
||||
columns: [
|
||||
'hostname', 'ip', 'public_ip', 'admin_user_display',
|
||||
'protocols', 'category', 'type', 'platform', 'sn',
|
||||
'is_active', 'connectivity', 'labels_display',
|
||||
'created_by', 'date_created', 'comment', 'org_name', 'actions'
|
||||
],
|
||||
columnsShow: {
|
||||
min: ['hostname', 'ip', 'actions'],
|
||||
default: [
|
||||
'hostname', 'ip', 'platform', 'category', 'type',
|
||||
'connectivity', 'actions'
|
||||
]
|
||||
},
|
||||
columnsMeta: {
|
||||
hostname: {
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
route: 'AssetDetail'
|
||||
},
|
||||
showOverflowTooltip: true,
|
||||
sortable: true
|
||||
},
|
||||
platform: {
|
||||
sortable: true
|
||||
},
|
||||
protocols: {
|
||||
formatter: function(row) {
|
||||
return <span> {row.protocols.toString()} </span>
|
||||
}
|
||||
},
|
||||
ip: {
|
||||
sortable: 'custom',
|
||||
width: '140px'
|
||||
},
|
||||
hardware_info: {
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
cpu_model: {
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
sn: {
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
comment: {
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
connectivity: connectivityMeta,
|
||||
labels_display: {
|
||||
formatter: TagsFormatter
|
||||
},
|
||||
actions: {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
performDelete: ({ row, col }) => {
|
||||
const id = row.id
|
||||
const url = `/api/v1/assets/assets/${id}/`
|
||||
return this.$axios.delete(url)
|
||||
},
|
||||
extraActions: [
|
||||
{
|
||||
name: 'View',
|
||||
title: this.$t(`common.UpdateAssetDetail`),
|
||||
type: 'primary',
|
||||
can: vm.$hasPerm('assets.refresh_assethardwareinfo'),
|
||||
callback: function({ cellValue, tableData, row }) {
|
||||
return this.$router.push({ name: 'AssetMoreInformationEdit', params: { id: row.id }})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasMoreActions: false,
|
||||
createRoute: 'HostCreate'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -14,9 +14,13 @@ export default {
|
||||
tableConfig: {
|
||||
url: '/api/v1/assets/platforms/',
|
||||
columns: [
|
||||
'name', 'base',
|
||||
'name', 'category', 'type',
|
||||
'comment', 'actions'
|
||||
],
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: ['name', 'category', 'type', 'actions']
|
||||
},
|
||||
columnsMeta: {
|
||||
base: {
|
||||
width: '140px'
|
||||
|
||||
Reference in New Issue
Block a user