mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-09-14 10:52:34 +00:00
Convert backend to ESM
- About 5 years overdue - Remove eslint, use bomejs instead
This commit is contained in:
@@ -1,38 +1,37 @@
|
||||
const internalProxyHost = require('./proxy-host');
|
||||
const internalRedirectionHost = require('./redirection-host');
|
||||
const internalDeadHost = require('./dead-host');
|
||||
const internalStream = require('./stream');
|
||||
import internalDeadHost from "./dead-host.js";
|
||||
import internalProxyHost from "./proxy-host.js";
|
||||
import internalRedirectionHost from "./redirection-host.js";
|
||||
import internalStream from "./stream.js";
|
||||
|
||||
const internalReport = {
|
||||
|
||||
/**
|
||||
* @param {Access} access
|
||||
* @return {Promise}
|
||||
*/
|
||||
getHostsReport: (access) => {
|
||||
return access.can('reports:hosts', 1)
|
||||
return access
|
||||
.can("reports:hosts", 1)
|
||||
.then((access_data) => {
|
||||
let user_id = access.token.getUserId(1);
|
||||
const userId = access.token.getUserId(1);
|
||||
|
||||
let promises = [
|
||||
internalProxyHost.getCount(user_id, access_data.visibility),
|
||||
internalRedirectionHost.getCount(user_id, access_data.visibility),
|
||||
internalStream.getCount(user_id, access_data.visibility),
|
||||
internalDeadHost.getCount(user_id, access_data.visibility)
|
||||
const promises = [
|
||||
internalProxyHost.getCount(userId, access_data.visibility),
|
||||
internalRedirectionHost.getCount(userId, access_data.visibility),
|
||||
internalStream.getCount(userId, access_data.visibility),
|
||||
internalDeadHost.getCount(userId, access_data.visibility),
|
||||
];
|
||||
|
||||
return Promise.all(promises);
|
||||
})
|
||||
.then((counts) => {
|
||||
return {
|
||||
proxy: counts.shift(),
|
||||
proxy: counts.shift(),
|
||||
redirection: counts.shift(),
|
||||
stream: counts.shift(),
|
||||
dead: counts.shift()
|
||||
stream: counts.shift(),
|
||||
dead: counts.shift(),
|
||||
};
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = internalReport;
|
||||
export default internalReport;
|
||||
|
Reference in New Issue
Block a user