mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-08-30 17:59:02 +00:00
42ac955052
Add the Companies app, resilient call handling, custom app registry, vendor compatibility, storage policies, frontend bridge, tests, documentation, config, locale, and SQL migrations.
40 lines
1.2 KiB
Vue
40 lines
1.2 KiB
Vue
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { useRoute } from 'vue-router'
|
|
|
|
import CustomAppFrame from '@/components/CustomAppFrame.vue'
|
|
import { getPhoneApp, isExternalPhoneApp } from '@/config/apps'
|
|
import { usePhoneStore } from '@/stores/phone'
|
|
import { getCustomAppFrameKey } from '@/utils/customAppLifecycle'
|
|
|
|
const route = useRoute()
|
|
const phone = usePhoneStore()
|
|
const app = computed(() => getPhoneApp(route.params.appId))
|
|
const launchStyle = computed(() => {
|
|
const origin = phone.launchOrigin
|
|
return {
|
|
'--launch-radius': `${origin?.borderRadius ?? 72}px`,
|
|
'--launch-scale-x': origin?.scaleX ?? 0.82,
|
|
'--launch-scale-y': origin?.scaleY ?? 0.82,
|
|
'--launch-x': `${origin?.x ?? 35}px`,
|
|
'--launch-y': `${origin?.y ?? 70}px`,
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="app" class="app-window" :style="launchStyle">
|
|
<CustomAppFrame
|
|
v-if="isExternalPhoneApp(app)"
|
|
:key="getCustomAppFrameKey(app)"
|
|
:app="app"
|
|
/>
|
|
<Suspense v-else>
|
|
<component :is="app.component" />
|
|
<template #fallback>
|
|
<div class="app-loading">{{ phone.t('Common.loading') }}</div>
|
|
</template>
|
|
</Suspense>
|
|
</div>
|
|
</template>
|