summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2018-07-31 07:29:32 +0000
committerIan C <ianc@noddybox.co.uk>2018-07-31 07:29:32 +0000
commit9307c0d8e819494f0492ee3b0e17388b066741f4 (patch)
tree1b9ff5d1408033e846b479f3de84a0bcea2042b3
parent9e965d8708f740be946ea866a7d667179d565b4b (diff)
Added header row to table.
-rw-r--r--www/scripts/main.js49
1 files changed, 48 insertions, 1 deletions
diff --git a/www/scripts/main.js b/www/scripts/main.js
index f75f23c..f9fe22f 100644
--- a/www/scripts/main.js
+++ b/www/scripts/main.js
@@ -1,5 +1,11 @@
-var globalDb = [];
+// var globalDb = [];
+var globalDb = [
+{id:1, description: "Test 1", username: "user1", password: ""},
+{id:2, description: "Test 2", username: "user2", password: ""},
+{id:3, description: "Test 3", username: "user3", password: ""},
+{id:4, description: "Test 4", username: "user4", password: ""}
+];
var globalGroups = [];
var globalCurrentGroup = "";
@@ -316,6 +322,44 @@ function AddRow(table, id, prev_id, next_id, desc, username, password, rowcount)
table.appendChild(tr);
}
+function AddHeaderRow(table, rowcount)
+{
+ var tr = document.createElement("tr");
+
+ if ((rowcount % 2) == 1)
+ {
+ tr.className = "style1";
+ }
+ else
+ {
+ tr.className = "style2";
+ }
+
+ var td;
+
+ td = document.createElement("td");
+ td.className = "description";
+ AddText(td, "Description");
+ tr.appendChild(td);
+
+ td = document.createElement("td");
+ td.className = "username";
+ AddText(td, "Username");
+ tr.appendChild(td);
+
+ td = document.createElement("td");
+ td.className = "password";
+ AddText(td, "Password");
+ tr.appendChild(td);
+
+ td = document.createElement("td");
+ td.className = "commands";
+ AddText(td, "Commands");
+ tr.appendChild(td);
+
+ table.appendChild(tr);
+}
+
function GetGroupRows()
{
var result = [];
@@ -339,6 +383,8 @@ function LoadTable()
var rowcount = 0;
+ AddHeaderRow(table, rowcount++);
+
var rows = GetGroupRows();
for(var f = 0; f < rows.length; f++)
@@ -412,6 +458,7 @@ function DoLoad()
}
WebRequest("get.php", DoLoadAsync, []);
+ LoadInitialData();
}
function DoChangePassphraseAsync()