Skip to content

Commit

Permalink
passwords and ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronblohowiak committed Oct 5, 2011
1 parent 4c33a28 commit 8316f10
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 42 deletions.
14 changes: 14 additions & 0 deletions controllers/account.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
fs = require("fs");
var formulate = require("formulate");
var passwords = require("../lib/passwords.js");


module.exports = function(routes, Transitive){
function renderAccount(res, template, locals){
Expand Down Expand Up @@ -27,4 +30,15 @@ module.exports = function(routes, Transitive){
routes.get("/process", function(req, res){
renderAccount(res, "process", {status:status});
});

routes.post("/login", function(req, res){
var hsh = "$2a$10$hbmTGDv4/WjRzXyuBuC25ucFORCd/jB8XnxOS25RwV941HE1NiPxq";
formulate(req, res, function(err, fields){
console.log(fields)
passwords.check(fields.password, hsh, function(err, matches){
if(err) return console.log(err);
res.end(JSON.stringify(matches));
});
}, 10);
});
};
12 changes: 9 additions & 3 deletions controllers/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var client = require("redis").createClient();
var formulate = require("formulate");

var Valid = require("../lib/valid.js");
var passwords = require("../lib/passwords.js");

module.exports = function(routes, Transitive){

Expand All @@ -25,7 +26,7 @@ module.exports = function(routes, Transitive){
routes.get("/"+str, function(req, res){
marketing(req, res, str);
});
})
});



Expand All @@ -41,10 +42,15 @@ module.exports = function(routes, Transitive){
var errors = userValid.test(fields);
if(errors){
return marketing(req, res, "signup", {fields: fields, errors: errors});
}else{
passwords.toHash(fields.password, function(err, hsh){
res.writeHead(200, {
'Content-Type': 'text/plain'
});
res.end(hsh);
});
}



//check if email already exists
//verify that plan is valid planId
//create account!
Expand Down
10 changes: 5 additions & 5 deletions generated/public/templates.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions generated/templates.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion less/dxdt.less
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ html {
}

.highlight{
background-color: #FFA;
background-color: #FFC;
color: black;
}

19 changes: 19 additions & 0 deletions lib/passwords.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var bcrypt = require('bcrypt');

function toHash(password, cb){
bcrypt.gen_salt(10, function(err, salt) {
if(err) return cb(err);
bcrypt.encrypt(password, salt, cb);
});
}

function check(password, hash, cb){
console.log(password);
console.log(hash);
bcrypt.compare(password, hash, cb);
}

module.exports = {
toHash: toHash,
check: check
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"hiredis": "~0.1.12",
"formulate": "~0.1.1",
"validator": "~0.2.8",
"composable-validator": "0.0.1"
"composable-validator": "0.0.1",
"bcrypt": "~0.3.2"
}
}
2 changes: 1 addition & 1 deletion public/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,6 @@ html {
color: black;
}
.highlight {
background-color: #FFA;
background-color: #FFC;
color: black;
}
11 changes: 7 additions & 4 deletions templates/marketing/layout.haml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@
%a(href="mailto:support@dxdt.io") Support
%ul.secondary-nav
%li
%form
%input.username(placeholder="Email Address")
%input.password(placeholder="Password" type="password")
%a.login(href="#toggle") Log In
%form(action="/login" method="POST" id="login-form")
%input.username(placeholder="Email Address" name="email")
%input.password(placeholder="Password" type="password" name="password")
%a.login(href="#" onclick="$('#login-form').submit()") Log In
/ we need this for enter to 'just work'
%div(style="position:absolute; left:-99999px")
%input(type="submit") log in
- }

!= content
Expand Down
8 changes: 3 additions & 5 deletions templates/marketing/plans.haml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
%div(style="padding:0 0px")
%h2 Have more than 50 servers?
%p
%a(href="mailto:custom@dxdt.io")> Email
or call us at (877) 250-4337 for volume discounts.
We offer
%a(href="mailto:custom@dxdt.io")> volume discounts.
.span8
%form(method="POST" action="/signup" autocomplete="off")
%fieldset
Expand All @@ -72,11 +72,9 @@
.row
.grayblock
%h3 If you have any questions, please <a href="mailto:[email protected]">email us</a> or call (877) 250-4337
.vspace
.vspace2
.span16
.row
.span16
%h2 FAQ
.span8
%h3 How does the 30-day trial work?
Sign up and start monitoring servers. A couple weeks before the end of your trial, we'll politely ask you to enter your billing information and you will be billed on the day after your trial ends for the following month. If for some reason we aren't a good fit, then we'll put your account on hold until further notice. If you get busy and forget to put in all your info, we have a grace period so you won't lose any data.
Expand Down
3 changes: 2 additions & 1 deletion templates/marketing/port-monitoring.haml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
%h2 Other Features:
%ul
%li
%a(href="/process-monitoring")> Process Monitoring
%b
%a(href="/process-monitoring")> Process Monitoring
tracks the RAM and CPU usage of every process on the machine.
%li
%a(href="/system-monitoring")> System Monitoring
Expand Down
37 changes: 21 additions & 16 deletions templates/marketing/process-monitoring.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,31 @@
%h1
Process Monitoring
%small(style="color:#666")> 100% Automatic: No Configuration.





.row
.span8
%h2
For every process on the machine see:
%p
%span.highlight dxdt is like a searchable, graphed version of `top` that works across all of your machines


%h3
For every process on the machine, you'll see:
%ul
%li Open
%a(href="/port-monitoring")>TCP Ports
%li RAM & CPU Usage
%li The command used to start the program
%li When the process started, and ended
%li
The
%a(href="/port-monitoring")>TCP Ports
this process is listening on
%li
%a(href="/event-stream")> Critical events
and custom notes.
%li The command-line options used to start the program
%li When the process started and ended

%p
Using dxdt is like having a searchable, graphed version of `top` that works across all of your machines. You can monitor your systems for performance problems, plan capacity, and
You can monitor your systems for performance problems, plan capacity, and
%span.highlight> perform a root cause analysis faster and easier than anything else.
<a href="/plans">Try dxdt</a> and see for yourself.
.vspace2
Expand All @@ -50,20 +58,17 @@
%h2(id="terminated")
Search Terminated Processes

%p
%a(href="http://en.wikipedia.org/wiki/Pgrep" target="_blank" rel="nofollow")>pgrep
is a command-line tool that lets you find the pid for a currently running process by regular expression.
%p With dxdt, you can use regular expressions to search through all your currently running processes and all processes that have terminated within the last 4 weeks.
%p Click on the name of a process and you'll see its detailed performance history. You can drill down, compare, and annotate graphs for the <b>fastest</b> root cause analysis.

.span8
%h1 &nbsp;
%br
%br
%img.pop(src="/process-monitoring.png" width="459px" height="507px")
.vspace2
%center
This is just a placeholder image for now while we're in Beta.
.vspace2
.vspace
%p
<a href="/plans">Start collecting data now »</a>
.vspace
<a href="/plans">Start your FREE 30-day trial »</a>
.vspace2

0 comments on commit 8316f10

Please sign in to comment.