fix prop visibility.

This commit is contained in:
Miroslav Šedivý
2023-09-24 23:24:15 +02:00
parent 122903a2b0
commit 40c313a5bd
8 changed files with 76 additions and 55 deletions
+18 -15
View File
@@ -57,9 +57,9 @@ import { AxiosError } from 'axios'
@Component
export default class Pull extends Vue {
private dialog = false
private loading = false
private nekoImage = ''
public dialog = false
public loading = false
public nekoImage = ''
get status() {
return this.$store.state.pullStatus
@@ -123,24 +123,27 @@ export default class Pull extends Vue {
private interval!: number
async mounted() {
await this.$store.dispatch('PULL_STATUS')
await this.pullStatus()
this.interval = window.setInterval(async () => {
if (!this.status.active) return
try {
await this.$store.dispatch('PULL_STATUS')
} catch(e) {
const response = (e as AxiosError).response
if (response) {
console.error('Server error', response.data)
} else {
console.error('Network error', String(e))
}
}
await this.pullStatus()
}, 1000)
}
async pullStatus() {
try {
await this.$store.dispatch('PULL_STATUS')
} catch(e) {
const response = (e as AxiosError).response
if (response) {
console.error('Server error', response.data)
} else {
console.error('Network error', String(e))
}
}
}
beforeDestroy() {
window.clearInterval(this.interval)
}
+1 -1
View File
@@ -17,7 +17,7 @@ export default class RoomActionBtn extends Vue {
@Prop(String) readonly roomId!: string
@Prop(Boolean) readonly disabled!: boolean
private loading = false
public loading = false
// eslint-disable-next-line
get tmpl(): any | undefined {
+5 -5
View File
@@ -224,12 +224,12 @@ import {
export default class RoomInfo extends Vue {
@Prop(String) readonly roomId!: string
private statsLoading = false
private statsErr = ""
private stats: RoomStats | null = null
public statsLoading = false
public statsErr = ""
public stats: RoomStats | null = null
private settingsLoading = false
private settings: RoomSettings | null = null
public settingsLoading = false
public settings: RoomSettings | null = null
get room(): RoomEntry {
return this.$store.state.rooms.find(({ id }: RoomEntry) => id == this.roomId)
+4 -3
View File
@@ -51,9 +51,8 @@ export default class RoomLink extends Vue {
@Prop(String) readonly password!: string
@Prop(String) readonly label!: string
private showPass = false
private copied = false
private copiedTimeout = 0
public showPass = false
public copied = false
get room(): RoomEntry {
return this.$store.state.rooms.find(({ id }: RoomEntry) => id == this.roomId)
@@ -78,6 +77,8 @@ export default class RoomLink extends Vue {
}).$el.querySelector('input')?.select();
}
private copiedTimeout = 0
copyToClipboard() {
if (this.copiedTimeout) {
clearInterval(this.copiedTimeout)
+16 -16
View File
@@ -513,28 +513,28 @@ export type VForm = Vue & {
export default class RoomsCreate extends Vue {
@Ref('form') readonly _form!: VForm
private valid = true
public valid = true
private screen = true
private extended = false
private expert = false
public screen = true
public extended = false
public expert = false
private showUserPass = false
private showAdminPass = false
public showUserPass = false
public showAdminPass = false
private maxFpsEnabled = true
private videoPipelineEnabled = false
private audioPipelineEnabled = false
private broadcastPipelineEnabled = false
private browserPolicyEnabled = false
public maxFpsEnabled = true
public videoPipelineEnabled = false
public audioPipelineEnabled = false
public broadcastPipelineEnabled = false
public browserPolicyEnabled = false
private loading = false
private data: RoomSettings = { ...this.$store.state.defaultRoomSettings }
private browserPolicyContent: BrowserPolicyContent = { ...this.$store.state.defaultBrowserPolicyContent }
private envList: { key: string; val: string }[] = []
public loading = false
public data: RoomSettings = { ...this.$store.state.defaultRoomSettings }
public browserPolicyContent: BrowserPolicyContent = { ...this.$store.state.defaultBrowserPolicyContent }
public envList: { key: string; val: string }[] = []
// eslint-disable-next-line
private rules: any = {
public rules: any = {
// eslint-disable-next-line
required(val: any) {
return val === null || typeof val === 'undefined' || val === "" ? 'This filed is mandatory.' : true
+3 -3
View File
@@ -85,9 +85,9 @@ import RoomActionBtn from '@/components/RoomActionBtn.vue'
export default class RoomsList extends Vue {
@Prop(Boolean) readonly loading: boolean = false
private dialog = false
private roomId = ''
private roomLoading = [] as Array<string>
public dialog = false
public roomId = ''
public roomLoading = [] as Array<string>
get headers() {
return [
+3 -3
View File
@@ -57,9 +57,9 @@ import RoomInfo from '@/components/RoomInfo.vue'
}
})
export default class RoomActionBtn extends Vue {
private dialog = false
private loading = false
private roomId = ''
public dialog = false
public loading = false
public roomId = ''
get nekoImages() {
return this.$store.state.roomsConfig.neko_images
+26 -9
View File
@@ -67,6 +67,7 @@
<script lang="ts">
import { Component, Vue, Watch } from 'vue-property-decorator'
import { AxiosError } from 'axios'
import RoomsList from '@/components/RoomsList.vue'
import RoomsQuick from '@/components/RoomsQuick.vue'
import RoomsCreate from '@/components/RoomsCreate.vue'
@@ -82,12 +83,12 @@ import { RoomEntry } from '@/api/index'
}
})
export default class Home extends Vue {
private loading = false
private dialog = false
public loading = false
public dialog = false
private interval!: number
private autoRefresh = 10
private autoRefreshItems = [
public interval!: number
public autoRefresh = 10
public autoRefreshItems = [
{ text: 'Off', value: 0 },
{ text: '5s', value: 5 },
{ text: '10s', value: 10 },
@@ -112,12 +113,18 @@ export default class Home extends Vue {
try {
await this.$store.dispatch('ROOMS_LOAD')
} catch(e) {
const response = (e as AxiosError).response
if (response) {
console.error('Server error', response.data)
} else {
console.error('Network error', String(e))
}
} finally {
this.loading = false
}
}
@Watch('autoRefresh', { immediate: true })
onAutoRefresh() {
if (this.interval) {
@@ -129,9 +136,19 @@ export default class Home extends Vue {
}
}
mounted() {
this.$store.dispatch('ROOMS_CONFIG')
this.LoadRooms()
async mounted() {
try {
await this.$store.dispatch('ROOMS_CONFIG')
} catch(e) {
const response = (e as AxiosError).response
if (response) {
console.error('Server error', response.data)
} else {
console.error('Network error', String(e))
}
}
await this.LoadRooms()
}
beforeDestroy() {