Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
497 changes: 497 additions & 0 deletions frontend/src/components/common/Resource/LogsButton.tsx

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/src/components/common/Resource/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const checkExports = [
'SimpleEditor',
'ViewButton',
'AuthVisible',
'LogsButton',
];

function getFilesToVerify() {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/common/Resource/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export { default as ResourceTableColumnChooser } from './ResourceTableColumnChoo
export { addResourceTableColumnsProcessor } from './resourceTableSlice';
export * from './RestartButton';
export * from './ScaleButton';
export * from './LogsButton';
export { default as ScaleButton } from './ScaleButton';
export * from './SimpleEditor';
export { default as SimpleEditor } from './SimpleEditor';
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/components/workload/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ConditionsSection,
ContainersSection,
DetailsGrid,
LogsButton,
MetadataDictGrid,
OwnedPodsSection,
} from '../common/Resource';
Expand Down Expand Up @@ -85,6 +86,18 @@ export default function WorkloadDetails<T extends WorkloadClass>(props: Workload
name={name}
withEvents
namespace={namespace}
actions={item => {
if (!item) return [];
const isLoggable = ['Deployment', 'ReplicaSet', 'DaemonSet'].includes(workloadKind.kind);
if (!isLoggable) return [];

return [
{
id: 'logs',
action: <LogsButton key="logs" item={item} />,
},
];
}}
extraInfo={item =>
item && [
{
Expand Down
22 changes: 16 additions & 6 deletions frontend/src/i18n/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,22 @@
"Are you sure?": "Sind Sie sicher?",
"This will discard your changes in the editor. Do you want to proceed?": "Dadurch werden Ihre Änderungen im Editor verworfen. Möchten Sie fortfahren?",
"Undo Changes": "Änderungen rückgängig machen",
"No label selectors found for this {{type}}": "",
"Invalid response from server": "",
"Failed to fetch related pods": "",
"No pods found for this workload": "",
"Failed to fetch pods: {{error}}": "",
"Logs are paused. Click the follow button to resume following them.": "Ereignisprotokolle wurden angehalten. Klicken Sie auf die Schaltfläche \"Verfolgen\", um die Protokollanzeige fortzusetzen.",
"Select Pod": "",
"All Pods": "",
"Container": "",
"Restarted": "",
"Show logs for previous instances of this container.": "Ereignisprotokolle für frühere Instanzen dieses Containers anzeigen.",
"You can only select this option for containers that have been restarted.": "Sie können diese Option nur für Container wählen, die neu gestartet wurden.",
"Show previous": "Vorherige anzeigen",
"Timestamps": "Zeitstempel anzeigen",
"Follow": "Verfolgen",
"Show logs": "",
"Loading resource data": "Lade Ressourcendaten",
"Creation": "Erstellung",
"Labels": "Labels",
Expand Down Expand Up @@ -387,13 +403,7 @@
"None": "",
"Software": "Software",
"Redirecting to main page…": "Weiterleiten zur Hauptseite…",
"Logs are paused. Click the follow button to resume following them.": "Ereignisprotokolle wurden angehalten. Klicken Sie auf die Schaltfläche \"Verfolgen\", um die Protokollanzeige fortzusetzen.",
"Lines": "Zeilen",
"Show logs for previous instances of this container.": "Ereignisprotokolle für frühere Instanzen dieses Containers anzeigen.",
"You can only select this option for containers that have been restarted.": "Sie können diese Option nur für Container wählen, die neu gestartet wurden.",
"Show previous": "Vorherige anzeigen",
"Timestamps": "Zeitstempel anzeigen",
"Follow": "Verfolgen",
"Max Unavailable": "Max Nicht verfügbar",
"Min Available": "Min verfügbar",
"Allowed disruptions": "Erlaubte Unterbrechungen",
Expand Down
22 changes: 16 additions & 6 deletions frontend/src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,22 @@
"Are you sure?": "Are you sure?",
"This will discard your changes in the editor. Do you want to proceed?": "This will discard your changes in the editor. Do you want to proceed?",
"Undo Changes": "Undo Changes",
"No label selectors found for this {{type}}": "No label selectors found for this {{type}}",
"Invalid response from server": "Invalid response from server",
"Failed to fetch related pods": "Failed to fetch related pods",
"No pods found for this workload": "No pods found for this workload",
"Failed to fetch pods: {{error}}": "Failed to fetch pods: {{error}}",
"Logs are paused. Click the follow button to resume following them.": "Logs are paused. Click the follow button to resume following them.",
"Select Pod": "Select Pod",
"All Pods": "All Pods",
"Container": "Container",
"Restarted": "Restarted",
"Show logs for previous instances of this container.": "Show logs for previous instances of this container.",
"You can only select this option for containers that have been restarted.": "You can only select this option for containers that have been restarted.",
"Show previous": "Show previous",
"Timestamps": "Timestamps",
"Follow": "Follow",
"Show logs": "Show logs",
"Loading resource data": "Loading resource data",
"Creation": "Creation",
"Labels": "Labels",
Expand Down Expand Up @@ -387,13 +403,7 @@
"None": "None",
"Software": "Software",
"Redirecting to main page…": "Redirecting to main page…",
"Logs are paused. Click the follow button to resume following them.": "Logs are paused. Click the follow button to resume following them.",
"Lines": "Lines",
"Show logs for previous instances of this container.": "Show logs for previous instances of this container.",
"You can only select this option for containers that have been restarted.": "You can only select this option for containers that have been restarted.",
"Show previous": "Show previous",
"Timestamps": "Timestamps",
"Follow": "Follow",
"Max Unavailable": "Max Unavailable",
"Min Available": "Min Available",
"Allowed disruptions": "Allowed disruptions",
Expand Down
22 changes: 16 additions & 6 deletions frontend/src/i18n/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@
"Are you sure?": "¿Está seguro?",
"This will discard your changes in the editor. Do you want to proceed?": "Esto descartará sus cambios en el editor. ¿Desea avanzar?",
"Undo Changes": "Deshacer cambios",
"No label selectors found for this {{type}}": "",
"Invalid response from server": "",
"Failed to fetch related pods": "",
"No pods found for this workload": "",
"Failed to fetch pods: {{error}}": "",
"Logs are paused. Click the follow button to resume following them.": "Los registros están en pausa. Haga clic en el botón siguiente para continuar a seguirlos.",
"Select Pod": "",
"All Pods": "",
"Container": "",
"Restarted": "",
"Show logs for previous instances of this container.": "Mostrar registros para instancias anteriores de este contenedor.",
"You can only select this option for containers that have been restarted.": "Sólo podrá seleccionar esta opción para los contenedores que se han reiniciado.",
"Show previous": "Mostrar anteriores",
"Timestamps": "Marcas de tiempo",
"Follow": "Seguir",
"Show logs": "",
"Loading resource data": "Cargando datos del recurso",
"Creation": "Creación",
"Labels": "Etiquetas",
Expand Down Expand Up @@ -388,13 +404,7 @@
"None": "",
"Software": "Software",
"Redirecting to main page…": "Redireccionando a la página principal…",
"Logs are paused. Click the follow button to resume following them.": "Los registros están en pausa. Haga clic en el botón siguiente para continuar a seguirlos.",
"Lines": "Líneas",
"Show logs for previous instances of this container.": "Mostrar registros para instancias anteriores de este contenedor.",
"You can only select this option for containers that have been restarted.": "Sólo podrá seleccionar esta opción para los contenedores que se han reiniciado.",
"Show previous": "Mostrar anteriores",
"Timestamps": "Marcas de tiempo",
"Follow": "Seguir",
"Max Unavailable": "Máx. Disponible",
"Min Available": "Min. Disponible",
"Allowed disruptions": "Perturbaciones permitidas",
Expand Down
22 changes: 16 additions & 6 deletions frontend/src/i18n/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@
"Are you sure?": "Êtes-vous sûr ?",
"This will discard your changes in the editor. Do you want to proceed?": "Vos modifications seront perdues. Voulez-vous continuer ?",
"Undo Changes": "Annuler les modifications",
"No label selectors found for this {{type}}": "",
"Invalid response from server": "",
"Failed to fetch related pods": "",
"No pods found for this workload": "",
"Failed to fetch pods: {{error}}": "",
"Logs are paused. Click the follow button to resume following them.": "Les journaux sont en pause. Cliquez sur le bouton suivre pour reprendre leur suivi.",
"Select Pod": "",
"All Pods": "",
"Container": "",
"Restarted": "",
"Show logs for previous instances of this container.": "Afficher les journaux des instances précédentes de ce conteneur.",
"You can only select this option for containers that have been restarted.": "Vous ne pouvez sélectionner cette option que pour les conteneurs qui ont été redémarrés.",
"Show previous": "Montrer le précédent",
"Timestamps": "Horodatages",
"Follow": "Suivez",
"Show logs": "",
"Loading resource data": "Chargement des données sur les ressources",
"Creation": "Création",
"Labels": "Étiquettes",
Expand Down Expand Up @@ -388,13 +404,7 @@
"None": "",
"Software": "Logiciel",
"Redirecting to main page…": "Redirection vers la page principale…",
"Logs are paused. Click the follow button to resume following them.": "Les journaux sont en pause. Cliquez sur le bouton suivre pour reprendre leur suivi.",
"Lines": "Lignes",
"Show logs for previous instances of this container.": "Afficher les journaux des instances précédentes de ce conteneur.",
"You can only select this option for containers that have been restarted.": "Vous ne pouvez sélectionner cette option que pour les conteneurs qui ont été redémarrés.",
"Show previous": "Montrer le précédent",
"Timestamps": "Horodatages",
"Follow": "Suivez",
"Max Unavailable": "Max Indisponible",
"Min Available": "Min Disponible",
"Allowed disruptions": "Perturbations autorisées",
Expand Down
22 changes: 16 additions & 6 deletions frontend/src/i18n/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@
"Are you sure?": "Tem a certeza?",
"This will discard your changes in the editor. Do you want to proceed?": "Irá descartar as suas modificações no editor. Deseja prosseguir?",
"Undo Changes": "Desfazer modificações",
"No label selectors found for this {{type}}": "",
"Invalid response from server": "",
"Failed to fetch related pods": "",
"No pods found for this workload": "",
"Failed to fetch pods: {{error}}": "",
"Logs are paused. Click the follow button to resume following them.": "Os \"logs\" estão pausados. Clique no seguinte botão para voltar a segui-los.",
"Select Pod": "",
"All Pods": "",
"Container": "",
"Restarted": "",
"Show logs for previous instances of this container.": "Mostrar \"logs\" para instâncias anteriores deste \"container\".",
"You can only select this option for containers that have been restarted.": "Só pode escolher esta opção para \"containers\" que tenham sido reiniciados.",
"Show previous": "Mostrar anteriores",
"Timestamps": "Marcações de tempo",
"Follow": "Seguir",
"Show logs": "",
"Loading resource data": "A carregar dados do recurso",
"Creation": "Criação",
"Labels": "Etiquetas",
Expand Down Expand Up @@ -388,13 +404,7 @@
"None": "",
"Software": "Software",
"Redirecting to main page…": "A redireccionar para a página principal…",
"Logs are paused. Click the follow button to resume following them.": "Os \"logs\" estão pausados. Clique no seguinte botão para voltar a segui-los.",
"Lines": "Linhas",
"Show logs for previous instances of this container.": "Mostrar \"logs\" para instâncias anteriores deste \"container\".",
"You can only select this option for containers that have been restarted.": "Só pode escolher esta opção para \"containers\" que tenham sido reiniciados.",
"Show previous": "Mostrar anteriores",
"Timestamps": "Marcações de tempo",
"Follow": "Seguir",
"Max Unavailable": "Máx. Indisponíveis",
"Min Available": "Mín. Disponíveis",
"Allowed disruptions": "Perturbações permitidas",
Expand Down
22 changes: 16 additions & 6 deletions frontend/src/i18n/locales/zh-tw/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,22 @@
"Are you sure?": "您確定嗎?",
"This will discard your changes in the editor. Do you want to proceed?": "這將放棄您在編輯器中的更改。您要繼續嗎?",
"Undo Changes": "撤銷更改",
"No label selectors found for this {{type}}": "",
"Invalid response from server": "",
"Failed to fetch related pods": "",
"No pods found for this workload": "",
"Failed to fetch pods: {{error}}": "",
"Logs are paused. Click the follow button to resume following them.": "日誌已暫停。點擊跟隨按鈕以繼續跟隨它們。",
"Select Pod": "",
"All Pods": "",
"Container": "",
"Restarted": "",
"Show logs for previous instances of this container.": "顯示此容器先前實例的日誌。",
"You can only select this option for containers that have been restarted.": "您只能為已重啟的容器選擇此選項。",
"Show previous": "顯示先前",
"Timestamps": "時間戳",
"Follow": "跟隨",
"Show logs": "",
"Loading resource data": "讀取資源數據",
"Creation": "新增",
"Labels": "標籤",
Expand Down Expand Up @@ -386,13 +402,7 @@
"None": "無",
"Software": "軟體",
"Redirecting to main page…": "正在重定向到首頁…",
"Logs are paused. Click the follow button to resume following them.": "日誌已暫停。點擊跟隨按鈕以繼續跟隨它們。",
"Lines": "行",
"Show logs for previous instances of this container.": "顯示此容器先前實例的日誌。",
"You can only select this option for containers that have been restarted.": "您只能為已重啟的容器選擇此選項。",
"Show previous": "顯示先前",
"Timestamps": "時間戳",
"Follow": "跟隨",
"Max Unavailable": "最大不可用",
"Min Available": "最小可用",
"Allowed disruptions": "允許的中斷",
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/lib/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import CustomResourceDefinitionDetails from '../components/crd/Details';
import CustomResourceDefinitionList from '../components/crd/List';
import CronJobDetails from '../components/cronjob/Details';
import CronJobList from '../components/cronjob/List';
import DaemonSetDetails from '../components/daemonset/Details';
import DaemonSetList from '../components/daemonset/List';
import DeploymentsList from '../components/deployments/List';
import EndpointDetails from '../components/endpoints/Details';
Expand Down Expand Up @@ -76,7 +75,6 @@ import ServiceList from '../components/service/List';
import ServiceAccountDetails from '../components/serviceaccount/Details';
import ServiceAccountList from '../components/serviceaccount/List';
import { DefaultSidebars } from '../components/Sidebar';
import StatefulSetDetails from '../components/statefulset/Details';
import StatefulSetList from '../components/statefulset/List';
import PersistentVolumeClaimDetails from '../components/storage/ClaimDetails';
import PersistentVolumeClaimList from '../components/storage/ClaimList';
Expand All @@ -96,9 +94,11 @@ import helpers from '../helpers';
import LocaleSelect from '../i18n/LocaleSelect/LocaleSelect';
import store from '../redux/stores/store';
import { useCluster } from './k8s';
import DaemonSet from './k8s/daemonSet';
import Deployment from './k8s/deployment';
import Job from './k8s/job';
import ReplicaSet from './k8s/replicaSet';
import StatefulSet from './k8s/statefulSet';
import { getCluster, getClusterPrefixedPath } from './util';

export interface Route {
Expand Down Expand Up @@ -232,13 +232,13 @@ const defaultRoutes: {
path: '/daemonsets/:namespace/:name',
exact: true,
sidebar: 'DaemonSets',
component: () => <DaemonSetDetails />,
component: () => <WorkloadDetails workloadKind={DaemonSet} />,
},
StatefulSet: {
path: '/statefulsets/:namespace/:name',
exact: true,
sidebar: 'StatefulSets',
component: () => <StatefulSetDetails />,
component: () => <WorkloadDetails workloadKind={StatefulSet} />,
},
Deployment: {
path: '/deployments/:namespace/:name',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/plugin/__snapshots__/pluginLib.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"Link": [Function],
"Loader": [Function],
"LogViewer": [Function],
"LogsButton": [Function],
"MatchExpressions": [Function],
"MetadataDictGrid": [Function],
"MetadataDisplay": [Function],
Expand All @@ -77,6 +78,7 @@
"DocsViewer": [Function],
"EditButton": [Function],
"EditorDialog": [Function],
"LogsButton": [Function],
"MatchExpressions": [Function],
"MetadataDictGrid": [Function],
"MetadataDisplay": [Function],
Expand Down
Loading