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