1
0
Fork 0

Merge branch 'sharding' of https://github.com/triAGENS/ArangoDB into sharding

This commit is contained in:
Michael Hackstein 2014-02-27 15:45:25 +01:00
commit 6169e326a4
4 changed files with 101 additions and 1 deletions

View File

@ -0,0 +1,11 @@
<script id="clusterDown.ejs" type="text/template">
<ul class="thumbnails2">
<div class="headerBar">
<a class="arangoHeader">Cluster Down</a>
</div>
</ul>
<div id="relaunchCluster">relaunchCluster</div>
<div id="editPlan">editPlan</div>
<div id="deletePlan">deletePlan</div>
</script>

View File

@ -0,0 +1,87 @@
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true, newcap: true */
/*global window, $, Backbone, plannerTemplateEngine, alert */
(function() {
"use strict";
window.ClusterDownView = Backbone.View.extend({
el: "#content",
template: templateEngine.createTemplate("clusterDown.ejs"),
events: {
"click #relaunchCluster" : "relaunchCluster",
"click #editPlan" : "editPlan",
"click #deletePlan" : "deletePlan"
},
initialize : function() {
this.dbservers = new window.ClusterServers([], {
interval: this.interval
});
this.dbservers.fetch({
async: false
});
this.dbservers.startUpdating();
},
render: function() {
$(this.el).html(this.template.render({}));
},
relaunchCluster: function() {
console.log("relaunchCluster");
var result = false;
$.ajax({
cache: false,
type: "GET",
async: false, // sequential calls!
url: "/cluster/relaunch",
success: function(data) {
result = data;
},
error: function(data) {
}
});
return result;
},
editPlan: function() {
console.log("editPlan");
//welches Scenario und entsprechende View rendern
//siehe showClusterView.js
var byAddress = this.listByAddress();
if (Object.keys(byAddress).length === 1) {
this.type = "testPlan";
} else {
this.type = "other";
}
if (this.type === "testPlan") {
window.App.navigate("planTest", {trigger : true});
} else {
// window.App.navigate("planSymmetrical", {trigger : true});
window.App.navigate("planAsymmetrical", {trigger : true});
}
},
deletePlan: function() {
console.log("deletePlan");
//irgendwie löschen
//view planScenario
},
listByAddress: function() {
var byAddress = this.dbservers.byAddress();
byAddress = this.coordinators.byAddress(byAddress);
return byAddress;
}
});
}());

View File

@ -50,6 +50,7 @@
},
render: function() {
//<fake*******************
this.model.set({
config : {
type: "testSetup",
@ -58,6 +59,7 @@
numberCoordinators: 3
}
})
//*******************fake>
$(this.el).html(this.template.render({
config : this.model.get("config")
}));

View File

@ -72,7 +72,7 @@
interval: this.interval
});
this.cols = new window.ClusterCollections();
this.shards = new window.ClusterShards()
this.shards = new window.ClusterShards();
this.startUpdating();
var typeModel = new window.ClusterType();