fix: resolve merge conflict artifacts in dev-1.10.1
- Fix missing closing tags in AppView.tsx NetworkGraphView - Fix incomplete catch blocks in server-stats.ts and db/index.ts - Fix missing closing brace in en.json ports section - Fix HostManagerApp.tsx import path - Fix stats-widgets.ts type definition - Fix schema.ts networkTopology table definition - Add type annotations in user-data-import.ts
This commit is contained in:
@@ -671,6 +671,12 @@ const migrateSchema = () => {
|
|||||||
`);
|
`);
|
||||||
} catch (createError) {
|
} catch (createError) {
|
||||||
databaseLogger.warn("Failed to create network_topology table", {
|
databaseLogger.warn("Failed to create network_topology table", {
|
||||||
|
error: createError instanceof Error ? createError.message : String(createError),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
sqlite.prepare("SELECT id FROM host_access LIMIT 1").get();
|
sqlite.prepare("SELECT id FROM host_access LIMIT 1").get();
|
||||||
} catch {
|
} catch {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -301,6 +301,14 @@ export const networkTopology = sqliteTable("network_topology", {
|
|||||||
.notNull()
|
.notNull()
|
||||||
.references(() => users.id, { onDelete: "cascade" }),
|
.references(() => users.id, { onDelete: "cascade" }),
|
||||||
topology: text("topology"),
|
topology: text("topology"),
|
||||||
|
createdAt: text("created_at")
|
||||||
|
.notNull()
|
||||||
|
.default(sql`CURRENT_TIMESTAMP`),
|
||||||
|
updatedAt: text("updated_at")
|
||||||
|
.notNull()
|
||||||
|
.default(sql`CURRENT_TIMESTAMP`),
|
||||||
|
});
|
||||||
|
|
||||||
export const hostAccess = sqliteTable("host_access", {
|
export const hostAccess = sqliteTable("host_access", {
|
||||||
id: integer("id").primaryKey({ autoIncrement: true }),
|
id: integer("id").primaryKey({ autoIncrement: true }),
|
||||||
hostId: integer("host_id")
|
hostId: integer("host_id")
|
||||||
|
|||||||
@@ -1803,6 +1803,10 @@ async function collectMetrics(host: SSHHostWithCredentials): Promise<{
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
statsLogger.debug("Failed to collect ports metrics", {
|
statsLogger.debug("Failed to collect ports metrics", {
|
||||||
operation: "ports_metrics_failed",
|
operation: "ports_metrics_failed",
|
||||||
|
error: e instanceof Error ? e.message : String(e),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let firewall: {
|
let firewall: {
|
||||||
type: "iptables" | "nftables" | "none";
|
type: "iptables" | "nftables" | "none";
|
||||||
status: "active" | "inactive" | "unknown";
|
status: "active" | "inactive" | "unknown";
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ class UserDataImport {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newHostData = {
|
const newHostData: Record<string, unknown> = {
|
||||||
...host,
|
...host,
|
||||||
userId: targetUserId,
|
userId: targetUserId,
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
@@ -204,14 +204,14 @@ class UserDataImport {
|
|||||||
newHostData.createdAt = new Date().toISOString();
|
newHostData.createdAt = new Date().toISOString();
|
||||||
}
|
}
|
||||||
|
|
||||||
let processedHostData = newHostData;
|
let processedHostData: Record<string, unknown> = newHostData;
|
||||||
if (options.userDataKey) {
|
if (options.userDataKey) {
|
||||||
processedHostData = DataCrypto.encryptRecord(
|
processedHostData = DataCrypto.encryptRecord(
|
||||||
"ssh_data",
|
"ssh_data",
|
||||||
newHostData,
|
newHostData,
|
||||||
targetUserId,
|
targetUserId,
|
||||||
options.userDataKey,
|
options.userDataKey,
|
||||||
);
|
) as Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete processedHostData.id;
|
delete processedHostData.id;
|
||||||
@@ -275,7 +275,7 @@ class UserDataImport {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newCredentialData = {
|
const newCredentialData: Record<string, unknown> = {
|
||||||
...credential,
|
...credential,
|
||||||
userId: targetUserId,
|
userId: targetUserId,
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
@@ -287,14 +287,14 @@ class UserDataImport {
|
|||||||
newCredentialData.createdAt = new Date().toISOString();
|
newCredentialData.createdAt = new Date().toISOString();
|
||||||
}
|
}
|
||||||
|
|
||||||
let processedCredentialData = newCredentialData;
|
let processedCredentialData: Record<string, unknown> = newCredentialData;
|
||||||
if (options.userDataKey) {
|
if (options.userDataKey) {
|
||||||
processedCredentialData = DataCrypto.encryptRecord(
|
processedCredentialData = DataCrypto.encryptRecord(
|
||||||
"ssh_credentials",
|
"ssh_credentials",
|
||||||
newCredentialData,
|
newCredentialData,
|
||||||
targetUserId,
|
targetUserId,
|
||||||
options.userDataKey,
|
options.userDataKey,
|
||||||
);
|
) as Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete processedCredentialData.id;
|
delete processedCredentialData.id;
|
||||||
|
|||||||
@@ -1740,6 +1740,7 @@
|
|||||||
"state": "State",
|
"state": "State",
|
||||||
"process": "Process",
|
"process": "Process",
|
||||||
"noData": "No listening ports data"
|
"noData": "No listening ports data"
|
||||||
|
},
|
||||||
"firewall": {
|
"firewall": {
|
||||||
"title": "Firewall",
|
"title": "Firewall",
|
||||||
"active": "Active",
|
"active": "Active",
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export interface ListeningPort {
|
|||||||
export interface PortsMetrics {
|
export interface PortsMetrics {
|
||||||
source: "ss" | "netstat" | "none";
|
source: "ss" | "netstat" | "none";
|
||||||
ports: ListeningPort[];
|
ports: ListeningPort[];
|
||||||
| "firewall";
|
}
|
||||||
|
|
||||||
export interface FirewallRule {
|
export interface FirewallRule {
|
||||||
chain: string;
|
chain: string;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { HostManager } from "@/ui/desktop/apps/host-manager/HostManager";
|
import { HostManager } from "@/ui/desktop/apps/host-manager/hosts/HostManager.tsx";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
const HostManagerApp: React.FC = () => {
|
const HostManagerApp: React.FC = () => {
|
||||||
|
|||||||
@@ -270,7 +270,8 @@ export function ServerStats({
|
|||||||
case "ports":
|
case "ports":
|
||||||
return (
|
return (
|
||||||
<PortsWidget metrics={metrics} metricsHistory={metricsHistory} />
|
<PortsWidget metrics={metrics} metricsHistory={metricsHistory} />
|
||||||
|
);
|
||||||
|
|
||||||
case "firewall":
|
case "firewall":
|
||||||
return (
|
return (
|
||||||
<FirewallWidget metrics={metrics} metricsHistory={metricsHistory} />
|
<FirewallWidget metrics={metrics} metricsHistory={metricsHistory} />
|
||||||
|
|||||||
@@ -361,6 +361,7 @@ export function AppView({
|
|||||||
rightSidebarOpen={rightSidebarOpen}
|
rightSidebarOpen={rightSidebarOpen}
|
||||||
rightSidebarWidth={rightSidebarWidth}
|
rightSidebarWidth={rightSidebarWidth}
|
||||||
isStandalone={true}
|
isStandalone={true}
|
||||||
|
/>
|
||||||
) : t.type === "tunnel" ? (
|
) : t.type === "tunnel" ? (
|
||||||
<TunnelManager
|
<TunnelManager
|
||||||
hostConfig={t.hostConfig}
|
hostConfig={t.hostConfig}
|
||||||
|
|||||||
Reference in New Issue
Block a user