mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
425
node_modules/mongo-express/views/collection.html
generated
vendored
425
node_modules/mongo-express/views/collection.html
generated
vendored
@@ -7,11 +7,12 @@
|
||||
<link href="{{ baseHref }}stylesheets/codemirror.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="{{ baseHref }}javascripts/codemirror-compressed.js"></script>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function ($) {
|
||||
'use strict';
|
||||
jQuery(document).ready(function ($) {
|
||||
$('#tabs').tab();
|
||||
if (document.location.href.indexOf("query=") >= 0) {
|
||||
$('#tabs a[href="#advanced"]').tab('show')
|
||||
}
|
||||
if (document.location.href.indexOf('query=') >= 0) {
|
||||
$('#tabs a[href="#advanced"]').tab('show');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% if editorTheme != "default" %}
|
||||
@@ -53,49 +54,49 @@
|
||||
{% block content %}
|
||||
|
||||
{% if !settings.read_only %}
|
||||
<p>
|
||||
<a data-toggle="modal" href="#addDocument" class="btn btn-success btn-large">
|
||||
<i class="icon-file icon-white"></i>
|
||||
New Document
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<a data-toggle="modal" href="#addDocument" class="btn btn-success btn-large input-block-level">
|
||||
<i class="icon-file icon-white"></i>
|
||||
New Document
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
|
||||
<li class="active"><a href="#simple" data-toggle="tab">Simple</a></li>
|
||||
<li><a href="#advanced" data-toggle="tab">Advanced</a></li>
|
||||
<li class="active"><a href="#simple" data-toggle="tab">Simple</a></li>
|
||||
<li><a href="#advanced" data-toggle="tab">Advanced</a></li>
|
||||
</ul>
|
||||
<div id="my-tab-content" class="tab-content">
|
||||
<div class="tab-pane active" id="simple">
|
||||
<form class="well form-inline" method="get" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}">
|
||||
<div class="input-prepend">
|
||||
<input class="input-medium" type="text" id="key" name="key" placeholder="Key" title="Key" value="{{ key }}">
|
||||
<input class="input-medium" type="text" id="value" name="value" placeholder="Value" title="Value" value="{{ value }}">
|
||||
<select name="type" class="input-small">
|
||||
<option value="S" {% if type == 'S' %}selected {% endif %}>String</option>
|
||||
<option value="J" {% if type == 'J' %}selected {% endif %}>JSON, bool</option>
|
||||
<option value="N" {% if type == 'N' %}selected {% endif %}>Number</option>
|
||||
<option value="O" {% if type == 'O' %}selected {% endif %}>ObjectID</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary pull-right">
|
||||
<i class="icon-search icon-white"></i>
|
||||
Find
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="advanced">
|
||||
<form class="well form-inline" method="get" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}">
|
||||
<div class="input-prepend">
|
||||
<textarea class="input-medium" style="width: 350px; height: 150px" id="query" name="query" placeholder="Query" title="Query">{{ query }}</textarea>
|
||||
<textarea class="input-medium" style="width: 350px; height: 150px" id="fields" name="fields" placeholder="Fields" title="Fields">{{ fields }}</textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary pull-right">
|
||||
<i class="icon-search icon-white"></i>
|
||||
Find
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane active" id="simple">
|
||||
<form class="well form-inline" method="get" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}">
|
||||
<div class="input-prepend">
|
||||
<input class="input-medium" type="text" id="key" name="key" placeholder="Key" title="Key" value="{{ key }}">
|
||||
<input class="input-medium" type="text" id="value" name="value" placeholder="Value" title="Value" value="{{ value }}">
|
||||
<select name="type" class="input-small">
|
||||
<option value="S" {% if type == 'S' %}selected {% endif %}>String</option>
|
||||
<option value="J" {% if type == 'J' %}selected {% endif %}>JSON, bool</option>
|
||||
<option value="N" {% if type == 'N' %}selected {% endif %}>Number</option>
|
||||
<option value="O" {% if type == 'O' %}selected {% endif %}>ObjectID</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary pull-right">
|
||||
<i class="icon-search icon-white"></i>
|
||||
Find
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="advanced">
|
||||
<form class="well form-inline" method="get" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}">
|
||||
<div class="input-prepend">
|
||||
<textarea class="input-medium" style="width: 350px; height: 150px" id="query" name="query" placeholder="Query" title="Query">{{ query }}</textarea>
|
||||
<textarea class="input-medium" style="width: 350px; height: 150px" id="fields" name="fields" placeholder="Fields" title="Fields">{{ fields }}</textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary pull-right">
|
||||
<i class="icon-search icon-white"></i>
|
||||
Find
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
@@ -125,109 +126,123 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$("#addDocument").modal("hide");
|
||||
$('#addDocument').modal('hide');
|
||||
var addDoc = CodeMirror.fromTextArea(document.getElementById('document'), {
|
||||
mode: { name: "javascript", json: true },
|
||||
mode: { name: 'javascript', json: true },
|
||||
indentUnit: 4,
|
||||
electricChars: true,
|
||||
matchBrackets: true,
|
||||
lineNumbers: true,
|
||||
theme: "{{ editorTheme }}"
|
||||
theme: '{{ editorTheme }}'
|
||||
});
|
||||
</script>
|
||||
|
||||
{% if documents.length == 0 %}
|
||||
<p class="well">
|
||||
No documents found.
|
||||
</p>
|
||||
<p class="well">
|
||||
No documents found.
|
||||
</p>
|
||||
{% else %}
|
||||
|
||||
{% if collectionName != 'system.indexes' %}
|
||||
<script type="text/javascript">
|
||||
function loadDocument(id) {
|
||||
location.href = '{{ baseHref }}db/{{ dbName }}/{{ collectionName }}/' + encodeURIComponent(id);
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<ul class="pager span7">
|
||||
<li class="previous"><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip=0&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">← First</a></li>
|
||||
<li{% if prev.skip < 0 %} class="disabled"{% endif %}>
|
||||
<a{% if prev.skip >= 0 %} href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ prev.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}"{% endif %}>← Prev</a>
|
||||
</li>
|
||||
|
||||
<li{% if next.skip >= stats.count %} class="disabled"{% endif %}>
|
||||
<a{% if next.skip < stats.count %} href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ next.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}"{% endif %}>Next →</a>
|
||||
</li>
|
||||
|
||||
<li class="next"><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ last }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">Last →</a></li>
|
||||
</ul>
|
||||
|
||||
{% for document in documents %}
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
<textarea readonly="readonly" id="doc_{{ loop.index }}" name="doc_{{ loop.index }}">{{ document }}</textarea>
|
||||
<p> </p>
|
||||
|
||||
<script>
|
||||
var doc_{{ loop.index }} = CodeMirror.fromTextArea(document.getElementById('doc_{{ loop.index }}'), {
|
||||
mode: { name: "javascript", json: true },
|
||||
readOnly: true,
|
||||
indentUnit: 4,
|
||||
theme: "{{ editorTheme }}",
|
||||
lineNumbers: true
|
||||
{%- if collectionName != 'system.indexes' && collectionName != 'system.users' %},
|
||||
onFocus: function() { loadDocument('{{ docs[loop.index0]._id|to_string }}') }
|
||||
{%- endif %}
|
||||
});
|
||||
<script type="text/javascript">
|
||||
function loadDocument(id) {
|
||||
location.href = '{{ baseHref }}db/{{ dbName }}/{{ collectionName }}/' + encodeURIComponent(id);
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
{% if !settings.read_only %}
|
||||
<div class="span1">
|
||||
<br /><br />
|
||||
<form method="POST" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}/{{ docs[loop.index0]._id|to_string|url_encode }}">
|
||||
<input type="hidden" name="_method" value="delete">
|
||||
<button type="submit" class="btn btn-danger btn-mini">
|
||||
<i class="icon-remove icon-white"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="pagination pagination-centered span7">
|
||||
<ul>
|
||||
{%- if prev2.skip >= 0 %}
|
||||
<li><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ prev2.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ prev2.page }}</a></li>
|
||||
{% else %}
|
||||
<li><a> </a></li>
|
||||
{%- endif %}
|
||||
{% if pagination %}
|
||||
<ul class="pager span7">
|
||||
<li class="previous"><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip=0&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">← First</a></li>
|
||||
<li{% if prev.skip < 0 %} class="disabled"{% endif %}>
|
||||
<a{% if prev.skip >= 0 %} href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ prev.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}"{% endif %}>← Prev</a>
|
||||
</li>
|
||||
|
||||
{%- if prev.skip >= 0 %}
|
||||
<li><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ prev.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ prev.page }}</a></li>
|
||||
{% else %}
|
||||
<li><a> </a></li>
|
||||
{%- endif %}
|
||||
<li{% if next.skip >= stats.count %} class="disabled"{% endif %}>
|
||||
<a{% if next.skip < stats.count %} href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ next.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}"{% endif %}>Next →</a>
|
||||
</li>
|
||||
|
||||
<li class="active"><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ here }}</a></li>
|
||||
|
||||
{%- if next.skip < stats.count %}
|
||||
<li><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ next.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ next.page }}</a></li>
|
||||
{% else %}
|
||||
<li><a> </a></li>
|
||||
{% endif %}
|
||||
|
||||
{%- if next2.skip < stats.count %}
|
||||
<li><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ next2.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ next2.page }}</a></li>
|
||||
{% else %}
|
||||
<li><a> </a></li>
|
||||
{% endif %}
|
||||
<li class="next"><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ last }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">Last →</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
<div class="tableWrapper">
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
{% for column in columns %}
|
||||
<th>{{column}}</th>
|
||||
{% endfor %}
|
||||
<th>Del</th>
|
||||
</tr>
|
||||
{% for document in docs %}
|
||||
<tr onclick="loadDocument( '{{ docs[loop.index0]._id | json | safe | url_encode }}')">
|
||||
{% for column in columns %}
|
||||
<td>
|
||||
{% if document[column] == "" %}
|
||||
{{column}} is empty for {{document["_id"]| to_display}}
|
||||
{% else %}
|
||||
{% if !document[column] %}
|
||||
{% if column|is_embeddedDocumentNotation %}
|
||||
{{edKey(document, column)}}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{document[column] | to_display | safe}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% if !settings.read_only %}
|
||||
<td>
|
||||
<div class="span1">
|
||||
<form method="POST" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}/{{ docs[loop.index0]._id| json | safe | url_encode }}">
|
||||
<input type="hidden" name="_method" value="delete">
|
||||
<button type="submit" class="btn btn-danger btn-mini">
|
||||
<i class="icon-remove icon-white"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if pagination %}
|
||||
<div class="pagination pagination-centered span7">
|
||||
<ul>
|
||||
{%- if prev2.skip >= 0 %}
|
||||
<li><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ prev2.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ prev2.page }}</a></li>
|
||||
{% else %}
|
||||
<li><a> </a></li>
|
||||
{%- endif %}
|
||||
|
||||
{%- if prev.skip >= 0 %}
|
||||
<li><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ prev.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ prev.page }}</a></li>
|
||||
{% else %}
|
||||
<li><a> </a></li>
|
||||
{%- endif %}
|
||||
|
||||
<li class="active"><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ here }}</a></li>
|
||||
|
||||
{%- if next.skip < stats.count %}
|
||||
<li><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ next.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ next.page }}</a></li>
|
||||
{% else %}
|
||||
<li><a> </a></li>
|
||||
{% endif %}
|
||||
|
||||
{%- if next2.skip < stats.count %}
|
||||
<li><a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}?skip={{ next2.skip }}&key={{ key }}&value={{ value }}&type={{ type }}&query={{ query }}&fields= {{ fields }}">{{ next2.page }}</a></li>
|
||||
{% else %}
|
||||
<li><a> </a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{#
|
||||
# Not very useful, since it doesn't show correct index names
|
||||
@@ -250,96 +265,104 @@ No indexes found.
|
||||
#}
|
||||
|
||||
<div class="row">
|
||||
<div class="span5">
|
||||
{% if !settings.read_only %}
|
||||
<div class="span9">
|
||||
<h2>Rename Collection</h2>
|
||||
<form method="POST" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}" class="well form-inline">
|
||||
<input type="hidden" name="_method" value="put">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">{{ dbName }} . </span>
|
||||
<input class="input-medium" type="text" id="collection" name="collection" placeholder="{{ collectionName }}">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="icon-tag icon-white"></i>
|
||||
Rename
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if !settings.read_only %}
|
||||
<h2>Rename Collection</h2>
|
||||
<form method="POST" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}" class="well form-inline">
|
||||
<input type="hidden" name="_method" value="put">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">{{ dbName }} . </span>
|
||||
<input class="input-medium" type="text" id="collection" name="collection" placeholder="{{ collectionName }}">
|
||||
<div class="span9">
|
||||
<h2>Export</h2>
|
||||
<div class="span4">
|
||||
<h3>Standard</h3>
|
||||
<div class="well">
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/export/{{ collectionName }}" class="btn btn-warning span2">
|
||||
<i class="icon-download icon-white"></i> Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="span4">
|
||||
<h3>--jsonArray</h3>
|
||||
<div class="well">
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/expArr/{{ collectionName }}" class="btn btn-warning span2">
|
||||
<i class="icon-download icon-white"></i> Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="icon-tag icon-white"></i>
|
||||
Rename
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="span4">
|
||||
|
||||
<h2>Delete Collection</h2>
|
||||
<form method="POST" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}" id="db-{{ dbName }}-{{ collectionName }}" class="well">
|
||||
<input type="hidden" name="_method" value="delete">
|
||||
<input type="submit" class="hidden" />
|
||||
<button class="btn btn-danger deleteButton" title="Warning" collection-name="{{ collectionName }}" childof="db-{{ dbName }}-{{ collectionName }}">
|
||||
<i class="icon-trash icon-white"></i>
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
{% if !settings.read_only %}
|
||||
<div class="span9">
|
||||
<h2>Delete Collection</h2>
|
||||
<form method="POST" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}" id="db-{{ dbName }}-{{ collectionName }}" class="well">
|
||||
<input type="hidden" name="_method" value="delete">
|
||||
<input type="submit" class="hidden" />
|
||||
<button class="btn btn-danger deleteButton" title="Warning" collection-name="{{ collectionName }}" childof="db-{{ dbName }}-{{ collectionName }}">
|
||||
<i class="icon-trash icon-white"></i>
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$( document ).ready( function() {
|
||||
$( '.deleteButton' ).popover({ placement: "left", title: "Warning", content: "Are you sure you want to delete this collection? All documents will be deleted." });
|
||||
'use strict';
|
||||
$(document).ready(function() {
|
||||
$('.deleteButton').popover({ placement: 'left', title: 'Warning', content: 'Are you sure you want to delete this collection? All documents will be deleted.' });
|
||||
|
||||
$( '.deleteButton' ).on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
var target = $( this );
|
||||
var parentForm = $( '#' + target.attr( 'childof' ) );
|
||||
$('.deleteButton').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
var target = $(this);
|
||||
var parentForm = $('#' + target.attr('childof'));
|
||||
|
||||
$( '#confirmation-input' ).attr( 'shouldbe', target.attr( 'collection-name' ) );
|
||||
$( '#modal-collection-name' ).text( target.attr( 'collection-name' ) );
|
||||
$( '#confirm-deletion' ).modal({ backdrop: 'static', keyboard: false })
|
||||
.one( 'click', '#delete', function() {
|
||||
var input = $( '#confirmation-input' );
|
||||
if ( input.val().toLowerCase() === input.attr( 'shouldbe' ).toLowerCase() ) {
|
||||
parentForm.trigger( 'submit' );
|
||||
} else {
|
||||
// wrong collection name
|
||||
}
|
||||
});
|
||||
$('#confirmation-input').attr('shouldbe', target.attr('collection-name'));
|
||||
$('#modal-collection-name').text(target.attr('collection-name'));
|
||||
$('#confirm-deletion').modal({ backdrop: 'static', keyboard: false })
|
||||
.one('click', '#delete', function() {
|
||||
var input = $('#confirmation-input');
|
||||
if (input.val().toLowerCase() === input.attr('shouldbe').toLowerCase()) {
|
||||
parentForm.trigger('submit');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="confirm-deletion" class="modal hide fade">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">Delete collection</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
Be careful! You are about to delete whole <strong><span id="modal-collection-name"></span></strong> collection.
|
||||
</p>
|
||||
<p>
|
||||
<label for="confirmation-input">Type the collection name to proceed.</label>
|
||||
<input type="text" id="confirmation-input" name="confirmation-input" shouldbe="" value="" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" data-dismiss="modal" class="btn" id="delete">Delete</button>
|
||||
<button type="button" data-dismiss="modal" class="btn btn-primary">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="span4">
|
||||
<h2>Export Collection</h2>
|
||||
<div class="well">
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/export/{{ collectionName }}" class="btn btn-warning span2">
|
||||
<i class="icon-download icon-white"></i> Export
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="confirm-deletion" class="modal hide fade">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">Delete collection</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
Be careful! You are about to delete whole <strong><span id="modal-collection-name"></span></strong> collection.
|
||||
</p>
|
||||
<p>
|
||||
<label for="confirmation-input">Type the collection name to proceed.</label>
|
||||
<input type="text" id="confirmation-input" name="confirmation-input" shouldbe="" value="" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" data-dismiss="modal" class="btn" id="delete">Delete</button>
|
||||
<button type="button" data-dismiss="modal" class="btn btn-primary">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
<div class="sidebar-nav">
|
||||
<ul class="nav nav-list">
|
||||
|
||||
197
node_modules/mongo-express/views/database.html
generated
vendored
197
node_modules/mongo-express/views/database.html
generated
vendored
@@ -14,67 +14,6 @@
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div class="stats">
|
||||
<h2>Database Stats</h2>
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<td class="span2"><strong>Collections (including system.namespaces)</strong></td>
|
||||
<td class="span3">{{ stats.collections }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Data Size</strong></td>
|
||||
<td>{{ stats.dataSize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Storage Size</strong></td>
|
||||
<td>{{ stats.storageSize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>File Size (on disk)</strong></td>
|
||||
<td>{{ stats.fileSize }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if !settings.read_only %}
|
||||
<h2>Create Collection</h2>
|
||||
<form class="well form-inline" method="POST">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">{{ dbName }} . </span>
|
||||
<input class="input-medium" type="text" id="collection" name="collection" placeholder="Collection Name" title="Collection Name">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="icon-folder-open icon-white"></i>
|
||||
Create collection
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$( document ).ready( function() {
|
||||
$( '#collection' ).popover({ content: "Collection names must begin with a letter or underscore, and can contain only letters, numbers, underscores and dots." });
|
||||
|
||||
$( '.deleteButton' ).popover({ placement: "left", title: "Warning", content: "Are you sure you want to delete this collection? All documents will be deleted." });
|
||||
|
||||
$( '.deleteButton' ).on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
var target = $( this );
|
||||
var parentForm = $( '#' + target.attr( 'childof' ) );
|
||||
|
||||
$( '#confirmation-input' ).attr( 'shouldbe', target.attr( 'collection-name' ) );
|
||||
$( '#modal-collection-name' ).text( target.attr( 'collection-name' ) );
|
||||
$( '#confirm-deletion' ).modal({ backdrop: 'static', keyboard: false })
|
||||
.one( 'click', '#delete', function() {
|
||||
var input = $( '#confirmation-input' );
|
||||
if ( input.val().toLowerCase() === input.attr( 'shouldbe' ).toLowerCase() ) {
|
||||
parentForm.trigger( 'submit' );
|
||||
} else {
|
||||
// wrong collection name
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
@@ -92,26 +31,31 @@
|
||||
<table class="table table-bordered table-striped table-condensed">
|
||||
{% for c in colls %}
|
||||
<tr>
|
||||
<td class="span2">
|
||||
<td class="span1">
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/{{ c }}" class="btn btn-success span2">
|
||||
<i class="icon-list-alt icon-white"></i> View
|
||||
<i class="icon-list-alt icon-white"></i><br>View
|
||||
</a>
|
||||
</td>
|
||||
<td class="span2">
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/export/{{ c }}" class="btn btn-warning span2">
|
||||
<i class="icon-download icon-white"></i> Export
|
||||
</a>
|
||||
</td>
|
||||
<td class="span1">
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/export/{{ c }}" class="btn btn-warning span1">
|
||||
<i class="icon-download icon-white"></i> Export
|
||||
</a>
|
||||
</td>
|
||||
<td class="span1">
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/expArr/{{ c }}" class="btn btn-warning span1">
|
||||
<i class="icon-download icon-white"></i> [JSON]
|
||||
</a>
|
||||
</td>
|
||||
<td><h3><a href="{{ baseHref }}db/{{ dbName }}/{{ c }}">{{ c }}</a></h3></td>
|
||||
{% if !settings.read_only %}
|
||||
<td class="span2">
|
||||
<td class="span1">
|
||||
<form method="POST" id="db-{{ dbName }}-{{ c }}" action="{{ baseHref }}db/{{ dbName }}/{{ c }}" style="margin: 0px;">
|
||||
<input type="hidden" name="_method" value="delete">
|
||||
<button type="submit" class="hidden"></button>
|
||||
</form>
|
||||
<button class="btn btn-danger span2 deleteButton" collection-name="{{ c }}" childof="db-{{ dbName }}-{{ c }}">
|
||||
<i class="icon-trash icon-white"></i>
|
||||
Delete
|
||||
<button class="btn btn-danger span1 deleteButton" collection-name="{{ c }}" childof="db-{{ dbName }}-{{ c }}">
|
||||
<i class="icon-trash icon-white"></i><br>
|
||||
Del
|
||||
</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
@@ -140,4 +84,113 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if !settings.read_only %}
|
||||
<h2>Create Collection</h2>
|
||||
<form class="well form-inline" method="POST">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">{{ dbName }} . </span>
|
||||
<input class="input-medium" type="text" id="collection" name="collection" placeholder="Collection Name" title="Collection Name">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="icon-folder-open icon-white"></i>
|
||||
Create collection
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
'use strict';
|
||||
$(document).ready(function() {
|
||||
$('#collection').popover({
|
||||
content: 'Collection names must begin with a letter or underscore, and can contain only letters, numbers, underscores and dots.',
|
||||
});
|
||||
|
||||
$('.deleteButton').popover({
|
||||
placement: 'left', title: 'Warning', content: 'Are you sure you want to delete this collection? All documents will be deleted.',
|
||||
});
|
||||
|
||||
$('.deleteButton').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
var target = $(this);
|
||||
var parentForm = $('#' + target.attr('childof'));
|
||||
|
||||
$('#confirmation-input').attr('shouldbe', target.attr('collection-name'));
|
||||
$('#modal-collection-name').text(target.attr('collection-name'));
|
||||
$('#confirm-deletion').modal({ backdrop: 'static', keyboard: false })
|
||||
.one('click', '#delete', function() {
|
||||
var input = $('#confirmation-input');
|
||||
if (input.val().toLowerCase() === input.attr('shouldbe').toLowerCase()) {
|
||||
parentForm.trigger('submit');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<div class="stats">
|
||||
<h2>Database Stats</h2>
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<td class="span2"><strong>Collections (incl. system.namespaces)</strong></td>
|
||||
<td class="span3">{{ stats.collections }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Data Size</strong></td>
|
||||
<td>{{ stats.dataSize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Storage Size</strong></td>
|
||||
<td>{{ stats.storageSize }}</td>
|
||||
</tr>
|
||||
{% if stats.fileSize %}
|
||||
<tr>
|
||||
<td><strong>File Size (on disk)</strong></td>
|
||||
<td>{{ stats.fileSize }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if stats.avgObjSize %}
|
||||
<tr>
|
||||
<td><strong>Avg Obj Size #</strong></td>
|
||||
<td>{{ stats.avgObjSize }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if stats.objects %}
|
||||
<tr>
|
||||
<td><strong>Objects #</strong></td>
|
||||
<td>{{ stats.objects }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if stats.numExtents %}
|
||||
<tr>
|
||||
<td><strong>Extents #</strong></td>
|
||||
<td>{{ stats.numExtents }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if stats.extentFreeListNum %}
|
||||
<tr>
|
||||
<td><strong>Extents Free List</strong></td>
|
||||
<td>{{ stats.extentFreeListNum }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if stats.indexes %}
|
||||
<tr>
|
||||
<td><strong>Indexes #</strong></td>
|
||||
<td>{{ stats.indexes }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if stats.indexSize %}
|
||||
<tr>
|
||||
<td><strong>Index Size</strong></td>
|
||||
<td>{{ stats.indexSize }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if stats.dataFileVersion %}
|
||||
<tr>
|
||||
<td><strong>Data File Version</strong></td>
|
||||
<td>{{ stats.dataFileVersion }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
35
node_modules/mongo-express/views/document.html
generated
vendored
35
node_modules/mongo-express/views/document.html
generated
vendored
@@ -43,10 +43,10 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form method="POST" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}/{{ document._id|to_string|url_encode }}">
|
||||
<form method="POST" id="documentEditForm" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}/{{ document._id | json | safe | url_encode }}">
|
||||
{% if !settings.read_only %}
|
||||
<input type="hidden" name="_method" value="put">
|
||||
<button type="submit" class="btn btn-success btn-large"{# onclick="return checkJSON()"#}>
|
||||
<button type="submit" class="btn btn-success btn-large" onclick="return onSubmitClick()">
|
||||
<i class="icon-pencil icon-white"></i>
|
||||
Save
|
||||
</button>
|
||||
@@ -69,20 +69,25 @@
|
||||
theme: "{{ editorTheme }}"
|
||||
});
|
||||
|
||||
{# This can check for valid JSON on the client side
|
||||
# Not used at the moment, since it doesn't allow BSON types
|
||||
function checkJSON() {
|
||||
var d = doc.getValue();
|
||||
|
||||
try {
|
||||
docJSON = JSON.parse(d);
|
||||
return true;
|
||||
} catch (err) {
|
||||
alert('This is not a valid document!');
|
||||
return false;
|
||||
}
|
||||
function onSubmitClick() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "{{ baseHref }}checkValid",
|
||||
data: {
|
||||
document: doc.getValue()
|
||||
},
|
||||
}).done(function(data) {
|
||||
console.log(data);
|
||||
if (data === 'Valid') {
|
||||
$('#documentInvalidJSON').remove();
|
||||
$('#documentEditForm').submit();
|
||||
} else if ($('#documentInvalidJSON').length === 0){
|
||||
$('#documentEditForm').parent().append('<div id="documentInvalidJSON" class="alert alert-error"><strong>Invalid JSON</strong></div>');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
#}
|
||||
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
36
node_modules/mongo-express/views/layout.html
generated
vendored
36
node_modules/mongo-express/views/layout.html
generated
vendored
@@ -56,23 +56,25 @@
|
||||
<div class="well sidebar-nav">
|
||||
<ul class="nav nav-list">
|
||||
{% for db in databases %}
|
||||
<li class="nav-header" onclick="$('#toggle_{{ db }}').collapse('toggle')">
|
||||
{{ db }}
|
||||
<i class="icon-chevron-down pull-right"></i>
|
||||
</li>
|
||||
<li><a href="{{ baseHref }}db/{{ db }}"><i class="icon-folder-open"></i> View Database</a></li>
|
||||
<ul class="unstyled collapse nav nav-list
|
||||
{%- if db == dbName %} in{% endif -%}
|
||||
" id="toggle_{{ db }}">
|
||||
{% for collection_db in collections -%}
|
||||
{% if loop.key == db -%}
|
||||
{% for collection in collection_db -%}
|
||||
<li><a href="{{ baseHref }}db/{{ db }}/{{ collection }}"><i class="icon-list-alt"></i> {{ collection }}</a></li>
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
<li class="divider"></li>
|
||||
<li class="nav-header" onclick="$('#toggle_{{ db }}').collapse('toggle')">
|
||||
{{ db }}
|
||||
<i class="icon-chevron-down pull-right"></i>
|
||||
</li>
|
||||
<li><a href="{{ baseHref }}db/{{ db }}"><i class="icon-folder-open"></i> View Database</a></li>
|
||||
<ul class="unstyled collapse nav nav-list
|
||||
{%- if db == dbName %} in{% endif -%}
|
||||
" id="toggle_{{ db }}">
|
||||
{% for collection_db in collections -%}
|
||||
{% if loop.key == db -%}
|
||||
{% for collection in collection_db -%}
|
||||
<li><a href="{{ baseHref }}db/{{ db }}/{{ collection }}"><i class="icon-list-alt"></i> {{ collection }}</a></li>
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{% if !loop.last %}
|
||||
<li class="divider"></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user