mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:arangodb/arangodb into devel
This commit is contained in:
commit
b7e3e39ba4
|
@ -210,13 +210,6 @@ describe ArangoDB do
|
||||||
result["path"].should be_kind_of(String)
|
result["path"].should be_kind_of(String)
|
||||||
result["isSystem"].should eq(false)
|
result["isSystem"].should eq(false)
|
||||||
|
|
||||||
# retrieve user for new database
|
|
||||||
doc = ArangoDB.log_get("#{prefix}-create-current", "/_db/#{name}/_api/user/root")
|
|
||||||
doc.code.should eq(200)
|
|
||||||
result = doc.parsed_response
|
|
||||||
result["user"].should eq("root")
|
|
||||||
result["active"].should eq(true)
|
|
||||||
|
|
||||||
doc = ArangoDB.log_delete("#{prefix}-create-current", api + "/#{name}")
|
doc = ArangoDB.log_delete("#{prefix}-create-current", api + "/#{name}")
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
response = doc.parsed_response
|
response = doc.parsed_response
|
||||||
|
@ -251,7 +244,7 @@ describe ArangoDB do
|
||||||
result["isSystem"].should eq(false)
|
result["isSystem"].should eq(false)
|
||||||
|
|
||||||
# retrieve information about user "admin"
|
# retrieve information about user "admin"
|
||||||
doc = ArangoDB.log_get("#{prefix}-create-users", "/_db/#{name}/_api/user/admin")
|
doc = ArangoDB.log_get("#{prefix}-create-users", "/_db/_system/_api/user/admin")
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
result = doc.parsed_response
|
result = doc.parsed_response
|
||||||
result["user"].should eq("admin")
|
result["user"].should eq("admin")
|
||||||
|
@ -259,16 +252,12 @@ describe ArangoDB do
|
||||||
result["extra"]["gender"].should eq("m")
|
result["extra"]["gender"].should eq("m")
|
||||||
|
|
||||||
# retrieve information about user "foxx"
|
# retrieve information about user "foxx"
|
||||||
doc = ArangoDB.log_get("#{prefix}-create-users", "/_db/#{name}/_api/user/foxx")
|
doc = ArangoDB.log_get("#{prefix}-create-users", "/_db/_system/_api/user/foxx")
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
result = doc.parsed_response
|
result = doc.parsed_response
|
||||||
result["user"].should eq("foxx")
|
result["user"].should eq("foxx")
|
||||||
result["active"].should eq(false)
|
result["active"].should eq(false)
|
||||||
|
|
||||||
# retrieve information about user "root"
|
|
||||||
doc = ArangoDB.log_get("#{prefix}-create-users", "/_db/#{name}/_api/user/root")
|
|
||||||
doc.code.should eq(404)
|
|
||||||
|
|
||||||
doc = ArangoDB.log_delete("#{prefix}-create-users", api + "/#{name}")
|
doc = ArangoDB.log_delete("#{prefix}-create-users", api + "/#{name}")
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
response = doc.parsed_response
|
response = doc.parsed_response
|
||||||
|
@ -312,10 +301,6 @@ describe ArangoDB do
|
||||||
result["path"].should be_kind_of(String)
|
result["path"].should be_kind_of(String)
|
||||||
result["isSystem"].should eq(false)
|
result["isSystem"].should eq(false)
|
||||||
|
|
||||||
# retrieve information about user "root"
|
|
||||||
doc = ArangoDB.log_get("#{prefix}-create-users-invalid", "/_db/#{name}/_api/user/root")
|
|
||||||
doc.code.should eq(404)
|
|
||||||
|
|
||||||
doc = ArangoDB.log_delete("#{prefix}-create-users-invalid", api + "/#{name}")
|
doc = ArangoDB.log_delete("#{prefix}-create-users-invalid", api + "/#{name}")
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
response = doc.parsed_response
|
response = doc.parsed_response
|
||||||
|
|
|
@ -8,7 +8,7 @@ directory= @LOCALSTATEDIR@/lib/arangodb3
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
rest-server = false
|
rest-server = false
|
||||||
authentication = false
|
authentication = true
|
||||||
statistics = false
|
statistics = false
|
||||||
# set number of threads to 1 so we don't have concurrency
|
# set number of threads to 1 so we don't have concurrency
|
||||||
threads = 1
|
threads = 1
|
||||||
|
|
|
@ -5,4 +5,4 @@ progress = true
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
endpoint = tcp://127.0.0.1:8529
|
endpoint = tcp://127.0.0.1:8529
|
||||||
authentication = false
|
authentication = true
|
||||||
|
|
|
@ -4,4 +4,4 @@ progress = true
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
endpoint = tcp://127.0.0.1:8529
|
endpoint = tcp://127.0.0.1:8529
|
||||||
authentication = false
|
authentication = true
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
endpoint = tcp://127.0.0.1:8529
|
endpoint = tcp://127.0.0.1:8529
|
||||||
authentication = false
|
authentication = true
|
||||||
|
|
|
@ -4,4 +4,4 @@ progress = true
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
endpoint = tcp://127.0.0.1:8529
|
endpoint = tcp://127.0.0.1:8529
|
||||||
authentication = false
|
authentication = true
|
||||||
|
|
|
@ -3,7 +3,7 @@ pretty-print = true
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
endpoint = tcp://127.0.0.1:8529
|
endpoint = tcp://127.0.0.1:8529
|
||||||
authentication = false
|
authentication = true
|
||||||
|
|
||||||
[javascript]
|
[javascript]
|
||||||
startup-directory = @PKGDATADIR@/js
|
startup-directory = @PKGDATADIR@/js
|
||||||
|
|
|
@ -50,7 +50,11 @@ function get_api_database (req, res) {
|
||||||
if (req.suffix[0] === 'user') {
|
if (req.suffix[0] === 'user') {
|
||||||
// fetch all databases for the current user
|
// fetch all databases for the current user
|
||||||
// note: req.user may be null if authentication is turned off
|
// note: req.user may be null if authentication is turned off
|
||||||
result = arangodb.db._databases(req.user);
|
if (req.user === null) {
|
||||||
|
result = arangodb.db._databases();
|
||||||
|
} else {
|
||||||
|
result = arangodb.db._databases(req.user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (req.suffix[0] === 'current') {
|
else if (req.suffix[0] === 'current') {
|
||||||
if (cluster.isCoordinator()) {
|
if (cluster.isCoordinator()) {
|
||||||
|
|
|
@ -147,7 +147,7 @@
|
||||||
<div class="dashboard-full-width-chart" id="replication-chart">
|
<div class="dashboard-full-width-chart" id="replication-chart">
|
||||||
<div class="dashboard-full-width-chart-inner pure-u">
|
<div class="dashboard-full-width-chart-inner pure-u">
|
||||||
<div class="dashboard-sub-bar"">Replication <span class="state"> updating...</span></div>
|
<div class="dashboard-sub-bar"">Replication <span class="state"> updating...</span></div>
|
||||||
<div id="repl-numbers" class="dashboard-interior-chart pure-u-1-3">
|
<div id="repl-numbers" class="dashboard-interior-chart pure-u-1-1 pure-u-sm-1-1 pure-u-md-1-3">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<div class="top dashboard-subtitle-bar">Totals</div>
|
<div class="top dashboard-subtitle-bar">Totals</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
|
@ -170,7 +170,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="repl-ticks" class="dashboard-interior-chart pure-u-1-3">
|
<div id="repl-ticks" class="dashboard-interior-chart pure-u-1-1 pure-u-sm-1-1 pure-u-md-1-3">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<div class="top dashboard-subtitle-bar">Ticks</div>
|
<div class="top dashboard-subtitle-bar">Ticks</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="repl-progress" class="dashboard-interior-chart pure-u-1-3">
|
<div id="repl-progress" class="dashboard-interior-chart pure-u-1-1 pure-u-sm-1-1 pure-u-md-1-3">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<div class="top dashboard-subtitle-bar">Progress</div>
|
<div class="top dashboard-subtitle-bar">Progress</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
|
|
|
@ -36,17 +36,22 @@
|
||||||
"insert|update|remove|replace|upsert|options|with|and|or|not|" +
|
"insert|update|remove|replace|upsert|options|with|and|or|not|" +
|
||||||
"distinct|graph|outbound|inbound|any|all|none|aggregate|like|count|shortest_path",
|
"distinct|graph|outbound|inbound|any|all|none|aggregate|like|count|shortest_path",
|
||||||
|
|
||||||
|
hide: function() {
|
||||||
|
this.typeahead = $('#spotlight .typeahead').typeahead('destroy');
|
||||||
|
$(this.el).hide();
|
||||||
|
},
|
||||||
|
|
||||||
listenKey: function(e) {
|
listenKey: function(e) {
|
||||||
if (e.keyCode === 27) {
|
if (e.keyCode === 27) {
|
||||||
|
this.hide();
|
||||||
if (this.callbackSuccess) {
|
if (this.callbackSuccess) {
|
||||||
this.callbackCancel();
|
this.callbackCancel();
|
||||||
}
|
}
|
||||||
this.hide();
|
|
||||||
}
|
}
|
||||||
else if (e.keyCode === 13) {
|
else if (e.keyCode === 13) {
|
||||||
if (this.callbackSuccess) {
|
if (this.callbackSuccess) {
|
||||||
this.callbackSuccess($(this.typeahead).val());
|
|
||||||
this.hide();
|
this.hide();
|
||||||
|
this.callbackSuccess($(this.typeahead).val());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -112,7 +117,8 @@
|
||||||
url: arangoHelper.databaseUrl("/_api/aql-builtin"),
|
url: arangoHelper.databaseUrl("/_api/aql-builtin"),
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
console.log(data);
|
self.stringToArray();
|
||||||
|
self.updateDatasets();
|
||||||
_.each(data.functions, function(val) {
|
_.each(data.functions, function(val) {
|
||||||
self.aqlBuiltinFunctionsArray.push(val.name);
|
self.aqlBuiltinFunctionsArray.push(val.name);
|
||||||
});
|
});
|
||||||
|
@ -136,8 +142,6 @@
|
||||||
this.callbackCancel = callbackCancel;
|
this.callbackCancel = callbackCancel;
|
||||||
|
|
||||||
var continueRender = function() {
|
var continueRender = function() {
|
||||||
this.stringToArray();
|
|
||||||
this.updateDatasets();
|
|
||||||
|
|
||||||
var genHeader = function(name, icon, type) {
|
var genHeader = function(name, icon, type) {
|
||||||
var string = '<div class="header-type"><h4>' + name + '</h4>';
|
var string = '<div class="header-type"><h4>' + name + '</h4>';
|
||||||
|
@ -247,13 +251,6 @@
|
||||||
else {
|
else {
|
||||||
continueRender();
|
continueRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
hide: function() {
|
|
||||||
$(this.el).hide();
|
|
||||||
this.typeahead = $('#spotlight .typeahead').typeahead('destroy');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -14,6 +14,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// SINGLE NODE DASHBOARD
|
// SINGLE NODE DASHBOARD
|
||||||
|
#repl-numbers,
|
||||||
|
#repl-progress,
|
||||||
|
#repl-ticks {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
.dashboard-large-chart,
|
.dashboard-large-chart,
|
||||||
.dashboard-medium-chart-outer:first-child {
|
.dashboard-medium-chart-outer:first-child {
|
||||||
padding-right: 0 !important;
|
padding-right: 0 !important;
|
||||||
|
|
|
@ -280,7 +280,6 @@ function DatabaseSuite () {
|
||||||
|
|
||||||
assertTrue(internal.db._createDatabase("UnitTestsDatabase0", { }, users));
|
assertTrue(internal.db._createDatabase("UnitTestsDatabase0", { }, users));
|
||||||
|
|
||||||
internal.db._useDatabase("UnitTestsDatabase0");
|
|
||||||
var userManager = require("@arangodb/users");
|
var userManager = require("@arangodb/users");
|
||||||
var user = userManager.document("admin");
|
var user = userManager.document("admin");
|
||||||
|
|
||||||
|
@ -293,8 +292,6 @@ function DatabaseSuite () {
|
||||||
assertFalse(user.active);
|
assertFalse(user.active);
|
||||||
assertEqual("f", user.extra.gender);
|
assertEqual("f", user.extra.gender);
|
||||||
|
|
||||||
internal.db._useDatabase("_system");
|
|
||||||
|
|
||||||
assertTrue(internal.db._dropDatabase("UnitTestsDatabase0"));
|
assertTrue(internal.db._dropDatabase("UnitTestsDatabase0"));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -317,15 +314,12 @@ function DatabaseSuite () {
|
||||||
];
|
];
|
||||||
assertTrue(internal.db._createDatabase("UnitTestsDatabase0", { }, users));
|
assertTrue(internal.db._createDatabase("UnitTestsDatabase0", { }, users));
|
||||||
|
|
||||||
internal.db._useDatabase("UnitTestsDatabase0");
|
|
||||||
var userManager = require("@arangodb/users");
|
var userManager = require("@arangodb/users");
|
||||||
var user = userManager.document("admin");
|
var user = userManager.document("admin");
|
||||||
assertEqual("admin", user.user);
|
assertEqual("admin", user.user);
|
||||||
assertTrue(user.active);
|
assertTrue(user.active);
|
||||||
assertEqual("m", user.extra.gender);
|
assertEqual("m", user.extra.gender);
|
||||||
|
|
||||||
internal.db._useDatabase("_system");
|
|
||||||
|
|
||||||
assertTrue(internal.db._dropDatabase("UnitTestsDatabase0"));
|
assertTrue(internal.db._dropDatabase("UnitTestsDatabase0"));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -312,7 +312,7 @@ exports.exists = function(username) {
|
||||||
exports.document(username);
|
exports.document(username);
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.errNum === arangodb.errors.ERROR_USER_NOT_FOUND.code) {
|
if (e.errorNum === arangodb.errors.ERROR_USER_NOT_FOUND.code) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
|
|
|
@ -600,6 +600,15 @@ void WindowsServiceFeature::validateOptions(std::shared_ptr<ProgramOptions> opti
|
||||||
} };
|
} };
|
||||||
|
|
||||||
_server->addReporter(reporter);
|
_server->addReporter(reporter);
|
||||||
|
SERVICE_TABLE_ENTRY ste[] = {{TEXT(""), (LPSERVICE_MAIN_FUNCTION)ServiceMain},
|
||||||
|
{nullptr, nullptr}};
|
||||||
|
|
||||||
|
if (!StartServiceCtrlDispatcher(ste)) {
|
||||||
|
std::cerr << "FATAL: StartServiceCtrlDispatcher has failed with "
|
||||||
|
<< GetLastError() << std::endl;
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (_startService) {
|
else if (_startService) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ std::string arangodb::options::EnvironmentTranslator(std::string const& value) {
|
||||||
|
|
||||||
if (v == nullptr) {
|
if (v == nullptr) {
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
if (TRI_EqualString(k, "ROOTDIR")) {
|
if (TRI_EqualString(k.c_str(), "ROOTDIR")) {
|
||||||
vv = TRI_LocateInstallDirectory();
|
vv = TRI_LocateInstallDirectory();
|
||||||
|
|
||||||
if (! vv.empty()) {
|
if (! vv.empty()) {
|
||||||
|
|
Loading…
Reference in New Issue