mongo_browser 0.2.0.rc2 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -1
- data/.rspec +1 -1
- data/.travis.yml +6 -1
- data/CHANGELOG.md +15 -0
- data/{grunt.js → Gruntfile.js} +10 -8
- data/Procfile +1 -0
- data/README.md +44 -2
- data/Rakefile +1 -12
- data/app/assets/images/ajax-loader.gif +0 -0
- data/app/assets/javascripts/app/controllers/{breadcrumbs.js.coffee → breadcrumbs_controller.js.coffee} +4 -7
- data/app/assets/javascripts/app/controllers/collections/index_controller.js.coffee +38 -0
- data/app/assets/javascripts/app/controllers/collections/stats_controller.js.coffee +17 -0
- data/app/assets/javascripts/app/controllers/{databases.js.coffee → databases/index_controller.js.coffee} +11 -15
- data/app/assets/javascripts/app/controllers/databases/stats_controller.js.coffee +15 -0
- data/app/assets/javascripts/app/controllers/documents/index_controller.js.coffee +54 -0
- data/app/assets/javascripts/app/controllers/documents/show_controller.js.coffee +38 -0
- data/app/assets/javascripts/app/controllers/main_controller.js.coffee +15 -0
- data/app/assets/javascripts/app/controllers/servers/show_controller.js.coffee +17 -0
- data/app/assets/javascripts/app/directives.js.coffee +23 -0
- data/app/assets/javascripts/app/filters.js.coffee +14 -1
- data/app/assets/javascripts/app/modules/alerts.js.coffee +58 -0
- data/app/assets/javascripts/app/modules/pager.js.coffee +2 -2
- data/app/assets/javascripts/app/modules/spinner.js.coffee +29 -0
- data/app/assets/javascripts/app/modules/table_filter.js.coffee +4 -4
- data/app/assets/javascripts/app/resources.js.coffee +14 -8
- data/app/assets/javascripts/app/services.js.coffee +11 -33
- data/app/assets/javascripts/application.js.coffee +62 -34
- data/app/assets/javascripts/application.test.js.coffee +5 -0
- data/app/assets/javascripts/compiled_templates.js.coffee +1 -0
- data/app/assets/javascripts/vendor.js.coffee +0 -1
- data/app/assets/stylesheets/application.css.scss +36 -18
- data/{public/index.html → app/views/index.erb} +8 -8
- data/bin/mongo_browser +2 -13
- data/config.ru +3 -1
- data/lib/mongo_browser.rb +1 -0
- data/lib/mongo_browser/api.rb +11 -0
- data/lib/mongo_browser/api/collections.rb +34 -0
- data/lib/mongo_browser/api/databases.rb +32 -0
- data/lib/mongo_browser/api/documents.rb +37 -0
- data/lib/mongo_browser/api/mongo.rb +41 -0
- data/lib/mongo_browser/application.rb +8 -174
- data/lib/mongo_browser/application/development.rb +32 -0
- data/lib/mongo_browser/cli.rb +48 -0
- data/lib/mongo_browser/entities.rb +43 -0
- data/lib/mongo_browser/models/collection.rb +7 -12
- data/lib/mongo_browser/models/document.rb +5 -1
- data/lib/mongo_browser/models/pager.rb +22 -9
- data/lib/mongo_browser/version.rb +1 -1
- data/mongo_browser.gemspec +22 -15
- data/package.json +30 -0
- data/public/ng/templates/alerts.html +6 -0
- data/public/ng/templates/collections/index.html +39 -0
- data/public/ng/templates/collections/stats.html +18 -0
- data/public/ng/templates/databases/index.html +35 -0
- data/public/ng/templates/databases/stats.html +18 -0
- data/public/ng/templates/documents/index.html +40 -0
- data/public/ng/templates/documents/show.html +17 -0
- data/{app/assets → public/ng}/templates/pager.html +0 -0
- data/{app/assets/templates/server_info.html → public/ng/templates/server/show.html} +1 -1
- data/{app/assets → public/ng}/templates/table_filter.html +0 -0
- data/script/ci_all +5 -1
- data/script/ci_e2e +5 -2
- data/script/ci_javascripts +1 -1
- data/script/ci_rspec +1 -1
- data/spec/javascripts/app/controllers/{breadcrumbs_spec.js.coffee → breadcrumbs_controller_spec.js.coffee} +1 -1
- data/spec/javascripts/app/controllers/collections/index_controller_spec.js.coffee +95 -0
- data/spec/javascripts/app/controllers/collections/stats_controller_spec.js.coffee +34 -0
- data/spec/javascripts/app/controllers/databases/index_controller_spec.js.coffee +93 -0
- data/spec/javascripts/app/controllers/databases/stats_controller_spec.js.coffee +30 -0
- data/spec/javascripts/app/controllers/documents/index_controller_spec.js.coffee +108 -0
- data/spec/javascripts/app/controllers/documents/show_controller_spec.js.coffee +94 -0
- data/spec/javascripts/app/controllers/{main_spec.js.coffee → main_controller_spec.js.coffee} +2 -2
- data/spec/javascripts/app/controllers/{server_info_spec.js.coffee → server/show_controller_spec.js.coffee} +5 -6
- data/spec/javascripts/app/directives_spec.js.coffee +108 -24
- data/spec/javascripts/app/filters_spec.js.coffee +31 -5
- data/spec/javascripts/app/modules/alerts_spec.js.coffee +138 -0
- data/spec/javascripts/app/modules/dialogs_spec.js.coffee +1 -2
- data/spec/javascripts/app/modules/pager_spec.js.coffee +0 -1
- data/spec/javascripts/app/modules/spinner_spec.js.coffee +65 -0
- data/spec/javascripts/app/modules/table_filter_spec.js.coffee +9 -9
- data/spec/javascripts/app/resources_spec.js.coffee +99 -0
- data/spec/javascripts/app/services_spec.js.coffee +31 -71
- data/spec/javascripts/config/{testacular-e2e.conf.js → karma-e2e.conf.js} +1 -1
- data/spec/javascripts/config/{testacular.conf.js → karma.conf.js} +2 -3
- data/spec/javascripts/e2e/collection_stats_scenario.js.coffee +12 -0
- data/spec/javascripts/e2e/collections_scenario.js.coffee +59 -20
- data/spec/javascripts/e2e/database_stats_scenario.js.coffee +11 -0
- data/spec/javascripts/e2e/databases_scenario.js.coffee +37 -36
- data/spec/javascripts/e2e/document_show_scenario.js.coffee +31 -0
- data/spec/javascripts/e2e/documents_pagination_scenario.js.coffee +33 -0
- data/spec/javascripts/e2e/documents_scenario.js.coffee +43 -4
- data/spec/javascripts/e2e/server_info_scenario.js.coffee +8 -2
- data/spec/javascripts/helpers/mocks.js.coffee +2 -0
- data/spec/javascripts/helpers_e2e/dsl.js.coffee +20 -0
- data/spec/javascripts/lib/angular-mocks.js +64 -16
- data/spec/javascripts/lib/angular-scenario.js +724 -561
- data/spec/javascripts/runner.html +5 -5
- data/spec/lib/api/collections_spec.rb +62 -0
- data/spec/lib/api/databases_spec.rb +58 -0
- data/spec/lib/api/documents_spec.rb +135 -0
- data/spec/lib/api/mongo_spec.rb +27 -0
- data/spec/lib/cli_spec.rb +19 -0
- data/spec/lib/entities_spec.rb +39 -0
- data/spec/lib/models/collection_spec.rb +16 -10
- data/spec/lib/models/database_spec.rb +4 -4
- data/spec/lib/models/document_spec.rb +5 -5
- data/spec/lib/models/pager_spec.rb +20 -11
- data/spec/spec_helper.rb +7 -15
- data/spec/support/api_example_group.rb +45 -0
- data/spec/support/fixtures.rb +10 -6
- data/spec/support/matchers/expose.rb +18 -0
- data/vendor/assets/javascripts/angular/angular-bootstrap.js +1 -1
- data/vendor/assets/javascripts/angular/angular-resource.js +78 -56
- data/vendor/assets/javascripts/angular/angular-sanitize.js +3 -1
- data/vendor/assets/javascripts/angular/angular.js +720 -404
- metadata +323 -183
- data/app/assets/javascripts/app.js.coffee +0 -8
- data/app/assets/javascripts/app/controllers.js.coffee +0 -2
- data/app/assets/javascripts/app/controllers/alerts.js.coffee +0 -12
- data/app/assets/javascripts/app/controllers/collections.js.coffee +0 -40
- data/app/assets/javascripts/app/controllers/documents.js.coffee +0 -49
- data/app/assets/javascripts/app/controllers/main.js.coffee +0 -10
- data/app/assets/javascripts/app/controllers/server_info.js.coffee +0 -14
- data/app/assets/javascripts/templates.js.coffee +0 -1
- data/app/assets/javascripts/templates/.gitkeep +0 -0
- data/app/assets/templates/collections.html +0 -53
- data/app/assets/templates/databases.html +0 -32
- data/app/assets/templates/documents.html +0 -45
- data/config-e2e.ru +0 -20
- data/spec/features/collections_list_spec.rb +0 -64
- data/spec/features/documents_list_spec.rb +0 -139
- data/spec/features/server_info_spec.rb +0 -23
- data/spec/javascripts/app/controllers/alerts_spec.js.coffee +0 -36
- data/spec/javascripts/app/controllers/collections_spec.js.coffee +0 -78
- data/spec/javascripts/app/controllers/databases_spec.js.coffee +0 -55
- data/spec/javascripts/app/controllers/documents_spec.js.coffee +0 -62
- data/spec/javascripts/helpers_e2e/app_element.js.coffee +0 -6
- data/spec/support/feature_example_group.rb +0 -53
- data/spec/support/matchers/have_flash_message.rb +0 -16
- data/spec/support/mongod.rb +0 -91
- data/spec/support/mongodb.conf +0 -47
@@ -0,0 +1,48 @@
|
|
1
|
+
require "mongo_browser"
|
2
|
+
|
3
|
+
require "thor"
|
4
|
+
require "thin"
|
5
|
+
|
6
|
+
module MongoBrowser
|
7
|
+
RACK_CONFIG = File.join(File.dirname(__FILE__), "../..", "config.ru")
|
8
|
+
|
9
|
+
class CLI < Thor
|
10
|
+
desc :start, "Starts the application"
|
11
|
+
option :port, aliases: :p, default: "5678",
|
12
|
+
desc: "Specify application port"
|
13
|
+
option :environment, aliases: :e, default: "production",
|
14
|
+
desc: "Specify application environment"
|
15
|
+
option :"mongodb-port", default: MongoBrowser::DEFAULT_MONGODB_PORT,
|
16
|
+
desc: "Specify mongodb port"
|
17
|
+
option :"mongodb-host", default: MongoBrowser::DEFAULT_MONGODB_HOST,
|
18
|
+
desc: "Specify mongodb host"
|
19
|
+
|
20
|
+
def start
|
21
|
+
setup_mongodb_connection!(options)
|
22
|
+
run_thin(options)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def setup_mongodb_connection!(options)
|
28
|
+
port = options[:"mongodb-port"].to_i
|
29
|
+
MongoBrowser.mongodb_port = port
|
30
|
+
puts "MongoDB port: #{port}"
|
31
|
+
|
32
|
+
host = options[:"mongodb-host"]
|
33
|
+
MongoBrowser.mongodb_host = host
|
34
|
+
puts "MongoDB host: #{host}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def run_thin(options)
|
38
|
+
argv = ["start"]
|
39
|
+
argv << ["-R", RACK_CONFIG]
|
40
|
+
argv << ["-p", options[:port]]
|
41
|
+
argv << ["-e", options[:environment]]
|
42
|
+
|
43
|
+
puts "Application environment: #{options[:environment]}"
|
44
|
+
puts "Application url: http://localhost:#{options[:port]}"
|
45
|
+
Thin::Runner.new(argv.flatten).run!
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module MongoBrowser::Entities
|
2
|
+
|
3
|
+
class Database < Grape::Entity
|
4
|
+
expose :name, documentation: { type: String, desc: "Database name." }
|
5
|
+
expose :size, documentation: { type: Integer, desc: "Database size in bytes." }
|
6
|
+
expose :count, documentation: { type: Integer, desc: "Number of collections." }
|
7
|
+
end
|
8
|
+
|
9
|
+
class Collection < Grape::Entity
|
10
|
+
expose(:dbName, documentation: { type: String, desc: "Database name." }) do |collection|
|
11
|
+
collection.db_name
|
12
|
+
end
|
13
|
+
expose :name, documentation: { type: String, desc: "Collection name." }
|
14
|
+
expose :size, documentation: { type: Integer, desc: "Number of documents." }
|
15
|
+
end
|
16
|
+
|
17
|
+
class Document < Grape::Entity
|
18
|
+
expose(:id, documentation: { type: String, desc: "Document id." }) do |document|
|
19
|
+
document.id.to_s
|
20
|
+
end
|
21
|
+
|
22
|
+
expose(:dbName, documentation: { type: String, desc: "Database name." }) do |document|
|
23
|
+
document.db_name
|
24
|
+
end
|
25
|
+
|
26
|
+
expose(:collectionName, documentation: { type: String, desc: "Collection name." }) do |document|
|
27
|
+
document.collection_name
|
28
|
+
end
|
29
|
+
|
30
|
+
expose :data, documentation: { type: Hash, desc: "Document" }
|
31
|
+
end
|
32
|
+
|
33
|
+
class PagedDocuments < Grape::Entity
|
34
|
+
expose :page, documentation: { type: Integer, desc: "Current page." }
|
35
|
+
expose :size, documentation: { type: Integer, desc: "Total number of records." }
|
36
|
+
expose(:totalPages, documentation: { type: Integer, desc: "Total number of pages" }) do |paged|
|
37
|
+
paged.total_pages
|
38
|
+
end
|
39
|
+
|
40
|
+
expose :documents, using: Document
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -30,13 +30,14 @@ module MongoBrowser
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def documents_with_pagination(page_number = 1)
|
33
|
-
pager =
|
33
|
+
pager = Pager.new(page_number, size)
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
documents = mongo_collection.find
|
36
|
+
.skip(pager.offset)
|
37
|
+
.limit(pager.per_page)
|
38
|
+
.map { |document| Document.new(db_name, name, document) }
|
38
39
|
|
39
|
-
|
40
|
+
OpenStruct.new pager.to_hash.merge(documents: documents)
|
40
41
|
end
|
41
42
|
|
42
43
|
def drop!
|
@@ -49,19 +50,13 @@ module MongoBrowser
|
|
49
50
|
def find(id)
|
50
51
|
condition = { _id: BSON::ObjectId(id.to_s) }
|
51
52
|
mongo_document = mongo_collection.find(condition).first
|
52
|
-
Document.new(mongo_document) if mongo_document
|
53
|
+
Document.new(db_name, name, mongo_document) if mongo_document
|
53
54
|
end
|
54
55
|
|
55
56
|
# Removes the given document from the collection.
|
56
57
|
def remove!(document)
|
57
58
|
mongo_collection.remove(_id: document.id)
|
58
59
|
end
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
|
-
def pager_for(page)
|
63
|
-
Pager.new(page, size)
|
64
|
-
end
|
65
60
|
end
|
66
61
|
end
|
67
62
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
module MongoBrowser
|
2
2
|
module Models
|
3
3
|
class Document
|
4
|
+
attr_reader :db_name, :collection_name
|
4
5
|
attr_reader :mongo_document
|
5
6
|
|
6
|
-
def initialize(mongo_document)
|
7
|
+
def initialize(db_name, collection_name, mongo_document)
|
8
|
+
@db_name = db_name
|
9
|
+
@collection_name = collection_name
|
10
|
+
|
7
11
|
@mongo_document = mongo_document
|
8
12
|
end
|
9
13
|
|
@@ -3,15 +3,16 @@ module MongoBrowser
|
|
3
3
|
class Pager
|
4
4
|
PER_PAGE = 25
|
5
5
|
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :page
|
7
7
|
attr_reader :size
|
8
8
|
|
9
|
-
def initialize(
|
9
|
+
def initialize(page, size)
|
10
10
|
@size = size
|
11
|
-
@
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
@page = if page.to_i <= 0 then
|
12
|
+
1
|
13
|
+
else
|
14
|
+
[page.to_i, total_pages].min
|
15
|
+
end
|
15
16
|
end
|
16
17
|
|
17
18
|
def per_page
|
@@ -19,12 +20,24 @@ module MongoBrowser
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def offset
|
22
|
-
(
|
23
|
+
(page - 1) * per_page
|
23
24
|
end
|
24
25
|
|
25
26
|
def total_pages
|
26
|
-
|
27
|
+
if size == 0 then
|
28
|
+
1
|
29
|
+
else
|
30
|
+
(size.to_f / per_page).ceil
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def to_hash
|
35
|
+
{
|
36
|
+
size: size,
|
37
|
+
page: page,
|
38
|
+
total_pages: total_pages
|
39
|
+
}
|
27
40
|
end
|
28
41
|
end
|
29
42
|
end
|
30
|
-
end
|
43
|
+
end
|
data/mongo_browser.gemspec
CHANGED
@@ -12,26 +12,33 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "mongo_browser"
|
15
|
+
gem.license = "MIT"
|
15
16
|
gem.require_paths = ["lib"]
|
16
17
|
gem.version = MongoBrowser::VERSION
|
17
18
|
|
18
|
-
gem.add_development_dependency("rdoc", "
|
19
|
-
gem.add_development_dependency("rake", "
|
19
|
+
gem.add_development_dependency("rdoc", "4.0.1")
|
20
|
+
gem.add_development_dependency("rake", "10.1.0")
|
20
21
|
|
21
|
-
gem.add_development_dependency("
|
22
|
-
gem.add_development_dependency("
|
23
|
-
gem.add_development_dependency("
|
24
|
-
gem.add_development_dependency("
|
22
|
+
gem.add_development_dependency("coveralls", "0.6.7")
|
23
|
+
gem.add_development_dependency("foreman", "0.63.0")
|
24
|
+
gem.add_development_dependency("rspec", "2.14.1")
|
25
|
+
gem.add_development_dependency("rack-test", "0.6.2")
|
26
|
+
gem.add_development_dependency("simplecov", "0.7.1")
|
27
|
+
gem.add_development_dependency("debugger", "1.6.1")
|
25
28
|
|
26
|
-
gem.add_dependency("
|
27
|
-
gem.add_dependency("
|
28
|
-
gem.add_dependency("
|
29
|
+
gem.add_dependency("thin", "1.5.1")
|
30
|
+
gem.add_dependency("mongo", "1.9.1")
|
31
|
+
gem.add_dependency("bson_ext", "1.9.1")
|
29
32
|
|
30
|
-
gem.add_dependency("
|
31
|
-
gem.add_dependency("sinatra
|
32
|
-
gem.add_dependency("
|
33
|
+
gem.add_dependency("thor", "0.18.1")
|
34
|
+
gem.add_dependency("sinatra", "1.4.3")
|
35
|
+
gem.add_dependency("sinatra-contrib", "1.4.0")
|
36
|
+
gem.add_dependency("grape", "0.5.0")
|
37
|
+
gem.add_dependency("grape-entity", "0.3.0")
|
33
38
|
|
34
|
-
gem.add_dependency("sprockets", "
|
35
|
-
gem.add_dependency("
|
36
|
-
gem.add_dependency("
|
39
|
+
gem.add_dependency("sprockets", "2.10.0")
|
40
|
+
gem.add_dependency("execjs", "1.4.0")
|
41
|
+
gem.add_dependency("therubyracer", "0.11.4")
|
42
|
+
gem.add_dependency("coffee-script", "2.2.0")
|
43
|
+
gem.add_dependency("sass", "3.2.9")
|
37
44
|
end
|
data/package.json
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"name": "mongo_browser",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"description": "[![Build status](https://secure.travis-ci.org/lucassus/mongo_browser.png)](http://travis-ci.org/lucassus/mongo_browser) [![Dependency Status](https://gemnasium.com/lucassus/mongo_browser.png)](http://gemnasium.com/lucassus/mongo_browser) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/lucassus/mongo_browser)",
|
5
|
+
"main": "Gruntfile.js",
|
6
|
+
"dependencies": {
|
7
|
+
"grunt": "~0.4.1",
|
8
|
+
"grunt-cli": "~0.1.9",
|
9
|
+
"karma": "~0.8.5"
|
10
|
+
},
|
11
|
+
"devDependencies": {},
|
12
|
+
"scripts": {
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
14
|
+
},
|
15
|
+
"repository": {
|
16
|
+
"type": "git",
|
17
|
+
"url": "git://github.com/lucassus/mongo_browser.git"
|
18
|
+
},
|
19
|
+
"keywords": [
|
20
|
+
"mongodb",
|
21
|
+
"angularjs"
|
22
|
+
],
|
23
|
+
"author": "Lukasz Bandzarewicz",
|
24
|
+
"license": "BSD",
|
25
|
+
"readmeFilename": "README.md",
|
26
|
+
"gitHead": "dc2044e1f9d67c258b30c5b4c5efcd53067697c8",
|
27
|
+
"bugs": {
|
28
|
+
"url": "https://github.com/lucassus/mongo_browser/issues"
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<aside id="alerts">
|
2
|
+
<div ng-repeat="message in alertMessages" class="alert alert-{{message.type}}">
|
3
|
+
<button ng-click="disposeAlert(message.id)" type="button" class="close">×</button>
|
4
|
+
<strong>{{message.type}}</strong> <span>{{message.text}}</span>
|
5
|
+
</div>
|
6
|
+
</aside>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<header>
|
2
|
+
<h2>{{dbName}} collections</h2>
|
3
|
+
</header>
|
4
|
+
|
5
|
+
<table-filter value="filterValue.name" placeholder="Enter collection name"></table-filter>
|
6
|
+
|
7
|
+
<table ng-show="(collections | filter:filterValue).length" class="table table-striped table-hover collections">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>Name</th>
|
11
|
+
<th>Documents</th>
|
12
|
+
<th class="actions"> </th>
|
13
|
+
</tr>
|
14
|
+
</thead>
|
15
|
+
<tbody>
|
16
|
+
<tr ng-repeat="collection in collections | orderBy:'name' | filter:filterValue"
|
17
|
+
ng-mouseleave="showActions = false"
|
18
|
+
ng-mouseenter="showActions = true">
|
19
|
+
<td>
|
20
|
+
<a href="{{collection | documentsPath}}">
|
21
|
+
{{collection.name}}
|
22
|
+
</a>
|
23
|
+
</td>
|
24
|
+
<td>{{collection.size}}</td>
|
25
|
+
<td>
|
26
|
+
<span class="actions" ng-show="showActions">
|
27
|
+
<show-button path="{{collection | documentsPath}}"></show-button>
|
28
|
+
<delete-button ng-click="delete(collection)"></delete-button>
|
29
|
+
</span>
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
</tbody>
|
33
|
+
</table>
|
34
|
+
|
35
|
+
<div ng-hide="(collections | filter:filterValue).length" class="alert">
|
36
|
+
Nothing has been found.
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<a href="/databases/{{dbName}}/stats" class="btn">Database stats</a>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<header>
|
2
|
+
<h2>{{dbName}} / {{collectionName}} stats</h2>
|
3
|
+
</header>
|
4
|
+
|
5
|
+
<table class="table table-striped table-hover">
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th>Property</th>
|
9
|
+
<th>Value</th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<tr ng-repeat="(property, value) in stats">
|
14
|
+
<td>{{property}}</td>
|
15
|
+
<td>{{value}}</td>
|
16
|
+
</tr>
|
17
|
+
</tbody>
|
18
|
+
</table>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<header>
|
2
|
+
<h2>localhost databases</h2>
|
3
|
+
</header>
|
4
|
+
|
5
|
+
<table-filter value="filterValue.name" placeholder="Enter database name"></table-filter>
|
6
|
+
|
7
|
+
<table ng-hide="isLoading()" ng-show="(databases | filter:filterValue).length" class="table table-striped table-hover databases">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>Name</th>
|
11
|
+
<th>Collections</th>
|
12
|
+
<th>Size</th>
|
13
|
+
<th class="actions"> </th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
<tr ng-repeat="database in databases | orderBy:'name' | filter:filterValue"
|
18
|
+
ng-mouseleave="showActions = false"
|
19
|
+
ng-mouseenter="showActions = true">
|
20
|
+
<td><a href="{{database | collectionsPath}}">{{database.name}}</a></td>
|
21
|
+
<td>{{database.count}}</td>
|
22
|
+
<td>{{database.size | humanSize}}</td>
|
23
|
+
<td>
|
24
|
+
<span class="actions" ng-show="showActions">
|
25
|
+
<show-button path="{{database | collectionsPath}}"></show-button>
|
26
|
+
<delete-button ng-click="delete(database)"></delete-button>
|
27
|
+
</span>
|
28
|
+
</td>
|
29
|
+
</tr>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
32
|
+
|
33
|
+
<div ng-hide="(databases | filter:filterValue).length" class="alert">
|
34
|
+
Nothing has been found.
|
35
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<header>
|
2
|
+
<h2>{{dbName}} stats</h2>
|
3
|
+
</header>
|
4
|
+
|
5
|
+
<table class="table table-striped table-hover">
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th>Property</th>
|
9
|
+
<th>Value</th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<tr ng-repeat="(property, value) in stats">
|
14
|
+
<td>{{property}}</td>
|
15
|
+
<td>{{value}}</td>
|
16
|
+
</tr>
|
17
|
+
</tbody>
|
18
|
+
</table>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<header>
|
2
|
+
<h2>{{collectionName}} documents</h2>
|
3
|
+
</header>
|
4
|
+
|
5
|
+
<pager page="page" total-pages="totalPages"></pager>
|
6
|
+
|
7
|
+
<table ng-show="showDocuments()" class="table table-striped table-hover documents">
|
8
|
+
<thead>
|
9
|
+
<tr>
|
10
|
+
<th>Data</th>
|
11
|
+
<th class="actions"> </th>
|
12
|
+
</tr>
|
13
|
+
</thead>
|
14
|
+
<tbody>
|
15
|
+
<tr ng-repeat="document in documents" class="document id-{{document.id}}"
|
16
|
+
ng-mouseleave="showActions = false"
|
17
|
+
ng-mouseenter="showActions = true"
|
18
|
+
ng-init="document.dbName = dbName; document.collectionName = collectionName">
|
19
|
+
<td class="data">
|
20
|
+
<span class="id"><a href="{{document | documentPath}}">{{document.id}}</a></span>
|
21
|
+
<span>{{document | documentPrettyTime}}</span>
|
22
|
+
<div ng-bind-html="document.data | jsonDocument"></div>
|
23
|
+
</td>
|
24
|
+
<td>
|
25
|
+
<span class="actions" ng-show="showActions">
|
26
|
+
<show-button path="{{document | documentPath}}"></show-button>
|
27
|
+
<delete-button ng-click="delete(document)"></delete-button>
|
28
|
+
</span>
|
29
|
+
</td>
|
30
|
+
</tr>
|
31
|
+
</tbody>
|
32
|
+
</table>
|
33
|
+
|
34
|
+
<pager page="page" total-pages="totalPages"></pager>
|
35
|
+
|
36
|
+
<div ng-hide="showDocuments()" class="alert">
|
37
|
+
Nothing has been found.
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<a href="/databases/{{dbName}}/collections/{{collectionName}}/stats" class="btn">Collection stats</a>
|