feat: add scoped device catalog and unlimited custom area hierarchy

This commit is contained in:
Codex
2026-10-04 11:19:14 +08:00
parent 72a3252e25
commit 5544780bf0
16 changed files with 349 additions and 66 deletions
+2 -1
View File
@@ -105,7 +105,7 @@ class WebTests(unittest.TestCase):
self.assertEqual(headers['Cache-Control'], 'no-store')
self.assertNotIn(b'__ASSET_VERSION__', body)
assets = re.findall(r'(?:src|href)="(/[^"?]+\.(?:js|css)\?v=[^"]+)"', body.decode())
self.assertEqual(len(assets), 20)
self.assertEqual(len(assets), 22)
version = (app.ROOT / 'VERSION').read_text().strip()
for asset in assets:
self.assertTrue(asset.endswith('?v=' + version))
@@ -256,6 +256,7 @@ class WebTests(unittest.TestCase):
self.assertIn('pipe:1', command)
def test_ptz_requires_both_space_and_control_permission(self):
app.save_object('sites', dict(id='permitted', name='Permitted'))
camera = dict(id='e'*16, name='Test', siteId='permitted', enabled=True)
viewer = dict(role='member', siteIds=['permitted'], ptzControl=False)
with self.assertRaises(app.Problem):app.ACCOUNTS.control(viewer, camera)