mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-24 03:35:59 +08:00
服务支持页面
This commit is contained in:
@@ -19,6 +19,7 @@ bindRouters = (app) ->
|
||||
app.use '/plan', require './router/plan'
|
||||
app.use '/ticket', require './router/ticket'
|
||||
app.use '/wiki', require './router/wiki'
|
||||
app.use '/public', require './router/public'
|
||||
|
||||
app.get '/', (req, res) ->
|
||||
res.redirect '/panel/'
|
||||
|
||||
18
core/router/public.coffee
Normal file
18
core/router/public.coffee
Normal file
@@ -0,0 +1,18 @@
|
||||
express = require 'express'
|
||||
async = require 'async'
|
||||
|
||||
config = require '../config'
|
||||
plugin = require '../plugin'
|
||||
{renderAccount} = require './middleware'
|
||||
|
||||
module.exports = exports = express.Router()
|
||||
|
||||
exports.get '/services', renderAccount, (req, res) ->
|
||||
async.map config.plugin.availablePlugin, (item, callback) ->
|
||||
p = plugin.get item
|
||||
p.service.preview (html) ->
|
||||
callback null, html
|
||||
|
||||
, (err, result) ->
|
||||
res.render 'public/services',
|
||||
services: result
|
||||
8
core/view/public/services.jade
Normal file
8
core/view/public/services.jade
Normal file
@@ -0,0 +1,8 @@
|
||||
extends ../layout
|
||||
|
||||
prepend head
|
||||
title 服务支持 | #{t('app.name')}
|
||||
|
||||
block main
|
||||
for service in services
|
||||
.row!= service
|
||||
@@ -11,3 +11,7 @@ module.exports =
|
||||
widget: (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/linux/view/preview.jade
Normal file
2
plugin/linux/view/preview.jade
Normal file
@@ -0,0 +1,2 @@
|
||||
header Linux
|
||||
p Linux 是 RP 主机的基础服务,负责进行资源限制。
|
||||
@@ -5,7 +5,7 @@ table.table.table-hover
|
||||
td(style='width: 200px;') 2 小时 CPU 时间
|
||||
td
|
||||
.progress
|
||||
.progress-bar.progress-bar-success(role='progressbar', aria-valuenow='20', aria-valuemin='0', aria-valuemax='100', style='width: 20%;') 29 / 144 s
|
||||
.progress-bar.progress-bar-success(role='progressbar', aria-valuenow='20', aria-valuemin='0', aria-valuemax='100', style='width: 20%;') 58 / 288 s
|
||||
tr
|
||||
td 2 小时内存占用
|
||||
td
|
||||
|
||||
@@ -25,3 +25,7 @@ module.exports =
|
||||
widget: (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/ssh/view/preview.jade
Normal file
2
plugin/ssh/view/preview.jade
Normal file
@@ -0,0 +1,2 @@
|
||||
header SSH
|
||||
p SSH 提供了远程登录服务。
|
||||
Reference in New Issue
Block a user