mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-22 06:29:17 -04:00
Added basic web interface for API keys
Web interfaces for manging API keys have been added however translation keys are still required. Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
parent
0d6a8b2101
commit
ee2eb5109b
12 changed files with 759 additions and 3 deletions
|
@ -113,6 +113,31 @@ async function sendProxyList(socket) {
|
|||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit API key list to client
|
||||
* @param {Socket} socket Socket.io socket instance
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function sendAPIKeyList(socket) {
|
||||
const timeLogger = new TimeLogger();
|
||||
|
||||
let result = [];
|
||||
const list = await R.find(
|
||||
"api_key",
|
||||
"user_id=?",
|
||||
[ socket.userID ],
|
||||
);
|
||||
|
||||
for (let bean of list) {
|
||||
result.push(bean.toPublicJSON());
|
||||
}
|
||||
|
||||
io.to(socket.userID).emit("apiKeyList", result);
|
||||
timeLogger.print("Sent API Key List");
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Emits the version information to the client.
|
||||
* @param {Socket} socket Socket.io socket instance
|
||||
|
@ -157,6 +182,7 @@ module.exports = {
|
|||
sendImportantHeartbeatList,
|
||||
sendHeartbeatList,
|
||||
sendProxyList,
|
||||
sendAPIKeyList,
|
||||
sendInfo,
|
||||
sendDockerHostList
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue