feat(prod): deploy web dashboard, migrate mongodb configuration, resolve server components render error and fix logo static asset paths
This commit is contained in:
1 parent
4882108068
commit
b2ea883601
119 files changed
+7123
-2011
No files matched your search
@@ -0,0 +1,35 @@
|
||||
const mongoose = require('mongoose');
|
||||
const path = require('path');
|
||||
|
||||
require('dotenv').config({ path: path.join(__dirname, '../.env.local') });
|
||||
const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://127.0.0.1:27017/backone_dpi';
|
||||
|
||||
async function run() {
|
||||
console.log('Connecting to:', MONGODB_URI);
|
||||
try {
|
||||
await mongoose.connect(MONGODB_URI, {
|
||||
serverSelectionTimeoutMS: 5000,
|
||||
});
|
||||
console.log('Connected!');
|
||||
|
||||
const db = mongoose.connection.db;
|
||||
const collections = await db.listCollections().toArray();
|
||||
console.log('Collections:', collections.map(c => c.name));
|
||||
|
||||
// Try raw query on users collection
|
||||
const users = await db.collection('users').find({}).toArray();
|
||||
console.log('Raw users in DB:', users.map(u => ({
|
||||
username: u.username,
|
||||
role: u.role,
|
||||
site_uuid: u.site_uuid,
|
||||
agent_uuid: u.agent_uuid,
|
||||
created_by: u.created_by
|
||||
})));
|
||||
|
||||
await mongoose.disconnect();
|
||||
} catch (err) {
|
||||
console.error('Error:', err);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
Reference in new issue
Block a user