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:supplementary algorithms UI #270

Merged
merged 1 commit into from
May 10, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import HintIcon from '../../assets/imgs/ic_question_mark.svg';
import { GraphData } from '../../stores/types/GraphManagementStore/graphManagementStore';
import { useTranslation } from 'react-i18next';


const commonInputProps = {
size: 'medium',
width: 420
Expand Down Expand Up @@ -234,7 +233,7 @@ const GraphManagementListItem: React.FC<
value: 'delete'
}
];

const disabledDropdownList = [
{
label: t('addition.common.edit'),
Expand Down Expand Up @@ -338,6 +337,9 @@ const GraphManagementListItem: React.FC<
'password',
'edit'
)}
originInputProps={{
type: 'password'
}}
/>
</div>
<div>
Expand Down Expand Up @@ -368,7 +370,9 @@ const GraphManagementListItem: React.FC<
) : (
<div className="graph-management-list" key={id}>
<div className="graph-management-list-item">
<div className="graph-management-list-title">{t('addition.graphManagementList.id')}</div>
<div className="graph-management-list-title">
{t('addition.graphManagementList.id')}
</div>
<div className="graph-management-list-data">
<span title={name}>
<Highlighter
Expand All @@ -381,7 +385,9 @@ const GraphManagementListItem: React.FC<
</div>
</div>
<div className="graph-management-list-item">
<div className="graph-management-list-title">{t('addition.graphManagementList.name')}</div>
<div className="graph-management-list-title">
{t('addition.graphManagementList.name')}
</div>
<div className="graph-management-list-data">
<span title={graph}>
<Highlighter
Expand All @@ -394,7 +400,9 @@ const GraphManagementListItem: React.FC<
</div>
</div>
<div className="graph-management-list-item">
<div className="graph-management-list-title">{t('addition.graphManagementList.host')}</div>
<div className="graph-management-list-title">
{t('addition.graphManagementList.host')}
</div>
<div className="graph-management-list-data" title={host}>
{host}
</div>
Expand All @@ -408,7 +416,9 @@ const GraphManagementListItem: React.FC<
</div>
</div>
<div className="graph-management-list-item">
<div className="graph-management-list-title">{t('addition.graphManagementList.creation-time')}</div>
<div className="graph-management-list-title">
{t('addition.graphManagementList.creation-time')}
</div>
<div className="graph-management-list-data" title={create_time}>
{create_time}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
ImportManagerStoreContext
} from '../../stores';

import BackIcon from '../../assets/imgs/ic_topback.svg';
import ArrowIcon from '../../assets/imgs/ic_arrow_white.svg';
import DataAnalyzeIconNormal from '../../assets/imgs/ic_shuju_normal.svg';
import DataAnalyzeIconPressed from '../../assets/imgs/ic_shuju_pressed.svg';
Expand Down Expand Up @@ -43,11 +42,6 @@ const GraphManagementSidebar: React.FC = observer(() => {
expand: graphManagementStore.isExpanded
});

const sidebarGoBackClassName = classnames({
'data-analyze-sidebar-go-back': true,
expand: graphManagementStore.isExpanded
});

