feat(ops-dashboard): implement OpsServer and dashboard component with initial rendering
This commit is contained in:
121
html/index.html
Normal file
121
html/index.html
Normal 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>
|
@@ -12,11 +12,11 @@
|
|||||||
"test": "(tstest test/ --logfile --timeout 60)",
|
"test": "(tstest test/ --logfile --timeout 60)",
|
||||||
"start": "(node --max_old_space_size=250 ./cli.js)",
|
"start": "(node --max_old_space_size=250 ./cli.js)",
|
||||||
"startTs": "(node cli.ts.js)",
|
"startTs": "(node cli.ts.js)",
|
||||||
"build": "(tsbuild tsfolders --allowimplicitany)",
|
"build": "(tsbuild tsfolders --allowimplicitany && tsbundle website --production)"
|
||||||
"localPublish": ""
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.6.4",
|
"@git.zone/tsbuild": "^2.6.4",
|
||||||
|
"@git.zone/tsbundle": "^2.2.5",
|
||||||
"@git.zone/tsrun": "^1.3.3",
|
"@git.zone/tsrun": "^1.3.3",
|
||||||
"@git.zone/tstest": "^2.3.1",
|
"@git.zone/tstest": "^2.3.1",
|
||||||
"@git.zone/tswatch": "^2.0.1",
|
"@git.zone/tswatch": "^2.0.1",
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
"@api.global/typedsocket": "^3.0.0",
|
"@api.global/typedsocket": "^3.0.0",
|
||||||
"@apiclient.xyz/cloudflare": "^6.4.1",
|
"@apiclient.xyz/cloudflare": "^6.4.1",
|
||||||
"@design.estate/dees-catalog": "^1.8.0",
|
"@design.estate/dees-catalog": "^1.8.0",
|
||||||
|
"@design.estate/dees-element": "^2.0.42",
|
||||||
"@push.rocks/projectinfo": "^5.0.1",
|
"@push.rocks/projectinfo": "^5.0.1",
|
||||||
"@push.rocks/qenv": "^6.1.0",
|
"@push.rocks/qenv": "^6.1.0",
|
||||||
"@push.rocks/smartacme": "^8.0.0",
|
"@push.rocks/smartacme": "^8.0.0",
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
"@push.rocks/smartnetwork": "^4.0.2",
|
"@push.rocks/smartnetwork": "^4.0.2",
|
||||||
"@push.rocks/smartpath": "^5.0.5",
|
"@push.rocks/smartpath": "^5.0.5",
|
||||||
"@push.rocks/smartpromise": "^4.0.3",
|
"@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/smartrequest": "^2.1.0",
|
||||||
"@push.rocks/smartrule": "^2.0.1",
|
"@push.rocks/smartrule": "^2.0.1",
|
||||||
"@push.rocks/smartrx": "^3.0.10",
|
"@push.rocks/smartrx": "^3.0.10",
|
||||||
|
18
pnpm-lock.yaml
generated
18
pnpm-lock.yaml
generated
@@ -23,6 +23,9 @@ importers:
|
|||||||
'@design.estate/dees-catalog':
|
'@design.estate/dees-catalog':
|
||||||
specifier: ^1.8.0
|
specifier: ^1.8.0
|
||||||
version: 1.8.0
|
version: 1.8.0
|
||||||
|
'@design.estate/dees-element':
|
||||||
|
specifier: ^2.0.42
|
||||||
|
version: 2.0.42
|
||||||
'@push.rocks/projectinfo':
|
'@push.rocks/projectinfo':
|
||||||
specifier: ^5.0.1
|
specifier: ^5.0.1
|
||||||
version: 5.0.2
|
version: 5.0.2
|
||||||
@@ -57,8 +60,8 @@ importers:
|
|||||||
specifier: ^4.0.3
|
specifier: ^4.0.3
|
||||||
version: 4.2.3
|
version: 4.2.3
|
||||||
'@push.rocks/smartproxy':
|
'@push.rocks/smartproxy':
|
||||||
specifier: ^19.5.4
|
specifier: ^19.5.19
|
||||||
version: 19.5.4(@aws-sdk/credential-providers@3.817.0)(socks@2.8.4)
|
version: 19.5.19(@aws-sdk/credential-providers@3.817.0)(socks@2.8.4)
|
||||||
'@push.rocks/smartrequest':
|
'@push.rocks/smartrequest':
|
||||||
specifier: ^2.1.0
|
specifier: ^2.1.0
|
||||||
version: 2.1.0
|
version: 2.1.0
|
||||||
@@ -99,6 +102,9 @@ importers:
|
|||||||
'@git.zone/tsbuild':
|
'@git.zone/tsbuild':
|
||||||
specifier: ^2.6.4
|
specifier: ^2.6.4
|
||||||
version: 2.6.4
|
version: 2.6.4
|
||||||
|
'@git.zone/tsbundle':
|
||||||
|
specifier: ^2.2.5
|
||||||
|
version: 2.2.5
|
||||||
'@git.zone/tsrun':
|
'@git.zone/tsrun':
|
||||||
specifier: ^1.3.3
|
specifier: ^1.3.3
|
||||||
version: 1.3.3
|
version: 1.3.3
|
||||||
@@ -1031,8 +1037,8 @@ packages:
|
|||||||
'@push.rocks/smartpromise@4.2.3':
|
'@push.rocks/smartpromise@4.2.3':
|
||||||
resolution: {integrity: sha512-Ycg/TJR+tMt+S3wSFurOpEoW6nXv12QBtKXgBcjMZ4RsdO28geN46U09osPn9N9WuwQy1PkmTV5J/V4F9U8qEw==}
|
resolution: {integrity: sha512-Ycg/TJR+tMt+S3wSFurOpEoW6nXv12QBtKXgBcjMZ4RsdO28geN46U09osPn9N9WuwQy1PkmTV5J/V4F9U8qEw==}
|
||||||
|
|
||||||
'@push.rocks/smartproxy@19.5.4':
|
'@push.rocks/smartproxy@19.5.19':
|
||||||
resolution: {integrity: sha512-iNbPQ0s2cco7X+Y++U5ebh1/G/0/HClCxCRPUxiOMj5wbRzlNCnLuW6X6lNk5DX49WhOAWd1tilQ52k+woXEXg==}
|
resolution: {integrity: sha512-YvcScIomiOxrFwh/g0Cb9GNywQBKmc4BstOOy7rwYyaUZ3H6veVscYHy8gWlRnNBf5YP+GXkzXy9kS7Kv+Djyg==}
|
||||||
|
|
||||||
'@push.rocks/smartpuppeteer@2.0.5':
|
'@push.rocks/smartpuppeteer@2.0.5':
|
||||||
resolution: {integrity: sha512-yK/qSeWVHIGWRp3c8S5tfdGP6WCKllZC4DR8d8CQlEjszOSBmHtlTdyyqOMBZ/BA4kd+eU5f3A1r4K2tGYty1g==}
|
resolution: {integrity: sha512-yK/qSeWVHIGWRp3c8S5tfdGP6WCKllZC4DR8d8CQlEjszOSBmHtlTdyyqOMBZ/BA4kd+eU5f3A1r4K2tGYty1g==}
|
||||||
@@ -5687,7 +5693,6 @@ snapshots:
|
|||||||
- '@mongodb-js/zstd'
|
- '@mongodb-js/zstd'
|
||||||
- '@nuxt/kit'
|
- '@nuxt/kit'
|
||||||
- aws-crt
|
- aws-crt
|
||||||
- bufferutil
|
|
||||||
- encoding
|
- encoding
|
||||||
- gcp-metadata
|
- gcp-metadata
|
||||||
- kerberos
|
- kerberos
|
||||||
@@ -5696,7 +5701,6 @@ snapshots:
|
|||||||
- snappy
|
- snappy
|
||||||
- socks
|
- socks
|
||||||
- supports-color
|
- supports-color
|
||||||
- utf-8-validate
|
|
||||||
- vue
|
- vue
|
||||||
|
|
||||||
'@push.rocks/smartarchive@3.0.8':
|
'@push.rocks/smartarchive@3.0.8':
|
||||||
@@ -6108,7 +6112,7 @@ snapshots:
|
|||||||
|
|
||||||
'@push.rocks/smartpromise@4.2.3': {}
|
'@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:
|
dependencies:
|
||||||
'@push.rocks/lik': 6.2.2
|
'@push.rocks/lik': 6.2.2
|
||||||
'@push.rocks/smartacme': 8.0.0(@aws-sdk/credential-providers@3.817.0)(socks@2.8.4)
|
'@push.rocks/smartacme': 8.0.0(@aws-sdk/credential-providers@3.817.0)(socks@2.8.4)
|
||||||
|
@@ -12,6 +12,8 @@ import { configureEmailStorage, configureEmailServer } from './mail/delivery/ind
|
|||||||
// Import storage manager
|
// Import storage manager
|
||||||
import { StorageManager, type IStorageConfig } from './storage/index.js';
|
import { StorageManager, type IStorageConfig } from './storage/index.js';
|
||||||
|
|
||||||
|
import { OpsServer } from './opsserver/index.js';
|
||||||
|
|
||||||
export interface IDcRouterOptions {
|
export interface IDcRouterOptions {
|
||||||
/**
|
/**
|
||||||
* Direct SmartProxy configuration - gives full control over HTTP/HTTPS and TCP/SNI traffic
|
* 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 dnsServer?: plugins.smartdns.dnsServerMod.DnsServer;
|
||||||
public emailServer?: UnifiedEmailServer;
|
public emailServer?: UnifiedEmailServer;
|
||||||
public storageManager: StorageManager;
|
public storageManager: StorageManager;
|
||||||
|
public opsServer: OpsServer;
|
||||||
|
|
||||||
|
|
||||||
// Environment access
|
// Environment access
|
||||||
@@ -150,6 +153,10 @@ export class DcRouter {
|
|||||||
console.log('║ Starting DcRouter Services ║');
|
console.log('║ Starting DcRouter Services ║');
|
||||||
console.log('╚═══════════════════════════════════════════════════════════════════╝');
|
console.log('╚═══════════════════════════════════════════════════════════════════╝');
|
||||||
|
|
||||||
|
|
||||||
|
this.opsServer = new OpsServer(this);
|
||||||
|
await this.opsServer.start();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Set up SmartProxy for HTTP/HTTPS and all traffic including email routes
|
// Set up SmartProxy for HTTP/HTTPS and all traffic including email routes
|
||||||
await this.setupSmartProxy();
|
await this.setupSmartProxy();
|
||||||
@@ -551,6 +558,8 @@ export class DcRouter {
|
|||||||
|
|
||||||
public async stop() {
|
public async stop() {
|
||||||
console.log('Stopping DcRouter services...');
|
console.log('Stopping DcRouter services...');
|
||||||
|
|
||||||
|
await this.opsServer.stop();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Stop all services in parallel for faster shutdown
|
// 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),
|
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
|
// Configure data directory with environment variable or default to .nogit/data
|
||||||
const DEFAULT_DATA_PATH = '.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
|
||||||
|
}
|
0
ts_interfaces/index.ts
Normal file
0
ts_interfaces/index.ts
Normal file
3
ts_interfaces/tspublish.json
Normal file
3
ts_interfaces/tspublish.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"order": 1
|
||||||
|
}
|
@@ -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
1
ts_web/elements/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './ops-dashboard.js';
|
18
ts_web/elements/ops-dashboard.ts
Normal file
18
ts_web/elements/ops-dashboard.ts
Normal 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
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,2 +0,0 @@
|
|||||||
console.log('minidash');
|
|
||||||
export {};
|
|
@@ -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
7
ts_web/plugins.ts
Normal 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
3
ts_web/tspublish.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"order": 3
|
||||||
|
}
|
Reference in New Issue
Block a user