supervisor framework

This commit is contained in:
jysperm
2014-11-06 00:35:56 +08:00
parent f6c39b411d
commit 4569538efa
9 changed files with 39 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
{pluggable} = app
module.exports = pluggable.createHelpers exports =
name: 'supervisor'
type: 'service'
dependencies: ['linux']
exports.registerHook 'view.panel.scripts',
path: '/plugin/linux/script/panel.css'
exports.registerHook 'view.panel.widgets',
generator: (req, callback) ->
exports.render 'widget', req, {}, callback
app.express.use '/plugin/supervisor', require './router'

View File

@@ -0,0 +1,3 @@
{
"": "Supervisor"
}

View File

@@ -0,0 +1,12 @@
{express} = app.libs
{requireInService} = app.middleware
module.exports = exports = express.Router()
exports.use requireInService 'supervisor'
exports.post '/update_program', (req, res) ->
exports.get '/program_config', (req, res) ->
exports.post '/program_control', (req, res) ->

View File

View File

View File

@@ -0,0 +1,7 @@
describe 'plugin/supervisor', ->
describe 'router', ->
it 'POST update_program'
it 'GET program_config'
it 'POST program_control'

View File

View File

@@ -15,7 +15,7 @@ module.exports =
plugin:
available_extensions: ['bitcoin', 'wiki', 'rpvhost']
available_services: ['linux']
available_services: ['linux', 'supervisor']
billing:
currency: 'CNY'
@@ -35,7 +35,7 @@ module.exports =
unit: 24 * 3600 * 1000
price: 10 / 30
services: ['ssh', 'linux']
services: ['supervisor', 'linux']
resources:
cpu: 144