mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-12 07:23:45 +08:00
17 lines
952 B
JavaScript
17 lines
952 B
JavaScript
import { GxNotice } from './notice.js'
|
|
|
|
export const bluetoothConnection = () => (globalThis.StarPilotApp || globalThis.window?.StarPilotApp)?.bluetooth?.() === true
|
|
|
|
export const BluetoothNotice = {
|
|
name: 'BluetoothNotice',
|
|
components: { GxNotice },
|
|
props: { feature: { type: String, default: 'This feature' } },
|
|
computed: { canSwitch() { return typeof (globalThis.StarPilotApp || globalThis.window?.StarPilotApp)?.connectionOptions === 'function' } },
|
|
methods: { connections() { (globalThis.StarPilotApp || globalThis.window?.StarPilotApp)?.connectionOptions?.() } },
|
|
template: `<GxNotice class="gx-alert--bluetooth" tone="info" icon="bi-bluetooth" :title="feature">
|
|
Not available over Bluetooth. Connect using Galaxy Wi-Fi or LAN to use this feature.
|
|
<slot />
|
|
<template #actions v-if="canSwitch"><button type="button" class="gx-btn gx-btn--tonal" @click="connections">Connection options</button></template>
|
|
</GxNotice>`,
|
|
}
|