This commit is contained in:
Ilana Kantorov 2017-08-17 17:07:49 +03:00
Родитель c95158f358
Коммит 7c12f914ba
1 изменённых файлов: 26 добавлений и 18 удалений

Просмотреть файл

@ -24,11 +24,11 @@ interface IQueryTesterProps {
}
const styles = {
json: {
overflowY: 'scroll',
height: 'calc(100% - 200px)',
width: 'calc(100% - 48px)',
position: 'absolute'
json: {
overflowY: 'scroll',
height: 'calc(100% - 200px)',
width: 'calc(100% - 48px)',
position: 'absolute'
}
};
@ -41,7 +41,7 @@ export default class QueryTester extends React.Component<IQueryTesterProps, IQue
loadingData: false,
responseExpanded: true
};
constructor(props: any) {
super(props);
@ -90,25 +90,33 @@ export default class QueryTester extends React.Component<IQueryTesterProps, IQue
let { showDialog, query, response, loadingData, responseExpanded } = this.state;
const dialogActions = [
{ onClick: this.submitQuery, primary: true, label: 'Run query' },
{ onClick: this.collapseResponse, primary: false, label: 'Collapse',
{ onClick: this.submitQuery, primary: true, label: 'Run query' },
{ onClick: this.collapseResponse, primary: false, label: 'Collapse',
disabled: _.isEmpty(response) || !responseExpanded},
{ onClick: this.expandResponse, primary: false, label: 'Expand',
disabled: _.isEmpty(response) || responseExpanded},
{ onClick: this.closeDialog, primary: false, label: 'Close'}
];
];
return (
<div>
<Button raised label="Test connection" onClick={this.openDialog} style={this.props.buttonStyle} />
<Dialog
id="testerForm"
visible={showDialog}
onHide={this.closeDialog}
<Dialog
id="testerForm"
visible={showDialog}
onHide={this.closeDialog}
dialogStyle={{ width: '60%', height: '90%' }}
style={{ zIndex: 99 }}
title="Query tester"
actions= {dialogActions}
title={
(
<div>Query tester
<Button disabled icon style={{height: '38px'}}
href={'https://docs.loganalytics.io/index'} target="_blank">help
</Button>
</div>
)
}
actions={dialogActions}
>
<TextField
id="query"
@ -121,14 +129,14 @@ export default class QueryTester extends React.Component<IQueryTesterProps, IQue
<JSONTree data={response} theme="default" shouldExpandNode={() => responseExpanded}/>
</div>
{
loadingData &&
loadingData &&
(
<div style={{ width: '100%', position: 'absolute', top: 130, left: 0 }}>
<CircularProgress id="testerProgress" />
</div>
)
}
</Dialog>
</Dialog>
</div>
);
}