vmui/logs: update footer links (#6498)

### Describe Your Changes
Update the links in the footer for logs:
[LogsQL](https://docs.victoriametrics.com/victorialogs/logsql/) and
[Documentation](https://docs.victoriametrics.com/victorialogs/)

(cherry picked from commit 13e3bb88a9)
This commit is contained in:
Yury Molodov 2024-06-18 15:25:32 +02:00 committed by hagen1778
parent 36f6a08f07
commit 5e8e89f22d
No known key found for this signature in database
GPG Key ID: 3BF75F3741CA9640
3 changed files with 60 additions and 30 deletions

View File

@ -0,0 +1,35 @@
import { CodeIcon, IssueIcon, WikiIcon } from "../components/Main/Icons";
const issueLink = {
href: "https://github.com/VictoriaMetrics/VictoriaMetrics/issues/new/choose",
Icon: IssueIcon,
title: "Create an issue",
};
export const footerLinksByDefault = [
{
href: "https://docs.victoriametrics.com/MetricsQL.html",
Icon: CodeIcon,
title: "MetricsQL",
},
{
href: "https://docs.victoriametrics.com/#vmui",
Icon: WikiIcon,
title: "Documentation",
},
issueLink
];
export const footerLinksToLogs = [
{
href: "https://docs.victoriametrics.com/victorialogs/logsql/",
Icon: CodeIcon,
title: "LogsQL",
},
{
href: "https://docs.victoriametrics.com/victorialogs/",
Icon: WikiIcon,
title: "Documentation",
},
issueLink
];

View File

@ -1,8 +1,17 @@
import React, { FC, memo } from "preact/compat";
import { CodeIcon, IssueIcon, LogoShortIcon, WikiIcon } from "../../components/Main/Icons";
import { LogoShortIcon } from "../../components/Main/Icons";
import "./style.scss";
import { footerLinksByDefault } from "../../constants/footerLinks";
const Footer: FC = memo(() => {
interface Props {
links?: {
href: string;
Icon: FC;
title: string;
}[]
}
const Footer: FC<Props> = memo(({ links = footerLinksByDefault }) => {
const copyrightYears = `2019-${new Date().getFullYear()}`;
return <footer className="vm-footer">
@ -15,33 +24,18 @@ const Footer: FC = memo(() => {
<LogoShortIcon/>
victoriametrics.com
</a>
<a
className="vm-link vm-footer__link"
target="_blank"
href="https://docs.victoriametrics.com/MetricsQL.html"
rel="help noreferrer"
>
<CodeIcon/>
MetricsQL
</a>
<a
className="vm-link vm-footer__link"
target="_blank"
href="https://docs.victoriametrics.com/#vmui"
rel="help noreferrer"
>
<WikiIcon/>
Documentation
</a>
<a
className="vm-link vm-footer__link"
target="_blank"
href="https://github.com/VictoriaMetrics/VictoriaMetrics/issues/new/choose"
rel="noreferrer"
>
<IssueIcon/>
Create an issue
</a>
{links.map(({ href, Icon, title }) => (
<a
className="vm-link vm-footer__link"
target="_blank"
href={href}
rel="help noreferrer"
key={`${href}-${title}`}
>
<Icon/>
{title}
</a>
))}
<div className="vm-footer__copyright">
&copy; {copyrightYears} VictoriaMetrics
</div>

View File

@ -9,6 +9,7 @@ import router, { routerOptions } from "../../router";
import useDeviceDetect from "../../hooks/useDeviceDetect";
import ControlsLogsLayout from "./ControlsLogsLayout";
import useFetchDefaultTimezone from "../../hooks/useFetchDefaultTimezone";
import { footerLinksToLogs } from "../../constants/footerLinks";
const LogsLayout: FC = () => {
const appModeEnable = getAppModeEnable();
@ -36,7 +37,7 @@ const LogsLayout: FC = () => {
>
<Outlet/>
</div>
{!appModeEnable && <Footer/>}
{!appModeEnable && <Footer links={footerLinksToLogs}/>}
</section>;
};