-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
333 lines (295 loc) · 16.8 KB
/
index.html
File metadata and controls
333 lines (295 loc) · 16.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!--
Copyright 2025 KCoderVA
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Comprehensive Git/GitHub repository commit log analyzer and productivity dashboard. Analyze local repositories and GitHub.com projects with detailed metrics and visualizations.">
<meta name="keywords" content="git, github, commit, productivity, analyzer, dashboard, repository, metrics, visualization">
<meta name="author" content="KCoderVA">
<meta name="robots" content="index, follow">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:title" content="Git/GitHub Commit Log Productivity Analyzer">
<meta property="og:description" content="Analyze Git repository commit logs and extract productivity insights with this comprehensive dashboard.">
<meta property="og:site_name" content="Commit Log Productivity Analyzer">
<!-- Twitter -->
<meta property="twitter:card" content="summary">
<meta property="twitter:title" content="Git/GitHub Commit Log Productivity Analyzer">
<meta property="twitter:description" content="Analyze Git repository commit logs and extract productivity insights with this comprehensive dashboard.">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="src/assets/favicon.ico">
<link rel="apple-touch-icon" href="src/assets/icons/apple-touch-icon.png">
<title>Git/GitHub Commit Log Productivity Analyzer</title>
<!-- Stylesheets -->
<link rel="stylesheet" href="src/css/main.css">
<link rel="stylesheet" href="src/css/dashboard.css">
<link rel="stylesheet" href="src/css/responsive.css">
</head>
<body>
<div id="app">
<header class="dashboard-header">
<div class="header-content">
<h1>Git/GitHub Commit Log Productivity Analyzer</h1>
<p class="subtitle">Comprehensive repository analysis and productivity insights</p>
<p class="version-indicator" id="version-indicator">Loading...</p>
</div>
</header>
<main>
<!-- Repository Selection Section -->
<section id="repo-selection" class="section">
<div class="section-header">
<h2>Repository Selection</h2>
<p class="section-description">Choose a repository to analyze commit logs and extract productivity metrics</p>
</div>
<div class="input-group">
<div class="local-repo-section">
<button id="select-local-repo" class="btn btn-primary" style="display: none;" title="Select a local Git repository folder">
📁 Select Local Git Repository
</button>
<p class="help-text" id="local-help" style="display: none;">Choose a folder containing a .git directory</p>
</div>
<div class="github-repo-section">
<div class="input-wrapper">
<input type="text"
id="github-repo-url"
placeholder="https://github.com/username/repository-name"
class="input-field"
title="Enter a GitHub repository URL">
<button id="analyze-github-repo" class="btn btn-secondary" title="Analyze the GitHub repository">
🔍 Analyze GitHub Repository
</button>
</div>
<p class="help-text">Enter the full URL of any public GitHub repository</p>
</div>
<div class="demo-section">
<button id="load-mock-data" class="btn btn-outline" title="Load enhanced mock data for testing">
🔬 Load Mock Data (Demo)
</button>
<p class="help-text">Test the analyzer with enhanced mock data including full commit messages and accurate statistics</p>
</div>
<div class="demo-section">
<button id="test-git-log-parsing" class="btn btn-outline" title="Test enhanced Git log parsing with real repository data">
📊 Test Enhanced Git Log Parsing
</button>
<p class="help-text">Test the new Git log parsing functionality with actual repository statistics</p>
</div>
<div class="note-section">
<p class="note" id="local-repo-note" style="display: none;">
ℹ️ <strong>Note:</strong> Local repository analysis is not available in the online version for security reasons.
</p>
<p class="note" id="offline-note" style="display: none;">
ℹ️ <strong>Offline Mode:</strong> You can analyze both local repositories and GitHub repositories.
</p>
</div>
</div>
</section>
<!-- Date Filter Section (hidden until repository is selected) -->
<section id="date-filter-section" class="section" style="display: none;">
<div class="section-header">
<h2>📅 Analysis Date Range</h2>
<p class="section-description">Filter commit history by date range to focus your analysis</p>
</div>
<div class="filter-controls">
<div class="filter-group">
<h4>Quick Filters</h4>
<div class="quick-filters">
<button class="filter-btn active" data-filter="all">All Time</button>
<button class="filter-btn" data-filter="7days">Last 7 Days</button>
<button class="filter-btn" data-filter="30days">Last 30 Days</button>
<button class="filter-btn" data-filter="90days">Last 90 Days</button>
<button class="filter-btn" data-filter="year">Last Year</button>
</div>
</div>
<div class="filter-group">
<h4>Custom Date Range</h4>
<div class="custom-date-range">
<div class="date-input-group">
<label for="start-date">From:</label>
<input type="date" id="start-date" class="date-input">
</div>
<div class="date-input-group">
<label for="end-date">To:</label>
<input type="date" id="end-date" class="date-input">
</div>
<button id="apply-custom-filter" class="btn btn-secondary">Apply Filter</button>
</div>
</div>
<div class="filter-status">
<p id="filter-status-text">Showing all commits</p>
<button id="reset-filters" class="btn btn-outline" style="display: none;">Reset to All Time</button>
</div>
</div>
</section>
<!-- Summary Analysis Section -->
<section id="summary-analysis" class="section" style="display: none;">
<div class="section-header">
<h2>Repository Summary</h2>
<p class="section-description">High-level overview of repository statistics and productivity metrics</p>
</div>
<div id="summary-content">
<!-- Summary data will be populated here dynamically -->
</div>
</section>
<!-- Detailed Commit History Section -->
<section id="detailed-history" class="section" style="display: none;">
<div class="section-header">
<h2>Detailed Commit History</h2>
<p class="section-description">Comprehensive commit timeline with detailed analysis and visualizations</p>
</div>
<div id="commit-details">
<!-- Detailed commit data will be populated here dynamically -->
</div>
</section>
<!-- Loading and Error States -->
<section id="loading-section" class="section" style="display: none;">
<div class="loading-content">
<div class="loading-spinner"></div>
<h3>Analyzing Repository...</h3>
<p id="loading-message">Fetching repository data and processing commit history...</p>
</div>
</section>
<section id="error-section" class="section error-section" style="display: none;">
<div class="error-content">
<h3>⚠️ Analysis Error</h3>
<p id="error-message">An error occurred during repository analysis.</p>
<button id="retry-button" class="btn btn-primary">Try Again</button>
</div>
</section>
</main>
<footer class="dashboard-footer">
<div class="footer-content">
<p>© 2025 KCoderVA | Licensed under <a href="LICENSE" target="_blank">Apache 2.0</a></p>
<p class="footer-links">
<a href="docs/user-guide.md" target="_blank">User Guide</a> |
<a href="docs/api-documentation.md" target="_blank">API Docs</a> |
<a href="https://github.com/KCoderVA" target="_blank">GitHub</a>
</p>
</div>
</footer>
</div>
<!-- Configuration and Scripts -->
<script>
// Environment Detection and Dynamic Loading
(function() {
// Detect if running locally (file://) or on a server (http/https)
const isLocal = window.location.protocol === 'file:' ||
window.location.hostname === 'localhost' ||
window.location.hostname === '127.0.0.1' ||
window.location.hostname === '';
// Detect if running on GitHub Pages
const isGitHubPages = window.location.hostname.includes('github.io');
// Set environment
window.APP_ENVIRONMENT = isLocal ? 'offline' : (isGitHubPages ? 'github-pages' : 'online');
// Update UI based on environment
document.addEventListener('DOMContentLoaded', function() {
const versionIndicator = document.getElementById('version-indicator');
const localRepoButton = document.getElementById('select-local-repo');
const localRepoNote = document.getElementById('local-repo-note');
const offlineNote = document.getElementById('offline-note');
const localHelp = document.getElementById('local-help');
const analyzeButton = document.getElementById('analyze-github-repo');
if (window.APP_ENVIRONMENT === 'offline') {
versionIndicator.textContent = '🏠 Offline Mode - Full Functionality';
versionIndicator.className = 'version-indicator offline';
localRepoButton.style.display = 'inline-block';
localHelp.style.display = 'block';
localRepoNote.style.display = 'none';
offlineNote.style.display = 'block';
analyzeButton.className = 'btn btn-secondary';
} else if (window.APP_ENVIRONMENT === 'github-pages') {
versionIndicator.textContent = '🌐 Online - GitHub Pages Hosted';
versionIndicator.className = 'version-indicator github-pages';
localRepoButton.style.display = 'none';
localHelp.style.display = 'none';
localRepoNote.style.display = 'block';
offlineNote.style.display = 'none';
analyzeButton.className = 'btn btn-primary';
} else {
versionIndicator.textContent = '☁️ Online Mode - Web Hosted';
versionIndicator.className = 'version-indicator online';
localRepoButton.style.display = 'none';
localHelp.style.display = 'none';
localRepoNote.style.display = 'block';
offlineNote.style.display = 'none';
analyzeButton.className = 'btn btn-primary';
}
});
// Dynamic script loading based on environment
function loadScript(src) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.src = src;
script.onload = resolve;
script.onerror = reject;
document.head.appendChild(script);
});
}
// Load configuration based on environment
const configScript = window.APP_ENVIRONMENT === 'offline' ?
'config/offline-config.js' : 'config/online-config.js';
// Core scripts that are always needed
const coreScripts = [
configScript,
'src/js/utils/helpers.js',
'src/js/core/github-api.js',
'src/js/core/data-processor.js',
'src/js/ui/dashboard.js',
'src/js/ui/charts.js'
];
// Additional scripts for offline version
const offlineScripts = [
'src/js/utils/file-handler.js',
'src/js/core/git-analyzer.js'
];
// Load scripts sequentially
async function loadScripts() {
try {
// Load core scripts
for (const script of coreScripts) {
await loadScript(script);
}
// Load offline-specific scripts if in offline mode
if (window.APP_ENVIRONMENT === 'offline') {
for (const script of offlineScripts) {
await loadScript(script);
}
}
console.log('All scripts loaded successfully for', window.APP_ENVIRONMENT, 'environment');
// Initialize Dashboard after all scripts are loaded
if (typeof window.initializeDashboard === 'function') {
console.log('Initializing Dashboard...');
window.initializeDashboard();
} else {
console.error('Dashboard initialization function not found');
}
} catch (error) {
console.error('Error loading scripts:', error);
// Fallback: show error message to user
document.addEventListener('DOMContentLoaded', function() {
const repoSection = document.getElementById('repo-selection');
if (repoSection) {
const errorDiv = document.createElement('div');
errorDiv.className = 'error-message';
errorDiv.textContent = 'Failed to load application scripts. Please refresh the page.';
repoSection.appendChild(errorDiv);
}
});
}
}
loadScripts();
})();
</script>
</body>
</html>