Skip to content

Commit

Permalink
fix dashboard config reset (#1110)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuhui zhang <[email protected]>
  • Loading branch information
zxh326 authored Sep 5, 2024
1 parent 30540c6 commit 04c540b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dashboard-ui-v2/src/components/config-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ const ConfigModal: React.FC<{
onClick={() => {
mutate()
if (data?.data) {
setConfig(
YAML.stringify(data?.data?.['config.yaml'])
.split('\n')
.slice(1)
.join('\n'),
)
try {
setConfig(
YAML.stringify(YAML.parse(data?.data?.['config.yaml'])),
)
} catch (e) {
setConfig((e as YAMLParseError).message)
}
setUpdated(false)
}
}}
Expand Down

0 comments on commit 04c540b

Please sign in to comment.