Update pages v2

This commit is contained in:
Werner
2023-06-08 17:17:11 -03:00
parent edbc13e080
commit bd3ac873b3
2 changed files with 19 additions and 11 deletions

View File

@ -1,4 +1,5 @@
import Head from 'next/head' import Head from 'next/head'
import Link from 'next/link'
import Form from 'react-bootstrap/Form'; import Form from 'react-bootstrap/Form';
import Table from 'react-bootstrap/Table' import Table from 'react-bootstrap/Table'
import { useState } from 'react'; import { useState } from 'react';
@ -16,16 +17,18 @@ export default function Home() {
const geraTabelaParaInserirInstrucoes = (nInst) => { const geraTabelaParaInserirInstrucoes = (nInst) => {
let tabela = []; let tabela = [];
for (let i = 0; i < nInst; i++) { for (let i = 0; i < nInst; i++) {
let d = "D" + i; let d = "D" + i;
let r = "R" + i; let r = "R" + i;
let s = "S" + i; let s = "S" + i;
let t = "T" + i; let t = "T" + i;
tabela.push( tabela.push(
<tr key={i}> <tr key={i}>
<td> <td>
<select className="form-control" size="1" name={d} id={d}> <select className="form-control" size="1" name={d} id={d}>
<option value="">Instrução</option> <option value="">Operand</option>
<option value="ADD">ADD</option> <option value="ADD">ADD</option>
<option value="ADDD">ADDD</option> <option value="ADDD">ADDD</option>
<option value="BEQ">BEQ</option> <option value="BEQ">BEQ</option>
@ -71,6 +74,7 @@ export default function Home() {
</tr> </tr>
); );
} }
return tabela; return tabela;
}; };
@ -100,17 +104,22 @@ export default function Home() {
</Navbar> </Navbar>
<main> <main>
<Container> <Container>
<Row> <Row className="row my-4">
<div className="my-4"> <Col>
<h3>Lista de Instruções</h3> <h3>Instructions</h3>
</div> </Col>
<Col className="text-end">
<Link href="/runner">
<Button className="ms-4" variant="primary">Execute</Button>
</Link>
</Col>
</Row> </Row>
<Row className="mb-3"> <Row className="mb-3">
<Col> <Col>
<Form.Control <Form.Control
className="form-control-sm" className="form-control-sm"
type="number" type="number"
placeholder="Selecione o número de instruções" placeholder="Select number of instructions"
onChange={handleGenerateTable} onChange={handleGenerateTable}
/> />
</Col> </Col>
@ -120,10 +129,10 @@ export default function Home() {
<Table bordered> <Table bordered>
<thead> <thead>
<tr> <tr>
<th>Instrução</th> <th>Op</th>
<th>Operando 3</th> <th>RD</th>
<th>Operando 2</th> <th>RS</th>
<th>Operando 1</th> <th>RT</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -642,7 +642,6 @@ export default function Home() {
</Table> </Table>
</Col> </Col>
</Row> </Row>
<Row className="row my-4"> <Row className="row my-4">
<Col> <Col>
<div className="my-4"> <div className="my-4">