Skip to content

Commit

Permalink
fix: check terminus info takes too long (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
qq815776412 authored May 28, 2024
2 parents f30719d + 4d534c3 commit 86d0c4b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/app/src/components/common/TerminusAccountItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
class="text-subtitle2"
:style="
user.name && user.id == userStore.current_user?.id
? 'width: 100%'
: 'width: 60%'
? 'max-width: 40%'
: 'max-width: 100%'
"
style="text-align: left"
:class="{
Expand All @@ -35,7 +35,7 @@
{{ user.name ? user.local_name : t('terminus_name_not_created') }}
</div>
<div
style="max-width: 40%"
style="max-width: 60%"
v-if="user.name && user.id == userStore.current_user?.id"
>
<terminus-user-status class="q-ml-sm" />
Expand Down
8 changes: 7 additions & 1 deletion packages/app/src/components/common/TerminusUserStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</svg>
</div>
<div
class="q-ml-xs text-overline"
class="q-ml-xs text-overline status"
:class="
configTitleClass(
termipassStore.totalStatus?.isError || UserStatusActive.normal
Expand Down Expand Up @@ -161,5 +161,11 @@ const emit = defineEmits(['superAction']);
-webkit-transform: rotate(360deg);
}
}
.status {
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
}
}
</style>
2 changes: 1 addition & 1 deletion packages/app/src/pages/Desktop/TransferPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
{{ formatStampTime(props.row.endTime) }}
</div>
<q-icon
:name="props.row.isUpload ? 'sym_r_download' : 'sym_r_upload'"
:name="props.row.isUpload ? 'sym_r_upload' : 'sym_r_download'"
color="blue"
size="20px"
/>
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/platform/platformAjaxSender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class PlatformAjaxSender implements Sender {
if (
e.response.status == 525 ||
e.response.status == 530 ||
e.response.status == 522 ||
e.response.status > 1000
) {
throw new Err(ErrorCode.SERVER_NOT_EXIST);
Expand Down
6 changes: 6 additions & 0 deletions packages/app/src/utils/termipassState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ export class TermiPassState {
this.stateMachine.transition().goto(TermipassActionStatus.SrpInvalid);
if (result == ErrorCode.INVALID_SESSION) {
termipassStore.srpInvalid = true;
termipassStore.ssoInvalid = false;
} else {
if (result == ErrorCode.TOKE_INVILID) {
// 400
Expand All @@ -367,12 +368,17 @@ export class TermiPassState {
terminusInfo.terminusId == this.currentUser!.terminus_id
) {
termipassStore.ssoInvalid = true;
termipassStore.srpInvalid = false;
} else {
termipassStore.srpInvalid = true;
termipassStore.ssoInvalid = false;
}
} else {
//525
if (result == ErrorCode.SERVER_NOT_EXIST) {
termipassStore.reactivation = true;
termipassStore.srpInvalid = false;
termipassStore.ssoInvalid = false;
await this.actions.getTerminusInfo(false);
} else if (result == ErrorCode.SERVER_ERROR) {
if (this.currentUser.isLocal) {
Expand Down

0 comments on commit 86d0c4b

Please sign in to comment.