+
+
@@ -53,37 +54,6 @@
class="w-full bg-surface-container-low border border-outline-variant/40 rounded-lg py-2.5 px-4 focus:ring-2 focus:ring-primary/20 focus:border-primary focus:outline-none transition-all font-medium text-on-surface">
-
-
-
-
-
-
-
-
-
-
-
@@ -119,6 +89,20 @@
+
+
+
+
+
+
+
.pem .key .ppk
+
+
+
+
@@ -150,18 +135,18 @@ function hostForm() {
editing: false,
hostId: '',
form: {
- name: '', ip: '', hostname: '', port: '22', username: 'root',
- os: 'Ubuntu 22.04', provider: 'AWS US-East', type: 'api',
- authType: 'key', password: '', notes: ''
+ name: '', ip: '', hostname: '', port: '22', username: '',
+ type: 'api', authType: 'key', password: '', notes: ''
},
reset() {
this.editing = false;
this.hostId = '';
this.form = {
- name: '', ip: '', hostname: '', port: '22', username: 'root',
- os: 'Ubuntu 22.04', provider: 'AWS US-East', type: 'api',
- authType: 'key', password: '', notes: ''
+ name: '', ip: '', hostname: '', port: '22', username: '',
+ type: 'api', authType: 'key', password: '', notes: ''
};
+ var ta = document.querySelector('#host-modal textarea[name=password]');
+ if (ta) ta.value = '';
},
populate(host) {
this.editing = true;
@@ -172,13 +157,23 @@ function hostForm() {
hostname: host.Hostname || '',
port: String(host.Port || 22),
username: host.Username || 'root',
- os: host.OS || 'Ubuntu 22.04',
- provider: host.Provider || 'AWS US-East',
type: host.Type || 'api',
authType: host.AuthType || 'key',
password: host.Password || '',
notes: host.Notes || ''
};
+ var ta = document.querySelector('#host-modal textarea[name=password]');
+ if (ta) ta.value = host.Password || '';
+ },
+ readKeyFile($event) {
+ var file = $event.target.files[0];
+ if (!file) return;
+ var reader = new FileReader();
+ var ta = document.querySelector('#host-modal textarea[name=password]');
+ reader.onload = function(e) {
+ if (ta) ta.value = e.target.result;
+ };
+ reader.readAsText(file);
}
};
}
diff --git a/app/backend/views/index.html b/app/backend/views/index.html
index f87385c..67f9505 100644
--- a/app/backend/views/index.html
+++ b/app/backend/views/index.html
@@ -68,22 +68,22 @@
+ hx-get="/hosts/list?filter=all" hx-target="#host-list">All
+ hx-get="/hosts/list?filter=active" hx-target="#host-list">Active
+ hx-get="/hosts/list?filter=offline" hx-target="#host-list">Offline