81 lines
1.6 KiB
Vue
Raw Normal View History

2020-01-22 17:16:40 +00:00
<template>
<ul>
<li><i @click.stop.prevent="about" class="fas fa-question-circle" /></li>
<li>
<i
class="fas fa-shield-alt"
v-tooltip="{
2020-04-05 02:57:22 +00:00
content: $t('admin_loggedin'),
2020-01-22 17:16:40 +00:00
placement: 'right',
offset: 5,
boundariesElement: 'body',
}"
v-if="admin"
/>
</li>
2021-04-02 15:29:27 +00:00
<li>
<select v-model="$i18n.locale">
<option v-for="(lang, i) in langs" :key="`Lang${i}`" :value="lang">
{{ lang }}
</option>
</select>
</li>
2020-01-22 17:16:40 +00:00
</ul>
</template>
<style lang="scss" scoped>
ul {
li {
display: inline-block;
margin-right: 10px;
i {
font-size: 24px;
cursor: pointer;
}
}
}
2021-04-02 15:29:27 +00:00
select {
appearance: none;
background-color: $background-tertiary;
border: 1px solid $background-primary;
color: white;
cursor: pointer;
border-radius: 5px;
height: 24px;
vertical-align: text-bottom;
display: inline-block;
option {
font-weight: normal;
color: $text-normal;
background-color: $background-tertiary;
}
&:hover {
border: 1px solid $background-primary;
}
}
2020-01-22 17:16:40 +00:00
</style>
<script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
2021-04-02 15:29:27 +00:00
import { messages } from '~/locale'
2020-01-22 17:16:40 +00:00
@Component({ name: 'neko-menu' })
export default class extends Vue {
get admin() {
return this.$accessor.user.admin
}
2021-04-02 15:29:27 +00:00
get langs() {
return Object.keys(messages)
}
2020-01-22 17:16:40 +00:00
about() {
this.$accessor.client.toggleAbout()
}
}
</script>