feat(ops-dashboard): implement OpsServer and dashboard component with initial rendering

This commit is contained in:
Philipp Kunz 2025-06-01 19:46:10 +00:00
parent f877ad9676
commit 6ee1d6e917
17 changed files with 215 additions and 21 deletions

121
html/index.html Normal file
View File

@ -0,0 +1,121 @@
<!--gitzone default-->
<!-- made by Lossless GmbH -->
<!-- checkout https://maintainedby.lossless.com for awesome OpenSource projects -->
<!DOCTYPE html>
<html lang="en">
<head>
<!--Lets set some basic meta tags-->
<meta
name="viewport"
content="user-scalable=0, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height"
/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="theme-color" content="#000000" />
<!--Lets make sure we recognize this as an PWA-->
<link rel="manifest" href="/manifest.json" />
<link rel="icon" type="image/png" href="/assetbroker/manifest/favicon.png" />
<!--Lets load standard fonts-->
<link rel="preconnect" href="https://assetbroker.lossless.one/" crossorigin>
<link rel="stylesheet" href="https://assetbroker.lossless.one/fonts/fonts.css">
<!--Lets avoid a rescaling flicker due to default body margins-->
<style>
html {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
position: relative;
background: #000;
margin: 0px;
}
</style>
<script>
projectVersion = '';
</script>
</head>
<body>
<noscript>
<style>
body {
background: #303f9f;
font-family: Inter, Roboto, sans-serif;
color: #ffffff;
}
a {
color: #ffffff;
text-decoration: none;
}
.logo {
margin-top: 100px;
text-align: center;
}
img {
width: 130px;
}
.container {
width: 600px;
margin: auto;
margin-top: 20px;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
overflow: hidden;
border-radius: 3px;
background: #4357d9;
}
.contentHeader {
padding: 20px;
text-align: center;
font-size: 25px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.content {
padding: 20px;
}
.footer {
padding: 10px;
text-align: center;
}
</style>
<div class="logo">
<img src="https://assetbroker.lossless.one/brandfiles/lossless/svg-minimal-bright.svg" />
</div>
<div class="container">
<div class="contentHeader">We need JavaScript to run properly!</div>
<div class="content">
This site is being built using lit-element (made by Google). This technology works with
JavaScript. Subsequently this website does not work as intended by Lossless GmbH without
JavaScript.
</div>
</div>
<div class="footer">
<a href="https://lossless.gmbh">Legal Info</a> |
<a href="https://lossless.gmbh/privacy">Privacy Policy</a>
</div>
</noscript>
<script type="text/javascript" async defer>
window.revenueEnabled = true;
const runRevenueCheck = async () => {
var e = document.createElement('div');
e.id = '476kjuhzgtr764';
e.style.display = 'none';
document.body.appendChild(e);
if (document.getElementById('476kjuhzgtr764')) {
window.revenueEnabled = true;
} else {
window.revenueEnabled = false;
}
console.log(`revenue enabled: ${window.revenueEnabled}`);
};
runRevenueCheck();
</script>
</body>
<script defer type="module" src="/bundle.js"></script>
</html>

View File

@ -12,11 +12,11 @@
"test": "(tstest test/ --logfile --timeout 60)",
"start": "(node --max_old_space_size=250 ./cli.js)",
"startTs": "(node cli.ts.js)",
"build": "(tsbuild tsfolders --allowimplicitany)",
"localPublish": ""
"build": "(tsbuild tsfolders --allowimplicitany && tsbundle website --production)"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.6.4",
"@git.zone/tsbundle": "^2.2.5",
"@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^2.3.1",
"@git.zone/tswatch": "^2.0.1",
@ -29,6 +29,7 @@
"@api.global/typedsocket": "^3.0.0",
"@apiclient.xyz/cloudflare": "^6.4.1",
"@design.estate/dees-catalog": "^1.8.0",
"@design.estate/dees-element": "^2.0.42",
"@push.rocks/projectinfo": "^5.0.1",
"@push.rocks/qenv": "^6.1.0",
"@push.rocks/smartacme": "^8.0.0",
@ -40,7 +41,7 @@
"@push.rocks/smartnetwork": "^4.0.2",
"@push.rocks/smartpath": "^5.0.5",
"@push.rocks/smartpromise": "^4.0.3",
"@push.rocks/smartproxy": "^19.5.4",
"@push.rocks/smartproxy": "^19.5.19",
"@push.rocks/smartrequest": "^2.1.0",
"@push.rocks/smartrule": "^2.0.1",
"@push.rocks/smartrx": "^3.0.10",

18
pnpm-lock.yaml generated
View File

@ -23,6 +23,9 @@ importers:
'@design.estate/dees-catalog':
specifier: ^1.8.0
version: 1.8.0
'@design.estate/dees-element':
specifier: ^2.0.42
version: 2.0.42
'@push.rocks/projectinfo':
specifier: ^5.0.1
version: 5.0.2
@ -57,8 +60,8 @@ importers:
specifier: ^4.0.3
version: 4.2.3
'@push.rocks/smartproxy':
specifier: ^19.5.4
version: 19.5.4(@aws-sdk/credential-providers@3.817.0)(socks@2.8.4)
specifier: ^19.5.19
version: 19.5.19(@aws-sdk/credential-providers@3.817.0)(socks@2.8.4)
'@push.rocks/smartrequest':
specifier: ^2.1.0
version: 2.1.0
@ -99,6 +102,9 @@ importers:
'@git.zone/tsbuild':
specifier: ^2.6.4
version: 2.6.4
'@git.zone/tsbundle':
specifier: ^2.2.5
version: 2.2.5
'@git.zone/tsrun':
specifier: ^1.3.3
version: 1.3.3
@ -1031,8 +1037,8 @@ packages:
'@push.rocks/smartpromise@4.2.3':
resolution: {integrity: sha512-Ycg/TJR+tMt+S3wSFurOpEoW6nXv12QBtKXgBcjMZ4RsdO28geN46U09osPn9N9WuwQy1PkmTV5J/V4F9U8qEw==}
'@push.rocks/smartproxy@19.5.4':
resolution: {integrity: sha512-iNbPQ0s2cco7X+Y++U5ebh1/G/0/HClCxCRPUxiOMj5wbRzlNCnLuW6X6lNk5DX49WhOAWd1tilQ52k+woXEXg==}
'@push.rocks/smartproxy@19.5.19':
resolution: {integrity: sha512-YvcScIomiOxrFwh/g0Cb9GNywQBKmc4BstOOy7rwYyaUZ3H6veVscYHy8gWlRnNBf5YP+GXkzXy9kS7Kv+Djyg==}
'@push.rocks/smartpuppeteer@2.0.5':
resolution: {integrity: sha512-yK/qSeWVHIGWRp3c8S5tfdGP6WCKllZC4DR8d8CQlEjszOSBmHtlTdyyqOMBZ/BA4kd+eU5f3A1r4K2tGYty1g==}
@ -5687,7 +5693,6 @@ snapshots:
- '@mongodb-js/zstd'
- '@nuxt/kit'
- aws-crt
- bufferutil
- encoding
- gcp-metadata
- kerberos
@ -5696,7 +5701,6 @@ snapshots:
- snappy
- socks
- supports-color
- utf-8-validate
- vue
'@push.rocks/smartarchive@3.0.8':
@ -6108,7 +6112,7 @@ snapshots:
'@push.rocks/smartpromise@4.2.3': {}
'@push.rocks/smartproxy@19.5.4(@aws-sdk/credential-providers@3.817.0)(socks@2.8.4)':
'@push.rocks/smartproxy@19.5.19(@aws-sdk/credential-providers@3.817.0)(socks@2.8.4)':
dependencies:
'@push.rocks/lik': 6.2.2
'@push.rocks/smartacme': 8.0.0(@aws-sdk/credential-providers@3.817.0)(socks@2.8.4)

View File

@ -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

View 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
View File

@ -0,0 +1 @@
export * from './classes.opsserver.js';

View File

@ -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
View File

@ -0,0 +1,3 @@
{
"order": 2
}

0
ts_interfaces/index.ts Normal file
View File

View File

@ -0,0 +1,3 @@
{
"order": 1
}

View File

@ -1,8 +0,0 @@
/**
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@serve.zone/platformservice',
version: '2.12.0',
description: 'A multifaceted platform service handling mail, SMS, letter delivery, and AI services.'
};

1
ts_web/elements/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './ops-dashboard.js';

View File

@ -0,0 +1,18 @@
import {
DeesElement,
css,
cssManager,
customElement,
html,
state,
type TemplateResult
} from '@design.estate/dees-element';
@customElement('ops-dashboard')
export class OpsDashboard extends DeesElement {
public render(): TemplateResult {
return html`
hello
`;
}
}

View File

@ -1,2 +0,0 @@
console.log('minidash');
export {};

View File

@ -1 +1,9 @@
console.log('minidash')
import * as plugins from './plugins.js';
import { html } from '@design.estate/dees-element';
import './elements/index.js';
plugins.deesElement.render(html`
<ops-dashboard></ops-dashboard>
`, document.body);

7
ts_web/plugins.ts Normal file
View File

@ -0,0 +1,7 @@
import * as deesElement from '@design.estate/dees-element';
import * as deesCatalog from '@design.estate/dees-catalog';
export {
deesElement,
deesCatalog
}

3
ts_web/tspublish.json Normal file
View File

@ -0,0 +1,3 @@
{
"order": 3
}