docs: add CONTRIBUTING.md, CHANGELOG.md, and JSDoc to entire codebase
CI / Build & Test (push) Successful in 2m54s
CI / Build & Test (push) Successful in 2m54s
Add docs/CONTRIBUTING.md covering the build system, dev workflow, all npm scripts, how to add new native host message types, code style, and debugging guidance. Add CHANGELOG.md at the project root documenting all features and fixes across the 1.0.0 release. Add JSDoc (@param, @returns) to all previously undocumented exported functions across 35 JS files: - native-host/holesail-manager/ (index, virtual-hosts, service-tunnels, servers, port-allocator) - native-host top-level managers (startup, connect-proxy, https-proxy, certificate-authority, ssh-manager, rdp-manager) - extension/background/ (logs, native-messaging, proxy, message-router) - extension/dashboard/core/ (utils, navigation, init) - extension/dashboard/ui/ (modal, toast, state-tag) - extension/dashboard/pages/ (all 10 page files) - extension/dashboard/refresh.js, events.js - extension/dashboard/data/hostname-validator.js - scripts/ (build-host, run-install)
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
// Depends on: core/utils.js ($, escapeHtml), ui/state-tag.js (stateTag),
|
||||
// ui/modal.js (openModal), pages/ssh.js (openAddSshModal),
|
||||
// pages/rdp.js (openAddRdpModal), core/state.js (sshConnections, rdpConnections)
|
||||
/**
|
||||
* Overview page — summary stats, quick-action cards, and virtualized connection lists.
|
||||
* Uses the OvList class for infinite-scroll, searchable tables of connections and servers.
|
||||
* Depends on: core/utils.js ($, escapeHtml), ui/state-tag.js (stateTag),
|
||||
* ui/modal.js (openModal), pages/ssh.js (openAddSshModal),
|
||||
* pages/rdp.js (openAddRdpModal), core/state.js (sshConnections, rdpConnections)
|
||||
*/
|
||||
|
||||
const OV_PAGE = 20; // rows per page
|
||||
|
||||
/**
|
||||
* Virtualized, searchable, infinite-scroll list for the Overview page.
|
||||
* Renders rows in pages of OV_PAGE, loading more when the sentinel element scrolls into view.
|
||||
*/
|
||||
class OvList {
|
||||
constructor({ bodyId, sentinelId, searchId, subtitleId, rowFn, emptyMsg, cols }) {
|
||||
this.body = $(bodyId);
|
||||
@@ -78,6 +86,10 @@ let _ovSvc = null;
|
||||
let _ovSsh = null;
|
||||
let _ovRdp = null;
|
||||
|
||||
/**
|
||||
* Create and wire up the OvList instances for virtual hosts and server tunnels.
|
||||
* Called once during dashboard initialisation.
|
||||
*/
|
||||
function initOvLists() {
|
||||
_ovVhost = new OvList({
|
||||
bodyId: 'recentConnections', sentinelId: 'ovVhostSentinel',
|
||||
@@ -175,6 +187,11 @@ function initOvLists() {
|
||||
$('qaInstallCA') ?.addEventListener('click', () => openModal('modal-installCA'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Overview page with the latest extension state.
|
||||
* Updates summary stat cards, quick-action buttons, and the connection/server lists.
|
||||
* @param {object} state - Full extension state from `fetchState()`.
|
||||
*/
|
||||
function updateDashboard(state) {
|
||||
currentState = state;
|
||||
const servers = state.servers || [];
|
||||
|
||||
Reference in New Issue
Block a user