Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #59 from ViDA-NYU/consistent_interface
Browse files Browse the repository at this point in the history
Merging consistent_interface branch with master.
  • Loading branch information
soniacq committed Sep 14, 2017
2 parents 8db1b0d + 2e076ce commit 72690ed
Show file tree
Hide file tree
Showing 10 changed files with 296 additions and 213 deletions.
85 changes: 52 additions & 33 deletions client/src/components/DeepCrawling.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import TextField from 'material-ui/TextField';
import Dialog from 'material-ui/Dialog';
import RaisedButton from 'material-ui/RaisedButton';
import RemoveURL from 'material-ui/svg-icons/navigation/cancel';
import LoadExternalUrls from 'material-ui/svg-icons/file/file-upload';
import AddRecommendationUrls from 'material-ui/svg-icons/content/add-circle-outline';
import IconButton from 'material-ui/IconButton';
import {Card, CardHeader, CardText} from 'material-ui/Card';
import Divider from 'material-ui/Divider';
Expand Down Expand Up @@ -50,11 +52,12 @@ class DeepCrawling extends Component {
this.recommendationInterval = null;
this.addDomainsForDeepCrawl = this.addDomainsForDeepCrawl.bind(this);
this.addDomainsOnSelection = this.addDomainsOnSelection.bind(this);

this.startDeepCrawler = this.startDeepCrawler.bind(this);
this.stopDeepCrawler = this.stopDeepCrawler.bind(this);
this.addUrlsWhileCrawling = this.addUrlsWhileCrawling.bind(this);

this.changeMinURLCount = this.changeMinURLCount.bind(this);
this.handleOpenDialogLoadUrl = this.handleOpenDialogLoadUrl.bind(this);

}

Expand Down Expand Up @@ -468,44 +471,55 @@ class DeepCrawling extends Component {
</Table>
</CardText>
</Card>
<div >
<div>
<RaisedButton
label="Start Crawler"
disable={this.state.disabledStartCrawler}
style={
this.state.disabledStartCrawler ?
{pointerEvents: 'none', opacity: 0.5, margin: 12}
:
{pointerEvents: 'auto', opacity: 1.0, margin: 12}
}
onClick={this.startDeepCrawler.bind(this)}
/>
</div>
<Row>
<Col xs={4} md={4} style={{marginLeft:'0px'}}>
<RaisedButton
label="Start Crawler"
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
//icon={<Search />}
disable={this.state.disabledStartCrawler}
style={
this.state.disabledStartCrawler ?
{pointerEvents: 'none', opacity: 0.5, height:35, marginTop: 0, margin: 12}
:
{pointerEvents: 'auto', opacity: 1.0, height:35, marginTop: 0, margin: 12}
}
onClick={this.startDeepCrawler}
/>
</Col>
{
this.state.disabledStartCrawler ?
<div style={{float:'right'}}>

<Col xs={9} md={9} style={{marginLeft:'-70px'}}>
<RaisedButton
label="Add URLs"
style={{margin: 12}}
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
//icon={<Search />}
style={{height:35, marginTop: 0, margin: 12}}
onClick={this.addUrlsWhileCrawling}
/>
<RaisedButton
label="Crawler Monitor"
style={{margin: 12}}
href={this.props.crawlerServers['deep']+"/monitoring"} target="_blank"
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
//icon={<Search />}
style={{height:35, marginTop: 0, margin: 12}}
href={this.props.crawlerServers['deep']+"/monitoring"} target="_blank"
/>
<RaisedButton
label="Stop Crawler"
style={{margin: 12}}
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
//icon={<Search />}
style={{height:35, marginTop: 0, margin: 12}}
onClick={this.stopDeepCrawler}
/>
</div>
</Col>
:
null
}
</div>
</Row>
</Col>

<Col xs={6} md={6} style={{marginLeft:'0px'}}>
Expand Down Expand Up @@ -543,11 +557,11 @@ class DeepCrawling extends Component {
resetSelection={this.state.resetSelection}
/>
<RaisedButton
disabled={false}
style={{ height:20, marginTop: 15}}
labelStyle={{textTransform: "capitalize"}}
buttonStyle={{height:19}}
label="Add to deep crawl"
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
icon={<AddRecommendationUrls />}
style={{height:35, marginTop: 12}}
onClick={this.addDomainsForDeepCrawl}
/>
</CardText>
Expand All @@ -556,13 +570,14 @@ class DeepCrawling extends Component {
<Card id={"Load external urls"} initiallyExpanded={true} >
<CardHeader
title={<RaisedButton
disabled={false}
style={{ height:20, marginTop: 15}}
labelStyle={{textTransform: "capitalize", fontWeight:"bold", fontSize:14,}}
buttonStyle={{height:19}}
label="Loading external urls"
onClick={this.handleOpenDialogLoadUrl.bind(this)}
/>}
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
icon={<LoadExternalUrls />}
style={{height:35, marginTop: 8, marginBottom:"-8px"}}
disabled={false}
onClick={this.handleOpenDialogLoadUrl}
/>}
actAsExpander={false}
showExpandableButton={false}
style={{fontWeight:'bold',}}
Expand Down Expand Up @@ -611,4 +626,8 @@ class DeepCrawling extends Component {
}
}

DeepCrawling.defaultProps = {
backgroundColor:"#9A7BB0",
};

export default DeepCrawling;
115 changes: 73 additions & 42 deletions client/src/components/FocusedCrawling.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import Avatar from 'material-ui/Avatar';
import {List, ListItem} from 'material-ui/List';
import Subheader from 'material-ui/Subheader';
import CommunicationChatBubble from 'material-ui/svg-icons/communication/chat-bubble';
import Save from 'material-ui/svg-icons/content/save';
import Cancel from 'material-ui/svg-icons/action/highlight-off';
import Export from 'material-ui/svg-icons/file/file-download';
import Monitoring from './Monitoring.js';
import Dialog from 'material-ui/Dialog';
import {scaleLinear} from 'd3-scale';
Expand Down Expand Up @@ -450,10 +453,28 @@ class FocusedCrawling extends Component {
{checkedTagsPosNeg}
</Row>
<Row style={{margin:"-8px 5px 10px 20px"}}>
<RaisedButton disabled={false} onTouchTap={this.handleSaveTags.bind(this)} style={{ height:20, marginTop: 15, marginRight:10, minWidth:118, width:118}} labelStyle={{textTransform: "capitalize"}} buttonStyle={{height:19}}
label="Save" labelPosition="before" containerElement="label" />
<RaisedButton disabled={false} onTouchTap={this.handleCancelTags.bind(this)} style={{ height:20, marginTop: 15, minWidth:118, width:118}} labelStyle={{textTransform: "capitalize"}} buttonStyle={{height:19}}
label="Cancel" labelPosition="before" containerElement="label" />
<RaisedButton
disabled={false}
label="Save"
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
icon={<Save />}
//buttonStyle={{height:19}}
style={{height:35, marginTop: 8, marginBottom:"-8px", marginRight:10}}
disabled={false}
onTouchTap={this.handleSaveTags.bind(this)}
/>
<RaisedButton
disabled={false}
label="Cancel"
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
icon={<Cancel />}
//buttonStyle={{height:19}}
style={{height:35, marginTop: 8, marginBottom:"-8px"}}
disabled={false}
onTouchTap={this.handleCancelTags.bind(this)}
/>
</Row>
<Dialog title="Select positive tags to extract terms." open={openMessage}>
{DialogBox}</Dialog>
Expand Down Expand Up @@ -481,44 +502,47 @@ class FocusedCrawling extends Component {
style={{fontWeight:'bold',}}
/>
<CardText expandable={true} style={{height:212}}>
<div style={{display: 'flex'}}>
<div>
<RaisedButton
label="Start Crawler"
style={{margin: 5}}
disable={this.state.disabledStartCrawler}
labelStyle={{textTransform: "capitalize"}}
style={
this.state.disabledStartCrawler ?
{pointerEvents: 'none', opacity: 0.5, margin: 12}
:
{pointerEvents: 'auto', opacity: 1.0, margin: 12}
}
onClick={this.startFocusedCrawler.bind(this)}
/>
</div>
{
this.state.disabledStartCrawler ?
<div style={{float:'right'}}>
<Row>
<Col xs={5} md={5} style={{marginLeft:'0px'}}>
<RaisedButton
label="Stop Crawler"
style={{margin: 5,}}
labelStyle={{textTransform: "capitalize"}}
onClick={this.stopFocusedCrawler.bind(this)}
/>
<br/>
<RaisedButton
label="Crawler Monitor"
style={{margin: 5}}
labelStyle={{textTransform: "capitalize"}}
href={this.props.crawlerServers['focused']+"/monitoring"} target="_blank"
label="Start Crawler"
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
//icon={<Search />}
disable={this.state.disabledStartCrawler}
style={
this.state.disabledStartCrawler ?
{pointerEvents: 'none', opacity: 0.5, height:35, marginTop: 0, margin: 12}
:
{pointerEvents: 'auto', opacity: 1.0, height:35, marginTop: 0, margin: 12}
}
onClick={this.startFocusedCrawler}
/>

</div>
:
null
}
</div>
</Col>
{
this.state.disabledStartCrawler ?
<Col xs={7} md={7} style={{marginLeft:'-70px'}}>
<RaisedButton
label="Stop Crawler"
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
//icon={<Search />}
style={{height:35, marginTop: 0, margin: 12}}
onClick={this.stopFocusedCrawler.bind(this)}
/>
<RaisedButton
label="Crawler Monitor"
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
//icon={<Search />}
style={{height:35, marginTop: 0, margin: 12}}
href={this.props.crawlerServers['focused']+"/monitoring"} target="_blank"
/>
</Col>
:
null
}
</Row>
</CardText>
</Card>
</Col>
Expand All @@ -543,8 +567,10 @@ class FocusedCrawling extends Component {
<RaisedButton
disabled={this.state.disabledCreateModel}
label="Export"
style={{margin: 5}}
labelStyle={{textTransform: "capitalize"}}
labelStyle={{textTransform: "capitalize", fontSize:14, fontWeight:"normal"}}
backgroundColor={this.props.backgroundColor}
icon={<Export />}
style={{height:35, marginTop: 0, margin: 12}}
onClick={this.exportModel.bind(this)}
/>
<div style={{marginTop:"-40px", marginLeft:"-180px"}}>
Expand Down Expand Up @@ -574,4 +600,9 @@ class FocusedCrawling extends Component {
}
}


FocusedCrawling.defaultProps = {
backgroundColor:"#9A7BB0",
};

export default FocusedCrawling;

0 comments on commit 72690ed

Please sign in to comment.