new service interfacee page

This commit is contained in:
Matt Hill
2026-02-14 12:24:16 -07:00
parent d5c74bc22e
commit 098d9275f4
29 changed files with 1133 additions and 1759 deletions

View File

@@ -2130,68 +2130,44 @@ export namespace Mock {
addresses: {
enabled: [],
disabled: [],
possible: [
available: [
{
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: false,
hostname: {
kind: 'local',
value: 'adjective-noun.local',
port: null,
sslPort: 1234,
host: 'adjective-noun.local',
port: 1234,
metadata: {
kind: 'private-domain',
gateways: ['eth0', 'wlan0'],
},
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
ssl: true,
public: false,
hostname: {
kind: 'local',
value: 'adjective-noun.local',
port: null,
sslPort: 1234,
},
host: '192.168.10.11',
port: 1234,
metadata: { kind: 'ipv4', gateway: 'wlan0' },
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
ssl: true,
public: false,
hostname: {
kind: 'ipv4',
value: '192.168.10.11',
port: null,
sslPort: 1234,
},
host: '10.0.0.2',
port: 1234,
metadata: { kind: 'ipv4', gateway: 'wlan0' },
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
ssl: true,
public: false,
hostname: {
kind: 'ipv4',
value: '10.0.0.2',
port: null,
sslPort: 1234,
},
host: 'fe80:cd00:0000:0cde:1257:0000:211e:72cd',
port: 1234,
metadata: { kind: 'ipv6', gateway: 'eth0', scopeId: 2 },
},
{
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: false,
hostname: {
kind: 'ipv6',
value: '[fe80:cd00:0000:0cde:1257:0000:211e:72cd]',
scopeId: 2,
port: null,
sslPort: 1234,
},
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false,
hostname: {
kind: 'ipv6',
value: '[fe80:cd00:0000:0cde:1257:0000:211e:1234]',
scopeId: 3,
port: null,
sslPort: 1234,
},
host: 'fe80:cd00:0000:0cde:1257:0000:211e:1234',
port: 1234,
metadata: { kind: 'ipv6', gateway: 'wlan0', scopeId: 3 },
},
],
},
@@ -2203,7 +2179,7 @@ export namespace Mock {
},
},
publicDomains: {},
privateDomains: [],
privateDomains: {},
},
bcdefgh: {
bindings: {
@@ -2216,7 +2192,7 @@ export namespace Mock {
addresses: {
enabled: [],
disabled: [],
possible: [],
available: [],
},
options: {
addSsl: null,
@@ -2226,7 +2202,7 @@ export namespace Mock {
},
},
publicDomains: {},
privateDomains: [],
privateDomains: {},
},
cdefghi: {
bindings: {
@@ -2239,7 +2215,7 @@ export namespace Mock {
addresses: {
enabled: [],
disabled: [],
possible: [],
available: [],
},
options: {
addSsl: null,
@@ -2249,7 +2225,7 @@ export namespace Mock {
},
},
publicDomains: {},
privateDomains: [],
privateDomains: {},
},
},
storeExposedDependents: [],

View File

@@ -257,7 +257,6 @@ export namespace RR {
export type AddTunnelReq = {
name: string
config: string // file contents
type: GatewayType
setAsDefaultOutbound?: boolean
} // net.tunnel.add
export type AddTunnelRes = {

View File

@@ -583,7 +583,7 @@ export class MockApiService extends ApiService {
lanIp: ['192.168.1.10'],
dnsServers: [],
},
type: params.type,
type: 'inbound-outbound',
},
},
]
@@ -1406,24 +1406,20 @@ export class MockApiService extends ApiService {
const patch: Operation<any>[] = [
{
op: PatchOp.ADD,
path: `/serverInfo/host/publicDomains`,
path: `/serverInfo/network/host/publicDomains`,
value: {
[params.fqdn]: { gateway: params.gateway, acme: params.acme },
},
},
{
op: PatchOp.ADD,
path: `/serverInfo/network/host/bindings/80/addresses/possible/0`,
path: `/serverInfo/network/host/bindings/80/addresses/available/-`,
value: {
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: true,
hostname: {
kind: 'domain',
domain: params.fqdn,
subdomain: null,
port: null,
sslPort: 443,
},
host: params.fqdn,
port: 443,
metadata: { kind: 'public-domain', gateway: params.gateway },
},
},
]
@@ -1440,11 +1436,7 @@ export class MockApiService extends ApiService {
const patch: RemoveOperation[] = [
{
op: PatchOp.REMOVE,
path: `/serverInfo/host/publicDomains/${params.fqdn}`,
},
{
op: PatchOp.REMOVE,
path: `/serverInfo/network/host/bindings/80/addresses/possible/0`,
path: `/serverInfo/network/host/publicDomains/${params.fqdn}`,
},
]
this.mockRevision(patch)
@@ -1459,23 +1451,19 @@ export class MockApiService extends ApiService {
const patch: Operation<any>[] = [
{
op: PatchOp.REPLACE,
path: `/serverInfo/host/privateDomains`,
value: [params.fqdn],
op: PatchOp.ADD,
path: `/serverInfo/network/host/privateDomains/${params.fqdn}`,
value: ['eth0'],
},
{
op: PatchOp.ADD,
path: `/serverInfo/network/host/bindings/80/addresses/possible/0`,
path: `/serverInfo/network/host/bindings/80/addresses/available/-`,
value: {
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: false,
hostname: {
kind: 'domain',
domain: params.fqdn,
subdomain: null,
port: null,
sslPort: 443,
},
host: params.fqdn,
port: 443,
metadata: { kind: 'private-domain', gateways: ['eth0'] },
},
},
]
@@ -1489,15 +1477,10 @@ export class MockApiService extends ApiService {
): Promise<RR.OsUiRemovePrivateDomainRes> {
await pauseFor(2000)
const patch: Operation<any>[] = [
{
op: PatchOp.REPLACE,
path: `/serverInfo/host/privateDomains`,
value: [],
},
const patch: RemoveOperation[] = [
{
op: PatchOp.REMOVE,
path: `/serverInfo/network/host/bindings/80/addresses/possible/0`,
path: `/serverInfo/network/host/privateDomains/${params.fqdn}`,
},
]
this.mockRevision(patch)
@@ -1529,17 +1512,13 @@ export class MockApiService extends ApiService {
},
{
op: PatchOp.ADD,
path: `/packageData/${params.package}/hosts/${params.host}/bindings/80/addresses/possible/0`,
path: `/packageData/${params.package}/hosts/${params.host}/bindings/80/addresses/available/-`,
value: {
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: true,
hostname: {
kind: 'domain',
domain: params.fqdn,
subdomain: null,
port: null,
sslPort: 443,
},
host: params.fqdn,
port: 443,
metadata: { kind: 'public-domain', gateway: params.gateway },
},
},
]
@@ -1558,10 +1537,6 @@ export class MockApiService extends ApiService {
op: PatchOp.REMOVE,
path: `/packageData/${params.package}/hosts/${params.host}/publicDomains/${params.fqdn}`,
},
{
op: PatchOp.REMOVE,
path: `/packageData/${params.package}/hosts/${params.host}/bindings/80/addresses/possible/0`,
},
]
this.mockRevision(patch)
@@ -1575,23 +1550,19 @@ export class MockApiService extends ApiService {
const patch: Operation<any>[] = [
{
op: PatchOp.REPLACE,
path: `/packageData/${params.package}/hosts/${params.host}/privateDomains`,
value: [params.fqdn],
op: PatchOp.ADD,
path: `/packageData/${params.package}/hosts/${params.host}/privateDomains/${params.fqdn}`,
value: ['eth0'],
},
{
op: PatchOp.ADD,
path: `/packageData/${params.package}/hosts/${params.host}/bindings/80/addresses/possible/0`,
path: `/packageData/${params.package}/hosts/${params.host}/bindings/80/addresses/available/-`,
value: {
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: false,
hostname: {
kind: 'domain',
domain: params.fqdn,
subdomain: null,
port: null,
sslPort: 443,
},
host: params.fqdn,
port: 443,
metadata: { kind: 'private-domain', gateways: ['eth0'] },
},
},
]
@@ -1605,15 +1576,10 @@ export class MockApiService extends ApiService {
): Promise<RR.PkgRemovePrivateDomainRes> {
await pauseFor(2000)
const patch: Operation<any>[] = [
{
op: PatchOp.REPLACE,
path: `/packageData/${params.package}/hosts/${params.host}/privateDomains`,
value: [],
},
const patch: RemoveOperation[] = [
{
op: PatchOp.REMOVE,
path: `/packageData/${params.package}/hosts/${params.host}/bindings/80/addresses/possible/0`,
path: `/packageData/${params.package}/hosts/${params.host}/privateDomains/${params.fqdn}`,
},
]
this.mockRevision(patch)

View File

@@ -42,68 +42,58 @@ export const mockPatchData: DataModel = {
addresses: {
enabled: [],
disabled: [],
possible: [
available: [
{
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: false,
hostname: {
kind: 'local',
value: 'adjective-noun.local',
port: null,
sslPort: 443,
host: 'adjective-noun.local',
port: 443,
metadata: {
kind: 'private-domain',
gateways: ['eth0', 'wlan0'],
},
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
ssl: true,
public: false,
hostname: {
kind: 'local',
value: 'adjective-noun.local',
port: null,
sslPort: 443,
},
host: '10.0.0.1',
port: 443,
metadata: { kind: 'ipv4', gateway: 'eth0' },
},
{
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: false,
hostname: {
kind: 'ipv4',
value: '10.0.0.1',
port: null,
sslPort: 443,
},
host: '10.0.0.2',
port: 443,
metadata: { kind: 'ipv4', gateway: 'wlan0' },
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
ssl: true,
public: false,
hostname: {
kind: 'ipv4',
value: '10.0.0.2',
port: null,
sslPort: 443,
},
host: 'fe80::cd00:0000:0cde:1257:0000:211e:72cd',
port: 443,
metadata: { kind: 'ipv6', gateway: 'eth0', scopeId: 2 },
},
{
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: false,
hostname: {
kind: 'ipv6',
value: 'fe80::cd00:0000:0cde:1257:0000:211e:72cd',
scopeId: 2,
port: null,
sslPort: 443,
},
host: 'fe80::cd00:0000:0cde:1257:0000:211e:1234',
port: 443,
metadata: { kind: 'ipv6', gateway: 'wlan0', scopeId: 3 },
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
ssl: false,
public: false,
hostname: {
kind: 'ipv6',
value: 'fe80::cd00:0000:0cde:1257:0000:211e:1234',
scopeId: 3,
port: null,
sslPort: 443,
},
host: 'abc123def456ghi789jkl012mno345pqr678stu901vwx234yz567abc.onion',
port: 80,
metadata: { kind: 'plugin', package: 'tor' },
},
{
ssl: true,
public: false,
host: 'abc123def456ghi789jkl012mno345pqr678stu901vwx234yz567abc.onion',
port: 443,
metadata: { kind: 'plugin', package: 'tor' },
},
],
},
@@ -119,7 +109,7 @@ export const mockPatchData: DataModel = {
},
},
publicDomains: {},
privateDomains: [],
privateDomains: {},
},
gateways: {
eth0: {
@@ -474,13 +464,13 @@ export const mockPatchData: DataModel = {
},
rpc: {
id: 'rpc',
masked: false,
masked: true,
name: 'RPC',
description:
'Used by dependent services and client wallets for connecting to your node',
type: 'api',
addressInfo: {
username: null,
username: 'rpcuser',
hostId: 'bcdefgh',
internalPort: 8332,
scheme: 'http',
@@ -516,70 +506,84 @@ export const mockPatchData: DataModel = {
assignedSslPort: 443,
},
addresses: {
enabled: [],
enabled: ['203.0.113.45:443'],
disabled: [],
possible: [
available: [
{
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: true,
public: false,
hostname: {
kind: 'local',
value: 'adjective-noun.local',
port: null,
sslPort: 1234,
host: 'adjective-noun.local',
port: 443,
metadata: {
kind: 'private-domain',
gateways: ['eth0'],
},
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
ssl: true,
public: false,
hostname: {
kind: 'local',
value: 'adjective-noun.local',
port: null,
sslPort: 1234,
host: '10.0.0.1',
port: 443,
metadata: { kind: 'ipv4', gateway: 'eth0' },
},
{
ssl: true,
public: false,
host: 'fe80::cd00:0cde:1257:211e:72cd',
port: 443,
metadata: { kind: 'ipv6', gateway: 'eth0', scopeId: 2 },
},
{
ssl: true,
public: true,
host: '203.0.113.45',
port: 443,
metadata: { kind: 'ipv4', gateway: 'eth0' },
},
{
ssl: true,
public: true,
host: 'bitcoin.example.com',
port: 443,
metadata: { kind: 'public-domain', gateway: 'eth0' },
},
{
ssl: true,
public: false,
host: '192.168.10.11',
port: 443,
metadata: { kind: 'ipv4', gateway: 'wlan0' },
},
{
ssl: true,
public: false,
host: 'fe80::cd00:0cde:1257:211e:1234',
port: 443,
metadata: { kind: 'ipv6', gateway: 'wlan0', scopeId: 3 },
},
{
ssl: true,
public: false,
host: 'my-bitcoin.home',
port: 443,
metadata: {
kind: 'private-domain',
gateways: ['wlan0'],
},
},
{
gateway: { id: 'eth0', name: 'Ethernet', public: false },
ssl: false,
public: false,
hostname: {
kind: 'ipv4',
value: '10.0.0.1',
port: null,
sslPort: 1234,
},
host: 'xyz789abc123def456ghi789jkl012mno345pqr678stu901vwx234.onion',
port: 80,
metadata: { kind: 'plugin', package: 'tor' },
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
ssl: true,
public: false,
hostname: {
kind: 'ipv4',
value: '10.0.0.2',
port: null,
sslPort: 1234,
},
},
{
gateway: { id: 'eth0', name: 'Ethernet', public: false },
public: false,
hostname: {
kind: 'ipv6',
value: 'fe80::cd00:0000:0cde:1257:0000:211e:72cd',
scopeId: 2,
port: null,
sslPort: 1234,
},
},
{
gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false,
hostname: {
kind: 'ipv6',
value: 'fe80::cd00:0000:0cde:1257:0000:211e:1234',
scopeId: 3,
port: null,
sslPort: 1234,
},
host: 'xyz789abc123def456ghi789jkl012mno345pqr678stu901vwx234.onion',
port: 443,
metadata: { kind: 'plugin', package: 'tor' },
},
],
},
@@ -590,8 +594,15 @@ export const mockPatchData: DataModel = {
},
},
},
publicDomains: {},
privateDomains: [],
publicDomains: {
'bitcoin.example.com': {
gateway: 'eth0',
acme: null,
},
},
privateDomains: {
'my-bitcoin.home': ['wlan0'],
},
},
bcdefgh: {
bindings: {
@@ -604,7 +615,25 @@ export const mockPatchData: DataModel = {
addresses: {
enabled: [],
disabled: [],
possible: [],
available: [
{
ssl: false,
public: false,
host: 'adjective-noun.local',
port: 8332,
metadata: {
kind: 'private-domain',
gateways: ['eth0'],
},
},
{
ssl: false,
public: false,
host: '10.0.0.1',
port: 8332,
metadata: { kind: 'ipv4', gateway: 'eth0' },
},
],
},
options: {
addSsl: null,
@@ -614,7 +643,7 @@ export const mockPatchData: DataModel = {
},
},
publicDomains: {},
privateDomains: [],
privateDomains: {},
},
cdefghi: {
bindings: {
@@ -627,7 +656,7 @@ export const mockPatchData: DataModel = {
addresses: {
enabled: [],
disabled: [],
possible: [],
available: [],
},
options: {
addSsl: null,
@@ -637,7 +666,7 @@ export const mockPatchData: DataModel = {
},
},
publicDomains: {},
privateDomains: [],
privateDomains: {},
},
},
storeExposedDependents: [],