22< html >
33< head >
44 < meta charset ="UTF-8 ">
5- < meta http-equiv ="Content-Security-Policy " content ="default-src 'self' video-archive:; script-src 'self' 'unsafe-eval'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' ws://localhost:* http://localhost:* http:; img-src 'self' data:; media-src 'self' blob: video-archive:; frame-src http:; ">
5+ <!-- ИЗМЕНЕНИЕ ЗДЕСЬ: директива connect-src была обновлена -->
6+ < meta http-equiv ="Content-Security-Policy " content ="default-src 'self' video-archive:; script-src 'self' 'unsafe-eval' 'unsafe-inline'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' ws: http:; img-src 'self' data:; media-src 'self' blob: video-archive:; frame-src http:; ">
67 < title data-brand ="appName "> DASHBOARD for OpenIPC</ title >
78
89 < link href ="https://fonts.googleapis.com/icon?family=Material+Icons " rel ="stylesheet ">
@@ -122,49 +123,9 @@ <h3>События</h3>
122123 </ div >
123124 </ div >
124125
125- < template id ="grid-cell-content-template ">
126- < canvas class ="video-canvas video-canvas-hd "> </ canvas >
127- < canvas class ="video-canvas video-canvas-sd hidden "> </ canvas >
128- < canvas class ="overlay-canvas "> </ canvas >
129-
130- <!-- START: ИСПРАВЛЕНИЕ - ДОБАВЛЕН PTZ OVERLAY -->
131- < div class ="ptz-overlay ">
132- < div class ="ptz-btn ptz-up " data-command ="tilt_up "> < i class ="material-icons "> arrow_upward</ i > </ div >
133- < div class ="ptz-btn ptz-down " data-command ="tilt_down "> < i class ="material-icons "> arrow_downward</ i > </ div >
134- < div class ="ptz-btn ptz-left " data-command ="pan_left "> < i class ="material-icons "> arrow_back</ i > </ div >
135- < div class ="ptz-btn ptz-right " data-command ="pan_right "> < i class ="material-icons "> arrow_forward</ i > </ div >
136- </ div >
137- < div class ="ptz-zoom-controls ">
138- < div class ="ptz-btn ptz-zoom-in " data-command ="zoom_in "> < i class ="material-icons "> add</ i > </ div >
139- < div class ="ptz-btn ptz-zoom-out " data-command ="zoom_out "> < i class ="material-icons "> remove</ i > </ div >
140- </ div >
141- <!-- END: ИСПРАВЛЕНИЕ -->
142-
143- < div class ="cell-header ">
144- < span class ="cell-name "> </ span >
145- < span class ="cell-stats "> </ span >
146- </ div >
147- < div class ="cell-controls ">
148- < button class ="icon-button stream-switch-btn " title ="Переключить качество "> < i class ="material-icons "> hd</ i > </ button >
149- < button class ="icon-button audio-btn " title ="Включить звук "> < i class ="material-icons "> volume_off</ i > </ button >
150- < button class ="icon-button record-btn intellect-only " title ="Запись "> < i class ="material-icons "> fiber_manual_record</ i > </ button >
151- < button class ="icon-button fullscreen-btn " title ="На весь экран "> < i class ="material-icons "> fullscreen</ i > </ button >
152- < button class ="icon-button close-btn " title ="Закрыть "> < i class ="material-icons "> close</ i > </ button >
153- </ div >
154- < div class ="loading-overlay ">
155- < div class ="spinner "> </ div >
156- </ div >
157- < div class ="error-overlay hidden ">
158- < div class ="error-content ">
159- < i class ="material-icons error-icon "> error_outline</ i >
160- < p class ="error-message "> </ p >
161- < div class ="error-buttons ">
162- < button class ="retry-button "> </ button >
163- < button class ="close-on-error-btn "> </ button >
164- </ div >
165- </ div >
166- </ div >
167- </ template >
126+ <!-- VVVVVV --- ИЗМЕНЕНИЕ ЗДЕСЬ: ВЕСЬ БЛОК <template> БЫЛ УДАЛЕН --- VVVVVV -->
127+ <!-- Старый, захардкоженный шаблон был здесь. Теперь его нет. -->
128+ <!-- ^^^^^^ --- КОНЕЦ ИЗМЕНЕНИЯ --- ^^^^^^ -->
168129
169130 < div id ="app-toast " class ="toast-notification "> </ div >
170131
@@ -183,5 +144,15 @@ <h3>События</h3>
183144 < script src ="./js/archive-manager.js "> </ script >
184145 < script src ="./js/window-controls.js "> </ script >
185146 < script src ="./js/renderer.js "> </ script >
147+
148+ < script >
149+ // Если window.api не был создан preload-скриптом Electron,
150+ // значит, мы в обычном браузере. Подключаем наш веб-адаптер.
151+ if ( typeof window . api === 'undefined' ) {
152+ const script = document . createElement ( 'script' ) ;
153+ script . src = './js/web-api.js' ;
154+ document . body . appendChild ( script ) ;
155+ }
156+ </ script >
186157</ body >
187158</ html >
0 commit comments