mirror of https://gitee.com/bigwinds/arangodb
commit for 1.4 final
This commit is contained in:
parent
c6b46a04f7
commit
8ce910f0f6
|
@ -18,7 +18,6 @@
|
|||
}
|
||||
|
||||
.api-actions .resource {
|
||||
margin-bottom: 5px !important;
|
||||
padding-left: 5px !important;
|
||||
border-bottom: 0 !important;
|
||||
}
|
||||
|
@ -80,3 +79,12 @@
|
|||
.api-actions .resource > .heading > .options {
|
||||
margin: 11px 10px 0 0 !important;
|
||||
}
|
||||
|
||||
#resources > li:nth-child(even) {
|
||||
background-color: #FFFFFF !important;
|
||||
}
|
||||
|
||||
#resources > li:nth-child(odd) {
|
||||
background-color: #F1F0EE !important;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,10 +34,6 @@
|
|||
color: #DA4F49;
|
||||
}
|
||||
|
||||
#newIndexView table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#change-collection .glyphicon-minus-sign {
|
||||
color: #DA4F49;
|
||||
font-size: 20px;
|
||||
|
@ -64,15 +60,6 @@
|
|||
margin-top: 0px;
|
||||
}
|
||||
|
||||
#newIndexType {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#createIndex {
|
||||
margin-top: 15px !important;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
#tab-content-collection-edit {
|
||||
max-height: 300px !important;
|
||||
}
|
||||
|
@ -84,10 +71,3 @@
|
|||
color: black;
|
||||
}
|
||||
|
||||
#newIndexView select {
|
||||
margin-left: -10px;
|
||||
}
|
||||
|
||||
#newIndexView input[type='checkbox'] {
|
||||
margin-left: -20px;
|
||||
}
|
||||
|
|
|
@ -523,8 +523,7 @@ table.dataTable thead th {
|
|||
|
||||
#documentsToolbar li a {
|
||||
margin-top: 0px !important;
|
||||
padding-top: 6px;
|
||||
padding-bottom: 1px;
|
||||
padding: 5px 11px 2px 9px;
|
||||
}
|
||||
|
||||
#documentsToolbar span {
|
||||
|
@ -535,3 +534,72 @@ table.dataTable thead th {
|
|||
|
||||
#resetView, #filterSend, #confirmDocImport {
|
||||
}
|
||||
|
||||
#indexHeaderContent {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#indexHeaderContent > div {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#figuresHeader th {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
#figuresHeader .collectionInfoTh {
|
||||
width: 25% !important;
|
||||
}
|
||||
|
||||
#createIndex, #addIndex, #cancelIndex {
|
||||
margin-top: 15px !important;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
#collectionEditIndexTable {
|
||||
min-width: 100% !important;
|
||||
}
|
||||
|
||||
#collectionEditIndexTable tr:nth-child(even) {
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
#collectionEditIndexTable tr:nth-child(odd) {
|
||||
background-color: #F1F0EE !important;
|
||||
}
|
||||
|
||||
#collectionEditIndexTable th {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#collectionEditIndexTable .glyphicon {
|
||||
font-size: 18px !important;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
#collectionEditIndexTable .glyphicon-minus-sign {
|
||||
color: #B30000;
|
||||
}
|
||||
|
||||
#collectionEditIndexTable .glyphicon-ban-circle {
|
||||
color: #C2C2C2;
|
||||
cursor: default !important;
|
||||
}
|
||||
|
||||
#newIndexView table tr {
|
||||
width: 600px !important;
|
||||
}
|
||||
|
||||
#newIndexView table tr th:last-child {
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
#newIndexView table th {
|
||||
width: 200px !important;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
}
|
||||
|
||||
.figuresHeader {
|
||||
border-bottom: 1px solid #888888;
|
||||
border-bottom: 1px solid #C2C2C2;
|
||||
}
|
||||
|
||||
.figuresHeader th {
|
||||
|
@ -153,9 +153,7 @@
|
|||
|
||||
#tab-content-collection-info #info,
|
||||
#tab-content-collection-info #figures,
|
||||
#tab-content-collection-info #index,
|
||||
#tab-content-collection-edit #main,
|
||||
#tab-content-collection-edit #editIndex {
|
||||
#tab-content-collection-info #index {
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid #888888 !important;
|
||||
margin-left: 0px !important;
|
||||
|
@ -275,3 +273,8 @@
|
|||
#change-collection select {
|
||||
width: 398px !important;
|
||||
}
|
||||
|
||||
#figures .glyphicon-info-sign{
|
||||
position: relative !important;
|
||||
right: -4px !important;
|
||||
}
|
||||
|
|
|
@ -251,3 +251,58 @@
|
|||
z-index: 9999 !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
#queryDropdown {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
background-color: rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
#queryDropdownIn {
|
||||
background-color: #FFFFFF;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#queryDropdownIn a {
|
||||
width: 100%;
|
||||
margin-bottom: 5px;
|
||||
font-size: 16px;
|
||||
font-weight: bolder;
|
||||
color: #686766;
|
||||
}
|
||||
|
||||
#queryDropdownRight {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#queryModalSelect {
|
||||
width: 100%;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#queryDropdownRight textarea {
|
||||
width: 100%;
|
||||
padding: 5px 0 0 0px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
#queryDropdownRight textarea:focus {
|
||||
outline: none;
|
||||
border-color: #8AA051;
|
||||
box-shadow: 0 0 3px #8AA051;
|
||||
}
|
||||
|
||||
#queryDropdownLeft {
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#queryDropdownIn #save-edit-query {
|
||||
margin-left: 7px !important;
|
||||
}
|
||||
|
||||
#queryDropdownIn #delete-edit-query {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<ul id="collectionTab" class="nav nav-tabs" style="visibility:hidden">
|
||||
<li class="active"><a href="#main" data-toggle="tab">Main</a></li>
|
||||
<li><a href="#editIndex" data-toggle="tab">Index</a></li>
|
||||
<ul id="collectionTab" class="nav nav-tabs" style="display:none">
|
||||
<li class="active"><a href="#main" data-toggle="tab" style="display:none">Main</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" id="tab-content-collection-edit">
|
||||
|
@ -59,144 +58,6 @@
|
|||
</div>
|
||||
|
||||
<div class="tab-pane" id="editIndex">
|
||||
|
||||
<div id="indexEditView">
|
||||
<span class="glyphicon glyphicon-plus-sign" data-original-title="Add index"></span>
|
||||
<table id="collectionEditIndexTable">
|
||||
<tr class="figuresHeader">
|
||||
<th class="collectionInfoTh">ID</th>
|
||||
<th class="collectionInfoTh">Type</th>
|
||||
<th class="collectionInfoTh">Unique</th>
|
||||
<th class="collectionInfoTh">Fields</th>
|
||||
<th class="collectionInfoTh">Action</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="newIndexView" style="display:none">
|
||||
<span class="glyphicon glyphicon-remove-circle" data-original-title="Abort"></span>
|
||||
<a id="newIndexHeader" class="arangoHeader">Add Index:</a>
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh thBorderBottom">Type:</th>
|
||||
<th class="thBorderBottom">
|
||||
<select id="newIndexType">
|
||||
<option value="Cap">Cap Constraints</option>
|
||||
<option value="Geo">Geo Index</option>
|
||||
<option value="Hash">Hash Index</option>
|
||||
<option value="Fulltext">Fulltext Index</option>
|
||||
<option value="Skiplist">Skip-List Index</option>
|
||||
</select>
|
||||
</th>
|
||||
<th class="thBorderBottom" style="width: 18px"/>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="newIndexTypeCap" class="newIndexClass">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Size:</th>
|
||||
<th><input type="text" id="newCapSize" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="The maximal number of documents for the collection."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Bytesize:</th>
|
||||
<th><input type="text" id="newCapByteSize" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="The maximal size of the active document data in the collection."/></th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="newIndexTypeGeo" class="newIndexClass" style="display: none">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Fields:</th>
|
||||
<th><input type="text" id="newGeoFields" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="A list with one or two attribute paths."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Geo JSON:</th>
|
||||
<th>
|
||||
<input id="newGeoJson" type="checkbox" name="newGeoJson" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If a geo-spatial index on a location is constructed and geoJson is true, then the order within the list is longitude followed by latitude."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Constraint:</th>
|
||||
<th>
|
||||
<input id="newGeoConstraint" type="checkbox" name="newGeoConstraint" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If constraint is true, then a geo-spatial constraint is created."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Ignore Null:</th>
|
||||
<th>
|
||||
<input id="newGeoIgnoreNull" type="checkbox" name="newGeoIgnoreNull" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If a geo-spatial constraint is created and ignoreNull is true, then documents with a null in location or at least one null in latitude or longitude are ignored."/>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="newIndexTypeHash" class="newIndexClass" style="display:none">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Fields:</th>
|
||||
<th><input type="text" id="newHashFields" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="A list of attribute paths."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Unique:</th>
|
||||
<th>
|
||||
<input id="newHashUnique" type="checkbox" name="newHashUnique" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If true, then create a unique index."/>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="newIndexTypeFulltext" class="newIndexClass" style="display:none">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Fields:</th>
|
||||
<th><input type="text" id="newFulltextFields" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="A list of attribute names. Currently, the list is limited to exactly one attribute, so the value of fields should look like this for example: [ "text" ]."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Min. length:</th>
|
||||
<th><input type="text" id="newFulltextMinLength" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="Minimum character length of words to index. Will default to a server-defined value if unspecified. It is thus recommended to set this value explicitly when creating the index."/></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="newIndexTypeSkiplist" class="newIndexClass" style="display:none">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Fields:</th>
|
||||
<th><input type="text" id="newSkiplistFields" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="A list of attribute paths."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Unique:</th>
|
||||
<th>
|
||||
<input id="newSkiplistUnique" type="checkbox" name="newSkiplistUnique" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If true, then create a unique index."/>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<button id="createIndex" class="btn btn-success" style="margin-right:8px; margin-top: 8px">Create Index</button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
<div id="replicationDropdownOut" class="dropdownOut">
|
||||
<div id="replicationDropdown" class="dropdownIn">
|
||||
<ul id="intervalUL">
|
||||
<ul id="intervalULR">
|
||||
<li class="nav-header">Update every:</li>
|
||||
<li><a><label class="radio"><input type="radio" name="updateInterval" id="every5seconds" value="5"><label><span></span>5 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="updateInterval" id="every10seconds" value="10"><label><span></span>10 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="updateInterval" id="every15seconds" value="15"><label><span></span>15 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="updateInterval" id="every30seconds" value="30"><label><span></span>30 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="updateInterval" id="every60seconds" value="60"><label><span></span>60 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="updateInterval" id="every90seconds" value="90"><label><span></span>90 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="updateInterval" id="every120seconds" value="120"><label><span></span>120 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="replUpdateInterval" id="every5secondsR" value="5"><label><span></span>5 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="replUpdateInterval" id="every10secondsR" value="10"><label><span></span>10 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="replUpdateInterval" id="every15secondsR" value="15"><label><span></span>15 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="replUpdateInterval" id="every30secondsR" value="30"><label><span></span>30 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="replUpdateInterval" id="every60secondsR" value="60"><label><span></span>60 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="replUpdateInterval" id="every90secondsR" value="90"><label><span></span>90 seconds</label></label></a></li>
|
||||
<li><a><label class="radio"><input type="radio" name="replUpdateInterval" id="every120secondsR" value="120"><label><span></span>120 seconds</label></label></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<div id="documentsToolbar" class="pagination pagination-small pagination-right">
|
||||
|
||||
<!-- remove marker for docupdiv--!>
|
||||
<ul><li class="enabled"><a id="indexCollection"><span class="glyphicon glyphicon-list-alt" title="Index collection"></span></a></li></ul>
|
||||
<ul><li class="enabled"><a id="filterCollection"><span class="glyphicon glyphicon-filter" title="Filter collection"></span></a></li></ul>
|
||||
<ul><li class="enabled"><a id="importCollection"><span class="arangoicon arango-icon-import" title="Upload documents"></span></a></li></ul>
|
||||
<ul>
|
||||
|
@ -40,6 +41,143 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="indexHeader"class="dropdownIn" style="display:none">
|
||||
<div class="contentIn" id="indexHeaderContent">
|
||||
<div id="indexEditView">
|
||||
<table id="collectionEditIndexTable">
|
||||
<tr class="figuresHeader">
|
||||
<th class="collectionInfoTh">ID</th>
|
||||
<th class="collectionInfoTh">Type</th>
|
||||
<th class="collectionInfoTh">Unique</th>
|
||||
<th class="collectionInfoTh">Fields</th>
|
||||
<th class="collectionInfoTh">Action</th>
|
||||
</tr>
|
||||
</table>
|
||||
<button id="addIndex" class="btn btn-primary btn-success">Add Index</button>
|
||||
</div>
|
||||
|
||||
<div id="newIndexView" style="display:none">
|
||||
<a id="newIndexHeader" class="arangoHeader">Add Index:</a>
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Type:</th>
|
||||
<th class="">
|
||||
<select id="newIndexType">
|
||||
<option value="Cap">Cap Constraints</option>
|
||||
<option value="Geo">Geo Index</option>
|
||||
<option value="Hash">Hash Index</option>
|
||||
<option value="Fulltext">Fulltext Index</option>
|
||||
<option value="Skiplist">Skip-List Index</option>
|
||||
</select>
|
||||
</th>
|
||||
<th class="" style="width: 18px"/>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="newIndexTypeCap" class="newIndexClass">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Size:</th>
|
||||
<th><input type="text" id="newCapSize" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="The maximal number of documents for the collection."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Bytesize:</th>
|
||||
<th><input type="text" id="newCapByteSize" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="The maximal size of the active document data in the collection."/></th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="newIndexTypeGeo" class="newIndexClass" style="display: none">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Fields:</th>
|
||||
<th><input type="text" id="newGeoFields" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="A list with one or two attribute paths."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Geo JSON:</th>
|
||||
<th>
|
||||
<input id="newGeoJson" type="checkbox" name="newGeoJson" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If a geo-spatial index on a location is constructed and geoJson is true, then the order within the list is longitude followed by latitude."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Constraint:</th>
|
||||
<th>
|
||||
<input id="newGeoConstraint" type="checkbox" name="newGeoConstraint" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If constraint is true, then a geo-spatial constraint is created."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Ignore Null:</th>
|
||||
<th>
|
||||
<input id="newGeoIgnoreNull" type="checkbox" name="newGeoIgnoreNull" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If a geo-spatial constraint is created and ignoreNull is true, then documents with a null in location or at least one null in latitude or longitude are ignored."/>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="newIndexTypeHash" class="newIndexClass" style="display:none">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Fields:</th>
|
||||
<th><input type="text" id="newHashFields" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="A list of attribute paths."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Unique:</th>
|
||||
<th>
|
||||
<input id="newHashUnique" type="checkbox" name="newHashUnique" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If true, then create a unique index."/>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="newIndexTypeFulltext" class="newIndexClass" style="display:none">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Fields:</th>
|
||||
<th><input type="text" id="newFulltextFields" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="A list of attribute names. Currently, the list is limited to exactly one attribute, so the value of fields should look like this for example: [ "text" ]."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Min. length:</th>
|
||||
<th><input type="text" id="newFulltextMinLength" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="Minimum character length of words to index. Will default to a server-defined value if unspecified. It is thus recommended to set this value explicitly when creating the index."/></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="newIndexTypeSkiplist" class="newIndexClass" style="display:none">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="collectionTh">Fields:</th>
|
||||
<th><input type="text" id="newSkiplistFields" value=""/></th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="A list of attribute paths."/></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="collectionTh">Unique:</th>
|
||||
<th>
|
||||
<input id="newSkiplistUnique" type="checkbox" name="newSkiplistUnique" value="true">
|
||||
</th>
|
||||
<th><span class="glyphicon glyphicon-info-sign" data-original-title="If true, then create a unique index."/>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<button id="createIndex" class="btn btn-success">Save</button>
|
||||
<button id="cancelIndex" class="btn btn-danger">Cancel</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="documentsDiv">
|
||||
|
@ -69,7 +207,7 @@
|
|||
<a class="arangoHeader">Delete Document?</a>
|
||||
</div>
|
||||
<div class="modal-body" id="deleteDoc">
|
||||
<p>Theres no way back…</p>
|
||||
<p>There is no way back…</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-close" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
|
@ -77,6 +215,21 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Delete Index Modal -->
|
||||
<div id="indexDeleteModal" style="display:none" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<a class="arangoHeader">Delete Index?</a>
|
||||
</div>
|
||||
<div class="modal-body" id="deleteIndex">
|
||||
<p>There is no way back…</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-close" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<button id="confirmDeleteIndexBtn" class="btn btn-danger" style="float:right">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Create Edge Modal -->
|
||||
<div id="edgeCreateModal" style="display:none" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
|
|
|
@ -4,11 +4,33 @@
|
|||
<ul><li class="enabled" style="visibility:hidden"><a id="aqlToggle" class="arangoHeaderA"><span class="glyphicon glyphicon-cog" title="Settings"></span></a></li></ul>
|
||||
<ul><li class="enabled"><a id="editAQL" class="arangoHeaderA"><span class="glyphicon glyphicon-th-list" title="Edit custom Queries"></span></a></li></ul>
|
||||
</div>
|
||||
|
||||
<a class="arangoHeader">AQL Editor</a>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<div id="queryDropdown" class="dropdownOut" style="display:hidden">
|
||||
<div class="dropdownIn" id="queryDropdownIn">
|
||||
<a class="arangoHeader">Edit custom queries</a>
|
||||
<div id="queryDropdownLeft">
|
||||
Name
|
||||
<select id="queryModalSelect"/>
|
||||
</div>
|
||||
<div id="queryDropdownRight">
|
||||
Query
|
||||
<textarea id="edit-aql-textarea"/>
|
||||
</div>
|
||||
<div class="buttonContainer">
|
||||
<button id="delete-edit-query" class="btn btn-danger">Delete</button>
|
||||
<button id="save-edit-query" class="btn btn-success">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-error" style="display:none" id="reallyDeleteQueryDiv">
|
||||
<strong>Really delete query?</strong>
|
||||
<button id="confirmDeleteQuery" class="btn btn-danger pull-right" style="margin-top: -4px; margin-right: -18px !important;">Yes</button>
|
||||
<button id="abortDeleteQuery" class="btn pull-right" style="margin-top: -4px; margin-right:10px;">No</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="queryDiv" class="form-actions" style="display:none">
|
||||
<div id="editorLabel"><h6>Query</h6></div>
|
||||
<div id="editorToolbar">
|
||||
|
@ -20,10 +42,6 @@
|
|||
</div>
|
||||
<div id="aqlEditor"></div>
|
||||
<div id="wideButtonDiv">
|
||||
<div id="shortcutDiv">
|
||||
<b>Submit:</b> CTRL/CMD + Return ; <b>Undo:</b> CTRL/CMD + Z ; <b>Redo:</b> CTRL/CMD + SHIFT + Z ;
|
||||
<b>Toggle Comments:</b> CTRL/CMD + SHIFT + C
|
||||
</div>
|
||||
<button id="submitQueryButton" class="btn btn-success">Submit</button>
|
||||
<button id="clearQueryButton" class="btn">Clear</button>
|
||||
<div class="styled-select">
|
||||
|
@ -40,6 +58,10 @@
|
|||
</div>
|
||||
<div id="queryOutput" class="thumbnail">
|
||||
</div>
|
||||
<div id="shortcutDiv">
|
||||
<b>Submit:</b> CTRL/CMD + Return ; <b>Undo:</b> CTRL/CMD + Z ; <b>Redo:</b> CTRL/CMD + SHIFT + Z ;
|
||||
<b>Toggle Comments:</b> CTRL/CMD + SHIFT + C
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -62,32 +84,4 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="edit-aql-queries" 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 custom queries</a>
|
||||
</div>
|
||||
<div id="edit-aql-body" class="modal-body">
|
||||
Name
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width:100% !important;">
|
||||
<select id="queryModalSelect"/>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
Query<br/>
|
||||
<textarea id="edit-aql-textarea"/>
|
||||
</div>
|
||||
<div id="colFooter" class="modal-footer">
|
||||
<button id="save-edit-query" class="btn btn-success pull-right">Save</button>
|
||||
<button id="delete-edit-query" class="btn btn-danger">Delete</button>
|
||||
<button class="btn btn-close btn-margin" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
</div>
|
||||
<div class="alert alert-error" style="display:none" id="reallyDeleteQueryDiv">
|
||||
<strong>Really delete query?</strong>
|
||||
<button id="confirmDeleteQuery" class="btn btn-danger pull-right" style="margin-top: -4px; margin-right: -18px !important;">Yes</button>
|
||||
<button id="abortDeleteQuery" class="btn pull-right" style="margin-top: -4px; margin-right:10px;">No</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -56,6 +56,7 @@ var collectionInfoView = Backbone.View.extend({
|
|||
this.data = window.arangoCollectionsStore.getFigures(this.options.colId, true);
|
||||
this.revision = window.arangoCollectionsStore.getRevision(this.options.colId, true);
|
||||
this.properties = window.arangoCollectionsStore.getProperties(this.options.colId, true);
|
||||
//remove
|
||||
this.index = window.arangoCollectionsStore.getIndex(this.options.colId, true);
|
||||
this.fillLoadedModal(this.data);
|
||||
//this.convertFigures(this.data);
|
||||
|
|
|
@ -23,14 +23,6 @@ var collectionView = Backbone.View.extend({
|
|||
placement: "left"
|
||||
});
|
||||
|
||||
$('#collectionTab a').click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
if ($(this).attr('href') === '#editIndex') {
|
||||
self.resetIndexForms();
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
events: {
|
||||
|
@ -42,12 +34,7 @@ var collectionView = Backbone.View.extend({
|
|||
"click #confirmDeleteCollection" : "confirmDeleteCollection",
|
||||
"click #abortDeleteCollection" : "abortDeleteCollection",
|
||||
"keydown #change-collection-name" : "listenKey",
|
||||
"keydown #change-collection-size" : "listenKey",
|
||||
"click #editIndex .glyphicon-plus-sign" : "toggleNewIndexView",
|
||||
"click #editIndex .glyphicon-remove-circle" : "toggleNewIndexView",
|
||||
"change #newIndexType" : "selectIndexType",
|
||||
"click #createIndex" : "createIndex",
|
||||
"click .deleteIndex" : "deleteIndex"
|
||||
"keydown #change-collection-size" : "listenKey"
|
||||
},
|
||||
listenKey: function(e) {
|
||||
if (e.keyCode === 13) {
|
||||
|
@ -57,16 +44,6 @@ var collectionView = Backbone.View.extend({
|
|||
hidden: function () {
|
||||
window.App.navigate("#collections", {trigger: true});
|
||||
},
|
||||
toggleNewIndexView: function () {
|
||||
$('#indexEditView').toggle("fast");
|
||||
$('#newIndexView').toggle("fast");
|
||||
this.resetIndexForms();
|
||||
},
|
||||
selectIndexType: function () {
|
||||
$('.newIndexClass').hide();
|
||||
var type = $('#newIndexType').val();
|
||||
$('#newIndexType'+type).show();
|
||||
},
|
||||
fillModal: function() {
|
||||
try {
|
||||
this.myCollection = window.arangoCollectionsStore.get(this.options.colId).attributes;
|
||||
|
@ -99,156 +76,11 @@ var collectionView = Backbone.View.extend({
|
|||
this.fillLoadedModal(data);
|
||||
}
|
||||
},
|
||||
stringToArray: function (fieldString) {
|
||||
var fields = [];
|
||||
fieldString.split(',').forEach(function(field){
|
||||
field = field.replace(/(^\s+|\s+$)/g,'');
|
||||
if (field !== '') {
|
||||
fields.push(field);
|
||||
}
|
||||
});
|
||||
return fields;
|
||||
},
|
||||
checkboxToValue: function (id) {
|
||||
var checked = $(id).is('checked');
|
||||
return checked;
|
||||
},
|
||||
createIndex: function (e) {
|
||||
//e.preventDefault();
|
||||
var self = this;
|
||||
var collection = this.myCollection.name;
|
||||
var indexType = $('#newIndexType').val();
|
||||
var result;
|
||||
var postParameter = {};
|
||||
var fields;
|
||||
var unique;
|
||||
|
||||
switch(indexType) {
|
||||
case 'Cap':
|
||||
var size = parseInt($('#newCapSize').val(), 10) || 0;
|
||||
var byteSize = parseInt($('#newCapByteSize').val(), 10) || 0;
|
||||
postParameter = {
|
||||
type: 'cap',
|
||||
size: size,
|
||||
byteSize: byteSize
|
||||
};
|
||||
break;
|
||||
case 'Geo':
|
||||
//HANDLE ARRAY building
|
||||
fields = $('#newGeoFields').val();
|
||||
var geoJson = self.checkboxToValue('#newGeoJson');
|
||||
var constraint = self.checkboxToValue('#newGeoConstraint');
|
||||
var ignoreNull = self.checkboxToValue('#newGeoIgnoreNull');
|
||||
postParameter = {
|
||||
type: 'geo',
|
||||
fields: self.stringToArray(fields),
|
||||
geoJson: geoJson,
|
||||
constraint: constraint,
|
||||
ignoreNull: ignoreNull
|
||||
};
|
||||
break;
|
||||
case 'Hash':
|
||||
fields = $('#newHashFields').val();
|
||||
unique = self.checkboxToValue('#newHashUnique');
|
||||
postParameter = {
|
||||
type: 'hash',
|
||||
fields: self.stringToArray(fields),
|
||||
unique: unique
|
||||
};
|
||||
break;
|
||||
case 'Fulltext':
|
||||
fields = ($('#newFulltextFields').val());
|
||||
var minLength = parseInt($('#newFulltextMinLength').val(), 10) || 0;
|
||||
postParameter = {
|
||||
type: 'fulltext',
|
||||
fields: self.stringToArray(fields),
|
||||
minLength: minLength
|
||||
};
|
||||
break;
|
||||
case 'Skiplist':
|
||||
fields = $('#newSkiplistFields').val();
|
||||
unique = self.checkboxToValue('#newSkiplistUnique');
|
||||
postParameter = {
|
||||
type: 'skiplist',
|
||||
fields: self.stringToArray(fields),
|
||||
unique: unique
|
||||
};
|
||||
break;
|
||||
}
|
||||
result = window.arangoCollectionsStore.createIndex(collection, postParameter);
|
||||
if (result === true) {
|
||||
$('#collectionEditIndexTable tr').remove();
|
||||
self.getIndex();
|
||||
self.toggleNewIndexView();
|
||||
self.resetIndexForms();
|
||||
}
|
||||
else {
|
||||
arangoHelper.arangoError("Could not create index");
|
||||
}
|
||||
},
|
||||
|
||||
resetIndexForms: function () {
|
||||
$('#editIndex input').val('').prop("checked", false);
|
||||
$('#newIndexType').val('Cap').prop('selected',true);
|
||||
},
|
||||
|
||||
deleteIndex: function (e) {
|
||||
var collection = this.myCollection.name;
|
||||
var id = $(e.currentTarget).parent().parent().first().children().first().text();
|
||||
var result = window.arangoCollectionsStore.deleteIndex(collection, id);
|
||||
if (result === true) {
|
||||
$(e.currentTarget).parent().parent().remove();
|
||||
}
|
||||
else {
|
||||
arangoHelper.arangoError("Could not delete index");
|
||||
}
|
||||
},
|
||||
|
||||
getIndex: function () {
|
||||
this.index = window.arangoCollectionsStore.getIndex(this.options.colId, true);
|
||||
var cssClass = 'collectionInfoTh modal-text';
|
||||
if (this.index) {
|
||||
var fieldString = '';
|
||||
var indexId = '';
|
||||
var actionString = '';
|
||||
|
||||
$.each(this.index.indexes, function(k,v) {
|
||||
|
||||
if (v.type === 'primary' || v.type === 'edge') {
|
||||
actionString = '<span class="glyphicon glyphicon-ban-circle" ' +
|
||||
'data-original-title="No action"></span>';
|
||||
}
|
||||
else {
|
||||
actionString = '<span class="deleteIndex glyphicon glyphicon-minus-sign" ' +
|
||||
'data-original-title="Delete index"></span>';
|
||||
}
|
||||
|
||||
if (v.fields !== undefined) {
|
||||
fieldString = v.fields.join(", ");
|
||||
}
|
||||
|
||||
//cut index id
|
||||
var position = v.id.indexOf('/');
|
||||
var indexId = v.id.substr(position+1, v.id.length);
|
||||
|
||||
$('#collectionEditIndexTable').append(
|
||||
'<tr>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + indexId + '</th>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + v.type + '</th>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + v.unique + '</th>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + fieldString + '</th>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + actionString + '</th>'+
|
||||
'</tr>'
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
fillLoadedModal: function (data) {
|
||||
|
||||
//show tabs & render figures tab-view
|
||||
$('#change-collection .nav-tabs').css("visibility","visible");
|
||||
this.getIndex();
|
||||
|
||||
$('#collectionSizeBox').show();
|
||||
$('#collectionSyncBox').show();
|
||||
|
|
|
@ -5,6 +5,7 @@ var dashboardView = Backbone.View.extend({
|
|||
el: '#content',
|
||||
updateInterval: 1000, // 1 second, constant
|
||||
updateFrequency: 5, // the actual update rate (5 s)
|
||||
updateFrequencyR: 5, // the actual update rate (5 s) REPLICATION
|
||||
updateCounter: 0,
|
||||
arraySize: 20, // how many values will we keep per figure?
|
||||
seriesData: {},
|
||||
|
@ -39,7 +40,9 @@ var dashboardView = Backbone.View.extend({
|
|||
if (self.updateCounter < self.updateFrequency) {
|
||||
return false;
|
||||
}
|
||||
if (window.location.hash === '#dashboard') {
|
||||
|
||||
//need other solution here -> split repl & graph update interval
|
||||
if (window.location.hash === '' && self.updateCounter >= self.updateFrequencyR) {
|
||||
self.getReplicationStatus();
|
||||
}
|
||||
|
||||
|
@ -64,6 +67,7 @@ var dashboardView = Backbone.View.extend({
|
|||
events: {
|
||||
"click #dashboardDropdown li" : "checkEnabled",
|
||||
"click #intervalUL li" : "checkInterval",
|
||||
"click #intervalULR li" : "checkIntervalR",
|
||||
"click .db-zoom" : "renderDetailChart",
|
||||
"click .db-minimize" : "checkDetailChart",
|
||||
"click .db-hide" : "hideChart",
|
||||
|
@ -228,6 +232,7 @@ var dashboardView = Backbone.View.extend({
|
|||
self.renderFigure(this);
|
||||
});
|
||||
$('#every'+self.updateFrequency+'seconds').prop('checked',true);
|
||||
$('#every'+self.updateFrequencyR+'secondsR').prop('checked',true);
|
||||
|
||||
if (this.collection.models[0] === undefined) {
|
||||
this.collection.fetch({
|
||||
|
@ -294,6 +299,11 @@ var dashboardView = Backbone.View.extend({
|
|||
this.calculateSeries();
|
||||
this.renderCharts();
|
||||
},
|
||||
checkIntervalR: function (a) {
|
||||
this.updateFrequencyR = a.target.value;
|
||||
self.getReplicationStatus();
|
||||
console.log("asd");
|
||||
},
|
||||
|
||||
checkEnabled: function (a) {
|
||||
var myId = a.target.id;
|
||||
|
@ -430,6 +440,7 @@ var dashboardView = Backbone.View.extend({
|
|||
renderCharts: function () {
|
||||
var self = this;
|
||||
$('#every'+self.updateFrequency+'seconds').prop('checked',true);
|
||||
$('#every'+self.updateFrequency+'secondsR').prop('checked',true);
|
||||
|
||||
$.each(self.options.description.models[0].attributes.figures, function () {
|
||||
var figure = this;
|
||||
|
|
|
@ -27,6 +27,7 @@ var documentsView = Backbone.View.extend({
|
|||
"click #collectionPrev" : "prevCollection",
|
||||
"click #collectionNext" : "nextCollection",
|
||||
"click #filterCollection" : "filterCollection",
|
||||
"click #indexCollection" : "indexCollection",
|
||||
"click #importCollection" : "importCollection",
|
||||
"click #filterSend" : "sendFilter",
|
||||
"click #addFilterItem" : "addFilterItem",
|
||||
|
@ -46,7 +47,14 @@ var documentsView = Backbone.View.extend({
|
|||
"keydown .filterValue" : "filterValueKeydown",
|
||||
"click #importModal" : "showImportModal",
|
||||
"click #resetView" : "resetView",
|
||||
"click #confirmDocImport" : "startUpload"
|
||||
"click #confirmDocImport" : "startUpload",
|
||||
"change #newIndexType" : "selectIndexType",
|
||||
"click #createIndex" : "createIndex",
|
||||
"click .deleteIndex" : "prepDeleteIndex",
|
||||
"click #confirmDeleteIndexBtn" : "deleteIndex",
|
||||
"click #documentsToolbar ul" : "resetIndexForms",
|
||||
"click #indexHeader #addIndex" : "toggleNewIndexView",
|
||||
"click #indexHeader #cancelIndex" : "toggleNewIndexView"
|
||||
},
|
||||
|
||||
showSpinner: function() {
|
||||
|
@ -72,7 +80,11 @@ var documentsView = Backbone.View.extend({
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
toggleNewIndexView: function () {
|
||||
$('#indexEditView').toggle("fast");
|
||||
$('#newIndexView').toggle("fast");
|
||||
this.resetIndexForms();
|
||||
},
|
||||
nop: function(event) {
|
||||
event.stopPropagation();
|
||||
},
|
||||
|
@ -197,6 +209,7 @@ var documentsView = Backbone.View.extend({
|
|||
filterCollection : function () {
|
||||
$('#filterHeader').slideToggle(200);
|
||||
$('#importHeader').hide();
|
||||
$('#indexHeader').hide();
|
||||
|
||||
var i;
|
||||
for (i in this.filters) {
|
||||
|
@ -210,6 +223,16 @@ var documentsView = Backbone.View.extend({
|
|||
importCollection: function () {
|
||||
$('#importHeader').slideToggle(200);
|
||||
$('#filterHeader').hide();
|
||||
$('#indexHeader').hide();
|
||||
},
|
||||
|
||||
indexCollection: function () {
|
||||
$('#newIndexView').hide();
|
||||
$('#indexEditView').show();
|
||||
$('#indexHeader').slideToggle(200);
|
||||
$('#importHeader').hide();
|
||||
$('#filterHeader').hide();
|
||||
|
||||
},
|
||||
|
||||
getFilterContent: function () {
|
||||
|
@ -541,6 +564,7 @@ var documentsView = Backbone.View.extend({
|
|||
this.collectionContext = window.arangoCollectionsStore.getPosition(this.colid);
|
||||
|
||||
$(this.el).html(this.template.text);
|
||||
this.getIndex();
|
||||
this.initTable();
|
||||
this.breadcrumb();
|
||||
if (this.collectionContext.prev === null) {
|
||||
|
@ -624,12 +648,12 @@ var documentsView = Backbone.View.extend({
|
|||
}
|
||||
},
|
||||
breadcrumb: function () {
|
||||
var name = window.location.hash.split("/")[1];
|
||||
this.collectionName = window.location.hash.split("/")[1];
|
||||
$('#transparentHeader').append(
|
||||
'<div class="breadcrumb">'+
|
||||
'<a class="activeBread" href="#">Collections</a>'+
|
||||
'<a class="activeBread" href="#collections">Collections</a>'+
|
||||
' > '+
|
||||
'<a class="disabledBread">'+name+'</a>'+
|
||||
'<a class="disabledBread">'+this.collectionName+'</a>'+
|
||||
'</div>'
|
||||
);
|
||||
},
|
||||
|
@ -642,6 +666,156 @@ var documentsView = Backbone.View.extend({
|
|||
escaped: function (value) {
|
||||
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")
|
||||
.replace(/"/g, """).replace(/'/g, "'");
|
||||
},
|
||||
resetIndexForms: function () {
|
||||
$('#indexHeader input').val('').prop("checked", false);
|
||||
$('#newIndexType').val('Cap').prop('selected',true);
|
||||
},
|
||||
stringToArray: function (fieldString) {
|
||||
var fields = [];
|
||||
fieldString.split(',').forEach(function(field){
|
||||
field = field.replace(/(^\s+|\s+$)/g,'');
|
||||
if (field !== '') {
|
||||
fields.push(field);
|
||||
}
|
||||
});
|
||||
return fields;
|
||||
},
|
||||
createIndex: function (e) {
|
||||
//e.preventDefault();
|
||||
var self = this;
|
||||
var collection = this.collectionName;
|
||||
var indexType = $('#newIndexType').val();
|
||||
var result;
|
||||
var postParameter = {};
|
||||
var fields;
|
||||
var unique;
|
||||
|
||||
switch(indexType) {
|
||||
case 'Cap':
|
||||
var size = parseInt($('#newCapSize').val(), 10) || 0;
|
||||
var byteSize = parseInt($('#newCapByteSize').val(), 10) || 0;
|
||||
postParameter = {
|
||||
type: 'cap',
|
||||
size: size,
|
||||
byteSize: byteSize
|
||||
};
|
||||
break;
|
||||
case 'Geo':
|
||||
//HANDLE ARRAY building
|
||||
fields = $('#newGeoFields').val();
|
||||
var geoJson = self.checkboxToValue('#newGeoJson');
|
||||
var constraint = self.checkboxToValue('#newGeoConstraint');
|
||||
var ignoreNull = self.checkboxToValue('#newGeoIgnoreNull');
|
||||
postParameter = {
|
||||
type: 'geo',
|
||||
fields: self.stringToArray(fields),
|
||||
geoJson: geoJson,
|
||||
constraint: constraint,
|
||||
ignoreNull: ignoreNull
|
||||
};
|
||||
break;
|
||||
case 'Hash':
|
||||
fields = $('#newHashFields').val();
|
||||
unique = self.checkboxToValue('#newHashUnique');
|
||||
postParameter = {
|
||||
type: 'hash',
|
||||
fields: self.stringToArray(fields),
|
||||
unique: unique
|
||||
};
|
||||
break;
|
||||
case 'Fulltext':
|
||||
fields = ($('#newFulltextFields').val());
|
||||
var minLength = parseInt($('#newFulltextMinLength').val(), 10) || 0;
|
||||
postParameter = {
|
||||
type: 'fulltext',
|
||||
fields: self.stringToArray(fields),
|
||||
minLength: minLength
|
||||
};
|
||||
break;
|
||||
case 'Skiplist':
|
||||
fields = $('#newSkiplistFields').val();
|
||||
unique = self.checkboxToValue('#newSkiplistUnique');
|
||||
postParameter = {
|
||||
type: 'skiplist',
|
||||
fields: self.stringToArray(fields),
|
||||
unique: unique
|
||||
};
|
||||
break;
|
||||
}
|
||||
result = window.arangoCollectionsStore.createIndex(collection, postParameter);
|
||||
if (result === true) {
|
||||
$('#collectionEditIndexTable tr').remove();
|
||||
self.getIndex();
|
||||
self.toggleNewIndexView();
|
||||
self.resetIndexForms();
|
||||
}
|
||||
else {
|
||||
arangoHelper.arangoError("Could not create index");
|
||||
}
|
||||
},
|
||||
|
||||
prepDeleteIndex: function (e) {
|
||||
this.lastTarget = e;
|
||||
this.lastId = $(this.lastTarget.currentTarget).parent().parent().first().children().first().text();
|
||||
$("#indexDeleteModal").modal('show');
|
||||
},
|
||||
deleteIndex: function () {
|
||||
var result = window.arangoCollectionsStore.deleteIndex(this.collectionName, this.lastId);
|
||||
if (result === true) {
|
||||
$(this.lastTarget.currentTarget).parent().parent().remove();
|
||||
}
|
||||
else {
|
||||
arangoHelper.arangoError("Could not delete index");
|
||||
}
|
||||
$("#indexDeleteModal").modal('hide');
|
||||
},
|
||||
selectIndexType: function () {
|
||||
$('.newIndexClass').hide();
|
||||
var type = $('#newIndexType').val();
|
||||
$('#newIndexType'+type).show();
|
||||
},
|
||||
checkboxToValue: function (id) {
|
||||
var checked = $(id).is('checked');
|
||||
return checked;
|
||||
},
|
||||
getIndex: function () {
|
||||
this.index = window.arangoCollectionsStore.getIndex(this.collectionID, true);
|
||||
var cssClass = 'collectionInfoTh modal-text';
|
||||
if (this.index) {
|
||||
var fieldString = '';
|
||||
var indexId = '';
|
||||
var actionString = '';
|
||||
|
||||
$.each(this.index.indexes, function(k,v) {
|
||||
|
||||
if (v.type === 'primary' || v.type === 'edge') {
|
||||
actionString = '<span class="glyphicon glyphicon-ban-circle" ' +
|
||||
'data-original-title="No action"></span>';
|
||||
}
|
||||
else {
|
||||
actionString = '<span class="deleteIndex glyphicon glyphicon-minus-sign" ' +
|
||||
'data-original-title="Delete index"></span>';
|
||||
}
|
||||
|
||||
if (v.fields !== undefined) {
|
||||
fieldString = v.fields.join(", ");
|
||||
}
|
||||
|
||||
//cut index id
|
||||
var position = v.id.indexOf('/');
|
||||
var indexId = v.id.substr(position+1, v.id.length);
|
||||
|
||||
$('#collectionEditIndexTable').append(
|
||||
'<tr>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + indexId + '</th>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + v.type + '</th>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + v.unique + '</th>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + fieldString + '</th>'+
|
||||
'<th class=' + JSON.stringify(cssClass) + '>' + actionString + '</th>'+
|
||||
'</tr>'
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -231,7 +231,8 @@ var queryView = Backbone.View.extend({
|
|||
}
|
||||
|
||||
this.hideDeleteField();
|
||||
$('#edit-aql-queries').modal('show');
|
||||
$('#queryDropdown').slideToggle();
|
||||
//$('#edit-aql-queries').modal('show');
|
||||
this.renderSelectboxes(true);
|
||||
this.updateEditSelect();
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue