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 = {
fromString: function (s) {
var parts = s.replace(/-[a-zA-Z0-9_\-]*$/g, '').split('.');
var parts = s.replace(/-[a-zA-Z0-9_-]*$/g, '').split('.');
return {
major: parseInt(parts[0], 10) || 0,
minor: parseInt(parts[1], 10) || 0,

View File

@ -1,5 +1,5 @@
/* jshint unused: false */
/* global window, _, $*/
/* global window, _, $ */
(function () {
'use strict';
// 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
// TODO RE-ADD Auth
/*
fetch: function(callback, errCB) {
/* fetch: function(callback, errCB) {
this.forEach(function (m) {
m.fetch({
beforeSend: window.App.addAuth.bind(window.App),
@ -29,5 +28,5 @@ fetch: function(callback, errCB) {
callback(m)
})
})
}*/
} */
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/* jshint browser: true */
/* jshint unused: false */
/* global window, document, Backbone, $, arangoHelper, templateEngine, Joi*/
/* global window, document, Backbone, $, arangoHelper, templateEngine, Joi */
(function () {
'use strict';
@ -130,7 +130,7 @@
arangoHelper.arangoError('DB ', 'Databasename should not start with _');
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 -');
return false;
}

View File

@ -240,40 +240,6 @@
buildCollectionLink: function (collection) {
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 () {
if (this.restoredFilters.length > 0) {

View File

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

View File

@ -1,5 +1,5 @@
/* jshint browser: true */
/* global $, Joi, _, arangoHelper, templateEngine, window*/
/* global $, Joi, _, arangoHelper, templateEngine, window */
(function () {
'use strict';
@ -47,7 +47,7 @@
validateInput: function () {
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'
},
{
@ -59,7 +59,7 @@
msg: 'Mountpoints with _ are reserved for internal use'
},
{
rule: Joi.string().regex(/[^\/]$/),
rule: Joi.string().regex(/[^/]$/),
msg: 'May not end with /'
},
{
@ -81,7 +81,7 @@
validateInput: function () {
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.'
}
];
@ -130,7 +130,7 @@
validateInput: function () {
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.'
}
];
@ -240,7 +240,7 @@
};
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) {
return;
}

View File

@ -301,7 +301,6 @@
$('#graphManagementDropdown').show();
}
self.events['click .tableRow'] = self.showHideDefinition.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 #graphTab a'] = self.toggleTab.bind(self);
@ -362,19 +361,6 @@
$('#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) {
@ -915,16 +901,6 @@
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) {
var collList = []; var collections = this.options.collectionCollection.models;

View File

@ -1,6 +1,6 @@
/* jshint browser: true */
/* 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 () {
'use strict';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -67,7 +67,9 @@
time = false;
closeWidth = ['button'];
buttons = [{
addClass: 'button-danger', text: 'Close', onClick: function ($noty) {
addClass: 'button-danger',
text: 'Close',
onClick: function ($noty) {
$noty.close();
}
}];
@ -75,12 +77,16 @@
time = 15000;
buttons = [
{
addClass: 'button-warning', text: 'Close', onClick: function ($noty) {
addClass: 'button-warning',
text: 'Close',
onClick: function ($noty) {
$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();
window.arangoHelper.doNotShowAgain();
}

View File

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

View File

@ -1,6 +1,6 @@
/* jshint browser: true */
/* 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 */
(function () {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/* jshint browser: true */
/* jshint unused: false */
/* global frontendConfig, window, document, Backbone, $, arangoHelper, templateEngine, Joi*/
/* global frontendConfig, window, document, Backbone, $, arangoHelper, templateEngine, Joi */
(function () {
'use strict';
@ -176,14 +176,6 @@
$('#newUsername').closest('th').css('backgroundColor', 'red');
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;
},

View File

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