Restore desktop update terminal width and center queue statistics
This commit is contained in:
1 parent
e5048f260b
commit
38e4f0df0b
5 files changed
+30
-7
No files matched your search
@@ -80,6 +80,10 @@ storage. Из вывода удаляются пароль и строки с и
|
||||
кнопки идут одной колонкой, карточки статистики — двумя, поля ввода имеют
|
||||
шрифт 16 px, длинные имена, ID, команды и причины переносятся в своих блоках.
|
||||
Списки и вывод команды ограничены по высоте; предусмотрены отступы safe area.
|
||||
На ПК сохраняется прежняя центрированная колонка шириной до 1100 px:
|
||||
ограничения для длинного текста не растягивают её на весь экран.
|
||||
Заголовки и числа всех восьми карточек статистики, включая кнопки
|
||||
«Подробнее», выровнены по центру на ПК и мобильном экране.
|
||||
Рядом с «Вернуться в Hub» есть «Обновить список роутеров»: после завершения
|
||||
очереди кнопка убирает её результаты и получает текущий список, имена и статусы.
|
||||
Во время работающей очереди она только обновляет статусы, не удаляя задачу.
|
||||
@@ -106,7 +110,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Users\k.zolotarev95\
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Users\k.zolotarev95\Documents\openwrt overlay\vps\deploy-router-updates.ps1" -Vps "root@193.233.82.38" -Action Rollback
|
||||
```
|
||||
|
||||
Резервная копия: `/opt/owrt-remote/owrt-remote-hub.py.bak-before-router-updates-mobile-v117`.
|
||||
Резервная копия: `/opt/owrt-remote/owrt-remote-hub.py.bak-before-router-updates-desktop-width-v117`.
|
||||
Не устанавливай/не откатывай Hub, пока его очередь работает.
|
||||
|
||||
## Проверки
|
||||
@@ -128,3 +132,5 @@ Dropbear и обновление физического OpenWrt требуют
|
||||
сброс списка при обновлении роутеров. Дополнительно проверяются мобильные
|
||||
ширины 320/360/390/430 px, альбомный режим, сохранение настоящей ширины viewport
|
||||
при длинном тексте, размеры полей/кнопок и отсутствие горизонтального выезда.
|
||||
Для ПК проверяется центрирование и ограничение ширины 1100 px на экранах
|
||||
1280/1440/1920 px, а также прежнее расположение кнопок и полей.
|
||||
@@ -21,7 +21,7 @@ class RouterUpdatesDeployTests(unittest.TestCase):
|
||||
self.target = self.root / 'hub.py'
|
||||
self.previous = b'print("previous Hub")\n'
|
||||
self.target.write_bytes(self.previous)
|
||||
self.backup = self.root / 'hub.py.bak-before-router-updates-mobile-v117'
|
||||
self.backup = self.root / 'hub.py.bak-before-router-updates-desktop-width-v117'
|
||||
source = (ROOT / 'vps/deploy-router-updates.ps1').read_text(encoding='utf-8')
|
||||
self.script = source.split("$RemoteScript = @'\n", 1)[1].split("\n'@", 1)[0]
|
||||
self.script = self.script.replace('/opt/owrt-remote/owrt-remote-hub.py', self.target.as_posix())
|
||||
|
||||
@@ -214,6 +214,23 @@ const server = http.createServer((req,res)=>{
|
||||
await page.screenshot({path:path.join(root,'mobile-layout-'+viewport.width+'.png'),fullPage:true});
|
||||
assert.deepEqual(errors,[]);await page.close();
|
||||
}
|
||||
// Mobile wrapping rules must preserve the original centered desktop column.
|
||||
job=null;routers=[{id:'node-5',name:'АНТОН ВПН',online:true,last_seen:0,xray:'running'}];
|
||||
for(const width of [1280,1440,1920]) {
|
||||
const page=await browser.newPage({viewport:{width,height:900}});
|
||||
await page.goto(`http://127.0.0.1:${server.address().port}/router-updates/`);
|
||||
await page.waitForFunction(()=>!document.querySelector('#start').disabled);
|
||||
const layout=await page.evaluate(()=>{const wrap=document.querySelector('.wrap').getBoundingClientRect(),input=document.querySelector('#sshPassword').getBoundingClientRect(),start=document.querySelector('#start').getBoundingClientRect(),cancel=document.querySelector('#cancel').getBoundingClientRect(),refresh=document.querySelector('#refreshRouters').getBoundingClientRect(),back=document.querySelector('.head-actions a').getBoundingClientRect();return {left:wrap.left,right:wrap.right,width:wrap.width,viewport:innerWidth,inputWidth:input.width,inputFont:getComputedStyle(document.querySelector('#sshPassword')).fontSize,actionRow:Math.abs(start.top-cancel.top)<1,headerRow:Math.abs(refresh.top-back.top)<1,columns:getComputedStyle(document.querySelector('.metrics')).gridTemplateColumns.split(' ').length};});
|
||||
assert.equal(layout.width,1100,JSON.stringify(layout));
|
||||
assert.ok(Math.abs(layout.left-(width-layout.right))<1,JSON.stringify(layout));
|
||||
assert.equal(layout.inputWidth,480);
|
||||
assert.equal(layout.inputFont,'14px');
|
||||
assert.equal(layout.actionRow,true);
|
||||
assert.equal(layout.headerRow,true);
|
||||
assert.equal(layout.columns,4);
|
||||
await page.screenshot({path:path.join(root,'desktop-layout-'+width+'.png'),fullPage:true});
|
||||
await page.close();
|
||||
}
|
||||
job=null;routers=[];
|
||||
const dashboard=await browser.newPage();
|
||||
await dashboard.goto(`http://127.0.0.1:${server.address().port}/`);
|
||||
@@ -222,6 +239,6 @@ const server = http.createServer((req,res)=>{
|
||||
assert.equal(await link.getAttribute('href'),'/router-updates/');
|
||||
assert.match(await link.getAttribute('rel'),/noopener/);
|
||||
await dashboard.close();
|
||||
console.log('Router updates desktop/mobile dashboard, outcome lists, 320/360/390/430px and landscape layouts, live statuses, refresh, polling, reload, privacy and new-tab link: PASS');
|
||||
console.log('Router updates desktop/mobile dashboard, centered desktop widths, outcome lists, 320/360/390/430px and landscape layouts, live statuses, refresh, polling, reload, privacy and new-tab link: PASS');
|
||||
} finally {await browser.close();await new Promise(resolve=>server.close(resolve));}
|
||||
})().catch(error=>{console.error(error);process.exitCode=1;});
|
||||
Reference in new issue
Block a user