mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
0088fa2cbb
|
@ -1036,6 +1036,7 @@ size_t ClusterComm::performRequests(std::vector<ClusterCommRequest>& requests,
|
||||||
arangodb::LogTopic const& logTopic) {
|
arangodb::LogTopic const& logTopic) {
|
||||||
|
|
||||||
if (requests.size() == 0) {
|
if (requests.size() == 0) {
|
||||||
|
nrDone = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1065,7 +1066,10 @@ size_t ClusterComm::performRequests(std::vector<ClusterCommRequest>& requests,
|
||||||
// First send away what is due:
|
// First send away what is due:
|
||||||
for (size_t i = 0; i < requests.size(); i++) {
|
for (size_t i = 0; i < requests.size(); i++) {
|
||||||
if (!requests[i].done && now >= dueTime[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)
|
LOG_TOPIC(TRACE, logTopic)
|
||||||
<< "ClusterComm::performRequests: sending request to "
|
<< "ClusterComm::performRequests: sending request to "
|
||||||
<< requests[i].destination << ":" << requests[i].path
|
<< requests[i].destination << ":" << requests[i].path
|
||||||
|
@ -1075,7 +1079,8 @@ size_t ClusterComm::performRequests(std::vector<ClusterCommRequest>& requests,
|
||||||
requests[i].requestType,
|
requests[i].requestType,
|
||||||
requests[i].path,
|
requests[i].path,
|
||||||
requests[i].body,
|
requests[i].body,
|
||||||
headers, nullptr, timeout - (now - startTime),
|
requests[i].headerFields,
|
||||||
|
nullptr, timeout - (now - startTime),
|
||||||
false);
|
false);
|
||||||
if (res.status == CL_COMM_ERROR) {
|
if (res.status == CL_COMM_ERROR) {
|
||||||
// We did not find the destination, this is could change in the
|
// 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
|
// We only get here if the global timeout was triggered, not all
|
||||||
// requests are marked by done!
|
// requests are marked by done!
|
||||||
|
|
||||||
|
LOG_TOPIC(ERR, logTopic) << "ClusterComm::performRequests: "
|
||||||
|
<< "got timeout, this will be reported...";
|
||||||
|
|
||||||
// Forget about
|
// Forget about
|
||||||
drop("", coordinatorTransactionID, 0, "");
|
drop("", coordinatorTransactionID, 0, "");
|
||||||
return nrGood;
|
return nrGood;
|
||||||
|
|
|
@ -183,12 +183,13 @@ void ClusterCommRestCallback(std::string& coordinator,
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
struct ClusterCommRequest {
|
struct ClusterCommRequest {
|
||||||
std::string destination;
|
std::string destination;
|
||||||
GeneralRequest::RequestType requestType;
|
GeneralRequest::RequestType requestType;
|
||||||
std::string path;
|
std::string path;
|
||||||
std::shared_ptr<std::string const> body;
|
std::shared_ptr<std::string const> body;
|
||||||
ClusterCommResult result;
|
std::unique_ptr<std::map<std::string, std::string>> headerFields;
|
||||||
bool done;
|
ClusterCommResult result;
|
||||||
|
bool done;
|
||||||
|
|
||||||
ClusterCommRequest() : done(false) {
|
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);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -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();
|
const authRouter = createRouter();
|
||||||
router.use(authRouter);
|
router.use(authRouter);
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,16 @@
|
||||||
|
|
||||||
<div id="nodesContent" class="innerContent">
|
<div id="nodesContent" class="innerContent">
|
||||||
|
|
||||||
<% if(coords.length > 0) { %>
|
<% if (coords.length > 0) { %>
|
||||||
<% var genClass = "pure-u-1-" + Object.keys(coords[0]).length; %>
|
<% 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-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">Name</div>
|
||||||
<div class="<%= genClass %> mid">Address</div>
|
<div class="<%= genClass %> mid">Address</div>
|
||||||
<div class="<%= genClass %> mid">Protocol</div>
|
<div class="<%= genClass %> mid">Protocol</div>
|
||||||
|
@ -24,7 +29,7 @@
|
||||||
|
|
||||||
<% _.each(coords, function(node) { %>
|
<% _.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.name %></div>
|
||||||
<div class="<%= genClass %> mid"><%= node.address %></div>
|
<div class="<%= genClass %> mid"><%= node.address %></div>
|
||||||
|
|
|
@ -12,16 +12,20 @@
|
||||||
knownServers: [],
|
knownServers: [],
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
"click .pure-table-body .pure-table-row": "navigateToNode"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize: function (options) {
|
initialize: function (options) {
|
||||||
|
|
||||||
if (window.App.isCluster) {
|
if (window.App.isCluster) {
|
||||||
this.dbServers = options.dbServers;
|
this.dbServers = options.dbServers;
|
||||||
this.coordinators = options.coordinators;
|
this.coordinators = options.coordinators;
|
||||||
this.updateServerTime();
|
this.updateServerTime();
|
||||||
this.toRender = options.toRender;
|
this.toRender = options.toRender;
|
||||||
|
|
||||||
|
if (this.toRender !== 'coordinator') {
|
||||||
|
this.events["click .pure-table-body .pure-table-row"] = "navigateToNode";
|
||||||
|
}
|
||||||
|
|
||||||
//start polling with interval
|
//start polling with interval
|
||||||
window.setInterval(function() {
|
window.setInterval(function() {
|
||||||
if (window.location.hash === '#cNodes' || window.location.hash === '#dNodes') {
|
if (window.location.hash === '#cNodes' || window.location.hash === '#dNodes') {
|
||||||
|
|
|
@ -29,12 +29,20 @@
|
||||||
color: $c-pure-text;
|
color: $c-pure-text;
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: rgb(239, 240, 235);
|
background-color: rgb(239, 240, 235);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
&:hover {
|
||||||
|
background-color: $c-white;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue