-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-unified-connection.html
More file actions
233 lines (197 loc) · 8.84 KB
/
test-unified-connection.html
File metadata and controls
233 lines (197 loc) · 8.84 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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🐱 Unified Connection Manager テスト</title>
<style>
body {
background: #0a0a0a;
color: #00ff88;
font-family: 'Courier New', monospace;
margin: 0;
padding: 20px;
}
.test-info {
background: rgba(0, 255, 136, 0.1);
border: 1px solid #00ff88;
padding: 15px;
margin-bottom: 20px;
border-radius: 5px;
}
.test-button {
background: #4a90e2;
color: white;
border: none;
padding: 10px 20px;
margin: 5px;
border-radius: 3px;
cursor: pointer;
font-family: inherit;
}
.test-button:hover {
background: #357abd;
}
.status {
background: #1a1a1a;
border: 1px solid #333;
padding: 10px;
margin: 10px 0;
border-radius: 3px;
max-height: 200px;
overflow-y: auto;
}
.status.unified {
border-color: #00ff88;
}
.status.legacy {
border-color: #ff6b35;
}
#voidflow-canvas {
border: 1px solid #333;
background: #111;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="test-info">
<h1>🐱 UnifiedConnectionManager テスト</h1>
<p><strong>使用方法:</strong></p>
<ul>
<li><code>?unified</code> - 新システム使用</li>
<li><code>?debug</code> - デバッグログ表示</li>
<li><code>?unified&debug</code> - 両方有効</li>
</ul>
<p><strong>現在のURL:</strong> <span id="current-url"></span></p>
<p><strong>システム:</strong> <span id="current-system"></span></p>
</div>
<div>
<button class="test-button" onclick="window.location.href='?'">🔄 レガシーモード</button>
<button class="test-button" onclick="window.location.href='?unified'">🚀 統合モード</button>
<button class="test-button" onclick="window.location.href='?unified&debug'">🐛 統合+デバッグ</button>
<button class="test-button" onclick="testBasicConnection()">🔗 基本接続テスト</button>
<button class="test-button" onclick="showDebugInfo()">📊 デバッグ情報</button>
</div>
<div class="status" id="status-log">
<strong>ステータスログ</strong><br>
システム読み込み中...
</div>
<div class="status unified" id="unified-status" style="display: none;">
<strong>🚀 Unified Connection Manager</strong><br>
<div id="unified-info"></div>
</div>
<div class="status legacy" id="legacy-status" style="display: none;">
<strong>🔄 Legacy Connection Manager</strong><br>
<div id="legacy-info"></div>
</div>
<!-- CharmFlow キャンバス -->
<div id="voidflow-canvas" style="width: 800px; height: 400px; position: relative;">
<svg id="voidflow-canvas-svg" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none;">
</svg>
</div>
<script type="module">
// URL情報表示
document.getElementById('current-url').textContent = window.location.search || '(なし)'
// CharmFlow読み込み
import('./charmflow_v3/js/main-nyacore.js').then(() => {
// 読み込み完了後の処理
setTimeout(() => {
updateSystemInfo()
log('✅ CharmFlow システム読み込み完了')
// 統合システム状態チェック
if (window.unifiedConnectionManager) {
document.getElementById('unified-status').style.display = 'block'
updateUnifiedInfo()
}
// レガシーシステム状態チェック
if (window.connectionManager) {
document.getElementById('legacy-status').style.display = 'block'
updateLegacyInfo()
}
}, 1000)
}).catch(error => {
log(`❌ CharmFlow読み込みエラー: ${error.message}`)
})
function updateSystemInfo() {
const params = new URLSearchParams(window.location.search)
const useUnified = params.has('unified')
const debug = params.has('debug')
document.getElementById('current-system').innerHTML =
(useUnified ? '🚀 統合モード' : '🔄 レガシーモード') +
(debug ? ' + 🐛 デバッグ' : '')
}
function updateUnifiedInfo() {
if (!window.unifiedConnectionManager) return
const info = window.unifiedConnectionManager.getDebugInfo()
document.getElementById('unified-info').innerHTML = `
モード: ${info.mode}<br>
接続数: ${info.connectionCount}<br>
プラグイン数: ${info.pluginCount}<br>
機能: ${Object.entries(info.features).map(([k,v]) => v ? `✅${k}` : `❌${k}`).join(' ')}
`
}
function updateLegacyInfo() {
if (!window.connectionManager) return
document.getElementById('legacy-info').innerHTML = `
接続数: ${window.connectionManager.connections?.size || 0}<br>
プラグイン接続: ${window.connectionManager.pluginConnections?.size || 0}
`
}
function log(message) {
const statusLog = document.getElementById('status-log')
const time = new Date().toLocaleTimeString()
statusLog.innerHTML += `<br>[${time}] ${message}`
statusLog.scrollTop = statusLog.scrollHeight
}
window.testBasicConnection = function() {
log('🔗 基本接続テストを開始...')
try {
// 使用するマネージャーを判定
const manager = window.unifiedConnectionManager?.config.useUnified ?
window.unifiedConnectionManager : window.connectionManager
if (!manager) {
log('❌ 接続マネージャーが見つかりません')
return
}
// テスト用の仮想接続を作成
const testSource = 'test-source-' + Date.now()
const testTarget = 'test-target-' + Date.now()
const connectionId = manager.createConnection(testSource, testTarget, 'test-flow')
log(`✅ テスト接続作成成功: ${connectionId}`)
// 接続情報取得テスト
const connection = manager.getConnection(connectionId)
if (connection) {
log(`✅ 接続取得成功: ${connection.sourcePluginId} → ${connection.targetPluginId}`)
} else {
log('❌ 接続取得失敗')
}
// 削除テスト
setTimeout(() => {
const removed = manager.removeConnection(connectionId)
log(removed ? '✅ テスト接続削除成功' : '❌ テスト接続削除失敗')
updateUnifiedInfo()
updateLegacyInfo()
}, 1000)
} catch (error) {
log(`❌ テストエラー: ${error.message}`)
}
}
window.showDebugInfo = function() {
log('📊 デバッグ情報を表示中...')
// Unified Manager
if (window.unifiedConnectionManager) {
const info = window.unifiedConnectionManager.getDebugInfo()
log(`🚀 Unified: ${JSON.stringify(info, null, 2)}`)
}
// Legacy Manager
if (window.connectionManager) {
const connectionsCount = window.connectionManager.connections?.size || 0
log(`🔄 Legacy: ${connectionsCount} connections`)
}
updateUnifiedInfo()
updateLegacyInfo()
}
</script>
</body>
</html>