conjur-asset-ui-beta 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.git-hooks/pre_commit/trailing_whitespace.rb +26 -0
- data/.gitignore +23 -0
- data/.project +18 -0
- data/CHANGELOG.md +14 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +22 -0
- data/README.md +72 -0
- data/Rakefile +76 -0
- data/TODO.md +31 -0
- data/app/.csscomb.json +304 -0
- data/app/.jshintrc +46 -0
- data/app/build/css/bootstrap.css +6906 -0
- data/app/build/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/build/fonts/glyphicons-halflings-regular.svg +288 -0
- data/app/build/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/build/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/build/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/app/build/images/conjur-logo.svg +26 -0
- data/app/build/images/icon-client-pc.svg +12 -0
- data/app/build/images/icon-environment.png +0 -0
- data/app/build/images/icon-person.svg +12 -0
- data/app/build/images/icon-policy.png +0 -0
- data/app/build/images/icon-resource.png +0 -0
- data/app/build/images/icon-service-dots.svg +13 -0
- data/app/build/images/icon-variable.png +0 -0
- data/app/build/index.html +26 -0
- data/app/build/js/app.js +78070 -0
- data/app/build/js/pace.js +2 -0
- data/app/config/preprocessor.js +9 -0
- data/app/config/webpack.js +84 -0
- data/app/gulpfile.js +144 -0
- data/app/package.json +83 -0
- data/app/src/actions.js +493 -0
- data/app/src/app.js +76 -0
- data/app/src/clients/audit.js +54 -0
- data/app/src/clients/generic.js +87 -0
- data/app/src/clients/layer_members.js +36 -0
- data/app/src/clients/list.js +82 -0
- data/app/src/clients/members.js +37 -0
- data/app/src/clients/search.js +19 -0
- data/app/src/components/app/__tests__/app-test.js +22 -0
- data/app/src/components/app/app.js +66 -0
- data/app/src/components/audit/__tests__/table_header-test.js +40 -0
- data/app/src/components/audit/box.js +11 -0
- data/app/src/components/audit/constants.js +7 -0
- data/app/src/components/audit/entry.js +107 -0
- data/app/src/components/audit/fields_mixin.js +13 -0
- data/app/src/components/audit/humanize_event.js +216 -0
- data/app/src/components/audit/table.js +100 -0
- data/app/src/components/audit/table_header.js +38 -0
- data/app/src/components/audit/timestamp.js +30 -0
- data/app/src/components/chart/chart.js +539 -0
- data/app/src/components/chart/chart_helper_mixin.js +79 -0
- data/app/src/components/custom/list.js +5 -0
- data/app/src/components/custom/view.js +71 -0
- data/app/src/components/dashboard/activity.js +113 -0
- data/app/src/components/dashboard/dashboard.js +47 -0
- data/app/src/components/flash/flash.js +17 -0
- data/app/src/components/generic/__tests__/time-test.js +43 -0
- data/app/src/components/generic/annotations.js +41 -0
- data/app/src/components/generic/breadcrumbs.js +59 -0
- data/app/src/components/generic/foldable_audit_section.js +252 -0
- data/app/src/components/generic/list.js +144 -0
- data/app/src/components/generic/list_factory.js +42 -0
- data/app/src/components/generic/resource_link.js +65 -0
- data/app/src/components/generic/role_link.js +65 -0
- data/app/src/components/generic/tab_mixin.js +148 -0
- data/app/src/components/generic/time.js +34 -0
- data/app/src/components/group/list.js +5 -0
- data/app/src/components/group/view.js +137 -0
- data/app/src/components/host/activity.js +93 -0
- data/app/src/components/host/details.js +30 -0
- data/app/src/components/host/host_link.js +20 -0
- data/app/src/components/host/list.js +5 -0
- data/app/src/components/host/view.js +113 -0
- data/app/src/components/layer/list.js +5 -0
- data/app/src/components/layer/view.js +180 -0
- data/app/src/components/navbar/__tests__/navbar-test.js +21 -0
- data/app/src/components/navbar/nav_search_form.js +41 -0
- data/app/src/components/navbar/navbar.js +71 -0
- data/app/src/components/owned_resources/owned_resources.js +86 -0
- data/app/src/components/owned_resources/owned_resources_box.js +106 -0
- data/app/src/components/permissions/permissions.js +143 -0
- data/app/src/components/permissions/permissions_table.js +104 -0
- data/app/src/components/policy/list.js +5 -0
- data/app/src/components/policy/view.js +98 -0
- data/app/src/components/refresh/refresh.js +30 -0
- data/app/src/components/refresh/refresh.less +15 -0
- data/app/src/components/search/group.js +45 -0
- data/app/src/components/search/group_heading.js +50 -0
- data/app/src/components/search/group_title.js +38 -0
- data/app/src/components/search/result_item.js +57 -0
- data/app/src/components/search/search.js +103 -0
- data/app/src/components/user/activity.js +92 -0
- data/app/src/components/user/details.js +30 -0
- data/app/src/components/user/list.js +5 -0
- data/app/src/components/user/pubkeys.js +116 -0
- data/app/src/components/user/pubkeys.less +56 -0
- data/app/src/components/user/view.js +123 -0
- data/app/src/components/variable/activity.js +83 -0
- data/app/src/components/variable/details.js +48 -0
- data/app/src/components/variable/fetchers.js +83 -0
- data/app/src/components/variable/list.js +5 -0
- data/app/src/components/variable/updaters.js +83 -0
- data/app/src/components/variable/view.js +105 -0
- data/app/src/constants.js +35 -0
- data/app/src/images/conjur-logo.svg +26 -0
- data/app/src/images/icon-client-pc.svg +12 -0
- data/app/src/images/icon-environment.png +0 -0
- data/app/src/images/icon-person.svg +12 -0
- data/app/src/images/icon-policy.png +0 -0
- data/app/src/images/icon-resource.png +0 -0
- data/app/src/images/icon-service-dots.svg +13 -0
- data/app/src/images/icon-variable.png +0 -0
- data/app/src/pages/index.html +26 -0
- data/app/src/routes.js +57 -0
- data/app/src/stores/app_store.js +29 -0
- data/app/src/stores/audit_store.js +77 -0
- data/app/src/stores/group_store.js +105 -0
- data/app/src/stores/host_store.js +98 -0
- data/app/src/stores/layer_store.js +115 -0
- data/app/src/stores/policy_store.js +89 -0
- data/app/src/stores/resources_store.js +118 -0
- data/app/src/stores/route_store.js +24 -0
- data/app/src/stores/search_store.js +73 -0
- data/app/src/stores/user_store.js +111 -0
- data/app/src/stores/variable_store.js +94 -0
- data/app/src/styles/bootstrap.less +56 -0
- data/app/src/styles/styles.less +634 -0
- data/app/src/utils.js +43 -0
- data/app/src/vendor/pace.js +2 -0
- data/conjur-asset-ui.gemspec +36 -0
- data/features/navigation_bar.feature +31 -0
- data/features/step_definitions/custom_step.rb +32 -0
- data/features/support/env.rb +38 -0
- data/features/support/hooks.rb +30 -0
- data/features/support/world.rb +17 -0
- data/lib/conjur-asset-ui-version.rb +7 -0
- data/lib/conjur-asset-ui.rb +7 -0
- data/lib/conjur/command/ui.rb +54 -0
- data/lib/conjur/webserver/api_proxy.rb +94 -0
- data/lib/conjur/webserver/authorize.rb +28 -0
- data/lib/conjur/webserver/conjur_info.rb +33 -0
- data/lib/conjur/webserver/home.rb +42 -0
- data/lib/conjur/webserver/login.rb +57 -0
- data/lib/conjur/webserver/renderer.rb +34 -0
- data/lib/conjur/webserver/server.rb +130 -0
- data/public/js/views/roleGraph.js +91 -0
- metadata +373 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var React = require('react'),
|
4
|
+
Fluxxor = require('fluxxor'),
|
5
|
+
FluxMixin = Fluxxor.FluxMixin(React),
|
6
|
+
StoreWatchMixin = Fluxxor.StoreWatchMixin,
|
7
|
+
Router = require('react-router'),
|
8
|
+
compact = require('lodash/array/compact');
|
9
|
+
|
10
|
+
var TabbedArea = require('react-bootstrap/lib/TabbedArea'),
|
11
|
+
TabPane = require('react-bootstrap/lib/TabPane');
|
12
|
+
|
13
|
+
var TabMixin = require('../generic/tab_mixin'),
|
14
|
+
RoleLink = require('../generic/role_link'),
|
15
|
+
AuditTable = require('../audit/table');
|
16
|
+
|
17
|
+
module.exports = React.createClass({
|
18
|
+
displayName: 'PolicyView',
|
19
|
+
|
20
|
+
mixins: [FluxMixin, StoreWatchMixin('policy'), Router.State, TabMixin],
|
21
|
+
|
22
|
+
getStateFromFlux() {
|
23
|
+
var flux = this.getFlux(),
|
24
|
+
data = flux.store('policy').getData(),
|
25
|
+
resource = flux.store('resources').getResource(
|
26
|
+
'policy',
|
27
|
+
unescape(this.getParams().id)
|
28
|
+
);
|
29
|
+
|
30
|
+
var ret = {
|
31
|
+
loading: data.loading,
|
32
|
+
resource: resource.data,
|
33
|
+
owner: resource.data.owner,
|
34
|
+
annotations: resource.data.annotations,
|
35
|
+
owned: data.owned,
|
36
|
+
roles: data.roles,
|
37
|
+
resources: data.resources
|
38
|
+
};
|
39
|
+
|
40
|
+
ret.loading.resource = resource.loading;
|
41
|
+
ret.loading.owner = resource.loading;
|
42
|
+
ret.loading.annotations = resource.loading;
|
43
|
+
|
44
|
+
return ret;
|
45
|
+
},
|
46
|
+
|
47
|
+
render() {
|
48
|
+
//TODO: policy loader
|
49
|
+
//TODO in CLI: why not save text of policy as an annotation?
|
50
|
+
var overviewTab = (
|
51
|
+
<TabPane eventKey="overview" tab="Overview">
|
52
|
+
<dl className="dl-horizontal">
|
53
|
+
<dt>Owner</dt>
|
54
|
+
<dd><RoleLink id={this.state.owner} /></dd>
|
55
|
+
</dl>
|
56
|
+
</TabPane>
|
57
|
+
);
|
58
|
+
|
59
|
+
var permissionsTab = this.permissionsTab(this.state.resource.id),
|
60
|
+
membershipsTab = this.membershipsTab(this.state.resource.id),
|
61
|
+
annotationsTab = this.annotationsTab(),
|
62
|
+
ownedTab = this.ownedTab();
|
63
|
+
|
64
|
+
var auditTab = (
|
65
|
+
<TabPane eventKey="audit" tab="Recent Activity">
|
66
|
+
<div className="audit auditGroup">
|
67
|
+
<AuditTable roles={[this.state.resource.id]} tabview={true} />
|
68
|
+
</div>
|
69
|
+
</TabPane>
|
70
|
+
);
|
71
|
+
|
72
|
+
var tabs = compact([
|
73
|
+
overviewTab,
|
74
|
+
ownedTab,
|
75
|
+
membershipsTab,
|
76
|
+
permissionsTab,
|
77
|
+
annotationsTab,
|
78
|
+
auditTab
|
79
|
+
]);
|
80
|
+
|
81
|
+
return (
|
82
|
+
<div className="policy">
|
83
|
+
<h2>Policy {this.state.resource.identifier}</h2>
|
84
|
+
<TabbedArea defaultActiveKey="overview">
|
85
|
+
{tabs}
|
86
|
+
</TabbedArea>
|
87
|
+
</div>
|
88
|
+
);
|
89
|
+
},
|
90
|
+
|
91
|
+
componentDidMount() {
|
92
|
+
var actions = this.getFlux().actions,
|
93
|
+
id = unescape(this.getParams().id);
|
94
|
+
|
95
|
+
actions.policy.load(id);
|
96
|
+
actions.resources.loadOne('policy', id);
|
97
|
+
}
|
98
|
+
});
|
@@ -0,0 +1,30 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var React = require('react');
|
4
|
+
|
5
|
+
require('./refresh.less');
|
6
|
+
|
7
|
+
module.exports = React.createClass({
|
8
|
+
|
9
|
+
propTypes: {
|
10
|
+
show: React.PropTypes.bool
|
11
|
+
},
|
12
|
+
|
13
|
+
getDefaultProps() {
|
14
|
+
return {
|
15
|
+
show: true
|
16
|
+
};
|
17
|
+
},
|
18
|
+
|
19
|
+
render() {
|
20
|
+
var style = {};
|
21
|
+
|
22
|
+
if (!this.props.show) {
|
23
|
+
style.display = 'none';
|
24
|
+
}
|
25
|
+
|
26
|
+
return (
|
27
|
+
<div className="b-refresh" style={style} />
|
28
|
+
);
|
29
|
+
}
|
30
|
+
});
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.b-refresh {
|
2
|
+
background-image: url('/images/icon-service-dots.svg');
|
3
|
+
background-size: contain;
|
4
|
+
background-repeat: no-repeat;
|
5
|
+
background-position: right center;
|
6
|
+
position: absolute;
|
7
|
+
display: inline-block;
|
8
|
+
width: 30px;
|
9
|
+
height: 30px;
|
10
|
+
-webkit-animation: pace-pulse 1s alternate infinite none cubic-bezier(1, 0, 0.73, 1);
|
11
|
+
-moz-animation: pace-pulse 1s alternate infinite none cubic-bezier(1, 0, 0.73, 1);
|
12
|
+
-ms-animation: pace-pulse 1s alternate infinite none cubic-bezier(1, 0, 0.73, 1);
|
13
|
+
-o-animation: pace-pulse 1s alternate infinite none cubic-bezier(1, 0, 0.73, 1);
|
14
|
+
animation: pace-pulse 1s alternate infinite none cubic-bezier(1, 0, 0.73, 1);
|
15
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var React = require('react');
|
4
|
+
|
5
|
+
var SearchGroupHeading = require('./group_heading'),
|
6
|
+
SearchResultItem = require('./result_item');
|
7
|
+
|
8
|
+
module.exports = React.createClass({
|
9
|
+
displayName: 'SearchGroup',
|
10
|
+
|
11
|
+
propTypes: {
|
12
|
+
kind: React.PropTypes.string,
|
13
|
+
items: React.PropTypes.array
|
14
|
+
},
|
15
|
+
|
16
|
+
getDefaultProps() {
|
17
|
+
return {
|
18
|
+
kind: '',
|
19
|
+
items: []
|
20
|
+
};
|
21
|
+
},
|
22
|
+
|
23
|
+
render() {
|
24
|
+
var id = 'search-group-' + this.props.kind;
|
25
|
+
|
26
|
+
var items = this.props.items.map(function(r) {
|
27
|
+
return (
|
28
|
+
<SearchResultItem data={r}/>
|
29
|
+
);
|
30
|
+
});
|
31
|
+
|
32
|
+
return (
|
33
|
+
<div id={id} className="panel panel-default search-group">
|
34
|
+
<SearchGroupHeading kind={this.props.kind}
|
35
|
+
items={this.props.items} />
|
36
|
+
<div id={'search-collapse-' + this.props.kind}
|
37
|
+
className="panel-collapse collapse in">
|
38
|
+
<div className="panel-body">
|
39
|
+
{items}
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
);
|
44
|
+
}
|
45
|
+
});
|
@@ -0,0 +1,50 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var React = require('react'),
|
4
|
+
capitalize = require('lodash/string/capitalize');
|
5
|
+
|
6
|
+
var SearchGroupTitle = require('./group_title'),
|
7
|
+
utils = require('../../utils');
|
8
|
+
|
9
|
+
module.exports = React.createClass({
|
10
|
+
displayName: 'SearchGroupHeading',
|
11
|
+
|
12
|
+
propTypes: {
|
13
|
+
kind: React.PropTypes.string,
|
14
|
+
items: React.PropTypes.array
|
15
|
+
},
|
16
|
+
|
17
|
+
getDefaultProps() {
|
18
|
+
return {
|
19
|
+
kind: '',
|
20
|
+
items: []
|
21
|
+
};
|
22
|
+
},
|
23
|
+
|
24
|
+
render() {
|
25
|
+
var targetId = '#search-collapse-' + this.props.kind;
|
26
|
+
|
27
|
+
return (
|
28
|
+
<div className="panel-heading">
|
29
|
+
<h4 className="panel-title">
|
30
|
+
<a data-toggle="collapse"
|
31
|
+
data-target={targetId}
|
32
|
+
className={'group-heading' + this.props.kind}>
|
33
|
+
<SearchGroupTitle kind={this.props.kind}
|
34
|
+
items={this.props.items} />
|
35
|
+
</a>
|
36
|
+
</h4>
|
37
|
+
</div>
|
38
|
+
);
|
39
|
+
},
|
40
|
+
|
41
|
+
title() {
|
42
|
+
var words = this.props.kind.replace(/[-_]/, ' ').split(' ');
|
43
|
+
|
44
|
+
words[words.length - 1] = utils.pluralize(words[words.length - 1]);
|
45
|
+
|
46
|
+
return (
|
47
|
+
words.map(capitalize).join(' ') + ' (' + this.props.items.length + ')'
|
48
|
+
);
|
49
|
+
}
|
50
|
+
});
|
@@ -0,0 +1,38 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var React = require('react'),
|
4
|
+
capitalize = require('lodash/string/capitalize');
|
5
|
+
|
6
|
+
var utils = require('../../utils');
|
7
|
+
|
8
|
+
module.exports = React.createClass({
|
9
|
+
displayName: 'SearchGroupTitle',
|
10
|
+
|
11
|
+
propTypes: {
|
12
|
+
kind: React.PropTypes.string,
|
13
|
+
items: React.PropTypes.array
|
14
|
+
},
|
15
|
+
|
16
|
+
getDefaultProps() {
|
17
|
+
return {
|
18
|
+
kind: '',
|
19
|
+
items: []
|
20
|
+
};
|
21
|
+
},
|
22
|
+
|
23
|
+
render() {
|
24
|
+
return (
|
25
|
+
<span>{this.title()}</span>
|
26
|
+
);
|
27
|
+
},
|
28
|
+
|
29
|
+
title() {
|
30
|
+
var words = this.props.kind.replace(/[-_]/, ' ').split(' ');
|
31
|
+
|
32
|
+
words[words.length - 1] = utils.pluralize(words[words.length - 1]);
|
33
|
+
|
34
|
+
return (
|
35
|
+
words.map(capitalize).join(' ') + ' (' + this.props.items.length + ')'
|
36
|
+
);
|
37
|
+
}
|
38
|
+
});
|
@@ -0,0 +1,57 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var React = require('react');
|
4
|
+
|
5
|
+
var ResourceLink = require('../generic/resource_link'),
|
6
|
+
RoleLink = require('../generic/role_link');
|
7
|
+
|
8
|
+
module.exports = React.createClass({
|
9
|
+
displayName: 'SearchResultItem',
|
10
|
+
|
11
|
+
render() {
|
12
|
+
return (
|
13
|
+
<div className="item">
|
14
|
+
<h4>{this.titleLink()}</h4>
|
15
|
+
<div className="details">
|
16
|
+
<strong> ID: </strong>
|
17
|
+
<ResourceLink id={this.props.data.id}
|
18
|
+
noIcon="true" />
|
19
|
+
<strong> Owner: </strong>
|
20
|
+
<RoleLink id={this.props.data.owner}
|
21
|
+
noIcon="true" />
|
22
|
+
</div>
|
23
|
+
<div className="comment">
|
24
|
+
{this.commentText()}
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
);
|
28
|
+
},
|
29
|
+
|
30
|
+
commentText() {
|
31
|
+
var annots = this.annotationsMap();
|
32
|
+
|
33
|
+
return annots.description || '';
|
34
|
+
},
|
35
|
+
|
36
|
+
titleLink() {
|
37
|
+
var annots = this.annotationsMap();
|
38
|
+
|
39
|
+
return (
|
40
|
+
<ResourceLink id={this.props.data.id} text={annots.name} />
|
41
|
+
);
|
42
|
+
},
|
43
|
+
|
44
|
+
annotationsMap() {
|
45
|
+
if (this._annotationsMap) {
|
46
|
+
return this._annotationsMap;
|
47
|
+
}
|
48
|
+
|
49
|
+
var map = this._annotationsMap = {};
|
50
|
+
|
51
|
+
(this.props.data.annotations || []).forEach(function(a) {
|
52
|
+
map[a.name] = a.value;
|
53
|
+
});
|
54
|
+
|
55
|
+
return map;
|
56
|
+
}
|
57
|
+
});
|
@@ -0,0 +1,103 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var React = require('react'),
|
4
|
+
Fluxxor = require('fluxxor'),
|
5
|
+
FluxMixin = Fluxxor.FluxMixin(React),
|
6
|
+
StoreWatchMixin = Fluxxor.StoreWatchMixin,
|
7
|
+
Router = require('react-router'),
|
8
|
+
groupBy = require('lodash/collection/groupBy'),
|
9
|
+
map = require('lodash/collection/map');
|
10
|
+
|
11
|
+
var SearchGroup = require('./group'),
|
12
|
+
SearchGroupTitle = require('./group_title'),
|
13
|
+
Refresh = require('../refresh/refresh');
|
14
|
+
|
15
|
+
module.exports = React.createClass({
|
16
|
+
displayName: 'Search',
|
17
|
+
|
18
|
+
mixins: [FluxMixin, StoreWatchMixin('search'), Router.State],
|
19
|
+
|
20
|
+
getStateFromFlux() {
|
21
|
+
var data = this.getFlux().store('search').getData();
|
22
|
+
|
23
|
+
return {
|
24
|
+
loading: data.loading.results,
|
25
|
+
results: data.results,
|
26
|
+
query: data.identifier
|
27
|
+
};
|
28
|
+
},
|
29
|
+
|
30
|
+
render() {
|
31
|
+
var results = this.state.results;
|
32
|
+
|
33
|
+
var grouped = groupBy(results, function(r) {
|
34
|
+
return r.id.split(':')[1];
|
35
|
+
});
|
36
|
+
|
37
|
+
// Don't care about these
|
38
|
+
delete grouped['environment-variables'];
|
39
|
+
delete grouped.notification;
|
40
|
+
delete grouped.queue;
|
41
|
+
|
42
|
+
var groups = map(grouped, function(items, key) {
|
43
|
+
return <SearchGroup kind={key} items={items} />;
|
44
|
+
});
|
45
|
+
|
46
|
+
var scores = {
|
47
|
+
'policy': 1,
|
48
|
+
'layer': 2,
|
49
|
+
'group': 3,
|
50
|
+
'host': 4,
|
51
|
+
'user': 5,
|
52
|
+
'variable': 6,
|
53
|
+
'key_pair': 7
|
54
|
+
};
|
55
|
+
|
56
|
+
groups.sort(function(a, b) {
|
57
|
+
return (
|
58
|
+
(scores[a.props.kind] || 100) -
|
59
|
+
(scores[b.props.kind] || 100)
|
60
|
+
);
|
61
|
+
});
|
62
|
+
|
63
|
+
var toc = groups.map(function(g) {
|
64
|
+
var gid = '#search-group-' + g.props.kind;
|
65
|
+
|
66
|
+
return (
|
67
|
+
<div className="toc-item">
|
68
|
+
<a href={gid}>
|
69
|
+
<SearchGroupTitle kind={g.props.kind}
|
70
|
+
items={g.props.items} />
|
71
|
+
</a>
|
72
|
+
</div>
|
73
|
+
);
|
74
|
+
});
|
75
|
+
|
76
|
+
var heading;
|
77
|
+
|
78
|
+
if (this.state.loading) {
|
79
|
+
heading = 'Searching for "' + this.state.query + '"';
|
80
|
+
} else {
|
81
|
+
heading = 'Found ' + this.state.results.length +
|
82
|
+
' resources matching "' + this.state.query + '"';
|
83
|
+
}
|
84
|
+
|
85
|
+
return (
|
86
|
+
<div id="searchResults">
|
87
|
+
<div className="searchResults">
|
88
|
+
<h3>{heading}<Refresh show={this.state.loading} /></h3>
|
89
|
+
<div className="search-results-toc">
|
90
|
+
{toc}
|
91
|
+
</div>
|
92
|
+
<div className="search-results">
|
93
|
+
{groups}
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
);
|
98
|
+
},
|
99
|
+
|
100
|
+
componentDidMount() {
|
101
|
+
this.getFlux().actions.search(unescape(this.getParams().query));
|
102
|
+
}
|
103
|
+
});
|