-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8a667c
commit 0aa9c6f
Showing
13 changed files
with
161 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: launch-app | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
||
jobs: | ||
build-windows: | ||
runs-on: [windows-latest] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build Electron App | ||
run: npm run dist | ||
|
||
- name: Release Electron App | ||
run: npm run release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
/* eslint-disable @typescript-eslint/no-namespace */ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { IpcRenderer, ipcRenderer } from "electron"; | ||
import { ipcRenderer } from "electron"; | ||
|
||
declare global { | ||
namespace NodeJS { | ||
interface Global { | ||
IpcRenderer: IpcRenderer | ||
API: any; | ||
} | ||
} | ||
} | ||
|
||
const db = { | ||
createUser: (data: {}) => ipcRenderer.sendSync("createUser", data), | ||
} | ||
|
||
const sys = { | ||
chooseFiles: () => ipcRenderer.sendSync("chooseFiles"), | ||
} | ||
|
||
process.once("loaded", () => { | ||
(global as any).api = { ipcRenderer, db, sys }; | ||
(global as any).api = { | ||
ipcRenderer, | ||
runCommand: (command: {}) => ipcRenderer.sendSync("runCommand", command), | ||
}; | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,61 @@ | ||
import { useState } from "react"; | ||
|
||
export default function Index() { | ||
const [Users, setUsers] = useState([]); | ||
const [data, setData] = useState(""); | ||
|
||
return ( | ||
<main> | ||
<h1>Home</h1> | ||
<main className="flex flex-col p-1"> | ||
<button | ||
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded m-1" | ||
onClick={async () => { | ||
const data = await global.api.runCommand( | ||
"deviceinstaller64 install usbmmidd.inf usbmmidd" | ||
); | ||
setData(data); | ||
}} | ||
> | ||
Instalar app | ||
</button> | ||
|
||
<button | ||
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded m-1" | ||
onClick={async () => { | ||
const data = await global.api.runCommand( | ||
"deviceinstaller64 stop usbmmidd; deviceinstaller64 remove usbmmidd" | ||
); | ||
setData(data); | ||
}} | ||
> | ||
Remover app | ||
</button> | ||
|
||
<button | ||
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded m-1" | ||
onClick={async () => { | ||
const data = await global.api.runCommand( | ||
"deviceinstaller64 enableidd 1" | ||
); | ||
setData(data); | ||
}} | ||
> | ||
Adicionar tela | ||
</button> | ||
|
||
<button | ||
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" | ||
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded m-1" | ||
onClick={async () => { | ||
const data = await global.api.db.createUser({ | ||
firstName: "Saulo", | ||
lastName: "Costa", | ||
}); | ||
setUsers(data); | ||
const data = await global.api.runCommand( | ||
"deviceinstaller64 enableidd 0" | ||
); | ||
setData(data); | ||
}} | ||
> | ||
Criar user | ||
Remover tela | ||
</button> | ||
|
||
<hr /> | ||
<pre className="bg-slate-500">{JSON.stringify(Users, null, 4)}</pre> | ||
<hr /> | ||
<pre className="p-5 border border-red-100 rounded-md"> | ||
{JSON.stringify(data, null, 4)} | ||
</pre> | ||
</main> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.