1
0
Fork 0

ignore cache

This commit is contained in:
Frank Celler 2014-02-20 20:34:57 +01:00
commit 38f1e55f99
95 changed files with 696 additions and 27406 deletions

2
.gitignore vendored
View File

@ -98,6 +98,8 @@ nbproject/
test.cpp.txt
.sass-cache
js/apps/*
!js/apps/system
!js/apps/system/*

View File

@ -1,6 +1,21 @@
v1.5.0 (XXXX-XX-XX)
-------------------
* slightly improved users management API in `/_api/user`:
Previously, when creating a new user via HTTP POST, the username needed to be
passed in an attribute `username`. When users were returned via this API,
the usernames were returned in an attribute named `user`. This was slightly
confusing and was changed in 1.5 as follows:
- when adding a user via HTTP POST, the username can be specified in an attribute
`user`. If this attribute is not used, the API will look into the attribute `username`
as before and use that value.
- when users are returned via HTTP GET, the usernames are still returned in an
attribute `user`.
This change should be fully downwards-compatible with the previous version of the API.
* added AQL SLICE function to extract slices from lists
* removed check-server binary

View File

@ -51,7 +51,7 @@ describe ArangoDB do
doc.parsed_response['errorNum'].should eq(1700)
end
it "add user, empty username" do
it "add user, empty username, old API" do
body = "{ \"username\" : \"\", \"passwd\" : \"fox\" }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
@ -61,8 +61,19 @@ describe ArangoDB do
doc.parsed_response['code'].should eq(400)
doc.parsed_response['errorNum'].should eq(1700)
end
it "add user, empty username" do
body = "{ \"user\" : \"\", \"passwd\" : \"fox\" }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
doc.code.should eq(400)
doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['error'].should eq(true)
doc.parsed_response['code'].should eq(400)
doc.parsed_response['errorNum'].should eq(1700)
end
it "add user, no passwd" do
it "add user, no passwd, old API" do
body = "{ \"username\" : \"users-1\" }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
@ -78,8 +89,25 @@ describe ArangoDB do
doc.parsed_response['user'].should eq("users-1")
doc.parsed_response['active'].should eq(true)
end
it "add user, no passwd" do
body = "{ \"user\" : \"users-1\" }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
doc.code.should eq(201)
doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['error'].should eq(false)
doc.parsed_response['code'].should eq(201)
doc = ArangoDB.get(api + "/users-1")
doc.code.should eq(200)
doc.parsed_response['error'].should eq(false)
doc.parsed_response['code'].should eq(200)
doc.parsed_response['user'].should eq("users-1")
doc.parsed_response['active'].should eq(true)
end
it "add user, username and passwd" do
it "add user, username and passwd, old API" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\" }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
@ -95,8 +123,25 @@ describe ArangoDB do
doc.parsed_response['user'].should eq("users-1")
doc.parsed_response['active'].should eq(true)
end
it "add user, username passwd, active, extra" do
it "add user, username and passwd" do
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\" }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
doc.code.should eq(201)
doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['error'].should eq(false)
doc.parsed_response['code'].should eq(201)
doc = ArangoDB.get(api + "/users-1")
doc.code.should eq(200)
doc.parsed_response['error'].should eq(false)
doc.parsed_response['code'].should eq(200)
doc.parsed_response['user'].should eq("users-1")
doc.parsed_response['active'].should eq(true)
end
it "add user, username passwd, active, extra, old API" do
body = "{ \"username\" : \"users-2\", \"passwd\" : \"fox\", \"active\" : false, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
@ -114,7 +159,25 @@ describe ArangoDB do
doc.parsed_response['extra'].should eq({ "foo" => true })
end
it "add user, duplicate username" do
it "add user, username passwd, active, extra" do
body = "{ \"user\" : \"users-2\", \"passwd\" : \"fox\", \"active\" : false, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
doc.code.should eq(201)
doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['error'].should eq(false)
doc.parsed_response['code'].should eq(201)
doc = ArangoDB.get(api + "/users-2")
doc.code.should eq(200)
doc.parsed_response['error'].should eq(false)
doc.parsed_response['code'].should eq(200)
doc.parsed_response['user'].should eq("users-2")
doc.parsed_response['active'].should eq(false)
doc.parsed_response['extra'].should eq({ "foo" => true })
end
it "add user, duplicate username, old API" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\" }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
@ -131,6 +194,24 @@ describe ArangoDB do
doc.parsed_response['code'].should eq(400)
doc.parsed_response['errorNum'].should eq(1702)
end
it "add user, duplicate username" do
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\" }"
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
doc.code.should eq(201)
doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['error'].should eq(false)
doc.parsed_response['code'].should eq(201)
doc = ArangoDB.log_post("#{prefix}-add", api, :body => body)
doc.code.should eq(400)
doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['error'].should eq(true)
doc.parsed_response['code'].should eq(400)
doc.parsed_response['errorNum'].should eq(1702)
end
end
################################################################################
@ -153,7 +234,7 @@ describe ArangoDB do
end
it "replace already removed user" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-replace-removed", api, :body => body)
doc.code.should eq(201)
@ -172,7 +253,7 @@ describe ArangoDB do
end
it "replace, empty body" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-replace-empty", api, :body => body)
# replace
@ -191,7 +272,7 @@ describe ArangoDB do
end
it "replace existing user, no passwd" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-replace-nopass", api, :body => body)
# replace
@ -211,7 +292,7 @@ describe ArangoDB do
end
it "replace existing user" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-replace-exists", api, :body => body)
# replace
@ -252,7 +333,7 @@ describe ArangoDB do
end
it "update already removed user" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-update", api, :body => body)
doc.code.should eq(201)
@ -271,7 +352,7 @@ describe ArangoDB do
end
it "update, empty body" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-update", api, :body => body)
# update
@ -291,7 +372,7 @@ describe ArangoDB do
end
it "update existing user, no passwd" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-update", api, :body => body)
# update
@ -311,7 +392,7 @@ describe ArangoDB do
end
it "update existing user" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-update", api, :body => body)
# update
@ -352,7 +433,7 @@ describe ArangoDB do
end
it "remove already removed user" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-delete", api, :body => body)
doc.code.should eq(201)
@ -371,7 +452,7 @@ describe ArangoDB do
end
it "remove existing user" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : true, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-delete", api, :body => body)
# remove
@ -409,7 +490,7 @@ describe ArangoDB do
end
it "fetches users, requires some created users" do
body = "{ \"username\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : false, \"extra\" : { \"meow\" : false } }"
body = "{ \"user\" : \"users-1\", \"passwd\" : \"fox\", \"active\" : false, \"extra\" : { \"meow\" : false } }"
ArangoDB.log_post("#{prefix}-fetch-existing", api, :body => body)
doc = ArangoDB.log_get("#{prefix}-fetch-existing", api)
@ -444,7 +525,7 @@ describe ArangoDB do
end
it "fetch user" do
body = "{ \"username\" : \"users-2\", \"passwd\" : \"fox\", \"active\" : false, \"extra\" : { \"foo\" : true } }"
body = "{ \"user\" : \"users-2\", \"passwd\" : \"fox\", \"active\" : false, \"extra\" : { \"foo\" : true } }"
doc = ArangoDB.log_post("#{prefix}-fetch", api, :body => body)
doc.code.should eq(201)

View File

@ -44,11 +44,11 @@ var users = require("org/arangodb/users");
////////////////////////////////////////////////////////////////////////////////
/// @brief fetch a user
///
/// @RESTHEADER{GET /_api/user/{username},fetches a user}
/// @RESTHEADER{GET /_api/user/{user},fetches a user}
///
/// @RESTURLPARAMETERS
///
/// @RESTURLPARAM{username,string,required}
/// @RESTURLPARAM{user,string,required}
/// The name of the user.
///
/// @RESTDESCRIPTION
@ -58,7 +58,7 @@ var users = require("org/arangodb/users");
/// The call will return a JSON document with at least the following attributes
/// on success:
///
/// - `username`: The name of the user as a string.
/// - `user`: The name of the user as a string.
///
/// - `active`: an optional flag that specifies whether the user is active.
///
@ -71,7 +71,7 @@ var users = require("org/arangodb/users");
/// The user was found.
///
/// @RESTRETURNCODE{404}
/// The user with `username` does not exist.
/// The user with `user` does not exist.
///
////////////////////////////////////////////////////////////////////////////////
@ -86,9 +86,10 @@ function get_api_user (req, res) {
return;
}
var username = decodeURIComponent(req.suffix[0]);
var user = decodeURIComponent(req.suffix[0]);
try {
var result = users.document(username);
var result = users.document(user);
actions.resultOk(req, res, actions.HTTP_OK, result);
}
catch (err) {
@ -113,7 +114,7 @@ function get_api_user (req, res) {
/// The following data need to be passed in a JSON representation in the body of
/// the POST request:
///
/// - `username`: The name of the user as a string. This is mandatory.
/// - `user`: The name of the user as a string. This is mandatory.
///
/// - `passwd`: The user password as a string. If no password is specified,
/// the empty string will be used.
@ -166,7 +167,13 @@ function post_api_user (req, res) {
return;
}
users.save(json.username, json.passwd, json.active, json.extra);
var user = json.user;
if (user === undefined && json.hasOwnProperty("username")) {
// deprecated usage
user = json.username;
}
users.save(user, json.passwd, json.active, json.extra);
users.reload();
actions.resultOk(req, res, actions.HTTP_CREATED, { });
@ -175,11 +182,11 @@ function post_api_user (req, res) {
////////////////////////////////////////////////////////////////////////////////
/// @brief replace an existing user
///
/// @RESTHEADER{PUT /_api/user/{username},replaces user}
/// @RESTHEADER{PUT /_api/user/{user},replaces user}
///
/// @RESTURLPARAMETERS
///
/// @RESTURLPARAM{username,string,required}
/// @RESTURLPARAM{user,string,required}
/// The name of the user.
///
/// @RESTBODYPARAM{body,json,required}
@ -187,7 +194,7 @@ function post_api_user (req, res) {
/// @RESTDESCRIPTION
///
/// Replaces the data of an existing user. The name of an existing user must
/// be specified in `username`.
/// be specified in `user`.
///
/// The following data can to be passed in a JSON representation in the body of
/// the POST request:
@ -245,7 +252,7 @@ function put_api_user (req, res) {
return;
}
var username = decodeURIComponent(req.suffix[0]);
var user = decodeURIComponent(req.suffix[0]);
var json = actions.getJsonBody(req, res, actions.HTTP_BAD);
@ -254,7 +261,7 @@ function put_api_user (req, res) {
}
try {
users.replace(username, json.passwd, json.active, json.extra);
users.replace(user, json.passwd, json.active, json.extra);
users.reload();
actions.resultOk(req, res, actions.HTTP_OK, { });
@ -272,11 +279,11 @@ function put_api_user (req, res) {
////////////////////////////////////////////////////////////////////////////////
/// @brief partially update an existing user
///
/// @RESTHEADER{PATCH /_api/user/{username},updates user}
/// @RESTHEADER{PATCH /_api/user/{user},updates user}
///
/// @RESTURLPARAMETERS
///
/// @RESTURLPARAM{username,string,required}
/// @RESTURLPARAM{user,string,required}
/// The name of the user.
///
/// @RESTBODYPARAM{body,json,required}
@ -284,7 +291,7 @@ function put_api_user (req, res) {
/// @RESTDESCRIPTION
///
/// Partially updates the data of an existing user. The name of an existing user
/// must be specified in `username`.
/// must be specified in `user`.
///
/// The following data can be passed in a JSON representation in the body of
/// the POST request:
@ -344,8 +351,7 @@ function patch_api_user (req, res) {
return;
}
var username = decodeURIComponent(req.suffix[0]);
var user = decodeURIComponent(req.suffix[0]);
var json = actions.getJsonBody(req, res, actions.HTTP_BAD);
if (json === undefined) {
@ -353,7 +359,7 @@ function patch_api_user (req, res) {
}
try {
users.update(username, json.passwd, json.active, json.extra);
users.update(user, json.passwd, json.active, json.extra);
users.reload();
actions.resultOk(req, res, actions.HTTP_OK, { });
}
@ -370,16 +376,16 @@ function patch_api_user (req, res) {
////////////////////////////////////////////////////////////////////////////////
/// @brief remove an existing user
///
/// @RESTHEADER{DELETE /_api/user/{username},removes a user}
/// @RESTHEADER{DELETE /_api/user/{user},removes a user}
///
/// @RESTURLPARAMETERS
///
/// @RESTURLPARAM{username,string,required}
/// @RESTURLPARAM{user,string,required}
/// The name of the user.
///
/// @RESTDESCRIPTION
///
/// Removes an existing user, identified by `username`.
/// Removes an existing user, identified by `user`.
///
/// If the user can be removed, the server will respond with `HTTP 202`.
///
@ -420,9 +426,9 @@ function delete_api_user (req, res) {
return;
}
var username = decodeURIComponent(req.suffix[0]);
var user = decodeURIComponent(req.suffix[0]);
try {
users.remove(username);
users.remove(user);
users.reload();
actions.resultOk(req, res, actions.HTTP_ACCEPTED, { });
}

View File

@ -2853,17 +2853,6 @@ table th[class*="span"],
outline: 0;
}
.caret {
display: inline-block;
width: 0;
height: 0;
vertical-align: top;
border-top: 4px solid #000000;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
content: "";
}
.dropdown .caret {
margin-top: 8px;
margin-left: 2px;

View File

@ -171,8 +171,14 @@
color:#FFFFFF;
}
.pagination-mini ul > li.disabled:last-child > a, .pagination-small ul > li.disabled:last-child > a, .pagination-mini ul > li.disabled:last-child > span, .pagination-small ul > li.disabled:last-child > span,
.pagination-mini ul > li.disabled:first-child > a, .pagination-small ul > li.disabled:first-child > a, .pagination-mini ul > li.disabled:first-child > span, .pagination-small ul > li.disabled:first-child > span {
.pagination-mini ul > li.disabled:last-child > a,
.pagination-small ul > li.disabled:last-child > a,
.pagination-mini ul > li.disabled:last-child > span,
.pagination-small ul > li.disabled:last-child > span,
.pagination-mini ul > li.disabled:first-child > a,
.pagination-small ul > li.disabled:first-child > a,
.pagination-mini ul > li.disabled:first-child > span,
.pagination-small ul > li.disabled:first-child > span {
pointer-events: none;
cursor: default;
background-color: ##777;
@ -193,7 +199,7 @@
border-radius:0;
}
.badge-success, .badge-success, .badge-important, .badge-inverse {
.badge-success, .badge-important, .badge-inverse {
background: none;
padding-left: 0px;
padding-right: 0px;

View File

@ -378,9 +378,3 @@ div.queryline div.searchByAttribute > ul.dropdown-menu {
display: none;
/* background-color: #8F8D8C; */
}
/* Temporary */
#transparentPlaceholder {
margin-right: -100%;
}

