Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modified js for better ajax

  • Loading branch information...
commit a0c0b0544c3d41bccd13aaad1bd639beb3819c0d 1 parent d8846e2
@rowoot rowoot authored
Showing with 7 additions and 9 deletions.
  1. +7 −9 public/javascripts/n.js
View
16 public/javascripts/n.js
@@ -26,17 +26,17 @@ Array.prototype.clean = function(deleteValue) {
$tree = $(".tree"),
template = {
apps: {
- body:["<td>{{name}}</td>",
- "<td>{{port}}</td>",
- "<td>{{running}}</td>"].join(""),
+ body:["<td class='name'>{{name}}</td>",
+ "<td class='port'>{{port}}</td>",
+ "<td class='status'>{{running}}</td>"].join(""),
header: ["<th>name</th>",
"<th>port</th>",
"<th>app-status</th>",
"<th>action</th>"].join("")
},
appdomains: {
- body:["<td>{{domain}}</td>",
- "<td>{{appname}}</td>"].join(""),
+ body:["<td class='domain'>{{domain}}</td>",
+ "<td class='appname'>{{appname}}</td>"].join(""),
header: ["<th>domain</th>",
"<th>appname</th>",
"<th>action</th>"].join("")
@@ -107,14 +107,12 @@ Array.prototype.clean = function(deleteValue) {
type:"PUT",
data:data,
success:function(r) {
- console.log(r);
if(r.status == "success") {
// since href can be /apps or /appdomains
switch(href.split("/")[1]) {
case 'app':
var $tRow = $this.parent().parent();
- $tRow.find(".pid").text(r.pid); // change pid
- $tRow.find(".running").text(r.running); // change running
+ $tRow.find(".status").text(r.running); // change running
break;
case 'appdomains':
@@ -170,7 +168,7 @@ Array.prototype.clean = function(deleteValue) {
"<p>port - {{port}}</p>",
"<p>gitrepo - {{gitrepo}}</p>",
"<p>start file - {{start}}</p>",
- "<p>app status - {{status}}</p>",
+ "<p>app status - {{running}}</p>",
"<p>process id - {{pid}}</p>"].join("");
// remove put from rel --- temporary
$this.attr("rel", "");
Please sign in to comment.
Something went wrong with that request. Please try again.