mirror of https://gitee.com/bigwinds/arangodb
improved gui
This commit is contained in:
parent
5a729b12d9
commit
7735386109
|
@ -89,10 +89,6 @@ td {
|
|||
height:30px;
|
||||
}
|
||||
|
||||
#editCollectionView td {
|
||||
font-size: 1.2em ;
|
||||
}
|
||||
|
||||
pre ul li span{
|
||||
font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
|
||||
font-size: 1em;
|
||||
|
@ -216,8 +212,25 @@ pre ul li span{
|
|||
box-shadow: inset 0 0 1px 1px #f6f6f6;
|
||||
}
|
||||
|
||||
#createCollection, #refreshCollections {
|
||||
font-size: 0.85em !important;
|
||||
}
|
||||
|
||||
#createCollectionView {
|
||||
height:130px;
|
||||
height:auto;
|
||||
}
|
||||
|
||||
#createCollectionView td, #editCollectionView td {
|
||||
width:200px;
|
||||
background-color: #e4e9d2;
|
||||
}
|
||||
|
||||
.first {
|
||||
width: 200px !important;
|
||||
}
|
||||
|
||||
.longTD {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
#newCollection_left, #editCollection_left {
|
||||
|
@ -250,23 +263,12 @@ pre ul li span{
|
|||
resize: none;
|
||||
}
|
||||
|
||||
#editCollectionTable {
|
||||
font-size: 0.8em;
|
||||
border-width: 1px;
|
||||
border-color: green;
|
||||
border-style: solid;
|
||||
background-color: #E4E9D2;
|
||||
padding-left: 5px;
|
||||
padding-bottom: 2px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
#newCollection_right form {
|
||||
padding-top: 10px;
|
||||
margin-left: -7px;
|
||||
}
|
||||
|
||||
#waitForSyncForm {
|
||||
#waitForSyncForm, #isSystemForm {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
|
@ -340,7 +342,7 @@ form {
|
|||
-moz-border-radius: 2px; -webkit-border-radius: 2px;
|
||||
margin-top: 0px;
|
||||
background-color: white;
|
||||
height: 300px;
|
||||
height: 70%;
|
||||
overflow-y: auto;
|
||||
width:100%;
|
||||
}
|
||||
|
@ -364,7 +366,7 @@ form {
|
|||
|
||||
#avocshContent {
|
||||
font-family: "courier";
|
||||
width: 100%;
|
||||
width: 90%;
|
||||
height: 30px;
|
||||
background-color: white;
|
||||
margin-right: 0.5%;
|
||||
|
@ -387,10 +389,9 @@ form {
|
|||
}
|
||||
|
||||
#submitAvoc {
|
||||
visibility:hidden;
|
||||
height: 40px !important;
|
||||
width: 9% !important;
|
||||
margin-top: 10px !important;
|
||||
height: 29px !important;
|
||||
width: 9.5% !important;
|
||||
vertical-align: -1px;
|
||||
}
|
||||
|
||||
#centerView {
|
||||
|
@ -659,7 +660,6 @@ form {
|
|||
}
|
||||
|
||||
#avocshView {
|
||||
height: 350px;
|
||||
padding-top: 2px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
|
|
|
@ -94,19 +94,35 @@
|
|||
<a>Cancel</a>
|
||||
</button>
|
||||
<br></br>
|
||||
<div id="newCollection_left">
|
||||
<a>Name:</a><br></br>
|
||||
<a>waitForSync:</a>
|
||||
</div>
|
||||
<div id="newCollection_right">
|
||||
<input type="text" class="smallInput" id="createCollName"></input>
|
||||
<form action="#" id="waitForSyncForm">
|
||||
<input type="radio" name="waitForSync" value=true checked>yes</input>
|
||||
<input type="radio" name="waitForSync" value=false>no</input>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<table cellpadding="3" cellspacing="0" border="0">
|
||||
<tr><td>Name:</td>
|
||||
<td>
|
||||
<input type="text" class="smallInput" id="createCollName"></input>
|
||||
</td>
|
||||
<td class="longTD">Enter new collection name here</td>
|
||||
</tr>
|
||||
<tr><td>waitForSync:</td><td>
|
||||
<form action="#" id="waitForSyncForm">
|
||||
<input type="radio" name="waitForSync" value=true>yes</input>
|
||||
<input type="radio" name="waitForSync" value=false checked>no</input>
|
||||
</form>
|
||||
</td>
|
||||
<td class="longTD">If true then the data is synchronised to disk before returning from a create or update of an document.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>isSystem:</td><td>
|
||||
<form action="#" id="isSystemForm">
|
||||
<input type="radio" name="isSystem" value=true>yes</input>
|
||||
<input type="radio" name="isSystem" value=false checked>no</input>
|
||||
</form>
|
||||
</td>
|
||||
<td class="longTD">If true, create a system collection. In this case collection-name should start with an underscore.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>journalSize:</td></td><td></td><td class="longTD">
|
||||
The maximal size of a journal or datafile. Note that this also limits the maximal size of a single object. Must be at least 1MB.
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -116,17 +132,17 @@
|
|||
<a>Save Collection</a>
|
||||
</button>
|
||||
<br></br>
|
||||
<table cellpadding="3" cellspacing="0" border="0" width="300px" id="editCollectionTable">
|
||||
<table cellpadding="3" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td align="left"><b>Name:</b></td>
|
||||
<td><input id="editCollectionName" type="text" placeholder="unknown" name="username"></td>
|
||||
<td class="first" align="left">Name:</td>
|
||||
<td class="longTD"><input id="editCollectionName" type="text" placeholder="unknown" name="username"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><b>ID:</b></td>
|
||||
<td class="first" align="left">ID:</td>
|
||||
<td id="editCollectionID">unknown</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><b>Status:</b></td>
|
||||
<td class="first" align="left">Status:</td>
|
||||
<td id="editCollectionStatus">unknown</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -10,7 +10,7 @@ var collectionCurrentPage;
|
|||
var globalCollectionName;
|
||||
var globalCollectionID;
|
||||
var globalCollectionRev;
|
||||
|
||||
var checkCollectionName;
|
||||
var open = false;
|
||||
$(document).ready(function() {
|
||||
showCursor();
|
||||
|
@ -76,7 +76,7 @@ $("#documents_last").live('click', function () {
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// html customizations
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
$('#logView ul').append('<button id="refreshLogButton"><img src="/_admin/html/media/icons/refresh_icon16.png" width=16 height=16></button><div id=tab_right align=right><form><input type="text" id="logSearchField"></input><button id="submitLogSearch">Search</button></form></div>');
|
||||
$('#logView ul').append('<button class="enabled" id="refreshLogButton"><img src="/_admin/html/media/icons/refresh_icon16.png" width=16 height=16></button><div id=tab_right align=right><form><input type="text" id="logSearchField"></input><button id="submitLogSearch">Search</button></form></div>');
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// initialize jquery tabs
|
||||
|
@ -520,6 +520,7 @@ var logTable = $('#logTableID').dataTable({
|
|||
}
|
||||
|
||||
$('#editCollectionStatus').text(tmpStatus);
|
||||
checkCollectionName = collectionName;
|
||||
},
|
||||
error: function(data) {
|
||||
}
|
||||
|
@ -531,7 +532,7 @@ var logTable = $('#logTableID').dataTable({
|
|||
hideAllSubDivs();
|
||||
$('#collectionsView').hide();
|
||||
$('#editCollectionView').show();
|
||||
|
||||
$('#editCollectionName').focus();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -544,6 +545,7 @@ var logTable = $('#logTableID').dataTable({
|
|||
$('#collectionsView').hide();
|
||||
$('#logView').show();
|
||||
createnav ("Logs");
|
||||
showCursor();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -687,6 +689,7 @@ var logTable = $('#logTableID').dataTable({
|
|||
$('#collectionsView').hide();
|
||||
$('#queryView').show();
|
||||
createnav ("Query");
|
||||
$('#queryContent').focus();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -698,6 +701,7 @@ var logTable = $('#logTableID').dataTable({
|
|||
$('#collectionsView').hide();
|
||||
$('#avocshView').show();
|
||||
createnav ("AvocSH");
|
||||
$('#avocshContent').focus();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -713,6 +717,7 @@ var logTable = $('#logTableID').dataTable({
|
|||
hideAllSubDivs();
|
||||
$('#collectionsView').hide();
|
||||
$('#createCollectionView').show();
|
||||
$('#createCollName').focus();
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -881,7 +886,7 @@ var logTable = $('#logTableID').dataTable({
|
|||
|
||||
$('#addNewDocButton').live('click', function () {
|
||||
if (tableView == true) {
|
||||
newDocumentTable.fnAddData(['<button class="enabled" id="deleteEditedDocButton"><img src="/_admin/html/media/icons/delete_icon16.png" width="16" height="16"></button>', "somevalue", value2html("editme"), JSON.stringify("editme")]);
|
||||
newDocumentTable.fnAddData(['<button class="enabled" id="deleteNewDocButton"><img src="/_admin/html/media/icons/delete_icon16.png" width="16" height="16"></button>', "somevalue", value2html("editme"), JSON.stringify("editme")]);
|
||||
documentTableMakeEditable('#NewDocumentTableID');
|
||||
showCursor();
|
||||
}
|
||||
|
@ -1058,7 +1063,7 @@ var logTable = $('#logTableID').dataTable({
|
|||
newDocumentTable.fnAddData(["", key, value2html(val), JSON.stringify(val)]);
|
||||
}
|
||||
else {
|
||||
newDocumentTable.fnAddData(['<button id="deleteNewDocButton"><img src="/_admin/html/media/icons/delete_icon16.png" width="16" height="16"></button>',key, value2html(val), JSON.stringify(val)]);
|
||||
newDocumentTable.fnAddData(['<button class="enabled" id="deleteNewDocButton"><img src="/_admin/html/media/icons/delete_icon16.png" width="16" height="16"></button>',key, value2html(val), JSON.stringify(val)]);
|
||||
}
|
||||
});
|
||||
documentTableMakeEditable ('#NewDocumentTableID');
|
||||
|
@ -1084,7 +1089,6 @@ var logTable = $('#logTableID').dataTable({
|
|||
var row = $(this).closest("tr").get(0);
|
||||
documentEditTable.fnDeleteRow(documentEditTable.fnGetPosition(row));
|
||||
});
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// submit log search
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1269,7 +1273,12 @@ var logTable = $('#logTableID').dataTable({
|
|||
|
||||
$('#saveEditedCollection').live('click', function () {
|
||||
var newColName = $('#editCollectionName').val();
|
||||
var currentid = $('#editCollectionID').text();
|
||||
var currentid = $('#editCollectionID').text();
|
||||
|
||||
if (newColName == checkCollectionName) {
|
||||
alert("Nothing to do...");
|
||||
return 0;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "PUT",
|
||||
|
@ -1285,7 +1294,8 @@ var logTable = $('#logTableID').dataTable({
|
|||
drawCollectionsTable();
|
||||
},
|
||||
error: function(data) {
|
||||
alert(JSON.stringify(data));
|
||||
var temp = JSON.parse(data.responseText);
|
||||
alert("Error: " + JSON.stringify(temp.errorMessage));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1303,14 +1313,19 @@ var logTable = $('#logTableID').dataTable({
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$('#saveNewCollection').live('click', function () {
|
||||
|
||||
var wfscheck = $('input:radio[name=waitForSync]:checked').val();
|
||||
var systemcheck = $('input:radio[name=isSystem]:checked').val();
|
||||
var collName = $('#createCollName').val();
|
||||
|
||||
|
||||
if (collName == '') {
|
||||
alert("Nothing to do...");
|
||||
return 0;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/_api/collection",
|
||||
data: '{"name":"' + collName + '", "waitForSync":"' + JSON.parse(wfscheck) + '"}',
|
||||
data: '{"name":"' + collName + '", "waitForSync":' + JSON.parse(wfscheck) + '," isSystem":' + JSON.parse(systemcheck)+'}',
|
||||
contentType: "application/json",
|
||||
processData: false,
|
||||
success: function(data) {
|
||||
|
@ -1414,8 +1429,9 @@ var logTable = $('#logTableID').dataTable({
|
|||
drawCollectionsTable();
|
||||
},
|
||||
error: function (data) {
|
||||
alert('Error:' + JSON.stringify(data));
|
||||
drawCollectionsTable();
|
||||
var temp = JSON.parse(data.responseText);
|
||||
alert("Error: " + JSON.stringify(temp.errorMessage));
|
||||
drawCollectionsTable();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1430,12 +1446,12 @@ var logTable = $('#logTableID').dataTable({
|
|||
type: 'PUT',
|
||||
url: "/_api/collection/" + collectionID + "/unload",
|
||||
success: function () {
|
||||
drawCollectionsTable();
|
||||
},
|
||||
error: function () {
|
||||
alert('Error');
|
||||
}
|
||||
});
|
||||
drawCollectionsTable();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1498,12 +1514,13 @@ function drawCollectionsTable () {
|
|||
}
|
||||
});
|
||||
|
||||
items.push(['<button clas="enabled" id="delete"><img src="/_admin/html/media/icons/round_minus_icon16.png" width="16" height="16" title="Delete"></button><button class="enabled" id="unload"><img src="/_admin/html/media/icons/not_connected_icon16.png" width="16" height="16" title="Unload"></button><button class="enabled" id="showdocs"><img src="/_admin/html/media/icons/zoom_icon16.png" width="16" height="16" title="Show Documents"></button><button class="enabled" id="edit" title="Edit"><img src="/_admin/html/media/icons/doc_edit_icon16.png" width="16" height="16"></button>',
|
||||
items.push(['<button class="enabled" id="delete"><img src="/_admin/html/media/icons/round_minus_icon16.png" width="16" height="16" title="Delete"></button><button class="enabled" id="unload"><img src="/_admin/html/media/icons/not_connected_icon16.png" width="16" height="16" title="Unload"></button><button class="enabled" id="showdocs"><img src="/_admin/html/media/icons/zoom_icon16.png" width="16" height="16" title="Show Documents"></button><button class="enabled" id="edit" title="Edit"><img src="/_admin/html/media/icons/doc_edit_icon16.png" width="16" height="16"></button>',
|
||||
val.id, val.name, tempStatus, bytesToSize(size*1024), alive]);
|
||||
}
|
||||
else if (tempStatus == 4) {
|
||||
tempStatus = "in the process of being unloaded";
|
||||
items.push(["", val.id, val.name, tempStatus, "", ""]);
|
||||
items.push(['<button id="delete"><img src="/_admin/html/media/icons/round_minus_icon16_nofunction.png" class="nofunction" width="16" height="16"></button><button class="enabled" id="load"><img src="/_admin/html/media/icons/connect_icon16.png" width="16" height="16"></button><button><img src="/_admin/html/media/icons/zoom_icon16_nofunction.png" width="16" height="16" class="nofunction"></img></button><button><img src="/_admin/html/media/icons/doc_edit_icon16_nofunction.png" width="16" height="16" class="nofunction"></img></button>',
|
||||
val.id, val.name, tempStatus, "", ""]);
|
||||
}
|
||||
else if (tempStatus == 5) {
|
||||
tempStatus = "deleted";
|
||||
|
@ -2169,7 +2186,7 @@ $('#submitDocPageInput').live('click', function () {
|
|||
$(".prettify").snippet("javascript", {style: "nedit", menu: false, startText: false, transparent: true, showNum: false});
|
||||
collectionCurrentPage = enteredPage;
|
||||
$('#documents_status').text("Showing page " + enteredPage + " of " + totalCollectionCount);
|
||||
return 0;
|
||||
return false;
|
||||
},
|
||||
error: function(data) {
|
||||
}
|
||||
|
@ -2178,15 +2195,15 @@ $('#submitDocPageInput').live('click', function () {
|
|||
|
||||
else {
|
||||
console.log("out of reach");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
catch(e) {
|
||||
alert("No valid Page");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
@ -2232,8 +2249,3 @@ function is_int(value){
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$('#docPageInput').submit(function() {
|
||||
alert('Handler for .submit() called.');
|
||||
return false;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue