Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@evilemon/lowcode-plugin-datasource-pane
Advanced tools
配置页面的数据源。
一个 pluginProps 的例子
{
importPlugins: [],
exportPlugins: [],
formComponents: {},
tagSelector: () => {},
dataSourceTypes: [
{
type: 'mopen',
schema: {
type: 'object',
properties: {
options: {
type: 'object',
properties: {
uri: {
title: 'api',
},
v: {
title: 'v',
type: 'string',
},
appKey: {
title: 'appKey',
type: 'string',
},
},
},
},
},
},
],
}
使用预置的数据源类型
import {
DataSourceTypeFetch,
DataSourceTypeJsonp,
DataSourceTypeMtop,
} from '@alilc/lowcode-plugin-datasource-pane';
内置 fetch,mtop,jsonp 类型,支持传入自定义类型。
type DataSourceType = {
type: string;
optionsSchema: JSONSchema6
};
数据源类型需要在集团规范约束下扩展。目前只允许在 options 下添加扩展字段。
比如 mtop 类型,需要添加 options.v (版本)字段。
通过 renderDataSourceInfoTags 方法控制数据源的信息展示
(dataSourceConfig) => {
if (dataSourceConfig.type = 'fetch') {
return [{
type: 'primary',
content: dataSourceConfig.type
}];
}
}
导入组件引入方式参考 pluginProps
import { DataSourceImportPluginTest } from './DataSourceImportPluginTest';
{
...
importPlugins: [
{
name: '这里可以导入',
title: '这里可以导入',
component: DataSourceImportPluginTest,
componentProps: {
onImport: (res) => {
console.log('ceshi ')
},
onCancel: () => {
console.log('ceshi2 ')
}
}
}
],
exportPlugins: [],
formComponents: { },
...
}
// DataSourceImportPluginTest.jsx
/**
* 源码导入插件
* @todo editor 关联 types,并提供详细的出错信息
*/
import React, { PureComponent } from 'react';
import { Button } from '@alifd/next';
import _noop from 'lodash/noop';
import _isArray from 'lodash/isArray';
import _last from 'lodash/last';
import _isPlainObject from 'lodash/isPlainObject';
import { RuntimeDataSourceConfig as DataSourceConfig } from '@alilc/lowcode-datasource-types';
import { JSONSchema6 } from 'json-schema';
import type { ComponentType } from 'react';
export interface DataSourceType {
type: string;
schema: JSONSchema6;
plugin?: ComponentType;
}
export interface DataSourcePaneImportPluginComponentProps {
dataSourceTypes: DataSourceType[];
onImport?: (dataSourceList: DataSourceConfig[]) => void;
onCancel?: () => void;
}
export interface DataSourceImportPluginCodeProps
extends DataSourcePaneImportPluginComponentProps {
defaultValue?: DataSourceConfig[];
}
export interface DataSourceImportPluginCodeState {
code: string;
isCodeValid: boolean;
}
export class DataSourceImportPluginCode extends PureComponent<
DataSourceImportPluginCodeProps,
DataSourceImportPluginCodeState
> {
handleComplete = () => {
console.log('确认')
};
onCancel = () => {
console.log('取消')
};
render() {
return (
<div className="lowcode-plugin-datasource-import-plugin-code">
此处代码可以自定义
<p className="btns">
<Button onClick={this.onCancel}>取消</Button>
<Button type="primary" onClick={this.handleComplete}>
确认
</Button>
</p>
</div>
);
}
}
具体的 component 可参考 DataSourceImportPluginCode 查看
demo 截图
WIP
欢迎提 MR
FAQs
The npm package @evilemon/lowcode-plugin-datasource-pane receives a total of 2 weekly downloads. As such, @evilemon/lowcode-plugin-datasource-pane popularity was classified as not popular.
We found that @evilemon/lowcode-plugin-datasource-pane demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.