@@ -45,14 +45,11 @@ let CloningNote = ({ app, clone_status, clone_progress }) => {
45
45
return < div > Cloning is { progress } % complete</ div >
46
46
} ;
47
47
48
- let CountsSection = ( props ) => {
49
- return (
50
- < div className = { props . className } >
51
- < div className = { styles . section } > { props . title } </ div >
52
- { props . children }
53
- </ div >
54
- ) ;
55
- } ;
48
+ let CountsSection = ( { className, title, children } ) =>
49
+ < div className = { className } >
50
+ < div className = { styles . section } > { title } </ div >
51
+ { children }
52
+ </ div >
56
53
57
54
let Metric = ( props ) => {
58
55
return (
@@ -63,46 +60,20 @@ let Metric = (props) => {
63
60
) ;
64
61
} ;
65
62
66
- let AppCard = ( props ) => {
67
- let sharing = null ;
68
- if ( props . app . collabInfo ) {
69
- if ( props . app . isOwner ( ) ) {
70
- sharing = 'shared with ' + pluralize ( props . app . collaboratorCount , 'person' , 'people' ) ;
71
- } else {
72
- sharing = html `shared by ${ props . app . owner } ` ;
73
- }
74
- }
75
- return (
76
- < li onClick = { ( ) => history . pushState ( null , html `/apps/${ props . app . slug } /browser` ) } >
77
- < a className = { styles . icon } >
78
- { props . icon ? < img src = { props . icon } /> : < Icon width = { 56 } height = { 56 } name = 'blank-app-outline' fill = '#1E384D' /> }
79
- </ a >
80
- < CountsSection className = { styles . plan } title = 'Current plan' >
81
- < Metric number = { dash ( props . app . requestLimit ) } label = 'requests/s' />
82
- < Metric number = { dash ( props . app . requestLimit , Math . floor ( props . app . requestLimit / 20 ) ) } label = 'background job' />
83
- < Metric number = { dash ( props . app . requestLimit , '$' + ( props . app . requestLimit - 30 ) * 10 ) } label = 'monthly' />
84
- < a href = { html `/apps/${ props . app . slug } /settings` } className = { styles . edit } onClick = { ( e ) => {
85
- e . stopPropagation ( ) ;
86
- history . pushState ( null , html `/apps/${ props . app . slug } /settings` ) ;
87
- } } > Edit</ a >
88
- </ CountsSection >
89
- < CountsSection className = { styles . glance } title = 'At a glance' >
90
- < Metric number = { dash ( props . app . requests , prettyNumber ( props . app . requests ) ) } label = 'requests' />
91
- < Metric number = { dash ( props . app . users , prettyNumber ( props . app . users ) ) } label = 'total users' />
92
- < Metric number = { dash ( props . app . installations , prettyNumber ( props . app . installations ) ) } label = 'total installations' />
93
- </ CountsSection >
94
- < div className = { styles . details } >
95
- < a className = { styles . appname } > { props . app . name } </ a >
96
- { props . app . is_cloning ? < CloningNote
97
- app = { props . app }
98
- clone_status = { props . app . clone_status }
99
- clone_progress = { props . app . clone_progress } /> :
100
- < div > Created < span className = { styles . ago } > { howLongAgo ( props . app . createdAt ) } </ span > </ div > }
101
- </ div >
102
- { sharing }
103
- </ li >
104
- )
105
- } ;
63
+ let AppCard = ( {
64
+ app,
65
+ icon,
66
+ } ) => < li onClick = { ( ) => history . pushState ( null , html `/apps/${ app . slug } /browser` ) } >
67
+ { icon ? < a className = { styles . icon } > < img src = { icon } /> </ a > : null }
68
+ < CountsSection className = { styles . glance } title = 'At a glance' >
69
+ < Metric number = { dash ( app . users , prettyNumber ( app . users ) ) } label = 'total users' />
70
+ < Metric number = { dash ( app . installations , prettyNumber ( app . installations ) ) } label = 'total installations' />
71
+ </ CountsSection >
72
+ < div className = { styles . details } >
73
+ < a className = { styles . appname } > { app . name } </ a >
74
+ < div className = { styles . serverVersion } > Server version: < span className = { styles . ago } > { app . enabledFeatures . serverVersion || 'unknown' } </ span > </ div >
75
+ </ div >
76
+ </ li >
106
77
107
78
export default class AppsIndex extends React . Component {
108
79
constructor ( ) {
@@ -113,7 +84,7 @@ export default class AppsIndex extends React.Component {
113
84
114
85
componentWillMount ( ) {
115
86
document . body . addEventListener ( 'keydown' , this . focusField ) ;
116
- AppsManager . getAppsInfo ( ) . then ( ( ) => {
87
+ AppsManager . getAllAppsIndexStats ( ) . then ( ( ) => {
117
88
this . forceUpdate ( ) ;
118
89
} ) ;
119
90
}
0 commit comments