0.3.0-beta.39 • Published 8 months ago

@blueking/ip-selector v0.3.0-beta.39

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

蓝鲸 IPv6 选择器

使用

service.js
  export default {
    fetchTopologyWithCount: (params) => {
      return http.post('topology_width_count', { params })
    },
    fetchTopologyHost: (params) => {
      return http.post('topology_host', { params })
    },
    fetchTopologyHostIdsNodes: (params) => {
      return http.post('topology_host_ids_noodes', { params })
    },
    // ...
  }
创建组件
import vue from 'vue';
import createFactory from '@blueking/ip-selector';
import Service from './service'

// 初始化配置,创建组件
const IpSelector = createFactory({
  // 组件版本(改变版本重置用户自定义配置)
  version: '',
  // 需要支持的面板('staticTopo', 'dynamicTopo', 'dynamicGroup', 'serviceTemplate', 'setTemplate', 'serviceInstance', 'manualInput')
  panelList: ['staticTopo', 'dynamicTopo', 'dynamicGroup', 'manualInput'],
  // 面板选项的值是否唯一
  unqiuePanelValue: false,
  // 字段命名风格('camelCase', 'kebabCase')
  nameStyle: 'camelCase',
  // 主机列表全选模式,false: 本页全选;true: 跨页全选
  hostTableDefaultSelectAllMode: false,
  // 主机列表开启仅显示可用过滤
  hostOnlyValid: false,
  // 主机列表开启仅显示可用过滤时,手动输入 tab 判断主机可用的回调
  manualInputHostValidMethod: () => true,
  // 自定义主机列表列
  hostTableCustomColumnList: [
    // {
    //   key: 'collectStatus',
    //   index: 5,
    //   width: '100px',
    //   label: '采集状态',
    //   renderHead: h => h('span', '采集状态'),
    //   field: 'collect_status',
    //   renderCell: (h, row) => h('span', row.collect_status || '--'),
    // }
  ],
  nodeTableCustomColumnList: [],  // 自定义动态拓扑列表列 同上
  serviceTemplateTableCustomColumnList: [],  // 自定义服务模板列表列 同上
  setTemplateCustomColumnList: [],  // 自定义集群模板列表列 同上
  hostMemuExtends: [
    // {
    //   name: '复制采集状态异常',
    //   action: () => {
    //     console.log('复制成功');
    //   },
    // },
  ],
  // 主机预览字段显示
  hostViewFieldRender: (host, primaryField) => host.host_id,
  // 主机列表显示列(默认值:['ip', 'ipv6', 'alive', 'osName']),按配置顺序显示列
  // 内置所有列的 key ['ip', 'ipv6', 'cloudArea', 'alive', 'hostName', 'osName', 'coludVerdor', 'osType', 'hostId', 'agentId']
  hostTableRenderColumnList: [],

  // 创建时是否提示 service 信息
  serviceConfigError: false,

  // 需要的数据源配置(返回 Promise)
  // 主机拓扑
  fetchTopologyHostCount: Service.fetchTopologyWithCount,
  fetchTopologyHostsNodes: Service.fetchTopologyHost, // (params: Object, hostOnlyValid: boolean) => Promise<any[]>
  fetchTopologyHostIdsNodes: Service.fetchTopogyHostIdList, // (params: Object, hostOnlyValid: boolean) => Promise<any[]>
  fetchHostsDetails: Service.fetchHostInfoByHostId,
  fetchHostCheck: Service.fetchInputParseHostList,
  fetchNodesQueryPath: Service.fetchNodePath,
  fetchHostAgentStatisticsNodes: Service.fetchBatchNodeAgentStatistics,
  // 动态分组
  fetchDynamicGroups: Service.fetchDynamicGroup,
  fetchHostsDynamicGroup: Service.fetchDynamicGroupHost,
  fetchHostAgentStatisticsDynamicGroups: Service.fetchBatchGroupAgentStatistics,
  // 服务模板
  fetchServiceTemplates: Service.fetchServiceTemplates,
  fetchNodesServiceTemplate: Service.fetchNodesServiceTemplate,
  fetchHostServiceTemplate: Service.fetchHostServiceTemplate,
  fetchHostAgentStatisticsServiceTemplate: Service.fetchHostAgentStatisticsServiceTemplate,
  // 集群模板
  fetchSetTemplates: Service.fetchSetTemplates,
  fetchNodesSetTemplate: Service.fetchNodesSetTemplate,
  fetchHostSetTemplate: Service.fetchHostSetTemplate,
  fetchHostAgentStatisticsSetTemplate: Service.fetchHostAgentStatisticsSetTemplate,
  // 服务实例
  fetchSeriviceInstanceList: Service.fetchSeriviceInstanceList,
  fetchSeriviceInstanceDetails: Service.fetchSeriviceInstanceDetails,
  // DBM 白名单
  fetchDBMWhitelist: Service.fetchDBMWhitelist,
  // 自定义配置
  fetchCustomSettings: Service.fetchAll,
  updateCustomSettings: Service.update,
  // 系统相关配置
  fetchConfig: () => Promise.resolve()
    .then(() => ({
      // CMDB 动态分组链接
      bk_cmdb_dynamic_group_url: `http:xx.yy.zz.com/#/business/1/custom-query`,
      // CMDB 拓扑节点链接
      bk_cmdb_static_topo_url: `http:xx.yy.zz.com/#/business/1/custom-query`,
      // DBM 创建白名单链接
      bk_dbm_whitelist: `http:xx.yy.zz.com/#/business/1/custom-query`,
      // CMDB 服务模版链接
      bk_cmdb_service_template_url: `http:xx.yy.zz.com/#/business/1/custom-query`,
    })),
})

