mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
28bc0b38a0
|
@ -1,4 +1,5 @@
|
||||||
<script id="indicesView.ejs" type="text/template">
|
<script id="indicesView.ejs" type="text/template">
|
||||||
|
<% if (typeof supported !== 'undefined') { %>
|
||||||
<div class="contentIn" id="indexHeaderContent">
|
<div class="contentIn" id="indexHeaderContent">
|
||||||
<div id="indexEditView">
|
<div id="indexEditView">
|
||||||
<table id="collectionEditIndexTable" class="edit-index-table arango-table">
|
<table id="collectionEditIndexTable" class="edit-index-table arango-table">
|
||||||
|
@ -244,4 +245,5 @@
|
||||||
<div class="modal-footer" style="border: none"></div>
|
<div class="modal-footer" style="border: none"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% } %>
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -313,10 +313,27 @@
|
||||||
|
|
||||||
createCollection: function (e) {
|
createCollection: function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.createNewCollectionModal();
|
var self = this;
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
cache: false,
|
||||||
|
url: arangoHelper.databaseUrl('/_api/engine'),
|
||||||
|
contentType: 'application/json',
|
||||||
|
processData: false,
|
||||||
|
success: function (data) {
|
||||||
|
self.engine = data;
|
||||||
|
console.log(self.engine);
|
||||||
|
self.createNewCollectionModal(data);
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
arangoHelper.arangoError('Engine', 'Could not fetch ArangoDB Engine details.');
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
submitCreateCollection: function () {
|
submitCreateCollection: function () {
|
||||||
|
var self = this;
|
||||||
var callbackCoord = function (error, isCoordinator) {
|
var callbackCoord = function (error, isCoordinator) {
|
||||||
if (error) {
|
if (error) {
|
||||||
arangoHelper.arangoError('DB', 'Could not check coordinator state');
|
arangoHelper.arangoError('DB', 'Could not check coordinator state');
|
||||||
|
@ -383,16 +400,19 @@
|
||||||
window.modalView.hide();
|
window.modalView.hide();
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
this.collection.newCollection({
|
var tmpObj = {
|
||||||
collName: collName,
|
collName: collName,
|
||||||
wfs: wfs,
|
wfs: wfs,
|
||||||
isSystem: isSystem,
|
isSystem: isSystem,
|
||||||
journalSize: collSize,
|
|
||||||
replicationFactor: replicationFactor,
|
replicationFactor: replicationFactor,
|
||||||
collType: collType,
|
collType: collType,
|
||||||
shards: shards,
|
shards: shards,
|
||||||
shardBy: shardBy
|
shardBy: shardBy
|
||||||
}, callback);
|
};
|
||||||
|
if (self.engine.name !== 'rocksdb') {
|
||||||
|
tmpObj.journalSize = collSize;
|
||||||
|
}
|
||||||
|
this.collection.newCollection(tmpObj, callback);
|
||||||
}
|
}
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
|
@ -400,6 +420,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
createNewCollectionModal: function () {
|
createNewCollectionModal: function () {
|
||||||
|
var self = this;
|
||||||
var callbackCoord2 = function (error, isCoordinator) {
|
var callbackCoord2 = function (error, isCoordinator) {
|
||||||
if (error) {
|
if (error) {
|
||||||
arangoHelper.arangoError('DB', 'Could not check coordinator state');
|
arangoHelper.arangoError('DB', 'Could not check coordinator state');
|
||||||
|
@ -474,6 +495,7 @@
|
||||||
this.submitCreateCollection.bind(this)
|
this.submitCreateCollection.bind(this)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
if (self.engine.name !== 'rocksdb') {
|
||||||
advancedTableContent.push(
|
advancedTableContent.push(
|
||||||
window.modalView.createTextEntry(
|
window.modalView.createTextEntry(
|
||||||
'new-collection-size',
|
'new-collection-size',
|
||||||
|
@ -490,6 +512,7 @@
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
if (window.App.isCluster) {
|
if (window.App.isCluster) {
|
||||||
advancedTableContent.push(
|
advancedTableContent.push(
|
||||||
window.modalView.createTextEntry(
|
window.modalView.createTextEntry(
|
||||||
|
|
|
@ -281,6 +281,7 @@
|
||||||
if (error) {
|
if (error) {
|
||||||
arangoHelper.arangoError('Collection', 'Could not fetch properties');
|
arangoHelper.arangoError('Collection', 'Could not fetch properties');
|
||||||
} else {
|
} else {
|
||||||
|
if (data.journalSize) {
|
||||||
var journalSize = data.journalSize / (1024 * 1024);
|
var journalSize = data.journalSize / (1024 * 1024);
|
||||||
var indexBuckets = data.indexBuckets;
|
var indexBuckets = data.indexBuckets;
|
||||||
var wfs = data.waitForSync;
|
var wfs = data.waitForSync;
|
||||||
|
@ -301,7 +302,9 @@
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (indexBuckets) {
|
||||||
tableContent.push(
|
tableContent.push(
|
||||||
window.modalView.createTextEntry(
|
window.modalView.createTextEntry(
|
||||||
'change-index-buckets',
|
'change-index-buckets',
|
||||||
|
@ -318,6 +321,7 @@
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// prevent "unexpected sync method error"
|
// prevent "unexpected sync method error"
|
||||||
tableContent.push(
|
tableContent.push(
|
||||||
|
|
Loading…
Reference in New Issue