Skip to content

Commit

Permalink
fix dashboard config reset
Browse files Browse the repository at this point in the history
Signed-off-by: Xuhui zhang <[email protected]>
  • Loading branch information
zxh326 committed Sep 5, 2024
1 parent 30540c6 commit 4ec8b19
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 4ec8b19

Please sign in to comment.