Improve single camera GUI layout
This commit is contained in:
@@ -99,8 +99,14 @@ select {
|
|||||||
|
|
||||||
.control-grid {
|
.control-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 420px));
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-single {
|
||||||
|
grid-template-columns: minmax(0, 860px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.camera-card {
|
.camera-card {
|
||||||
@@ -114,6 +120,17 @@ select {
|
|||||||
box-shadow: var(--shadow);
|
box-shadow: var(--shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.grid-single .camera-card {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 0.9fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-single .media {
|
||||||
|
height: 100%;
|
||||||
|
min-height: 320px;
|
||||||
|
aspect-ratio: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.media {
|
.media {
|
||||||
position: relative;
|
position: relative;
|
||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
@@ -209,6 +226,11 @@ select {
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.grid-single .card-body {
|
||||||
|
justify-content: center;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
.card-main {
|
.card-main {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
@@ -232,6 +254,10 @@ h2 {
|
|||||||
gap: 11px;
|
gap: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.grid-single .control-stack {
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.action-control {
|
.action-control {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
@@ -491,6 +517,20 @@ h3 {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.grid-single,
|
||||||
|
.control-grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-single .camera-card {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-single .media {
|
||||||
|
min-height: 0;
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
max-width: 60%;
|
max-width: 60%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<section class="control-grid">
|
<section class="{grid_class}">
|
||||||
{cards}
|
{cards}
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -293,6 +293,7 @@ def render_page(actions, lang, token_param=None):
|
|||||||
cards_markup = "".join(cards)
|
cards_markup = "".join(cards)
|
||||||
if not cards_markup and not global_markup:
|
if not cards_markup and not global_markup:
|
||||||
cards_markup = f'<section class="empty-state">{html.escape(text_for(lang, "no_actions"))}</section>'
|
cards_markup = f'<section class="empty-state">{html.escape(text_for(lang, "no_actions"))}</section>'
|
||||||
|
grid_class = "control-grid grid-single" if len(groups) == 1 else "control-grid"
|
||||||
token_input = (
|
token_input = (
|
||||||
f'<input type="hidden" name="token" value="{html.escape(token_param)}">'
|
f'<input type="hidden" name="token" value="{html.escape(token_param)}">'
|
||||||
if token_param
|
if token_param
|
||||||
@@ -308,5 +309,6 @@ def render_page(actions, lang, token_param=None):
|
|||||||
language_options=render_language_options(lang),
|
language_options=render_language_options(lang),
|
||||||
token_input=token_input,
|
token_input=token_input,
|
||||||
global_actions=global_markup,
|
global_actions=global_markup,
|
||||||
|
grid_class=html.escape(grid_class),
|
||||||
cards=cards_markup,
|
cards=cards_markup,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class UiRenderTest(unittest.TestCase):
|
|||||||
|
|
||||||
html = render_page(actions, "en")
|
html = render_page(actions, "en")
|
||||||
|
|
||||||
|
self.assertIn('class="control-grid grid-single"', html)
|
||||||
self.assertEqual(html.count('class="camera-card"'), 1)
|
self.assertEqual(html.count('class="camera-card"'), 1)
|
||||||
self.assertEqual(html.count('class="action-control"'), 3)
|
self.assertEqual(html.count('class="action-control"'), 3)
|
||||||
self.assertIn("3 controls", html)
|
self.assertIn("3 controls", html)
|
||||||
|
|||||||
Reference in New Issue
Block a user