testing rate limiting, making API changes

This commit is contained in:
2018-01-31 22:28:45 -05:00
parent 6af49b317d
commit 8db9a43b0f
30 changed files with 2160 additions and 1514 deletions

View File

@@ -62,7 +62,7 @@ const inlineStyle = {
showRSSFiles = (key) => {
let RSSTorrentsRequest = {
messageType: "rssTorrentsRequest",
MessageType: "rssTorrentsRequest",
Payload: [this.props.RSSList[key].RSSURL]
}
ws.send(JSON.stringify(RSSTorrentsRequest))
@@ -85,7 +85,7 @@ const inlineStyle = {
deleteRSSFeed = (key) => {
let RSSURLDelete = {
messageType: "deleteRSSFeed",
MessageType: "deleteRSSFeed",
Payload: [this.props.RSSList[key]]
}
console.log("Deleting THIS", this.props.RSSList[key])

View File

@@ -105,12 +105,12 @@ const inlineStyle = {
handleAddRSSFeed = () => {
this.setState({ textValue: "Clear"}) //clearing out the text submitted
let RSSURLSubmit = {
messageType: "addRSSFeed",
MessageType: "addRSSFeed",
Payload: [this.state.textValue]
}
ws.send(JSON.stringify(RSSURLSubmit));
let RSSRequest = {
messageType: "rssFeedRequest",
MessageType: "rssFeedRequest",
}
ws.send(JSON.stringify(RSSRequest)) //Immediatly request an update of the feed when you add a new URL
}

View File

@@ -31,11 +31,9 @@ import * as actionTypes from '../../../store/actions';
const button = {
fontSize: '60px',
paddingRight: '20px',
paddingLeft: '20px',
marginLeft: '20px',
}
const inlineStyle = {
display: 'inline-block',
backdrop: 'static',
@@ -46,7 +44,7 @@ const inlineStyle = {
componentDidMount () { //Immediatly request an update of the feed when loading app
let RSSRequest = {
messageType: "rssFeedRequest",
MessageType: "rssFeedRequest",
}
ws.send(JSON.stringify(RSSRequest))

View File

@@ -20,8 +20,8 @@ import Dropzone from 'react-dropzone';
const button = {
fontSize: '60px',
paddingRight: '20px',
paddingLeft: '20px',
marginLeft: '20px',
marginRight: '20px',
}
const uploadButton = {
@@ -68,13 +68,13 @@ export default class addTorrentFilePopup extends React.Component {
console.log("Base64", base64data)
let torrentFileMessage = {
messageType: "torrentFileSubmit",
torrentFileName: this.state.torrentFileName,
torrentStorageValue : this.state.storageValue,
torrentLabelValue: this.state.torrentLabel,
MessageType: "torrentFileSubmit",
MessageDetail: this.state.torrentFileName, //filename
MessageDetailTwo: this.state.storageValue, //storage path
MessageDetailThree: this.state.torrentLabel, //torrent label
Payload: [base64data],
}
console.log("Sending magnet link: ", torrentFileMessage);
console.log("Sending Torrent File: ", torrentFileMessage);
ws.send(JSON.stringify(torrentFileMessage));
this.setState({torrentFileName: "", storageValue: ``, torrentFileValue: [], showDrop: true})
}

View File

@@ -20,8 +20,7 @@ import IconButton from 'material-ui/IconButton';
const button = {
fontSize: '60px',
paddingRight: '20px',
paddingLeft: '20px',
marginRight: '20px',
}
const inlineStyle = {
@@ -52,15 +51,16 @@ export default class addTorrentPopup extends React.Component {
handleSubmit = () => {
this.setState({ open: false });
//let magnetLinkSubmit = this.state.textValue;
console.log("MagnetLink", this.state.magnetLinkValue)
let magnetLinkMessage = {
messageType: "magnetLinkSubmit",
storageValue: this.state.storageValue,
torrentLabel: this.state.torrentLabel,
MessageType: "magnetLinkSubmit",
MessageDetail: this.state.storageValue, //storage location
MessageDetailTwo: this.state.torrentLabel, //label
Payload: [this.state.magnetLinkValue]
}
console.log("Sending magnet link: ", magnetLinkMessage);
ws.send(JSON.stringify(magnetLinkMessage));
this.setState({magnetLinkValue: ""}, {torrentLabel: ""}, {storageValue: ``})
//this.setState({magnetLinkValue: ""}, {torrentLabel: ""}, {storageValue: ``})
}
setMagnetLinkValue = (event) => {

View File

@@ -16,14 +16,14 @@ import Icon from 'material-ui/Icon';
import IconButton from 'material-ui/IconButton';
//Importing Redux
import {connect} from 'react-redux';
import * as actionTypes from '../store/actions';
import * as actionTypes from '../../store/actions';
const button = {
fontSize: '60px',
paddingRight: '20px',
paddingLeft: '20px',
marginLeft: '20px',
}
const inlineStyle = {
@@ -31,7 +31,7 @@ const inlineStyle = {
backdrop: 'static',
}
class addTorrentPopup extends React.Component {
class ChangeStorageModal extends React.Component {
state = {
open: false,
@@ -50,9 +50,9 @@ class addTorrentPopup extends React.Component {
this.setState({ open: false });
//let magnetLinkSubmit = this.state.textValue;
let changeStorageMessage = {
messageType: "changeStorageValue",
newStorageValue: this.state.storageValue,
Payload: [this.props.selectionHashes]
MessageType: "changeStorageValue",
MessageDetail: this.state.storageValue, //new storage value
Payload: this.props.selectionHashes, //the selection hashes
}
console.log("Sending new Storage Location: ", changeStorageMessage);
ws.send(JSON.stringify(changeStorageMessage));
@@ -113,4 +113,4 @@ const mapStateToProps = state => {
export default connect(mapStateToProps)(BackendSocket);
export default connect(mapStateToProps)(ChangeStorageModal);

View File

@@ -22,8 +22,7 @@ import * as actionTypes from '../../store/actions';
const button = {
fontSize: '60px',
paddingRight: '20px',
paddingLeft: '20px',
marginRight: '20px',
}
const inlineStyle = {