View File

@ -1,5 +1,5 @@
</head>
<body>
HHALO
<nav class="navbar">
<div class="resizecontainer">
<div class="navlogo">

View File

@ -7,4 +7,3 @@
<link href="css/style.css" rel="stylesheet">
<link href="css/sass.css" rel="stylesheet">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
</head>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -2,16 +2,17 @@
/*global EJS, window*/
(function() {
"use strict";
var TemplateEngine = function(prefix) {
prefix = prefix || "";
var TemplateEngine = function() {
var exports = {};
exports.createTemplate = function(path) {
var param = {
url: prefix + path
exports.createTemplate = function(id) {
var template = $("#" + id.replace(".", "\\.")).html();
return {
render: function(params) {
return _.template(template, params);
}
};
return new EJS(param);
};
return exports;
};
window.templateEngine = new TemplateEngine("js/templates/");
window.templateEngine = new TemplateEngine();
}());

View File

@ -18,9 +18,9 @@
COLOR_BOLD_WHITE, COLOR_YELLOW, COLOR_BOLD_YELLOW, COLOR_CYAN, COLOR_BOLD_CYAN, COLOR_MAGENTA,
COLOR_BOLD_MAGENTA, PRETTY_PRINT, VALGRIND, VERSION, UPGRADE,
BYTES_SENT_DISTRIBUTION, BYTES_RECEIVED_DISTRIBUTION, CONNECTION_TIME_DISTRIBUTION,
REQUEST_TIME_DISTRIBUTION, DEVELOPMENT_MODE, THREAD_NUMBER, LOGFILE_PATH,
REQUEST_TIME_DISTRIBUTION, DEVELOPMENT_MODE, FE_DEVELOPMENT_MODE, THREAD_NUMBER, LOGFILE_PATH,
SYS_PLATFORM, SYS_EXECUTE_EXTERNAL, SYS_STATUS_EXTERNAL, SYS_KILL_EXTERNAL,
FE_DEVELOPMENT_MODE, SYS_DEFINE_PERIODIC */
SYS_DEFINE_PERIODIC */
////////////////////////////////////////////////////////////////////////////////
/// @brief module "internal"

View File

@ -23,7 +23,6 @@ window.ArangoUsers = Backbone.Collection.extend({
},
logout: function () {
console.log("huhu");
this.activeUser = undefined;
this.reset();
$.ajax("unauthorized", {async:false}).error(

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -100,7 +100,9 @@ this.dummy.css({
var html = this.textarea.val().replace(/(<|>)/g, '');
// IE is different, as per usual
if ($.browser.msie)
//if ($.browser.msie)
// jQuery > 1.8 fix
if (navigator.appName == 'Microsoft Internet Explorer')
{
html = html.replace(/\n/g, '<BR>new');
}

View File

@ -1,18 +0,0 @@
/*
* jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
* http://benalman.com/projects/jquery-bbq-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
/*
* jQuery hashchange event - v1.2 - 2/11/2010
* http://benalman.com/projects/jquery-hashchange-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);

View File

@ -1,226 +0,0 @@
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Dual licensed under the MIT (MIT_LICENSE.txt)
* and GPL Version 2 (GPL_LICENSE.txt) licenses.
*
* Version: 1.1.1
* Requires jQuery 1.3+
* Docs: http://docs.jquery.com/Plugins/livequery
*/
(function($) {
$.extend($.fn, {
livequery: function(type, fn, fn2) {
var self = this, q;
// Handle different call patterns
if ($.isFunction(type))
fn2 = fn, fn = type, type = undefined;
// See if Live Query already exists
$.each( $.livequery.queries, function(i, query) {
if ( self.selector == query.selector && self.context == query.context &&
type == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) )
// Found the query, exit the each loop
return (q = query) && false;
});
// Create new Live Query if it wasn't found
q = q || new $.livequery(this.selector, this.context, type, fn, fn2);
// Make sure it is running
q.stopped = false;
// Run it immediately for the first time
q.run();
// Contnue the chain
return this;
},
expire: function(type, fn, fn2) {
var self = this;
// Handle different call patterns
if ($.isFunction(type))
fn2 = fn, fn = type, type = undefined;
// Find the Live Query based on arguments and stop it
$.each( $.livequery.queries, function(i, query) {
if ( self.selector == query.selector && self.context == query.context &&
(!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped )
$.livequery.stop(query.id);
});
// Continue the chain
return this;
}
});
$.livequery = function(selector, context, type, fn, fn2) {
this.selector = selector;
this.context = context;
this.type = type;
this.fn = fn;
this.fn2 = fn2;
this.elements = [];
this.stopped = false;
// The id is the index of the Live Query in $.livequery.queries
this.id = $.livequery.queries.push(this)-1;
// Mark the functions for matching later on
fn.$lqguid = fn.$lqguid || $.livequery.guid++;
if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++;
// Return the Live Query
return this;
};
$.livequery.prototype = {
stop: function() {
var query = this;
if ( this.type )
// Unbind all bound events
this.elements.unbind(this.type, this.fn);
else if (this.fn2)
// Call the second function for all matched elements
this.elements.each(function(i, el) {
query.fn2.apply(el);
});
// Clear out matched elements
this.elements = [];
// Stop the Live Query from running until restarted
this.stopped = true;
},
run: function() {
// Short-circuit if stopped
if ( this.stopped ) return;
var query = this;
var oEls = this.elements,
els = $(this.selector, this.context),
nEls = els.not(oEls);
// Set elements to the latest set of matched elements
this.elements = els;
if (this.type) {
// Bind events to newly matched elements
nEls.bind(this.type, this.fn);
// Unbind events to elements no longer matched
if (oEls.length > 0)
$.each(oEls, function(i, el) {
if ( $.inArray(el, els) < 0 )
$.event.remove(el, query.type, query.fn);
});
}
else {
// Call the first function for newly matched elements
nEls.each(function() {
query.fn.apply(this);
});
// Call the second function for elements no longer matched
if ( this.fn2 && oEls.length > 0 )
$.each(oEls, function(i, el) {
if ( $.inArray(el, els) < 0 )
query.fn2.apply(el);
});
}
}
};
$.extend($.livequery, {
guid: 0,
queries: [],
queue: [],
running: false,
timeout: null,
checkQueue: function() {
if ( $.livequery.running && $.livequery.queue.length ) {
var length = $.livequery.queue.length;
// Run each Live Query currently in the queue
while ( length-- )
$.livequery.queries[ $.livequery.queue.shift() ].run();
}
},
pause: function() {
// Don't run anymore Live Queries until restarted
$.livequery.running = false;
},
play: function() {
// Restart Live Queries
$.livequery.running = true;
// Request a run of the Live Queries
$.livequery.run();
},
registerPlugin: function() {
$.each( arguments, function(i,n) {
// Short-circuit if the method doesn't exist
if (!$.fn[n]) return;
// Save a reference to the original method
var old = $.fn[n];
// Create a new method
$.fn[n] = function() {
// Call the original method
var r = old.apply(this, arguments);
// Request a run of the Live Queries
$.livequery.run();
// Return the original methods result
return r;
}
});
},
run: function(id) {
if (id != undefined) {
// Put the particular Live Query in the queue if it doesn't already exist
if ( $.inArray(id, $.livequery.queue) < 0 )
$.livequery.queue.push( id );
}
else
// Put each Live Query in the queue if it doesn't already exist
$.each( $.livequery.queries, function(id) {
if ( $.inArray(id, $.livequery.queue) < 0 )
$.livequery.queue.push( id );
});
// Clear timeout if it already exists
if ($.livequery.timeout) clearTimeout($.livequery.timeout);
// Create a timeout to check the queue and actually run the Live Queries
$.livequery.timeout = setTimeout($.livequery.checkQueue, 20);
},
stop: function(id) {
if (id != undefined)
// Stop are particular Live Query
$.livequery.queries[ id ].stop();
else
// Stop all Live Queries
$.each( $.livequery.queries, function(id) {
$.livequery.queries[ id ].stop();
});
}
});
// Register core DOM manipulation methods
$.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove', 'html');
// Run Live Queries when the Document is ready
$(function() { $.livequery.play(); });
})(jQuery);

View File

@ -77,7 +77,7 @@ if (Function.prototype.bind && console && typeof console.log == "object") {
var Docs = {
shebang: function() {
return true;
// If shebang has an operation nickname in it..
// e.g. /docs/#!/words/get_search
var fragments = $.param.fragment().split('/');

View File

@ -5,13 +5,20 @@ window.Users = Backbone.Model.extend({
defaults: {
user: "",
active: false,
extra: {},
error: false,
code: 200
extra: {}
},
idAttribute : "user",
parse : function (d) {
this.isNotNew = true;
return d;
},
isNew: function () {
return !this.isNotNew;
},
url: function () {
if (this.get("user") !== "") {
return "/_api/user/" + this.get("user");

View File

@ -31,7 +31,8 @@
"graphManagement" : "graphManagement",
"graphManagement/add" : "graphAddNew",
"graphManagement/delete/:name" : "graphDelete",
"userManagement" : "userManagement"
"userManagement" : "userManagement",
"userProfile" : "userProfile"
},
initialize: function () {
@ -446,7 +447,7 @@
},
handleSelectDatabase: function () {
this.footerView.handleSelectDatabase();
this.naviView.handleSelectDatabase();
},
handleResize: function () {
@ -478,6 +479,16 @@
}
this.userManagementView.render();
this.naviView.selectMenuItem('user-menu');
},
userProfile: function() {
if (!this.userProfileView) {
this.userProfileView = new window.userProfileView({
collection: window.userCollection
});
}
this.userProfileView.render();
this.naviView.selectMenuItem('user-menu');
}
});

View File

@ -1,29 +1,31 @@
<div id="add-graph" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<a class="arangoHeader">Add new Graph</a>
<script id="addGraphView.ejs" type="text/template">
<div id="add-graph" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<a class="arangoHeader">Add new Graph</a>
</div>
<div class="modal-body">
<table>
<tr>
<th class="collectionTh">Name:</th>
<th class="collectionTh"><input type="text" id="newGraphName" placeholder="graphName"></input></th>
<th><a class="modalTooltips" title="The name to identify the graph. Has to be unique."><i class="icon-info-sign"></i></a></th>
</tr>
<tr>
<th class="collectionTh">Vertices:</th>
<th class="collectionTh"><input type="text" id="newGraphVertices" placeholder="Vertex Collection"></input></th>
<th><a class="modalTooltips" title="The path name of the document collection that should be used as vertices. If this does not exist it will be created."><i class="icon-info-sign"></i></a></th>
</tr>
<tr>
<th class="collectionTh">Edges:</th>
<th class="collectionTh"><input type="text" id="newGraphEdges" placeholder="Edge Collection"></input></th>
<th><a class="modalTooltips" title="The path name of the edge collection that should be used as edges. If this does not exist it will be created."><i class="icon-info-sign"></i></a></th>
</tr>
</table>
</div>
<div class="modal-footer">
<button id="cancel" class="btn btn-warning">Cancel</button>
<button id="createGraph" class="btn btn-success pull-right">Create</button>
</div>
</div>
<div class="modal-body">
<table>
<tr>
<th class="collectionTh">Name:</th>
<th class="collectionTh"><input type="text" id="newGraphName" placeholder="graphName"></input></th>
<th><a class="modalTooltips" title="The name to identify the graph. Has to be unique."><i class="icon-info-sign"></i></a></th>
</tr>
<tr>
<th class="collectionTh">Vertices:</th>
<th class="collectionTh"><input type="text" id="newGraphVertices" placeholder="Vertex Collection"></input></th>
<th><a class="modalTooltips" title="The path name of the document collection that should be used as vertices. If this does not exist it will be created."><i class="icon-info-sign"></i></a></th>
</tr>
<tr>
<th class="collectionTh">Edges:</th>
<th class="collectionTh"><input type="text" id="newGraphEdges" placeholder="Edge Collection"></input></th>
<th><a class="modalTooltips" title="The path name of the edge collection that should be used as edges. If this does not exist it will be created."><i class="icon-info-sign"></i></a></th>
</tr>
</table>
</div>
<div class="modal-footer">
<button id="cancel" class="btn btn-warning">Cancel</button>
<button id="createGraph" class="btn btn-success pull-right">Create</button>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="apiView.ejs" type="text/template">
<ul class="thumbnails2">
<div class="headerBar">
<a class="arangoHeader">Core - API - Documentation</a>
@ -8,3 +9,4 @@
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="appDocumentationView.ejs" type="text/template">
<ul class="thumbnails2">
<div class="headerBar">
<a class="arangoHeader">API - Documentation</a>
@ -8,3 +9,4 @@
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="applicationsView.ejs" type="text/template">
<ul class="thumbnails2">
<div class="headerBar">
<a class="arangoHeader">Applications</a>
@ -77,3 +78,4 @@
<ul id="availableList" class="tileList"></ul>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="collectionInfoView.ejs" type="text/template">
<div id="show-collection" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
@ -84,3 +85,4 @@
<button id="closeBtnInfoView"class="btn btn-close" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="collectionView.ejs" type="text/template">
<div id="change-collection" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
@ -73,4 +74,4 @@
<button id="abortDeleteCollection" class="btn pull-right" style="margin-top: -4px; margin-right:10px;">No</button>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="collectionsItemView.ejs" type="text/template">
<div class="iconSet">
<span id="editCollection" class="icon_arangodb_settings2" alt="Edit collection properties" title="Edit collection properties"></span>
<% if(attributes.status === "loaded") { %>
@ -7,8 +8,13 @@
<%}%>
</div>
<div class="plain">
<img src="<%= attributes.picture %>" height="50" width="50" alt="" class="icon">
<span class="badge badge-success <%= attributes.status %>"><div class="cornered"><%= attributes.status %></div></span>
<h5 class="collectionName"><%= attributes.name %></h5>
<img src="<%= attributes.picture %>" height="50" width="50" alt="" class="icon">
<div class="tileBadge">
<span>
<div class="corneredBadge <%= attributes.status %>">
<%= attributes.status %>
</div>
</span>
</div>
<h5 class="collectionName"><%= attributes.name %></h5>
</script>

View File

@ -1,3 +1,4 @@
<script id="collectionsView.ejs" type="text/template">
<ul class="thumbnails2">
<div class="headerBar">
<div class="headerButtonBar pull-right">
@ -98,4 +99,4 @@
<div class="containerdivNewLine"/>
<ul id="collectionsThumbnailsIn" class="tileList" />
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="dashboardView.ejs" type="text/template">
<ul class="thumbnails2">
<div id="dashboardHeader" class="headerBar">
<a class="arangoHeader">Dashboard</a>
@ -162,3 +163,4 @@
<div id="dbThumbnailsIn"/>
</ul>
</script>

View File

@ -1,3 +1,4 @@
<script id="databaseView.ejs" type="text/template">
<ul class="thumbnails2" id="databaseHeader">
<div class="headerBar">
<a class="arangoHeader">Databases</a>
@ -69,3 +70,4 @@
<button id="submitDeleteDatabase" class="btn btn-danger pull-right">Delete</button>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="dbSelectionView.ejs" type="text/template">
<a href="#" class="tab" id="dbselection">DB: <%=current%> <b class="caret"></b></a>
<ul class="link-dropdown-menu" id="dbs_dropdown">
<%
@ -25,3 +26,4 @@ if (list.length > 1) {
<li id="databaseNavi" class="dropdown-item"><a id="databases" class="" href="#databases">Manage DBs</a></li>
<% } %>
</ul>
</script>

View File

@ -1,3 +1,4 @@
<script id="deleteGraphView.ejs" type="text/template">
<div id="delete-graph" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
@ -13,3 +14,4 @@
<button id="confirmDelete" class="btn btn-danger pull-right">Delete</button>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="documentSourceView.ejs" type="text/template">
<div class="thumbnails2 sourceBox">
<div id="transparentHeader" class="headerBar">
@ -21,3 +22,4 @@
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="documentView.ejs" type="text/template">
<div class="thumbnails2" id="documentviewMain">
<div id="transparentHeader" class="headerBar">
@ -31,3 +32,4 @@
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="documentsView.ejs" type="text/template">
<ul class="thumbnails2">
<div id="transparentHeader" class="headerBar">
<div id="documentsToolbar" class="headerButtonBar pull-right">
@ -278,3 +279,4 @@
<button id="confirmCreateEdge" class="btn btn-success" style="float:right">Create</button>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="editListEntryView.ejs" type="text/template">
<td class="writable sorting_1">
<% if (isReadOnly) { %>
<span class="key"><%=key%></span>
@ -18,3 +19,4 @@
<span class="icon_arangodb_roundminus" data-original-title="Delete attribute"></span>
</a>
</td>
</script>

View File

@ -1,3 +1,4 @@
<script id="footerView.ejs" type="text/template">
<%
var n,v,db;
if (name) {
@ -12,3 +13,4 @@
<div class="footer-right">
<p><% if(n) { %>Server: <%=n%> <%=v%> <% } %></p>
</div>
</script>

View File

@ -1,40 +1,35 @@
<script id="foxxActiveView.ejs" type="text/template">
<% var appInfos = attributes.app.split(":"); %>
<div class="iconSet">
<span class="icon_arangodb_settings2" alt="Edit collection properties" title="Edit collection properties"></span>
<span class="icon_arangodb_info" title="Show API documentation"></span>
</div>
<div class="plain">
<img src="foxxes/thumbnail/<%=attributes.app %>" height="50" width="50" alt="" class="icon">
<%if (attributes.development) {%>
<span class="badge badge-success loaded">
<div class="cornered">
development
</div>
</span>
<%} else if (attributes.active) {%>
<span class="badge badge-success loaded">
<div class="cornered">
active
</div>
</span>
<%} else {%>
<span class="badge badge-success unloaded">
<div class="cornered">
<img src="foxxes/thumbnail/<%=attributes.app %>" height="50" width="50" alt="" class="icon">
<%if (attributes.development) {%>
<div class="tileBadge">
<span>
<div class="corneredBadge loaded">
development
</div>
</span>
</div>
<%} else if (attributes.active) {%>
<div class="tileBadge">
<span>
<div class="corneredBadge loaded">
active
</div>
</span>
</div>
<%} else {%>
<div class="tileBadge">
<span>
<div class="corneredBadge unloaded">
inactive
</div>
</span>
<%}%>
<h5 class="collectionName"><%= appInfos[1] %><%= attributes.isSystem ? " (system)" : "" %><%= appInfos[0] === "dev" ? " (dev)" : ""%></h5>
</div>
<!--
<small>
Description: <%=attributes.description %><br />
<strong>Mount:</strong>&nbsp;<%=attributes.mount %><br />
<strong>Version:</strong>&nbsp;<%=appInfos[2] %><br />
<strong>Prefix:</strong>&nbsp;<%=attributes.options && attributes.options.collectionPrefix%><br />
Git: <a href=<%=attributes.git %>>Repository</a>
</small>
-->
</div>
<%}%>
<h5 class="collectionName"><%= appInfos[1] %><%= attributes.isSystem ? " (system)" : "" %><%= appInfos[0] === "dev" ? " (dev)" : ""%></h5>
</script>

View File

@ -1,3 +1,4 @@
<script id="foxxEditView.ejs" type="text/template">
<%var appInfos = attributes.app.split(":"); %>
<div id="change-foxx" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
@ -60,3 +61,4 @@
</div>
</div>
</script>

View File

@ -1,29 +1,15 @@
<script id="foxxInstalledView.ejs" type="text/template">
<div class="iconSet">
<span id="editCollection" class="icon_arangodb_settings2" alt="Edit collection properties" title="Edit collection properties"></span>
<% if(attributes.status === "loaded") { %>
<span class="icon_arangodb_info" title="Show collection properties"></span>
<%} else {%>
<span class="icon_arangodb_info disabled" alt="disabled"></span>
<%}%>
</div>
<div class="plain">
<img src="<%= attributes.picture %>" height="50" width="50" alt="" class="icon">
<span class="badge badge-success <%= attributes.status %>"><div class="cornered"><%= attributes.status %></div></span>
<h5 class="collectionName"><%= attributes.name %><%= attributes.isSystem ? " (system)" : "" %></h5>
</div>
<small>
<div class="plain">
<h5 class="applicationName"><%= attributes.name %><%= attributes.isSystem ? " (system)" : "" %></h5>
<img src="foxxes/thumbnail/<%=attributes.app %>" alt="icon" class="foxxIcon"/>
<p class="foxxDescription">
<!--Description: <%=attributes.description %><br />-->
<strong>Path:</strong>&nbsp;<%=attributes.path %><br />
<strong>Version:</strong>&nbsp;<%=attributes.version %><br />
<!--Git: <a href=<%=attributes.git %>>Repository</a>-->
</p>
<button class="btn btn-success pull-right install">Install</button>
</div>
</small>
<img src="foxxes/thumbnail/<%= attributes.app %>" height="50" width="50" alt="" class="icon">
<!-- <p class="foxxDescription">
Description: <%=attributes.description %><br />
<strong>Path:</strong>&nbsp;<%=attributes.path %><br />
<strong>Version:</strong>&nbsp;<%=attributes.version %><br />
Git: <a href=<%=attributes.git %>>Repository</a>
</p> -->
<div class="tileBadge">
<button class="btn btn-success install">Install</button>
</div>
<h5 class="collectionName"><%= attributes.name %><%= attributes.isSystem ? " (system)" : "" %> - v: <%= attributes.version %></h5>
</script>

View File

@ -1,3 +1,4 @@
<script id="foxxInstalledView.ejs" type="text/template">
<ul class="thumbnails2">
<div class="headerBar">
<a class="arangoHeader">Applications</a>
@ -14,3 +15,4 @@
<ul class="contentDiv" id="foxxList">
</ul>
</script>

View File

@ -1,3 +1,4 @@
<script id="foxxMountView.ejs" type="text/template">
<div id="install-foxx" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
@ -37,3 +38,4 @@
<button class="btn btn-success pull-right installFoxx">Install</button>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="graphView.ejs" type="text/template">
<%
var ds = [], es = [],
sortF = function(e) {
@ -174,3 +175,4 @@ gs = _.sortBy(gs, sortF);
</form>
</div>
</div>
</script>

View File

@ -1,7 +1,9 @@
<script id="graphViewGroupByEntry.ejs" type="text/template">
<div class="control-group">
<label for="group_by_<%=id%>" class="control-label">Attribute <%=id%></label>
<div class="controls">
<input id="group_by_<%=id%>" type="text" name="group_by_<%=id%>" placeholder="Attribute" maxlength="75" class="input-xlarge">
<button id="remove_group_by_<%=id%>" class="graphViewer-icon-button gv_internal_remove_line gv-icon-small delete" />
</div>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="loginView.ejs" type="text/template">
<div id="loginWindow">
<div id="loginSpace"/>
<img id="loginLogo" src="img/logo_arangodb_transp.png"/>
@ -9,3 +10,4 @@
Testing: Enter custom data!
<button id="submitLogin" class="btn btn-success pull-right">Login</button>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="logsView.ejs" type="text/template">
<div class="thumbnails2">
<div class="headerBar">
<a class="arangoHeader">Logs</a>
@ -93,3 +94,4 @@
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="manageGraphsView.ejs" type="text/template">
<ul class="thumbnails2">
<div class="headerBar">
<div class="pull-left">
@ -71,3 +72,4 @@
<div id="documentsToolbarF" class="pagination pagination-small pagination-centered">
</div>
</div>
</script>

View File

@ -1,10 +1,11 @@
<script id="navigationView.ejs" type="text/template">
<ul class="navlist" id="arangoCollectionUl">
<!-- <li class="dashboard-menu"><a id="dashboard" class="tab" href="#dashboard">Dashboard</a></li>-->
<li id="dbSelect" class="dropdown databases-menu"></li>
<li class="collections-menu"><a id="collections" class="tab" href="#collections">Collections</a></li>
<li class="graphviewer-menu"><a id="graph" class="tab" href="#graph">Graphs</a></li>
<li class="applications-menu"><a id="applications" class="tab" href="#applications">Applications</a></li>
<li class="applications-menu navbar-spacer"><a id="applications" class="tab" href="#applications">Applications</a></li>
<li class="query-menu"><a id="query" class="tab" href="#query">AQL Editor</a></li>
<!-- <li class="api-menu"><a id="api" class="tab" href="#api">API</a></li> -->
<li class="dropdown tools-menu" id="toolsDropdown">
@ -68,3 +69,4 @@
<% } %>
<option value="#api">Api</option>
</select>
</script>

View File

@ -1,3 +1,4 @@
<script id="newCollectionView.ejs" type="text/template">
<div id="add-collection" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
@ -64,3 +65,4 @@
<button id="save-new-collection" class="btn btn-success pull-right">Save</button>
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="notificationItem.ejs" type="text/template">
<% notifications.forEach(function(n) { %>
<li class="dropdown-item">
<div class="notificationItem">
@ -7,3 +8,4 @@
</div>
</li>
<% }); %>
</script>

View File

@ -1,3 +1,4 @@
<script id="queryView.ejs" type="text/template">
<ul class="thumbnails2">
<div class="headerBar">
<div class="headerButtonBar pull-right">
@ -96,3 +97,4 @@
</div>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="shellView.ejs" type="text/template">
<ul class="thumbnails2 shellul">
<div class="headerBar">
<a class="arangoHeader">JS Shell</a>
@ -9,4 +10,4 @@
</div>
</ul>
</script>

View File

@ -1,3 +1,4 @@
<script id="statisticBarView.ejs" type="text/template">
<div class="navlogo">
<a id="stat_cpu" href="#dashboard" style="padding-left: 5px">
<img src="img/tmp_dashbord_activity_yellow.jpg">
@ -5,3 +6,4 @@
<img height="23"src="img/tmp_dashbord_activity_red.jpg">
</a>
</div>
</script>

View File

@ -1,3 +1,4 @@
<script id="userBarView.ejs" type="text/template">
<ul class="navlist" id="userBarUl">
<div class="navlogo">
@ -6,13 +7,13 @@
<li class="dropdown user-menu">
<a href="#" class="tab" id="user" >
<img src="<%=img%>" id="userimage" height="23" width="23" /> <b class="caret"></b>
<img class="userMenuImg" src="<%=img%>" id="userimage" /> <b class="caret"></b>
</a>
<ul class="user-dropdown-menu" id="user_dropdown">
<li class="dropdown-header" style="text-transform: none">
<%
if(username === null) {
%>-<%
%>User Management<%
} else {
if (name) {%>
<%=name%> (<%=username%>)
@ -24,15 +25,17 @@
%>
<% if(username !== null) { %>
<li class="dropdown-item">
<a id="user" class="tab" href="#user">User profile</a>
<a id="userProfile" class="tab" href="#user">User profile</a>
</li>
<% } %>
<li class="dropdown-item">
<a id="userManagement" class="internalLink" href="#userManagement">User management</a>
</li>
<% if(username !== null) { %>
<li class="dropdown-item">
<a id="userLogout" class="tab" href="#user">Logout</a>
</li>
<% } %>
</ul>
</li>
@ -48,3 +51,4 @@
</ul>
</script>

View File

@ -1,3 +1,4 @@
<script id="userManagementView.ejs" type="text/template">
<ul class="thumbnails2" id="userManagementHeader">
<div class="headerBar">
<a class="arangoHeader">User Management</a>
@ -101,3 +102,4 @@
<button id="submitEditUser" class="btn btn-success pull-right">Save</button>
</div>
</div>
</script>

View File

@ -0,0 +1,55 @@
<script id="userProfileView.ejs" type="text/template">
<div class="centralContent">
<ul class="thumbnails2">
<div class="headerBar">
<a class="arangoHeader">
User Profile
</a>
</div>
</ul>
<div class="contentDiv" id="profileContent" >
<table class="arangoDataTable contentTables">
<tr>
<td style="float: right">
<img src="https://s.gravatar.com/avatar/<%=img%>?s=150" />
</td>
<td>
<div>
<div>USERNAME:</div><div><%=username%></div>
</div>
<div>
<div>NAME:</div><div><%=name%></div>
</div>
</td>
</tr>
</table>
</div>
<div id="editUserProfileModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<a class="arangoHeader">Edit User Profile</a>
</div>
<div class="modal-body">
<table>
<tr>
<th>Username:</th>
<th id="editUsername"></th>
</tr>
<tr>
<th>Name:</th>
<th><input type="text" id="editName" name="name" value="" placeholder="Name"/></th>
</tr>
<tr>
<th>Gravatar-Link:</th>
<th><input type="text" id="editImg" name="img" value="" placeholder="Gravatar"/></th>
</tr>
</table>
</div>
<div class="modal-footer">
<button class="btn btn-close" data-dismiss="modal" aria-hidden="true">Close</button>
<button id="submitEditUserProfile" class="btn btn-success pull-right">Save</button>
</div>
</div>
</script>

View File

@ -192,7 +192,7 @@ window.ApplicationsView = Backbone.View.extend({
},
render: function() {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
var self = this;
_.each(this._installedSubViews, function (v) {
$("#installedList").append(v.render());

View File

@ -13,7 +13,7 @@
template: templateEngine.createTemplate("collectionInfoView.ejs"),
render: function() {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
$('#show-collection').modal('show');
this.fillModal();

View File

@ -10,7 +10,7 @@
template: templateEngine.createTemplate("collectionView.ejs"),
render: function() {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
$('#change-collection').modal('show');
$('#change-collection').on('hidden', function () {
});

View File

@ -20,7 +20,7 @@
dropdownVisible = true;
}
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
this.setFilterValues();
if (dropdownVisible === true) {

View File

@ -211,7 +211,7 @@
render: function() {
var self = this;
self.updateNOW = true;
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
this.getReplicationStatus();
arangoHelper.fixTooltips(".icon_arangodb", "top");

View File

@ -17,7 +17,7 @@
template: templateEngine.createTemplate("documentSourceView.ejs"),
render: function() {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
this.breadcrumb();
this.editor();

View File

@ -166,7 +166,7 @@
}
},
render: function() {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
this.breadcrumb();
return this;
},

View File

@ -570,7 +570,7 @@
render: function() {
this.collectionContext = window.arangoCollectionsStore.getPosition(this.colid);
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
this.getIndex();
this.initTable();
this.breadcrumb();

View File

@ -42,7 +42,7 @@
},
render: function() {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
_.each(this._subViews, function (v) {
$("#foxxList").append(v.render());
});

View File

@ -40,7 +40,7 @@
render: function() {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
_.each(this._subViews, function (v) {
$("#foxxList").append(v.render());
});

View File

@ -5,7 +5,7 @@
"use strict";
window.FoxxInstalledView = Backbone.View.extend({
tagName: 'li',
className: "span3",
className: "tile",
template: templateEngine.createTemplate("foxxInstalledView.ejs"),
events: {

View File

@ -22,7 +22,7 @@
render: function() {
this.addDummyUser();
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
$(this.el2).hide();
$(this.el3).hide();

View File

@ -132,7 +132,7 @@
},
render: function() {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
return this;
},
renderPagination: function (totalPages, currentPage) {

View File

@ -12,7 +12,7 @@
render: function() {
var self = this;
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
$('#add-collection').modal('show');
$('#add-collection').on('hidden', function () {
self.hidden();

View File

@ -90,7 +90,7 @@
template: templateEngine.createTemplate("queryView.ejs"),
render: function () {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
// fill select box with # of results
var querySize = 1000;

View File

@ -15,7 +15,7 @@
template: templateEngine.createTemplate("shellView.ejs"),
render: function() {
$(this.el).html(this.template.text);
$(this.el).html(this.template.render({}));
this.replShell();

View File

@ -21,6 +21,7 @@
this.collection.bind("remove", this.renderNotifications.bind(this));
this.collection.bind("reset", this.renderNotifications.bind(this));
this.userCollection = this.options.userCollection;
this.userCollection.bind("change", this.render(this.$el));
},
notificationItem: templateEngine.createTemplate("notificationItem.ejs"),
@ -59,16 +60,7 @@
},
hideDropdown: function (e) {
var tab = e.target || e.srcElement;
var navigateTo = tab.id;
if (navigateTo === "") {
tab = $(tab).closest(".user-dropdown-menu");
navigateTo = tab.attr("id");
}
if (navigateTo === "user" || navigateTo === "user_dropdown" || navigateTo === "userimage" ) {
$("#user_dropdown").hide();
return;
}
$("#user_dropdown").hide();
},
removeAllNotifications: function () {
@ -112,7 +104,7 @@
if (!img) {
img = "img/arangodblogoAvatar.png";
} else {
img = "https://s.gravatar.com/avatar/" + img + "?s=23";
img = "https://s.gravatar.com/avatar/" + img + "?s=28";
}
if (!name) {
name = "";
@ -135,7 +127,7 @@
},
userLogout : function() {
this.userCollection.whoAmI(),
this.userCollection.whoAmI();
this.userCollection.logout();
}
});

View File

@ -94,9 +94,10 @@
return;
}
var options = {
username: userName,
user: userName,
passwd: userPassword,
active: status
active: status,
extra:{name: name}
};
this.collection.create(options, {
wait:true,
@ -138,7 +139,7 @@
},
removeUser : function(e) {
this.userToDelete = $(e.currentTarget).parent().parent().children().first().text();
this.userToDelete = $(e.currentTarget).parent().parent().attr("id");
$('#deleteUserModal').modal('show');
e.stopPropagation();
},
@ -197,7 +198,7 @@
return false;
}
if (!username.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)) {
arangoHelper.arangoError("Username may only contain numbers, letters, _ and -");
arangoHelper.arangoError("Wrong Username", "Username may only contain numbers, letters, _ and -");
return false;
}
return true;
@ -212,7 +213,7 @@
return true;
}
if (!name.match(/^[a-zA-Z][a-zA-Z0-9_\-\ ]*$/)) {
arangoHelper.arangoError("Username may only contain numbers, letters, _ and -");
arangoHelper.arangoError("Wrong Username", "Username may only contain numbers, letters, _ and -");
return false;
}
return true;

View File

@ -10,16 +10,85 @@
template: templateEngine.createTemplate("userProfileView.ejs"),
events: {
"click #profileContent" : "editUserProfile",
"click #submitEditUserProfile" : "submitEditUserProfile"
},
initialize: function() {
//this.collection.fetch({async:false});
this.collection.fetch({async:false});
this.user = this.collection.findWhere({loggedIn: true});
},
render: function(){
$(this.el).html(this.template.render({}));
$(this.el).html(this.template.render({
img : this.user.get("extra").img,
name : this.user.get("extra").name,
username : this.user.get("user")
}));
return this;
},
editUserProfile : function() {
this.collection.fetch();
$('#editUsername').html(this.user.get("user"));
$('#editName').val(this.user.get("extra").name);
$('#editImg').val(this.user.get("extra").img);
this.showModal();
},
submitEditUserProfile : function() {
var self = this;
var userName = this.user.get("user");
var name = $('#editName').val();
var img = $('#editImg').val();
var active = this.user.get("active");
img = this.parseImgString(img);
/* if (!this.validateName(name)) {
$('#editName').closest("th").css("backgroundColor", "red");
return;
}*/
this.user.set({"extra": {"name":name, "img":img}, "active":active});
this.user.save();
this.hideModal();
this.updateUserProfile();
},
updateUserProfile: function() {
var self = this;
this.collection.fetch({
success: function() {
self.render();
}
});
},
showModal: function() {
$('#editUserProfileModal').modal('show');
},
hideModal: function() {
$('#editUserProfileModal').modal('hide');
},
parseImgString : function(img) {
var strings;
if (img.search("avatar/") !== -1) {
strings = img.split("avatar/");
img = strings[1];
}
if (img.search("\\?") !== -1) {
strings = img.split("?");
img = strings[0];
}
return img;
}
});
}());

View File

@ -7,6 +7,8 @@ $c_negative_hover: #BE342E;
$c_neutral: #8F8D8C;
$c_neutral_hover: #736B68;
$c_unloaded: #FF8F35;
$c_header_btn_bg: #DDDDDD;
$c_header_btn_fg: #555555;
$c_header_btn_border: #222222;

View File

@ -1,12 +1,15 @@
nav.navbar {
@extend %fixedbar;
top: 0px;
height: 34px;
height: 37px;
margin-bottom: 3px;
}
div.navlogo {
@extend %pull-left;
margin-left: 5px;
margin-right: 5px;
margin-right: 1px;
}
div.navmenu {
@ -24,11 +27,14 @@ ul.navlist {
> li:hover {
background-color: $c_positive;
}
li.dropdown-item {
margin-left: 0px;
}
}
a.tab {
padding: {
top: 7px;
top: 8px;
left: 10px;
bottom: 10px;
right: 10px;
@ -53,3 +59,17 @@ ul.user-dropdown-menu {
margin-right: 15px;
}
.caret {
display: inline-block;
width: 0;
height: 0;
vertical-align: top;
border-top: 5px solid $c_white;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
content: "";
}
.navbar-spacer {
margin-right: 15px;
}

View File

@ -72,8 +72,8 @@
}
#stat_hd {
width: 19px;
height: 19px;
width: 22px;
height: 22px;
margin-top: 5px;
background-color: #333232;
border-radius: 3px;
@ -95,5 +95,6 @@
#stat_hd #stat_hd_counter {
color: white;
margin-left: 5px;
margin-left: 7px;
line-height: 23px;
}

View File

@ -63,6 +63,39 @@ li.tile {
.deleted div {
border-bottom: 16px solid red;
}
div.tileBadge {
position: absolute;
right: 0px;
bottom: 29px;
font-size: 11px;
font-weight: 300;
color: $c_white;
span {
display: inline-block;
line-height: 13px;
div.corneredBadge {
padding-left: 4px;
padding-right: 9px;
height: 0px;
border: {
left: 17px solid transparent;
bottom: {
width: 17px;
style: solid;
}
}
&.loaded {
border-bottom-color: $c_positive;
}
&.unloaded {
border-bottom-color: $c_unloaded;
}
}
}
}
}
.collectionName {

View File

@ -0,0 +1,5 @@
.userMenuImg {
height : "28";
width : "28";
margin-top: -3px;
}

View File

@ -188,9 +188,14 @@ div.centralContent {
nav.navbar {
top: 0px;
height: 34px;
height: 37px;
margin-bottom: 3px; }
div.navlogo {
margin-left: 5px;
margin-right: 5px;
margin-right: 1px; }
ul.navlist {
list-style: none; }
ul.navlist li {
@ -199,9 +204,11 @@ ul.navlist {
ul.navlist li.dropdown-item:hover,
ul.navlist > li:hover {
background-color: #8aa051; }
ul.navlist li.dropdown-item {
margin-left: 0px; }
a.tab {
padding-top: 7px;
padding-top: 8px;
padding-left: 10px;
padding-bottom: 10px;
padding-right: 10px;
@ -215,6 +222,19 @@ a.tab {
margin-bottom: 0;
margin-right: 15px; }
.caret {
display: inline-block;
width: 0;
height: 0;
vertical-align: top;
border-top: 5px solid white;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
content: ""; }
.navbar-spacer {
margin-right: 15px; }
footer.footer {
bottom: 0px;
height: 40px; }
@ -268,6 +288,27 @@ li.tile {
border-bottom: 16px solid #FF8F35; }
li.tile .deleted div {
border-bottom: 16px solid red; }
li.tile div.tileBadge {
position: absolute;
right: 0px;
bottom: 29px;
font-size: 11px;
font-weight: 300;
color: white; }
li.tile div.tileBadge span {
display: inline-block;
line-height: 13px; }
li.tile div.tileBadge span div.corneredBadge {
padding-left: 4px;
padding-right: 9px;
height: 0px;
border-left: 17px solid transparent;
border-bottom-width: 17px;
border-bottom-style: solid; }
li.tile div.tileBadge span div.corneredBadge.loaded {
border-bottom-color: #8aa051; }
li.tile div.tileBadge span div.corneredBadge.unloaded {
border-bottom-color: #ff8f35; }
.collectionName {
text-align: left;
@ -335,8 +376,8 @@ li.tile {
cursor: pointer; }
#stat_hd {
width: 19px;
height: 19px;
width: 22px;
height: 22px;
margin-top: 5px;
background-color: #333232;
border-radius: 3px;
@ -354,7 +395,8 @@ li.tile {
#stat_hd #stat_hd_counter {
color: white;
margin-left: 5px; }
margin-left: 7px;
line-height: 23px; }
.contentButtons {
clear: both;
@ -450,3 +492,8 @@ select.filterSelect {
float: right;
margin-top: 1px;
margin-left: 10px !important; }
.userMenuImg {
height: "28";
width: "28";
margin-top: -3px; }

View File

@ -24,3 +24,5 @@
@import "contentTables";
// Dropdown menu
@import "dropdowns";
// Dropdown menu
@import "userMenu";

View File

@ -14,6 +14,7 @@
"files": [
"frontend/html/start.html.part",
"frontend/html/headadmin.html.part",
"frontend/js/templates/**",
"frontend/html/body.html.part",
"frontend/html/scriptsadmin.html.part",
"frontend/html/end.html.part"
@ -65,7 +66,7 @@
"libs.js": {
"files": [
"frontend/js/lib/jquery-1.8.3.js",
"frontend/js/lib/jquery-2.1.0.min.js",
"frontend/js/lib/jquery-ui-1.9.2.custom.js",
"frontend/js/lib/jquery.dataTables.js",
"frontend/js/lib/jquery.autogrow.js",
@ -74,7 +75,6 @@
"frontend/js/lib/jquery.snippet.js",
"frontend/js/lib/jquery.slideto.min.js",
"frontend/js/lib/jquery.wiggle.min.js",
"frontend/js/lib/jquery.ba-bbq.min.js",
"frontend/js/lib/jquery.contextmenu.js",
"frontend/js/lib/handlebars-1.0.rc.1.js",
"frontend/js/lib/underscore.js",
@ -150,7 +150,6 @@
"/api-docs": "api-docs",
"/fonts": "frontend/fonts",
"/img" : "frontend/img",
"/js/templates" : "frontend/js/templates",
"/js/arango/aqltemplates.json" : "frontend/aqltemplates.json",
"/" : "frontend/src"
},

View File

@ -13,12 +13,17 @@ module.exports = function(karma) {
//frameworks: ['jasmine', 'junit-reporter'],
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
/*
'test/lib/jasmine-1.3.1/jasmine-html.js',
'test/lib/jslint.js',
'frontend/js/lib/jquery-1.8.3.js',
//Templates
{pattern: 'frontend/js/templates/*.ejs', served: true, included: true, watched: true},
'frontend/js/lib/jquery-2.1.0.min.js',
'frontend/js/lib/jquery-ui-1.9.2.custom.js',
'frontend/js/lib/jquery.dataTables.js',
'frontend/js/lib/jquery.autogrow.js',
@ -27,7 +32,6 @@ module.exports = function(karma) {
'frontend/js/lib/jquery.snippet.js',
'frontend/js/lib/jquery.slideto.min.js',
'frontend/js/lib/jquery.wiggle.min.js',
'frontend/js/lib/jquery.ba-bbq.min.js',
'frontend/js/lib/jquery.contextmenu.js',
'frontend/js/lib/handlebars-1.0.rc.1.js',
'frontend/js/lib/underscore.js',
@ -35,7 +39,6 @@ module.exports = function(karma) {
'frontend/js/lib/d3.v3.min.js',
'frontend/js/lib/nv.d3.js',
'frontend/js/lib/d3.fisheye.js',
'frontend/js/lib/ejs_production.js',
'frontend/js/lib/ColVis.js',
'frontend/js/lib/bootstrap.js',
'frontend/js/lib/bootstrap-pagination.js',
@ -73,15 +76,12 @@ module.exports = function(karma) {
'frontend/js/client/client.js',
// Mocks
'test/mocks/disableEJS.js',
'test/specs/graphViewer/helper/eventHelper.js',
'test/specs/graphViewer/helper/objectsHelper.js',
'test/specs/graphViewer/helper/mocks.js',
'test/specs/graphViewer/helper/commMock.js',
'test/specs/graphViewer/helper/uiMatchers.js',
// GraphViewer
// Core Modules
'frontend/js/graphViewer/graphViewer.js',
@ -178,10 +178,9 @@ module.exports = function(karma) {
// Router
'frontend/js/routers/router.js',
//Templates
{pattern: 'frontend/js/templates/*.ejs', served:true, included:false, watched: true},
// Specs
// GraphViewer
'test/specs/graphViewer/specColourMapper/colourMapperSpec.js',
'test/specs/graphViewer/specWindowObjects/domObserverFactorySpec.js',
'test/specs/graphViewer/specCommunityNode/communityNodeSpec.js',
@ -228,7 +227,9 @@ module.exports = function(karma) {
// Router
'test/specs/router/routerSpec.js',
// JSLint
'test/specJSLint/jsLintSpec.js'
*/
],

View File

@ -56,7 +56,7 @@
describe("Check Collection Display Settings", function() {
it("Check if System Collections shoud not be drawn", function() {
it("Check if System Collections should not be drawn", function() {
myView.render();
var wasRendered;
@ -67,7 +67,7 @@
expect(wasRendered).toBeFalsy();
});
it("Check if System Collections shoud be drawn", function() {
it("Check if System Collections should be drawn", function() {
myView.render();
var wasRendered;
$('#checkSystem').click();
@ -79,7 +79,7 @@
expect(wasRendered).toBeTruthy();
});
it("Check if Edge Collections shoud not be drawn", function() {
it("Check if Edge Collections should not be drawn", function() {
myView.render();
var wasRendered;
@ -90,7 +90,7 @@
expect(wasRendered).toBeFalsy();
});
it("Check if Edge Collections shoud be drawn", function() {
it("Check if Edge Collections should be drawn", function() {
myView.render();
var wasRendered;
$('#checkEdge').click();
@ -102,7 +102,7 @@
expect(wasRendered).toBeTruthy();
});
it("Check if Document Collections shoud not be drawn", function() {
it("Check if Document Collections should not be drawn", function() {
myView.render();
var wasRendered;
@ -113,7 +113,7 @@
expect(wasRendered).toBeFalsy();
});
it("Check if Document Collections shoud be drawn", function() {
it("Check if Document Collections should be drawn", function() {
myView.render();
var wasRendered;
$('#checkDocument').click();
@ -125,7 +125,7 @@
expect(wasRendered).toBeTruthy();
});
it("Check if Loaded Collections shoud not be drawn", function() {
it("Check if Loaded Collections should not be drawn", function() {
myView.render();
var wasRendered;
@ -136,7 +136,7 @@
expect(wasRendered).toBeFalsy();
});
it("Check if Loaded Collections shoud be drawn", function() {
it("Check if Loaded Collections should be drawn", function() {
myView.render();
var wasRendered;
$('#checkLoaded').click();
@ -148,7 +148,7 @@
expect(wasRendered).toBeTruthy();
});
it("Check if Unloaded Collections shoud not be drawn", function() {
it("Check if Unloaded Collections should not be drawn", function() {
myView.render();
var wasRendered;
@ -159,7 +159,7 @@
expect(wasRendered).toBeFalsy();
});
it("Check if Unloaded Collections shoud be drawn", function() {
it("Check if Unloaded Collections should be drawn", function() {
myView.render();
var wasRendered;
$('#checkUnloaded').click();

View File

@ -18,9 +18,9 @@
COLOR_BOLD_WHITE, COLOR_YELLOW, COLOR_BOLD_YELLOW, COLOR_CYAN, COLOR_BOLD_CYAN, COLOR_MAGENTA,
COLOR_BOLD_MAGENTA, PRETTY_PRINT, VALGRIND, VERSION, UPGRADE,
BYTES_SENT_DISTRIBUTION, BYTES_RECEIVED_DISTRIBUTION, CONNECTION_TIME_DISTRIBUTION,
REQUEST_TIME_DISTRIBUTION, DEVELOPMENT_MODE, THREAD_NUMBER, LOGFILE_PATH,
REQUEST_TIME_DISTRIBUTION, DEVELOPMENT_MODE, FE_DEVELOPMENT_MODE, THREAD_NUMBER, LOGFILE_PATH,
SYS_PLATFORM, SYS_EXECUTE_EXTERNAL, SYS_STATUS_EXTERNAL, SYS_KILL_EXTERNAL,
FE_DEVELOPMENT_MODE, SYS_DEFINE_PERIODIC */
SYS_DEFINE_PERIODIC */
////////////////////////////////////////////////////////////////////////////////
/// @brief module "internal"

View File

@ -1,6 +1,6 @@
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, white: true, plusplus: true, regexp: true, nonpropdel: true */
/*global require, module: true, STARTUP_PATH, DEV_APP_PATH, APP_PATH, MODULES_PATH,
EXPORTS_SLOW_BUFFER */
EXPORTS_SLOW_BUFFER, SYS_PLATFORM */
////////////////////////////////////////////////////////////////////////////////
/// @brief JavaScript server functions

View File

@ -136,10 +136,10 @@ var getStorage = function () {
/// @fn JSF_saveUser
/// @brief create a new user
///
/// @FUN{users.save(@FA{username}, @FA{passwd}, @FA{active}, @FA{extra})}
/// @FUN{users.save(@FA{user}, @FA{passwd}, @FA{active}, @FA{extra})}
///
/// This will create a new ArangoDB user. The username must be specified and
/// must not be empty.
/// This will create a new ArangoDB user. The username must be specified in
/// @FA{user} and must not be empty.
///
/// The password must be given as a string, too, but can be left empty if
/// required.
@ -164,27 +164,27 @@ var getStorage = function () {
/// @endcode
////////////////////////////////////////////////////////////////////////////////
exports.save = function (username, passwd, active, extra) {
exports.save = function (user, passwd, active, extra) {
if (passwd === null || passwd === undefined) {
passwd = "";
}
// validate input
validateName(username);
validateName(user);
validatePassword(passwd);
var users = getStorage();
var user = users.firstExample({ user: username });
if (active === undefined || active === null) {
// this is the default value for active
active = true;
}
var users = getStorage();
var previous = users.firstExample({ user: user });
if (user === null) {
if (previous === null) {
var hash = encodePassword(passwd);
var data = {
user: username,
user: user,
password: hash,
active: active
};
@ -210,12 +210,12 @@ exports.save = function (username, passwd, active, extra) {
/// @fn JSF_replaceUser
/// @brief replace an existing user
///
/// @FUN{users.replace(@FA{username}, @FA{passwd}, @FA{active}, @FA{extra})}
/// @FUN{users.replace(@FA{user}, @FA{passwd}, @FA{active}, @FA{extra})}
///
/// This will look up an existing ArangoDB user and replace its user data.
///
/// The username must be specified, and a user with the specified name must
/// already exist in the database.
/// The username must be specified in @FA{user}, and a user with the specified
/// name must already exist in the database.
///
/// The password must be given as a string, too, but can be left empty if
/// required.
@ -240,24 +240,24 @@ exports.save = function (username, passwd, active, extra) {
/// @endcode
////////////////////////////////////////////////////////////////////////////////
exports.replace = function (username, passwd, active, extra) {
exports.replace = function (user, passwd, active, extra) {
if (passwd === null || passwd === undefined) {
passwd = "";
}
// validate input
validateName(username);
validateName(user);
validatePassword(passwd);
var users = getStorage();
var user = users.firstExample({ user: username });
if (active === undefined || active === null) {
// this is the default
active = true;
}
if (user === null) {
var users = getStorage();
var previous = users.firstExample({ user: user });
if (previous === null) {
var err = new ArangoError();
err.errorNum = arangodb.errors.ERROR_USER_NOT_FOUND.code;
err.errorMessage = arangodb.errors.ERROR_USER_NOT_FOUND.message;
@ -267,7 +267,7 @@ exports.replace = function (username, passwd, active, extra) {
var hash = encodePassword(passwd);
var data = {
user: username,
user: user,
password: hash,
active: active
};
@ -275,7 +275,7 @@ exports.replace = function (username, passwd, active, extra) {
data.extra = extra;
}
var doc = users.replace(user, data);
var doc = users.replace(previous, data);
// not exports.reload() as this is an abstract method...
require("org/arangodb/users").reload();
@ -286,13 +286,13 @@ exports.replace = function (username, passwd, active, extra) {
/// @fn JSF_updateUser
/// @brief update an existing user
///
/// @FUN{@FA{users}.update(@FA{username}, @FA{passwd}, @FA{active}, @FA{extra})}
/// @FUN{@FA{users}.update(@FA{user}, @FA{passwd}, @FA{active}, @FA{extra})}
///
/// This will update an existing ArangoDB user with a new password and other
/// data.
///
/// The username must be specified and the user must already exist in the
/// database.
/// The username must be specified in @FA{user} and the user must already exist
/// in the database.
///
/// The password must be given as a string, too, but can be left empty if
/// required.
@ -317,17 +317,17 @@ exports.replace = function (username, passwd, active, extra) {
/// @endcode
////////////////////////////////////////////////////////////////////////////////
exports.update = function (username, passwd, active, extra) {
exports.update = function (user, passwd, active, extra) {
// validate input
validateName(username);
validateName(user);
if (passwd !== undefined) {
validatePassword(passwd);
}
var users = getStorage();
var user = users.firstExample({ user: username });
var previous = users.firstExample({ user: user });
if (user === null) {
if (previous === null) {
var err = new ArangoError();
err.errorNum = arangodb.errors.ERROR_USER_NOT_FOUND.code;
err.errorMessage = arangodb.errors.ERROR_USER_NOT_FOUND.message;
@ -335,7 +335,7 @@ exports.update = function (username, passwd, active, extra) {
throw err;
}
var data = user._shallowCopy;
var data = previous._shallowCopy;
if (passwd !== undefined) {
var hash = encodePassword(passwd);
@ -348,7 +348,7 @@ exports.update = function (username, passwd, active, extra) {
data.extra = extra;
}
var doc = users.update(user, data);
var doc = users.update(previous, data);
// not exports.reload() as this is an abstract method...
require("org/arangodb/users").reload();
@ -360,12 +360,12 @@ exports.update = function (username, passwd, active, extra) {
/// @fn JSF_removeUser
/// @brief delete an existing user
///
/// @FUN{users.remove(@FA{username}, @FA{passwd})}
/// @FUN{users.remove(@FA{user})}
///
/// Removes an existing ArangoDB user from the database.
///
/// The username must be a string and the specified user must exist in the
/// database.
/// The username must be specified in @FA{user} and the specified user must
/// exist in the database.
///
/// This method will fail if the user cannot be found in the database.
///
@ -382,14 +382,14 @@ exports.update = function (username, passwd, active, extra) {
/// @endcode
////////////////////////////////////////////////////////////////////////////////
exports.remove = function (username) {
exports.remove = function (user) {
// validate input
validateName(username);
validateName(user);
var users = getStorage();
var user = users.firstExample({ user: username });
var previous = users.firstExample({ user: user });
if (user === null) {
if (previous === null) {
var err = new ArangoError();
err.errorNum = arangodb.errors.ERROR_USER_NOT_FOUND.code;
err.errorMessage = arangodb.errors.ERROR_USER_NOT_FOUND.message;
@ -397,7 +397,7 @@ exports.remove = function (username) {
throw err;
}
var doc = users.remove(user._id);
var doc = users.remove(previous);
// not exports.reload() as this is an abstract method...
require("org/arangodb/users").reload();
@ -409,23 +409,24 @@ exports.remove = function (username) {
/// @fn JSF_documentUser
/// @brief get an existing user
///
/// @FUN{users.document(@FA{username})}
/// @FUN{users.document(@FA{user})}
///
/// Fetches an existing ArangoDB user from the database.
///
/// The username must be specified in @FA{user}.
/// This method will fail if the user cannot be found in the database.
///
/// Note: this function will not work from within the web interface
////////////////////////////////////////////////////////////////////////////////
exports.document = function (username) {
exports.document = function (user) {
// validate name
validateName(username);
validateName(user);
var users = getStorage();
var user = users.firstExample({ user: username });
var previous = users.firstExample({ user: user });
if (user === null) {
if (previous === null) {
var err = new ArangoError();
err.errorNum = arangodb.errors.ERROR_USER_NOT_FOUND.code;
err.errorMessage = arangodb.errors.ERROR_USER_NOT_FOUND.message;
@ -434,9 +435,9 @@ exports.document = function (username) {
}
return {
user: user.user,
active: user.active,
extra: user.extra || { }
user: previous.user,
active: previous.active,
extra: previous.extra || { }
};
};

View File

@ -657,16 +657,21 @@ bool ApplicationEndpointServer::createSslContext () {
LOG_DEBUG("using SSL protocol version '%s'",
HttpsServer::protocolName((HttpsServer::protocol_e) _sslProtocol).c_str());
if (! FileUtils::exists(_httpsKeyfile)) {
LOG_FATAL_AND_EXIT("unable to find SSL keyfile '%s'", _httpsKeyfile.c_str());
}
// create context
_sslContext = HttpsServer::sslContext(HttpsServer::protocol_e(_sslProtocol), _httpsKeyfile);
if (_sslContext == 0) {
LOG_ERROR("failed to create SSL context, cannot create a HTTPS server");
LOG_ERROR("failed to create SSL context, cannot create HTTPS server");
return false;
}
// set cache mode
SSL_CTX_set_session_cache_mode(_sslContext, _sslCache ? SSL_SESS_CACHE_SERVER : SSL_SESS_CACHE_OFF);
if (_sslCache) {
LOG_TRACE("using SSL session caching");
}