Improve user-interactions

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-07-13 13:45:14 +02:00
parent 8ec3e66f42
commit d6f2b0bb51
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E
11 changed files with 26 additions and 31 deletions

View file

@ -1,7 +1,7 @@
<template>
<nav class="navbar fixed-top navbar-expand-lg bg-body-tertiary user-select-none">
<nav class="navbar fixed-top navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<span class="navbar-brand user-select-none">
<span class="navbar-brand">
<i class="fas fa-robot fa-fw me-1 text-info" />
Twitch-Bot
</span>

View file

@ -4,14 +4,14 @@
v-for="section in navigation"
:key="section.header"
>
<div class="navHeading user-select-none">
<div class="navHeading">
{{ section.header }}
</div>
<RouterLink
v-for="link in section.links"
:key="link.target"
:to="{name: link.target}"
class="nav-link user-select-none"
class="nav-link"
>
<i :class="`${link.icon} fa-fw me-1`" />
{{ link.name }}

View file

@ -1,5 +1,5 @@
<template>
<div class="h-100">
<div class="h-100 user-select-none">
<head-nav :is-logged-in="true" />
<div class="layout">

View file

@ -1,5 +1,5 @@
<template>
<div class="container my-3 user-select-none">
<div class="container my-3">
<div class="row justify-content-center">
<div class="col col-9">
<div class="card">
@ -19,7 +19,7 @@
<div class="input-group">
<input
type="text"
class="form-control user-select-all"
class="form-control"
:value="authURLs?.update_bot_token || ''"
:disabled="!authURLs?.update_bot_token"
readonly

View file

@ -34,7 +34,7 @@ import { type RouteLocationRaw } from 'vue-router'
export default defineComponent({
computed: {
cardClass(): string {
const classList = ['card user-select-none']
const classList = ['card']
if (this.clickRoute) {
classList.push('pointer-click')

View file

@ -40,9 +40,9 @@ export default defineComponent({
},
mounted() {
this.bus.on(BusEventTypes.RaffleChanged, () => {
this.fetchRaffleCount()
})
// Refresh raffle counts when raffle changed
this.bus.on(BusEventTypes.RaffleChanged, () => this.fetchRaffleCount())
this.fetchRaffleCount()
},

View file

@ -1,10 +1,10 @@
<template>
<div class="card user-select-none">
<div class="card">
<div class="card-header">
{{ $t('dashboard.changelog.heading') }}
</div>
<div
class="card-body"
class="card-body user-select-text"
v-html="changelog"
/>
</div>
@ -51,9 +51,3 @@ export default defineComponent({
name: 'DashboardChangelog',
})
</script>
<style scoped>
.card-body {
user-select: text !important;
}
</style>

View file

@ -1,5 +1,5 @@
<template>
<div class="card user-select-none">
<div class="card">
<div class="card-header">
{{ $t('dashboard.eventlog.heading') }}
</div>

View file

@ -51,9 +51,9 @@ export default defineComponent({
},
mounted() {
this.bus.on(BusEventTypes.ConfigReload, () => {
this.fetchGeneralConfig()
})
// Scopes might have changed due to authorization change
this.bus.on(BusEventTypes.ConfigReload, () => this.fetchGeneralConfig())
this.fetchGeneralConfig()
},

View file

@ -82,9 +82,8 @@ const app = createApp({
.then((resp: Response) => this.parseResponseFromJSON(resp))
},
loadVars(): Promise<void | Response> {
return fetch('editor/vars.json')
.then((resp: Response) => resp.json())
loadVars(): Promise<void> {
return this.fetchJSON('editor/vars.json')
.then((data: any) => {
this.vars = data
})
@ -100,8 +99,7 @@ const app = createApp({
this.$router.replace({ name: 'dashboard' })
}
fetch(`config-editor/user?user=${this.tokenUser}`, this.$root.fetchOpts)
.then((resp: Response) => this.$root.parseResponseFromJSON(resp))
this.fetchJSON(`config-editor/user?user=${this.tokenUser}`)
.then((data: any) => {
this.userInfo = data
})
@ -129,10 +127,9 @@ const app = createApp({
return
}
fetch('config-editor/refreshToken', this.$root.fetchOpts)
.then((resp: Response) => this.$root.parseResponseFromJSON(resp))
this.fetchJSON('config-editor/refreshToken')
.then((data: any) => this.login(data.token, new Date(data.expiresAt), data.user))
.catch(err => {
.catch((err: Error) => {
// Being unable to renew a token is a reason to logout
this.logout()
throw err

View file

@ -3,3 +3,7 @@ body,
#app {
height: 100%;
}
.user-select-text {
user-select: text !important;
}