This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/laravel-reverb
- Loading branch information
Showing
24 changed files
with
11,493 additions
and
8,768 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 @@ | ||
github: simonhamp |
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,5 @@ | ||
## Security contact information | ||
|
||
To report a security vulnerability, please use the | ||
[Tidelift security contact](https://tidelift.com/security). | ||
Tidelift will coordinate the fix and disclosure. |
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
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,62 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const express_1 = __importDefault(require("express")); | ||
const electron_1 = require("electron"); | ||
const utils_1 = require("../utils"); | ||
const router = express_1.default.Router(); | ||
router.get('/get-system-idle-state', (req, res) => { | ||
res.json({ | ||
result: electron_1.powerMonitor.getSystemIdleState(req.body.threshold), | ||
}); | ||
}); | ||
router.get('/get-system-idle-time', (req, res) => { | ||
res.json({ | ||
result: electron_1.powerMonitor.getSystemIdleTime(), | ||
}); | ||
}); | ||
router.get('/get-current-thermal-state', (req, res) => { | ||
res.json({ | ||
result: electron_1.powerMonitor.getCurrentThermalState(), | ||
}); | ||
}); | ||
router.get('/is-on-battery-power', (req, res) => { | ||
res.json({ | ||
result: electron_1.powerMonitor.isOnBatteryPower(), | ||
}); | ||
}); | ||
electron_1.powerMonitor.addListener('on-ac', () => { | ||
(0, utils_1.notifyLaravel)("events", { | ||
event: `\\Native\\Laravel\\Events\\PowerMonitor\\PowerStateChanged`, | ||
payload: { | ||
state: 'on-ac' | ||
} | ||
}); | ||
}); | ||
electron_1.powerMonitor.addListener('on-battery', () => { | ||
(0, utils_1.notifyLaravel)("events", { | ||
event: `\\Native\\Laravel\\Events\\PowerMonitor\\PowerStateChanged`, | ||
payload: { | ||
state: 'on-battery' | ||
} | ||
}); | ||
}); | ||
electron_1.powerMonitor.addListener('thermal-state-change', (state) => { | ||
(0, utils_1.notifyLaravel)("events", { | ||
event: `\\Native\\Laravel\\Events\\PowerMonitor\\ThermalStateChanged`, | ||
payload: { | ||
state | ||
} | ||
}); | ||
}); | ||
electron_1.powerMonitor.addListener('speed-limit-change', (limit) => { | ||
(0, utils_1.notifyLaravel)("events", { | ||
event: `\\Native\\Laravel\\Events\\PowerMonitor\\SpeedLimitChanged`, | ||
payload: { | ||
limit | ||
} | ||
}); | ||
}); | ||
exports.default = router; |
Oops, something went wrong.