-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
643 lines (550 loc) · 18.5 KB
/
Copy pathindex.html
File metadata and controls
643 lines (550 loc) · 18.5 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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
<!--
Copyright (c) 2024 LG Electronics Inc.
SPDX-License-Identifier: Apache-2.0
-->
<!DOCTYPE html>
<html>
<head>
<title>webOS TV System Explorer</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: #FFFFFF;
overflow-x: hidden;
}
.container {
padding: 20px;
max-width: 1920px;
margin: 0 auto;
}
.header {
text-align: center;
padding: 30px 0;
border-bottom: 3px solid rgba(255, 255, 255, 0.3);
margin-bottom: 30px;
}
.header h1 {
font-size: 48px;
margin-bottom: 10px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.header p {
font-size: 18px;
opacity: 0.9;
}
.section {
background: rgba(255, 255, 255, 0.1);
border-radius: 10px;
padding: 25px;
margin-bottom: 25px;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
}
.section-title {
font-size: 28px;
margin-bottom: 20px;
color: #FFD700;
border-bottom: 2px solid rgba(255, 215, 0, 0.3);
padding-bottom: 10px;
}
.info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
gap: 15px;
}
.info-item {
background: rgba(0, 0, 0, 0.3);
padding: 15px;
border-radius: 8px;
border-left: 4px solid #4CAF50;
}
.info-label {
font-size: 14px;
color: #B0BEC5;
margin-bottom: 5px;
text-transform: uppercase;
letter-spacing: 1px;
}
.info-value {
font-size: 18px;
font-weight: bold;
color: #FFFFFF;
word-break: break-word;
}
.info-description {
font-size: 12px;
color: #90A4AE;
margin-top: 5px;
font-style: italic;
}
.status-badge {
display: inline-block;
padding: 5px 12px;
border-radius: 20px;
font-size: 12px;
font-weight: bold;
margin-left: 10px;
}
.status-success {
background: #4CAF50;
color: white;
}
.status-error {
background: #F44336;
color: white;
}
.status-warning {
background: #FF9800;
color: white;
}
.status-info {
background: #2196F3;
color: white;
}
.loading {
color: #FFD700;
font-style: italic;
}
.error {
color: #F44336;
}
.json-display {
background: rgba(0, 0, 0, 0.5);
padding: 15px;
border-radius: 8px;
font-family: 'Courier New', monospace;
font-size: 12px;
overflow-x: auto;
max-height: 300px;
overflow-y: auto;
white-space: pre-wrap;
word-wrap: break-word;
}
.button {
background: #4CAF50;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
margin: 5px;
transition: background 0.3s;
}
.button:hover {
background: #45a049;
}
.button:active {
transform: scale(0.98);
}
.refresh-btn {
position: fixed;
bottom: 30px;
right: 30px;
background: #2196F3;
color: white;
border: none;
padding: 15px 25px;
border-radius: 50px;
cursor: pointer;
font-size: 16px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
z-index: 1000;
}
.refresh-btn:hover {
background: #1976D2;
}
.timestamp {
text-align: center;
color: #B0BEC5;
font-size: 14px;
margin-top: 20px;
}
</style>
</head>
<script src="webOSTVjs-1.2.10/webOSTV.js" charset="utf-8"></script>
<script src="webOSTVjs-1.2.10/webOSTV-dev.js" charset="utf-8"></script>
<script type="text/javascript">
// Global data storage
var appData = {
deviceInfo: null,
systemInfo: null,
platformInfo: null,
appInfo: null,
networkStatus: null,
timeInfo: null,
services: {}
};
// Initialize when system is ready
webOS.onSystemReady = function() {
console.log("System is ready - Starting exploration...");
loadAllData();
};
// If system is already ready
if (window.PalmSystem && window.PalmSystem.stageReady) {
window.PalmSystem.stageReady();
}
function loadAllData() {
loadDeviceInfo();
loadSystemInfo();
loadPlatformInfo();
loadAppInfo();
loadNetworkStatus();
loadTimeInfo();
testLunaServices();
}
function loadDeviceInfo() {
webOS.deviceInfo(function(info) {
appData.deviceInfo = info;
displayDeviceInfo(info);
});
}
function loadSystemInfo() {
var sysInfo = webOS.systemInfo();
appData.systemInfo = sysInfo;
displaySystemInfo(sysInfo);
}
function loadPlatformInfo() {
var platform = webOS.platform;
appData.platformInfo = platform;
displayPlatformInfo(platform);
}
function loadAppInfo() {
var appId = webOS.fetchAppId();
var appRoot = webOS.fetchAppRootPath();
var libVersion = webOS.libVersion;
webOS.fetchAppInfo(function(appInfo) {
appData.appInfo = {
id: appId,
root: appRoot,
libVersion: libVersion,
info: appInfo
};
displayAppInfo(appData.appInfo);
});
}
function loadNetworkStatus() {
if (window.webOSDev && webOSDev.connection) {
webOSDev.connection.getStatus({
subscribe: false,
onSuccess: function(status) {
appData.networkStatus = status;
displayNetworkStatus(status);
},
onFailure: function(error) {
appData.networkStatus = { error: error };
displayNetworkStatus({ error: error });
}
});
} else {
displayNetworkStatus({ error: "webOSDev.connection not available" });
}
}
function loadTimeInfo() {
webOS.service.request("luna://com.palm.systemservice", {
method: "clock/getTime",
parameters: {},
onSuccess: function(response) {
appData.timeInfo = response;
displayTimeInfo(response);
},
onFailure: function(error) {
appData.timeInfo = { error: error };
displayTimeInfo({ error: error });
}
});
}
function testLunaServices() {
// Test Application Manager
testApplicationManager();
// Test Settings Service
testSettingsService();
// Test System Properties
testSystemProperties();
}
function testApplicationManager() {
webOS.service.request("luna://com.webos.applicationManager", {
method: "listApps",
parameters: {},
onSuccess: function(response) {
appData.services.applicationManager = {
success: true,
appsCount: response.apps ? response.apps.length : 0,
data: response
};
displayServiceResult("Application Manager", appData.services.applicationManager);
},
onFailure: function(error) {
appData.services.applicationManager = { success: false, error: error };
displayServiceResult("Application Manager", appData.services.applicationManager);
}
});
}
function testSettingsService() {
webOS.service.request("luna://com.webos.settingsservice", {
method: "getSystemSettings",
parameters: {
category: "option",
keys: ["country", "localeInfo", "timeFormat"]
},
onSuccess: function(response) {
appData.services.settings = {
success: true,
data: response
};
displayServiceResult("Settings Service", appData.services.settings);
},
onFailure: function(error) {
appData.services.settings = { success: false, error: error };
displayServiceResult("Settings Service", appData.services.settings);
}
});
}
function testSystemProperties() {
webOS.service.request("luna://com.webos.service.tv.systemproperty", {
method: "getSystemInfo",
parameters: {
keys: ["modelName", "sdkVersion", "firmwareVersion", "UHD", "OLED"]
},
onSuccess: function(response) {
appData.services.systemProperty = {
success: true,
data: response
};
displayServiceResult("System Properties", appData.services.systemProperty);
},
onFailure: function(error) {
appData.services.systemProperty = { success: false, error: error };
displayServiceResult("System Properties", appData.services.systemProperty);
}
});
}
function displayDeviceInfo(info) {
var html = '<div class="info-grid">';
if (info) {
html += createInfoItem("Model Name", info.modelName || "N/A", "TV model identifier");
html += createInfoItem("Firmware Version", info.version || "N/A", "Current firmware version");
html += createInfoItem("Version Major", info.versionMajor || "N/A", "Major version number");
html += createInfoItem("Version Minor", info.versionMinor || "N/A", "Minor version number");
html += createInfoItem("Version Dot", info.versionDot || "N/A", "Patch version number");
html += createInfoItem("SDK Version", info.sdkVersion || "N/A", "webOS SDK version");
html += createInfoItem("Screen Resolution", (info.screenWidth || "N/A") + " x " + (info.screenHeight || "N/A"), "Display resolution in pixels");
html += createInfoItem("UHD Support", formatBoolean(info.uhd), "Ultra High Definition (4K) support");
html += createInfoItem("8K Support", formatBoolean(info.uhd8K), "8K resolution support");
html += createInfoItem("OLED Display", formatBoolean(info.oled), "OLED panel technology");
html += createInfoItem("HDR10 Support", formatBoolean(info.hdr10), "HDR10 high dynamic range");
html += createInfoItem("Dolby Vision", formatBoolean(info.dolbyVision), "Dolby Vision HDR support");
html += createInfoItem("Dolby Atmos", formatBoolean(info.dolbyAtmos), "Dolby Atmos audio support");
html += createInfoItem("Brand Name", info.brandName || "N/A", "TV brand identifier");
html += createInfoItem("Manufacturer", info.manufacturer || "N/A", "Device manufacturer");
html += createInfoItem("Mainboard Maker", info.mainboardMaker || "N/A", "Mainboard manufacturer");
html += createInfoItem("DDR Size", info.ddrSize || "N/A", "System memory size");
html += createInfoItem("TV Tuner", formatBoolean(info.tuner), "Built-in TV tuner availability");
html += createInfoItem("Platform Type", info.platformBizType || "N/A", "Platform business type");
} else {
html += '<div class="info-item"><span class="error">Failed to load device information</span></div>';
}
html += '</div>';
document.getElementById('device-info-content').innerHTML = html;
}
function displaySystemInfo(info) {
var html = '<div class="info-grid">';
if (info) {
html += createInfoItem("Country", info.country || "N/A", "Device country code");
html += createInfoItem("Smart Service Country", info.smartServiceCountry || "N/A", "Smart service region");
html += createInfoItem("Timezone", info.timezone || "N/A", "System timezone");
} else {
html += '<div class="info-item"><span class="error">Failed to load system information</span></div>';
}
html += '</div>';
document.getElementById('system-info-content').innerHTML = html;
}
function displayPlatformInfo(platform) {
var html = '<div class="info-grid">';
if (platform) {
html += createInfoItem("TV Platform", formatBoolean(platform.tv), "Running on webOS TV");
html += createInfoItem("Watch Platform", formatBoolean(platform.watch), "Running on Smart Watch");
html += createInfoItem("Open Platform", formatBoolean(platform.open), "webOS Open platform");
html += createInfoItem("Legacy Platform", formatBoolean(platform.legacy), "Legacy webOS platform");
html += createInfoItem("Chrome Version", platform.chrome || "N/A", "Chromium version number");
html += createInfoItem("Unknown Platform", formatBoolean(platform.unknown), "Unknown platform type");
} else {
html += '<div class="info-item"><span class="error">Failed to load platform information</span></div>';
}
html += '</div>';
document.getElementById('platform-info-content').innerHTML = html;
}
function displayAppInfo(info) {
var html = '<div class="info-grid">';
if (info) {
html += createInfoItem("App ID", info.id || "N/A", "Unique application identifier");
html += createInfoItem("App Root Path", info.root || "N/A", "Application root directory");
html += createInfoItem("Library Version", info.libVersion || "N/A", "webOSTV.js library version");
if (info.info) {
html += createInfoItem("App Title", info.info.title || "N/A", "Application display name");
html += createInfoItem("App Version", info.info.version || "N/A", "Application version");
html += createInfoItem("Vendor", info.info.vendor || "N/A", "Application vendor");
html += createInfoItem("App Type", info.info.type || "N/A", "Application type");
}
} else {
html += '<div class="info-item"><span class="error">Failed to load app information</span></div>';
}
html += '</div>';
document.getElementById('app-info-content').innerHTML = html;
}
function displayNetworkStatus(status) {
var html = '<div class="info-grid">';
if (status.error) {
html += '<div class="info-item"><span class="error">' + JSON.stringify(status.error) + '</span></div>';
} else if (status) {
html += createInfoItem("Internet Available", formatBoolean(status.isInternetConnectionAvailable), "Internet connection status");
html += createInfoItem("Wired Connection", formatBoolean(status.wired), "Ethernet connection");
html += createInfoItem("WiFi Connection", formatBoolean(status.wifi), "Wireless connection");
html += createInfoItem("State", status.state || "N/A", "Connection state");
// Show full response
html += '</div><div class="json-display">' + JSON.stringify(status, null, 2) + '</div>';
} else {
html += '<div class="info-item"><span class="loading">Loading network status...</span></div>';
}
document.getElementById('network-info-content').innerHTML = html;
}
function displayTimeInfo(time) {
var html = '<div class="info-grid">';
if (time.error) {
html += '<div class="info-item"><span class="error">' + JSON.stringify(time.error) + '</span></div>';
} else if (time) {
html += createInfoItem("UTC Time", time.utc || "N/A", "Coordinated Universal Time");
html += createInfoItem("Local Time", time.localTime || "N/A", "Local timezone time");
html += createInfoItem("Timezone", time.timezone || "N/A", "Current timezone");
// Show full response
html += '</div><div class="json-display">' + JSON.stringify(time, null, 2) + '</div>';
} else {
html += '<div class="info-item"><span class="loading">Loading time information...</span></div>';
}
document.getElementById('time-info-content').innerHTML = html;
}
function displayServiceResult(serviceName, result) {
var containerId = 'services-content';
var container = document.getElementById(containerId);
if (!container) return;
var html = '<div class="section" style="margin-top: 15px;">';
html += '<div class="section-title">' + serviceName;
if (result.success) {
html += '<span class="status-badge status-success">SUCCESS</span>';
} else {
html += '<span class="status-badge status-error">FAILED</span>';
}
html += '</div>';
if (result.success) {
if (result.appsCount !== undefined) {
html += '<div class="info-item">';
html += '<div class="info-label">Apps Count</div>';
html += '<div class="info-value">' + result.appsCount + '</div>';
html += '<div class="info-description">Number of installed applications</div>';
html += '</div>';
}
html += '<div class="json-display">' + JSON.stringify(result.data, null, 2) + '</div>';
} else {
html += '<div class="info-item"><span class="error">Error: ' + JSON.stringify(result.error) + '</span></div>';
}
html += '</div>';
container.innerHTML += html;
}
function createInfoItem(label, value, description) {
var badge = '';
if (typeof value === 'boolean') {
badge = value ? '<span class="status-badge status-success">YES</span>' : '<span class="status-badge status-error">NO</span>';
}
return '<div class="info-item">' +
'<div class="info-label">' + label + '</div>' +
'<div class="info-value">' + value + badge + '</div>' +
'<div class="info-description">' + description + '</div>' +
'</div>';
}
function formatBoolean(value) {
if (value === true) return "Yes";
if (value === false) return "No";
return "Unknown";
}
function refreshAll() {
document.getElementById('services-content').innerHTML = '';
loadAllData();
updateTimestamp();
}
function updateTimestamp() {
var now = new Date();
document.getElementById('timestamp').textContent = 'Last updated: ' + now.toLocaleString();
}
// Update timestamp on load
window.addEventListener('load', function() {
updateTimestamp();
});
</script>
<body>
<div class="container">
<div class="header">
<h1>🔍 webOS TV System Explorer</h1>
<p>Comprehensive system information and API testing dashboard</p>
</div>
<!-- Device Information Section -->
<div class="section">
<div class="section-title">📱 Device Information</div>
<div id="device-info-content">
<div class="loading">Loading device information...</div>
</div>
</div>
<!-- Platform Information Section -->
<div class="section">
<div class="section-title">🖥️ Platform Information</div>
<div id="platform-info-content">
<div class="loading">Loading platform information...</div>
</div>
</div>
<!-- System Information Section -->
<div class="section">
<div class="section-title">⚙️ System Information</div>
<div id="system-info-content">
<div class="loading">Loading system information...</div>
</div>
</div>
<!-- Application Information Section -->
<div class="section">
<div class="section-title">📦 Application Information</div>
<div id="app-info-content">
<div class="loading">Loading application information...</div>
</div>
</div>
<!-- Network Status Section -->
<div class="section">
<div class="section-title">🌐 Network Status</div>
<div id="network-info-content">
<div class="loading">Loading network status...</div>
</div>
</div>
<!-- Time Information Section -->
<div class="section">
<div class="section-title">🕐 Time Information</div>
<div id="time-info-content">
<div class="loading">Loading time information...</div>
</div>
</div>
<!-- Luna Services Section -->
<div class="section">
<div class="section-title">🔌 Luna Service API Tests</div>
<div id="services-content">
<div class="loading">Testing Luna Services...</div>
</div>
</div>
<div class="timestamp" id="timestamp"></div>
</div>
<button class="refresh-btn" onclick="refreshAll()">🔄 Refresh All</button>
</body>
</html>