You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/03/03 17:39:25 UTC

[GitHub] [apisix-dashboard] liuxiran commented on a change in pull request #1490: feat: support yaml to config plugin in plugin config page

liuxiran commented on a change in pull request #1490:
URL: https://github.com/apache/apisix-dashboard/pull/1490#discussion_r586634700



##########
File path: web/src/helpers.tsx
##########
@@ -130,3 +132,20 @@ export const timestampToLocaleString = (timestamp: number) => {
 
   return moment.unix(timestamp).format('YYYY-MM-DD HH:mm:ss');
 };
+
+/**
+ * Transform json string to yaml string
+ * @param jsonStr
+ */
+export const json2yaml = (jsonStr: string): string => {
+  return yaml.dump(JSON.parse(jsonStr))

Review comment:
       thanks a lot, already fixed.
   
   use `try...catch` to handle the exception




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org