mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor(ui): improve log highlighting and template formatting
This commit is contained in:
parent
125e44812b
commit
d3b2cee7fb
@ -35,34 +35,34 @@ export function TerminalLine({ log, noTimestamp, searchTerm }: LogLineProps) {
|
||||
})
|
||||
: "--- No time found ---";
|
||||
|
||||
const highlightMessage = (text: string, term: string) => {
|
||||
if (!term) {
|
||||
return (
|
||||
<span
|
||||
className="transition-colors"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: fancyAnsi.toHtml(text),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const htmlContent = fancyAnsi.toHtml(text);
|
||||
const searchRegex = new RegExp(`(${escapeRegExp(term)})`, "gi");
|
||||
|
||||
const modifiedContent = htmlContent.replace(
|
||||
searchRegex,
|
||||
(match) =>
|
||||
`<span class="bg-orange-200/80 dark:bg-orange-900/80 font-bold">${match}</span>`,
|
||||
);
|
||||
|
||||
const highlightMessage = (text: string, term: string) => {
|
||||
if (!term) {
|
||||
return (
|
||||
<span
|
||||
className="transition-colors"
|
||||
dangerouslySetInnerHTML={{ __html: modifiedContent }}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: fancyAnsi.toHtml(text),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
const htmlContent = fancyAnsi.toHtml(text);
|
||||
const searchRegex = new RegExp(`(${escapeRegExp(term)})`, "gi");
|
||||
|
||||
const modifiedContent = htmlContent.replace(
|
||||
searchRegex,
|
||||
(match) =>
|
||||
`<span class="bg-orange-200/80 dark:bg-orange-900/80 font-bold">${match}</span>`,
|
||||
);
|
||||
|
||||
return (
|
||||
<span
|
||||
className="transition-colors"
|
||||
dangerouslySetInnerHTML={{ __html: modifiedContent }}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const tooltip = (color: string, timestamp: string | null) => {
|
||||
const square = (
|
||||
|
@ -1,38 +1,38 @@
|
||||
import {
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateRandomDomain,
|
||||
type DomainSchema,
|
||||
type Schema,
|
||||
type Template,
|
||||
generateRandomDomain,
|
||||
} from "../utils";
|
||||
|
||||
export function generate(schema: Schema): Template {
|
||||
const dashboardDomain = generateRandomDomain(schema);
|
||||
const backendDomain = generateRandomDomain(schema);
|
||||
const actionsDomain = generateRandomDomain(schema);
|
||||
const dashboardDomain = generateRandomDomain(schema);
|
||||
const backendDomain = generateRandomDomain(schema);
|
||||
const actionsDomain = generateRandomDomain(schema);
|
||||
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: dashboardDomain,
|
||||
port: 6791,
|
||||
serviceName: "dashboard",
|
||||
},
|
||||
{
|
||||
host: backendDomain,
|
||||
port: 3210,
|
||||
serviceName: "backend",
|
||||
},
|
||||
{
|
||||
host: actionsDomain,
|
||||
port: 3211,
|
||||
serviceName: "backend",
|
||||
},
|
||||
];
|
||||
const domains: DomainSchema[] = [
|
||||
{
|
||||
host: dashboardDomain,
|
||||
port: 6791,
|
||||
serviceName: "dashboard",
|
||||
},
|
||||
{
|
||||
host: backendDomain,
|
||||
port: 3210,
|
||||
serviceName: "backend",
|
||||
},
|
||||
{
|
||||
host: actionsDomain,
|
||||
port: 3211,
|
||||
serviceName: "backend",
|
||||
},
|
||||
];
|
||||
|
||||
const envs = [
|
||||
`NEXT_PUBLIC_DEPLOYMENT_URL=http://${backendDomain}`,
|
||||
`CONVEX_CLOUD_ORIGIN=http://${backendDomain}`,
|
||||
`CONVEX_SITE_ORIGIN=http://${actionsDomain}`,
|
||||
];
|
||||
const envs = [
|
||||
`NEXT_PUBLIC_DEPLOYMENT_URL=http://${backendDomain}`,
|
||||
`CONVEX_CLOUD_ORIGIN=http://${backendDomain}`,
|
||||
`CONVEX_SITE_ORIGIN=http://${actionsDomain}`,
|
||||
];
|
||||
|
||||
return { envs, domains };
|
||||
return { envs, domains };
|
||||
}
|
||||
|
@ -1619,4 +1619,3 @@ export const templates: TemplateData[] = [
|
||||
load: () => import("./wikijs/index").then((m) => m.generate),
|
||||
},
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user