Added file links to the logs and output

This commit is contained in:
2022-06-17 12:55:58 +02:00
parent 5239cdb8f7
commit 7c082ee546
3 changed files with 17 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ function MainSide() {
setLogTable(logListName.map((log, index) => { setLogTable(logListName.map((log, index) => {
return <tr key={index}> return <tr key={index}>
<td title={logList[index]}>{index+1}. {log}</td> <td id="logList-Name" title={logList[index]} onClick={() => openFolder(logList[index].substring(0, logList[index].lastIndexOf('\\')))}>{index+1}. {log}</td>
<td><button className="listButton" onClick={() => { <td><button className="listButton" onClick={() => {
const newLogs = settingList.log.replace('"'+logList[index]+'"', ""); const newLogs = settingList.log.replace('"'+logList[index]+'"', "");
updateSettings({log:newLogs}); updateSettings({log:newLogs});
@@ -46,7 +46,6 @@ function MainSide() {
<path d="M361 215C375.3 223.8 384 239.3 384 256C384 272.7 375.3 288.2 361 296.1L73.03 472.1C58.21 482 39.66 482.4 24.52 473.9C9.377 465.4 0 449.4 0 432V80C0 62.64 9.377 46.63 24.52 38.13C39.66 29.64 58.21 29.99 73.03 39.04L361 215z"/> <path d="M361 215C375.3 223.8 384 239.3 384 256C384 272.7 375.3 288.2 361 296.1L73.03 472.1C58.21 482 39.66 482.4 24.52 473.9C9.377 465.4 0 449.4 0 432V80C0 62.64 9.377 46.63 24.52 38.13C39.66 29.64 58.21 29.99 73.03 39.04L361 215z"/>
</svg> </svg>
</button> </button>
<button id="openOutputMain" onClick={() => openOutputFolder()}>Open Output Folder</button>
<h4 className="noMarginBottom">Logs:</h4> <h4 className="noMarginBottom">Logs:</h4>
<table> <table>
<tbody> <tbody>
@@ -62,8 +61,8 @@ function MainSide() {
</div> </div>
<div className="dataDiv" id="outputDiv"> <div className="dataDiv" id="outputDiv">
<h4>Output Folder:</h4> <h4>Output Folder:</h4>
<p id="output">{output}</p> <p id="output" onClick={() => openFolder(settingList.output)}>{output}</p>
<button onClick={() => openVid(setOutput)}>Select Output Folder</button> <button onClick={() => openVid(setOutput)}>Select Folder</button>
</div> </div>
</div> </div>
) )
@@ -113,15 +112,15 @@ function openVid(updateHook:React.Dispatch<React.SetStateAction<string>>) {
}); });
} }
function openOutputFolder() { function openFolder(folder:string) {
if(settingList.output == "None") { if(settingList.output == "None") {
logger.warningMSG("No output folder set!"); logger.warningMSG("No output folder set!");
} else { } else {
exec('start "" "' + settingList.output + '"'); exec('start "" "' + folder + '"');
} }
} }
export default MainSide; export default MainSide;
export { export {
openOutputFolder openFolder
} }

View File

@@ -1,6 +1,6 @@
import React, {useState} from "react"; import React, {useState} from "react";
import { settingList } from "../settings"; import { settingList } from "../settings";
import {openOutputFolder} from "./mainSide"; import {openFolder} from "./mainSide";
let setLogNumber:React.Dispatch<React.SetStateAction<string>>; let setLogNumber:React.Dispatch<React.SetStateAction<string>>;
let setStatus:React.Dispatch<React.SetStateAction<string>>; let setStatus:React.Dispatch<React.SetStateAction<string>>;
@@ -15,7 +15,7 @@ function RenderingSide() {
<div id="content"> <div id="content">
<p>{"Log " + logNumber + "/" + String(settingList.log.split("\"\"").length)}</p> <p>{"Log " + logNumber + "/" + String(settingList.log.split("\"\"").length)}</p>
<p>{status}</p> <p>{status}</p>
<button onClick={() => openOutputFolder()}>Open Output Folder</button> <button onClick={() => openFolder(settingList.output)}>Open Output Folder</button>
</div> </div>
) )
} }

View File

@@ -199,6 +199,10 @@ header h1 {
#output { #output {
margin-left: 5px; margin-left: 5px;
} }
#output:hover {
cursor: pointer;
text-decoration: underline;
}
#openLogButton { #openLogButton {
margin-top: 5px; margin-top: 5px;
@@ -267,3 +271,8 @@ button:hover {
#resetSettingsButton { #resetSettingsButton {
height: 35px; height: 35px;
} }
#logList-Name:hover {
cursor: pointer;
text-decoration: underline;
}