Skip to content

Commit

Permalink
frontend: Add feature to view deploy logs
Browse files Browse the repository at this point in the history
This adds feature to view all the pods of pods in a deployment rather
than going to a specific pod.

Fixes: #2552

Signed-off-by: Kautilya Tripathi <[email protected]>
  • Loading branch information
knrt10 committed Dec 16, 2024
1 parent d94fde1 commit 7848c4f
Show file tree
Hide file tree
Showing 56 changed files with 706 additions and 23 deletions.
425 changes: 425 additions & 0 deletions frontend/src/components/common/Resource/LogsButton.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import ErrorBoundary from '../../ErrorBoundary';
import SectionHeader, { HeaderStyle } from '../../SectionHeader';
import DeleteButton from '../DeleteButton';
import EditButton from '../EditButton';
import { LogsButton } from '../LogsButton';
import { RestartButton } from '../RestartButton';
import ScaleButton from '../ScaleButton';

Expand Down Expand Up @@ -44,6 +45,9 @@ export function MainInfoHeader<T extends KubeObject>(props: MainInfoHeaderProps<
case DefaultHeaderAction.RESTART:
Action = RestartButton;
break;
case DefaultHeaderAction.DEPLOYMENT_LOGS:
Action = LogsButton;
break;
case DefaultHeaderAction.SCALE:
Action = ScaleButton;
break;
Expand Down Expand Up @@ -79,6 +83,9 @@ export function MainInfoHeader<T extends KubeObject>(props: MainInfoHeaderProps<
{
id: DefaultHeaderAction.RESTART,
},
{
id: DefaultHeaderAction.DEPLOYMENT_LOGS,
},
{
id: DefaultHeaderAction.SCALE,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/common/Resource/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ const checkExports = [
'SimpleEditor',
'ViewButton',
'AuthVisible',
'LogsButton',
];

function getFilesToVerify() {
const filesToVerify: string[] = [];
fs.readdirSync(__dirname).forEach(file => {
const fileNoSuffix = file.replace(/\.[^/.]+$/, '');
if (!avoidCheck.find(suffix => fileNoSuffix.endsWith(suffix))) {
if (!avoidCheck.find(suffix => fileNoSuffix.endsWith(suffix)) && fileNoSuffix) {
filesToVerify.push(fileNoSuffix);
}
});
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
2 changes: 1 addition & 1 deletion frontend/src/components/common/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function getFilesToVerify() {
const filesToVerify: string[] = [];
fs.readdirSync(__dirname).forEach(file => {
const fileNoSuffix = file.replace(/\.[^/.]+$/, '');
if (!avoidCheck.find(suffix => fileNoSuffix.endsWith(suffix))) {
if (!avoidCheck.find(suffix => fileNoSuffix.endsWith(suffix)) && fileNoSuffix) {
filesToVerify.push(fileNoSuffix);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
0
</div>
<div
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
/>
Expand Down
Loading

0 comments on commit 7848c4f

Please sign in to comment.