28 | */
29 | (function ($) {
30 | $.fn.selectpicker.defaults = {
31 | noneSelectedText: 'لم يتم إختيار شئ',
32 | noneResultsText: 'لا توجد نتائج مطابقة لـ {0}',
33 | countSelectedText: function (numSelected, numTotal) {
34 | return (numSelected == 1) ? "{0} خيار تم إختياره" : "{0} خيارات تمت إختيارها";
35 | },
36 | maxOptionsText: function (numAll, numGroup) {
37 | return [
38 | (numAll == 1) ? 'تخطى الحد المسموح ({n} خيار بحد أقصى)' : 'تخطى الحد المسموح ({n} خيارات بحد أقصى)',
39 | (numGroup == 1) ? 'تخطى الحد المسموح للمجموعة ({n} خيار بحد أقصى)' : 'تخطى الحد المسموح للمجموعة ({n} خيارات بحد أقصى)'
40 | ];
41 | },
42 | selectAllText: 'إختيار الجميع',
43 | deselectAllText: 'إلغاء إختيار الجميع',
44 | multipleSeparator: '، '
45 | };
46 | })(jQuery);
47 |
48 |
49 | }));
50 |
--------------------------------------------------------------------------------
/studio-ui/assets/vendors/font-awesome/less/mixins.less:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------
3 |
4 | .fa-icon() {
5 | display: inline-block;
6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
14 | .fa-icon-rotate(@degrees, @rotation) {
15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})";
16 | -webkit-transform: rotate(@degrees);
17 | -ms-transform: rotate(@degrees);
18 | transform: rotate(@degrees);
19 | }
20 |
21 | .fa-icon-flip(@horiz, @vert, @rotation) {
22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)";
23 | -webkit-transform: scale(@horiz, @vert);
24 | -ms-transform: scale(@horiz, @vert);
25 | transform: scale(@horiz, @vert);
26 | }
27 |
28 |
29 | // Only display content to screen readers. A la Bootstrap 4.
30 | //
31 | // See: http://a11yproject.com/posts/how-to-hide-content/
32 |
33 | .sr-only() {
34 | position: absolute;
35 | width: 1px;
36 | height: 1px;
37 | padding: 0;
38 | margin: -1px;
39 | overflow: hidden;
40 | clip: rect(0,0,0,0);
41 | border: 0;
42 | }
43 |
44 | // Use in conjunction with .sr-only to only display content when it's focused.
45 | //
46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
47 | //
48 | // Credit: HTML5 Boilerplate
49 |
50 | .sr-only-focusable() {
51 | &:active,
52 | &:focus {
53 | position: static;
54 | width: auto;
55 | height: auto;
56 | margin: 0;
57 | overflow: visible;
58 | clip: auto;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/studio-ui/assets/vendors/font-awesome/scss/_mixins.scss:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------
3 |
4 | @mixin fa-icon() {
5 | display: inline-block;
6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
14 | @mixin fa-icon-rotate($degrees, $rotation) {
15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})";
16 | -webkit-transform: rotate($degrees);
17 | -ms-transform: rotate($degrees);
18 | transform: rotate($degrees);
19 | }
20 |
21 | @mixin fa-icon-flip($horiz, $vert, $rotation) {
22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)";
23 | -webkit-transform: scale($horiz, $vert);
24 | -ms-transform: scale($horiz, $vert);
25 | transform: scale($horiz, $vert);
26 | }
27 |
28 |
29 | // Only display content to screen readers. A la Bootstrap 4.
30 | //
31 | // See: http://a11yproject.com/posts/how-to-hide-content/
32 |
33 | @mixin sr-only {
34 | position: absolute;
35 | width: 1px;
36 | height: 1px;
37 | padding: 0;
38 | margin: -1px;
39 | overflow: hidden;
40 | clip: rect(0,0,0,0);
41 | border: 0;
42 | }
43 |
44 | // Use in conjunction with .sr-only to only display content when it's focused.
45 | //
46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
47 | //
48 | // Credit: HTML5 Boilerplate
49 |
50 | @mixin sr-only-focusable {
51 | &:active,
52 | &:focus {
53 | position: static;
54 | width: auto;
55 | height: auto;
56 | margin: 0;
57 | overflow: visible;
58 | clip: auto;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/studio-ui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "web",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "build": "webpack",
9 | "start": "webpack-dev-server"
10 | },
11 | "author": "hhp",
12 | "license": "ISC",
13 | "devDependencies": {
14 | "babel-core": "^6.24.1",
15 | "babel-loader": "^7.0.0",
16 | "babel-plugin-syntax-dynamic-import": "^6.18.0",
17 | "babel-plugin-transform-decorators-legacy": "^1.3.4",
18 | "babel-preset-es2015": "^6.24.1",
19 | "babel-preset-react": "^6.24.1",
20 | "babel-preset-stage-0": "^6.24.1",
21 | "css-loader": "^0.28.4",
22 | "exports-loader": "^0.6.4",
23 | "extract-text-webpack-plugin": "^2.1.2",
24 | "file-loader": "^0.11.1",
25 | "font-awesome": "^4.7.0",
26 | "font-awesome-webpack": "0.0.5-beta.2",
27 | "html-loader": "^0.4.5",
28 | "html-webpack-plugin": "^2.29.0",
29 | "image-webpack-loader": "^3.3.1",
30 | "imports-loader": "^0.7.1",
31 | "jsx-loader": "^0.13.2",
32 | "less": "^2.7.2",
33 | "less-loader": "^4.0.4",
34 | "markdown": "^0.5.0",
35 | "moment": "^2.18.1",
36 | "react-hot-loader": "^3.0.0-beta.7",
37 | "react-router-dom": "^4.1.1",
38 | "react-time": "^4.3.0",
39 | "redux-devtools": "^3.4.0",
40 | "style-loader": "^0.18.1",
41 | "url-loader": "^0.5.8",
42 | "webpack": "^2.6.0",
43 | "webpack-dev-server": "^3.1.11",
44 | "whatwg-fetch": "^2.0.3"
45 | },
46 | "dependencies": {
47 | "classnames": "^2.2.5",
48 | "lodash.assign": "^4.2.0",
49 | "radium": "0.18.0",
50 | "react": "^15.5.4",
51 | "react-addons-css-transition-group": "^15.6.0",
52 | "react-bootstrap": "^0.31.0",
53 | "react-dom": "^15.5.4",
54 | "react-modal-bootstrap": "^1.1.1",
55 | "react-redux": "^5.0.5",
56 | "redux": "^3.6.0",
57 | "redux-thunk": "^2.2.0"
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/studio-ui/assets/vendors/ace/ace-builds/src-noconflict/ext-statusbar.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"], function(require, exports, module) {
2 | "use strict";
3 | var dom = require("ace/lib/dom");
4 | var lang = require("ace/lib/lang");
5 |
6 | var StatusBar = function(editor, parentNode) {
7 | this.element = dom.createElement("div");
8 | this.element.className = "ace_status-indicator";
9 | this.element.style.cssText = "display: inline-block;";
10 | parentNode.appendChild(this.element);
11 |
12 | var statusUpdate = lang.delayedCall(function(){
13 | this.updateStatus(editor)
14 | }.bind(this)).schedule.bind(null, 100);
15 |
16 | editor.on("changeStatus", statusUpdate);
17 | editor.on("changeSelection", statusUpdate);
18 | editor.on("keyboardActivity", statusUpdate);
19 | };
20 |
21 | (function(){
22 | this.updateStatus = function(editor) {
23 | var status = [];
24 | function add(str, separator) {
25 | str && status.push(str, separator || "|");
26 | }
27 |
28 | add(editor.keyBinding.getStatusText(editor));
29 | if (editor.commands.recording)
30 | add("REC");
31 |
32 | var sel = editor.selection;
33 | var c = sel.lead;
34 |
35 | if (!sel.isEmpty()) {
36 | var r = editor.getSelectionRange();
37 | add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")", " ");
38 | }
39 | add(c.row + ":" + c.column, " ");
40 | if (sel.rangeCount)
41 | add("[" + sel.rangeCount + "]", " ");
42 | status.pop();
43 | this.element.textContent = status.join("");
44 | };
45 | }).call(StatusBar.prototype);
46 |
47 | exports.StatusBar = StatusBar;
48 |
49 | });
50 | (function() {
51 | ace.require(["ace/ext/statusbar"], function() {});
52 | })();
53 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/query/cardfooter.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 |
22 | export default class CardFooter extends React.Component {
23 |
24 | constructor() {
25 | super();
26 | }
27 |
28 | render() {
29 | return (
30 |
31 | {this.showFooter()}
32 |
33 | );
34 | }
35 |
36 | showFooter = () => {
37 | if (this.props.result !== undefined && this.props.result !== null) {
38 | if (this.props.result.duration !== undefined &&
39 | this.props.result.duration !== null) {
40 | return (
41 |
42 | Real-time Success.
43 | Duration {this.props.result.duration * 1.0 / 1000}s.
44 |
45 | {this.props.result.message}
46 |
47 | );
48 | } else {
49 | return ;
50 | }
51 | } else {
52 | return
53 | }
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/studio-dist/src/assembly/static/conf/hugegraph-studio.properties:
--------------------------------------------------------------------------------
1 | studio.server.port=8088
2 | studio.server.host=localhost
3 |
4 | graph.server.host=localhost
5 | graph.server.port=8080
6 | graph.name=hugegraph
7 |
8 | client.timeout=30
9 |
10 | # the directory name released by react
11 | studio.server.ui=ui
12 | # the file location of studio-api.war
13 | studio.server.api.war=war/studio-api.war
14 | # default folder in your home directory, set to a non-empty value to override
15 | data.base_directory=.hugegraph-studio
16 |
17 | show.limit.data=250
18 | show.limit.edge.total=1000
19 | show.limit.edge.increment=20
20 |
21 | # separator ','
22 | gremlin.limit_suffix=[.V(),.E(),.hasLabel(STR),.hasLabel(NUM),.path()]
23 |
24 | # ui graph style
25 | vertex.vis.font.color=#343434
26 | vertex.vis.font.size=12
27 | vertex.vis.size=25
28 | vertex.vis.scaling.min=25
29 | vertex.vis.scaling.max=30
30 | vertex.vis.shape=dot
31 | vertex.vis.color=[\
32 | {"default":"#ED5736","hover":"#312520","highlight":"#ED5736"},\
33 | {"default":"#4C8DAE","hover":"#312520","highlight":"#4C8DAE"},\
34 | {"default":"#FF8C31","hover":"#312520","highlight":"#FF8C31"},\
35 | {"default":"#F47983","hover":"#312520","highlight":"#F47983"},\
36 | {"default":"#48C0A3","hover":"#312520","highlight":"#48C0A3"},\
37 | {"default":"#3B2E7E","hover":"#312520","highlight":"#3B2E7E"},\
38 | {"default":"#60281E","hover":"#312520","highlight":"#60281E"},\
39 | {"default":"#B36D61","hover":"#312520","highlight":"#B36D61"},\
40 | {"default":"#C89B40","hover":"#312520","highlight":"#C89B40"},\
41 | {"default":"#8D4BBB","hover":"#312520","highlight":"#8D4BBB"},\
42 | {"default":"#6E511E","hover":"#312520","highlight":"#6E511E"},\
43 | {"default":"#789262","hover":"#312520","highlight":"#789262"},\
44 | {"default":"#177CB0","hover":"#312520","highlight":"#177CB0"},\
45 | {"default":"#8C4356","hover":"#312520","highlight":"#8C4356"}\
46 | ]
47 |
48 | edge.vis.color.default=#A0A0A0
49 | edge.vis.color.hover=#808080
50 | edge.vis.color.highlight=#606060
51 | edge.vis.font.color=#77777
52 | edge.vis.font.size=11
53 |
--------------------------------------------------------------------------------
/studio-api/src/main/java/com/baidu/hugegraph/studio/board/HugeClientWrapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations under
17 | * the License.
18 | */
19 |
20 | package com.baidu.hugegraph.studio.board;
21 |
22 | import com.baidu.hugegraph.driver.HugeClient;
23 | import com.baidu.hugegraph.driver.HugeClientBuilder;
24 | import com.baidu.hugegraph.studio.config.StudioApiConfig;
25 |
26 | public final class HugeClientWrapper {
27 |
28 | private static volatile HugeClient instance;
29 |
30 | public static HugeClient get(StudioApiConfig config) {
31 | if (instance == null) {
32 | synchronized(HugeClientWrapper.class) {
33 | if (instance == null) {
34 | instance = newHugeClient(config);
35 | }
36 | }
37 | }
38 | return instance;
39 | }
40 |
41 | private HugeClientWrapper() {}
42 |
43 | private static HugeClient newHugeClient(StudioApiConfig config) {
44 | HugeClientBuilder builder;
45 | builder = new HugeClientBuilder(config.getGraphServerUrl(),
46 | config.getGraphName());
47 | builder.configTimeout(config.getClientTimeout());
48 | return builder.build();
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/studio-dist/src/assembly/descriptor/assembly.xml:
--------------------------------------------------------------------------------
1 |
2 | distribution
3 | /
4 |
5 |
6 | dir
7 |
8 |
9 |
10 |
11 | ${assembly.static.dir}/bin
12 | bin
13 |
14 | *
15 |
16 | 755
17 |
18 |
19 | ${assembly.static.dir}
20 | /
21 | false
22 |
23 |
24 | ${project.build.directory}
25 | lib
26 |
27 | *.jar
28 |
29 |
30 |
31 | ${top.level.basedir}/studio-api/target
32 | /war
33 |
34 | *.war
35 |
36 |
37 |
38 | ${top.level.basedir}
39 | /
40 |
41 | README*
42 | LICENSE*
43 | NOTICE*
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | /lib
52 | false
53 | runtime
54 | false
55 |
56 | *:*:jar:*
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/commoncomponents/validator.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Data validator
22 | *
23 | * @param {value} p1 the value which need be verified
24 | * @return {Json Object} the result ,
25 | * like {flag:true or false,message:'information ...'}
26 | */
27 | export var isNumber = (value, message = 'Please input number') => {
28 | let regex = /^\+?[1-9][0-9]*$/;
29 | const result = {
30 | flag: regex.test(value),
31 | message: message
32 | }
33 | return result;
34 | }
35 |
36 | export var isNull = (value, message = 'Please enter a value') => {
37 | let flag = true;
38 | if (value === '' || value === null || value === undefined) {
39 | flag = false;
40 | }
41 | const result = {
42 | flag: flag,
43 | message: message
44 | }
45 | return result;
46 | }
47 |
48 | export var isIp = (value, message = 'Please enter a host,like x.x.x.x') => {
49 | let regex = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
50 | const result = {
51 | flag: regex.test(value),
52 | message: message
53 | }
54 | return result;
55 | }
56 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/commoncomponents/select.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 |
22 | export default class Select extends React.Component {
23 |
24 | constructor() {
25 | super();
26 | this.state = {value: ''};
27 | this.handleSelectChange = this.handleSelectChange.bind(this);
28 | }
29 |
30 | handleSelectChange(event) {
31 | this.setState({value: event.target.value});
32 | this.props.onChange(event.target.name, event.target.value);
33 | }
34 |
35 | componentWillReceiveProps(nextProps) {
36 | this.setState({value: nextProps.value});
37 | this.props.onChange(nextProps.name, nextProps.value);
38 | }
39 |
40 | render() {
41 | return (
42 |
43 |
52 |
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/reducers.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import {alerts} from './common/reducers';
21 |
22 | import {queryPanel} from './query/reducers';
23 | import {CHANGE_HEAD_MODE} from './actions';
24 |
25 | const initialState = {
26 | alerts: {
27 | items: [],
28 | lastKey: -1
29 | },
30 | headMode: {
31 | fullScreen: true
32 | },
33 | queryPanel: {
34 | card: {
35 | "id": "card_default",
36 | "language": "gremlin",
37 | "code": "",
38 | "cardConfig": {
39 | "cardHeight": null,
40 | "cardWidth": null,
41 | "fullScreen": true,
42 | "editorView": true
43 | }
44 | }
45 | }
46 | };
47 |
48 | export function operation(state = initialState, action) {
49 | return {
50 | alerts: alerts(state.alerts, action),
51 | headMode: headMode(state.headMode, action),
52 | queryPanel: queryPanel(state.queryPanel, action)
53 | };
54 | }
55 |
56 | function headMode(state = {}, action) {
57 | switch (action.type) {
58 | case CHANGE_HEAD_MODE:
59 | return {
60 | ...state,
61 | ...action.mode
62 | };
63 | default:
64 | return state;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/common/alertlist.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 | import {Alert} from 'react-bootstrap';
22 | import {connect} from 'react-redux';
23 | import {hideAllAlert, alertHide} from './actions';
24 |
25 | class AlertList extends React.Component {
26 | constructor() {
27 | super();
28 | }
29 |
30 | componentDidMount() {
31 | this.props.hideAllAlert();
32 | }
33 |
34 | render() {
35 | return (
36 |
37 | {this.props.alerts.items.map((item, i) => (
38 |
this.props.alertHide(item.key)}>
42 | {item.messageText}
43 |
44 | ))}
45 |
46 | );
47 | }
48 | }
49 |
50 | // Map Redux state to component props
51 | function mapStateToProps(state) {
52 | return {
53 | alerts: state.alerts
54 | };
55 | }
56 |
57 | // Map Redux actions to component props
58 | function mapDispatchToProps(dispatch) {
59 | return {
60 | alertHide: key => dispatch(alertHide(key)),
61 | hideAllAlert: () => dispatch(hideAllAlert())
62 | };
63 | }
64 |
65 | // Connected Component
66 | export default connect(
67 | mapStateToProps,
68 | mapDispatchToProps
69 | )(AlertList);
70 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/commoncomponents/alertmodal.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 | import Modal from './modal';
22 |
23 | export default class AlertModal extends React.Component {
24 |
25 | render() {
26 | return (
27 |
28 |
29 |
36 |
37 |
{this.props.message}
38 |
39 |
40 |
41 |
47 |
52 |
53 |
54 | )
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/query/code.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 | import { LOADING_ID_SUFFIX } from './querycard';
22 |
23 | export default class Code extends React.Component {
24 |
25 | constructor() {
26 | super();
27 | }
28 |
29 | shouldComponentUpdate(nextProps, nextState) {
30 | if (document.getElementById(this.props.id) !== null) {
31 | document.getElementById(this.props.id).style.height =
32 | nextProps.height + 'px';
33 | }
34 | if (this.props.content === nextProps.content) {
35 | return false;
36 | } else {
37 | return true;
38 | }
39 | }
40 |
41 | render() {
42 | return (
43 |
45 |
46 | );
47 | }
48 |
49 | componentDidUpdate() {
50 | let paneJson = '#' + this.props.id;
51 | let json = JSON.stringify(this.props.content);
52 | $(paneJson).JSONView(json, {collapsed: true});
53 | this.loadDone();
54 | }
55 |
56 | componentDidMount() {
57 | let paneJson = '#' + this.props.id;
58 | let json = JSON.stringify(this.props.content);
59 | $(paneJson).JSONView(json, {collapsed: true});
60 | this.loadDone();
61 | }
62 |
63 | loadDone = () => {
64 | let loadingId = this.props.cardId + LOADING_ID_SUFFIX;
65 | document.getElementById(loadingId).style.display = 'none';
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/commoncomponents/dropdownmenu.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 | import {Nav, NavDropdown, MenuItem} from 'react-bootstrap';
22 |
23 | export default class DropDownMenu extends React.Component {
24 |
25 | constructor() {
26 | super();
27 | this.state = {selectMenu: ''};
28 | }
29 |
30 | componentDidMount() {
31 |
32 | if (this.props.initItem !== undefined) {
33 | this.setState({selectMenu: this.props.initItem});
34 | } else {
35 | if (this.props.menuItems !== undefined &&
36 | this.props.menuItems.length > 0) {
37 | this.setState({selectMenu: this.props.menuItems[0]});
38 | } else {
39 | this.setState({selectMenu: ''});
40 | }
41 | }
42 | }
43 |
44 | handleSelect = (eventKey) => {
45 | this.setState({selectMenu: `${eventKey}`});
46 | this.props.onChange(`${eventKey}`);
47 | }
48 |
49 | render() {
50 | let menuItems = this.props.menuItems.map((item, index) =>
51 |
52 | );
53 | let title = this.state.selectMenu;
54 | let finTitle = title.toLowerCase()
55 | .replace(/[a-z]/, (L) => L.toUpperCase());
56 |
57 | return (
58 |
64 | );
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/studio-api/src/main/java/com/baidu/hugegraph/studio/board/model/Board.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations under
17 | * the License.
18 | */
19 |
20 | package com.baidu.hugegraph.studio.board.model;
21 |
22 | import java.time.Instant;
23 |
24 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
25 | import com.fasterxml.jackson.annotation.JsonProperty;
26 |
27 | /**
28 | * Board entity for jersey restful api, and will be return as json.
29 | * A page contains many cards.
30 | */
31 | @JsonIgnoreProperties(ignoreUnknown = true)
32 | public class Board {
33 |
34 | @JsonProperty("createTime")
35 | private Long createTime;
36 | @JsonProperty("updateTime")
37 | private Long updateTime;
38 | @JsonProperty("card")
39 | private Card card;
40 | @JsonProperty("result")
41 | private QueryResult result;
42 |
43 | /**
44 | * Instantiates a new Board.
45 | */
46 | public Board() {
47 | this.createTime = Instant.now().getEpochSecond();
48 | this.updateTime = this.createTime;
49 | this.card = new Card();
50 | this.result = null;
51 | }
52 |
53 | public Long getCreateTime() {
54 | return createTime;
55 | }
56 |
57 | public Long getUpdateTime() {
58 | return updateTime;
59 | }
60 |
61 | public void setUpdateTime(Long updateTime) {
62 | this.updateTime = updateTime;
63 | }
64 |
65 | public Card getCard() {
66 | return card;
67 | }
68 |
69 | public void setCard(Card card) {
70 | this.card = card;
71 | }
72 |
73 | public QueryResult getResult() {
74 | return result;
75 | }
76 |
77 | public void setResult(QueryResult result) {
78 | this.result = result;
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/studio-dist/src/main/java/com/baidu/hugegraph/studio/config/StudioServerConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations under
17 | * the License.
18 | */
19 |
20 | package com.baidu.hugegraph.studio.config;
21 |
22 | import org.slf4j.Logger;
23 |
24 | import com.baidu.hugegraph.config.HugeConfig;
25 | import com.baidu.hugegraph.config.OptionSpace;
26 | import com.baidu.hugegraph.util.Log;
27 |
28 | /**
29 | * The type Studio configuration.
30 | */
31 | public class StudioServerConfig {
32 |
33 | private static final Logger LOG = Log.logger(StudioServerConfig.class);
34 |
35 | static {
36 | OptionSpace.register("studio", StudioServerOptions.instance());
37 | }
38 |
39 | private HugeConfig config;
40 |
41 | public StudioServerConfig(final String fileName) {
42 | // hugegraph-studio.sh -Dstudio.home="$STUDIO_HOME"
43 | final String homeDir = System.getProperty("studio.home");
44 | config = new HugeConfig(String.format("%s/conf/%s",
45 | homeDir, fileName));
46 | }
47 |
48 | public int getHttpPort() {
49 | return this.config.get(StudioServerOptions.STUDIO_SERVER_HTTP_PORT);
50 | }
51 |
52 | public String getHttpBindAddress() {
53 | return this.config.get(StudioServerOptions.STUDIO_SERVER_HTTP_BIND_ADDRESS);
54 | }
55 |
56 | public String getServerBasePath() {
57 | return this.config.get(StudioServerOptions.STUDIO_SERVER_BASE_PATH);
58 | }
59 |
60 | public String getServerUIDirectory() {
61 | return this.config.get(StudioServerOptions.STUDIO_SERVER_UI_DIR);
62 | }
63 |
64 | public String getServerWarDirectory() {
65 | return this.config.get(StudioServerOptions.STUDIO_SERVER_WAR_DIR);
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/query/errorresult.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 |
22 | export default class ErrorResult extends React.Component {
23 |
24 | constructor() {
25 | super();
26 | this.state = {
27 | showDetail: false
28 | }
29 | }
30 |
31 | render() {
32 | let display = this.state.showDetail ? 'block' : 'none';
33 | let errorPanel =
34 |
35 |
Error!
36 | ;
37 | let detailedMsg = this.props.msg.detailedMsg;
38 |
39 |
40 | if (detailedMsg !== undefined) {
41 | errorPanel =
42 |
43 |
Error!
44 |
45 | {detailedMsg}
46 |
47 |
50 |
51 |
;
52 | }
53 |
54 | return (
55 |
56 | {errorPanel}
57 |
58 | );
59 | }
60 |
61 | showDetail = () => {
62 | this.setState({
63 | showDetail: !this.state.showDetail
64 | });
65 | }
66 |
67 | componentDidUpdate() {
68 | this.loadDone();
69 | }
70 |
71 | componentDidMount() {
72 | this.loadDone();
73 | }
74 |
75 | loadDone = () => {
76 | let loadingId = this.props.id + '_loading';
77 | document.getElementById(loadingId).style.display = 'none';
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/studio-ui/assets/vendors/ace/ace-builds/src-noconflict/snippets/markdown.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/snippets/markdown",["require","exports","module"], function(require, exports, module) {
2 | "use strict";
3 |
4 | exports.snippetText = "# Markdown\n\
5 | \n\
6 | # Includes octopress (http://octopress.org/) snippets\n\
7 | \n\
8 | snippet [\n\
9 | [${1:text}](http://${2:address} \"${3:title}\")\n\
10 | snippet [*\n\
11 | [${1:link}](${2:`@*`} \"${3:title}\")${4}\n\
12 | \n\
13 | snippet [:\n\
14 | [${1:id}]: http://${2:url} \"${3:title}\"\n\
15 | snippet [:*\n\
16 | [${1:id}]: ${2:`@*`} \"${3:title}\"\n\
17 | \n\
18 | snippet \n\
20 | snippet ${4}\n\
22 | \n\
23 | snippet ![:\n\
24 | ![${1:id}]: ${2:url} \"${3:title}\"\n\
25 | snippet ![:*\n\
26 | ![${1:id}]: ${2:`@*`} \"${3:title}\"\n\
27 | \n\
28 | snippet ===\n\
29 | regex /^/=+/=*//\n\
30 | ${PREV_LINE/./=/g}\n\
31 | \n\
32 | ${0}\n\
33 | snippet ---\n\
34 | regex /^/-+/-*//\n\
35 | ${PREV_LINE/./-/g}\n\
36 | \n\
37 | ${0}\n\
38 | snippet blockquote\n\
39 | {% blockquote %}\n\
40 | ${1:quote}\n\
41 | {% endblockquote %}\n\
42 | \n\
43 | snippet blockquote-author\n\
44 | {% blockquote ${1:author}, ${2:title} %}\n\
45 | ${3:quote}\n\
46 | {% endblockquote %}\n\
47 | \n\
48 | snippet blockquote-link\n\
49 | {% blockquote ${1:author} ${2:URL} ${3:link_text} %}\n\
50 | ${4:quote}\n\
51 | {% endblockquote %}\n\
52 | \n\
53 | snippet bt-codeblock-short\n\
54 | ```\n\
55 | ${1:code_snippet}\n\
56 | ```\n\
57 | \n\
58 | snippet bt-codeblock-full\n\
59 | ``` ${1:language} ${2:title} ${3:URL} ${4:link_text}\n\
60 | ${5:code_snippet}\n\
61 | ```\n\
62 | \n\
63 | snippet codeblock-short\n\
64 | {% codeblock %}\n\
65 | ${1:code_snippet}\n\
66 | {% endcodeblock %}\n\
67 | \n\
68 | snippet codeblock-full\n\
69 | {% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %}\n\
70 | ${5:code_snippet}\n\
71 | {% endcodeblock %}\n\
72 | \n\
73 | snippet gist-full\n\
74 | {% gist ${1:gist_id} ${2:filename} %}\n\
75 | \n\
76 | snippet gist-short\n\
77 | {% gist ${1:gist_id} %}\n\
78 | \n\
79 | snippet img\n\
80 | {% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${6:alt_text} %}\n\
81 | \n\
82 | snippet youtube\n\
83 | {% youtube ${1:video_id} %}\n\
84 | \n\
85 | # The quote should appear only once in the text. It is inherently part of it.\n\
86 | # See http://octopress.org/docs/plugins/pullquote/ for more info.\n\
87 | \n\
88 | snippet pullquote\n\
89 | {% pullquote %}\n\
90 | ${1:text} {\" ${2:quote} \"} ${3:text}\n\
91 | {% endpullquote %}\n\
92 | ";
93 | exports.scope = "markdown";
94 |
95 | });
96 |
--------------------------------------------------------------------------------
/studio-ui/assets/vendors/ace/ace-builds/src-noconflict/ext-spellcheck.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"], function(require, exports, module) {
2 | "use strict";
3 | var event = require("../lib/event");
4 |
5 | exports.contextMenuHandler = function(e){
6 | var host = e.target;
7 | var text = host.textInput.getElement();
8 | if (!host.selection.isEmpty())
9 | return;
10 | var c = host.getCursorPosition();
11 | var r = host.session.getWordRange(c.row, c.column);
12 | var w = host.session.getTextRange(r);
13 |
14 | host.session.tokenRe.lastIndex = 0;
15 | if (!host.session.tokenRe.test(w))
16 | return;
17 | var PLACEHOLDER = "\x01\x01";
18 | var value = w + " " + PLACEHOLDER;
19 | text.value = value;
20 | text.setSelectionRange(w.length, w.length + 1);
21 | text.setSelectionRange(0, 0);
22 | text.setSelectionRange(0, w.length);
23 |
24 | var afterKeydown = false;
25 | event.addListener(text, "keydown", function onKeydown() {
26 | event.removeListener(text, "keydown", onKeydown);
27 | afterKeydown = true;
28 | });
29 |
30 | host.textInput.setInputHandler(function(newVal) {
31 | console.log(newVal , value, text.selectionStart, text.selectionEnd)
32 | if (newVal == value)
33 | return '';
34 | if (newVal.lastIndexOf(value, 0) === 0)
35 | return newVal.slice(value.length);
36 | if (newVal.substr(text.selectionEnd) == value)
37 | return newVal.slice(0, -value.length);
38 | if (newVal.slice(-2) == PLACEHOLDER) {
39 | var val = newVal.slice(0, -2);
40 | if (val.slice(-1) == " ") {
41 | if (afterKeydown)
42 | return val.substring(0, text.selectionEnd);
43 | val = val.slice(0, -1);
44 | host.session.replace(r, val);
45 | return "";
46 | }
47 | }
48 |
49 | return newVal;
50 | });
51 | };
52 | var Editor = require("../editor").Editor;
53 | require("../config").defineOptions(Editor.prototype, "editor", {
54 | spellcheck: {
55 | set: function(val) {
56 | var text = this.textInput.getElement();
57 | text.spellcheck = !!val;
58 | if (!val)
59 | this.removeListener("nativecontextmenu", exports.contextMenuHandler);
60 | else
61 | this.on("nativecontextmenu", exports.contextMenuHandler);
62 | },
63 | value: true
64 | }
65 | });
66 |
67 | });
68 | (function() {
69 | ace.require(["ace/ext/spellcheck"], function() {});
70 | })();
71 |
--------------------------------------------------------------------------------
/studio-ui/assets/vendors/ace/ace-builds/src-noconflict/ext-themelist.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"], function(require, exports, module) {
2 | "use strict";
3 | require("ace/lib/fixoldbrowsers");
4 |
5 | var themeData = [
6 | ["Chrome" ],
7 | ["Clouds" ],
8 | ["Crimson Editor" ],
9 | ["Dawn" ],
10 | ["Dreamweaver" ],
11 | ["Eclipse" ],
12 | ["GitHub" ],
13 | ["IPlastic" ],
14 | ["Solarized Light"],
15 | ["TextMate" ],
16 | ["Tomorrow" ],
17 | ["XCode" ],
18 | ["Kuroir"],
19 | ["KatzenMilch"],
20 | ["SQL Server" ,"sqlserver" , "light"],
21 | ["Ambiance" ,"ambiance" , "dark"],
22 | ["Chaos" ,"chaos" , "dark"],
23 | ["Clouds Midnight" ,"clouds_midnight" , "dark"],
24 | ["Cobalt" ,"cobalt" , "dark"],
25 | ["Gruvbox" ,"gruvbox" , "dark"],
26 | ["Green on Black" ,"gob" , "dark"],
27 | ["idle Fingers" ,"idle_fingers" , "dark"],
28 | ["krTheme" ,"kr_theme" , "dark"],
29 | ["Merbivore" ,"merbivore" , "dark"],
30 | ["Merbivore Soft" ,"merbivore_soft" , "dark"],
31 | ["Mono Industrial" ,"mono_industrial" , "dark"],
32 | ["Monokai" ,"monokai" , "dark"],
33 | ["Pastel on dark" ,"pastel_on_dark" , "dark"],
34 | ["Solarized Dark" ,"solarized_dark" , "dark"],
35 | ["Terminal" ,"terminal" , "dark"],
36 | ["Tomorrow Night" ,"tomorrow_night" , "dark"],
37 | ["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"],
38 | ["Tomorrow Night Bright","tomorrow_night_bright" , "dark"],
39 | ["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"],
40 | ["Twilight" ,"twilight" , "dark"],
41 | ["Vibrant Ink" ,"vibrant_ink" , "dark"]
42 | ];
43 |
44 |
45 | exports.themesByName = {};
46 | exports.themes = themeData.map(function(data) {
47 | var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
48 | var theme = {
49 | caption: data[0],
50 | theme: "ace/theme/" + name,
51 | isDark: data[2] == "dark",
52 | name: name
53 | };
54 | exports.themesByName[name] = theme;
55 | return theme;
56 | });
57 |
58 | });
59 | (function() {
60 | ace.require(["ace/ext/themelist"], function() {});
61 | })();
62 |
--------------------------------------------------------------------------------
/studio-ui/assets/vendors/ace/ace-builds/src-noconflict/theme-clouds.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/clouds",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = false;
4 | exports.cssClass = "ace-clouds";
5 | exports.cssText = ".ace-clouds .ace_gutter {\
6 | background: #ebebeb;\
7 | color: #333\
8 | }\
9 | .ace-clouds .ace_print-margin {\
10 | width: 1px;\
11 | background: #e8e8e8\
12 | }\
13 | .ace-clouds {\
14 | background-color: #FFFFFF;\
15 | color: #000000\
16 | }\
17 | .ace-clouds .ace_cursor {\
18 | color: #000000\
19 | }\
20 | .ace-clouds .ace_marker-layer .ace_selection {\
21 | background: #BDD5FC\
22 | }\
23 | .ace-clouds.ace_multiselect .ace_selection.ace_start {\
24 | box-shadow: 0 0 3px 0px #FFFFFF;\
25 | }\
26 | .ace-clouds .ace_marker-layer .ace_step {\
27 | background: rgb(255, 255, 0)\
28 | }\
29 | .ace-clouds .ace_marker-layer .ace_bracket {\
30 | margin: -1px 0 0 -1px;\
31 | border: 1px solid #BFBFBF\
32 | }\
33 | .ace-clouds .ace_marker-layer .ace_active-line {\
34 | background: #FFFBD1\
35 | }\
36 | .ace-clouds .ace_gutter-active-line {\
37 | background-color : #dcdcdc\
38 | }\
39 | .ace-clouds .ace_marker-layer .ace_selected-word {\
40 | border: 1px solid #BDD5FC\
41 | }\
42 | .ace-clouds .ace_invisible {\
43 | color: #BFBFBF\
44 | }\
45 | .ace-clouds .ace_keyword,\
46 | .ace-clouds .ace_meta,\
47 | .ace-clouds .ace_support.ace_constant.ace_property-value {\
48 | color: #AF956F\
49 | }\
50 | .ace-clouds .ace_keyword.ace_operator {\
51 | color: #484848\
52 | }\
53 | .ace-clouds .ace_keyword.ace_other.ace_unit {\
54 | color: #96DC5F\
55 | }\
56 | .ace-clouds .ace_constant.ace_language {\
57 | color: #39946A\
58 | }\
59 | .ace-clouds .ace_constant.ace_numeric {\
60 | color: #46A609\
61 | }\
62 | .ace-clouds .ace_constant.ace_character.ace_entity {\
63 | color: #BF78CC\
64 | }\
65 | .ace-clouds .ace_invalid {\
66 | background-color: #FF002A\
67 | }\
68 | .ace-clouds .ace_fold {\
69 | background-color: #AF956F;\
70 | border-color: #000000\
71 | }\
72 | .ace-clouds .ace_storage,\
73 | .ace-clouds .ace_support.ace_class,\
74 | .ace-clouds .ace_support.ace_function,\
75 | .ace-clouds .ace_support.ace_other,\
76 | .ace-clouds .ace_support.ace_type {\
77 | color: #C52727\
78 | }\
79 | .ace-clouds .ace_string {\
80 | color: #5D90CD\
81 | }\
82 | .ace-clouds .ace_comment {\
83 | color: #BCC8BA\
84 | }\
85 | .ace-clouds .ace_entity.ace_name.ace_tag,\
86 | .ace-clouds .ace_entity.ace_other.ace_attribute-name {\
87 | color: #606060\
88 | }\
89 | .ace-clouds .ace_indent-guide {\
90 | background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y\
91 | }";
92 |
93 | var dom = require("../lib/dom");
94 | dom.importCssString(exports.cssText, exports.cssClass);
95 | });
96 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/query/queryresult.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 | import GremlinResult from './gremlinresult';
22 | import ErrorResult from './errorresult';
23 | import DefaultResult from './defaultresult';
24 |
25 | export default class QueryResult extends React.Component {
26 |
27 | constructor() {
28 | super();
29 | }
30 |
31 | render() {
32 | let result = this.showResult();
33 | return (
34 | {result}
35 | );
36 | }
37 |
38 | showResult = () => {
39 | let resultPanel = null;
40 | let result = this.props.result;
41 | if (result === null || result === undefined) {
42 | return ;
43 | }
44 |
45 | let status = this.props.status;
46 | if (status === null || status === undefined) {
47 | return ;
48 | }
49 |
50 | if (status >= 200 && status <= 300) {
51 | let defaultTabKey = 1;
52 | if (this.props.cardConfig !== null) {
53 | if (this.props.cardConfig.viewType !== null &&
54 | this.props.cardConfig.viewType !== undefined) {
55 | defaultTabKey = this.props.cardConfig.viewType;
56 | }
57 | }
58 | resultPanel =
59 | ;
64 | } else {
65 | resultPanel = ;
68 | }
69 | return resultPanel;
70 | };
71 | }
72 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/query/cardeditor.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 | import { GremlinMode } from './querycard';
22 |
23 | export default class CardEditor extends React.Component {
24 |
25 | shouldComponentUpdate(nextProps, nextState) {
26 | if (this.props.code === nextProps.code &&
27 | this.props.language == nextProps.language) {
28 | return false;
29 | } else {
30 | return true;
31 | }
32 | }
33 |
34 | render() {
35 | return (
36 |
37 |
this.editor = el}/>
38 |
39 | );
40 | }
41 |
42 | componentDidUpdate() {
43 | let editor = ace.edit(this.editor);
44 | editor.session.setMode(GremlinMode);
45 | if (this.props.code !== null) {
46 | editor.setValue(this.props.code);
47 | } else {
48 | editor.setValue('');
49 | }
50 | }
51 |
52 | componentDidMount() {
53 | let editor = ace.edit(this.editor);
54 | ace.require('ace/ext/old_ie');
55 | ace.require('ace/ext/language_tools');
56 | editor.setTheme('ace/theme/chrome');
57 | editor.session.setMode(GremlinMode);
58 | editor.setShowPrintMargin(false);
59 | editor.renderer.setShowGutter(false);
60 | editor.$blockScrolling = Infinity;
61 | editor.setAutoScrollEditorIntoView(true);
62 | editor.setOption('maxLines', 15);
63 | editor.setOption('minLines', 3);
64 | this.editor.style.fontSize = '12px';
65 | if (this.props.code !== null) {
66 | editor.setValue(this.props.code);
67 | } else {
68 | editor.setValue('');
69 | }
70 | editor.resize();
71 | editor.setOptions({
72 | enableBasicAutocompletion: true,
73 | enableSnippets: true,
74 | enableLiveAutocompletion: true
75 | });
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/studio-api/src/main/java/com/baidu/hugegraph/studio/board/model/vis/EdgeColor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations under
17 | * the License.
18 | */
19 |
20 | package com.baidu.hugegraph.studio.board.model.vis;
21 |
22 | import com.baidu.hugegraph.studio.config.StudioApiConfig;
23 |
24 | public class EdgeColor {
25 |
26 | private String color;
27 | private String highlight;
28 | private String hover;
29 |
30 | public EdgeColor() {
31 | }
32 |
33 | public EdgeColor(Builder builder) {
34 | this.color = builder.color;
35 | this.highlight = builder.highlight;
36 | this.hover = builder.hover;
37 | }
38 |
39 | public static class Builder {
40 | private String color;
41 | private String highlight;
42 | private String hover;
43 |
44 | public Builder(StudioApiConfig conf) {
45 | color = conf.getEdgeDefaultColor();
46 | highlight = conf.getEdgeHighlightColor();
47 | hover = conf.getEdgeHoverColor();
48 | }
49 |
50 | public EdgeColor build() {
51 | return new EdgeColor(this);
52 | }
53 |
54 | public Builder color(String color) {
55 | this.color = color;
56 | return this;
57 | }
58 |
59 | public Builder highlight(String highlight) {
60 | this.highlight = highlight;
61 | return this;
62 | }
63 |
64 | public Builder hover(String hover) {
65 | this.hover = hover;
66 | return this;
67 | }
68 |
69 | }
70 |
71 | public String getColor() {
72 | return color;
73 | }
74 |
75 | public void setColor(String color) {
76 | this.color = color;
77 | }
78 |
79 | public String getHighlight() {
80 | return highlight;
81 | }
82 |
83 | public void setHighlight(String highlight) {
84 | this.highlight = highlight;
85 | }
86 |
87 | public String getHover() {
88 | return hover;
89 | }
90 |
91 | public void setHover(String hover) {
92 | this.hover = hover;
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/head.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import '../vendors/bootstrap/css/bootstrap.min.css';
21 | import '../css/main.css';
22 | import React from 'react';
23 | import {Navbar, Nav, NavDropdown, MenuItem} from 'react-bootstrap';
24 | import {Link} from 'react-router-dom';
25 | import {connect} from 'react-redux';
26 | import {changeHeadMode} from './actions';
27 | import {withRouter} from 'react-router-dom';
28 | import AlertList from './common/alertlist';
29 |
30 | class Head extends React.Component {
31 |
32 | render() {
33 | return (
34 |
35 |
36 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
54 |
55 | );
56 | }
57 | }
58 |
59 | // Map Redux state to component props
60 | function mapStateToProps(state) {
61 | return {
62 | headMode: state.headMode
63 | };
64 | }
65 |
66 | // Map Redux actions to component props
67 | function mapDispatchToProps(dispatch) {
68 | return {
69 | changeHeadMode: mode => dispatch(changeHeadMode(mode))
70 | };
71 | }
72 |
73 | // Connected Component
74 | export default withRouter(connect(
75 | mapStateToProps,
76 | mapDispatchToProps
77 | )(Head));
78 |
--------------------------------------------------------------------------------
/studio-api/src/main/java/com/baidu/hugegraph/studio/board/model/vis/Scaling.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package com.baidu.hugegraph.studio.board.model.vis;
21 |
22 | import static com.baidu.hugegraph.studio.board.model.vis.VisNode.SCALING_MAX;
23 | import static com.baidu.hugegraph.studio.board.model.vis.VisNode.SCALING_MIN;
24 |
25 | import java.util.Map;
26 |
27 | import com.baidu.hugegraph.studio.config.StudioApiConfig;
28 |
29 | public class Scaling {
30 |
31 | private Integer min = 10;
32 | private Integer max = 30;
33 |
34 | public Scaling() {
35 |
36 | }
37 |
38 | public Scaling(Builder builder) {
39 | this.min = builder.min;
40 | this.max = builder.max;
41 | }
42 |
43 | public static class Builder {
44 | private Integer min = 10;
45 | private Integer max = 30;
46 |
47 | public Builder(StudioApiConfig conf, Map userData) {
48 | this.min = conf.getVertexMinSize();
49 | this.max = conf.getVertexMaxSize();
50 |
51 | Object min = userData.get(SCALING_MIN);
52 | if (min instanceof Number) {
53 | this.min = ((Number) min).intValue();
54 | }
55 |
56 | Object max = userData.get(SCALING_MAX);
57 | if (max instanceof Number) {
58 | this.min = ((Number) max).intValue();
59 | }
60 | }
61 |
62 | public Scaling build() {
63 | return new Scaling(this);
64 | }
65 |
66 | public Builder min(Integer min) {
67 | this.min = min;
68 | return this;
69 | }
70 |
71 | public Builder max(Integer max) {
72 | this.max = max;
73 | return this;
74 | }
75 |
76 | }
77 |
78 | public Integer getMin() {
79 | return min;
80 | }
81 |
82 | public void setMin(Integer min) {
83 | this.min = min;
84 | }
85 |
86 | public Integer getMax() {
87 | return max;
88 | }
89 |
90 | public void setMax(Integer max) {
91 | this.max = max;
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/query/nodata.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | import React from 'react';
21 | import { LOADING_ID_SUFFIX } from './querycard';
22 |
23 | export default class NoData extends React.Component {
24 |
25 | constructor() {
26 | super();
27 | this.state = {
28 | showDetail: false
29 | }
30 | }
31 |
32 | render() {
33 | let display = this.state.showDetail ? 'block' : 'none';
34 | return (
35 |
36 |
37 |
38 | Return data is null...
39 |
41 | Detail
42 |
43 |
44 |
50 |
51 |
52 |
53 | );
54 | }
55 |
56 | showDetail = () => {
57 | this.setState({
58 | showDetail: !this.state.showDetail
59 | });
60 | }
61 |
62 | componentDidUpdate() {
63 | let paneJson = '#' + this.props.id;
64 | let json = JSON.stringify(this.props.content);
65 | $(paneJson).JSONView(json, {collapsed: true});
66 | this.loadDone();
67 | }
68 |
69 | componentDidMount() {
70 | let paneJson = '#' + this.props.id;
71 | let json = JSON.stringify(this.props.content);
72 | $(paneJson).JSONView(json, {collapsed: true});
73 | this.loadDone();
74 | }
75 |
76 | loadDone = () => {
77 | let loadingId = this.props.cardId + LOADING_ID_SUFFIX;
78 | document.getElementById(loadingId).style.display = 'none';
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/studio-ui/assets/components/common/actions.jsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | export const ALERT_SHOW = 'alert_show';
21 | export const ALERT_HIDE = 'alert_hide';
22 |
23 | export function alertShow(messageText, messageType, key) {
24 | return {
25 | type: ALERT_SHOW,
26 | payload: {
27 | messageText, messageType, key
28 | }
29 | };
30 | }
31 |
32 | export function alertHide(key) {
33 | return {
34 | type: ALERT_HIDE,
35 | payload: {key}
36 | };
37 | }
38 |
39 | export function alertMessage(messageText, messageType, delay = 1000) {
40 | let msgContent = 'messageText must be string type and messageType must ' +
41 | 'be either [%s, %s, %s, %s]';
42 | let msgType = ['success', 'warning', 'danger', 'info'];
43 | return (dispatch, getState) => {
44 | if (typeof messageText === 'string' &&
45 | msgType.indexOf(messageType) > -1) {
46 | const key = getState().alerts.lastKey + 1;
47 | dispatch(hideAllAlert(0));
48 | dispatch(alertShow(messageText, messageType, key));
49 | if (messageType === 'danger') {
50 | setTimeout(() => dispatch(alertHide(key)), 5000);
51 | } else if (messageType === 'warning') {
52 | setTimeout(() => dispatch(alertHide(key)), 5000);
53 | } else {
54 | setTimeout(() => dispatch(alertHide(key)), delay);
55 | }
56 | } else {
57 | console.error(msgContent, ...msgType);
58 | }
59 | };
60 | }
61 |
62 | export function hideAllAlert(delay = 0) {
63 | return (dispatch, getState) => {
64 | getState().alerts.items.forEach(item => {
65 | setTimeout(() => {
66 | dispatch(alertHide(item.key));
67 | }, delay);
68 | });
69 | };
70 | }
71 |
72 | export function checkStatus(response) {
73 | if (response.status >= 200 && response.status < 300) {
74 | return response
75 | } else {
76 | let error = new Error(response.statusText);
77 | error.status = response.status;
78 | throw error
79 | }
80 | }
81 |
82 | export function parseJSON(response) {
83 | return response.json()
84 | }
85 |
--------------------------------------------------------------------------------
/studio-ui/assets/vendors/ace/ace-builds/src-noconflict/theme-clouds_midnight.js:
--------------------------------------------------------------------------------
1 | ace.define("ace/theme/clouds_midnight",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2 |
3 | exports.isDark = true;
4 | exports.cssClass = "ace-clouds-midnight";
5 | exports.cssText = ".ace-clouds-midnight .ace_gutter {\
6 | background: #232323;\
7 | color: #929292\
8 | }\
9 | .ace-clouds-midnight .ace_print-margin {\
10 | width: 1px;\
11 | background: #232323\
12 | }\
13 | .ace-clouds-midnight {\
14 | background-color: #191919;\
15 | color: #929292\
16 | }\
17 | .ace-clouds-midnight .ace_cursor {\
18 | color: #7DA5DC\
19 | }\
20 | .ace-clouds-midnight .ace_marker-layer .ace_selection {\
21 | background: #000000\
22 | }\
23 | .ace-clouds-midnight.ace_multiselect .ace_selection.ace_start {\
24 | box-shadow: 0 0 3px 0px #191919;\
25 | }\
26 | .ace-clouds-midnight .ace_marker-layer .ace_step {\
27 | background: rgb(102, 82, 0)\
28 | }\
29 | .ace-clouds-midnight .ace_marker-layer .ace_bracket {\
30 | margin: -1px 0 0 -1px;\
31 | border: 1px solid #BFBFBF\
32 | }\
33 | .ace-clouds-midnight .ace_marker-layer .ace_active-line {\
34 | background: rgba(215, 215, 215, 0.031)\
35 | }\
36 | .ace-clouds-midnight .ace_gutter-active-line {\
37 | background-color: rgba(215, 215, 215, 0.031)\
38 | }\
39 | .ace-clouds-midnight .ace_marker-layer .ace_selected-word {\
40 | border: 1px solid #000000\
41 | }\
42 | .ace-clouds-midnight .ace_invisible {\
43 | color: #666\
44 | }\
45 | .ace-clouds-midnight .ace_keyword,\
46 | .ace-clouds-midnight .ace_meta,\
47 | .ace-clouds-midnight .ace_support.ace_constant.ace_property-value {\
48 | color: #927C5D\
49 | }\
50 | .ace-clouds-midnight .ace_keyword.ace_operator {\
51 | color: #4B4B4B\
52 | }\
53 | .ace-clouds-midnight .ace_keyword.ace_other.ace_unit {\
54 | color: #366F1A\
55 | }\
56 | .ace-clouds-midnight .ace_constant.ace_language {\
57 | color: #39946A\
58 | }\
59 | .ace-clouds-midnight .ace_constant.ace_numeric {\
60 | color: #46A609\
61 | }\
62 | .ace-clouds-midnight .ace_constant.ace_character.ace_entity {\
63 | color: #A165AC\
64 | }\
65 | .ace-clouds-midnight .ace_invalid {\
66 | color: #FFFFFF;\
67 | background-color: #E92E2E\
68 | }\
69 | .ace-clouds-midnight .ace_fold {\
70 | background-color: #927C5D;\
71 | border-color: #929292\
72 | }\
73 | .ace-clouds-midnight .ace_storage,\
74 | .ace-clouds-midnight .ace_support.ace_class,\
75 | .ace-clouds-midnight .ace_support.ace_function,\
76 | .ace-clouds-midnight .ace_support.ace_other,\
77 | .ace-clouds-midnight .ace_support.ace_type {\
78 | color: #E92E2E\
79 | }\
80 | .ace-clouds-midnight .ace_string {\
81 | color: #5D90CD\
82 | }\
83 | .ace-clouds-midnight .ace_comment {\
84 | color: #3C403B\
85 | }\
86 | .ace-clouds-midnight .ace_entity.ace_name.ace_tag,\
87 | .ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name {\
88 | color: #606060\
89 | }\
90 | .ace-clouds-midnight .ace_indent-guide {\
91 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y\
92 | }";
93 |
94 | var dom = require("../lib/dom");
95 | dom.importCssString(exports.cssText, exports.cssClass);
96 | });
97 |
--------------------------------------------------------------------------------
/studio-api/src/main/java/com/baidu/hugegraph/studio/board/model/Card.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 HugeGraph Authors
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one or more
5 | * contributor license agreements. See the NOTICE file distributed with this
6 | * work for additional information regarding copyright ownership. The ASF
7 | * licenses this file to You under the Apache License, Version 2.0 (the
8 | * "License"); you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 | * License for the specific language governing permissions and limitations under
17 | * the License.
18 | */
19 |
20 | package com.baidu.hugegraph.studio.board.model;
21 |
22 | import com.fasterxml.jackson.annotation.JsonCreator;
23 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
24 | import com.fasterxml.jackson.annotation.JsonProperty;
25 |
26 | @JsonIgnoreProperties(ignoreUnknown = true)
27 | public class Card {
28 |
29 | private String id;
30 | private String code;
31 |
32 | /**
33 | * Instantiates a new board card.
34 | *
35 | * @param id the id
36 | * @param code the code
37 | */
38 | @JsonCreator
39 | public Card(@JsonProperty("id") String id,
40 | @JsonProperty("code") String code) {
41 | this.id = id;
42 | this.code = code;
43 | }
44 |
45 | /**
46 | * Instantiates a new board card.
47 | */
48 | public Card() {
49 | this.id = "card_default";
50 | this.code = "";
51 | }
52 |
53 | /**
54 | * Sets id.
55 | *
56 | * @param id the id
57 | */
58 | public void setId(String id) {
59 | this.id = id;
60 | }
61 |
62 | /**
63 | * Card's id is uuid
64 | *
65 | * @return the id
66 | */
67 | public String getId() {
68 | return this.id;
69 | }
70 |
71 | /**
72 | * The code user input in the front page code editor.
73 | *
74 | * @return the code
75 | */
76 | public String getCode() {
77 | return this.code;
78 | }
79 |
80 | /**
81 | * Sets code.
82 | *
83 | * @param code the code
84 | */
85 | public void setCode(String code) {
86 | this.code = code;
87 | }
88 |
89 | public boolean equals(Object o) {
90 | if (this == o) {
91 | return true;
92 | }
93 | if (o == null || !this.getClass().equals(o.getClass())) {
94 | return false;
95 | }
96 | Card that = (Card) o;
97 |
98 | return (that.id == null && this.id == null) ||
99 | (this.id != null && this.id.equals(that.id));
100 | }
101 |
102 | public int hashCode() {
103 | return this.id != null ? this.id.hashCode() : 0;
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/studio-api/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | hugegraph-studio
7 | com.baidu.hugegraph
8 | 0.12.0
9 |
10 | 4.0.0
11 | studio-api
12 | war
13 |
14 |
15 |
16 | com.baidu.hugegraph
17 | hugegraph-client
18 |
19 |
20 | org.glassfish.jersey.core
21 | jersey-client
22 | 2.25.1
23 |
24 |
25 | org.glassfish.jersey.ext
26 | jersey-spring3
27 | 2.25.1
28 |
29 |
30 | org.springframework
31 | spring-core
32 |
33 |
34 | org.springframework
35 | spring-beans
36 |
37 |
38 |
39 |
40 |
41 | org.springframework
42 | spring-web
43 | ${spring.version}
44 |
45 |
46 | commons-logging
47 | commons-logging
48 |
49 |
50 |
51 |
52 | org.springframework
53 | spring-aop
54 | ${spring.version}
55 |
56 |
57 | commons-logging
58 | commons-logging
59 |
60 |
61 |
62 |
63 | org.springframework
64 | spring-test
65 | ${spring.version}
66 | test
67 |
68 |
69 |
70 |
71 | studio-api
72 |
73 |
74 | org.apache.maven.plugins
75 | maven-war-plugin
76 | 2.1.1
77 |
78 |
79 |
80 | src/main/webapp/WEB-INF
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------