Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support duration data type #76

Merged
merged 1 commit into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/assets/config/locale/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
"geography(point)Format": "Supported data inserting methods: <br /> Call function ST_GeogFromText('POINT()'), for example:ST_GeogFromText('POINT(6 10)')",
"geography(linestring)Format": "Supported data inserting methods: <br /> Call function ST_GeogFromText('LINESTRING()'), for example:ST_GeogFromText('LINESTRING(3 4,10 50,20 25)')",
"geography(polygon)Format": "Supported data inserting methods: <br /> Call function ST_GeogFromText('POLYGON()'), for example:ST_GeogFromText('POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2,2 3,3 3,3 2,2 2))')",
"durationFormat": "Supported data inserting methods: <br /> Call function duration(<map>), for example:duration({years: 1, seconds: 0})",
"cancelOperation": "Do you want to close this panel",
"cancelPropmt": "If you close the panel, the configuration will be deleted automatically. Are you sure that you want to close the panel?",
"fieldDisabled": "A TTL configuration is set for this property, so it cannot be edited. If you want to edit this property, delete the TTL configuration.",
Expand Down
1 change: 1 addition & 0 deletions app/assets/config/locale/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@
"geography(point)Format": "geo(point) 类型支持插入方式: <br /> 调用函数 ST_GeogFromText('POINT()'),例如:ST_GeogFromText('POINT(6 10)')",
"geography(linestring)Format": "geo(linestring) 类型支持插入方式: <br /> 调用函数 ST_GeogFromText('LINESTRING()'),例如:ST_GeogFromText('LINESTRING(3 4,10 50,20 25)')",
"geography(polygon)Format": "geo(polygon) 类型支持插入方式: <br /> 调用函数 ST_GeogFromText('POLYGON()'),例如:ST_GeogFromText('POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2,2 3,3 3,3 2,2 2))')",
"durationFormat": "duration 类型支持插入方式: <br /> 调用函数 duration(<map>),例如:duration({years: 1, seconds: 0})",
"cancelOperation": "是否取消配置并关闭面板",
"cancelPropmt": "关闭面板将删除所有属性,是否继续?",
"fieldDisabled": "该属性被 ttl_col 引用,不支持更改操作,如要更改,请先更新 ttl",
Expand Down
13 changes: 12 additions & 1 deletion app/assets/modules/Explore/NebulaGraph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,18 @@ class NebulaGraph extends React.Component<IProps, IState> {
const edgeFieldsValuePairStr = Object.keys(properties)
.map(property => {
const value = properties[property];
return `<div key=${property}><span>${link.type}.${property}: </span><span>${value}</span></div>`;
return `<div key=${property}><span>${
link.type
}.${property}: </span><span>${
typeof value !== 'string'
? convertBigNumberToString(value)
: JSON.stringify(value, (_, value) => {
if (typeof value === 'string') {
return value.replace(/\u0000+$/, '');
}
return value;
})
}</span></div>`;
})
.join('');
this.$tooltip.html(
Expand Down
5 changes: 5 additions & 0 deletions app/assets/utils/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ export const DATA_TYPE = [
value: 'geography(polygon)',
label: 'geography(polygon)',
},
{
value: 'duration',
label: 'duration',
},
];

export const RELATION_OPERATORS = [
Expand Down Expand Up @@ -202,6 +206,7 @@ export const EXPLAIN_DATA_TYPE = [
'geography(point)',
'geography(linestring)',
'geography(polygon)',
'duration',
];

export const NAME_REGEX = /^[a-zA-Z][a-zA-Z0-9_]*$/;
Expand Down