Skip to content

Commit

Permalink
fix: 打开时显示最后的站点状态 (#842)
Browse files Browse the repository at this point in the history
* fix: 打开时显示最后的站点状态

* fix sort status column
  • Loading branch information
sabersalv authored May 20, 2022
1 parent 6a75461 commit d363da8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 2 additions & 0 deletions resource/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@
"user": {
"notSupported": "Not Supported",
"notLogged": "Not logged",
"needLogin": "Not logged",
"unknown": "Unknown",
"getUserInfoFailed": "Failed to get username and id",
"abortGetUserInfoFailed": "Cancel request to get user information failed"
}
Expand Down
2 changes: 2 additions & 0 deletions resource/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,8 @@
"user": {
"notSupported": "暂不支持",
"notLogged": "未登录",
"needLogin": "未登录",
"unknown": "未知错误",
"getUserInfoFailed": "获取用户名和编号失败",
"abortGetUserInfoFailed": "取消获取用户信息请求失败"
}
Expand Down
18 changes: 14 additions & 4 deletions src/options/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
target="_blank"
rel="noopener noreferrer nofollow"
class="nodecoration"
>{{ props.item.user.lastErrorMsg }}</a>
<span v-else>{{ props.item.user.lastErrorMsg }}</span>
>{{ formatError(props.item.user) }}</a>
<span v-else>{{ formatError(props.item.user) }}</span>
</span>
</td>
</template>
Expand Down Expand Up @@ -446,7 +446,17 @@ export default Vue.extend({
showWeek: this.showWeek
}
});
}
},
formatError(user: any) {
if (user.lastErrorMsg) {
return user.lastErrorMsg;
}
if (user.lastUpdateStatus && user.lastUpdateStatus !== EUserDataRequestStatus.success) {
return this.$t(`service.user.${user.lastUpdateStatus}`);
}
return '';
},
},
filters: {
Expand Down Expand Up @@ -517,7 +527,7 @@ export default Vue.extend({
align: "right",
value: "user.lastUpdateTime"
},
{ text: this.$t("home.headers.status"), align: "center", value: "" }
{ text: this.$t("home.headers.status"), align: "center", value: "user.lastUpdateStatus" }
];
}
}
Expand Down

0 comments on commit d363da8

Please sign in to comment.