Commit 8d6aa118 authored by Markos Gogoulos's avatar Markos Gogoulos
Browse files

fix bug with big names on forms

 * on standard/list, trunchate machine names
 * on metadata list form
parent 7cbb25e0
......@@ -214,7 +214,7 @@ function update_machines_view(data){
imgSrc = "static/wave.gif";
imgStr = "<img class=list-logo src=" + imgSrc + " title=" + osTag + " height=16 width=16 />";
tableData[current][1] = "<span class=imagetag>" + osTag + "</span>" + imgStr;
tableData[current][2] = "<a class=name><span class=name>" + server.name + "</span></a>";
tableData[current][2] = "<a class=name><span class=name>" + server.name.substring(0,60) + "</span></a>";
//tableData[current][4] = "group"; //TODO
tableData[current][5] = "<span class=status>" + STATUS_MESSAGES[server.status] + "</span>";
vmTable.fnUpdate(tableData[current],current);
......@@ -227,7 +227,7 @@ function update_machines_view(data){
imgSrc = "static/wave.gif";
imgStr = "<img class=list-logo src=" + imgSrc + " title=" + osTag + " height=16 width=16 />";
tableData[current][1] = "<span class=imagetag>" + osTag + "</span>" + imgStr;
tableData[current][2] = "<a class=name><span class=name>" + server.name + "</span></a>";
tableData[current][2] = "<a class=name><span class=name>" + server.name.substring(0,60) + "</span></a>";
//tableData[current][4] = "group"; //TODO
tableData[current][5] = "<span class=status>" + STATUS_MESSAGES[server.status] + "</span>";
vmTable.fnUpdate(tableData[current],current);
......@@ -241,7 +241,7 @@ function update_machines_view(data){
imgSrc = "static/wave.gif";
imgStr = "<img class=list-logo src=" + imgSrc + " title=" + osTag + " height=16 width=16 />";
tableData[current][1] = "<span class=imagetag>" + osTag + "</span>" + imgStr;
tableData[current][2] = "<a class=name><span class=name>" + server.name + "</span></a>";
tableData[current][2] = "<a class=name><span class=name>" + server.name.substring(0,60) + "</span></a>";
//tableData[current][4] = "group"; //TODO
tableData[current][5] = "<span class=status>" + STATUS_MESSAGES[server.status] + "</span>";
vmTable.fnUpdate(tableData[current],current);
......@@ -279,7 +279,7 @@ function update_machines_view(data){
"<input class=" + server.status + " id=" + server.id + " type=checkbox>",
"<span class=imagetag>" + osTag + "</span><img class=list-logo src=" + osIcon +
" title=" + osTag + " height=16 width=16>",
"<a class=name><span class=name>" + server.name + "</span></a>",
"<a class=name><span class=name>" + server.name.substring(0,60) + "</span></a>",
"<a class=flavor><span>"+ flavorLabel + "</span></a>",
"group",
"<span class=status>" + STATUS_MESSAGES[server.status] + "</span>"
......
......@@ -691,8 +691,8 @@ function list_metadata(data) {
// show values
for (key in meta) {
pair = $("ul.meta-template li").clone();
pair.find("label").text(key);
pair.find("p").text(meta[key].substring(0,25));
pair.find("label").text(key.substring(0,15));
pair.find("p").text(meta[key].substring(0,30));
pair.appendTo("#editor-1 div.content ul.meta-list").fadeIn();
}
}
......
......@@ -288,12 +288,12 @@ function update_machines_view(data){
existing.find('.spinner').show();
}
}
existing.find("a.name span.name").text(server.name);
existing.find("a.name span.name").text(server.name.substring(0,100));
existing.find("a.ip span.public").text(String(server.addresses.values[0].values[0].addr).replace(',',' '));
} else if (server.status != 'DELETED') {
// If it does not exist and it's not deleted, we should create it
var machine = $("#machine-template").clone().attr("id", server.id).fadeIn("slow");
machine.find("a.name span.name").text(server.name);
machine.find("a.name span.name").text(server.name.substring(0,100));
machine.find("img.logo").attr("src","static/machines/"+server_image+'-on.png');
machine.find("span.imagetag").text(server_image);
machine.find("a.ip span.public").text(String(server.addresses.values[0].values[0].addr).replace(',',' '));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment