Skip to content

Commit

Permalink
fix: fix typo (#162)
Browse files Browse the repository at this point in the history
mod: update force graph
  • Loading branch information
hetao92 authored Mar 30, 2022
1 parent 7af399a commit a9ea402
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 68 deletions.
4 changes: 2 additions & 2 deletions app/config/locale/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@
"importCompleted": "Import completed",
"importStopped": "Import stopped",
"importFailed": "Failed",
"notImported": "{total} not imported",
"readFailed": "{total} read failed",
"notImported": "{total} lines not imported",
"readFailed": "{total} lines read failed",
"selectFile": "Select bind source file",
"addTag": "Add Tag",
"selectTag": "Select Tag",
Expand Down
4 changes: 2 additions & 2 deletions app/config/locale/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@
"importCompleted": "导入完成",
"importStopped": "导入中止",
"importFailed": "导入失败",
"notImported": "{total}未导入",
"readFailed": "{total}读取失败",
"notImported": "{total}行未导入",
"readFailed": "{total}行读取失败",
"selectFile": "选择绑定文件",
"addTag": "添加 Tag",
"selectTag": "选择 Tag",
Expand Down
4 changes: 2 additions & 2 deletions app/pages/Import/TaskList/TaskItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ const TaskItem = (props: IProps) => {
const addMsg = () => {
const info: string[] = [];
if(numFailed > 0) {
info.push(intl.get('import.notImported', { total: getFileSize(numFailed) }));
info.push(intl.get('import.notImported', { total: numFailed }));
}
if(numReadFailed > 0) {
info.push(intl.get('import.readFailed', { total: getFileSize(numReadFailed) }));
info.push(intl.get('import.readFailed', { total: numReadFailed }));
}
info.length > 0 && setExtraMsg(info.join(', '));
};
Expand Down
9 changes: 7 additions & 2 deletions app/pages/Schema/SchemaConfig/Create/CommonCreate/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, Col, Form, Input, Row, message } from 'antd';
import React, { useState } from 'react';
import React, { useState, useEffect } from 'react';
import intl from 'react-intl-universal';
import { observer } from 'mobx-react-lite';
import { nameRulesFn } from '@app/config/rules';
Expand All @@ -9,6 +9,7 @@ import GQLCodeMirror from '@app/components/GQLCodeMirror';
import { getTagOrEdgeCreateGQL } from '@app/utils/gql';
import { useStore } from '@app/stores';
import { ISchemaType } from '@app/interfaces/schema';
import { trackPageView } from '@app/utils/stat';
import PropertiesForm from './PropertiesForm';
import TTLForm from './TTLForm';
import './index.less';
Expand All @@ -23,7 +24,8 @@ const formItemLayout = {
};

interface IProps {
createType: ISchemaType
createType: ISchemaType,
locale: string
}
const ConfigCreate = (props: IProps) => {
const { createType } = props;
Expand All @@ -32,6 +34,9 @@ const ConfigCreate = (props: IProps) => {
const { schema: { createTagOrEdge } } = useStore();
const [gql, setGql] = useState('');
const [basicForm] = Form.useForm();
useEffect(() => {
trackPageView(`/schema/${createType}/create`);
}, []);

const updateGql = () => {
const { name, properties, ttl_col, ttl_duration, comment } = basicForm.getFieldsValue();
Expand Down
3 changes: 2 additions & 1 deletion app/pages/Schema/SchemaConfig/Edit/CommonEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ const ConfigEdit = (props: IProps) => {
const [ttlRequired, setTtlRequired] = useState(false);
const [propertiesRequired, setPropertiesRequired] = useState(false);
useEffect(() => {
trackPageView(`/schema/config/${editType}/edit`);
trackPageView(`/schema/${editType}/edit`);
getDetails();
}, []);

const getDetails = async () => {
const _editName = state[editType];
if(!_editName) {
Expand Down
1 change: 1 addition & 0 deletions app/pages/Schema/SchemaConfig/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
background: @lightBlue;
border-radius: 3px;
border: none;
text-align: left;
}
.ant-select-selection-item {
color: @darkBlue;
Expand Down
11 changes: 6 additions & 5 deletions app/pages/Schema/SchemaConfig/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Radio, Select } from 'antd';
import React, { useEffect, useMemo, useState } from 'react';
import React, { useContext, useEffect, useMemo, useState } from 'react';
import { Route, useHistory, useParams } from 'react-router-dom';
import intl from 'react-intl-universal';
import { trackPageView } from '@app/utils/stat';
import Breadcrumb from '@app/components/Breadcrumb';
import { observer } from 'mobx-react-lite';
import { useStore } from '@app/stores';
import Cookie from 'js-cookie';
import { LanguageContext } from '@app/context';
import TagList from './List/Tag';
import EdgeList from './List/Edge';
import IndexList from './List/Index/index';
Expand All @@ -23,6 +23,7 @@ const SchemaConfig = () => {
const { type, action } = useParams() as { type: string, action: string };
const { schema } = useStore();
const { spaces, getSpaces, switchSpace, currentSpace } = schema;
const { currentLocale } = useContext(LanguageContext);
const routes = useMemo(() => {
if(action === 'list') {
return [
Expand Down Expand Up @@ -53,7 +54,7 @@ const SchemaConfig = () => {
},
];
}
}, [currentSpace, action, Cookie.get('lang')]);
}, [currentSpace, action, currentLocale]);
useEffect(() => {
setTab(type);
if(spaces.length === 0) {
Expand Down Expand Up @@ -122,12 +123,12 @@ const SchemaConfig = () => {
<Route
path={`/schema/tag/create`}
exact={true}
render={() => <CommonCreate createType="tag" />}
render={() => <CommonCreate createType="tag" locale={currentLocale} />}
/>
<Route
path={`/schema/edge/create`}
exact={true}
render={() => <CommonCreate createType="edge" />}
render={() => <CommonCreate createType="edge" locale={currentLocale} />}
/>
<Route
path={`/schema/tag/edit`}
Expand Down
16 changes: 8 additions & 8 deletions app/utils/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import intl from 'react-intl-universal';
import { getRootStore } from '@app/stores';
import { trackEvent } from './stat';

const subErrMsgStr = [
'session expired',
'connection refused',
'broken pipe',
'an existing connection was forcibly closed',
'Token is expired',
];

const service = axios.create({
transformResponse: [
Expand Down Expand Up @@ -34,14 +41,7 @@ service.interceptors.response.use(
(response: any) => {
const { code, message: errMsg } = response.data;
// if connection refused, login again
if (
code === -1 &&
errMsg &&
(errMsg.includes('Connection refused') ||
errMsg.includes('broken pipe') ||
errMsg.includes('session expired') ||
errMsg.includes('an existing connection was forcibly closed'))
) {
if (code === -1 && new RegExp(subErrMsgStr.join('|')).test(errMsg)) {
message.warning(intl.get('warning.connectError'));
getRootStore().global.logout();
} else if (code === -1 && errMsg) {
Expand Down
99 changes: 56 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dagre": "^0.8.5",
"dayjs": "^1.10.7",
"file-saver": "^2.0.5",
"@vesoft-inc/force-graph": "^2.0.1",
"@vesoft-inc/force-graph": "^2.0.3",
"history": "^5.1.0",
"http-proxy-middleware": "^0.20.0",
"index-array-by": "^1.3.2",
Expand Down
1 change: 1 addition & 0 deletions scripts/rpm/postinst.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

# will exec when studio rpm installed
echo "Nebula Studio has been installed."
cd $RPM_INSTALL_PREFIX/nebula-graph-studio/
sed -i "s?PREFIX_TEMPLATE?$RPM_INSTALL_PREFIX?g" `grep -rl "PREFIX_TEMPLATE" ./scripts/`
chmod 755 ./server
Expand Down
1 change: 1 addition & 0 deletions scripts/rpm/postrm.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash

# scirpt exec after this rpm remove
echo "Nebula Studio removed, bye~"
4 changes: 3 additions & 1 deletion scripts/rpm/preinst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
if ! type "lsof" > /dev/null; then
echo -e "\e[31mInstall failed for the reason: the command lsof required\e[0m"
exit 1
fi
fi

echo "Start installing Nebula Studio now...";
3 changes: 2 additions & 1 deletion scripts/rpm/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
cd PREFIX_TEMPLATE/nebula-graph-studio/
cp ./scripts/nebula-graph-studio.service /usr/lib/systemd/system/
sudo systemctl daemon-reload && sudo systemctl enable nebula-graph-studio.service && sudo systemctl start nebula-graph-studio.service
sudo systemctl daemon-reload && sudo systemctl enable nebula-graph-studio.service && sudo systemctl start nebula-graph-studio.service
echo "Nebula Studio started automatically."

0 comments on commit a9ea402

Please sign in to comment.