// 全局注册
vue.component('IpSelector', IpSelector)

组件 Props

组件 Events

实例方法

0.3.0-beta.39

8 months ago

0.3.0-beta.38

8 months ago

0.3.0-beta.37

8 months ago

0.3.0-beta.36

8 months ago

0.3.0-beta.35

9 months ago

0.3.0-beta.34

9 months ago

0.3.0-beta.33

9 months ago

0.3.0-beta.32

10 months ago

0.3.0-beta.30

11 months ago

0.3.0-beta.24

1 year ago

0.3.0-beta.29

12 months ago

0.3.0-beta.28

12 months ago

0.3.0-beta.27

12 months ago

0.3.0-beta.26

1 year ago

0.3.0-beta.23

1 year ago

0.3.0-beta.22

1 year ago

0.3.0-beta.21

1 year ago

0.3.0-beta.20

1 year ago

0.3.0-beta.19

1 year ago

0.3.0-beta.18

1 year ago

0.3.0-beta.17

1 year ago

0.3.0-beta.16

1 year ago

0.3.0-beta.14

1 year ago

0.3.0-beta.15

1 year ago

0.3.0-beta.13

1 year ago

0.3.0-beta.12

1 year ago

0.3.0-beta.11

1 year ago

0.3.0-beta.8

1 year ago

0.3.0-beta.9

1 year ago

0.2.0-beta.1

1 year ago

0.3.0-beta.6

1 year ago

0.3.0-beta.7

1 year ago

0.3.0-beta.5

1 year ago

0.3.0-beta.4

1 year ago

0.3.0-beta.2

1 year ago

0.3.0-beta.3

1 year ago

0.3.0-beta.1

1 year ago

0.0.1-beta.138

2 years ago

0.0.1-beta.132

2 years ago

0.0.1-beta.133

2 years ago

0.0.1-beta.130

2 years ago

0.0.1-beta.131

2 years ago

0.0.1-beta.136

2 years ago

0.0.1-beta.137

2 years ago

0.0.1-beta.134

2 years ago

0.0.1-beta.135

2 years ago

0.0.1-beta.129

2 years ago

0.0.1-beta.127

2 years ago

0.0.1-beta.128

2 years ago

0.0.1-beta.121

2 years ago

0.0.1-beta.122

2 years ago

0.0.1-beta.120

2 years ago

0.0.1-beta.125

2 years ago

0.0.1-beta.126

2 years ago

0.0.1-beta.123

2 years ago

0.0.1-beta.124

2 years ago

0.0.1-beta.118

2 years ago

0.0.1-beta.119

2 years ago

0.0.1-beta.116

2 years ago

0.0.1-beta.117

2 years ago

0.0.1-beta.114

2 years ago

0.0.1-beta.115

2 years ago

0.0.1-beta.112

2 years ago

0.0.1-beta.113

2 years ago

0.2.0-beta

2 years ago

0.0.1-beta.110

2 years ago

0.0.1-beta.111

2 years ago

0.0.1-beta.109

2 years ago

0.0.1-beta.107

2 years ago

0.0.1-beta.108

2 years ago

0.0.1-beta.105

2 years ago

0.0.1-beta.106

2 years ago

0.0.1-beta.100

2 years ago

0.0.1-beta.103

2 years ago

0.0.1-beta.104

2 years ago

0.0.1-beta.101

2 years ago

0.0.1-beta.102

2 years ago

0.0.1-beta.98

2 years ago

0.0.1-beta.97

2 years ago

0.0.1-beta.99

2 years ago

0.0.1-beta.90

2 years ago

0.0.1-beta.92

2 years ago

0.0.1-beta.91

2 years ago

0.0.1-beta.94

2 years ago

0.0.1-beta.93

2 years ago

0.0.1-beta.96

2 years ago

0.0.1-beta.95

2 years ago

0.0.1-beta.87

2 years ago

0.0.1-beta.86

2 years ago

0.0.1-beta.89

2 years ago

0.0.1-beta.88

2 years ago

0.0.1-beta.83

2 years ago

0.0.1-beta.82

2 years ago

0.0.1-beta.85

2 years ago

0.0.1-beta.84

2 years ago

0.0.1-beta.81

2 years ago

0.0.1-beta.80

2 years ago

0.0.1-beta.76

2 years ago

0.0.1-beta.75

2 years ago

0.0.1-beta.78

2 years ago

0.0.1-beta.77

2 years ago

0.0.1-beta.72

2 years ago

0.0.1-beta.71

2 years ago

0.0.1-beta.74

2 years ago

0.0.1-beta.73

2 years ago

0.0.1-beta.79

2 years ago

0.0.1-beta.70

2 years ago

0.0.1-beta.67

2 years ago

0.0.1-beta.66

2 years ago

0.0.1-beta.69

2 years ago

0.0.1-beta.68

2 years ago

0.0.1-beta.64

2 years ago

0.0.1-beta.61

2 years ago

0.0.1-beta.60

2 years ago

0.0.1-beta.63

2 years ago

0.0.1-beta.62

2 years ago

0.0.1-beta.54

2 years ago

0.0.1-beta.53

2 years ago

0.0.1-beta.56

2 years ago

0.0.1-beta.55

2 years ago

0.0.1-beta.58

2 years ago

0.0.1-beta.57

2 years ago

0.0.1-beta.59

2 years ago

0.0.1-beta.43

3 years ago

0.0.1-beta.42

3 years ago

0.0.1-beta.45

3 years ago

0.0.1-beta.44

3 years ago

0.0.1-beta.41

3 years ago

0.0.1-beta.40

3 years ago

0.0.1-beta.47

2 years ago

0.0.1-beta.46

3 years ago

0.0.1-beta.49

2 years ago

0.0.1-beta.48

2 years ago

0.0.1-beta.32

3 years ago

0.0.1-beta.31

3 years ago

0.0.1-beta.34

3 years ago

0.0.1-beta.33

3 years ago

0.0.1-beta.30

3 years ago

0.0.1-beta.39

3 years ago

0.0.1-beta.36

3 years ago

0.0.1-beta.38

3 years ago

0.0.1-beta.37

3 years ago

0.0.1-beta.29

3 years ago

0.0.1-beta.28

3 years ago

0.0.1-beta.27

3 years ago

0.0.1-beta.50

2 years ago

0.0.1-beta.52

2 years ago

0.0.1-beta.51

2 years ago

0.0.1-beta.23

3 years ago

0.0.1-beta.25

3 years ago

0.0.1-beta.26

3 years ago

0.0.1-beta.22

3 years ago

0.0.1-beta.21

3 years ago

0.0.1-beta.20

3 years ago

0.0.1-beta.19

3 years ago

0.0.1-beta.18

3 years ago

0.0.1-beta.17

3 years ago

0.0.1-beta.16

3 years ago

0.0.1-beta.15

3 years ago

0.0.1-beta.14

3 years ago

0.0.1-beta.13

3 years ago

0.0.1-beta.12

3 years ago

0.0.1-beta.11

3 years ago

0.0.1-beta.9

3 years ago

0.0.1-beta.8

3 years ago

0.0.1-beta.7

3 years ago

0.0.1-beta.6

3 years ago

0.0.1-beta.5

3 years ago

0.0.1-beta.4

3 years ago

0.0.1-beta.3

3 years ago

0.0.1-beta.2

3 years ago

0.0.1-beta.1

3 years ago