Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Clutch
Commits
2a61021d
Unverified
Commit
2a61021d
authored
2 years ago
by
Shawna Monero
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
FE: add ability to download envoy config dump (#2367)
parent
16d1aff0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/workflows/envoy/package.json
+1
-0
frontend/workflows/envoy/package.json
frontend/workflows/envoy/src/remote-triage/index.tsx
+16
-1
frontend/workflows/envoy/src/remote-triage/index.tsx
frontend/yarn.lock
+5
-0
frontend/yarn.lock
with
22 additions
and
1 deletion
+22
-1
frontend/workflows/envoy/package.json
+
1
-
0
View file @
2a61021d
...
...
@@ -27,6 +27,7 @@
"@clutch-sh/data-layout"
:
"^2.0.0-beta"
,
"@clutch-sh/wizard"
:
"^2.0.0-beta"
,
"@mui/material"
:
"^5.8.5"
,
"file-saver"
:
"^2.0.5"
,
"lodash"
:
"^4.17.15"
,
"react"
:
"^17.0.2"
,
"react-dom"
:
"^17.0.2"
,
...
...
This diff is collapsed.
Click to expand it.
frontend/workflows/envoy/src/remote-triage/index.tsx
+
16
-
1
View file @
2a61021d
...
...
@@ -13,6 +13,7 @@ import {
import
{
useDataLayout
}
from
"
@clutch-sh/data-layout
"
;
import
type
{
WizardChild
}
from
"
@clutch-sh/wizard
"
;
import
{
Wizard
,
WizardStep
}
from
"
@clutch-sh/wizard
"
;
import
FileSaver
from
"
file-saver
"
;
import
type
{
TriageChild
,
WorkflowProps
}
from
"
../index
"
;
...
...
@@ -59,10 +60,17 @@ const TriageIdentifier: React.FC<TriageChild> = ({ host = "" }) => {
);
};
// This function is here for downloading the envoy config dump.
const
download
=
(
data
,
host
)
=>
{
const
output
=
new
Blob
([
JSON
.
stringify
(
data
,
null
,
"
\t
"
)]);
const
timestamp
=
Date
.
now
();
FileSaver
.
saveAs
(
output
,
`envoy_config_dump_
${
host
}
_
${
timestamp
}
.json`
);
};
const
TriageDetails
:
React
.
FC
<
WizardChild
>
=
()
=>
{
const
remoteData
=
useDataLayout
(
"
remoteData
"
);
const
metadata
=
remoteData
.
value
.
nodeMetadata
as
IClutch
.
envoytriage
.
v1
.
NodeMetadata
;
const
{
clusters
,
listeners
,
runtime
,
stats
,
serverInfo
}
=
const
{
clusters
,
configDump
,
listeners
,
runtime
,
stats
,
serverInfo
}
=
(
remoteData
.
value
?.
output
as
IClutch
.
envoytriage
.
v1
.
Result
.
Output
)
||
{};
const
failingClusterCount
=
clusters
?.
clusterStatuses
.
filter
(
...
...
@@ -88,6 +96,7 @@ const TriageDetails: React.FC<WizardChild> = () => {
{
name
:
"
Runtime Keys
"
,
value
:
runtime
?.
entries
?.
length
||
0
},
{
name
:
"
Stats
"
,
value
:
stats
?.
stats
?.
length
||
0
},
];
return
(
<
WizardStep
error
=
{
remoteData
.
error
}
isLoading
=
{
remoteData
.
isLoading
}
>
<
MetadataTable
...
...
@@ -101,6 +110,12 @@ const TriageDetails: React.FC<WizardChild> = () => {
{
name
:
"
Service Cluster
"
,
value
:
metadata
?.
serviceCluster
},
]
}
/>
<
Button
text
=
"Download Config Dump"
onClick
=
{
()
=>
{
download
(
configDump
?.
value
,
remoteData
.
value
.
address
?.
host
);
}
}
/>
<
Tabs
>
<
Tab
label
=
"Dashboard"
>
<
Dashboard
...
...
This diff is collapsed.
Click to expand it.
frontend/yarn.lock
+
5
-
0
View file @
2a61021d
...
...
@@ -11908,6 +11908,11 @@ file-loader@^6.2.0:
loader-utils "^2.0.0"
schema-utils "^3.0.0"
file-saver@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.5.tgz#d61cfe2ce059f414d899e9dd6d4107ee25670c38"
integrity sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==
file-system-cache@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/file-system-cache/-/file-system-cache-1.0.5.tgz#84259b36a2bbb8d3d6eb1021d3132ffe64cfff4f"
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help