mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-01-12 22:27:09 +08:00
mongodb ui
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
0
plugin/mongodb/API.md
Normal file
5
plugin/mongodb/action.coffee
Normal file
5
plugin/mongodb/action.coffee
Normal file
@@ -0,0 +1,5 @@
|
||||
{assertInService} = require '../../core/router/middleware'
|
||||
|
||||
module.exports = exports = express.Router()
|
||||
|
||||
exports.use assertInService 'mongodb'
|
||||
13
plugin/mongodb/index.coffee
Normal file
13
plugin/mongodb/index.coffee
Normal 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
|
||||
]
|
||||
4
plugin/mongodb/locale/zh_CN.json
Normal file
4
plugin/mongodb/locale/zh_CN.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "MongoDB",
|
||||
"description": "MongoDB 是世界上最流行的非关系型数据库之一"
|
||||
}
|
||||
22
plugin/mongodb/service.coffee
Normal file
22
plugin/mongodb/service.coffee
Normal 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
|
||||
2
plugin/mongodb/view/preview.jade
Normal file
2
plugin/mongodb/view/preview.jade
Normal file
@@ -0,0 +1,2 @@
|
||||
header MongoDB
|
||||
p MongoDB 是世界上最流行的非关系型数据库之一。
|
||||
33
plugin/mongodb/view/widget.jade
Normal file
33
plugin/mongodb/view/widget.jade
Normal 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
|
||||
Reference in New Issue
Block a user