1
0
Fork 0
This commit is contained in:
Heiko Kernbach 2016-11-15 15:31:30 +01:00
parent 1649b2cd59
commit aa55634419
31 changed files with 55 additions and 135 deletions

View File

@ -28,7 +28,7 @@
window.versionHelper = { window.versionHelper = {
fromString: function (s) { fromString: function (s) {
var parts = s.replace(/-[a-zA-Z0-9_\-]*$/g, '').split('.'); var parts = s.replace(/-[a-zA-Z0-9_-]*$/g, '').split('.');
return { return {
major: parseInt(parts[0], 10) || 0, major: parseInt(parts[0], 10) || 0,
minor: parseInt(parts[1], 10) || 0, minor: parseInt(parts[1], 10) || 0,

View File

@ -1,5 +1,5 @@
/* jshint unused: false */ /* jshint unused: false */
/* global window, _, $*/ /* global window, _, $ */
(function () { (function () {
'use strict'; 'use strict';
// For tests the templates are loaded some where else. // For tests the templates are loaded some where else.

View File

@ -17,8 +17,7 @@ window.ClusterStatisticsCollection = Backbone.Collection.extend({
// The callback has to be invokeable for each result individually // The callback has to be invokeable for each result individually
// TODO RE-ADD Auth // TODO RE-ADD Auth
/* /* fetch: function(callback, errCB) {
fetch: function(callback, errCB) {
this.forEach(function (m) { this.forEach(function (m) {
m.fetch({ m.fetch({
beforeSend: window.App.addAuth.bind(window.App), beforeSend: window.App.addAuth.bind(window.App),
@ -29,5 +28,5 @@ fetch: function(callback, errCB) {
callback(m) callback(m)
}) })
}) })
}*/ } */
}); });

View File

@ -1,5 +1,5 @@
/* jshint browser: true */ /* jshint browser: true */
/* global window, arangoHelper, Backbone, $, window, _*/ /* global window, arangoHelper, Backbone, $, window, _ */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global window, _, arangoHelper, $*/ /* global window, _, arangoHelper, $ */
(function () { (function () {
'use strict'; 'use strict';
@ -75,7 +75,7 @@
bindVars['param' + i] = '%' + f.val + '%'; bindVars['param' + i] = '%' + f.val + '%';
} else if (f.op === 'IN' || f.op === 'NOT IN ') { } else if (f.op === 'IN' || f.op === 'NOT IN ') {
if (f.val.indexOf(',') !== -1) { if (f.val.indexOf(',') !== -1) {
bindVars['param' + i] = f.val.split(',').map (function (v) { return v.replace(/(^ +| +$)/g, ''); }); bindVars['param' + i] = f.val.split(',').map(function (v) { return v.replace(/(^ +| +$)/g, ''); });
} else { } else {
bindVars['param' + i] = [ f.val ]; bindVars['param' + i] = [ f.val ];
} }
@ -208,12 +208,6 @@
query: query, query: query,
bindVars: bindVars bindVars: bindVars
}; };
/*
if (this.getTotal() < 10000 || this.filters.length > 0) {
queryObj.options = {
fullCount: true,
}
}*/
var checkCursorStatus = function (jobid) { var checkCursorStatus = function (jobid) {
$.ajax({ $.ajax({

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global Backbone, window, ArangoQuery, $, _, arangoHelper*/ /* global Backbone, window, ArangoQuery, $, _, arangoHelper */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,5 +1,5 @@
/* jshint browser: true */ /* jshint browser: true */
/* global Backbone, $, window, ace, arangoHelper, templateEngine, Joi, _*/ /* global Backbone, $, window, ace, arangoHelper, templateEngine, Joi, _ */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,5 +1,5 @@
/* jshint browser: true */ /* jshint browser: true */
/* global Backbone, $, window, arangoHelper, templateEngine, _*/ /* global Backbone, $, window, arangoHelper, templateEngine, _ */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global window, frontendConfig, exports, Backbone, _, $, templateEngine, arangoHelper, Joi*/ /* global window, frontendConfig, exports, Backbone, _, $, templateEngine, arangoHelper, Joi */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global _, Backbone, templateEngine, window, setTimeout, clearTimeout, arangoHelper, Joi, $*/ /* global _, Backbone, templateEngine, window, setTimeout, clearTimeout, arangoHelper, Joi, $ */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global window, document, Backbone, $, arangoHelper, templateEngine, Joi*/ /* global window, document, Backbone, $, arangoHelper, templateEngine, Joi */
(function () { (function () {
'use strict'; 'use strict';
@ -130,7 +130,7 @@
arangoHelper.arangoError('DB ', 'Databasename should not start with _'); arangoHelper.arangoError('DB ', 'Databasename should not start with _');
return false; return false;
} }
if (!db.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)) { if (!db.match(/^[a-zA-Z][a-zA-Z0-9_-]*$/)) {
arangoHelper.arangoError('DB', 'Databasename may only contain numbers, letters, _ and -'); arangoHelper.arangoError('DB', 'Databasename may only contain numbers, letters, _ and -');
return false; return false;
} }

View File

@ -240,40 +240,6 @@
buildCollectionLink: function (collection) { buildCollectionLink: function (collection) {
return 'collection/' + encodeURIComponent(collection.get('name')) + '/documents/1'; return 'collection/' + encodeURIComponent(collection.get('name')) + '/documents/1';
}, },
/*
prevCollection : function () {
if (this.collectionContext.prev !== null) {
$('#collectionPrev').parent().removeClass('disabledPag')
window.App.navigate(
this.buildCollectionLink(
this.collectionContext.prev
),
{
trigger: true
}
)
}
else {
$('#collectionPrev').parent().addClass('disabledPag')
}
},
nextCollection : function () {
if (this.collectionContext.next !== null) {
$('#collectionNext').parent().removeClass('disabledPag')
window.App.navigate(
this.buildCollectionLink(
this.collectionContext.next
),
{
trigger: true
}
)
}
else {
$('#collectionNext').parent().addClass('disabledPag')
}
},*/
markFilterToggle: function () { markFilterToggle: function () {
if (this.restoredFilters.length > 0) { if (this.restoredFilters.length > 0) {

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global _, Backbone, document, templateEngine, $, arangoHelper, window*/ /* global _, Backbone, document, templateEngine, $, arangoHelper, window */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,5 +1,5 @@
/* jshint browser: true */ /* jshint browser: true */
/* global $, Joi, _, arangoHelper, templateEngine, window*/ /* global $, Joi, _, arangoHelper, templateEngine, window */
(function () { (function () {
'use strict'; 'use strict';
@ -47,7 +47,7 @@
validateInput: function () { validateInput: function () {
return [ return [
{ {
rule: Joi.string().regex(/^(\/(APP[^\/]+|(?!APP)[a-zA-Z0-9_\-%]+))+$/i), rule: Joi.string().regex(/^(\/(APP[^/]+|(?!APP)[a-zA-Z0-9_\-%]+))+$/i),
msg: 'May not contain /APP' msg: 'May not contain /APP'
}, },
{ {
@ -59,7 +59,7 @@
msg: 'Mountpoints with _ are reserved for internal use' msg: 'Mountpoints with _ are reserved for internal use'
}, },
{ {
rule: Joi.string().regex(/[^\/]$/), rule: Joi.string().regex(/[^/]$/),
msg: 'May not end with /' msg: 'May not end with /'
}, },
{ {
@ -81,7 +81,7 @@
validateInput: function () { validateInput: function () {
return [ return [
{ {
rule: Joi.string().required().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/), rule: Joi.string().required().regex(/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$/),
msg: 'No valid Github account and repository.' msg: 'No valid Github account and repository.'
} }
]; ];
@ -130,7 +130,7 @@
validateInput: function () { validateInput: function () {
return [ return [
{ {
rule: Joi.string().required().regex(/^[a-zA-Z0-9 \.,;\-]+$/), rule: Joi.string().required().regex(/^[a-zA-Z0-9 .,;-]+$/),
msg: 'Has to be non empty.' msg: 'Has to be non empty.'
} }
]; ];
@ -240,7 +240,7 @@
}; };
try { try {
Joi.assert(url, Joi.string().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/)); Joi.assert(url, Joi.string().regex(/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$/));
} catch (e) { } catch (e) {
return; return;
} }

View File

@ -301,7 +301,6 @@
$('#graphManagementDropdown').show(); $('#graphManagementDropdown').show();
} }
self.events['click .tableRow'] = self.showHideDefinition.bind(self);
self.events['change tr[id*="newEdgeDefinitions"]'] = self.setFromAndTo.bind(self); self.events['change tr[id*="newEdgeDefinitions"]'] = self.setFromAndTo.bind(self);
self.events['click .graphViewer-icon-button'] = self.addRemoveDefinition.bind(self); self.events['click .graphViewer-icon-button'] = self.addRemoveDefinition.bind(self);
self.events['click #graphTab a'] = self.toggleTab.bind(self); self.events['click #graphTab a'] = self.toggleTab.bind(self);
@ -362,19 +361,6 @@
$('#toCollections' + id).attr('disabled', false); $('#toCollections' + id).attr('disabled', false);
} }
} }
/* following not needed? => destroys webif modal
tmp = $('input[id*="newEdgeDefinitions"]')
for (i = 0; i < tmp.length ; i++) {
id = tmp[i].id
$('#' + id).select2({
tags : this.eCollList,
showSearchBox: false,
minimumResultsForSearch: -1,
width: "336px",
maximumSelectionSize: 1
})
}*/
}, },
editGraph: function (e) { editGraph: function (e) {
@ -915,16 +901,6 @@
arangoHelper.arangoNotification('Graph', 'Reset successful.'); arangoHelper.arangoNotification('Graph', 'Reset successful.');
}, },
showHideDefinition: function (e) {
/* e.stopPropagation()
var id = $(e.currentTarget).attr("id"), number
if (id.indexOf("row_newEdgeDefinitions") !== -1 ) {
number = id.split("row_newEdgeDefinitions")[1]
$('#row_fromCollections' + number).toggle()
$('#row_toCollections' + number).toggle()
}*/
},
addRemoveDefinition: function (e) { addRemoveDefinition: function (e) {
var collList = []; var collections = this.options.collectionCollection.models; var collList = []; var collections = this.options.collectionCollection.models;

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global arangoHelper, _, frontendConfig, slicePath, icon, Joi, wheelnav, document, sigma, Backbone, templateEngine, $, window*/ /* global arangoHelper, _, frontendConfig, slicePath, icon, Joi, wheelnav, document, sigma, Backbone, templateEngine, $, window */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global Backbone, templateEngine, window*/ /* global Backbone, templateEngine, window */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global Backbone, document, _, arangoHelper, window, setTimeout, $, templateEngine, frontendConfig*/ /* global Backbone, document, _, arangoHelper, window, setTimeout, $, templateEngine, frontendConfig */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global arangoHelper, $, window, templateEngine*/ /* global arangoHelper, $, window, templateEngine */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* global Backbone, $, window, setTimeout, Joi, _ */ /* global Backbone, $, window, setTimeout, Joi, _ */
/* global templateEngine*/ /* global templateEngine */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global Backbone, templateEngine, $, window, arangoHelper, _*/ /* global Backbone, templateEngine, $, window, arangoHelper, _ */
(function () { (function () {
'use strict'; 'use strict';
window.NavigationView = Backbone.View.extend({ window.NavigationView = Backbone.View.extend({
@ -185,22 +185,6 @@
}, },
subMenuConfig: { subMenuConfig: {
/*
collection: [
{
name: 'Settings',
view: undefined
},
{
name: 'Indexes',
view: undefined
},
{
name: 'Content',
view: undefined,
active: true
}
],*/
cluster: [ cluster: [
{ {
name: 'Dashboard', name: 'Dashboard',
@ -376,8 +360,8 @@
}, },
hideDropdown: function (e) { hideDropdown: function (e) {
var tab = e.target || e.srcElement; // var tab = e.target || e.srcElement;
tab = $(tab).parent(); // tab = $(tab).parent();
$('#link_dropdown').fadeOut(1); $('#link_dropdown').fadeOut(1);
$('#tools_dropdown').fadeOut(1); $('#tools_dropdown').fadeOut(1);
$('#dbs_dropdown').fadeOut(1); $('#dbs_dropdown').fadeOut(1);

View File

@ -67,7 +67,9 @@
time = false; time = false;
closeWidth = ['button']; closeWidth = ['button'];
buttons = [{ buttons = [{
addClass: 'button-danger', text: 'Close', onClick: function ($noty) { addClass: 'button-danger',
text: 'Close',
onClick: function ($noty) {
$noty.close(); $noty.close();
} }
}]; }];
@ -75,12 +77,16 @@
time = 15000; time = 15000;
buttons = [ buttons = [
{ {
addClass: 'button-warning', text: 'Close', onClick: function ($noty) { addClass: 'button-warning',
text: 'Close',
onClick: function ($noty) {
$noty.close(); $noty.close();
} }
}, },
{ {
addClass: 'button-danger', text: "Don't show again.", onClick: function ($noty) { addClass: 'button-danger',
text: "Don't show again.",
onClick: function ($noty) {
$noty.close(); $noty.close();
window.arangoHelper.doNotShowAgain(); window.arangoHelper.doNotShowAgain();
} }

View File

@ -1,7 +1,7 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global Backbone, $, window, setTimeout */ /* global Backbone, $, window, setTimeout */
/* global templateEngine*/ /* global templateEngine */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global Backbone, $, setTimeout, localStorage, ace, Storage, window, _, console, btoa*/ /* global Backbone, $, setTimeout, localStorage, ace, Storage, window, _, console, btoa */
/* global _, arangoHelper, numeral, templateEngine, Joi */ /* global _, arangoHelper, numeral, templateEngine, Joi */
(function () { (function () {

View File

@ -122,7 +122,7 @@
var type; var type;
var icon; var icon;
id = id.replace(/\./g, '-'); id = id.replace(/\./g, '-');
id = id.replace(/\:/g, '_'); id = id.replace(/:/g, '_');
icon = $('#id' + id); icon = $('#id' + id);
if (icon.length < 1) { if (icon.length < 1) {
// callback after view was unrendered // callback after view was unrendered
@ -210,8 +210,11 @@
var self = this; var self = this;
this.data.forEach(function (m) { this.data.forEach(function (m) {
pieData.push({key: m.get('name'), value: m.get('system').virtualSize, pieData.push({
time: self.serverTime}); key: m.get('name'),
value: m.get('system').virtualSize,
time: self.serverTime
});
}); });
return pieData; return pieData;
@ -517,8 +520,8 @@
var coord; var coord;
var ipPort = tar.attr('id'); var ipPort = tar.attr('id');
ipPort = ipPort.replace(/\-/g, '.'); ipPort = ipPort.replace(/-/g, '.');
ipPort = ipPort.replace(/\_/g, ':'); ipPort = ipPort.replace(/_/g, ':');
ipPort = ipPort.substr(2); ipPort = ipPort.substr(2);
serv.raw = ipPort; serv.raw = ipPort;

View File

@ -1,7 +1,7 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global Backbone, $, window, setTimeout, _ */ /* global Backbone, $, window, setTimeout, _ */
/* global arangoHelper, templateEngine*/ /* global arangoHelper, templateEngine */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global Backbone, templateEngine, $, window*/ /* global Backbone, templateEngine, $, window */
(function () { (function () {
'use strict'; 'use strict';
window.StatisticBarView = Backbone.View.extend({ window.StatisticBarView = Backbone.View.extend({

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global _, Backbone, templateEngine, $, window*/ /* global _, Backbone, templateEngine, $, window */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global frontendConfig, arangoHelper, Backbone, templateEngine, $, window*/ /* global frontendConfig, arangoHelper, Backbone, templateEngine, $, window */
(function () { (function () {
'use strict'; 'use strict';

View File

@ -1,6 +1,6 @@
/* jshint browser: true */ /* jshint browser: true */
/* jshint unused: false */ /* jshint unused: false */
/* global frontendConfig, window, document, Backbone, $, arangoHelper, templateEngine, Joi*/ /* global frontendConfig, window, document, Backbone, $, arangoHelper, templateEngine, Joi */
(function () { (function () {
'use strict'; 'use strict';
@ -176,14 +176,6 @@
$('#newUsername').closest('th').css('backgroundColor', 'red'); $('#newUsername').closest('th').css('backgroundColor', 'red');
return false; return false;
} }
/* if (!username.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)) {
arangoHelper.arangoError("Name may only contain numbers, letters, _ and -")
return false
}
if (!user.match(/^[a-zA-Z][a-zA-Z\-]*$/)) {
arangoHelper.arangoError("Name may only letters and -")
return false
}*/
return true; return true;
}, },

View File

@ -255,7 +255,7 @@
$('#newUsername').closest('th').css('backgroundColor', 'red'); $('#newUsername').closest('th').css('backgroundColor', 'red');
return false; return false;
} }
if (!username.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)) { if (!username.match(/^[a-zA-Z][a-zA-Z0-9_-]*$/)) {
arangoHelper.arangoError( arangoHelper.arangoError(
'Wrong Username', 'Username may only contain numbers, letters, _ and -' 'Wrong Username', 'Username may only contain numbers, letters, _ and -'
); );
@ -273,7 +273,7 @@
if (name === '') { if (name === '') {
return true; return true;
} }
if (!name.match(/^[a-zA-Z][a-zA-Z0-9_\-\ ]*$/)) { if (!name.match(/^[a-zA-Z][a-zA-Z0-9_-]*$/)) {
arangoHelper.arangoError( arangoHelper.arangoError(
'Wrong Username', 'Username may only contain numbers, letters, _ and -' 'Wrong Username', 'Username may only contain numbers, letters, _ and -'
); );