var execute = require('child_process').exec; var prettyjson = require('prettyjson'); exports.index = function(req, res){ console.log("Client connected: " + req.ip); res.render('index', { title: 'YouNeedARealName' }); }; exports.servers = function(req, res){ console.log("Client " + req.ip + " requesting server list..."); execute('p4 -ztag -p localhost:1666 -u jrobinson servers', function(error, stdout, stderr){ if(error){ res.send("ERROR: " + error + "\n\t" + stderr); } var servers = {}; var currentID = ""; var currentServer; var lines = stdout.split('\n'); for(line in lines){ var key = (/\b\w*\b/).exec(lines[line]); if(key == null){ continue; } var value = lines[line].substring(key.index + key[0].length + 1); if(key == 'ServerID'){ currentServer = value; servers[currentServer] = { attr: {} }; continue; } servers[currentServer].attr[key[0]] = value; } console.log(prettyjson.render(servers)); res.json(servers); }); };
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#6 | 8378 | Joe Robinson |
- Server modal working. - Simplified backbone data fetching. - Log out of perforce now and not just empty session. - TODO: - Prettier/different icons for each server type. - Modal image and parent/child list. |
||
#5 | 8373 | Joe Robinson |
- Moved to d3 to handle image drawing (SVG). - Proper sessions (logging in/out) implemented. - TODO: Fix server modal style/formatting & populate with data. |
||
#4 | 8371 | Joe Robinson |
Implemented cookies/sessions (still need logout functionality). Cleaned up logging window; delete older messages so new ones do not break the page. |
||
#3 | 8367 | Joe Robinson |
Improve backbone data retrieval functionality (for building canvas nodes). Connect/login modal working almost as desired. Draw basic things on canvas. Preliminary implementation of Redis DB/cookie saving. |
||
#2 | 8362 | Joe Robinson |
Basic backbone functionality. Removed user routes. |
||
#1 | 8356 | Joe Robinson |
Refactored files, old service version can be deleted. Improved base service structure. |