-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
406 lines (355 loc) · 15.2 KB
/
index.html
File metadata and controls
406 lines (355 loc) · 15.2 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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Verant License Server Diagnostics</title>
<script
defer
type="text/javascript"
src="datasymbol-sdk-hlp.min.js"
></script>
<script type="module" defer src="index.js"></script>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #f5f5f5;
}
.container {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1 {
color: #2c3e50;
text-align: center;
margin-bottom: 30px;
}
.test-section {
margin: 20px 0;
padding: 15px;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #fafafa;
}
.test-result {
padding: 10px;
margin: 10px 0;
border-radius: 4px;
font-weight: bold;
}
.success {
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.error {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.warning {
background-color: #fff3cd;
color: #856404;
border: 1px solid #ffeaa7;
}
.info {
background-color: #d1ecf1;
color: #0c5460;
border: 1px solid #b8daff;
}
button {
background-color: #007bff;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
margin: 5px;
}
button:hover {
background-color: #0056b3;
}
button:disabled {
background-color: #6c757d;
cursor: not-allowed;
}
.details {
font-family: monospace;
background-color: #f8f9fa;
padding: 10px;
border-radius: 4px;
font-size: 12px;
white-space: pre-wrap;
max-height: 200px;
overflow-y: auto;
}
.system-info {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
font-size: 14px;
}
.loading {
display: inline-block;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div class="container">
<h1>🔧 Verant License Server Diagnostics</h1>
<div class="test-result info">
<strong>Instructions:</strong> Run all tests from the same machine and browser where you're experiencing license issues.
Share the results with Verant support.
<br><br>
<a href="index-staging.html">🧪 Test against staging server instead</a>
</div>
<!-- System Information -->
<div class="test-section">
<h3>📋 System Information</h3>
<div class="system-info" id="systemInfo">
<div>Browser: <span id="browserInfo">Loading...</span></div>
<div>User Agent: <span id="userAgent">Loading...</span></div>
<div>Current URL: <span id="currentUrl">Loading...</span></div>
<div>Timestamp: <span id="timestamp">Loading...</span></div>
<div>Screen Resolution: <span id="screenRes">Loading...</span></div>
<div>Timezone: <span id="timezone">Loading...</span></div>
</div>
</div>
<!-- DNS Test -->
<div class="test-section">
<h3>🌐 DNS Resolution Test</h3>
<button onclick="testDNS()" id="dnsBtn">Test DNS Resolution</button>
<div id="dnsResult"></div>
</div>
<!-- Barcode License API Test -->
<div class="test-section">
<h3>🔑 Barcode License API Test</h3>
<button onclick="testBarcodeLicenseAPI()" id="licenseBtn">Test License API</button>
<div id="licenseResult"></div>
</div>
<!-- Manual CloudScan Test -->
<div class="test-section">
<h3>📚 Manual CloudScan Test</h3>
<div class="test-result info">
<strong>CloudScan Library Test:</strong> If the above tests pass but your application still fails,
the issue is likely in the CloudScan library configuration or integration.
<br><br>
<strong>Next steps:</strong> Contact Verant support with these test results.
</div>
</div>
<!-- Run All Tests -->
<div class="test-section">
<h3>🚀 Run All Tests</h3>
<button onclick="runAllTests()" id="runAllBtn" style="background-color: #28a745; font-size: 16px; padding: 15px 30px;">
Run Complete Diagnostic
</button>
<button onclick="copyResults()" id="copyBtn" style="background-color: #6c757d;">
📋 Copy Results to Clipboard
</button>
</div>
<!-- Summary Results -->
<div class="test-section">
<h3>📊 Summary Results</h3>
<div id="summaryResults">
Click "Run Complete Diagnostic" to see summary results.
</div>
</div>
</div>
<script>
const LICENSE_SERVER = 'https://lic.verantid.com/api/v1';
let allResults = [];
// Initialize system info
function initSystemInfo() {
document.getElementById('browserInfo').textContent = navigator.userAgent.match(/(Chrome|Firefox|Safari|Edge)/)[0] || 'Unknown';
document.getElementById('userAgent').textContent = navigator.userAgent;
document.getElementById('currentUrl').textContent = window.location.href;
document.getElementById('timestamp').textContent = new Date().toISOString();
document.getElementById('screenRes').textContent = `${screen.width}x${screen.height}`;
document.getElementById('timezone').textContent = Intl.DateTimeFormat().resolvedOptions().timeZone;
}
// Test DNS resolution using a simple connection test
async function testDNS() {
const btn = document.getElementById('dnsBtn');
const result = document.getElementById('dnsResult');
btn.disabled = true;
btn.innerHTML = '<span class="loading">⟳</span> Testing DNS...';
const startTime = performance.now();
try {
// Test DNS by trying to connect to the license server
// Using a short timeout to isolate DNS issues
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 3000);
const response = await fetch(LICENSE_SERVER + '/get_barcode_license_key', {
method: 'GET',
signal: controller.signal,
mode: 'no-cors' // Bypass CORS to test pure connectivity
});
clearTimeout(timeoutId);
const endTime = performance.now();
result.innerHTML = `
<div class="test-result success">
✅ DNS & Connectivity: PASSED (${Math.round(endTime - startTime)}ms)
</div>
<div class="details">Successfully resolved lic.verantid.com and connected</div>
`;
allResults.push({test: 'DNS & Connectivity', status: 'PASSED', time: Math.round(endTime - startTime)});
} catch (error) {
const endTime = performance.now();
let errorMsg = error.message;
let errorType = 'Unknown Error';
if (error.name === 'AbortError') {
errorMsg = 'Connection timeout - likely DNS or network issue';
errorType = 'Timeout';
} else if (errorMsg.includes('ERR_NAME_NOT_RESOLVED')) {
errorMsg = 'DNS resolution failed - domain not found';
errorType = 'DNS Failure';
} else if (errorMsg.includes('ERR_NETWORK_ACCESS_DENIED')) {
errorMsg = 'Network access denied (firewall/proxy)';
errorType = 'Access Denied';
} else if (errorMsg.includes('ERR_FAILED')) {
errorMsg = 'Connection failed - network or firewall issue';
errorType = 'Connection Failed';
}
result.innerHTML = `
<div class="test-result error">
❌ DNS & Connectivity: FAILED (${Math.round(endTime - startTime)}ms)
</div>
<div class="details">${errorType}: ${errorMsg}</div>
`;
allResults.push({test: 'DNS & Connectivity', status: 'FAILED', time: Math.round(endTime - startTime), error: errorMsg, type: errorType});
}
btn.disabled = false;
btn.innerHTML = 'Test DNS Resolution';
}
// Test the actual barcode license API
async function testBarcodeLicenseAPI() {
const btn = document.getElementById('licenseBtn');
const result = document.getElementById('licenseResult');
btn.disabled = true;
btn.innerHTML = '<span class="loading">⟳</span> Testing License API...';
try {
const startTime = performance.now();
const response = await fetch(LICENSE_SERVER + '/get_barcode_license_key', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
const endTime = performance.now();
if (response.ok) {
const data = await response.json();
result.innerHTML = `
<div class="test-result success">
✅ License API: PASSED (${Math.round(endTime - startTime)}ms)
</div>
<div class="details">Response: ${JSON.stringify(data, null, 2)}</div>
`;
allResults.push({test: 'License API', status: 'PASSED', time: Math.round(endTime - startTime), response: data});
} else {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
} catch (error) {
const endTime = performance.now();
result.innerHTML = `
<div class="test-result error">
❌ License API: FAILED (${Math.round(endTime - startTime)}ms)
</div>
<div class="details">Error: ${error.message}</div>
`;
allResults.push({test: 'License API', status: 'FAILED', time: Math.round(endTime - startTime), error: error.message});
}
btn.disabled = false;
btn.innerHTML = 'Test License API';
}
// Run all tests sequentially
async function runAllTests() {
const btn = document.getElementById('runAllBtn');
btn.disabled = true;
btn.innerHTML = '<span class="loading">⟳</span> Running All Tests...';
allResults = []; // Clear previous results
await testDNS();
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait 1s between tests
await testBarcodeLicenseAPI();
generateSummary();
btn.disabled = false;
btn.innerHTML = 'Run Complete Diagnostic';
}
// Generate summary of all test results
function generateSummary() {
const summary = document.getElementById('summaryResults');
const passed = allResults.filter(r => r.status === 'PASSED').length;
const failed = allResults.filter(r => r.status === 'FAILED').length;
const notAvailable = allResults.filter(r => r.status === 'NOT AVAILABLE').length;
let html = `
<div class="test-result info">
<strong>Test Summary:</strong> ${passed} passed, ${failed} failed, ${notAvailable} not available
</div>
`;
allResults.forEach(result => {
const statusClass = result.status === 'PASSED' ? 'success' :
result.status === 'FAILED' ? 'error' : 'warning';
const statusIcon = result.status === 'PASSED' ? '✅' :
result.status === 'FAILED' ? '❌' : '⚠️';
html += `
<div class="test-result ${statusClass}">
${statusIcon} ${result.test}: ${result.status}
${result.time ? ` (${result.time}ms)` : ''}
</div>
`;
});
summary.innerHTML = html;
}
// Copy results to clipboard
async function copyResults() {
const systemInfo = {
browser: document.getElementById('browserInfo').textContent,
userAgent: document.getElementById('userAgent').textContent,
url: document.getElementById('currentUrl').textContent,
timestamp: document.getElementById('timestamp').textContent,
screen: document.getElementById('screenRes').textContent,
timezone: document.getElementById('timezone').textContent
};
const report = `
VERANT LICENSE SERVER DIAGNOSTIC REPORT
========================================
System Information:
- Browser: ${systemInfo.browser}
- User Agent: ${systemInfo.userAgent}
- URL: ${systemInfo.url}
- Timestamp: ${systemInfo.timestamp}
- Screen: ${systemInfo.screen}
- Timezone: ${systemInfo.timezone}
Test Results:
${allResults.map(r => `- ${r.test}: ${r.status}${r.time ? ` (${r.time}ms)` : ''}${r.error ? ` - ${r.error}` : ''}`).join('\n')}
Detailed Results:
${JSON.stringify(allResults, null, 2)}
`;
try {
await navigator.clipboard.writeText(report);
alert('Diagnostic report copied to clipboard! Please paste this in your support request.');
} catch (err) {
// Fallback for older browsers
const textArea = document.createElement('textarea');
textArea.value = report;
document.body.appendChild(textArea);
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);
alert('Diagnostic report copied to clipboard! Please paste this in your support request.');
}
}
// Initialize page
document.addEventListener('DOMContentLoaded', initSystemInfo);
</script>
</body>
</html>