mirror of https://gitee.com/bigwinds/arangodb
logs pages
This commit is contained in:
parent
86a64db15d
commit
9fa57f4af0
|
@ -1,5 +1,27 @@
|
|||
#documentSourceBox {
|
||||
width: 100%;
|
||||
min-height: 400px;
|
||||
width: 885px;
|
||||
border: 1px solid black;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#saveSourceDoc, #tableView {
|
||||
float:right;
|
||||
margin-right: 10px;
|
||||
margin-top: 11px;
|
||||
margin-right: 22px;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
#saveSourceDoc:hover, #tableView:hover{
|
||||
opacity: 0.8;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#sourceDiv {
|
||||
margin-top: 10px;
|
||||
padding: 20px 20px 20px 20px;
|
||||
min-height: 400px;
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#tableDiv {
|
||||
margin-top: 10px;
|
||||
padding: 20px 20px 20px 20px;
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
#addDocumentLine, #sourceView {
|
||||
float:right;
|
||||
margin-right: 10px;
|
||||
margin-top: 11px;
|
||||
margin-right: 22px;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
#addDocumentLine:hover, #sourceView:hover{
|
||||
opacity: 0.8;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#deleteRow {
|
||||
border: medium none;
|
||||
padding-left: 10px;
|
||||
background-color: transparent;
|
||||
}
|
|
@ -1,3 +1,9 @@
|
|||
#deleteDoc, #documentsToolbar button {
|
||||
border: medium none;
|
||||
padding-left: 10px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#documentsPlaceholder {
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
padding-bottom: 25px;
|
||||
}
|
||||
|
||||
#logPages {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
min-height: 290px;
|
||||
}
|
||||
|
@ -27,7 +31,6 @@
|
|||
}
|
||||
|
||||
#logToolbar {
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
|
@ -51,11 +54,18 @@
|
|||
}
|
||||
|
||||
#logToolbar {
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
padding-top: 10px;
|
||||
float:right;
|
||||
background-color: rgba(255, 255, 255, 0) !important;
|
||||
}
|
||||
|
||||
#logToolbar button {
|
||||
float:right;
|
||||
border: medium none;
|
||||
padding-left: 10px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#logTableID thead, #infoTableID thead, #debugTableID thead, #critTableID thead, #warnTableID thead {
|
||||
background-color: rgba(255, 255, 255, 0.8) !important;
|
||||
border-bottom: 0 !important;
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
<button id="tableView" class="btn btn-primary">TableView</button>
|
||||
<button id="saveSourceDoc" class="btn btn-primary">Save</button>
|
||||
<textarea id="documentSourceBox" class="editBox"></textarea>
|
||||
<ul class="thumbnails2">
|
||||
<div id="transparentHeader">
|
||||
<img id="saveSourceDoc" class="plusIcon" class="pull-right" src="/_admin/html/img/saveIcon.png">
|
||||
<img id="tableView" class="plusIcon" class="pull-right" src="/_admin/html/img/tableView.png">
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<div id="sourceDiv">
|
||||
<textarea id="documentSourceBox" class="editBox"></textarea>
|
||||
</div>
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
<ul class="thumbnails2">
|
||||
<div id="transparentHeader">
|
||||
<img id="plusIcon" class="pull-right" src="/_admin/html/img/plus_icon.png">
|
||||
<img id="addDocumentLine" class="plusIcon" class="pull-right" src="/_admin/html/img/plus_icon.png">
|
||||
<img id="sourceView" class="plusIcon" class="pull-right" src="/_admin/html/img/sourceView.png">
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<button id="saveDocument" class="btn btn-primary">Save</button>
|
||||
<button id="addDocumentLine" class="btn btn-primary">Add row</button>
|
||||
<button id="sourceView" class="btn btn-primary">SourceView</button>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="display" id="documentTableID" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
<th>type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div id="tableDiv">
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="display" id="documentTableID" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
<th>type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
<table cellpadding="0" cellspacing="0" border="0" class="display" id="documentsTableID">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="th1" style="width:30px"></th>
|
||||
<th class="th2" style="width:150px">_id</th>
|
||||
<th class="th3" style="width:100px">_key</th>
|
||||
<th class="th4" style="width:80px">_rev</th>
|
||||
<th class="th5" style="width:400px">Content</th>
|
||||
<th class="th1" style="width:30px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
|
|
@ -67,10 +67,12 @@
|
|||
</div>
|
||||
|
||||
<div id="logToolbar">
|
||||
<button class="enabled" id="logTableID_first"><img src="/_admin/html/img/rnd_br_last_icon16.png"></button>
|
||||
<button class="enabled" id="logTableID_prev"><img src="/_admin/html/img/rnd_br_next_icon16.png"></button>
|
||||
<button class="enabled" id="logTableID_next"><img src="/_admin/html/img/rnd_br_prev_icon16.png"></button>
|
||||
<div id="logPages">
|
||||
</div>
|
||||
<button class="enabled" id="logTableID_last"><img src="/_admin/html/img/rnd_br_first_icon16.png"></button>
|
||||
<button class="enabled" id="logTableID_next"><img src="/_admin/html/img/rnd_br_prev_icon16.png"></button>
|
||||
<button class="enabled" id="logTableID_prev"><img src="/_admin/html/img/rnd_br_next_icon16.png"></button>
|
||||
<button class="enabled" id="logTableID_first"><img src="/_admin/html/img/rnd_br_last_icon16.png"></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -39,9 +39,12 @@ var collectionsView = Backbone.View.extend({
|
|||
this.render();
|
||||
}
|
||||
},
|
||||
|
||||
restrictToSearchPhrase: function() {
|
||||
var searchPhrase = this.searchPhrase;
|
||||
this.searchPhrase = $('#searchInput').val().replace(/(^\s+|\s+$)/g, '');
|
||||
if (searchPhrase === this.searchPhrase) {
|
||||
return;
|
||||
}
|
||||
this.render();
|
||||
},
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ var documentView = Backbone.View.extend({
|
|||
return ("<a class=\"sh_keyword\">" + value + "</a>");
|
||||
case 'object':
|
||||
if (value instanceof Array) {
|
||||
window.arangoDocumentStore.saveDocument();
|
||||
return ("<a class=\"sh_array\">" + self.escaped(JSON.stringify(value)) + "</a>");
|
||||
}
|
||||
else {
|
||||
|
@ -142,6 +143,7 @@ var documentView = Backbone.View.extend({
|
|||
result[row_data[1]] = JSON.parse(row_data[3]);
|
||||
}
|
||||
window.arangoDocumentStore.updateLocalDocument(result);
|
||||
this.saveDocument();
|
||||
},
|
||||
|
||||
makeEditable: function () {
|
||||
|
@ -170,7 +172,7 @@ var documentView = Backbone.View.extend({
|
|||
var test = self.getTypedValue(value);
|
||||
if (String(value) == String(oldContent)) {
|
||||
// no change
|
||||
return value2html(oldContent);
|
||||
return self.value2html(oldContent);
|
||||
}
|
||||
else {
|
||||
// change update hidden row
|
||||
|
|
|
@ -75,7 +75,7 @@ var documentsView = Backbone.View.extend({
|
|||
var self = a.currentTarget;
|
||||
var aPos = $(this.table).dataTable().fnGetPosition(self);
|
||||
var rowContent = $(this.table).dataTable().fnGetData(aPos);
|
||||
window.location.hash = "#collection/" + rowContent[0];
|
||||
window.location.hash = "#collection/" + rowContent[1];
|
||||
},
|
||||
|
||||
initTable: function (colid, pageid) {
|
||||
|
@ -107,11 +107,11 @@ var documentsView = Backbone.View.extend({
|
|||
var self = this;
|
||||
$.each(window.arangoDocumentsStore.models, function(key, value) {
|
||||
$(self.table).dataTable().fnAddData([
|
||||
'<button class="enabled" id="deleteDoc"><img src="/_admin/html/img/doc_delete_icon16.png" width="16" height="16"></button>',
|
||||
value.attributes.id,
|
||||
value.attributes.key,
|
||||
value.attributes.rev,
|
||||
'<pre class=prettify>' + self.cutByResolution(JSON.stringify(value.attributes.content)) + '</pre>',
|
||||
'<button class="enabled" id="deleteDoc"><img src="/_admin/html/img/doc_delete_icon16.png" width="16" height="16"></button>'
|
||||
'<pre class=prettify>' + self.cutByResolution(JSON.stringify(value.attributes.content)) + '</pre>'
|
||||
]);
|
||||
});
|
||||
$(".prettify").snippet("javascript", {style: "nedit", menu: false, startText: false, transparent: true, showNum: false});
|
||||
|
|
|
@ -129,10 +129,19 @@ var logsView = Backbone.View.extend({
|
|||
drawTable: function () {
|
||||
var self = this;
|
||||
$.each(window.arangoLogsStore.models, function(key, value) {
|
||||
$('#'+self.table).dataTable().fnAddData([value.attributes.level, value.attributes.text]);
|
||||
var convertedLog = self.convertLogStatus(value.attributes.level);
|
||||
$('#'+self.table).dataTable().fnAddData([convertedLog, value.attributes.text]);
|
||||
});
|
||||
$('#logPages').html('Showing Page: '+this.page+' of '+this.totalPages);
|
||||
},
|
||||
clearTable: function () {
|
||||
$('#'+this.table).dataTable().fnClearTable();
|
||||
},
|
||||
convertLogStatus: function (status) {
|
||||
if (status === 1) { return "Error" ;}
|
||||
else if (status === 2) { return "Warning" ;}
|
||||
else if (status === 3) { return "Info" ;}
|
||||
else if (status === 4) { return "Debug" ;}
|
||||
else { return "Unknown";}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue