Skip to content

Commit

Permalink
Merge pull request #12 from pymit/doc
Browse files Browse the repository at this point in the history
small fixes
  • Loading branch information
marxmit7 committed Aug 7, 2019
2 parents 21cac90 + bf9e2d7 commit ebd048d
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 55 deletions.
24 changes: 12 additions & 12 deletions src/main/Homepage/doc/tabsView/ImageFR/AllReqValues.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import Table from "react-bootstrap/Table";

function GETReqTable() {
function POSTReqTable() {
return (
<div>
<Table striped bordered hover size="sm">
Expand All @@ -24,7 +24,7 @@ function GETReqTable() {
);
}

function GETResTable() {
function POSTResTable() {
return (
<div>
<Table striped bordered hover size="sm">
Expand Down Expand Up @@ -65,7 +65,7 @@ function GETResTable() {
);
}

const GETResExample = JSON.stringify(
const POSTResExample = JSON.stringify(
{
Faces: {
"Amit Kumar": {
Expand All @@ -90,17 +90,17 @@ const GETResExample = JSON.stringify(
2
);

const GETcurlValue =
const POSTcurlValue =
'curl -i -X POST -H "Content-Type: multipart/form-data " -F "file=@<path to image file> " http://127.0.0.1:8000/api/image/';
const GETpythonValue =
const POSTpythonValue =
"import requests \nimagePath = <path to image file> \nurl = \"http://127.0.0.1:8000/api/image/\" \nfiles = {'file': open(imagePath, 'rb') }\nresponse = requests.post(url, files=files)\nprint(response.text)";
const GETnodeValue = "";
const POSTnodeValue = "";

export {
GETResExample,
GETReqTable,
GETnodeValue,
GETpythonValue,
GETResTable,
GETcurlValue
POSTResExample,
POSTReqTable,
POSTnodeValue,
POSTpythonValue,
POSTResTable,
POSTcurlValue
};
30 changes: 15 additions & 15 deletions src/main/Homepage/doc/tabsView/ImageFR/FaceReckognition.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react";
import { GETReqRes, GETSnippetTab } from "../AllTabs";
import { POSTReqRes, POSTSnippetTab } from "../AllTabs";
import {
GETResExample,
GETReqTable,
GETnodeValue,
GETpythonValue,
GETResTable,
GETcurlValue
POSTResExample,
POSTReqTable,
POSTnodeValue,
POSTpythonValue,
POSTResTable,
POSTcurlValue
} from "./AllReqValues";

function YouTubeProcessing() {
Expand All @@ -15,15 +15,15 @@ function YouTubeProcessing() {
<b>POST</b>
<br />
/image
<GETReqRes
ReqVal={GETReqTable()}
ResVal={GETResTable()}
ResExample={GETResExample}
<POSTReqRes
ReqVal={POSTReqTable()}
ResVal={POSTResTable()}
ResExample={POSTResExample}
/>
<GETSnippetTab
curlValue={GETcurlValue}
pythonValue={GETpythonValue}
nodeValue={GETnodeValue}
<POSTSnippetTab
curlValue={POSTcurlValue}
pythonValue={POSTpythonValue}
nodeValue={POSTnodeValue}
/>
</div>
);
Expand Down
24 changes: 12 additions & 12 deletions src/main/Homepage/doc/tabsView/NSFW/AllReqValues.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import Table from "react-bootstrap/Table";

function GETReqTable() {
function POSTReqTable() {
return (
<div>
<Table striped bordered hover size="sm">
Expand All @@ -24,7 +24,7 @@ function GETReqTable() {
);
}

function GETResTable() {
function POSTResTable() {
return (
<div>
<Table striped bordered hover size="sm">
Expand Down Expand Up @@ -52,7 +52,7 @@ function GETResTable() {
);
}

const GETResExample = JSON.stringify(
const POSTResExample = JSON.stringify(
{
classes: "Porn",
probabilities: {
Expand All @@ -67,17 +67,17 @@ const GETResExample = JSON.stringify(
2
);

const GETcurlValue =
const POSTcurlValue =
'curl -i -X POST -H "Content-Type: multipart/form-data " -F "file=@<path to image file> " http://127.0.0.1:8000/api/nsfw/';
const GETpythonValue =
const POSTpythonValue =
"import requests \nimagePath = <path to image file> \nurl = \"http://127.0.0.1:8000/api/nsfw/\" \nfiles = {'file': open(imagePath, 'rb') }\nresponse = requests.post(url, files=files)\nprint(response.text)";
const GETnodeValue = "";
const POSTnodeValue = "";

export {
GETResExample,
GETReqTable,
GETnodeValue,
GETpythonValue,
GETResTable,
GETcurlValue
POSTResExample,
POSTReqTable,
POSTnodeValue,
POSTpythonValue,
POSTResTable,
POSTcurlValue
};
30 changes: 15 additions & 15 deletions src/main/Homepage/doc/tabsView/NSFW/NSFW.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import React from "react";
import { GETReqRes, GETSnippetTab } from "../AllTabs";
import { POSTReqRes, POSTSnippetTab } from "../AllTabs";
import {
GETResExample,
GETReqTable,
GETnodeValue,
GETpythonValue,
GETResTable,
GETcurlValue
POSTResExample,
POSTReqTable,
POSTnodeValue,
POSTpythonValue,
POSTResTable,
POSTcurlValue
} from "./AllReqValues";
function NSFWAPIs() {
return (
<div>
<b>POST</b>
<br />
/nsfw
<GETReqRes
ReqVal={GETReqTable()}
ResVal={GETResTable()}
ResExample={GETResExample}
<POSTReqRes
ReqVal={POSTReqTable()}
ResVal={POSTResTable()}
ResExample={POSTResExample}
/>
<GETSnippetTab
curlValue={GETcurlValue}
pythonValue={GETpythonValue}
nodeValue={GETnodeValue}
<POSTSnippetTab
curlValue={POSTcurlValue}
pythonValue={POSTpythonValue}
nodeValue={POSTnodeValue}
/>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/main/Homepage/doc/tabsView/TabContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function POSTResponseContents(props) {
{props.value}
<div>
Response Example <br />
{props.ResExample}
<pre> {(props.ResExample)}</pre>
</div>
</div>
);
Expand Down

0 comments on commit ebd048d

Please sign in to comment.