mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
0145d24b0c
|
@ -49,6 +49,7 @@ ICUDIR = @abs_top_srcdir@/3rdParty/icu/BUILD
|
|||
CLEANUP_3RD += clean-icu
|
||||
|
||||
clean-icu:
|
||||
cd @top_srcdir@/3rdParty/icu/source && ( $(MAKE) clean || true )
|
||||
rm -f @srcdir@/.icu-build-@TRI_BITS@
|
||||
rm -rf $(ICUDIR)
|
||||
|
||||
|
|
|
@ -5595,7 +5595,7 @@ static v8::Handle<v8::Value> JS_EnsurePriorityQueueIndexVocbaseCol (v8::Argument
|
|||
/// Creates a skiplist index on all documents using attributes as paths to
|
||||
/// the fields. At least one attribute must be given.
|
||||
/// All documents, which do not have the attribute path or
|
||||
/// with ore or more values that are not suitable, are ignored.
|
||||
/// with one or more values that are not suitable, are ignored.
|
||||
///
|
||||
/// In case that the index was successfully created, the index identifier
|
||||
/// is returned.
|
||||
|
@ -5629,7 +5629,7 @@ static v8::Handle<v8::Value> JS_LookupUniqueSkiplistVocbaseCol (v8::Arguments co
|
|||
/// Creates a multi skiplist index on all documents using attributes as paths to
|
||||
/// the fields. At least one attribute must be given.
|
||||
/// All documents, which do not have the attribute path or
|
||||
/// with ore or more values that are not suitable, are ignored.
|
||||
/// with one or more values that are not suitable, are ignored.
|
||||
///
|
||||
/// In case that the index was successfully created, the index identifier
|
||||
/// is returned.
|
||||
|
|
|
@ -150,7 +150,23 @@ controller.get('/docu/:key/*', function(req, res) {
|
|||
allowMultiple: false
|
||||
}).summary("List the API for one foxx")
|
||||
.notes("This function lists the API of the foxx"
|
||||
+ " runnning under the given mount point");
|
||||
+ " running under the given mount point");
|
||||
|
||||
// .............................................................................
|
||||
// Move one foxx from mount-point to another
|
||||
// .............................................................................
|
||||
|
||||
controller.put('/foxx/move/:key', function(req, res) {
|
||||
var body = req.body();
|
||||
var mountPoint = body.mount;
|
||||
var app = body.app;
|
||||
var key = req.params("key");
|
||||
var prefix = body.prefix;
|
||||
foxxes.move(key, app, mountPoint, prefix);
|
||||
})
|
||||
.summary("Move one foxx to another moint point")
|
||||
.notes ("This function moves one installed foxx"
|
||||
+ " to a given mount point.");
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
|
|
|
@ -1,30 +1,32 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, continue: true, regexp: true */
|
||||
/*global window, Backbone */
|
||||
(function() {
|
||||
|
||||
window.Foxx = Backbone.Model.extend({
|
||||
defaults: {
|
||||
"title": "",
|
||||
"version": "",
|
||||
"mount": "",
|
||||
"description": "",
|
||||
"git": "",
|
||||
"isSystem": false,
|
||||
"development": false
|
||||
},
|
||||
window.Foxx = Backbone.Model.extend({
|
||||
defaults: {
|
||||
"title": "",
|
||||
"version": "",
|
||||
"mount": "",
|
||||
"description": "",
|
||||
"git": "",
|
||||
"isSystem": false,
|
||||
"development": false
|
||||
},
|
||||
|
||||
url: function() {
|
||||
'use strict';
|
||||
url: function() {
|
||||
'use strict';
|
||||
|
||||
if (this.get("_key")) {
|
||||
return "/_admin/aardvark/foxxes/" + this.get("_key");
|
||||
if (this.get("_key")) {
|
||||
return "/_admin/aardvark/foxxes/" + this.get("_key");
|
||||
}
|
||||
return "/_admin/aardvark/foxxes/install";
|
||||
},
|
||||
|
||||
isNew: function() {
|
||||
'use strict';
|
||||
|
||||
return false;
|
||||
}
|
||||
return "/_admin/aardvark/foxxes/install";
|
||||
},
|
||||
|
||||
isNew: function() {
|
||||
'use strict';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}());
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Mount:</th>
|
||||
<th class="collectionTh"><input type="text" id="change-mount-point" name="mountpoint" value="<%=attributes.mount%>" disabled/></th>
|
||||
<th class="collectionTh"><input type="text" id="change-mount-point" name="mountpoint" value="<%=attributes.mount%>"/></th>
|
||||
<th><a class="modalTooltips" title="The path where the app can be reached."><i class="icon-info-sign"></i></a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -51,7 +51,7 @@
|
|||
</div>
|
||||
<div id="colFooter" class="modal-footer">
|
||||
<button id="uninstall" class="btn btn-danger"<%=(attributes.isSystem || attributes.development) ? " disabled" : ""%>>Uninstall</button>
|
||||
<button id="change" class="btn btn-success pull-right" disabled>Save</button>
|
||||
<button id="change" class="btn btn-success pull-right">Save</button>
|
||||
<%if (false && attributes.active) {%>
|
||||
<button id="deactivate" class="btn btn-warning pull-right" style="margin-right:8px" disabled>Deactivate</button>
|
||||
<%} else if (false) {%>
|
||||
|
|
|
@ -20,8 +20,51 @@ window.foxxEditView = Backbone.View.extend({
|
|||
"hidden #change-foxx" : "hidden",
|
||||
// "click #deactivate" : "deactivate",
|
||||
// "click #activate" : "activate",
|
||||
"click #uninstall" : "uninstall"
|
||||
"click #uninstall" : "uninstall",
|
||||
"click #change" : "changeFoxx",
|
||||
},
|
||||
|
||||
checkMount: function(mount) {
|
||||
var regex = /^(\/[^\/\s]+)+$/;
|
||||
if (!regex.test(mount)){
|
||||
alert("Sorry, you have to give a valid mount point, e.g.: /myPath");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
changeFoxx: function() {
|
||||
var mount = $("#change-mount-point").val();
|
||||
var failed = false;
|
||||
var app = this.model.get("app");
|
||||
var prefix = this.model.get("options").collectionPrefix;
|
||||
console.log("prefix", prefix);
|
||||
if (mount !== this.model.get("mount")) {
|
||||
if (this.checkMount(mount)) {
|
||||
$.ajax("foxx/move/" + this.model.get("_key"), {
|
||||
async: false,
|
||||
type: "PUT",
|
||||
data: JSON.stringify({
|
||||
mount: mount,
|
||||
app: app,
|
||||
prefix: prefix
|
||||
}),
|
||||
dataType: "json",
|
||||
error: function(data) {
|
||||
console.log(data);
|
||||
failed = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// TODO change version
|
||||
if (!failed) {
|
||||
this.hideModal();
|
||||
}
|
||||
},
|
||||
|
||||
hidden: function () {
|
||||
window.App.navigate("applications", {trigger: true});
|
||||
},
|
||||
|
|
|
@ -111,5 +111,10 @@ exports.Foxxes = function () {
|
|||
message: "To be implemented."
|
||||
};
|
||||
};
|
||||
|
||||
this.move = function(key, app, mount, prefix) {
|
||||
foxxmanager.unmount(key);
|
||||
foxxmanager.mount(app, mount, {collectionPrefix: prefix});
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue