feat(ops-dashboard): implement OpsServer and dashboard component with initial rendering
This commit is contained in:
@ -12,6 +12,8 @@ import { configureEmailStorage, configureEmailServer } from './mail/delivery/ind
|
||||
// Import storage manager
|
||||
import { StorageManager, type IStorageConfig } from './storage/index.js';
|
||||
|
||||
import { OpsServer } from './opsserver/index.js';
|
||||
|
||||
export interface IDcRouterOptions {
|
||||
/**
|
||||
* Direct SmartProxy configuration - gives full control over HTTP/HTTPS and TCP/SNI traffic
|
||||
@ -130,6 +132,7 @@ export class DcRouter {
|
||||
public dnsServer?: plugins.smartdns.dnsServerMod.DnsServer;
|
||||
public emailServer?: UnifiedEmailServer;
|
||||
public storageManager: StorageManager;
|
||||
public opsServer: OpsServer;
|
||||
|
||||
|
||||
// Environment access
|
||||
@ -150,6 +153,10 @@ export class DcRouter {
|
||||
console.log('║ Starting DcRouter Services ║');
|
||||
console.log('╚═══════════════════════════════════════════════════════════════════╝');
|
||||
|
||||
|
||||
this.opsServer = new OpsServer(this);
|
||||
await this.opsServer.start();
|
||||
|
||||
try {
|
||||
// Set up SmartProxy for HTTP/HTTPS and all traffic including email routes
|
||||
await this.setupSmartProxy();
|
||||
@ -551,6 +558,8 @@ export class DcRouter {
|
||||
|
||||
public async stop() {
|
||||
console.log('Stopping DcRouter services...');
|
||||
|
||||
await this.opsServer.stop();
|
||||
|
||||
try {
|
||||
// Stop all services in parallel for faster shutdown
|
||||
|
24
ts/opsserver/classes.opsserver.ts
Normal file
24
ts/opsserver/classes.opsserver.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import type DcRouter from '../classes.dcrouter.js';
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as paths from '../paths.js';
|
||||
|
||||
export class OpsServer {
|
||||
public dcRouterRef: DcRouter;
|
||||
public server: plugins.typedserver.utilityservers.UtilityWebsiteServer;
|
||||
|
||||
constructor(dcRouterRefArg: DcRouter) {
|
||||
this.dcRouterRef = dcRouterRefArg;
|
||||
}
|
||||
|
||||
public async start() {
|
||||
this.server = new plugins.typedserver.utilityservers.UtilityWebsiteServer({
|
||||
domain: 'localhost',
|
||||
feedMetadata: null,
|
||||
serveDir: paths.distServe,
|
||||
});
|
||||
|
||||
await this.server.start(3000);
|
||||
}
|
||||
|
||||
public async stop() {}
|
||||
}
|
1
ts/opsserver/index.ts
Normal file
1
ts/opsserver/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './classes.opsserver.js';
|
@ -6,6 +6,7 @@ export const packageDir = plugins.path.join(
|
||||
plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url),
|
||||
'../'
|
||||
);
|
||||
export const distServe = plugins.path.join(packageDir, './dist_serve');
|
||||
|
||||
// Configure data directory with environment variable or default to .nogit/data
|
||||
const DEFAULT_DATA_PATH = '.nogit/data';
|
||||
|
3
ts/tspublish.json
Normal file
3
ts/tspublish.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"order": 2
|
||||
}
|
Reference in New Issue
Block a user