1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
Jan Steemann 2016-04-19 16:38:55 +02:00
commit 0088fa2cbb
6 changed files with 42 additions and 23 deletions

View File

@ -1036,6 +1036,7 @@ size_t ClusterComm::performRequests(std::vector<ClusterCommRequest>& requests,
arangodb::LogTopic const& logTopic) {
if (requests.size() == 0) {
nrDone = 0;
return 0;
}
@ -1065,7 +1066,10 @@ size_t ClusterComm::performRequests(std::vector<ClusterCommRequest>& requests,
// First send away what is due:
for (size_t i = 0; i < requests.size(); i++) {
if (!requests[i].done && now >= dueTime[i]) {
auto headers = std::make_unique<std::map<std::string, std::string>>();
if (requests[i].headerFields.get() == nullptr) {
requests[i].headerFields
= std::make_unique<std::map<std::string, std::string>>();
}
LOG_TOPIC(TRACE, logTopic)
<< "ClusterComm::performRequests: sending request to "
<< requests[i].destination << ":" << requests[i].path
@ -1075,7 +1079,8 @@ size_t ClusterComm::performRequests(std::vector<ClusterCommRequest>& requests,
requests[i].requestType,
requests[i].path,
requests[i].body,
headers, nullptr, timeout - (now - startTime),
requests[i].headerFields,
nullptr, timeout - (now - startTime),
false);
if (res.status == CL_COMM_ERROR) {
// We did not find the destination, this is could change in the
@ -1159,6 +1164,9 @@ size_t ClusterComm::performRequests(std::vector<ClusterCommRequest>& requests,
// We only get here if the global timeout was triggered, not all
// requests are marked by done!
LOG_TOPIC(ERR, logTopic) << "ClusterComm::performRequests: "
<< "got timeout, this will be reported...";
// Forget about
drop("", coordinatorTransactionID, 0, "");
return nrGood;

View File

@ -183,12 +183,13 @@ void ClusterCommRestCallback(std::string& coordinator,
////////////////////////////////////////////////////////////////////////////////
struct ClusterCommRequest {
std::string destination;
GeneralRequest::RequestType requestType;
std::string path;
std::shared_ptr<std::string const> body;
ClusterCommResult result;
bool done;
std::string destination;
GeneralRequest::RequestType requestType;
std::string path;
std::shared_ptr<std::string const> body;
std::unique_ptr<std::map<std::string, std::string>> headerFields;
ClusterCommResult result;
bool done;
ClusterCommRequest() : done(false) {
}
@ -201,6 +202,9 @@ struct ClusterCommRequest {
{
}
void setHeaders(std::unique_ptr<std::map<std::string, std::string>>& headers) {
headerFields = std::move(headers);
}
};
////////////////////////////////////////////////////////////////////////////////

View File

@ -109,16 +109,6 @@ router.post('/login', function (req, res) {
`);
router.get('/unauthorized', function(req, res) {
res.throw('unauthorized');
})
.error('unauthorized')
.summary('Unauthorized')
.description(dd`
Responds with a HTTP 401 response.
`);
const authRouter = createRouter();
router.use(authRouter);

View File

@ -2,11 +2,16 @@
<div id="nodesContent" class="innerContent">
<% if(coords.length > 0) { %>
<% var genClass = "pure-u-1-" + Object.keys(coords[0]).length; %>
<% if (coords.length > 0) { %>
<% var disabled = ''; %>
<% var genClass = "pure-u-1-" + Object.keys(coords[0]).length; %>
<% if (type !== 'coordinator') { %>
<% disabled = " disabled"; %>
<% } %>
<div class="pure-g cluster-nodes-title pure-table pure-table-header pure-title">
<div class="pure-table-row">
<div class="pure-table-row <%= disabled %> ">
<div class="<%= genClass %> mid">Name</div>
<div class="<%= genClass %> mid">Address</div>
<div class="<%= genClass %> mid">Protocol</div>
@ -24,7 +29,7 @@
<% _.each(coords, function(node) { %>
<div class="pure-table-row" node="<%=node.name%>">
<div class="pure-table-row disabled" node="<%=node.name%>">
<div class="<%= genClass %> mid"><%= node.name %></div>
<div class="<%= genClass %> mid"><%= node.address %></div>

View File

@ -12,16 +12,20 @@
knownServers: [],
events: {
"click .pure-table-body .pure-table-row": "navigateToNode"
},
initialize: function (options) {
if (window.App.isCluster) {
this.dbServers = options.dbServers;
this.coordinators = options.coordinators;
this.updateServerTime();
this.toRender = options.toRender;
if (this.toRender !== 'coordinator') {
this.events["click .pure-table-body .pure-table-row"] = "navigateToNode";
}
//start polling with interval
window.setInterval(function() {
if (window.location.hash === '#cNodes' || window.location.hash === '#dNodes') {

View File

@ -29,12 +29,20 @@
color: $c-pure-text;
font-weight: 100;
line-height: 40px;
width: 100%;
&:hover {
background-color: rgb(239, 240, 235);
cursor: pointer;
}
&.disabled {
&:hover {
background-color: $c-white;
cursor: not-allowed;
}
}
.left {
text-align: left;
}