Sha256: b489951e6039c766922d178fffb5dd310a4939cfc7e9d2ffcfa635940101ab0a

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

/**@jsx React.DOM*/

var DashboardSearchForm = React.createClass({
  mixins: [ SearchMixin ],
  
  render: function() {
    return ( 
    <form id="dashboard-search" className="form-inline search" role="search" onSubmit={this.handleSubmit}>
      <div className="form-group">
        <input ref="input" type="text" className="form-control" placeholder="Search Conjur" value={this.props.searchText}>
        </input>
       </div>
      <button type="submit" className="btn btn-default search-button">Search</button>
    </form>
    );
  }
});

var DashboardFrequent = React.createClass({
  getInitialState: function() {
    return {resources: [], loaded: false}
  },

  componentWillMount: function() {
    $.get("/api/authz/" + conjurConfiguration.account + "/resources?owner=" + encodeURIComponent(userId), function(data) {
      this.setState({resources: data, loaded: true});
    }.bind(this));
  },

  render: function() {
    var content;
    if (this.state.loaded)
      content = <OwnedResourcesBox resources={this.state.resources} />
    else
      content = <span>Loading...</span>
    
    return <section>
      <h3>Owned assets</h3>
      {content}
    </section>;
  }  
});

var Dashboard = React.createClass({
  render: function(){
    return (
      <div className="dashboard">
        <div className="row">
          <DashboardSearchForm />
        </div>
        <div className="row summary">
          <div className="col-xs-6">
            <DashboardFrequent />
          </div>
          <div className="col-xs-6 audit">
            <AuditTable src={'/api/audit/all'} caption={'Recent activity'} compact={true}/>
          </div>
        </div>
      </div>
    );
  }
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
conjur-asset-ui-api-1.2.0 public/js/views/dashboard.js