const sidebarGraphSelectionClassName = classnames({
'data-analyze-sidebar-graph-selection': true,
expand: graphManagementStore.isExpanded
Expand Down Expand Up @@ -91,9 +85,8 @@ const GraphManagementSidebar: React.FC = observer(() => {

const handleSelectId = useCallback(
(value: string) => {
const id = graphManagementStore.idList.find(
({ name }) => name === value
)!.id;
const id = graphManagementStore.idList.find(({ name }) => name === value)!
.id;

dataAnalyzeStore.resetIdState();
setLocation(`/graph-management/${id}/data-analyze`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
line-height: 22px;
text-align: center;

&.new,
&.scheduling,
&.scheduled,
&.queued,
&.restoring,
&.running {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ import classnames from 'classnames';
import { useRoute } from 'wouter';
import { useTranslation } from 'react-i18next';
import { isEmpty, size, intersection, without } from 'lodash-es';
import {
Breadcrumb,
Input,
Button,
Message,
Table,
Loading
} from 'hubble-ui';
import { Breadcrumb, Input, Button, Message, Table, Loading } from 'hubble-ui';

import {
GraphManagementStoreContext,
Expand Down Expand Up @@ -151,7 +144,7 @@ const AsyncTaskList: React.FC = observer(() => {
{t('async-tasks.table-filters.task-type.gremlin')}
</div>
<div onClick={handleFilterOptions('type', 'algorithm')}>
{t('async-tasks.table-filters.task-type.algorithm')}{' '}
{t('async-tasks.table-filters.task-type.algorithm')}
</div>
<div onClick={handleFilterOptions('type', 'remove_schema')}>
{t('async-tasks.table-filters.task-type.remove-schema')}
Expand Down Expand Up @@ -231,6 +224,10 @@ const AsyncTaskList: React.FC = observer(() => {
timeString += ' ' + restTime + 'ms';
}

if (restTime <= 0) {
timeString = '0s';
}

return <div className="no-line-break">{timeString}</div>;
}
},
Expand Down Expand Up @@ -412,7 +409,7 @@ const AsyncTaskList: React.FC = observer(() => {
<div className="async-task-list-content-header">
<Input.Search
size="medium"
width={205}
width={215}
placeholder={t('async-tasks.placeholders.search')}
value={asyncTasksStore.searchWords}
onChange={handleSearchChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,33 @@
}
}

.query-tab-algorithm-wrapper,
.query-tab-content-wrapper {
padding: 16px;
background: #fff;
border-radius: 3px 3px 3px 3px;
}

.query-tab-algorithm-wrapper {
// min-width: 1220px;
overflow: auto;

.new-fc-one-input-error.new-fc-one-input-error-right {
left: 0;
top: 30px;
}
}

.query-tab-algorithm-hint {
width: fit-content;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.15);
line-height: 18px;
padding: 16px;
color: #e64552;
font-size: 14px;
text-align: center;
}

.query-tab-content {
display: flex;
}
Expand Down Expand Up @@ -238,15 +259,6 @@
background-color: #f2f7ff;
cursor: pointer;
}

&.query-tab-content-menu-item-disabled {
color: #ccc;
cursor: not-allowed;

&:hover {
background-color: #fff;
}
}
}
}

Expand Down Expand Up @@ -303,10 +315,6 @@
padding: 16px 8px;
margin-bottom: 16px;

&-invalid {
border: 1px solid #e64552;
}

&:last-child {
margin-bottom: 0;
}
Expand All @@ -322,6 +330,40 @@
}
}

.query-tab-content-internal-expand-row {
width: 390px;
display: flex;
// justify-content: space-between;
height: 32px;
margin-bottom: 16px;
}

.query-tab-content-internal-expand-input {
margin: 0 14px 0 16px;
}

.query-tab-content-internal-expand-manipulation {
&-enable,
&-disabled {
font-size: 14px;
line-height: 20px;
margin-bottom: 32px;
padding-left: 172px;

& span {
cursor: pointer;
}
}

&-enable {
color: #2b65ff;
}

&-disabled {
color: #999;
}
}

.query-tab-code-edit {
width: calc(100% - 55px);

Expand Down Expand Up @@ -441,6 +483,7 @@
border-right: 1px solid #e0e0e0;
display: flex;
flex-direction: column;
overflow-y: auto;

&-options {
width: 61px;
Expand Down Expand Up @@ -595,6 +638,14 @@
& > img {
margin-bottom: 10px;
}

& > span {
display: block;
width: 80%;
text-align: center;
max-height: 200px;
overflow: auto;
}
}
}

Expand Down Expand Up @@ -830,8 +881,12 @@
}

& > div {
flex-basis: 50%;
// flex-basis: 50%;
line-height: 32px;

&:first-child {
width: 162px;
}
}
}
}
Expand Down Expand Up @@ -1131,3 +1186,12 @@ div.vis-tooltip {
pointer-events: none;
z-index: 5;
}

// refer to index.less, this should be fixed in the future version
.data-analyze-dynamic-add-options .new-fc-one-input-all-container {
position: relative;
}

.data-analyze-graph-node-info .new-fc-one-input-all-container {
position: relative;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const DataAnalyze: React.FC = observer(() => {
dataAnalyzeStore.setCurrentId(Number(params.id));
dataAnalyzeStore.fetchValueTypes();
dataAnalyzeStore.fetchVertexTypes();
dataAnalyzeStore.fetchAllPropertyIndexes('vertex');
dataAnalyzeStore.fetchEdgeTypes();
dataAnalyzeStore.fetchAllNodeStyle();
dataAnalyzeStore.fetchAllEdgeStyle();
Expand All @@ -70,9 +71,9 @@ const DataAnalyze: React.FC = observer(() => {
{t('addition.dataAnalyze.return-home')}
</Button>
]}
visible={Object.values(dataAnalyzeStore.errorInfo)
.map(({ code }) => code)
.includes(401)}
visible={graphManagementStore.graphData.some(
({ id, enabled }) => dataAnalyzeStore.currentId === id && !enabled
)}
destroyOnClose
needCloseIcon={false}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ const DataAnalyzeInfoDrawer: React.FC = observer(() => {
marginTop: !isEdit ? 0 : nullableIndex === 0 ? 8 : 32
}}
>
<div>{key}: </div>
<div title={key}>{key}: </div>
{!isEdit ? (
<div>{convertArrayToString(value)}</div>
) : (
Expand Down
Loading