mongodb ui

This commit is contained in:
jysperm
2014-07-23 05:36:31 +08:00
parent 9553e3e99f
commit ef6feb5414
9 changed files with 82 additions and 5 deletions

View File

@@ -16,9 +16,7 @@
mongo
use admin
db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWriteAnyDatabase', 'userAdminAnyDatabase', 'dbAdminAnyDatabase', 'clusterAdmin']})
use RootPanel
db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWrite']})
db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWriteAnyDatabase', 'userAdminAnyDatabase', 'dbAdminAnyDatabase']})
vi /etc/mongodb.conf

View File

@@ -21,7 +21,7 @@ module.exports =
]
plugin:
availablePlugin: ['linux', 'ssh', 'phpfpm', 'mysql', 'nginx', 'memcached']
availablePlugin: ['linux', 'ssh', 'phpfpm', 'mysql', 'nginx', 'memcached', 'mongodb']
plans:
all:
@@ -29,7 +29,7 @@ module.exports =
t_name: '所有服务(默认)'
t_service: '支持所有服务'
t_resources: '磁盘: 520MB, 内存: 27MB, 流量: 37GB'
services: ['linux', 'ssh', 'phpfpm', 'mysql', 'nginx', 'memcached']
services: ['linux', 'ssh', 'phpfpm', 'mysql', 'nginx', 'memcached', 'mongodb']
resources:
cpu: 144
storage: 520

0
plugin/mongodb/API.md Normal file
View File

View File

@@ -0,0 +1,5 @@
{assertInService} = require '../../core/router/middleware'
module.exports = exports = express.Router()
exports.use assertInService 'mongodb'

View File

@@ -0,0 +1,13 @@
action = require './action'
service = require './service'
module.exports =
name: 'mongodb'
type: 'service'
action: action
service: service
panel_widgets: [
service.widget
]

View File

@@ -0,0 +1,4 @@
{
"name": "MongoDB",
"description": "MongoDB 是世界上最流行的非关系型数据库之一"
}

View File

@@ -0,0 +1,22 @@
jade = require 'jade'
path = require 'path'
async = require 'async'
config = require '../../config'
mAccount = require '../../core/model/account'
module.exports =
enable: (account, callback) ->
callback()
delete: (account, callback) ->
callback()
widget: (account, callback) ->
jade.renderFile path.join(__dirname, 'view/widget.jade'), {}, (err, html) ->
callback html
preview: (callback) ->
jade.renderFile path.join(__dirname, 'view/preview.jade'), {}, (err, html) ->
callback html

View File

@@ -0,0 +1,2 @@
header MongoDB
p MongoDB 是世界上最流行的非关系型数据库之一。

View File

@@ -0,0 +1,33 @@
header MongoDB
.col-md-6
.panel.panel-success
.panel-heading
h3.panel-title 新建数据库
.panel-body
.input-group#mongodb-create
input.form-control(value='jysperm_')
span.input-group-btn
button.btn.btn-default(type='button') 提交
.panel.panel-warning
.panel-heading
h3.panel-title 设置 MongoDB 密码
.panel-body
.input-group#mongodb-input
input.form-control(type='password')
span.input-group-btn
button.btn.btn-default(type='button') 提交
.col-md-6
table(style= 'table-layout: fixed;').table.table-hover
thead
tr
td(style= 'width: 200px;') 数据库
td 体积
td
tbody
tr
td(style= 'white-space: nowrap; overflow: hidden;', title= 'jysperm_test') jysperm_test
td 10M
td
button.nginx-remove-btn.btn.btn-danger.btn-xs
span.glyphicon.glyphicon-remove-sign