mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 20:35:59 +00:00
storage controller
This commit is contained in:
@@ -16,6 +16,7 @@ const { safeJsonParse, getLogger } = require('dbgate-tools');
|
||||
const platformInfo = require('../utility/platformInfo');
|
||||
const { connectionHasPermission, testConnectionPermission } = require('../utility/hasPermission');
|
||||
const pipeForkLogs = require('../utility/pipeForkLogs');
|
||||
const storage = require('./storage');
|
||||
|
||||
const logger = getLogger('connections');
|
||||
|
||||
@@ -199,6 +200,10 @@ module.exports = {
|
||||
|
||||
list_meta: true,
|
||||
async list(_params, req) {
|
||||
const storageConnectionst = await storage.connections();
|
||||
if (storageConnectionst) {
|
||||
return storageConnectionst;
|
||||
}
|
||||
if (portalConnections) {
|
||||
if (platformInfo.allowShellConnection) return portalConnections;
|
||||
return portalConnections.map(maskConnection).filter(x => connectionHasPermission(x, req));
|
||||
|
||||
6
packages/api/src/controllers/storage.js
Normal file
6
packages/api/src/controllers/storage.js
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
connections_meta: true,
|
||||
async connections() {
|
||||
return null;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user