@tachybase/plugin-block-charts 0.23.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -0
- package/README.md +88 -0
- package/client.d.ts +3 -0
- package/client.js +65 -0
- package/dist/client/block/ChartBlock.d.ts +2 -0
- package/dist/client/block/ChartBlockDesigner.d.ts +2 -0
- package/dist/client/block/ChartBlockInitializer.d.ts +4 -0
- package/dist/client/block/ChartDataProvider.d.ts +16 -0
- package/dist/client/block/formatters.d.ts +15 -0
- package/dist/client/block/index.d.ts +3 -0
- package/dist/client/block/transformers.d.ts +10 -0
- package/dist/client/chart/antd/GroupedTable.d.ts +6 -0
- package/dist/client/chart/antd/antd.d.ts +7 -0
- package/dist/client/chart/antd/index.d.ts +5 -0
- package/dist/client/chart/antd/statistic.d.ts +7 -0
- package/dist/client/chart/antd/table.d.ts +6 -0
- package/dist/client/chart/chart.d.ts +77 -0
- package/dist/client/chart/configs.d.ts +79 -0
- package/dist/client/chart/g2plot/AntChart.d.ts +2 -0
- package/dist/client/chart/g2plot/bar.d.ts +6 -0
- package/dist/client/chart/g2plot/configs.d.ts +40 -0
- package/dist/client/chart/g2plot/dualAxes.d.ts +7 -0
- package/dist/client/chart/g2plot/g2plot.d.ts +10 -0
- package/dist/client/chart/g2plot/index.d.ts +3 -0
- package/dist/client/chart/g2plot/pie.d.ts +7 -0
- package/dist/client/chart/group.d.ts +32 -0
- package/dist/client/configure/ChartConfigProvider.d.ts +18 -0
- package/dist/client/configure/ChartConfigure.d.ts +18 -0
- package/dist/client/configure/FilterDynamicComponent.d.ts +2 -0
- package/dist/client/configure/index.d.ts +2 -0
- package/dist/client/configure/schemas/configure.d.ts +4 -0
- package/dist/client/filter/CollectionFieldInitializer.d.ts +2 -0
- package/dist/client/filter/FilterActionInitializers.d.ts +15 -0
- package/dist/client/filter/FilterBlockDesigner.d.ts +2 -0
- package/dist/client/filter/FilterBlockInitializer.d.ts +3 -0
- package/dist/client/filter/FilterBlockProvider.d.ts +2 -0
- package/dist/client/filter/FilterCheckbox.d.ts +2 -0
- package/dist/client/filter/FilterForm.d.ts +2 -0
- package/dist/client/filter/FilterItemDesigner.d.ts +2 -0
- package/dist/client/filter/FilterItemInitializers.d.ts +7 -0
- package/dist/client/filter/FilterProvider.d.ts +30 -0
- package/dist/client/filter/FilterVariableInput.d.ts +2 -0
- package/dist/client/filter/index.d.ts +6 -0
- package/dist/client/filter/utils.d.ts +59 -0
- package/dist/client/hooks/filter.d.ts +225 -0
- package/dist/client/hooks/index.d.ts +4 -0
- package/dist/client/hooks/query.d.ts +52 -0
- package/dist/client/hooks/transformer.d.ts +12 -0
- package/dist/client/hooks/useDateVariable.d.ts +14 -0
- package/dist/client/hooks/useUserVariable.d.ts +8 -0
- package/dist/client/hooks/useVariableOptions.d.ts +10 -0
- package/dist/client/index.d.ts +13 -0
- package/dist/client/index.js +234 -0
- package/dist/client/locale/index.d.ts +3 -0
- package/dist/client/renderer/ChartRenderer.d.ts +4 -0
- package/dist/client/renderer/ChartRendererProvider.d.ts +49 -0
- package/dist/client/renderer/index.d.ts +2 -0
- package/dist/client/utils.d.ts +44 -0
- package/dist/externalVersion.js +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +89 -0
- package/dist/locale/ko_KR.json +85 -0
- package/dist/locale/zh-CN.json +90 -0
- package/dist/node_modules/fs-extra/LICENSE +15 -0
- package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +161 -0
- package/dist/node_modules/fs-extra/lib/copy/copy.js +177 -0
- package/dist/node_modules/fs-extra/lib/copy/index.js +7 -0
- package/dist/node_modules/fs-extra/lib/empty/index.js +39 -0
- package/dist/node_modules/fs-extra/lib/ensure/file.js +66 -0
- package/dist/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/dist/node_modules/fs-extra/lib/ensure/link.js +64 -0
- package/dist/node_modules/fs-extra/lib/ensure/symlink-paths.js +101 -0
- package/dist/node_modules/fs-extra/lib/ensure/symlink-type.js +34 -0
- package/dist/node_modules/fs-extra/lib/ensure/symlink.js +67 -0
- package/dist/node_modules/fs-extra/lib/fs/index.js +140 -0
- package/dist/node_modules/fs-extra/lib/index.js +1 -0
- package/dist/node_modules/fs-extra/lib/json/index.js +16 -0
- package/dist/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
- package/dist/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
- package/dist/node_modules/fs-extra/lib/json/output-json.js +12 -0
- package/dist/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/dist/node_modules/fs-extra/lib/mkdirs/make-dir.js +27 -0
- package/dist/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
- package/dist/node_modules/fs-extra/lib/move/index.js +7 -0
- package/dist/node_modules/fs-extra/lib/move/move-sync.js +55 -0
- package/dist/node_modules/fs-extra/lib/move/move.js +59 -0
- package/dist/node_modules/fs-extra/lib/output-file/index.js +31 -0
- package/dist/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/dist/node_modules/fs-extra/lib/remove/index.js +17 -0
- package/dist/node_modules/fs-extra/lib/util/stat.js +158 -0
- package/dist/node_modules/fs-extra/lib/util/utimes.js +36 -0
- package/dist/node_modules/fs-extra/package.json +1 -0
- package/dist/node_modules/koa-compose/index.js +1 -0
- package/dist/node_modules/koa-compose/package.json +1 -0
- package/dist/server/actions/formatter.d.ts +4 -0
- package/dist/server/actions/formatter.js +67 -0
- package/dist/server/actions/query.d.ts +8 -0
- package/dist/server/actions/query.js +320 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/dist/server/migrations/20230926211750-rename-charttype.d.ts +5 -0
- package/dist/server/migrations/20230926211750-rename-charttype.js +51 -0
- package/dist/server/plugin.d.ts +13 -0
- package/dist/server/plugin.js +83 -0
- package/dist/server/services/sql-loader.d.ts +10 -0
- package/dist/server/services/sql-loader.js +134 -0
- package/dist/server/sqls/view_load_function.sql +17 -0
- package/dist/server/utils/multiprocess.d.ts +2 -0
- package/dist/server/utils/multiprocess.js +38 -0
- package/dist/swagger/index.d.ts +8 -0
- package/dist/swagger/index.js +29 -0
- package/package.json +44 -0
- package/server.d.ts +3 -0
- package/server.js +65 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type MeasureProps = {
|
|
3
|
+
field: string | string[];
|
|
4
|
+
aggregation?: string;
|
|
5
|
+
alias?: string;
|
|
6
|
+
};
|
|
7
|
+
export type DimensionProps = {
|
|
8
|
+
field: string | string[];
|
|
9
|
+
alias?: string;
|
|
10
|
+
format?: string;
|
|
11
|
+
};
|
|
12
|
+
export type TransformProps = {
|
|
13
|
+
field: string;
|
|
14
|
+
type: string;
|
|
15
|
+
format: string;
|
|
16
|
+
specific?: string;
|
|
17
|
+
};
|
|
18
|
+
export type QueryProps = Partial<{
|
|
19
|
+
measures: MeasureProps[];
|
|
20
|
+
dimensions: DimensionProps[];
|
|
21
|
+
orders: {
|
|
22
|
+
field: string;
|
|
23
|
+
order: 'asc' | 'desc';
|
|
24
|
+
}[];
|
|
25
|
+
filter: any;
|
|
26
|
+
limit: number;
|
|
27
|
+
sql: {
|
|
28
|
+
fields?: string;
|
|
29
|
+
clauses?: string;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
export type ChartRendererProps = {
|
|
33
|
+
collection?: string;
|
|
34
|
+
dataSource?: string;
|
|
35
|
+
query?: QueryProps;
|
|
36
|
+
config?: {
|
|
37
|
+
chartType: string;
|
|
38
|
+
general: any;
|
|
39
|
+
advanced: any;
|
|
40
|
+
};
|
|
41
|
+
transform?: TransformProps[];
|
|
42
|
+
mode?: 'builder' | 'sql';
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
};
|
|
45
|
+
export declare const ChartRendererContext: React.Context<{
|
|
46
|
+
service?: any;
|
|
47
|
+
data?: any[];
|
|
48
|
+
} & ChartRendererProps>;
|
|
49
|
+
export declare const ChartRendererProvider: (props: ChartRendererProps) => React.JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FieldOption } from './hooks';
|
|
2
|
+
import { QueryProps } from './renderer';
|
|
3
|
+
export declare const createRendererSchema: (decoratorProps: any, componentProps?: {}) => {
|
|
4
|
+
type: string;
|
|
5
|
+
'x-decorator': string;
|
|
6
|
+
'x-decorator-props': any;
|
|
7
|
+
'x-acl-action': string;
|
|
8
|
+
'x-designer': string;
|
|
9
|
+
'x-component': string;
|
|
10
|
+
'x-component-props': {
|
|
11
|
+
size: string;
|
|
12
|
+
};
|
|
13
|
+
'x-initializer': string;
|
|
14
|
+
properties: {
|
|
15
|
+
[x: string]: {
|
|
16
|
+
type: string;
|
|
17
|
+
'x-component': string;
|
|
18
|
+
'x-component-props': {};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare const parseField: (field: string | string[]) => {
|
|
23
|
+
target: string;
|
|
24
|
+
name: string;
|
|
25
|
+
alias: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const getField: (fields: FieldOption[], field: string | string[]) => FieldOption;
|
|
28
|
+
export declare const getSelectedFields: (fields: FieldOption[], query: QueryProps) => {
|
|
29
|
+
key: string;
|
|
30
|
+
label: string;
|
|
31
|
+
value: string;
|
|
32
|
+
alias?: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
type?: string;
|
|
35
|
+
interface?: string;
|
|
36
|
+
uiSchema?: import("@tachybase/schema").ISchema;
|
|
37
|
+
target?: string;
|
|
38
|
+
targetFields?: FieldOption[];
|
|
39
|
+
}[];
|
|
40
|
+
export declare const processData: (selectedFields: FieldOption[], data: any[], scope: any) => {}[];
|
|
41
|
+
export declare const removeUnparsableFilter: (filter: any) => any;
|
|
42
|
+
export declare const getValuesByPath: (values: any, path: string) => any;
|
|
43
|
+
export declare const getFormulaComponent: (type: string) => string;
|
|
44
|
+
export declare const getFormulaInterface: (type: string) => string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"@tachybase/client": "0.23.8",
|
|
3
|
+
"@tachybase/schema": "0.23.8",
|
|
4
|
+
"lodash": "4.17.21",
|
|
5
|
+
"@tachybase/cache": "0.23.8",
|
|
6
|
+
"@tachybase/server": "0.23.8",
|
|
7
|
+
"@tachybase/utils": "0.23.8",
|
|
8
|
+
"react": "18.3.1",
|
|
9
|
+
"@ant-design/icons": "5.3.7",
|
|
10
|
+
"ahooks": "3.8.4",
|
|
11
|
+
"antd": "5.22.5",
|
|
12
|
+
"dayjs": "1.11.13",
|
|
13
|
+
"@tachybase/components": "0.23.8",
|
|
14
|
+
"react-i18next": "15.2.0",
|
|
15
|
+
"sequelize": "6.37.5",
|
|
16
|
+
"@tachybase/actions": "0.23.8",
|
|
17
|
+
"@tachybase/database": "0.23.8"
|
|
18
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
default: () => import_server.default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
__reExport(src_exports, require("./server"), module.exports);
|
|
35
|
+
var import_server = __toESM(require("./server"));
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
...require("./server")
|
|
39
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Abbreviation": "Abbreviation",
|
|
3
|
+
"Actions": "Actions",
|
|
4
|
+
"Add chart": "Add chart",
|
|
5
|
+
"Add custom field": "Add custom field",
|
|
6
|
+
"Add field": "Add field",
|
|
7
|
+
"Aggregation": "Aggregation",
|
|
8
|
+
"Alias": "Alias",
|
|
9
|
+
"Are you sure to cancel?": "Are you sure to cancel?",
|
|
10
|
+
"Area Chart": "Area Chart",
|
|
11
|
+
"Avg": "Avg",
|
|
12
|
+
"Bar Chart": "Bar Chart",
|
|
13
|
+
"Built-in": "Built-in",
|
|
14
|
+
"Cancel": "Cancel",
|
|
15
|
+
"Chart": "Chart",
|
|
16
|
+
"Chart type": "Chart type",
|
|
17
|
+
"ChartV2": "ChartV2",
|
|
18
|
+
"Charts": "Charts",
|
|
19
|
+
"Collection": "Collection",
|
|
20
|
+
"Column Chart": "Column Chart",
|
|
21
|
+
"Config reference: ": "Config reference: ",
|
|
22
|
+
"Configure": "Configure",
|
|
23
|
+
"Configure chart": "Configure chart",
|
|
24
|
+
"Count": "Count",
|
|
25
|
+
"Currency": "Currency",
|
|
26
|
+
"CurrencyNegative": "CurrencyNegative",
|
|
27
|
+
"Current filter": "Current filter",
|
|
28
|
+
"Data": "Data",
|
|
29
|
+
"Date range": "Date range",
|
|
30
|
+
"Decimal": "Decimal",
|
|
31
|
+
"Delete": "Delete",
|
|
32
|
+
"Dimensions": "Dimensions",
|
|
33
|
+
"Dual Axes Chart": "Dual Axes Chart",
|
|
34
|
+
"Duplicate": "Duplicate",
|
|
35
|
+
"Edit": "Edit",
|
|
36
|
+
"Edit field properties": "Edit field properties",
|
|
37
|
+
"Enable": "Enable",
|
|
38
|
+
"Enable cache": "Enable cache",
|
|
39
|
+
"Expand": "Expand",
|
|
40
|
+
"Exponential": "Exponential",
|
|
41
|
+
"Field": "Field",
|
|
42
|
+
"Filter": "Filter",
|
|
43
|
+
"Format": "Format",
|
|
44
|
+
"FourDigits": "FourDigits",
|
|
45
|
+
"Gauge Chart": "Gauge Chart",
|
|
46
|
+
"Input": "Input",
|
|
47
|
+
"JSON config": "JSON config",
|
|
48
|
+
"Limit": "Limit",
|
|
49
|
+
"Line Chart": "Line Chart",
|
|
50
|
+
"Max": "Max",
|
|
51
|
+
"Measures": "Measures",
|
|
52
|
+
"Min": "Min",
|
|
53
|
+
"Original field": "Original field",
|
|
54
|
+
"Percent": "Percent",
|
|
55
|
+
"Pie Chart": "Pie Chart",
|
|
56
|
+
"Please configure and run query": "Please configure and run query",
|
|
57
|
+
"Please configure chart": "Please configure chart",
|
|
58
|
+
"Please run query to retrive data.": "Please run query to retrive data.",
|
|
59
|
+
"Please select a chart type.": "Please select a chart type.",
|
|
60
|
+
"Query": "Query",
|
|
61
|
+
"Run query": "Run query",
|
|
62
|
+
"Same properties set in the form above will be overwritten by this JSON config.": "Same properties set in the form above will be overwritten by this JSON config.",
|
|
63
|
+
"Scatter Chart": "Scatter Chart",
|
|
64
|
+
"Select a source field to use metadata of the field": "Select a source field to use metadata of the field",
|
|
65
|
+
"Sort": "Sort",
|
|
66
|
+
"Statistic": "Statistic",
|
|
67
|
+
"Submit": "Submit",
|
|
68
|
+
"Sum": "Sum",
|
|
69
|
+
"TTL (second)": "TTL (second)",
|
|
70
|
+
"Table": "Table",
|
|
71
|
+
"The first 10 records of the query result:": "The first 10 records of the query result:",
|
|
72
|
+
"ThreeDigits": "ThreeDigits",
|
|
73
|
+
"Time range": "Time range",
|
|
74
|
+
"Title": "Title",
|
|
75
|
+
"To filter with custom fields, use \"Current filter\" variables in the chart configuration.": "To filter with custom fields, use \"Current filter\" variables in the chart configuration.",
|
|
76
|
+
"Transform": "Transform",
|
|
77
|
+
"TwoDigits": "TwoDigits",
|
|
78
|
+
"Type": "Type",
|
|
79
|
+
"You changes are not saved. If you click OK, your changes will be lost.": "You changes are not saved. If you click OK, your changes will be lost.",
|
|
80
|
+
"angleField": "angleField",
|
|
81
|
+
"colorField": "colorField",
|
|
82
|
+
"isGroup": "isGroup",
|
|
83
|
+
"isPercent": "isPercent",
|
|
84
|
+
"isStack": "isStack",
|
|
85
|
+
"seriesField": "seriesField",
|
|
86
|
+
"smooth": "smooth",
|
|
87
|
+
"xField": "xField",
|
|
88
|
+
"yField": "yField"
|
|
89
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Abbreviation": "약어",
|
|
3
|
+
"Actions": "동작",
|
|
4
|
+
"Add chart": "차트 추가",
|
|
5
|
+
"Add custom field": "사용자 정의 필드 추가",
|
|
6
|
+
"Add field": "필드 추가",
|
|
7
|
+
"Aggregation": "집계",
|
|
8
|
+
"Alias": "별칭",
|
|
9
|
+
"Are you sure to cancel?": "취소하시겠습니까?",
|
|
10
|
+
"Area Chart": "면적 그래프",
|
|
11
|
+
"Avg": "평균",
|
|
12
|
+
"Bar Chart": "막대 그래프",
|
|
13
|
+
"Built-in": "내장",
|
|
14
|
+
"Cancel": "취소",
|
|
15
|
+
"Chart": "차트",
|
|
16
|
+
"Chart type": "차트 유형",
|
|
17
|
+
"ChartV2": "차트V2",
|
|
18
|
+
"Charts": "차트",
|
|
19
|
+
"Collapse": "축소",
|
|
20
|
+
"Collection": "데이터 테이블",
|
|
21
|
+
"Column Chart": "막대 그래프",
|
|
22
|
+
"Config reference: ": "구성 참조: ",
|
|
23
|
+
"Configure": "구성",
|
|
24
|
+
"Configure chart": "차트 구성",
|
|
25
|
+
"Count": "계수",
|
|
26
|
+
"Currency": "통화",
|
|
27
|
+
"Current filter": "현재 필터",
|
|
28
|
+
"Data": "데이터",
|
|
29
|
+
"Date range": "날짜 범위",
|
|
30
|
+
"Delete": "삭제",
|
|
31
|
+
"Dimensions": "치수",
|
|
32
|
+
"Dual Axes Chart": "이중 축 그래프",
|
|
33
|
+
"Duplicate": "복제",
|
|
34
|
+
"Edit": "편집",
|
|
35
|
+
"Edit field properties": "필드 속성 편집",
|
|
36
|
+
"Enable": "활성화",
|
|
37
|
+
"Enable cache": "캐시 활성화",
|
|
38
|
+
"Expand": "확장",
|
|
39
|
+
"Exponential": "지수 표기법",
|
|
40
|
+
"Field": "필드",
|
|
41
|
+
"Filter": "필터",
|
|
42
|
+
"Format": "형식",
|
|
43
|
+
"Gauge Chart": "게이지 차트",
|
|
44
|
+
"Input": "입력",
|
|
45
|
+
"JSON config": "JSON 구성",
|
|
46
|
+
"Limit": "결과 제한",
|
|
47
|
+
"Line Chart": "선 그래프",
|
|
48
|
+
"Max": "최대값",
|
|
49
|
+
"Measures": "측정",
|
|
50
|
+
"Min": "최소값",
|
|
51
|
+
"Original field": "원본 필드",
|
|
52
|
+
"Percent": "퍼센트",
|
|
53
|
+
"Pie Chart": "파이 차트",
|
|
54
|
+
"Please configure and run query": "쿼리를 구성하고 실행하세요.",
|
|
55
|
+
"Please configure chart": "차트를 구성하세요.",
|
|
56
|
+
"Please run query to retrieve data.": "데이터를 검색하려면 쿼리를 실행하십시오.",
|
|
57
|
+
"Please select a chart type.": "차트 유형을 선택하세요.",
|
|
58
|
+
"Query": "쿼리",
|
|
59
|
+
"Run query": "쿼리 실행",
|
|
60
|
+
"Same properties set in the form above will be overwritten by this JSON config.": "상단 양식에 설정된 동일한 속성은이 JSON 구성에 의해 덮어쓰기됩니다.",
|
|
61
|
+
"Scatter Chart": "산점도 차트",
|
|
62
|
+
"Select a source field to use metadata of the field": "필드의 메타데이터 구성에 사용할 소스 필드를 선택하세요.",
|
|
63
|
+
"Sort": "정렬",
|
|
64
|
+
"Statistic": "통계",
|
|
65
|
+
"Submit": "제출",
|
|
66
|
+
"Sum": "합계",
|
|
67
|
+
"TTL (second)": "TTL (초)",
|
|
68
|
+
"Table": "테이블",
|
|
69
|
+
"The first 10 records of the query result:": "쿼리 결과의 처음 10 개 레코드:",
|
|
70
|
+
"Time range": "시간 범위",
|
|
71
|
+
"Title": "제목",
|
|
72
|
+
"To filter with custom fields, use 'Current filter' variables in the chart configuration.": "사용자 정의 필드로 필터링하려면 차트 구성에서 '현재 필터' 변수를 사용하세요.",
|
|
73
|
+
"Transform": "데이터 변환",
|
|
74
|
+
"Type": "유형",
|
|
75
|
+
"Your changes are not saved. If you click OK, your changes will be lost.": "변경 내용이 저장되지 않았습니다. 확인을 클릭하면 변경 내용이 손실됩니다.",
|
|
76
|
+
"angleField": "각도 필드",
|
|
77
|
+
"colorField": "색상 필드",
|
|
78
|
+
"isGroup": "그룹화",
|
|
79
|
+
"isPercent": "백분율로 표시",
|
|
80
|
+
"isStack": "스택",
|
|
81
|
+
"seriesField": "시리즈 필드",
|
|
82
|
+
"smooth": "부드러운 곡선",
|
|
83
|
+
"xField": "x축 필드",
|
|
84
|
+
"yField": "y축 필드"
|
|
85
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Abbreviation": "缩写",
|
|
3
|
+
"Actions": "操作",
|
|
4
|
+
"Add chart": "添加图表",
|
|
5
|
+
"Add custom field": "添加自定义字段",
|
|
6
|
+
"Add field": "添加字段",
|
|
7
|
+
"Aggregation": "聚合",
|
|
8
|
+
"Alias": "别名",
|
|
9
|
+
"Are you sure to cancel?": "确定要取消吗?",
|
|
10
|
+
"Area Chart": "面积图",
|
|
11
|
+
"Avg": "平均值",
|
|
12
|
+
"Bar Chart": "条形图",
|
|
13
|
+
"Built-in": "内置图表",
|
|
14
|
+
"Cancel": "取消",
|
|
15
|
+
"Chart": "图表",
|
|
16
|
+
"Chart type": "图表类型",
|
|
17
|
+
"ChartV2": "图表V2",
|
|
18
|
+
"Charts": "图表",
|
|
19
|
+
"Collapse": "折叠",
|
|
20
|
+
"Collection": "数据表",
|
|
21
|
+
"Column Chart": "柱状图",
|
|
22
|
+
"Config reference: ": "配置参考: ",
|
|
23
|
+
"Configure": "配置",
|
|
24
|
+
"Configure chart": "配置图表",
|
|
25
|
+
"Count": "计数",
|
|
26
|
+
"Currency": "货币",
|
|
27
|
+
"CurrencyNegative": "货币取反",
|
|
28
|
+
"Current filter": "当前筛选",
|
|
29
|
+
"Data": "数据",
|
|
30
|
+
"Date range": "日期范围",
|
|
31
|
+
"Decimal": "小数",
|
|
32
|
+
"Delete": "删除",
|
|
33
|
+
"Dimensions": "维度",
|
|
34
|
+
"Dual Axes Chart": "双轴图",
|
|
35
|
+
"Duplicate": "复制",
|
|
36
|
+
"Edit": "编辑",
|
|
37
|
+
"Edit field properties": "编辑字段属性",
|
|
38
|
+
"Enable": "启用",
|
|
39
|
+
"Enable cache": "启用缓存",
|
|
40
|
+
"Expand": "展开",
|
|
41
|
+
"Exponential": "科学记数法",
|
|
42
|
+
"Field": "字段",
|
|
43
|
+
"Filter": "过滤",
|
|
44
|
+
"Format": "格式",
|
|
45
|
+
"FourDigits": "保留四位",
|
|
46
|
+
"Gauge Chart": "仪表盘",
|
|
47
|
+
"Input": "输入框",
|
|
48
|
+
"JSON config": "JSON 配置",
|
|
49
|
+
"Limit": "结果数量",
|
|
50
|
+
"Line Chart": "折线图",
|
|
51
|
+
"Max": "最大值",
|
|
52
|
+
"Measures": "度量",
|
|
53
|
+
"Min": "最小值",
|
|
54
|
+
"Original field": "原始字段",
|
|
55
|
+
"Percent": "百分比",
|
|
56
|
+
"Pie Chart": "饼图",
|
|
57
|
+
"Please configure and run query": "请配置并执行数据查询",
|
|
58
|
+
"Please configure chart": "请配置图表",
|
|
59
|
+
"Please run query to retrive data.": "请执行查询来获取数据。",
|
|
60
|
+
"Please select a chart type.": "请选择图表类型",
|
|
61
|
+
"Query": "查询",
|
|
62
|
+
"Run query": "执行查询",
|
|
63
|
+
"Same properties set in the form above will be overwritten by this JSON config.": "上面表单中设置的相同属性将被JSON配置覆盖。",
|
|
64
|
+
"Scatter Chart": "散点图",
|
|
65
|
+
"Select a source field to use metadata of the field": "选择来源字段可以复用字段的元数据配置",
|
|
66
|
+
"Sort": "排序",
|
|
67
|
+
"Statistic": "统计",
|
|
68
|
+
"Submit": "提交",
|
|
69
|
+
"Sum": "求和",
|
|
70
|
+
"TTL (second)": "缓存时间 (秒)",
|
|
71
|
+
"Table": "表格",
|
|
72
|
+
"The first 10 records of the query result:": "查询结果的前 10 条记录:",
|
|
73
|
+
"ThreeDigits": "保留三位",
|
|
74
|
+
"Time range": "时间范围",
|
|
75
|
+
"Title": "名称",
|
|
76
|
+
"To filter with custom fields, use \"Current filter\" variables in the chart configuration.": "要通过自定义字段筛选,需要在图表配置中使用“当前筛选”变量。",
|
|
77
|
+
"Transform": "数据转换",
|
|
78
|
+
"TwoDigits": "保留两位",
|
|
79
|
+
"Type": "类型",
|
|
80
|
+
"You changes are not saved. If you click OK, your changes will be lost.": "您的更改尚未保存。如果您点击“确定”,您的更改将丢失。",
|
|
81
|
+
"angleField": "角度字段",
|
|
82
|
+
"colorField": "颜色字段",
|
|
83
|
+
"isGroup": "分组",
|
|
84
|
+
"isPercent": "显示为百分比",
|
|
85
|
+
"isStack": "堆叠",
|
|
86
|
+
"seriesField": "分类字段",
|
|
87
|
+
"smooth": "平滑曲线",
|
|
88
|
+
"xField": "x轴字段",
|
|
89
|
+
"yField": "y轴字段"
|
|
90
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2011-2017 JP Richardson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
|
6
|
+
(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
|
|
7
|
+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
13
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
14
|
+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
15
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const fs = require('graceful-fs')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const mkdirsSync = require('../mkdirs').mkdirsSync
|
|
6
|
+
const utimesMillisSync = require('../util/utimes').utimesMillisSync
|
|
7
|
+
const stat = require('../util/stat')
|
|
8
|
+
|
|
9
|
+
function copySync (src, dest, opts) {
|
|
10
|
+
if (typeof opts === 'function') {
|
|
11
|
+
opts = { filter: opts }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
opts = opts || {}
|
|
15
|
+
opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
|
|
16
|
+
opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
|
|
17
|
+
|
|
18
|
+
// Warn about using preserveTimestamps on 32-bit node
|
|
19
|
+
if (opts.preserveTimestamps && process.arch === 'ia32') {
|
|
20
|
+
process.emitWarning(
|
|
21
|
+
'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
|
|
22
|
+
'\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
|
|
23
|
+
'Warning', 'fs-extra-WARN0002'
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
|
|
28
|
+
stat.checkParentPathsSync(src, srcStat, dest, 'copy')
|
|
29
|
+
if (opts.filter && !opts.filter(src, dest)) return
|
|
30
|
+
const destParent = path.dirname(dest)
|
|
31
|
+
if (!fs.existsSync(destParent)) mkdirsSync(destParent)
|
|
32
|
+
return getStats(destStat, src, dest, opts)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getStats (destStat, src, dest, opts) {
|
|
36
|
+
const statSync = opts.dereference ? fs.statSync : fs.lstatSync
|
|
37
|
+
const srcStat = statSync(src)
|
|
38
|
+
|
|
39
|
+
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
|
|
40
|
+
else if (srcStat.isFile() ||
|
|
41
|
+
srcStat.isCharacterDevice() ||
|
|
42
|
+
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
|
|
43
|
+
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
|
|
44
|
+
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
|
|
45
|
+
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
|
|
46
|
+
throw new Error(`Unknown file: ${src}`)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function onFile (srcStat, destStat, src, dest, opts) {
|
|
50
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts)
|
|
51
|
+
return mayCopyFile(srcStat, src, dest, opts)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function mayCopyFile (srcStat, src, dest, opts) {
|
|
55
|
+
if (opts.overwrite) {
|
|
56
|
+
fs.unlinkSync(dest)
|
|
57
|
+
return copyFile(srcStat, src, dest, opts)
|
|
58
|
+
} else if (opts.errorOnExist) {
|
|
59
|
+
throw new Error(`'${dest}' already exists`)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function copyFile (srcStat, src, dest, opts) {
|
|
64
|
+
fs.copyFileSync(src, dest)
|
|
65
|
+
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
|
|
66
|
+
return setDestMode(dest, srcStat.mode)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function handleTimestamps (srcMode, src, dest) {
|
|
70
|
+
// Make sure the file is writable before setting the timestamp
|
|
71
|
+
// otherwise open fails with EPERM when invoked with 'r+'
|
|
72
|
+
// (through utimes call)
|
|
73
|
+
if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
|
|
74
|
+
return setDestTimestamps(src, dest)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function fileIsNotWritable (srcMode) {
|
|
78
|
+
return (srcMode & 0o200) === 0
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function makeFileWritable (dest, srcMode) {
|
|
82
|
+
return setDestMode(dest, srcMode | 0o200)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function setDestMode (dest, srcMode) {
|
|
86
|
+
return fs.chmodSync(dest, srcMode)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function setDestTimestamps (src, dest) {
|
|
90
|
+
// The initial srcStat.atime cannot be trusted
|
|
91
|
+
// because it is modified by the read(2) system call
|
|
92
|
+
// (See https://nodejs.org/api/fs.html#fs_stat_time_values)
|
|
93
|
+
const updatedSrcStat = fs.statSync(src)
|
|
94
|
+
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function onDir (srcStat, destStat, src, dest, opts) {
|
|
98
|
+
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
|
|
99
|
+
return copyDir(src, dest, opts)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function mkDirAndCopy (srcMode, src, dest, opts) {
|
|
103
|
+
fs.mkdirSync(dest)
|
|
104
|
+
copyDir(src, dest, opts)
|
|
105
|
+
return setDestMode(dest, srcMode)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function copyDir (src, dest, opts) {
|
|
109
|
+
fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function copyDirItem (item, src, dest, opts) {
|
|
113
|
+
const srcItem = path.join(src, item)
|
|
114
|
+
const destItem = path.join(dest, item)
|
|
115
|
+
if (opts.filter && !opts.filter(srcItem, destItem)) return
|
|
116
|
+
const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
|
|
117
|
+
return getStats(destStat, srcItem, destItem, opts)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function onLink (destStat, src, dest, opts) {
|
|
121
|
+
let resolvedSrc = fs.readlinkSync(src)
|
|
122
|
+
if (opts.dereference) {
|
|
123
|
+
resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (!destStat) {
|
|
127
|
+
return fs.symlinkSync(resolvedSrc, dest)
|
|
128
|
+
} else {
|
|
129
|
+
let resolvedDest
|
|
130
|
+
try {
|
|
131
|
+
resolvedDest = fs.readlinkSync(dest)
|
|
132
|
+
} catch (err) {
|
|
133
|
+
// dest exists and is a regular file or directory,
|
|
134
|
+
// Windows may throw UNKNOWN error. If dest already exists,
|
|
135
|
+
// fs throws error anyway, so no need to guard against it here.
|
|
136
|
+
if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)
|
|
137
|
+
throw err
|
|
138
|
+
}
|
|
139
|
+
if (opts.dereference) {
|
|
140
|
+
resolvedDest = path.resolve(process.cwd(), resolvedDest)
|
|
141
|
+
}
|
|
142
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
143
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// prevent copy if src is a subdir of dest since unlinking
|
|
147
|
+
// dest in this case would result in removing src contents
|
|
148
|
+
// and therefore a broken symlink would be created.
|
|
149
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
150
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
|
|
151
|
+
}
|
|
152
|
+
return copyLink(resolvedSrc, dest)
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function copyLink (resolvedSrc, dest) {
|
|
157
|
+
fs.unlinkSync(dest)
|
|
158
|
+
return fs.symlinkSync(resolvedSrc, dest)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
module.exports = copySync
|