fmt , made default textarea bigger

This commit is contained in:
daragh 2024-02-18 16:47:22 +00:00
parent 0851e9934d
commit 92a83a2079
No known key found for this signature in database
2 changed files with 14 additions and 5 deletions

View file

@ -12,6 +12,7 @@
margin-left: auto;
margin-right: auto;
}
.center, .center th, .center td {
border: 1px solid white;
}
@ -28,6 +29,12 @@
display: none;
}
textarea {
width: 650px;
height: 57px;
}
</style>
<body>
<div class="wrapper">
@ -66,6 +73,7 @@
placeholder="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINS2UR/o+nK8lNHHTj5I84ZAAp6P+ZhXqhedMfx0KHE4 My skynet key!"></textarea>
<button type="button" id="add_key_button"> Add key</button>
</form>
<br>
<table id="key_table" class="center">
<tr>

View file

@ -1,13 +1,14 @@
function update_table(keys){
function update_table(keys) {
let table = document.getElementById("key_table")
//removing old table
while(table.rows.length > 0){
while (table.rows.length > 0) {
table.deleteRow(0);
}
keys.forEach(key => {
add_to_table(key);
})
}
async function get_keys() {
let username = document.getElementById("user").value;
let password = document.getElementById("pass").value;
@ -68,7 +69,7 @@ async function add_key() {
}
}
async function delete_key(row_idx,key) {
async function delete_key(row_idx, key) {
let username = document.getElementById("user").value;
let password = document.getElementById("pass").value;
@ -102,7 +103,7 @@ async function delete_key(row_idx,key) {
function add_to_table(key) {
let table = document.getElementById("key_table");
let row = table.insertRow();
row.setAttribute("ssh_key",key);
row.setAttribute("ssh_key", key);
let cell_name = row.insertCell(0);
let cell_key = row.insertCell(1);
@ -115,7 +116,7 @@ function add_to_table(key) {
for (let i = 2; i < key_split.length; i++) {
comment += " " + key_split[i];
}
if(key_split.length === 2) {
if (key_split.length === 2) {
comment = "No comment";
}
cell_name.textContent = comment;