77
88import React from 'react'
99import classnames from 'classnames'
10+ import { Icon } from 'antd'
1011import Agent from '../Agent'
1112import isInViewport from 'wheel-js/src/browser/isInViewport'
1213import './list-item.less'
@@ -22,7 +23,7 @@ export default class ListItem extends React.Component {
2223 getTitle ( ) {
2324 let { lang} = this . props
2425 return this . is_sys ? lang . sys_hosts_title : this . props . data . title ||
25- lang . untitled
26+ lang . untitled
2627 }
2728
2829 beSelected ( ) {
@@ -66,6 +67,17 @@ export default class ListItem extends React.Component {
6667 'data-id' : data . id || ''
6768 }
6869
70+ let icon_type
71+ if ( sys ) {
72+ icon_type = 'desktop'
73+ } else if ( data . where === 'remote' ) {
74+ icon_type = 'global'
75+ } else if ( data . where === 'group' ) {
76+ icon_type = 'copy'
77+ } else {
78+ icon_type = 'file-text'
79+ }
80+
6981 return (
7082 < div className = { classnames ( {
7183 'list-item' : 1
@@ -94,15 +106,20 @@ export default class ListItem extends React.Component {
94106 />
95107 </ div >
96108 ) }
97- < i className = { classnames ( {
98- 'iconfont' : 1
99- , 'item-icon' : 1
100- , 'icon-warn' : ! ! data . error
101- , 'icon-file' : ! sys && ! data . error && data . where !== 'group'
102- , 'icon-files' : data . where === 'group'
103- , 'icon-sysserver' : sys && ! data . error
104- } ) }
105- title = { data . error || '' }
109+ { /*<i className={classnames({*/ }
110+ { /*'iconfont': 1*/ }
111+ { /*, 'item-icon': 1*/ }
112+ { /*, 'icon-warn': !!data.error*/ }
113+ { /*, 'icon-file': !sys && !data.error && data.where !== 'group'*/ }
114+ { /*, 'icon-files': data.where === 'group'*/ }
115+ { /*, 'icon-sysserver': sys && !data.error*/ }
116+ { /*}) }*/ }
117+ { /*title={data.error || ''}*/ }
118+ { /*/>*/ }
119+ < Icon
120+ type = { icon_type }
121+ className = "iconfont item-icon"
122+ title = { data . error || '' }
106123 />
107124 < span > { this . getTitle ( ) } </ span >
108125 </ div >
0 commit comments