Skip to content

Commit

Permalink
[0.0.26] 改进 term
Browse files Browse the repository at this point in the history
  • Loading branch information
Houfeng committed Jul 6, 2016
1 parent 92c6603 commit f4d7a9f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion demo/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ demo1.job('pull', ci.shell(function () {

demo1.job('build', ci.by(['pull'], ci.shell(function () {
/*
npm i
nokit xxx
npm test
*/
})));
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cize",
"version": "0.0.25",
"version": "0.0.26",
"dbVersion": "1",
"description": "Cize 是一个「持续集成」工具",
"main": "index.js",
Expand All @@ -26,6 +26,7 @@
},
"license": "MIT",
"dependencies": {
"ansi-to-html": "^0.4.1",
"async": "^1.5.2",
"bootstrap": "^3.3.6",
"cify": "^1.0.0",
Expand All @@ -45,8 +46,7 @@
"request": "^2.72.0",
"rmdir": "^1.2.0",
"shify": "^0.1.0",
"sqlite3": "^3.1.4",
"xterm": "^0.33.0"
"sqlite3": "^3.1.4"
},
"devDependencies": {
"istanbul": "^0.4.3",
Expand Down
3 changes: 1 addition & 2 deletions web/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"^/bootstrap(.*)": "../node_modules/bootstrap/dist",
"^/jquery(.*)": "../node_modules/jquery/dist",
"^/font-awesome(.*)": "../node_modules/font-awesome",
"^/pjax/(.*)$": "../node_modules/nokit-pjax/client",
"^/xterm/(.*)$": "../node_modules/xterm/src"
"^/pjax/(.*)$": "../node_modules/nokit-pjax/client"
}
},
"session": {
Expand Down
8 changes: 6 additions & 2 deletions web/controllers/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const async = require('async');
const fs = require('fs');
const path = require('path');

const Convert = require('ansi-to-html');
const convert = new Convert({
fg: '#333',
bg: '#fff'
});
/**
* 定义 MainController
**/
Expand Down Expand Up @@ -111,7 +115,7 @@ const MainController = nokit.define({
}
fs.readFile(outFile, function (err, data) {
if (err) return callback(err);
self.record.out = data.toString();
self.record.out = convert.toHtml(data.toString().replace(/\[2K\[0G/igm, ''));
callback();
});
});
Expand Down
4 changes: 2 additions & 2 deletions web/public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
}
var url = location.href.split('?')[0];
$.get(url + '/console?_t=' + Date.now(), function (data) {
if (console.text() != data) {
console.text(data);
if (console.html() != data) {
console.html(data);
console.prop('scrollTop', console.prop('scrollHeight'));
}
return fetchOut(SHORT_INTERVAL);
Expand Down

0 comments on commit f4d7a9f

Please sign in to comment.