@hatiolab/things-scene 3.4.45 → 8.0.0-alpha.1
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.
- package/db.sqlite +0 -0
- package/monitor-extension/background.js +21 -0
- package/monitor-extension/content.js +65 -0
- package/monitor-extension/devtools.html +38 -0
- package/monitor-extension/devtools.js +155 -0
- package/monitor-extension/icons/icon128.png +0 -0
- package/monitor-extension/icons/icon16.png +0 -0
- package/monitor-extension/icons/icon48.png +0 -0
- package/monitor-extension/injected.js +28 -0
- package/monitor-extension/libs/Chart.min.js +7 -0
- package/monitor-extension/libs/apexchart.min.js +24151 -0
- package/monitor-extension/manifest.json +34 -0
- package/monitor-extension/popup.html +37 -0
- package/monitor-extension/popup.js +99 -0
- package/package.json +9 -3
- package/schema.graphql +548 -59
- package/things-scene-ie.js +1 -1
- package/things-scene-min.js +1 -1
- package/things-scene.mjs +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"name": "Board Monitor",
|
|
4
|
+
"version": "1.0",
|
|
5
|
+
"description": "Monitoring extention for Operato Board",
|
|
6
|
+
"permissions": ["activeTab", "scripting", "storage"],
|
|
7
|
+
"action": {
|
|
8
|
+
"default_popup": "popup.html",
|
|
9
|
+
"default_icon": {
|
|
10
|
+
"16": "icons/icon16.png",
|
|
11
|
+
"48": "icons/icon48.png",
|
|
12
|
+
"128": "icons/icon128.png"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"background": {
|
|
16
|
+
"service_worker": "background.js"
|
|
17
|
+
},
|
|
18
|
+
"devtools_page": "devtools.html",
|
|
19
|
+
"content_scripts": [
|
|
20
|
+
{
|
|
21
|
+
"matches": ["<all_urls>"],
|
|
22
|
+
"js": ["content.js"]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"web_accessible_resources": [
|
|
26
|
+
{
|
|
27
|
+
"resources": ["injected.js"],
|
|
28
|
+
"matches": ["<all_urls>"]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"content_security_policy": {
|
|
32
|
+
"extension_pages": "script-src 'self'; object-src 'self'"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Component Residents Monitor</title>
|
|
7
|
+
<script src="libs/Chart.min.js"></script>
|
|
8
|
+
<script src="popup.js"></script>
|
|
9
|
+
|
|
10
|
+
<style>
|
|
11
|
+
body {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 10px;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
min-width: 400px;
|
|
18
|
+
min-height: 800px;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
canvas {
|
|
23
|
+
flex: 1;
|
|
24
|
+
border: 1px solid #000;
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
width: 100%;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
<h1>Component Residents Monitor</h1>
|
|
33
|
+
<canvas id="residentChart1"></canvas>
|
|
34
|
+
<canvas id="residentChart2"></canvas>
|
|
35
|
+
<canvas id="residentChart3"></canvas>
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
2
|
+
let residentChart1, residentChart2, residentChart3
|
|
3
|
+
let chartsInitialized = false
|
|
4
|
+
let listenerRegistered = false
|
|
5
|
+
|
|
6
|
+
// 현재 활성 탭의 tabId 가져오기
|
|
7
|
+
chrome.tabs.query({ active: true, currentWindow: true }, tabs => {
|
|
8
|
+
if (tabs.length === 0) {
|
|
9
|
+
console.error('No active tab found.')
|
|
10
|
+
return
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const tabId = tabs[0].id
|
|
14
|
+
|
|
15
|
+
// 차트 생성 함수
|
|
16
|
+
const createChart = (ctx, label) => {
|
|
17
|
+
return new Chart(ctx, {
|
|
18
|
+
type: 'line',
|
|
19
|
+
data: {
|
|
20
|
+
labels: [],
|
|
21
|
+
datasets: [
|
|
22
|
+
{
|
|
23
|
+
label: label,
|
|
24
|
+
data: [],
|
|
25
|
+
borderColor: 'rgba(75, 192, 192, 1)',
|
|
26
|
+
borderWidth: 1,
|
|
27
|
+
fill: false
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
options: {
|
|
32
|
+
scales: {
|
|
33
|
+
x: {
|
|
34
|
+
display: false,
|
|
35
|
+
ticks: {
|
|
36
|
+
display: false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
y: {
|
|
40
|
+
title: {
|
|
41
|
+
display: true,
|
|
42
|
+
text: label
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 차트가 초기화되지 않았을 때만 차트 생성
|
|
51
|
+
if (!chartsInitialized) {
|
|
52
|
+
const ctx1 = document.getElementById('residentChart1').getContext('2d')
|
|
53
|
+
const ctx2 = document.getElementById('residentChart2').getContext('2d')
|
|
54
|
+
const ctx3 = document.getElementById('residentChart3').getContext('2d')
|
|
55
|
+
|
|
56
|
+
residentChart1 = createChart(ctx1, 'Component Residents Count')
|
|
57
|
+
residentChart2 = createChart(ctx2, 'Scene Residents Count')
|
|
58
|
+
residentChart3 = createChart(ctx3, 'ReferenceMap Residents Count')
|
|
59
|
+
|
|
60
|
+
chartsInitialized = true // 차트가 초기화되었음을 표시
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 차트 업데이트 함수
|
|
64
|
+
const updateCharts = data => {
|
|
65
|
+
residentChart1.data.labels = data.map(entry => entry.timestamp)
|
|
66
|
+
residentChart1.data.datasets[0].data = data.map(entry => entry.componentResidentsCount)
|
|
67
|
+
residentChart1.update()
|
|
68
|
+
|
|
69
|
+
residentChart2.data.labels = data.map(entry => entry.timestamp)
|
|
70
|
+
residentChart2.data.datasets[0].data = data.map(entry => entry.sceneResidentsCount)
|
|
71
|
+
residentChart2.update()
|
|
72
|
+
|
|
73
|
+
residentChart3.data.labels = data.map(entry => entry.timestamp)
|
|
74
|
+
residentChart3.data.datasets[0].data = data.map(entry => entry.referenceMapResidentsCount)
|
|
75
|
+
residentChart3.update()
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 저장된 데이터 가져오기 및 초기 로딩
|
|
79
|
+
chrome.storage.local.get({ residentData: {} }, result => {
|
|
80
|
+
const residentData = result.residentData
|
|
81
|
+
|
|
82
|
+
if (residentData[tabId] && residentData[tabId].length > 0) {
|
|
83
|
+
updateCharts(residentData[tabId])
|
|
84
|
+
} else {
|
|
85
|
+
console.log('No resident data found for this tab.')
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
// 메시지 리스너 중복 등록 방지
|
|
90
|
+
if (!listenerRegistered) {
|
|
91
|
+
chrome.runtime.onMessage.addListener(message => {
|
|
92
|
+
if (message.type === 'UPDATE_CHART' && message.tabId === tabId) {
|
|
93
|
+
updateCharts(message.data)
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
listenerRegistered = true // 리스너가 등록되었음을 표시
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatiolab/things-scene",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.1",
|
|
4
4
|
"description": "2D graphic library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "things-scene.mjs",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@babel/register": "^7.17.7",
|
|
49
49
|
"@rollup/plugin-commonjs": "^22.0.2",
|
|
50
50
|
"@rollup/plugin-node-resolve": "^14.1.0",
|
|
51
|
-
"@things-factory/builder": "^
|
|
52
|
-
"@things-factory/operato-board": "^
|
|
51
|
+
"@things-factory/builder": "^8.0.0-alpha",
|
|
52
|
+
"@things-factory/operato-board": "^8.0.0-alpha",
|
|
53
53
|
"atob": "^2.1.2",
|
|
54
54
|
"babel-eslint": "^10.1.0",
|
|
55
55
|
"babel-jest": "^29.0.3",
|
|
@@ -87,5 +87,11 @@
|
|
|
87
87
|
},
|
|
88
88
|
"optionalDependencies": {
|
|
89
89
|
"canvas": "^2.9.1"
|
|
90
|
+
},
|
|
91
|
+
"resolutions": {
|
|
92
|
+
"@azure/storage-blob": "12.18.0",
|
|
93
|
+
"lit": "^3.0.0",
|
|
94
|
+
"passport": "^0.7.0",
|
|
95
|
+
"puppeteer": "22.12.1"
|
|
90
96
|
}
|
|
91
97
|
}
|