Adding language switching and minimize button (#25)
* Initial Push
Inititial project state
* Static demo version
* static demo site - added variables
a
* first_implementation
* Updated UI, Improved Style to be more "Reactly", added Functionality
* add parsing functions
* change folder
* Import/Export Prototype
* Adding "reactjs-popup" to package,json
* Adding GLPK source
* Rough implementation of solver + example
* Show solution in output
* example 2 + popup lib
* removing import button
This feature won't be needed in this state of the project and might come back later. Right now it serves no functional purpose.
* Removing "Popout" button
This feature won't be needed in this state of the project and might come back later. Right now it serves no functional purpose.
* Updating Logs
Now the site displays all logs created with customLog(STRING). Logs can be cleared with customLogClear();
* Adding walltime
Can be called using:
Start:
function walltimeStart() {
returns Date.now();
Stop:
function walltimeStopAndPrint(startpoint: number) {
Add startpoint as argument.
It prints the elapsed time using customLog()
* Adding duals ouput
* Adding glpk.js package
required dependency
* adding LP format export and fixing a few errors
* fixing further errors
* adding automatic build
* Moving files to correct folders
* Update nextjs.yml
* Updating README and .gitignore
README:
- added installation instructions
- added troubleshooting
gitignore:
- skipping Writerside and .idea folders
* Update LICENCE.txt
We are required to use the same license. See https://github.com/hgourvest/node-glpk/blob/master/LICENSE
* Updating icon
* Adding RegEx input checks and updating text box explanations
* Update README.md
Updating license info
Signed-off-by: SinusFox <61253950+SinusFox@users.noreply.github.com>
* Deleting license to recreate proper license
* Update layout.tsx
fixing typo
Signed-off-by: SinusFox <61253950+SinusFox@users.noreply.github.com>
* Fixing word issue
English has some false friends... like the German "Enter" is actually return in English.
* Updatint License
* Fixing design issue and updating license link
* Fixing typo in log
* Fixing white mode
* adding translations 1/2
UI Translations
Coming in 2/2: Output translations
* adding output translations
* adding minimize button
---------
Signed-off-by: SinusFox <61253950+SinusFox@users.noreply.github.com>
Co-authored-by: moebiusl <lucas.moebius@icloud.com>
Co-authored-by: Marcel Pöppe <marcel.poeppe@gmail.com>
This commit is contained in:
+49
-27
@@ -1,58 +1,80 @@
|
||||
'use client'
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { Box, Button, Output } from "./modules";
|
||||
import { calculate_click, downloadLP, import_click } from "./scripts"
|
||||
import { calculate_clickMaximize, calculate_clickMinimize, downloadLP, import_click } from "./scripts"
|
||||
import text from "./lang"
|
||||
|
||||
export default function Home() {
|
||||
const [language, setLanguage] = useState('eng');
|
||||
const tr_hTitle = text(language, 'header_title');
|
||||
const tr_hSubtitle = text(language, 'header_subtitle');
|
||||
const tr_boxObjTitle = text(language, 'boxObjTitle');
|
||||
const tr_boxObjDesc = text(language, "boxObjDesc");
|
||||
const tr_boxSubjTitle = text(language, 'boxSubjTitle');
|
||||
const tr_boxSubjDesc = text(language, "boxSubjDesc");
|
||||
const tr_boxBoundsTitle = text(language, 'boxBoundsTitle');
|
||||
const tr_boxBoundsDesc = text(language, "boxBoundsDesc");
|
||||
const tr_boxVarsTitle = text(language, 'boxVarsTitle');
|
||||
const tr_boxVarsDesc = text(language, "boxVarsDesc");
|
||||
const tr_boxOut = text(language, "boxOut");
|
||||
const tr_boxExportLP = text(language, "boxExportLP");
|
||||
const tr_calc_max = text(language, "maximize");
|
||||
const tr_calc_min = text(language, "minimize");
|
||||
|
||||
const handleLanguageChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
setLanguage(event.target.value);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<header className="header">
|
||||
<div className="title">
|
||||
<main className="header_box">
|
||||
Operations Research Tool
|
||||
{tr_hTitle}
|
||||
<br></br>
|
||||
<span className="header_copyright">
|
||||
<i>by Spaceholder Programming</i>
|
||||
</span>
|
||||
<i>{tr_hSubtitle}</i>
|
||||
</span><br></br>
|
||||
<select id="language_current" value={language} onChange={handleLanguageChange} className="dropdown-custom">
|
||||
<option value="ger">Deutsch</option>
|
||||
<option value="eng">English</option>
|
||||
</select>
|
||||
</main>
|
||||
</div>
|
||||
</header>
|
||||
<Box
|
||||
title={"Objective"}
|
||||
placeholder={"Insert your objective here. One objective is allowed. Use one line for it (no \"return\"!) Allowed symbols are 0-9, a-z, A-Z and <>=.\nExample:\nx + y\n-786433 x1 + 655361 x2"}
|
||||
id="objective"/>
|
||||
title={tr_boxObjTitle}
|
||||
placeholder={tr_boxObjDesc}
|
||||
id="objective" />
|
||||
<Box
|
||||
title={"Subject"}
|
||||
placeholder={"Insert your subject here. One per line (divide by 'return' button). Allowed symbols are 0-9, a-z, A-Z and <>=.\nExample:\n+1 x + 2 y <= 15\n524321 x14 + 524305 x15 <= 4194303.5"}
|
||||
id="subject"/>
|
||||
title={tr_boxSubjTitle}
|
||||
placeholder={tr_boxSubjDesc}
|
||||
id="subject" />
|
||||
<Box
|
||||
title={"Bounds"}
|
||||
placeholder={"Insert your bounds here. One per line (divide by 'return' button). Allowed symbols are 0-9, a-z, A-Z and <>=.\nExample:\nx >= 0\nx > 0\n0 <= x1 <= 1"}
|
||||
id="bounds"/>
|
||||
title={tr_boxBoundsTitle}
|
||||
placeholder={tr_boxBoundsDesc}
|
||||
id="bounds" />
|
||||
<Box
|
||||
title={"Variables"}
|
||||
placeholder={"List all your variables. One per line (divide by 'return' button). Allowed symbols are a-z, A-Z.\nExample:\nx\ny"}
|
||||
title={tr_boxVarsTitle}
|
||||
placeholder={tr_boxVarsDesc}
|
||||
id="vars" />
|
||||
<Button
|
||||
title={"Calculate"}
|
||||
title={tr_calc_max}
|
||||
className={"button_green"}
|
||||
onClickFunc={calculate_click} />
|
||||
{/* <Popup_Button
|
||||
title={"Import"}
|
||||
className={"button"} /> */}
|
||||
onClickFunc={calculate_clickMaximize} />
|
||||
<Button
|
||||
title={"Export as LP"}
|
||||
title={tr_calc_min}
|
||||
className={"button_green"}
|
||||
onClickFunc={calculate_clickMinimize} />
|
||||
<Button
|
||||
title={tr_boxExportLP}
|
||||
className={"button"}
|
||||
onClickFunc={downloadLP} />
|
||||
<br></br>
|
||||
<Output
|
||||
id="out"
|
||||
text={"Input a problem and an action button to display output..."}/>
|
||||
{/* <Popup_Button
|
||||
title="Popup"
|
||||
className="button"
|
||||
/> */}
|
||||
|
||||
text={tr_boxOut} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user