Skip to content
Snippets Groups Projects
Commit 4891ff46 authored by Jacob Theisen's avatar Jacob Theisen
Browse files

Initial commit

parent 020264ff
No related branches found
No related tags found
No related merge requests found
Pipeline #142025 failed
Showing
with 2243 additions and 2200 deletions
# Use Debian latest stable from https://hub.docker.com as base image
FROM debian:latest
# Upgrade packages
RUN apt-get update
RUN apt-get -y upgrade
# Install Node.js
RUN apt-get -y install nodejs
...@@ -3,39 +3,75 @@ ...@@ -3,39 +3,75 @@
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import * as React from 'react'; import * as React from 'react';
import { Component } from 'react-simplified'; import { Component } from 'react-simplified';
import { HashRouter, Route } from 'react-router-dom'; import { Alert, Card, Row, Column, Form, Button } from './widgets';
import { NavBar, Card, Alert } from './widgets'; import appService from './task-service';
import { TaskList, TaskDetails, TaskEdit, TaskNew } from './task-components';
class App extends Component {
code: string = '';
stOutput: string = '';
stError: string = '';
stExit: number = 0;
class Menu extends Component {
render() { render() {
return ( return (
<NavBar brand="Todo App"> <>
<NavBar.Link to="/tasks">Tasks</NavBar.Link> <Card>
</NavBar> App.js
); <Row>
<Column>
<Form.Textarea
type="text"
value={this.code}
onChange={(event) => (this.code = event.currentTarget.value)}
rows={10}
/>
</Column>
</Row>
<Button.Success
onClick={() =>
appService.send(this.code).then((response) => {
(this.stOutput = response.data[0]),
(this.stError = response.data[1]),
(this.stExit = response.data[2]);
console.log(this.stExit);
})
} }
>
Run
</Button.Success>
</Card>
<Card>
Standard Output:
<Form.Label>{this.stOutput}</Form.Label>
</Card>
<Card>
Standard Error:
<Form.Label>{this.stError}</Form.Label>
</Card>
<Card>
Standard Exit Status:
<Form.Label>{this.stExit}</Form.Label>
</Card>
</>
);
} }
class Home extends Component { mounted() {}
render() {
return <Card title="Welcome">This is Todo App</Card>; // func() {
} // appService.send(this.code).then((response) => {
// (this.stOutput = response.data[0]),
// (this.stError = response.data[1]),
// (this.stExit = response.data[2]);
// });
// }
} }
const root = document.getElementById('root'); const root = document.getElementById('root');
if (root) if (root)
ReactDOM.render( ReactDOM.render(
<HashRouter> <>
<div> <App />
<Alert /> </>,
<Menu />
<Route exact path="/" component={Home} />
<Route exact path="/tasks" component={TaskList} />
<Route exact path="/tasks/:id(\d+)" component={TaskDetails} /> {/* id must be number */}
<Route exact path="/tasks/:id(\d+)/edit" component={TaskEdit} /> {/* id must be number */}
<Route exact path="/tasks/new" component={TaskNew} />
</div>
</HashRouter>,
root root
); );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment