mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
api tokens with panel instead of property
This commit is contained in:
parent
4627a860b2
commit
36aa5b1891
@ -22,6 +22,8 @@ import Form from './ascribe_forms/form';
|
||||
import Property from './ascribe_forms/property';
|
||||
import InputCheckbox from './ascribe_forms/input_checkbox';
|
||||
|
||||
import ActionPanel from './ascribe_panel/action_panel';
|
||||
|
||||
import apiUrls from '../constants/api_urls';
|
||||
import AppConstants from '../constants/application_constants';
|
||||
import { getLangText } from '../utils/lang_utils';
|
||||
@ -339,20 +341,18 @@ let APISettings = React.createClass({
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
},
|
||||
|
||||
render() {
|
||||
getApplications(){
|
||||
let content = <img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} />;
|
||||
if (this.state.applications.length > -1) {
|
||||
content = this.state.applications.map(function(app, i) {
|
||||
return (
|
||||
<Property
|
||||
<ActionPanel
|
||||
name={app.name}
|
||||
label={app.name}
|
||||
key={i}>
|
||||
<div className="row-same-height">
|
||||
<div className="no-padding col-xs-6 col-sm-10 col-xs-height col-middle">
|
||||
{'Bearer ' + app.bearer_token.token}
|
||||
</div>
|
||||
<div className="col-xs-6 col-sm-2 col-xs-height">
|
||||
key={i}
|
||||
title={app.name}
|
||||
content={'Bearer ' + app.bearer_token.token}
|
||||
buttons={
|
||||
<div className="pull-right">
|
||||
<button
|
||||
className="pull-right btn btn-default btn-sm"
|
||||
onClick={this.handleTokenRefresh}
|
||||
@ -360,17 +360,14 @@ let APISettings = React.createClass({
|
||||
{getLangText('REFRESH')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</Property>);
|
||||
}/>
|
||||
);
|
||||
}, this);
|
||||
content = (
|
||||
<div>
|
||||
<Form>
|
||||
{content}
|
||||
<hr />
|
||||
</Form>
|
||||
</div>);
|
||||
}
|
||||
return content;
|
||||
},
|
||||
render() {
|
||||
|
||||
return (
|
||||
<CollapsibleParagraph
|
||||
title={getLangText('API Integration')}
|
||||
@ -392,7 +389,7 @@ let APISettings = React.createClass({
|
||||
<pre>
|
||||
Usage: curl <url> -H 'Authorization: Bearer <token>'
|
||||
</pre>
|
||||
{content}
|
||||
{this.getApplications()}
|
||||
</CollapsibleParagraph>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user