You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2024/01/19 03:47:20 UTC
(incubator-devlake) branch fix-be-plugin-unload created (now a86d67d2c)
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a change to branch fix-be-plugin-unload
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at a86d67d2c fix: be plugin unload error
This branch includes the following new commits:
new a86d67d2c fix: be plugin unload error
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-devlake) 01/01: fix: be plugin unload error
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a commit to branch fix-be-plugin-unload
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit a86d67d2c28be6a29617c376119a7267baef78d9
Author: mintsweet <0x...@gmail.com>
AuthorDate: Fri Jan 19 16:47:08 2024 +1300
fix: be plugin unload error
---
config-ui/src/api/plugin/index.ts | 5 +++++
config-ui/src/routes/layout/loader.ts | 16 ++++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/config-ui/src/api/plugin/index.ts b/config-ui/src/api/plugin/index.ts
index 4f6633b38..054c539e5 100644
--- a/config-ui/src/api/plugin/index.ts
+++ b/config-ui/src/api/plugin/index.ts
@@ -16,11 +16,16 @@
*
*/
+import { request } from '@/utils';
+
import * as jira from './jira';
import * as tapd from './tapd';
import * as webhook from './webhook';
+export const list = (): Promise<[{ plugin: string }]> => request('/plugins');
+
export const plugin = {
+ list,
jira,
tapd,
webhook,
diff --git a/config-ui/src/routes/layout/loader.ts b/config-ui/src/routes/layout/loader.ts
index 003db2041..2bba5a86a 100644
--- a/config-ui/src/routes/layout/loader.ts
+++ b/config-ui/src/routes/layout/loader.ts
@@ -16,6 +16,8 @@
*
*/
+import { intersection } from 'lodash';
+
import API from '@/api';
import { getRegisterPlugins } from '@/plugins';
@@ -24,19 +26,21 @@ type Props = {
};
export const layoutLoader = async ({ request }: Props) => {
- let plugins = [];
+ let fePlugins = getRegisterPlugins();
+ const bePlugins = await API.plugin.list();
try {
const envPlugins = import.meta.env.DEVLAKE_PLUGINS.split(',').filter(Boolean);
- plugins = getRegisterPlugins().filter((plugin) => !envPlugins.length || envPlugins.includes(plugin));
- } catch (err) {
- plugins = getRegisterPlugins();
- }
+ fePlugins = fePlugins.filter((plugin) => !envPlugins.length || envPlugins.includes(plugin));
+ } catch (err) {}
const res = await API.version(request.signal);
return {
version: res.version,
- plugins,
+ plugins: intersection(
+ fePlugins,
+ bePlugins.map((it) => it.plugin),
+ ),
};
};