rename termipass client internals to beOS

This commit is contained in:
2026-03-09 12:30:16 +01:00
parent e4eae0361d
commit cc344bbe64
44 changed files with 293 additions and 317 deletions

View File

@@ -10,10 +10,10 @@ import { getAppPlatform } from '../../application/platform';
import { useDataStore } from '../../stores/data';
import {
TermiPassState,
TermiPassStateInfo,
useTermipassStore
} from 'src/stores/termipass';
BeOSAppState,
BeOSStateInfo,
useBeOSAppStore
} from 'src/stores/beosApp';
import { Store } from 'pinia';
import { i18n } from 'src/boot/i18n';
import { getRequestErrorMessage } from 'src/utils/notifyRedefinedUtil';
@@ -63,15 +63,15 @@ class Fetch {
// private instanceWeb: AxiosInstance;
private termipassStore: Store<
private beosAppStore: Store<
'termipass',
TermiPassState,
BeOSAppState,
{
isLocal(): boolean;
isP2P(): boolean;
isDER(): boolean;
isDirect(): boolean;
totalStatus(): TermiPassStateInfo | undefined;
totalStatus(): BeOSStateInfo | undefined;
}
>;
@@ -102,7 +102,7 @@ class Fetch {
if (
getAppPlatform().isClient &&
this.termipassStore.totalStatus?.isError !== UserStatusActive.active
this.beosAppStore.totalStatus?.isError !== UserStatusActive.active
) {
console.error('Request blocked');
return Promise.reject(new Error('Request blocked'));
@@ -157,7 +157,7 @@ class Fetch {
url: string,
config?: AxiosRequestConfig
): Promise<T> {
this.termipassStore = useTermipassStore();
this.beosAppStore = useBeOSAppStore();
const response: AxiosResponse<T> = await this.instance.get(url, config);
return response.data;
}
@@ -167,7 +167,7 @@ class Fetch {
data?: any,
config?: AxiosRequestConfig
): Promise<AxiosResponse<T>> {
this.termipassStore = useTermipassStore();
this.beosAppStore = useBeOSAppStore();
return this.instance.post(url, data, config);
}

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -11,7 +11,7 @@
class="user_status"
:class="
configIconClass(
termipassStore.totalStatus?.isError || UserStatusActive.normal
beosAppStore.totalStatus?.isError || UserStatusActive.normal
)
"
></div>
@@ -20,12 +20,12 @@
<script setup lang="ts">
import { useUserStore } from '../../stores/user';
import { useTermipassStore } from '../../stores/termipass';
import { useBeOSAppStore } from '../../stores/beosApp';
import { UserStatusActive } from '../../utils/checkTerminusState';
import { useRouter } from 'vue-router';
const userStore = useUserStore();
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const configIconClass = (active: UserStatusActive) => {
if (active == UserStatusActive.error) {

View File

@@ -11,7 +11,7 @@
class="user_status"
:class="
configIconClass(
termipassStore.totalStatus?.isError || UserStatusActive.normal
beosAppStore.totalStatus?.isError || UserStatusActive.normal
)
"
></div>
@@ -26,12 +26,12 @@
<script setup lang="ts">
import { useUserStore } from '../../stores/user';
import { useTermipassStore } from '../../stores/termipass';
import { useBeOSAppStore } from '../../stores/beosApp';
import { UserStatusActive } from '../../utils/checkTerminusState';
import AccountList from 'src/pages/Mobile/AccountListPlugin.vue';
const userStore = useUserStore();
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const configIconClass = (active: UserStatusActive) => {
if (active == UserStatusActive.error) {

View File

@@ -7,9 +7,9 @@
<div class="tabs-items row items-center justify-evenly">
<div
v-for="(item, index) in termipassStore.tabItems"
v-for="(item, index) in beosAppStore.tabItems"
:key="item.identify"
:style="`width:calc((100% - 20px)/${termipassStore.tabItems.length})`"
:style="`width:calc((100% - 20px)/${beosAppStore.tabItems.length})`"
@click="updateCurrent(index)"
class="tab-item column justify-end items-center"
>
@@ -66,7 +66,7 @@ import { getRequireImage } from '../../utils/imageUtils';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useFilesStore } from './../../stores/files';
import { useTermipassStore } from '../../stores/termipass';
import { useBeOSAppStore } from '../../stores/beosApp';
const props = defineProps({
current: {
@@ -80,7 +80,7 @@ const emit = defineEmits(['updateCurrent']);
const $router = useRouter();
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const { t } = useI18n();
@@ -91,14 +91,14 @@ const updateCurrent = (index: number) => {
if (index === props.current) {
return;
}
if (termipassStore.tabItems[index].tabChanged) {
const result = termipassStore.tabItems[index].tabChanged();
if (beosAppStore.tabItems[index].tabChanged) {
const result = beosAppStore.tabItems[index].tabChanged();
if (result) {
return;
}
}
if (termipassStore.tabItems[index].to) {
$router.replace(termipassStore.tabItems[index].to);
if (beosAppStore.tabItems[index].to) {
$router.replace(beosAppStore.tabItems[index].to);
return;
}
emit('updateCurrent', index);

View File

@@ -114,7 +114,7 @@ import { getRequireImage } from '../../utils/imageUtils';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useFilesStore } from '../../stores/files';
import { useTermipassStore } from '../../stores/termipass';
import { useBeOSAppStore } from '../../stores/beosApp';
import menuActionIcon from 'src/assets/plugin/menu-action.svg';
import menuActionIconDark from 'src/assets/plugin/menu-action-dark.svg';
import BtTooltip from 'src/components/base/BtTooltip.vue';
@@ -140,11 +140,11 @@ const $q = useQuasar();
const itemList = computed(() => {
if (!userStore.current_user?.isLargeVersion12 && process.env.IS_BEX) {
return termipassStore.tabItems.filter(
return beosAppStore.tabItems.filter(
(item) => !tabsIgnore.includes(item.identify)
);
} else {
return termipassStore.tabItems;
return beosAppStore.tabItems;
}
});
@@ -152,11 +152,11 @@ const actionIcon = computed(() => {
return $q.dark.isActive ? menuActionIconDark : menuActionIcon;
});
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const tabItemOption = computed(() => {
const top = termipassStore.tabItems.slice(0, -1);
const bottom = termipassStore.tabItems.slice(-1);
const top = beosAppStore.tabItems.slice(0, -1);
const bottom = beosAppStore.tabItems.slice(-1);
return {
top,
bottom
@@ -172,14 +172,14 @@ const updateCurrent = (index: number) => {
if (index === props.current) {
return;
}
if (termipassStore.tabItems[index].tabChanged) {
const result = termipassStore.tabItems[index].tabChanged();
if (beosAppStore.tabItems[index].tabChanged) {
const result = beosAppStore.tabItems[index].tabChanged();
if (result) {
return;
}
}
if (termipassStore.tabItems[index].to) {
$router.replace(termipassStore.tabItems[index].to);
if (beosAppStore.tabItems[index].to) {
$router.replace(beosAppStore.tabItems[index].to);
return;
}
emit('updateCurrent', index);

View File

@@ -1,35 +1,35 @@
<template>
<div
v-if="
termipassStore.totalStatus?.isError == UserStatusActive.error ||
beosAppStore.totalStatus?.isError == UserStatusActive.error ||
$slots.errorcontent
"
class="error-content text-body3 row items-center justify-center q-py-sm"
>
<q-icon name="sym_r_error" size="20px" class="q-mr-sm" />
<div v-if="!$slots.errorcontent" style="max-width: calc(100% - 70px)">
<div v-if="termipassStore.totalStatus?.description">
<div v-if="termipassStore.totalStatus.descriptionEx">
<div v-if="beosAppStore.totalStatus?.description">
<div v-if="beosAppStore.totalStatus.descriptionEx">
{{
termipassStore.totalStatus.description.split(
termipassStore.totalStatus.descriptionEx
beosAppStore.totalStatus.description.split(
beosAppStore.totalStatus.descriptionEx
)[0]
}}
<span class="jump-subline-item" @click="itemClick">
{{ termipassStore.totalStatus.descriptionEx }}
{{ beosAppStore.totalStatus.descriptionEx }}
</span>
{{
termipassStore.totalStatus.description.split(
termipassStore.totalStatus.descriptionEx
beosAppStore.totalStatus.description.split(
beosAppStore.totalStatus.descriptionEx
).length > 1
? termipassStore.totalStatus.description.split(
termipassStore.totalStatus.descriptionEx
? beosAppStore.totalStatus.description.split(
beosAppStore.totalStatus.descriptionEx
)[1]
: ''
}}
</div>
<div v-else>
{{ termipassStore.totalStatus.description }}
{{ beosAppStore.totalStatus.description }}
</div>
</div>
</div>
@@ -43,8 +43,8 @@
import { UserStatusActive } from '../../utils/checkTerminusState';
import { getPlatform } from '@didvault/sdk/src/core';
import { TerminusCommonPlatform } from '../../platform/terminusCommon/terminalCommonPlatform';
import { useTermipassStore } from '../../stores/termipass';
const termipassStore = useTermipassStore();
import { useBeOSAppStore } from '../../stores/beosApp';
const beosAppStore = useBeOSAppStore();
const itemClick = () => {
const platform = getPlatform() as unknown as TerminusCommonPlatform;

View File

@@ -4,9 +4,9 @@
:class="`${
hideBg
? ''
: termipassStore.totalStatus?.isError == UserStatusActive.error
: beosAppStore.totalStatus?.isError == UserStatusActive.error
? 'bg-red-1'
: termipassStore.totalStatus?.isError == UserStatusActive.normal
: beosAppStore.totalStatus?.isError == UserStatusActive.normal
? 'bg-background-1'
: 'bg-light-green-1'
}`"
@@ -16,16 +16,16 @@
@[clickStop]="itemClick"
>
<q-icon
:name="`sym_r_${termipassStore.totalStatus?.icon}`"
:name="`sym_r_${beosAppStore.totalStatus?.icon}`"
:color="
configIconClass(
termipassStore.totalStatus?.isError || UserStatusActive.normal
beosAppStore.totalStatus?.isError || UserStatusActive.normal
)
"
size="12px"
v-if="
termipassStore.totalStatus?.status != TermiPassStatus.VPNConnecting &&
termipassStore.totalStatus?.status != TermiPassStatus.VPNDisconnecting
beosAppStore.totalStatus?.status != BeOSAppStatus.VPNConnecting &&
beosAppStore.totalStatus?.status != BeOSAppStatus.VPNDisconnecting
"
/>
<div v-else class="row items-center justify-center q-mr-xs">
@@ -70,13 +70,13 @@
class="text-overline status"
:class="
configTitleClass(
termipassStore.totalStatus?.isError || UserStatusActive.normal
beosAppStore.totalStatus?.isError || UserStatusActive.normal
)
"
>
{{ termipassStore.totalStatus?.title }}
<q-tooltip v-if="termipassStore.totalStatus?.description">
{{ termipassStore.totalStatus?.description }}
{{ beosAppStore.totalStatus?.title }}
<q-tooltip v-if="beosAppStore.totalStatus?.description">
{{ beosAppStore.totalStatus?.description }}
</q-tooltip>
</div>
</div>
@@ -84,7 +84,7 @@
<script setup lang="ts">
import { useTerminusUserStatus } from 'src/composables/mobile/useTerminusUserStatus';
import { TermiPassStatus } from '../../utils/termipassState';
import { BeOSAppStatus } from '../../utils/beosState';
import { ref } from 'vue';
const props = defineProps({
@@ -104,7 +104,7 @@ const {
configIconClass,
configTitleClass,
UserStatusActive,
termipassStore
beosAppStore
} = useTerminusUserStatus(emit);
</script>

View File

@@ -2,25 +2,25 @@
<div
class="terminus-user-status row items-center"
:class="`${
termipassStore.totalStatus?.isError == UserStatusActive.error
beosAppStore.totalStatus?.isError == UserStatusActive.error
? 'text-red-1'
: termipassStore.totalStatus?.isError == UserStatusActive.normal
: beosAppStore.totalStatus?.isError == UserStatusActive.normal
? 'text-background-1'
: 'text-light-green-1'
}`"
@click.stop="itemClick"
>
<q-icon
:name="`sym_r_${termipassStore.totalStatus?.icon}`"
:name="`sym_r_${beosAppStore.totalStatus?.icon}`"
:color="
configIconClass(
termipassStore.totalStatus?.isError || UserStatusActive.normal
beosAppStore.totalStatus?.isError || UserStatusActive.normal
)
"
size="12px"
v-if="
termipassStore.totalStatus?.status != TermiPassStatus.VPNConnecting &&
termipassStore.totalStatus?.status != TermiPassStatus.VPNDisconnecting
beosAppStore.totalStatus?.status != BeOSAppStatus.VPNConnecting &&
beosAppStore.totalStatus?.status != BeOSAppStatus.VPNDisconnecting
"
/>
<div v-else class="row items-center justify-center q-mr-xs">
@@ -65,24 +65,24 @@
class="text-subtitle3 status"
:class="
configTitleClass(
termipassStore.totalStatus?.isError || UserStatusActive.normal
beosAppStore.totalStatus?.isError || UserStatusActive.normal
)
"
>
{{ termipassStore.totalStatus?.title }}
{{ beosAppStore.totalStatus?.title }}
</div>
</div>
</template>
<script setup lang="ts">
import { useTerminusUserStatus } from 'src/composables/mobile/useTerminusUserStatus';
import { TermiPassStatus } from '../../utils/termipassState';
import { BeOSAppStatus } from '../../utils/beosState';
const emit = defineEmits(['superAction']);
const {
itemClick,
configIconClass,
configTitleClass,
termipassStore,
beosAppStore,
UserStatusActive
} = useTerminusUserStatus(emit);
</script>

View File

@@ -11,7 +11,7 @@
class="column root items-center"
:class="isDesktop ? 'q-dialog-plugin' : 'd-createVault-mobile'"
>
<DesktopTermipassUnlockContent
<DesktopBeOSUnlockContent
v-if="isDesktop"
@unlockSuccess="onDialogOK"
@cancel="onDialogCancel"
@@ -26,7 +26,7 @@
: 'login/larepass_brand_desktop_light.svg'
"
/>
<MobileTermipassUnlockContent
<MobileBeOSUnlockContent
v-else-if="isMobile"
@unlockSuccess="onDialogOK"
@cancel="onDialogCancel"
@@ -46,8 +46,8 @@
</template>
<script setup lang="ts">
import { useDialogPluginComponent } from 'quasar';
import MobileTermipassUnlockContent from './mobile/TermipassUnlockContent.vue';
import DesktopTermipassUnlockContent from './desktop/TermipassUnlockContent.vue';
import MobileBeOSUnlockContent from './mobile/BeOSUnlockContent.vue';
import DesktopBeOSUnlockContent from './desktop/BeOSUnlockContent.vue';
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';

View File

@@ -1,12 +1,12 @@
import { getPlatform } from '@didvault/sdk/src/core';
import { TerminusCommonPlatform } from '../../platform/terminusCommon/terminalCommonPlatform';
import { useTermipassStore } from '../../stores/termipass';
import { useBeOSAppStore } from '../../stores/beosApp';
import { UserStatusActive } from '../../utils/checkTerminusState';
export function useTerminusUserStatus(emit: any) {
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const itemClick = () => {
if (termipassStore.totalStatus?.isError != UserStatusActive.error) {
if (beosAppStore.totalStatus?.isError != UserStatusActive.error) {
if (emit) emit('superAction');
return;
}
@@ -39,7 +39,7 @@ export function useTerminusUserStatus(emit: any) {
itemClick,
configIconClass,
configTitleClass,
termipassStore,
beosAppStore,
UserStatusActive
};
}

View File

@@ -21,19 +21,19 @@
>
<q-carousel-slide
:name="1"
img-src="../assets/login/termipass_slide_img.svg"
img-src="../assets/login/beos_slide_img.svg"
/>
<q-carousel-slide
:name="2"
img-src="../assets/login/termipass_slide_img.svg"
img-src="../assets/login/beos_slide_img.svg"
/>
<q-carousel-slide
:name="3"
img-src="../assets/login/termipass_slide_img.svg"
img-src="../assets/login/beos_slide_img.svg"
/>
<q-carousel-slide
:name="4"
img-src="../assets/login/termipass_slide_img.svg"
img-src="../assets/login/beos_slide_img.svg"
/>
</q-carousel>
<div class="login-layout-data text-h4 text-ink-1">

View File

@@ -36,7 +36,7 @@
userStore.isUnlocked
"
/>
<TermipassUnlockContent
<BeOSUnlockContent
v-if="
!$q.platform.is.mobile &&
menuStore.terminusActiveMenu === LayoutMenuIdetify.VAULT &&
@@ -121,11 +121,11 @@ import { useDataStore } from '../stores/data';
import { useBeOSWebsocketManagerStore } from '../stores/beosWebsocketManager';
import TerminusMenu from './../components/TerminusMenu.vue';
import SearchPage from './../components/search/LarePass/IndexPage.vue';
import SearchPage from './../components/search/BeOS/IndexPage.vue';
import { watch } from 'vue';
import TermipassUnlockContent from '../components/unlock/desktop/TermipassUnlockContent.vue';
import TermipassMobileUnlockContent from '../components/unlock/mobile/TermipassUnlockContent.vue';
import BeOSUnlockContent from '../components/unlock/desktop/BeOSUnlockContent.vue';
import TermipassMobileUnlockContent from '../components/unlock/mobile/BeOSUnlockContent.vue';
import { LayoutMenuIdetify } from '../utils/constants';
import { useI18n } from 'vue-i18n';

View File

@@ -12,7 +12,7 @@ import {
import { PrivateKey } from '@trustwallet/wallet-core/dist/src/wallet-core';
import { i18n } from '../../boot/i18n';
import { TermipassConfig } from '../../utils/config';
import { BeOSConfig } from '../../utils/config';
function getFullyQualifiedVerificationMethodID(did: string): string {
const [, , id] = did.split(':');
@@ -43,7 +43,7 @@ export async function signJWS(
t.iss = getFullyQualifiedVerificationMethodID(issuer);
t.nbf =
Math.floor(issuanceDate.getTime() / 1000) -
TermipassConfig.jwt_payload_nbf_sub_second;
BeOSConfig.jwt_payload_nbf_sub_second;
const signer = await GeneralJwsSigner.create(
new TextEncoder().encode(JSON.stringify(t)),

View File

@@ -23,19 +23,19 @@
>
<q-carousel-slide
:name="1"
img-src="../../assets/login/termipass_slide_img.svg"
img-src="../../assets/login/beos_slide_img.svg"
/>
<q-carousel-slide
:name="2"
img-src="../../assets/login/termipass_slide_img.svg"
img-src="../../assets/login/beos_slide_img.svg"
/>
<q-carousel-slide
:name="3"
img-src="../../assets/login/termipass_slide_img.svg"
img-src="../../assets/login/beos_slide_img.svg"
/>
<q-carousel-slide
:name="4"
img-src="../../assets/login/termipass_slide_img.svg"
img-src="../../assets/login/beos_slide_img.svg"
/>
</q-carousel>
<div class="login-layout-data text-h4 text-ink-1">

View File

@@ -370,8 +370,8 @@ import {
} from '../../../utils/interface/transfer';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { useTermipassStore } from '../../../stores/termipass';
import { TermiPassStatus } from '../../../utils/termipassState';
import { useBeOSAppStore } from '../../../stores/beosApp';
import { BeOSAppStatus } from '../../../utils/beosState';
import { BtNotify, NotifyDefinedType } from '@bytetrade/ui';
import {
notifyFailed,
@@ -481,8 +481,8 @@ const columnsCompleted = [
];
const pauseOrResumeAction = (item: any) => {
const termipassStore = useTermipassStore();
if (termipassStore.totalStatus?.status === TermiPassStatus.OfflineMode) {
const beosAppStore = useBeOSAppStore();
if (beosAppStore.totalStatus?.status === BeOSAppStatus.OfflineMode) {
return BtNotify.show({
type: NotifyDefinedType.WARNING,
message: t('offline_message')
@@ -521,7 +521,7 @@ const filesIcon = (name: string, isFolder: boolean) => {
};
const deleteItem = async (item: TransferItem) => {
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
if (item.front == TransferFront.cloud) {
if (
@@ -535,7 +535,7 @@ const deleteItem = async (item: TransferItem) => {
transferStore.cancel(item);
return;
}
if (termipassStore.totalStatus?.status === TermiPassStatus.OfflineMode) {
if (beosAppStore.totalStatus?.status === BeOSAppStatus.OfflineMode) {
return BtNotify.show({
type: NotifyDefinedType.WARNING,
message: t('offline_message')

View File

@@ -2,7 +2,7 @@
<div class="welcome-page column justify-start items-center">
<q-img
class="welcome-page__logo"
:src="getRequireImage('login/termipass_logo.svg')"
:src="getRequireImage('login/beos_logo.svg')"
/>
<terminus-page-title
:center="true"

View File

@@ -34,7 +34,7 @@ import { useDataStore } from '../../stores/data';
import { useFilesStore, FilesIdType } from '../../stores/files';
import { useRoute, onBeforeRouteUpdate } from 'vue-router';
import { UserStatusActive } from '../../utils/checkTerminusState';
import { useTermipassStore } from '../../stores/termipass';
import { useBeOSAppStore } from '../../stores/beosApp';
import FilesHeader from './common-files/FilesHeader.vue';
import FilesFooter from './common-files/FilesFooter.vue';
import ListingFiles from './common-files/ListingFiles.vue';
@@ -55,13 +55,13 @@ defineProps({
const store = useDataStore();
const route = useRoute();
const error = ref<any>(null);
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const filesStore = useFilesStore();
const isPad = ref(getAppPlatform() && getAppPlatform().isPad);
const operateinStore = useOperateinStore();
watch(
() => termipassStore.totalStatus?.isError,
() => beosAppStore.totalStatus?.isError,
(newVal) => {
checkUserStatus(newVal);
}
@@ -93,7 +93,7 @@ const checkUserStatus = (status: any) => {
false
);
},
termipassStore.isLocal ? 5000 : 2000
beosAppStore.isLocal ? 5000 : 2000
);
}
return true;

View File

@@ -71,9 +71,9 @@
<div
style="padding-bottom: 60px; width: 100%; height: 1px"
v-if="
termipassStore &&
termipassStore.totalStatus &&
termipassStore.totalStatus.isError == 2
beosAppStore &&
beosAppStore.totalStatus &&
beosAppStore.totalStatus.isError == 2
"
/>
<!-- </q-scroll-area> -->
@@ -135,7 +135,7 @@ import { useMenuStore } from '../../stores/menu';
import { VaultMenuItem } from '../../utils/contact';
import { autofillById } from '../../utils/bexFront';
// import { busOn, busOff } from '../../utils/bus';
import { useTermipassStore } from '../../stores/termipass';
import { useBeOSAppStore } from '../../stores/beosApp';
import { useVaultStore } from '../../stores/vault';
import { getAppPlatform } from '../../application/platform';
import {
@@ -190,7 +190,7 @@ const $q = useQuasar();
const Route = useRoute();
const menuStore = useMenuStore();
const vaultStore = useVaultStore();
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const deviceStore = useDeviceStore();
const filterInput = ref('');

View File

@@ -602,7 +602,7 @@ import { useVaultStore } from '../../stores/vault';
import { BtDialog } from '@bytetrade/ui';
import { useDeviceStore } from '../../stores/device';
import { getAppPlatform } from 'src/application/platform';
import { useTermipassStore } from 'src/stores/termipass';
import { useBeOSAppStore } from 'src/stores/beosApp';
import { UserStatusActive } from 'src/utils/checkTerminusState';
// import { redirectToSecretInPLugin } from 'src/utils/common-safe';
import TerminusSelectLocalFile from '../../components/common/TerminusSelectLocalFile.vue';
@@ -625,7 +625,7 @@ const editing_t1 = ref(props.isNew);
const showAddField = ref(false);
const meunStore = useMenuStore();
const now = new Date();
const larePassStore = useTermipassStore();
const larePassStore = useBeOSAppStore();
const nameValue = ref();

View File

@@ -79,7 +79,7 @@ import {
} from '../../../utils/BindTerminusBusiness';
import { busEmit } from '../../../utils/bus';
import { notifyFailed } from '../../../utils/notifyRedefinedUtil';
import { useTermipassStore } from '../../../stores/termipass';
import { useBeOSAppStore } from '../../../stores/beosApp';
import { getAppPlatform } from '../../../application/platform';
import { onUnmounted } from 'vue';
import TerminusWizardView from '../../../components/common/TerminusWizardView.vue';
@@ -93,7 +93,7 @@ const userStore = useUserStore();
const loading = ref(false);
const btnTitle = ref(t('complete'));
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const osPwd = ref('');
const btnStatusRef = ref<ConfirmButtonStatus>(ConfirmButtonStatus.disable);
@@ -111,9 +111,9 @@ onMounted(() => {
monitorKeyboard.onShow(() => (keyboardOpen.value = true));
monitorKeyboard.onHidden(() => (keyboardOpen.value = false));
}
if (termipassStore.srpInvalid) {
if (beosAppStore.srpInvalid) {
btnTitle.value = t('reconnect');
} else if (termipassStore.ssoInvalid) {
} else if (beosAppStore.ssoInvalid) {
btnTitle.value = t('login.title');
}
});

View File

@@ -150,9 +150,9 @@
<div
v-if="
termipassStore &&
termipassStore.totalStatus &&
termipassStore.totalStatus.isError == 2
beosAppStore &&
beosAppStore.totalStatus &&
beosAppStore.totalStatus.isError == 2
"
style="padding-bottom: 60px; width: 100%; height: 1px"
/>
@@ -176,7 +176,7 @@ import { MenuItem } from '../../../utils/contact';
import { useRouter } from 'vue-router';
import BindTerminusName from '../../../components/common/BindTerminusName.vue';
import TerminusScrollArea from '../../../components/common/TerminusScrollArea.vue';
import { useTermipassStore } from '../../../stores/termipass';
import { useBeOSAppStore } from '../../../stores/beosApp';
import { FilesIdType, useFilesStore } from '../../../stores/files';
import { useIntegrationStore } from '../../../stores/integration';
import { AccountType, IntegrationAccountMiniData } from '@bytetrade/core';
@@ -188,7 +188,7 @@ import * as filesUtil from '../../../api/files/v2/common/utils';
const { t } = useI18n();
const fileStore = useFilesStore();
const Router = useRouter();
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const integrationStore = useIntegrationStore();
// const driveList = ref();
@@ -228,11 +228,11 @@ const driveMenus = ref([
const seahubAtion = (menu: MenuItem, name?: string) => {
// const userStore = useUserStore();
// const termipassStore = useTermipassStore();
// if (termipassStore.totalStatus?.isError != UserStatusActive.active) {
// const beosAppStore = useBeOSAppStore();
// if (beosAppStore.totalStatus?.isError != UserStatusActive.active) {
// notifyFailed(
// t('the_current_status_this_module_cannot_be_accessed', {
// status: termipassStore.totalStatus?.title
// status: beosAppStore.totalStatus?.title
// })
// );
// return;

View File

@@ -11,19 +11,19 @@
>
<q-carousel-slide
:name="1"
img-src="../../../assets/login/termipass_mobile_slide_img.svg"
img-src="../../../assets/login/beos_mobile_slide_img.svg"
/>
<q-carousel-slide
:name="2"
img-src="../../../assets/login/termipass_mobile_slide_img.svg"
img-src="../../../assets/login/beos_mobile_slide_img.svg"
/>
<q-carousel-slide
:name="3"
img-src="../../../assets/login/termipass_mobile_slide_img.svg"
img-src="../../../assets/login/beos_mobile_slide_img.svg"
/>
<q-carousel-slide
:name="4"
img-src="../../../assets/login/termipass_mobile_slide_img.svg"
img-src="../../../assets/login/beos_mobile_slide_img.svg"
/>
</q-carousel>
<div class="welcome-data text-h4">{{ carouselData }}</div>

View File

@@ -12,9 +12,7 @@
>
<template v-slot:content>
<q-item
v-if="
termipassStore.totalStatus?.status == TermiPassStatus.Reactivation
"
v-if="beosAppStore.totalStatus?.status == BeOSAppStatus.Reactivation"
clickable
v-close-popup
class="account-operation-item q-pb-lg"
@@ -66,7 +64,7 @@ import { useDialogPluginComponent, useQuasar } from 'quasar';
import TerminusDialogDisplayContent from '../../../components/common/TerminusDialogDisplayContent.vue';
import { useUserStore } from '../../../stores/user';
import { TermiPassStatus } from '../../../utils/termipassState';
import { BeOSAppStatus } from '../../../utils/beosState';
import { app, clearSenderUrl, setSenderUrl } from '../../../globals';
import { useRouter } from 'vue-router';
import { useBexStore } from '../../../stores/bex';
@@ -74,7 +72,7 @@ import TerminusTipDialog from '../../../components/dialog/TerminusTipDialog.vue'
import { useI18n } from 'vue-i18n';
import { TerminusCommonPlatform } from '../../../platform/terminusCommon/terminalCommonPlatform';
import { getPlatform } from '@didvault/sdk/src/core';
import { useTermipassStore } from '../../../stores/termipass';
import { useBeOSAppStore } from '../../../stores/beosApp';
import { onMounted, ref } from 'vue';
import { getNativeAppPlatform } from 'src/application/platform';
@@ -82,7 +80,7 @@ const { dialogRef, onDialogOK } = useDialogPluginComponent();
const userStore = useUserStore();
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const $router = useRouter();

View File

@@ -48,13 +48,13 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { useTermipassStore } from '../../../stores/termipass';
import { useBeOSAppStore } from '../../../stores/beosApp';
import TerminusTitleBar from '../../../components/common/TerminusTitleBar.vue';
import TerminusScrollArea from '../../../components/common/TerminusScrollArea.vue';
import { date } from 'quasar';
const termipassStore = useTermipassStore();
const historys = ref(termipassStore.state.publicActions.getCheckHistory());
const beosAppStore = useBeOSAppStore();
const historys = ref(beosAppStore.state.publicActions.getCheckHistory());
</script>
<style scoped lang="scss">

View File

@@ -83,7 +83,7 @@ import { TerminusStatusEnum } from '../../../services/abstractions/mdns/service'
import { onMounted, onUnmounted, watch } from 'vue';
import { useRouter } from 'vue-router';
import { useTermipassStore } from '../../../stores/termipass';
import { useBeOSAppStore } from '../../../stores/beosApp';
import { busEmit } from '../../../utils/bus';
import { setSenderUrl } from '../../../globals';
import { ConfirmButtonStatus } from 'src/utils/constants';
@@ -92,7 +92,7 @@ const { t } = useI18n();
const userStore = useUserStore();
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const $q = useQuasar();
@@ -203,7 +203,7 @@ onUnmounted(() => {
});
const uninstallSuccess = async () => {
termipassStore.reactivation = true;
beosAppStore.reactivation = true;
const user = userStore.users!.items.get(userStore.current_id!)!;
user.wizard = 'restore';
user.terminus_activate_status = 'wait_activate_vault';

View File

@@ -134,9 +134,9 @@
<div
style="padding-bottom: 60px; width: 100%; height: 1px"
v-if="
termipassStore &&
termipassStore.totalStatus &&
termipassStore.totalStatus.isError == 2
beosAppStore &&
beosAppStore.totalStatus &&
beosAppStore.totalStatus.isError == 2
"
/>
<div v-else style="padding-bottom: 30px; width: 100%; height: 1px" />
@@ -161,7 +161,7 @@ import AuthItemCard from '../items/AuthItemCard2.vue';
import { getRequireImage } from '../../../utils/imageUtils';
import { useI18n } from 'vue-i18n';
import { useTermipassStore } from '../../../stores/termipass';
import { useBeOSAppStore } from '../../../stores/beosApp';
import SwitchComponent from '../../../components/common/SwitchComponent.vue';
import OlaresInfo from '../../../components/setting/OlaresInfo.vue';
import TerminusUserStatus from '../../../components/common/TerminusUserStatus.vue';
@@ -184,7 +184,7 @@ const settingMenu = [
}
];
const userStore = useUserStore();
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const $q = useQuasar();
const monitorStore = useMonitorStore();

View File

@@ -187,7 +187,7 @@ import {
TransferFront,
TransferStatus
} from '../../../utils/interface/transfer';
import { useTermipassStore } from 'src/stores/termipass';
import { useBeOSAppStore } from 'src/stores/beosApp';
import { UserStatusActive } from '../../../utils/checkTerminusState';
import { useUserStore } from 'src/stores/user';
import { useQuasar } from 'quasar';
@@ -202,7 +202,7 @@ const activeStatus = ref(TransferStatus.All);
const selectIds = ref(null);
const fileTransfer = ref();
const lockEvent = ref(false);
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const userStore = useUserStore();
const deviceStore = useDeviceStore();
const $q = useQuasar();
@@ -343,7 +343,7 @@ const hasProcessingItems = computed(() => {
});
const showOnlyWifiTransfer = computed(() => {
if (termipassStore.totalStatus?.isError === UserStatusActive.error) {
if (beosAppStore.totalStatus?.isError === UserStatusActive.error) {
return false;
}
if (

View File

@@ -5,7 +5,7 @@
<ItemList @toolabClick="onItemClicked" />
</div>
</div>
<TermipassUnlockContent
<BeOSUnlockContent
v-if="!userStore.isUnlocked"
:cancel="false"
:detailText="t('unlock.vault_unlock_introduce')"
@@ -20,7 +20,7 @@
import { useRouter } from 'vue-router';
import VaultsDrawer from '../../../layouts/TermipassLayout/VaultsDrawer.vue';
import ItemList from './../../Items/ItemList.vue';
import TermipassUnlockContent from '../../../components/unlock/mobile/TermipassUnlockContent.vue';
import BeOSUnlockContent from '../../../components/unlock/mobile/BeOSUnlockContent.vue';
import { useUserStore } from '../../../stores/user';
import { useI18n } from 'vue-i18n';
const Router = useRouter();

View File

@@ -10,8 +10,8 @@ import axios, {
import { getAppPlatform } from '../application/platform';
import { getApplication } from 'src/application/base';
import { InOfflineText } from '../utils/checkTerminusState';
import { useTermipassStore } from 'src/stores/termipass';
import { TermiPassStatus } from 'src/utils/termipassState';
import { useBeOSAppStore } from 'src/stores/beosApp';
import { BeOSAppStatus } from 'src/utils/beosState';
type RequestInterceptor = (
config: InternalAxiosRequestConfig
@@ -46,11 +46,11 @@ const totalHookMethod = [
export const axiosProxyHandler: ProxyHandler<AxiosInstanceWithIntercept> = {
get: function (target, prop: Method) {
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
if (
!getAppPlatform().isHookHttpRequest ||
!totalHookMethod.includes(prop.toLowerCase()) ||
termipassStore.totalStatus?.status == TermiPassStatus.OfflineMode
beosAppStore.totalStatus?.status == BeOSAppStatus.OfflineMode
) {
return Reflect.get(target, prop);
}
@@ -59,11 +59,11 @@ export const axiosProxyHandler: ProxyHandler<AxiosInstanceWithIntercept> = {
async apply(target, thisArg, argumentsList: InternalAxiosRequestConfig[]) {
const [config] = argumentsList;
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
if (
!getAppPlatform().isHookHttpRequest ||
!totalHookMethod.includes(config.method?.toLowerCase() || 'get') ||
termipassStore.totalStatus?.status == TermiPassStatus.OfflineMode
beosAppStore.totalStatus?.status == BeOSAppStatus.OfflineMode
) {
return Reflect.apply(target, thisArg, argumentsList);
}
@@ -233,10 +233,10 @@ export const axiosInstanceProxy = (
...config
});
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
instance.interceptors.request.use((config) => {
if (termipassStore.totalStatus?.status == TermiPassStatus.OfflineMode) {
if (beosAppStore.totalStatus?.status == BeOSAppStatus.OfflineMode) {
return Promise.reject(new Error(InOfflineText()));
}
const application = getApplication();

View File

@@ -3,7 +3,7 @@ import { isPad } from 'src/utils/platform';
import { useFilesStore, FilesIdType } from '../../stores/files';
import { watch } from 'vue';
import { useTransfer2Store } from 'src/stores/transfer2';
import { useTermipassStore } from '../../stores/termipass';
import { useBeOSAppStore } from '../../stores/beosApp';
import { useDeviceStore } from 'src/stores/device';
import { useDeviceStore as useDeviceStore2 } from 'src/stores/settings/device';
import { tabbarItems } from 'src/platform/interface/bex/front/bexTabOptions';
@@ -20,7 +20,7 @@ export class MobileWebPlatform extends TerminusCommonPlatform {
this.isPad = isPad();
const transferStore = useTransfer2Store();
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const mndsStore = useMDNSStore();
const deviceStore2 = useDeviceStore2();
@@ -41,7 +41,7 @@ export class MobileWebPlatform extends TerminusCommonPlatform {
? `${downloadingsNum + uploadingNum}`
: undefined;
}
termipassStore.tabItems[1].badge = transferBadge;
beosAppStore.tabItems[1].badge = transferBadge;
}
);
}

View File

@@ -35,8 +35,8 @@ import { MessageTopic, TermiPassDeviceInfo } from '@bytetrade/core';
import { MessageBody } from '@bytetrade/core';
import SignMessageDialog from '../../layouts/dialog/SignMessageDialog.vue';
import { i18n } from '../../boot/i18n';
import { useTermipassStore } from 'src/stores/termipass';
import { TermiPassStatus } from 'src/utils/termipassState';
import { useBeOSAppStore } from 'src/stores/beosApp';
import { BeOSAppStatus } from 'src/utils/beosState';
import DialogResetPassword from '../../pages/Electron/SettingsPage/DialogResetPassword.vue';
import AccessViaBrowserDialog from '../../components/wizard/AccessViaBrowserDialog.vue';
import { supportLanguages, languagesShort } from 'src/i18n';
@@ -350,7 +350,7 @@ export class TerminusCommonPlatform extends SubAppPlatform {
lastSyncTime: date.formatDate(app.state.lastSync, 'HH:mm:ss')
};
const termipassState = useTermipassStore();
const termipassState = useBeOSAppStore();
termipassState.state.publicActions.resetCheckEnable(true);
}
@@ -367,7 +367,7 @@ export class TerminusCommonPlatform extends SubAppPlatform {
async homeUnMounted(): Promise<void> {
commonHomeUnMounted();
busOff('appSubscribe', this.stateUpdate);
const termipassState = useTermipassStore();
const termipassState = useBeOSAppStore();
termipassState.state.publicActions.resetCheckEnable(false);
}
@@ -389,9 +389,9 @@ export class TerminusCommonPlatform extends SubAppPlatform {
}
async userStatusUpdateAction() {
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
if (termipassStore.totalStatus?.status == TermiPassStatus.Offline) {
if (beosAppStore.totalStatus?.status == BeOSAppStatus.Offline) {
this.quasar?.dialog({
component: this.quasar?.platform.is.mobile
? UserStatusCommonDialog
@@ -407,7 +407,7 @@ export class TerminusCommonPlatform extends SubAppPlatform {
return;
}
if (termipassStore.totalStatus?.status == TermiPassStatus.Reactivation) {
if (beosAppStore.totalStatus?.status == BeOSAppStatus.Reactivation) {
this.quasar?.dialog({
component: this.quasar?.platform.is.mobile
? UserStatusCommonDialog
@@ -427,7 +427,7 @@ export class TerminusCommonPlatform extends SubAppPlatform {
return;
}
if (termipassStore.totalStatus?.status == TermiPassStatus.TokenInvalid) {
if (beosAppStore.totalStatus?.status == BeOSAppStatus.TokenInvalid) {
this.quasar
?.dialog({
component: this.quasar?.platform.is.mobile
@@ -448,9 +448,7 @@ export class TerminusCommonPlatform extends SubAppPlatform {
return;
}
if (
termipassStore.totalStatus?.status == TermiPassStatus.VaultTokenInvalid
) {
if (beosAppStore.totalStatus?.status == BeOSAppStatus.VaultTokenInvalid) {
this.quasar
?.dialog({
component: this.quasar?.platform.is.mobile
@@ -471,7 +469,7 @@ export class TerminusCommonPlatform extends SubAppPlatform {
return;
}
if (termipassStore.totalStatus?.status == TermiPassStatus.RequiresVpn) {
if (beosAppStore.totalStatus?.status == BeOSAppStatus.RequiresVpn) {
const scaleStore = useScaleStore();
this.quasar
?.dialog({

View File

@@ -1,16 +1,13 @@
import { defineStore } from 'pinia';
import {
TermiPassState as TermiPassStateI,
TermiPassStatus
} from '../utils/termipassState';
import { BeOSAppState as BeOSStateI, BeOSAppStatus } from '../utils/beosState';
import { useUserStore } from './user';
import { useScaleStore } from './scale';
import { UserStatusActive } from 'src/utils/checkTerminusState';
import { i18n } from '../boot/i18n';
import { useDeviceStore } from './device';
import { TabbarItem } from '../application/interface/index';
export class TermiPassState {
state: TermiPassStateI;
export class BeOSAppState {
state: BeOSStateI;
reactivation: boolean;
srpInvalid: boolean;
ssoInvalid: boolean;
@@ -19,8 +16,8 @@ export class TermiPassState {
vpnErrorCount: number;
}
export interface TermiPassStateInfo {
status: TermiPassStatus;
export interface BeOSStateInfo {
status: BeOSAppStatus;
isError: UserStatusActive;
icon: string;
title: string;
@@ -28,13 +25,13 @@ export interface TermiPassStateInfo {
descriptionEx?: string;
}
export const useTermipassStore = defineStore('termipass', {
export const useBeOSAppStore = defineStore('termipass', {
state: () => {
return {
state: new TermiPassStateI(),
state: new BeOSStateI(),
tabItems: [] as TabbarItem[],
vpnErrorCount: 0
} as TermiPassState;
} as BeOSAppState;
},
getters: {
@@ -62,7 +59,7 @@ export const useTermipassStore = defineStore('termipass', {
const userStore = useUserStore();
return !userStore.current_user?.isLocal || true;
},
totalStatus(): TermiPassStateInfo | undefined {
totalStatus(): BeOSStateInfo | undefined {
// return UserStatus
const userStore = useUserStore();
if (!userStore.current_user) {
@@ -71,7 +68,7 @@ export const useTermipassStore = defineStore('termipass', {
if (userStore.current_user.offline_mode) {
return {
status: TermiPassStatus.OfflineMode,
status: BeOSAppStatus.OfflineMode,
isError: UserStatusActive.normal,
title: i18n.global.t('user_current_status.offline_mode.title'),
icon: 'public_off'
@@ -82,7 +79,7 @@ export const useTermipassStore = defineStore('termipass', {
if (!deviceStore.networkOnLine) {
return {
status: TermiPassStatus.Offline,
status: BeOSAppStatus.Offline,
isError: UserStatusActive.error,
title: i18n.global.t('user_current_status.networkOnLine.title'),
icon: 'wifi_tethering_error',
@@ -95,7 +92,7 @@ export const useTermipassStore = defineStore('termipass', {
if (this.reactivation) {
return {
status: TermiPassStatus.Reactivation,
status: BeOSAppStatus.Reactivation,
isError: UserStatusActive.error,
title: i18n.global.t('user_current_status.reactivation.title'),
icon: 'devices_off',
@@ -110,7 +107,7 @@ export const useTermipassStore = defineStore('termipass', {
if (this.ssoInvalid) {
return {
status: TermiPassStatus.TokenInvalid,
status: BeOSAppStatus.TokenInvalid,
isError: UserStatusActive.error,
title: i18n.global.t('user_current_status.token_invalid.title'),
icon: 'account_circle_off',
@@ -125,7 +122,7 @@ export const useTermipassStore = defineStore('termipass', {
if (this.srpInvalid) {
return {
status: TermiPassStatus.VaultTokenInvalid,
status: BeOSAppStatus.VaultTokenInvalid,
isError: UserStatusActive.error,
title: i18n.global.t('user_current_status.srp_invalid.title'),
icon: 'account_circle_off',
@@ -142,7 +139,7 @@ export const useTermipassStore = defineStore('termipass', {
if (userStore.current_user.tailscale_activated && !scaleStore.isOn) {
return {
status: TermiPassStatus.RequiresVpn,
status: BeOSAppStatus.RequiresVpn,
isError: UserStatusActive.error,
title: i18n.global.t('user_current_status.requires_vpn.title'),
icon: 'public_off',
@@ -157,7 +154,7 @@ export const useTermipassStore = defineStore('termipass', {
if (scaleStore.isConnecting) {
return {
status: TermiPassStatus.VPNConnecting,
status: BeOSAppStatus.VPNConnecting,
isError: UserStatusActive.active,
title: i18n.global.t('user_current_status.connecting.title'),
icon: ''
@@ -166,7 +163,7 @@ export const useTermipassStore = defineStore('termipass', {
if (scaleStore.isDisconnecting) {
return {
status: TermiPassStatus.VPNDisconnecting,
status: BeOSAppStatus.VPNDisconnecting,
isError: UserStatusActive.active,
title: i18n.global.t('user_current_status.disconnecting.title'),
icon: ''
@@ -177,7 +174,7 @@ export const useTermipassStore = defineStore('termipass', {
if (userStore.current_user.isLargeVersion12) {
if (scaleStore.isLocal) {
return {
status: TermiPassStatus.Intranet,
status: BeOSAppStatus.Intranet,
isError: UserStatusActive.active,
title: i18n.global.t('user_current_status.intranet.title'),
icon: 'signal_wifi_0_bar'
@@ -186,14 +183,14 @@ export const useTermipassStore = defineStore('termipass', {
}
if (this.isP2P) {
return {
status: TermiPassStatus.P2P,
status: BeOSAppStatus.P2P,
isError: UserStatusActive.active,
title: i18n.global.t('user_current_status.p2p.title'),
icon: 'vpn_lock'
};
}
return {
status: TermiPassStatus.DERP,
status: BeOSAppStatus.DERP,
isError: UserStatusActive.active,
title: i18n.global.t('user_current_status.derp.title'),
icon: 'vpn_lock'
@@ -201,7 +198,7 @@ export const useTermipassStore = defineStore('termipass', {
}
return {
status: TermiPassStatus.Internet,
status: BeOSAppStatus.Internet,
isError: UserStatusActive.active,
title: i18n.global.t(
userStore.current_user.isLocal

View File

@@ -12,9 +12,9 @@ import {
} from '../platform/terminusCommon/terminusCommonInterface';
import { app } from '../globals';
import { PreAuthKey } from '@didvault/sdk/src/core/api';
import { useTermipassStore } from './termipass';
import { useBeOSAppStore } from './beosApp';
import { UserStatusActive } from 'src/utils/checkTerminusState';
import { TermiPassStatus } from 'src/utils/termipassState';
import { BeOSAppStatus } from 'src/utils/beosState';
import { notifyFailed } from 'src/utils/notifyRedefinedUtil';
import { i18n } from 'src/boot/i18n';
@@ -251,10 +251,10 @@ export const useScaleStore = defineStore('scale', {
return this.hostPeerInfo;
},
notifyUserCannotCorrespondMethod() {
const termiPassStore = useTermipassStore();
const termiPassStore = useBeOSAppStore();
if (
termiPassStore.totalStatus?.isError != UserStatusActive.active &&
termiPassStore.totalStatus?.status != TermiPassStatus.RequiresVpn
termiPassStore.totalStatus?.status != BeOSAppStatus.RequiresVpn
) {
notifyFailed(
i18n.global.t('the_current_status_this_module_cannot_be_accessed', {

View File

@@ -12,13 +12,13 @@ import {
} from './bus';
import { useDeviceStore } from 'src/stores/device';
import { useScaleStore } from 'src/stores/scale';
import { useTermipassStore } from 'src/stores/termipass';
import { useBeOSAppStore } from 'src/stores/beosApp';
import { BuildTransition, StateMachine } from './stateMachine';
import { axiosInstanceProxy } from 'src/platform/httpProxy';
import { commonInterceptValue } from './response';
import { getAppPlatform } from 'src/application/platform';
export enum TermiPassStatus {
export enum BeOSAppStatus {
INIT = 0,
OfflineMode = 1,
Offline,
@@ -35,7 +35,7 @@ export enum TermiPassStatus {
Internet
}
enum TermipassActionStatus {
enum BeOSActionStatus {
None = 0,
UserSetupFinished,
TerminusPinged,
@@ -49,20 +49,20 @@ enum TermipassActionStatus {
Completed
}
export interface TermiPassStateInterface {
status: TermiPassStatus;
export interface BeOSStateInterface {
status: BeOSAppStatus;
}
type TermiPassStateCacheInfo = 'termimusInfo' | 'vpnStateInfo';
type BeOSStateCacheInfo = 'termimusInfo' | 'vpnStateInfo';
type TermiPassCheckItem = 'termimusInfo' | 'srpToken' | 'refreshToken';
type BeOSCheckItem = 'termimusInfo' | 'srpToken' | 'refreshToken';
interface CacheInfo<T> {
cacheDate?: Date;
info: T;
}
// termipassStore.srpInvalid = false;
// termipassStore.ssoInvalid = false;
// beosAppStore.srpInvalid = false;
// beosAppStore.ssoInvalid = false;
interface CheckHistoryResult {
before?:
| {
@@ -95,7 +95,7 @@ interface CheckLogHistoryInterface {
type: CheckLogHistoryType;
date: Date;
result?: CheckHistoryResult;
checkItem?: TermiPassCheckItem;
checkItem?: BeOSCheckItem;
reasonDesc?: string;
}
@@ -107,7 +107,7 @@ const CheckVPNStatusInfoTimeInterval = 30;
const UserCheckHistoryMaxLength = 100;
export class TermiPassState {
export class BeOSAppState {
private getVPNHostPeerInfoTimer: NodeJS.Timer | undefined;
private tokenRefresh = false;
@@ -122,10 +122,7 @@ export class TermiPassState {
private termiPassStateUserLastCheckCacheInfo: Record<
string,
Record<
TermiPassStateCacheInfo,
CacheInfo<TermiPassStateCacheInfo> | undefined
>
Record<BeOSStateCacheInfo, CacheInfo<BeOSStateCacheInfo> | undefined>
> = {};
private termiPassStateCheckHistory: Record<
@@ -148,64 +145,60 @@ export class TermiPassState {
private terminusCheckingRunLoopTimer: NodeJS.Timer | undefined;
private termipassActionStatusOptions = {
init: TermipassActionStatus.None,
onBefore: (from: TermipassActionStatus, to: TermipassActionStatus) => {
init: BeOSActionStatus.None,
onBefore: (from: BeOSActionStatus, to: BeOSActionStatus) => {
console.log('before from ===>', from);
console.log('before to ===>', to);
},
onAfter: (from: TermipassActionStatus, to: TermipassActionStatus) => {
onAfter: (from: BeOSActionStatus, to: BeOSActionStatus) => {
console.log('after from ===>', from);
console.log('after to ===>', to);
},
transitions: {
step: [],
reset: BuildTransition('*', TermipassActionStatus.None, () => {
const termipassStore = useTermipassStore();
termipassStore.srpInvalid = false;
termipassStore.ssoInvalid = false;
termipassStore.reactivation = false;
reset: BuildTransition('*', BeOSActionStatus.None, () => {
const beosAppStore = useBeOSAppStore();
beosAppStore.srpInvalid = false;
beosAppStore.ssoInvalid = false;
beosAppStore.reactivation = false;
}),
goto: BuildTransition<TermipassActionStatus>(
goto: BuildTransition<BeOSActionStatus>(
'*',
(state) => state,
(from, to) => {
const termipassStore = useTermipassStore();
if (to == TermipassActionStatus.SrpValid) {
termipassStore.srpInvalid = false;
termipassStore.ssoInvalid = false;
termipassStore.reactivation = false;
const beosAppStore = useBeOSAppStore();
if (to == BeOSActionStatus.SrpValid) {
beosAppStore.srpInvalid = false;
beosAppStore.ssoInvalid = false;
beosAppStore.reactivation = false;
this.publicActions.startTokenRefresh();
} else if (to == TermipassActionStatus.TokenRefreshed) {
if (from == TermipassActionStatus.SsoTokenInvalid) {
} else if (to == BeOSActionStatus.TokenRefreshed) {
if (from == BeOSActionStatus.SsoTokenInvalid) {
this.srpTokenCheck = true;
} else if (from == TermipassActionStatus.SrpValid) {
} else if (from == BeOSActionStatus.SrpValid) {
setTimeout(() => {
this.stateMachine
.transition()
.goto(TermipassActionStatus.Completed);
this.stateMachine.transition().goto(BeOSActionStatus.Completed);
}, 100);
}
} else if (to == TermipassActionStatus.SrpInvalid) {
termipassStore.srpInvalid = true;
termipassStore.ssoInvalid = false;
termipassStore.reactivation = false;
} else if (to == TermipassActionStatus.SsoTokenInvalid) {
} else if (to == BeOSActionStatus.SrpInvalid) {
beosAppStore.srpInvalid = true;
beosAppStore.ssoInvalid = false;
beosAppStore.reactivation = false;
} else if (to == BeOSActionStatus.SsoTokenInvalid) {
this.publicActions.startTokenRefresh();
} else if (to == TermipassActionStatus.NeedReactive) {
termipassStore.srpInvalid = false;
termipassStore.ssoInvalid = false;
termipassStore.reactivation = true;
} else if (to == TermipassActionStatus.RefreshTokenInvalid) {
if (from !== TermipassActionStatus.SrpValid) {
termipassStore.srpInvalid = false;
termipassStore.ssoInvalid = true;
termipassStore.reactivation = false;
} else if (to == BeOSActionStatus.NeedReactive) {
beosAppStore.srpInvalid = false;
beosAppStore.ssoInvalid = false;
beosAppStore.reactivation = true;
} else if (to == BeOSActionStatus.RefreshTokenInvalid) {
if (from !== BeOSActionStatus.SrpValid) {
beosAppStore.srpInvalid = false;
beosAppStore.ssoInvalid = true;
beosAppStore.reactivation = false;
}
} else if (to == TermipassActionStatus.TokenNoNeedRefresh) {
} else if (to == BeOSActionStatus.TokenNoNeedRefresh) {
setTimeout(() => {
this.stateMachine
.transition()
.goto(TermipassActionStatus.Completed);
this.stateMachine.transition().goto(BeOSActionStatus.Completed);
}, 100);
}
}
@@ -325,14 +318,10 @@ export class TermiPassState {
return this.termiPassStateCheckHistory[this.currentUser.id];
},
setSSOTokenInvalid: () => {
if (
this.stateMachine.state() == TermipassActionStatus.RefreshTokenInvalid
) {
if (this.stateMachine.state() == BeOSActionStatus.RefreshTokenInvalid) {
return;
}
this.stateMachine
.transition()
.goto(TermipassActionStatus.SsoTokenInvalid);
this.stateMachine.transition().goto(BeOSActionStatus.SsoTokenInvalid);
}
};
@@ -346,12 +335,10 @@ export class TermiPassState {
return;
}
this.currentUser = user;
this.stateMachine
.transition()
.goto(TermipassActionStatus.UserSetupFinished);
this.stateMachine.transition().goto(BeOSActionStatus.UserSetupFinished);
},
ping: async () => {
if (this.stateMachine.state() < TermipassActionStatus.UserSetupFinished) {
if (this.stateMachine.state() < BeOSActionStatus.UserSetupFinished) {
return;
}
@@ -378,10 +365,10 @@ export class TermiPassState {
this.actions.resetSenderUrl();
}
this.stateMachine.transition().goto(TermipassActionStatus.TerminusPinged);
this.stateMachine.transition().goto(BeOSActionStatus.TerminusPinged);
},
resetSenderUrl: async () => {
if (this.stateMachine.state() < TermipassActionStatus.UserSetupFinished) {
if (this.stateMachine.state() < BeOSActionStatus.UserSetupFinished) {
return;
}
if (!getAppPlatform().hookServerHttp) {
@@ -410,24 +397,24 @@ export class TermiPassState {
this.srpTokenChecking = true;
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const checkResult: CheckHistoryResult = {
before: {
reactivation: termipassStore.reactivation,
ssoInvalid: termipassStore.ssoInvalid,
srpInvalid: termipassStore.srpInvalid
reactivation: beosAppStore.reactivation,
ssoInvalid: beosAppStore.ssoInvalid,
srpInvalid: beosAppStore.srpInvalid
},
description: ''
};
if (termipassStore.reactivation) {
if (beosAppStore.reactivation) {
await this.actions.getTerminusInfo(true, false);
if (termipassStore.reactivation) {
if (beosAppStore.reactivation) {
checkResult.after = {
reactivation: termipassStore.reactivation,
ssoInvalid: termipassStore.ssoInvalid,
srpInvalid: termipassStore.srpInvalid
reactivation: beosAppStore.reactivation,
ssoInvalid: beosAppStore.ssoInvalid,
srpInvalid: beosAppStore.srpInvalid
};
checkResult.description = 'No need to check again app.simpleSync';
this.addCheckHistory(this.currentUser.id, {
@@ -447,7 +434,7 @@ export class TermiPassState {
if (result) {
checkResult.description = result;
if (result == ErrorCode.INVALID_SESSION) {
this.stateMachine.transition().goto(TermipassActionStatus.SrpInvalid);
this.stateMachine.transition().goto(BeOSActionStatus.SrpInvalid);
} else {
if (result == ErrorCode.TOKE_INVILID) {
// 400
@@ -461,18 +448,16 @@ export class TermiPassState {
) {
this.stateMachine
.transition()
.goto(TermipassActionStatus.SsoTokenInvalid);
.goto(BeOSActionStatus.SsoTokenInvalid);
} else {
this.stateMachine
.transition()
.goto(TermipassActionStatus.SrpInvalid);
this.stateMachine.transition().goto(BeOSActionStatus.SrpInvalid);
}
} else {
//525
if (result == ErrorCode.SERVER_NOT_EXIST) {
this.stateMachine
.transition()
.goto(TermipassActionStatus.NeedReactive);
.goto(BeOSActionStatus.NeedReactive);
await this.actions.getTerminusInfo(false);
} else if (result == ErrorCode.SERVER_ERROR) {
if (this.currentUser.isLocal) {
@@ -485,13 +470,13 @@ export class TermiPassState {
}
}
} else {
this.stateMachine.transition().goto(TermipassActionStatus.SrpValid);
this.stateMachine.transition().goto(BeOSActionStatus.SrpValid);
}
checkResult.after = {
reactivation: termipassStore.reactivation,
ssoInvalid: termipassStore.ssoInvalid,
srpInvalid: termipassStore.srpInvalid
reactivation: beosAppStore.reactivation,
ssoInvalid: beosAppStore.ssoInvalid,
srpInvalid: beosAppStore.srpInvalid
};
this.addCheckHistory(this.currentUser.id, {
@@ -504,7 +489,7 @@ export class TermiPassState {
},
// isPing on used in Olares 1.11
getTerminusInfo: async (addHistory = false, isPing = false) => {
if (this.stateMachine.state() < TermipassActionStatus.UserSetupFinished) {
if (this.stateMachine.state() < BeOSActionStatus.UserSetupFinished) {
return;
}
const userStore = useUserStore();
@@ -515,15 +500,15 @@ export class TermiPassState {
this.terminusInfoRefreshIng = true;
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
const checkUserId = this.currentUser.id;
const checkResult: CheckHistoryResult = {
before: {
reactivation: termipassStore.reactivation,
ssoInvalid: termipassStore.ssoInvalid,
srpInvalid: termipassStore.srpInvalid
reactivation: beosAppStore.reactivation,
ssoInvalid: beosAppStore.ssoInvalid,
srpInvalid: beosAppStore.srpInvalid
},
description: ''
};
@@ -558,14 +543,14 @@ export class TermiPassState {
this.currentUser.isLocal = false;
this.actions.resetSenderUrl();
termipassStore.reactivation = true;
beosAppStore.reactivation = true;
await userStore.setUserTerminusInfo(this.currentUser.id, undefined);
checkResult.description = data.data;
} else {
const terminusInfo: OlaresInfo = data.data.data;
termipassStore.reactivation = false;
termipassStore.vpnErrorCount = 0;
beosAppStore.reactivation = false;
beosAppStore.vpnErrorCount = 0;
await userStore.setUserTerminusInfo(
this.currentUser.id,
@@ -581,10 +566,10 @@ export class TermiPassState {
return terminusInfo;
}
} catch (e) {
const termipassStore = useTermipassStore();
const beosAppStore = useBeOSAppStore();
checkResult.description = e.message;
if (!isPing) {
termipassStore.updateVpn();
beosAppStore.updateVpn();
}
if (!isPing && (e.response || process.env.PLATFORM == 'BEX')) {
@@ -598,20 +583,20 @@ export class TermiPassState {
if (this.currentUser.tailscale_activated) {
const scaleStore = useScaleStore();
if (!scaleStore.isOn) {
termipassStore.reactivation = false;
termipassStore.srpInvalid = false;
termipassStore.ssoInvalid = false;
beosAppStore.reactivation = false;
beosAppStore.srpInvalid = false;
beosAppStore.ssoInvalid = false;
return;
}
}
termipassStore.reactivation = true;
beosAppStore.reactivation = true;
}
}
} finally {
this.terminusInfoRefreshIng = false;
if (saveLastTerminusInfo) {
this.setTermiPassStateUserLastCheckCacheInfo(
this.setBeOSAppStateUserLastCheckCacheInfo(
checkUserId,
'termimusInfo',
{
@@ -623,9 +608,9 @@ export class TermiPassState {
if (addHistory) {
checkResult.after = {
reactivation: termipassStore.reactivation,
ssoInvalid: termipassStore.ssoInvalid,
srpInvalid: termipassStore.srpInvalid
reactivation: beosAppStore.reactivation,
ssoInvalid: beosAppStore.ssoInvalid,
srpInvalid: beosAppStore.srpInvalid
};
this.addCheckHistory(this.currentUser.id, {
type: 'check',
@@ -662,20 +647,18 @@ export class TermiPassState {
}
this.tokenRefreshIng = true;
const result = await userStore.currentUserRefreshToken(
this.stateMachine.state() == TermipassActionStatus.SsoTokenInvalid
this.stateMachine.state() == BeOSActionStatus.SsoTokenInvalid
);
if (result.status) {
this.stateMachine
.transition()
.goto(TermipassActionStatus.TokenRefreshed);
this.stateMachine.transition().goto(BeOSActionStatus.TokenRefreshed);
} else if (!result.status && result.refreshError) {
this.stateMachine
.transition()
.goto(TermipassActionStatus.RefreshTokenInvalid);
.goto(BeOSActionStatus.RefreshTokenInvalid);
} else if (!result.status) {
this.stateMachine
.transition()
.goto(TermipassActionStatus.TokenNoNeedRefresh);
.goto(BeOSActionStatus.TokenNoNeedRefresh);
}
this.tokenRefreshIng = false;
@@ -701,7 +684,7 @@ export class TermiPassState {
return;
}
const date = new Date();
const cacheVPNCheckInfo = this.getTermiPassStateUserLastCheckCacheInfo(
const cacheVPNCheckInfo = this.getBeOSAppStateUserLastCheckCacheInfo(
this.currentUser.id,
'vpnStateInfo'
);
@@ -713,7 +696,7 @@ export class TermiPassState {
date.getTime() / 1000
) {
await this.actions.getVPNHostPeerInfo();
this.setTermiPassStateUserLastCheckCacheInfo(
this.setBeOSAppStateUserLastCheckCacheInfo(
this.currentUser.id,
'vpnStateInfo',
{
@@ -740,9 +723,9 @@ export class TermiPassState {
);
}
private getTermiPassStateUserLastCheckCacheInfo(
private getBeOSAppStateUserLastCheckCacheInfo(
userId: string,
type: TermiPassStateCacheInfo
type: BeOSStateCacheInfo
) {
try {
this.configUserStatus(userId);
@@ -767,10 +750,10 @@ export class TermiPassState {
}
}
private setTermiPassStateUserLastCheckCacheInfo(
private setBeOSAppStateUserLastCheckCacheInfo(
userId: string,
type: TermiPassStateCacheInfo,
cache?: CacheInfo<TermiPassStateCacheInfo>
type: BeOSStateCacheInfo,
cache?: CacheInfo<BeOSStateCacheInfo>
) {
if (!this.termiPassStateUserLastCheckCacheInfo[userId]) {
this.configUserStatus(userId);
@@ -824,7 +807,7 @@ export class TermiPassState {
if (!this.currentUser) {
return;
}
const cacheTerminusInfo = this.getTermiPassStateUserLastCheckCacheInfo(
const cacheTerminusInfo = this.getBeOSAppStateUserLastCheckCacheInfo(
this.currentUser.id,
'termimusInfo'
);

View File

@@ -1,3 +1,3 @@
export const TermipassConfig = {
export const BeOSConfig = {
jwt_payload_nbf_sub_second: 0
};

View File

@@ -13,7 +13,7 @@ import {
import { VaultItem, VaultType, uuid } from '@didvault/sdk/src/core';
import { i18n } from 'src/boot/i18n';
import { GeneralJwsSigner } from 'src/jose/jws/general/signer';
import { TermipassConfig } from './config';
import { BeOSConfig } from './config';
export interface VCCardInfo {
type: string;
@@ -61,7 +61,7 @@ export async function signVerifiableCredentialJWT(
t.iss = cred.issuer;
t.nbf =
Math.floor(new Date(cred.issuanceDate).getTime() / 1000) -
TermipassConfig.jwt_payload_nbf_sub_second;
BeOSConfig.jwt_payload_nbf_sub_second;
t.jti = cred.id;
t.sub = cred.credentialSubject.id;
t.vc = cred;