mirror of
https://github.com/LinoSchmidt/StickExporterTX.git
synced 2026-03-21 01:51:15 +01:00
Better log menu
This commit is contained in:
@@ -30,7 +30,12 @@ function MainSide() {
|
|||||||
|
|
||||||
setLogTable(logListName.map((log, index) => {
|
setLogTable(logListName.map((log, index) => {
|
||||||
return <tr key={index}>
|
return <tr key={index}>
|
||||||
<td title={logList[index]}>{log}</td>
|
<td title={logList[index]}>{index+1}. {log}</td>
|
||||||
|
<td><button onClick={() => {
|
||||||
|
const newLogs = settingList.log.replace('"'+logList[index]+'"', "");
|
||||||
|
updateSettings({log:newLogs});
|
||||||
|
setLogs(newLogs);
|
||||||
|
}}>Delete</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
}));
|
}));
|
||||||
}, [logs]);
|
}, [logs]);
|
||||||
@@ -49,24 +54,29 @@ function MainSide() {
|
|||||||
<button onClick={() => openOutputFolder()}>Open Output Folder</button>
|
<button onClick={() => openOutputFolder()}>Open Output Folder</button>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
<h4 className="noMarginBottom">Logs:</h4>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
{logTable}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
<div className="dataDiv">
|
<div className="dataDiv">
|
||||||
<p>Logs:</p>
|
<button id="openLogButton" onClick={() => addLog(setLogs)}>Add Log(s)</button>
|
||||||
<table>
|
<button id="deleteLogsButton" onClick={() => {
|
||||||
<tbody>
|
updateSettings({log:""});
|
||||||
{logTable}
|
setLogs("");
|
||||||
</tbody>
|
}}>Delete All</button>
|
||||||
</table>
|
|
||||||
<button onClick={() => openLog(setLogs)}>Open Log</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="dataDiv">
|
<div className="dataDiv" id="outputDiv">
|
||||||
<p id="output">{"Output Folder: " + output}</p>
|
<h4>Output Folder:</h4>
|
||||||
|
<p id="output">{output}</p>
|
||||||
<button onClick={() => openVid(setOutput)}>Open Video</button>
|
<button onClick={() => openVid(setOutput)}>Open Video</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function openLog(updateHook:React.Dispatch<React.SetStateAction<string>>) {
|
function addLog(updateHook:React.Dispatch<React.SetStateAction<string>>) {
|
||||||
dialog.showOpenDialog({
|
dialog.showOpenDialog({
|
||||||
properties: [
|
properties: [
|
||||||
"multiSelections"
|
"multiSelections"
|
||||||
@@ -82,10 +92,16 @@ function openLog(updateHook:React.Dispatch<React.SetStateAction<string>>) {
|
|||||||
}).then(result => {
|
}).then(result => {
|
||||||
let logStr = "";
|
let logStr = "";
|
||||||
result.filePaths.forEach(value => {
|
result.filePaths.forEach(value => {
|
||||||
logStr += "\"" + String(value) + "\"";
|
const logToAdd = "\"" + value + "\"";
|
||||||
|
if(settingList.log.includes(logToAdd)) {
|
||||||
|
logger.warningMSG("Log already added!");
|
||||||
|
} else {
|
||||||
|
logStr += "\"" + String(value) + "\"";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
updateSettings({log:logStr});
|
const newLogs = settingList.log + logStr;
|
||||||
updateHook(logStr);
|
updateSettings({log:newLogs});
|
||||||
|
updateHook(newLogs);
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
logger.errorMSG(err);
|
logger.errorMSG(err);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -190,3 +190,23 @@ header h1 {
|
|||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.noMarginBottom {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#outputDiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
#output {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#openLogButton {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
#deleteLogsButton {
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user