mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 02:42:48 +00:00
Added file upload and dynamic blog post pages on index
This commit is contained in:
383
node_modules/mongo-express/views/collection.html
generated
vendored
Normal file
383
node_modules/mongo-express/views/collection.html
generated
vendored
Normal file
@@ -0,0 +1,383 @@
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block title %}{{ collectionName }}{% endblock %}
|
||||
|
||||
|
||||
{% block head %}
|
||||
<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 ($) {
|
||||
$('#tabs').tab();
|
||||
if (document.location.href.indexOf("query=") >= 0) {
|
||||
$('#tabs a[href="#advanced"]').tab('show')
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% if editorTheme != "default" %}
|
||||
<link href="{{ baseHref }}stylesheets/theme/{{ editorTheme }}.css" rel="stylesheet">
|
||||
{% endif %}
|
||||
|
||||
<style type="text/css">
|
||||
.CodeMirror-scroll {
|
||||
height: 120px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.modal-body .CodeMirror .CodeMirror-scroll {
|
||||
height: auto;
|
||||
min-height: 200px;
|
||||
overflow-y: hidden;
|
||||
overflow-x: auto;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block breadcrumb %}
|
||||
<li>
|
||||
<a href="">Home</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li>
|
||||
<a href="db/{{ dbName }}">{{ dbName }}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li class="active">
|
||||
{{ collectionName }}
|
||||
</li>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% 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>
|
||||
{% 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>
|
||||
</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>
|
||||
<br/>
|
||||
|
||||
<div class="modal fade" id="addDocument">
|
||||
<form method="post" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}">
|
||||
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">×</button>
|
||||
<h3>Add Document</h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<textarea id="document" name="document">{
|
||||
"_id": ObjectID()
|
||||
}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-error" data-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="icon-pencil icon-white"></i>
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$("#addDocument").modal("hide");
|
||||
var addDoc = CodeMirror.fromTextArea(document.getElementById('document'), {
|
||||
mode: { name: "javascript", json: true },
|
||||
indentUnit: 4,
|
||||
electricChars: true,
|
||||
matchBrackets: true,
|
||||
lineNumbers: true,
|
||||
theme: "{{ editorTheme }}"
|
||||
});
|
||||
</script>
|
||||
|
||||
{% if documents.length == 0 %}
|
||||
<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>
|
||||
</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 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 %}
|
||||
|
||||
|
||||
{#
|
||||
# Not very useful, since it doesn't show correct index names
|
||||
# Could use db.coll.getIndexes(), but that is an extra query on every collection page
|
||||
<h2>Indexes</h2>
|
||||
{% if stats.nindexes == 0 %}
|
||||
<p class="well">
|
||||
No indexes found.
|
||||
</p>
|
||||
{% else %}
|
||||
<table class="table table-bordered table-striped">
|
||||
{% for size in stats.indexSizes %}
|
||||
<tr>
|
||||
<td>{{ loop.key }}</td>
|
||||
<td>{{ size }} bytes</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
#}
|
||||
|
||||
<div class="row">
|
||||
<div class="span5">
|
||||
|
||||
{% 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>
|
||||
<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>
|
||||
|
||||
<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." });
|
||||
|
||||
$( '.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>
|
||||
|
||||
</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>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block sidebar %}
|
||||
<div class="sidebar-nav">
|
||||
<ul class="nav nav-list">
|
||||
<li class="nav-header">Collection Stats</li>
|
||||
<li>
|
||||
<strong>Documents</strong>
|
||||
<span class="pull-right" id="collStatsCount">{{ stats.count }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Total doc size</strong>
|
||||
<span class="pull-right">{{ stats.size|convertBytes }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Average doc size</strong>
|
||||
<span class="pull-right">{{ stats.avgObjSize|convertBytes }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Pre-allocated size</strong>
|
||||
<span class="pull-right">{{ stats.storageSize|convertBytes }}</span>
|
||||
</li>
|
||||
<li> </li>
|
||||
<li>
|
||||
<strong>Indexes</strong>
|
||||
<span class="pull-right">{{ stats.nindexes }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Total index size</strong>
|
||||
<span class="pull-right">{{ stats.totalIndexSize|convertBytes }}</span>
|
||||
</li>
|
||||
<li> </li>
|
||||
<li>
|
||||
<strong>Padding factor</strong>
|
||||
<span class="pull-right">{{ stats.paddingFactor }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Extents</strong>
|
||||
<span class="pull-right">{{ stats.numExtents }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
143
node_modules/mongo-express/views/database.html
generated
vendored
Normal file
143
node_modules/mongo-express/views/database.html
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block title %}{{ dbName }}{% endblock %}
|
||||
|
||||
{% block breadcrumb %}
|
||||
<li>
|
||||
<a href="">Home</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li class="active">
|
||||
{{ dbName }}
|
||||
</li>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% 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>
|
||||
<td>
|
||||
<h2>Collections</h2>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/updateCollections" class="btn btn-primary">
|
||||
<i class="icon-refresh icon-white"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="table table-bordered table-striped table-condensed">
|
||||
{% for c in colls %}
|
||||
<tr>
|
||||
<td class="span2">
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/{{ c }}" class="btn btn-success span2">
|
||||
<i class="icon-list-alt icon-white"></i> 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><h3><a href="{{ baseHref }}db/{{ dbName }}/{{ c }}">{{ c }}</a></h3></td>
|
||||
{% if !settings.read_only %}
|
||||
<td class="span2">
|
||||
<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>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<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>
|
||||
|
||||
{% endblock %}
|
||||
88
node_modules/mongo-express/views/document.html
generated
vendored
Normal file
88
node_modules/mongo-express/views/document.html
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block title %}{{ document._id|to_string }}{% endblock %}
|
||||
|
||||
|
||||
{% block head %}
|
||||
<link href="{{ baseHref }}stylesheets/codemirror.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="{{ baseHref }}javascripts/codemirror-compressed.js"></script>
|
||||
|
||||
{% if editorTheme != "default" %}
|
||||
<link href="{{ baseHref }}stylesheets/theme/{{ editorTheme }}.css" rel="stylesheet">
|
||||
{% endif %}
|
||||
|
||||
<style type="text/css">
|
||||
.CodeMirror-scroll {
|
||||
height: auto;
|
||||
overflow-y: hidden;
|
||||
overflow-x: auto;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block breadcrumb %}
|
||||
<li>
|
||||
<a href="">Home</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ baseHref }}db/{{ dbName }}">{{ dbName }}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}">{{ collectionName }}</a>
|
||||
<span class="divider">/</span>
|
||||
</li>
|
||||
<li class="active">
|
||||
{{ document._id|to_string }}
|
||||
</li>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form method="POST" action="{{ baseHref }}db/{{ dbName }}/{{ collectionName }}/{{ document._id|to_string|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()"#}>
|
||||
<i class="icon-pencil icon-white"></i>
|
||||
Save
|
||||
</button>
|
||||
<br /><br />
|
||||
{% endif %}
|
||||
|
||||
<textarea class="span9" id="document" name="document"{% if settings.read_only %} readonly="readonly"{% endif %}>{{ docString }}</textarea>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
var doc = CodeMirror.fromTextArea(document.getElementById('document'), {
|
||||
mode: { name: "javascript", json: true },
|
||||
indentUnit: 4,
|
||||
lineNumbers: true,
|
||||
autoClearEmptyLines: true,
|
||||
matchBrackets: true,
|
||||
{% if settings.read_only %}
|
||||
readOnly: true,
|
||||
{% endif %}
|
||||
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;
|
||||
}
|
||||
}
|
||||
#}
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
89
node_modules/mongo-express/views/index.html
generated
vendored
Normal file
89
node_modules/mongo-express/views/index.html
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block title %}Home{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if info == false %}
|
||||
|
||||
<h2>Server Status</h2>
|
||||
<p>
|
||||
Turn on admin in config.js to view server stats!
|
||||
</p>
|
||||
|
||||
{% else %}
|
||||
|
||||
<h2>Server Status</h2>
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<td class="span2"><strong>Hostname</strong></td>
|
||||
<td class="span3" id="dbHost">{{ info.host }}</td>
|
||||
<td class="span2"><strong>MongoDB Version</strong></td>
|
||||
<td class="span3" id="dbVersion">{{ info.version }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Uptime</strong></td>
|
||||
<td>{{ info.uptime }} seconds {% if info.uptime > 86400 %} ({{ Math.floor( info.uptime/86400 ) }} days) {% endif %}</td>
|
||||
<td><strong>Server Time</strong></td>
|
||||
<td>{{ info.localTime|date('r') }}</td>
|
||||
</tr>
|
||||
<tr><td colspan="4"> </td></tr>
|
||||
<tr>
|
||||
<td><strong>Current Connections</strong></td>
|
||||
<td>{{ info.connections.current }}</td>
|
||||
<td><strong>Available Connections</strong></td>
|
||||
<td>{{ info.connections.available }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Active Clients</strong></td>
|
||||
<td>{{ info.globalLock.activeClients.total }}</td>
|
||||
<td><strong>Queued Operations</strong></td>
|
||||
<td>{{ info.globalLock.currentQueue.total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Clients Reading</strong></td>
|
||||
<td>{{ info.globalLock.activeClients.readers }}</td>
|
||||
<td><strong>Clients Writing</strong></td>
|
||||
<td>{{ info.globalLock.activeClients.writers}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Read Lock Queue</strong></td>
|
||||
<td>{{ info.globalLock.currentQueue.readers }}</td>
|
||||
<td><strong>Write Lock Queue</strong></td>
|
||||
<td>{{ info.globalLock.currentQueue.writers}}</td>
|
||||
</tr>
|
||||
<tr><td colspan="4"> </td></tr>
|
||||
<tr>
|
||||
<td><strong>Disk Flushes</strong></td>
|
||||
<td>{{ info.backgroundFlushing.flushes }}</td>
|
||||
<td><strong>Last Flush</strong></td>
|
||||
<td>{{ info.backgroundFlushing.last_finished|date('r') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Time Spent Flushing</strong></td>
|
||||
<td>{{ info.backgroundFlushing.total_ms }} ms</td>
|
||||
<td><strong>Average Flush Time</strong></td>
|
||||
<td>{{ info.backgroundFlushing.average_ms }} ms</td>
|
||||
</tr>
|
||||
<tr><td colspan="4"> </td></tr>
|
||||
<tr>
|
||||
<td><strong>Total Inserts</strong></td>
|
||||
<td>{{ info.opcounters.insert }}</td>
|
||||
<td><strong>Total Queries</strong></td>
|
||||
<td>{{ info.opcounters.query}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Total Updates</strong></td>
|
||||
<td>{{ info.opcounters.update}}</td>
|
||||
<td><strong>Total Deletes</strong></td>
|
||||
<td>{{ info.opcounters.delete}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{#
|
||||
# Still need to add global lock time stats and replica set stats
|
||||
#}
|
||||
|
||||
{% endblock %}
|
||||
128
node_modules/mongo-express/views/layout.html
generated
vendored
Normal file
128
node_modules/mongo-express/views/layout.html
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="{{ baseHref }}">
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}Index{% endblock %} - Mongo Express</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<link href="{{ baseHref }}stylesheets/bootstrap.css" rel="stylesheet">
|
||||
<link href="{{ baseHref }}stylesheets/style.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-top: 60px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
.sidebar-nav a {
|
||||
display: inline-block;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.tooltip-inner {
|
||||
max-width: 500px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link href="{{ baseHref }}stylesheets/bootstrap-responsive.min.css" rel="stylesheet">
|
||||
<script src="{{ baseHref }}javascripts/jquery-1.7.2.min.js"></script>
|
||||
<script src="{{ baseHref }}javascripts/bootstrap.min.js"></script>
|
||||
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="">Mongo Express</a>
|
||||
<div class="nav-collapse">
|
||||
<ul class="nav">
|
||||
<li><a href="">Home</a></li>
|
||||
{#<li><a href="cmd">Command Line</a></li>#}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="span3">
|
||||
<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>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% block sidebar %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="span9">
|
||||
<ul class="breadcrumb">
|
||||
{% block breadcrumb %}
|
||||
<li class="active">
|
||||
Home
|
||||
</li>
|
||||
{% endblock %}
|
||||
</ul>
|
||||
|
||||
<div class="page-header">
|
||||
<h1 id="pageTitle">{{ title }}</h1>
|
||||
</div>
|
||||
|
||||
{% if messageSuccess %}
|
||||
<div class="alert alert-success">
|
||||
<button class="close" data-dismiss="alert">×</button>
|
||||
<strong>{{ messageSuccess }}</strong>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if messageError %}
|
||||
<div class="alert alert-error">
|
||||
<button class="close" data-dismiss="alert">×</button>
|
||||
<strong>{{ messageError }}</strong>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".sidebar-nav").find("a").each(function(){
|
||||
if ($(this).text().length > 20) {
|
||||
$(this).tooltip({
|
||||
title: $(this).text(),
|
||||
delay: { show: 500, hide: 100 }
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user