Merge branch 'preview-fixes' into preview-features

This commit is contained in:
the1812 2023-02-20 22:41:45 +08:00
commit 0efe0b32c1
6 changed files with 15 additions and 11 deletions

View File

@ -9,7 +9,7 @@
</div> </div>
<div class="live-info"> <div class="live-info">
<div class="live-title" :title="c.title">{{ c.title }}</div> <div class="live-title" :title="c.title">{{ c.title }}</div>
<div class="live-name" :title="c.name">{{ c.upName }}</div> <div class="live-name" :title="c.upName">{{ c.upName }}</div>
</div> </div>
</a> </a>
</transition-group> </transition-group>

View File

@ -3,10 +3,19 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import type { PropType } from 'vue'
import type { NavbarIframeConfig } from './iframe'
import { popperMixin } from '../mixins' import { popperMixin } from '../mixins'
import { CustomNavbarItem } from '../custom-navbar-item'
export default Vue.extend({ export default Vue.extend({
name: 'IframePopup', name: 'IframePopup',
mixins: [popperMixin], mixins: [popperMixin],
props: {
item: {
type: CustomNavbarItem as unknown as PropType<CustomNavbarItem & NavbarIframeConfig>,
required: true,
},
},
}) })
</script> </script>

View File

@ -1,6 +1,6 @@
import { CustomNavbarItemInit } from '../custom-navbar-item' import { CustomNavbarItemInit } from '../custom-navbar-item'
interface NavbarIframeConfig { export interface NavbarIframeConfig {
src: string src: string
href: string href: string
width: number width: number

View File

@ -34,8 +34,6 @@ export default Vue.extend({
data() { data() {
return { return {
client: null, client: null,
// sessions: [],
// devRecords: options.devRecords,
isConnected: false, isConnected: false,
} }
}, },
@ -44,12 +42,10 @@ export default Vue.extend({
this.client = devClient this.client = devClient
this.updateConnectionStatus() this.updateConnectionStatus()
devClient.addEventListener(DevClientEvents.ServerChange, this.updateConnectionStatus) devClient.addEventListener(DevClientEvents.ServerChange, this.updateConnectionStatus)
// devClient.addEventListener(DevClientEvents.SessionsUpdate, this.updateSessionsStatus)
}, },
beforeDestroy() { beforeDestroy() {
const devClient = this.client as DevClient const devClient = this.client as DevClient
devClient.removeEventListener(DevClientEvents.ServerChange, this.updateConnectionStatus) devClient.removeEventListener(DevClientEvents.ServerChange, this.updateConnectionStatus)
// devClient.removeEventListener(DevClientEvents.SessionsUpdate, this.updateSessionsStatus)
}, },
methods: { methods: {
async connect() { async connect() {
@ -61,9 +57,6 @@ export default Vue.extend({
updateConnectionStatus() { updateConnectionStatus() {
this.isConnected = this.client.isConnected this.isConnected = this.client.isConnected
}, },
updateSessionsStatus() {
this.sessions = [...this.client.sessions]
},
}, },
}) })
</script> </script>

View File

@ -1,6 +1,7 @@
import * as ajax from '@/core/ajax' import * as ajax from '@/core/ajax'
import * as cdnTypes from '@/core/cdn-types' import * as cdnTypes from '@/core/cdn-types'
import * as download from '@/core/download' import * as download from '@/core/download'
import * as dialog from '@/core/dialog'
import * as externalInput from '@/core/external-input' import * as externalInput from '@/core/external-input'
import * as filePicker from '@/core/file-picker' import * as filePicker from '@/core/file-picker'
import * as installFeature from '@/core/install-feature' import * as installFeature from '@/core/install-feature'
@ -40,6 +41,7 @@ export const coreApis = {
ajax, ajax,
cdnTypes, cdnTypes,
download, download,
dialog,
externalInput, externalInput,
filePicker, filePicker,
installFeature, installFeature,
@ -80,6 +82,7 @@ export const externalApis = {
ajax, ajax,
...cdnTypes, ...cdnTypes,
...download, ...download,
...dialog,
...externalInput, ...externalInput,
...filePicker, ...filePicker,
...installFeature, ...installFeature,

View File

@ -49,8 +49,7 @@ export default Vue.extend({
async mounted() { async mounted() {
await this.$nextTick() await this.$nextTick()
const appendTarget = containerMap[this.container] const appendTarget = containerMap[this.container]
this.toast = createMiniToast(this.message, this.$refs.content, { this.toast = createMiniToast(this.$refs.toast, this.$refs.content, {
content: this.$refs.toast,
placement: this.placement, placement: this.placement,
showOnCreate: this.show, showOnCreate: this.show,
trigger: 'mouseenter focusin', trigger: 'mouseenter focusin',