mirror of https://gitee.com/bigwinds/arangodb
Bug fix 3.4/ui graph parsing (#7063)
* fixes some graph data parsing issues, if format was not like it was expected * changelog
This commit is contained in:
parent
e1480cfd11
commit
bc578b47da
|
@ -1,6 +1,9 @@
|
||||||
v3.4.0-rc.4 (XXXX-XX-XX)
|
v3.4.0-rc.4 (XXXX-XX-XX)
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
* fixes some graph data parsing issues in the ui, e.g. cleaning up duplicate
|
||||||
|
edges inside the graph viewer.
|
||||||
|
|
||||||
* in a cluster environment, the arangod process now exits if wrong credentials
|
* in a cluster environment, the arangod process now exits if wrong credentials
|
||||||
are used during the startup process.
|
are used during the startup process.
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,6 @@
|
||||||
self.renderGraph(data);
|
self.renderGraph(data);
|
||||||
},
|
},
|
||||||
error: function (e) {
|
error: function (e) {
|
||||||
console.log(e);
|
|
||||||
arangoHelper.arangoError('Graph', 'Could not load full graph.');
|
arangoHelper.arangoError('Graph', 'Could not load full graph.');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -534,17 +533,22 @@
|
||||||
*/
|
*/
|
||||||
});
|
});
|
||||||
} else if (type === 'array') {
|
} else if (type === 'array') {
|
||||||
_.each(data, function (edge) {
|
var edgeObj = {};
|
||||||
vertices[edge._from] = null;
|
|
||||||
vertices[edge._to] = null;
|
|
||||||
|
|
||||||
returnObj.edges.push({
|
_.each(data, function (edge) {
|
||||||
id: edge._id,
|
if (edge) {
|
||||||
source: edge._from,
|
vertices[edge._from] = null;
|
||||||
// label: edge._key,
|
vertices[edge._to] = null;
|
||||||
color: '#cccccc',
|
|
||||||
target: edge._to
|
if (edge._id) {
|
||||||
});
|
edgeObj[edge._id] = {
|
||||||
|
id: edge._id,
|
||||||
|
source: edge._from,
|
||||||
|
color: '#cccccc',
|
||||||
|
target: edge._to
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_.each(vertices, function (val, key) {
|
_.each(vertices, function (val, key) {
|
||||||
|
@ -557,6 +561,9 @@
|
||||||
y: Math.random()
|
y: Math.random()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
_.each(edgeObj, function (edge) {
|
||||||
|
returnObj.edges.push(edge);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnObj;
|
return returnObj;
|
||||||
|
|
|
@ -2495,8 +2495,17 @@
|
||||||
|
|
||||||
// check if result could be displayed as graph
|
// check if result could be displayed as graph
|
||||||
// case a) result has keys named vertices and edges
|
// case a) result has keys named vertices and edges
|
||||||
if (result[0]) {
|
|
||||||
if (result[0].vertices && result[0].edges) {
|
var index = 0;
|
||||||
|
for (var i = 0; i < result.length; i++) {
|
||||||
|
if (result[i]) {
|
||||||
|
index = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result[index]) {
|
||||||
|
if (result[index].vertices && result[index].edges) {
|
||||||
var hitsa = 0;
|
var hitsa = 0;
|
||||||
var totala = 0;
|
var totala = 0;
|
||||||
|
|
||||||
|
@ -2739,7 +2748,7 @@
|
||||||
var headers = {}; // quick lookup cache
|
var headers = {}; // quick lookup cache
|
||||||
var pos = 0;
|
var pos = 0;
|
||||||
_.each(data.original, function (obj) {
|
_.each(data.original, function (obj) {
|
||||||
if (first === true) {
|
if (first === true && obj) {
|
||||||
tableDescription.titles = Object.keys(obj);
|
tableDescription.titles = Object.keys(obj);
|
||||||
tableDescription.titles.forEach(function (t) {
|
tableDescription.titles.forEach(function (t) {
|
||||||
headers[String(t)] = pos++;
|
headers[String(t)] = pos++;
|
||||||
|
|
Loading…
Reference in New Issue