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/05/05 06:37:09 UTC

[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1813: feat: refactor Plugin Orchestration

juzhiyuan commented on a change in pull request #1813:
URL: https://github.com/apache/apisix-dashboard/pull/1813#discussion_r626287508



##########
File path: web/src/components/PluginFlow/PluginFlow.tsx
##########
@@ -0,0 +1,203 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React, { useEffect, useState } from 'react'
+import { Modal, Form, Input, Alert } from 'antd'
+import { Cell } from '@antv/x6'
+import { useIntl } from 'umi'
+
+import FlowGraph from './components/FlowGraph'
+import Toolbar from './components/Toolbar'
+import { DEFAULT_CONDITION_PROPS, DEFAULT_PLUGIN_PROPS, DEFAULT_STENCIL_WIDTH, DEFAULT_TOOLBAR_HEIGHT, FlowGraphEvent } from './constants'
+import styles from './style.less'
+import ConfigPanel from './components/ConfigPanel'
+import PluginDetail from '../Plugin/PluginDetail'
+import { fetchList } from '../Plugin/service'
+
+type Props = {
+  chart: {
+    cells: Cell.Properties[];
+  };
+  readonly?: boolean;
+}
+
+type PluginProps = {
+  id: string;
+  name: string;
+  visible: boolean;
+  data: any;
+}
+
+type ConditionProps = {
+  id: string;
+  visible: boolean;
+  data: string;
+}
+
+const PluginFlow: React.FC<Props> = ({ chart, readonly = false }) => {
+  const { formatMessage } = useIntl()
+
+  // NOTE: To prevent from graph is not initialized
+  const [isReady, setIsReady] = useState(false)
+  const [plugins, setPlugins] = useState<PluginComponent.Meta[]>([])
+
+  const [pluginProps, setPluginProps] = useState<PluginProps>(DEFAULT_PLUGIN_PROPS)
+  const [conditionProps, setConditionProps] = useState<ConditionProps>(DEFAULT_CONDITION_PROPS)
+
+  const getContainerSize = () => {

Review comment:
       ![image](https://user-images.githubusercontent.com/2106987/117104744-4301b700-adaf-11eb-869c-8e764b5af817.png)
   
   Hi @liuxiran, if we disable the right scrollbar, due to we have many plugins on the left, some of them cannot show completely.




-- 
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