Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Home): Change the lastUpdateTime format to relative time. #1590

Merged
merged 2 commits into from
Sep 19, 2023
Merged

feat(Home): Change the lastUpdateTime format to relative time. #1590

merged 2 commits into from
Sep 19, 2023

Conversation

lqzhgood
Copy link

将首页的 最后一次数据更新时间 修改为相对时间,绝对时间放置到 title 里面

before
268508887-dfc67dec-82c1-47c5-bf59-c05c8c7ef114

after
268508708-29c77eb0-ad48-4442-a956-4f8baea8b9d2

@IITII
Copy link
Member

IITII commented Sep 17, 2023

建议做成这种
image

Copy link
Member

@IITII IITII left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

配置成开关, 可切换

@lqzhgood
Copy link
Author

lqzhgood commented Sep 18, 2023

对齐方式

  • 右对齐试过了~ 非常丑,因为相对时间是个文本描述,且长度基本一致
  • 因为这里并不存在 单行数据更新的情况,(刷新我的数据 -> 全部更新),所以这里的时间大部分情况也是一样的,即便因为某行更新失败导致数值不一样,到下一次更新时间,这段时间也不会差出一个数量级,导致文本长度变化很大

所以我认为居中更合适

是否需要做成选项

基于这个数据的内容是 最后的更新时间

  • 大家看到这个数据其实只关心距离现在的相对时间 (这个数据是否太旧,需要我去更新)
  • 更新的这个 时刻 (绝对时间)其实没有太多意义。(我并不需要通过这个时刻去联想到其他事情)

所以我认为 相对时间 应该是一个默认选项,而 绝对时间 因为并没有太多意义,不需要做成选项让其可以一直显示,但基于方便,放到 title 中即可

@IITII IITII requested a review from fzlins September 18, 2023 05:06
@IITII
Copy link
Member

IITII commented Sep 18, 2023

  • 对齐方式
    • 截个图看看吧, 这块感觉和入站时间一样, 还是右对齐好点
  • 是否需要做成选项
    • 因为显示 相对时间还是绝对时间, 这个问题本身就是有争议的. 所以目前做成开关好点.
    • 这个会影响排序吗?

@lqzhgood
Copy link
Author

lqzhgood commented Sep 18, 2023

image

image

右对齐是为了基于 不定长的数字,上下对齐,便于比较大小,最后一次更新并不需要对比~
即便是使用 绝对时间, 因为时间格式 YYYY-MM-DD HH:mm:ss 保证长度一致 也不需要右对齐来对比。

@IITII
Copy link
Member

IITII commented Sep 18, 2023

  1. 关于对齐的问题, 你可以看看这个 一个标题的小细节问题,希望能统一下 #1260
  2. 改成相对时间会影响排序吗?

@lqzhgood
Copy link
Author

lqzhgood commented Sep 18, 2023

  1. 我还是选择居中。 // you are boss 你决定吧
  2. 不影响排序,只修改了 view 中的数据显示,未涉及数据排序

确定 1 后我把选项加上再 pr

<v-btn depressed small class="lastUpdateTime"
:to="`statistic/${props.item.host}`" :title="$t('home.statistic')">
{{ props.item.user.lastUpdateTime | formatDate("YYYY-MM-DD HH:mm:ss") }}
<td v-if="showColumn('user.lastUpdateTime')" class="center">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

试了一下, 居中只和这个有关... (没发现你上面发的对比图都是一样的吗
样式上居中确实是比其他好点

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

选项你看着加吧, 默认启用就行. 不好加或者加完了, @我 merge 就行

@lqzhgood
Copy link
Author

lqzhgood commented Sep 19, 2023

@IITII
因为最后更新时间的字符串长度一致(10分钟前),所以看不太出来
我是2k屏,全屏下右对齐会让左边间距非常大,就会非常明显,截图不放大到100%很难感觉。

  1. 标题和内容居中
  2. 增加了选项,默认开启

屏幕截图 2023-09-19 094351

@IITII IITII merged commit 59b0e29 into pt-plugins:dev Sep 19, 2023
@lqzhgood lqzhgood deleted the dev branch September 19, 2023 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants