Skip to content

Commit

Permalink
new logs + Frontends in manage Emulators
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoonDorise committed Oct 23, 2023
1 parent dfa3aea commit 6273425
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default class AppUpdater {
}
}

fs.exists(`${os.homedir()}/emudeck/emudeck.AppImage.log`, (exists: any) => {
fs.exists(`${os.homedir()}/emudeck/logs/emudeckApp.log`, (exists: any) => {
if (exists) {
fs.unlinkSync(`${os.homedir()}/emudeck/emudeck.AppImage.log`);
fs.unlinkSync(`${os.homedir()}/emudeck/logs/emudeckApp.log`);
}
});

Expand All @@ -62,9 +62,9 @@ const logCommand = (
const date = `${mm}/${dd}/${yyyy}`;
const homedir = os.homedir();

let logFile = `${homedir}/emudeck/Emudeck.AppImage.log`;
let logFile = `${homedir}/emudeck/logs/emudeckApp.log`;
if (os.platform().includes('win32')) {
logFile = `${homedir}\\Emudeck.AppImage.log`;
logFile = `${homedir}\\emudeck\\logs\\emudeckApp.log`;
}

const bashCommandString = bashCommand ? bashCommand.toString() : '';
Expand Down Expand Up @@ -515,7 +515,7 @@ ipcMain.on('update-check', async (event) => {
logCommand(`${JSON.stringify(updateInfo)}`);
} else {
exec(
`echo "[$(date)] UPDATE: UPDATING!" >> $HOME/emudeck/Emudeck.Update.log`,
`echo "[$(date)] UPDATE: UPDATING!" >> $HOME/emudeck/logs/EmudeckUpdate.log`,
shellType
);
logCommand('UPDATE: UPDATING!');
Expand Down Expand Up @@ -653,7 +653,7 @@ ipcMain.on('isGameMode', async (event) => {

// Other
ipcMain.on('clean-log', async () => {
exec(`echo "[$(date)] App Installed" > $HOME/emudeck/Emudeck.AppImage.log`, {
exec(`echo "[$(date)] App Installed" > $HOME/emudeck/logs/EmudeckApp.log`, {
shell: '/bin/bash',
});
});
Expand Down
34 changes: 33 additions & 1 deletion src/renderer/pages/EmulatorsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ function EmulatorsPage() {
dom,
} = statePage;

const { system, installEmus } = state;
const { system, installEmus, installFrontends } = state;

const installEmusArray = Object.values(installEmus);
const installFrontendsArray = Object.values(installFrontends);

const ipcChannel = window.electron.ipcRenderer;

Expand Down Expand Up @@ -379,6 +380,37 @@ function EmulatorsPage() {
</div>
);
})}
{installFrontendsArray.map((item) => {
const img = images[item.id];
const updateNotif = updates[item.id];

if (item.id === 'pegasus' || item.id === 'steam') {
return;
}

return (
<div key={item.id} data-col-md="2">
<CardSettings
icon={img}
css="is-highlighted"
btnCSS={
item.status === true
? 'btn-simple--5'
: 'btn-simple--2'
}
iconSize="sm"
title={`${item.name}`}
button={item.status === true ? 'Manage' : 'Install'}
onClick={() => navigate(`/emulators-detail/${item.id}`)}
notification={
item.status === true
? updateNotif != undefined
: false
}
/>
</div>
);
})}
</div>
</>
)}
Expand Down

0 comments on commit 6273425

Please sign in to comment.