Permalink
Browse files

system application UI improved

  • Loading branch information...
1 parent de305f0 commit 7bb03563d9dc2e809ab1696abe94b8ba6e51e797 @yssk22 committed May 9, 2011
View
17 apps/system/_attachments/css/system.css
@@ -0,0 +1,17 @@
+div.system article.runtime_info section.platform {
+ float: left;
+ margin-right: 10px;
+ float: left;
+ margin-right: 10px;
+ width: 230px;
+}
+div.system article.runtime_info section.stats {
+ float: left;
+ margin-right: 10px;
+ float: left;
+ margin-right: 10px;
+ width: 390px;
+ margin-right: 0;
+ padding-right: 0;
+ margin-right: 0;
+}
View
15 apps/system/_attachments/css/system.less
@@ -0,0 +1,15 @@
+div.system {
+ article.app_info {
+ }
+ article.runtime_info {
+ section.platform {
+ .column;
+ .span-6;
+ }
+ section.stats {
+ .column;
+ .span-10;
+ .last;
+ }
+ }
+}
View
10 apps/system/_attachments/templates/index.ejs
@@ -1,8 +1,8 @@
<% title('System') %>
<div class="system">
<h2>System Info</h2>
- <article>
- <h3>Installed Applications</h3>
+ <article class="app_info">
+ <h3>Application Info</h3>
<table>
<thead>
<tr>
@@ -24,9 +24,9 @@
</tbody>
</table>
</article>
- <article>
+ <article class="runtime_info">
<h3>Runtime Info</h3>
- <section>
+ <section class="platform">
<h4>Platform Version</h4>
<dl>
<dt>Sunrise</dt>
@@ -37,7 +37,7 @@
<dd><%= version.couchdb %></dd>
</dl>
</section>
- <section>
+ <section class="stats">
<h4>Current Statistics</h4>
<dl>
<dt>Server boot time</dt>
View
24 apps/system/app.js
@@ -1,9 +1,5 @@
var path = require('path');
var couchapp = require('couchapp');
-var raiseError = require('sunrise').raiseError;
-var merge = require('sunrise').utils.merge;
-var auth = require('sunrise').middleware.auth;
-
var ddoc = {
_id: "_design/system" ,
version: require('sunrise').version,
@@ -20,6 +16,13 @@ module.exports = ddoc;
ddoc.helpers = require('./helpers');
ddoc.dynamicHelpers = require('./dynamicHelpers');
ddoc.init = function(app){
+ var merge = require('sunrise').utils.merge;
+ var parallel = require('sunrise').middleware.utils.parallel,
+ js = require('sunrise').middleware.utils.js,
+ css = require('sunrise').middleware.utils.css,
+ auth = require('sunrise').middleware.auth;
+ var raiseError = require('sunrise').raiseError;
+
var version = {
node: process.version,
coucdb: '',
@@ -33,11 +36,14 @@ ddoc.init = function(app){
version.couchdb = v.version;
});
- app.get('/', function(req, res, next){
- res.local('version', version);
- res.local('stats', merge({}, stats, process.memoryUsage()));
- res.render('index.ejs');
- });
+
+ app.get('/',
+ css('css/system.css'),
+ function(req, res, next){
+ res.local('version', version);
+ res.local('stats', merge({}, stats, process.memoryUsage()));
+ res.render('index.ejs');
+ });
// TODO: Response login selector
// app.get('/login', function(req, res, nex){

0 comments on commit 7bb0356

Please sign in to comment.