git-watchtower 1.10.1 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,140 @@
1
+ /**
2
+ * HTML skeleton for the Git Watchtower web dashboard.
3
+ * Contains the body markup and modal templates.
4
+ * @module server/web-ui/html
5
+ */
6
+
7
+ /**
8
+ * Get the dashboard HTML body markup.
9
+ * @returns {string} HTML body content (elements only, no body/html tags)
10
+ */
11
+ function getDashboardHtml() {
12
+ return `
13
+ <div class="header">
14
+ <div class="header-left">
15
+ <span class="header-title">&#x1f3f0; Git Watchtower</span>
16
+ <span class="header-version" id="version"></span>
17
+ <span class="header-project" id="project-name">-</span>
18
+ </div>
19
+ <div class="header-right">
20
+ <button class="notif-btn" id="notif-btn" title="Enable desktop notifications">notifications</button>
21
+ <span class="badge" id="status-badge">connecting</span>
22
+ <span class="connection-dot disconnected" id="connection-dot"></span>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="tab-bar" id="tab-bar"></div>
27
+
28
+ <div class="layout">
29
+ <div class="branch-panel">
30
+ <div class="search-bar" id="search-bar">
31
+ <input type="text" class="search-input" id="search-input" placeholder="Filter branches..." autocomplete="off" spellcheck="false">
32
+ </div>
33
+ <div class="panel-header">
34
+ <span>Active Branches</span>
35
+ <span class="branch-count" id="branch-count">0</span>
36
+ </div>
37
+ <div class="branch-list" id="branch-list"></div>
38
+ </div>
39
+
40
+ <div class="side-panel" id="side-panel">
41
+ <div class="panel-header">Activity Log <button class="sidebar-toggle" id="sidebar-toggle" title="Toggle sidebar">&#x25b6;</button></div>
42
+ <div class="activity-log" id="activity-log"></div>
43
+ </div>
44
+
45
+ <div class="footer" id="footer">
46
+ <span><kbd>j</kbd><kbd>k</kbd> navigate</span>
47
+ <span><kbd>Enter</kbd> switch</span>
48
+ <span><kbd>/</kbd> search</span>
49
+ <span><kbd>b</kbd> actions</span>
50
+ <span><kbd>i</kbd> info</span>
51
+ <span><kbd>l</kbd> logs</span>
52
+ <span><kbd>p</kbd> pull</span>
53
+ <span><kbd>f</kbd> fetch</span>
54
+ <span><kbd>S</kbd> stash</span>
55
+ <span><kbd>d</kbd> cleanup</span>
56
+ <span><kbd>h</kbd> history</span>
57
+ <span><kbd>Esc</kbd> close</span>
58
+ <span class="stats-bar" id="stats-bar"></span>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="flash" id="flash"></div>
63
+ <div class="confirm-overlay" id="confirm-overlay">
64
+ <div class="confirm-box" id="confirm-box"></div>
65
+ </div>
66
+ <div class="toast-container" id="toast-container"></div>
67
+
68
+ <!-- Log Viewer Modal -->
69
+ <div class="modal-overlay" id="log-viewer-overlay">
70
+ <div class="modal-box" style="min-width:500px;max-width:750px;">
71
+ <div class="modal-title">
72
+ Server Logs
73
+ <button class="modal-close" id="log-viewer-close">&times;</button>
74
+ </div>
75
+ <div class="log-viewer-tabs" id="log-viewer-tabs">
76
+ <button class="log-viewer-tab active" data-tab="server">Server</button>
77
+ <button class="log-viewer-tab" data-tab="activity">Activity</button>
78
+ </div>
79
+ <div class="log-viewer-content" id="log-viewer-content"></div>
80
+ </div>
81
+ </div>
82
+
83
+ <!-- Branch Action Modal -->
84
+ <div class="modal-overlay" id="branch-action-overlay">
85
+ <div class="modal-box">
86
+ <div class="modal-title">
87
+ <span id="branch-action-title">Branch Actions</span>
88
+ <button class="modal-close" id="branch-action-close">&times;</button>
89
+ </div>
90
+ <div class="action-list" id="branch-action-list"></div>
91
+ </div>
92
+ </div>
93
+
94
+ <!-- Info Panel Modal -->
95
+ <div class="modal-overlay" id="info-overlay">
96
+ <div class="modal-box" style="min-width:380px;">
97
+ <div class="modal-title">
98
+ Server Info
99
+ <button class="modal-close" id="info-close">&times;</button>
100
+ </div>
101
+ <div class="info-grid" id="info-grid"></div>
102
+ </div>
103
+ </div>
104
+
105
+ <!-- Branch Cleanup Modal -->
106
+ <div class="modal-overlay" id="cleanup-overlay">
107
+ <div class="modal-box">
108
+ <div class="modal-title">
109
+ Branch Cleanup
110
+ <button class="modal-close" id="cleanup-close">&times;</button>
111
+ </div>
112
+ <div id="cleanup-content"></div>
113
+ </div>
114
+ </div>
115
+
116
+ <!-- Update Notification Modal -->
117
+ <div class="modal-overlay" id="update-overlay">
118
+ <div class="modal-box" style="min-width:380px;">
119
+ <div class="modal-title">
120
+ Update Available
121
+ <button class="modal-close" id="update-close">&times;</button>
122
+ </div>
123
+ <div id="update-content"></div>
124
+ </div>
125
+ </div>
126
+
127
+ <!-- Stash Confirm Modal -->
128
+ <div class="modal-overlay" id="stash-overlay">
129
+ <div class="modal-box" style="min-width:380px;">
130
+ <div class="modal-title">
131
+ Stash Changes
132
+ <button class="modal-close" id="stash-close">&times;</button>
133
+ </div>
134
+ <div id="stash-content"></div>
135
+ </div>
136
+ </div>
137
+ `;
138
+ }
139
+
140
+ module.exports = { getDashboardHtml };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Assembles the Git Watchtower web dashboard from its component parts.
3
+ * Combines CSS, HTML, and JS into a single HTML document string.
4
+ * @module server/web-ui
5
+ */
6
+
7
+ const { getDashboardCss } = require('./css');
8
+ const { getDashboardHtml } = require('./html');
9
+ const { getDashboardJs } = require('./js');
10
+
11
+ /**
12
+ * Generate the complete web dashboard HTML page.
13
+ * @param {number} port - The web server port (accepted for API compatibility, currently unused)
14
+ * @returns {string} Complete HTML document
15
+ */
16
+ function getWebDashboardHtml(port) {
17
+ return `<!DOCTYPE html>
18
+ <html lang="en">
19
+ <head>
20
+ <meta charset="utf-8">
21
+ <meta name="viewport" content="width=device-width, initial-scale=1">
22
+ <title>Git Watchtower</title>
23
+ <style>
24
+ ${getDashboardCss()}
25
+ </style>
26
+ </head>
27
+ <body>
28
+ ${getDashboardHtml()}
29
+ <script>
30
+ ${getDashboardJs()}
31
+ </script>
32
+ </body>
33
+ </html>`;
34
+ }
35
+
36
+ module.exports = { getWebDashboardHtml };