Sha256: f9f99c3e01a5658b3ed8eef246641ac6be0d95b4b945374114621e0908e2aaca

Contents?: true

Size: 1.78 KB

Versions: 2

Compression:

Stored size: 1.78 KB

Contents

/** @jsx React.DOM */

var HostLink = React.createClass({
  hostId : function() {
    return this.props.data.split(':')[2];
  },

  hostUrl: function() {
    return "/ui/hosts/" + encodeURIComponent(this.hostId());
  },

  render: function() {
    return (
      <a href={this.hostUrl()}>
        {this.hostId()}
      </a>
    );
  }
});

var Host = React.createClass({
  mixins: [conjur.views.mixins.Tab],
  render: function(){
    var host = this.props.data.host;

    // TODO: control for 'enroll'
    var overview_tab =
            <TabPane key="overview" tab="Overview">
                <dl className="dl-horizontal">
                  <dt> Owner </dt>
                  <dd> <RoleLink id={host.ownerid}/> </dd>
                  <dt>Created by</dt>
                  <dd><RoleLink id={host.userid}/></dd>
                  <dt> Created At </dt>
                  <dd> <Time timestamp={host.created_at}/> </dd>
                </dl>
            </TabPane>;

    var permissions_tab = this.permissions_tab(host.roleid);
    var memberships_tab = this.memberships_tab(host.roleid);
    var annotations_tab = this.annotations_tab();
    var owned_tab       = this.owned_tab();

    var audit_tab =
            <TabPane key="audit" tab="Recent Activity">
                <div className="audit auditHost">
                  <AuditBox roles={[host.roleid]} resources={[host.resource_identifier]} tabview={true}/>
                </div>
            </TabPane>;

    var tabs = _.compact([ overview_tab, owned_tab, memberships_tab,
                          permissions_tab, annotations_tab, audit_tab
                        ]);

    return (
      <div className="host">
        <h2> Host {host.id} </h2>
        <TabbedArea defaultActiveKey="overview">
            {tabs}
         </TabbedArea>
      </div>
    );
  }
})

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
conjur-asset-ui-1.3.2 public/js/views/host.js
conjur-asset-ui-1.3.0 public/js/views/host.js