-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Florian Renaut <[email protected]>
- Loading branch information
Showing
19 changed files
with
795 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/manager/apps/pci-load-balancer/public/translations/logs/Messages_de_DE.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"see_more_label": "Mehr erfahren", | ||
"octavia_load_balancer_logs_breadcrumb_label": "Logs", | ||
"octavia_load_balancer_logs_main_description": "Im Folgenden finden Sie die Logs Ihres Loadbalancers für TCP-, HTTP-, HTTPS- und TERMINATED_HTTPS-Listener (UDP wird nicht unterstützt). Diese Logs werden von der Open-Source-Komponente HAProxy generiert.", | ||
"octavia_load_balancer_data_streams_description_haproxy": "Wenn Sie die HAProxy-Logs Ihres Loadbalancers abonnieren, werden sie auf die Logs Data Platform übertragen. Sie können sie mit Ihren anderen Logs zentralisieren, erweiterte Suchvorgänge durchführen, ihre Aufbewahrung verwalten, Alarme definieren und Dashboards erstellen, um Ihre Anwendungen mit Loadbalancer zu überwachen." | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/manager/apps/pci-load-balancer/public/translations/logs/Messages_en_GB.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"see_more_label": "Find out more", | ||
"octavia_load_balancer_logs_breadcrumb_label": "Logs", | ||
"octavia_load_balancer_logs_main_description": "Below are the logs for your load balancer, separated into categories such as TCP, HTTP, HTTPS, and TERMINATED_HTTPS (please note that UDP is not supported). These logs are those generated by the HAProxy OpenSource component.", | ||
"octavia_load_balancer_data_streams_description_haproxy": "By subscribing to your Load Balancer’s haproxy logs, they will be seamlessly transferred to the Logs Data Platform. You can centralise them with your other logs, conduct advanced searches, manage their retention, set alerts, and set up dashboards to monitor your applications using Load Balancers." | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/manager/apps/pci-load-balancer/public/translations/logs/Messages_es_ES.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"see_more_label": "Más información", | ||
"octavia_load_balancer_logs_breadcrumb_label": "Logs", | ||
"octavia_load_balancer_logs_main_description": "A continuación encontrará los logs de su Load Balancer para los «listeners» de tipo TCP, HTTP, HTTPS y TERMINATED_HTTPS (UDP no es compatible). Estos son los logs generados por el componente open source HAProxy.", | ||
"octavia_load_balancer_data_streams_description_haproxy": "Al suscribirse a los logs HAProxy de su Load Balancer, estos registros se transferirán a Logs Data Platform, desde donde podrá gestionarlos de forma centralizada junto con el resto de sus logs. Además, podrá realizar búsquedas más avanzadas, gestionar sus retenciones, definir alertas y «dashboards» para monitorizar sus aplicaciones que utilizan Load Balancers." | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/manager/apps/pci-load-balancer/public/translations/logs/Messages_fr_CA.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"see_more_label": "En savoir plus", | ||
"octavia_load_balancer_logs_breadcrumb_label": "Logs", | ||
"octavia_load_balancer_logs_main_description": "Vous trouverez ci-dessous les logs de votre load balancer pour les listeners de type TCP, HTTP, HTTPS & TERMINATED_HTTPS (UDP n'est pas supporté). Ces logs sont ceux générés par le composant OpenSource HAProxy.", | ||
"octavia_load_balancer_data_streams_description_haproxy": "En vous abonnant aux logs haproxy de votre Load Balancer, ils seront transférés dans Logs Data Platform et vous pourrez les centraliser avec vos autres logs, effectuer des recherches avancées, gérer leurs rétentions, définir des alertes ainsi que des tableaux de bord pour observer vos applications utilisant des Load Balancers." | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/manager/apps/pci-load-balancer/public/translations/logs/Messages_fr_FR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"see_more_label": "En savoir plus", | ||
"octavia_load_balancer_logs_breadcrumb_label": "Logs", | ||
"octavia_load_balancer_logs_main_description": "Vous trouverez ci-dessous les logs de votre load balancer pour les listeners de type TCP, HTTP, HTTPS & TERMINATED_HTTPS (UDP n'est pas supporté). Ces logs sont ceux générés par le composant OpenSource HAProxy.", | ||
"octavia_load_balancer_data_streams_description_haproxy": "En vous abonnant aux logs haproxy de votre Load Balancer, ils seront transférés dans Logs Data Platform et vous pourrez les centraliser avec vos autres logs, effectuer des recherches avancées, gérer leurs rétentions, définir des alertes ainsi que des tableaux de bord pour observer vos applications utilisant des Load Balancers." | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/manager/apps/pci-load-balancer/public/translations/logs/Messages_it_IT.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"see_more_label": "Scopri di più", | ||
"octavia_load_balancer_logs_breadcrumb_label": "Log", | ||
"octavia_load_balancer_logs_main_description": "Qui sotto sono disponibili i log del tuo Load Balancer per i listener di tipo TCP, HTTP, HTTPS & TERMINATED_HTTPS (UDP non supportato). Questi log sono quelli generati dal componente OpenSource HAProxy.", | ||
"octavia_load_balancer_data_streams_description_haproxy": "Abbonandoti ai log haproxy del tuo Load Balancer, saranno trasferiti in Logs Data Platform e potrai centralizzarli con altri log, effettuare ricerche avanzate, gestire la loro retention, definire allarmi e creare dashboard per osservare le applicazioni che utilizzano i Load Balancer." | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/manager/apps/pci-load-balancer/public/translations/logs/Messages_pl_PL.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"see_more_label": "Dowiedz się więcej", | ||
"octavia_load_balancer_logs_breadcrumb_label": "Logi", | ||
"octavia_load_balancer_logs_main_description": "Poniżej znajdziesz logi Load Balancera dla nasłuchów TCP, HTTP, HTTPS i TERMINATED_HTTPS (UDP nie jest obsługiwany). Logi te są generowane przez komponent OpenSource HAProxy.", | ||
"octavia_load_balancer_data_streams_description_haproxy": "Po tym, jak zasubskrybujesz logi haproxy Load Balancera, zostaną one przeniesione do Logs Data Platform. Będziesz mógł je scentralizować z innymi logami, uruchamiać zaawansowane wyszukiwanie, zarządzać retencją, definiować alerty oraz dashboardy umożliwiające obserwację aplikacji korzystających z Load Balancerów." | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/manager/apps/pci-load-balancer/public/translations/logs/Messages_pt_PT.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"see_more_label": "Saber mais", | ||
"octavia_load_balancer_logs_breadcrumb_label": "Logs", | ||
"octavia_load_balancer_logs_main_description": "Encontrará abaixo os logs do seu Load Balancer para os “listeners” de tipo TCP, HTTP, HTTPS e TERMINATED_HTTPS (UDP não é suportado). Estes são os logs gerados pelo componente open source HAProxy.", | ||
"octavia_load_balancer_data_streams_description_haproxy": "Ao subscrever os logs HAProxy do seu Load Balancer, estes registos serão transferidos para o Logs Data Platform, de onde poderá geri-los de forma centralizada com os seus outros logs. Além disso, poderá efetuar pesquisas mais avançadas, gerir as suas retenções, definir alertas, bem como painéis de controlo para monitorizar as aplicações que utilizam Load Balancers." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 77 additions & 2 deletions
79
packages/manager/apps/pci-load-balancer/src/pages/detail/log/Log.page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,78 @@ | ||
export default function Log() { | ||
return <div>Log Page</div>; | ||
import { useState } from 'react'; | ||
import { clsx } from 'clsx'; | ||
import { OsdsIcon, OsdsLink, OsdsText } from '@ovhcloud/ods-components/react'; | ||
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; | ||
import { | ||
ODS_ICON_NAME, | ||
ODS_ICON_SIZE, | ||
ODS_TEXT_LEVEL, | ||
ODS_TEXT_SIZE, | ||
} from '@ovhcloud/ods-components'; | ||
import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core'; | ||
import { LogTiles } from '@ovh-ux/manager-pci-common'; | ||
import { Notifications, useMe } from '@ovh-ux/manager-react-components'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { useParams } from 'react-router-dom'; | ||
import { LOAD_BALANCER_LOGS_SERVICE_GUIDE_LINK } from '@/constants'; | ||
|
||
export default function LogsPage() { | ||
const { t } = useTranslation('logs'); | ||
const { projectId, region, loadBalancerId } = useParams(); | ||
const [isFullscreen, setIsFullscreen] = useState(false); | ||
const ovhSubsidiary = useMe()?.me?.ovhSubsidiary; | ||
const infoLink = | ||
LOAD_BALANCER_LOGS_SERVICE_GUIDE_LINK[ovhSubsidiary] || | ||
LOAD_BALANCER_LOGS_SERVICE_GUIDE_LINK.DEFAULT; | ||
|
||
return ( | ||
<> | ||
<Notifications /> | ||
<OsdsText | ||
size={ODS_TEXT_SIZE._400} | ||
level={ODS_TEXT_LEVEL.body} | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
> | ||
{t('octavia_load_balancer_logs_main_description')}{' '} | ||
</OsdsText> | ||
<OsdsLink | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
href={infoLink} | ||
target={OdsHTMLAnchorElementTarget._blank} | ||
> | ||
{t('see_more_label')} | ||
<span slot="end"> | ||
<OsdsIcon | ||
aria-hidden="true" | ||
className="ml-4" | ||
name={ODS_ICON_NAME.EXTERNAL_LINK} | ||
hoverable | ||
size={ODS_ICON_SIZE.xxs} | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
/> | ||
</span> | ||
</OsdsLink> | ||
<div | ||
className={clsx( | ||
'flex mt-4 md:h-[600px]', | ||
isFullscreen ? 'flex-col' : 'flex-col md:flex-row', | ||
)} | ||
> | ||
<div className={clsx(isFullscreen || 'w-full md:w-[68%] h-full')}></div> | ||
|
||
<div | ||
className={clsx( | ||
isFullscreen || | ||
'w-full md:w-[32%] h-full overflow-y-auto mt-4 md:mt-0 ml-0 md:ml-4', | ||
'min-h-0', | ||
)} | ||
> | ||
<LogTiles | ||
logsApiURL={`/cloud/project/${projectId}/region/${region}/loadbalancing/loadbalancer/${loadBalancerId}/log`} | ||
logsKind="haproxy" | ||
onGotoStreams={() => console.log('TODO')} | ||
/> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
|
82 changes: 82 additions & 0 deletions
82
packages/manager/modules/manager-pci-common/src/api/data/logs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { Filter, fetchIcebergV6, v6 } from '@ovh-ux/manager-core-api'; | ||
import { PaginationState } from '@ovh-ux/manager-react-components'; | ||
|
||
export type TDbaasLog = { | ||
createdAt: string; | ||
displayName?: string; | ||
iam?: { | ||
displayName?: string; | ||
id: string; | ||
tags?: Record<string, string>; | ||
urn: string; | ||
}; | ||
isClusterOwner: boolean; | ||
plan: 'ENTERPRISE' | 'STANDARD'; | ||
serviceName: string; | ||
state: 'DISABLED' | 'ENABLED' | 'INIT' | 'TO_CONFIG'; | ||
updatedAt?: string; | ||
username: string; | ||
}; | ||
|
||
export async function getDbaasLogs() { | ||
const { data } = await fetchIcebergV6<TDbaasLog>({ | ||
route: `/dbaas/logs`, | ||
disableCache: true, | ||
}); | ||
return data; | ||
} | ||
|
||
export type TDbaasStream = { | ||
canAlert: boolean; | ||
clusterId: string; | ||
createdAt: string; | ||
description: string; | ||
isEditable: boolean; | ||
title: string; | ||
updatedAt: string; | ||
retentionId: string; | ||
streamId: string; | ||
indexingEnabled: boolean; | ||
nbSubscription: number; | ||
}; | ||
|
||
export async function getStream(serviceName: string, streamId: string) { | ||
const { data } = await v6.get<TDbaasStream>( | ||
`/dbaas/logs/${serviceName}/output/graylog/stream/${streamId}`, | ||
); | ||
return data; | ||
} | ||
|
||
export async function getStreamsIds(serviceName: string) { | ||
const { data } = await v6.get<TDbaasStream>( | ||
`/dbaas/logs/${serviceName}/output/graylog/stream`, | ||
); | ||
return data; | ||
} | ||
|
||
export async function getStreams( | ||
serviceName: string, | ||
pagination: PaginationState, | ||
filters: Filter[], | ||
) { | ||
const { data, totalCount } = await fetchIcebergV6<TDbaasStream>({ | ||
route: `/dbaas/logs/${serviceName}/output/graylog/stream`, | ||
page: pagination.pageIndex, | ||
pageSize: pagination.pageSize, | ||
filters, | ||
disableCache: true, | ||
}); | ||
return { data, totalCount }; | ||
} | ||
|
||
export type TStreamURL = { | ||
address: string; | ||
type: string; | ||
}; | ||
|
||
export async function getStreamURL(serviceName: string, streamId: string) { | ||
const { data } = await v6.get<TStreamURL[]>( | ||
`/dbaas/logs/${serviceName}/output/graylog/stream/${streamId}/url`, | ||
); | ||
return data; | ||
} |
Oops, something went wrong.