76 lines
2.4 KiB
Vue
76 lines
2.4 KiB
Vue
<template lang="pug">
|
|
.user.list-item
|
|
.avatar
|
|
img(v-if='avatar_file', v-bind:src="'/usercontent/images/' + avatar_file")
|
|
img(v-else='v-else', src='/static/image/avatar.png')
|
|
.info
|
|
.stamps
|
|
.stamp(title="Used an external login" v-if="!password")
|
|
i.fa.fa-fw.fa-sign-out
|
|
|
|
.noactive.stamp(v-if='activated == false' title='Not activated.')
|
|
i.fa.fa-fw.fa-envelope
|
|
|
|
.totp.stamp(v-if='totp_enabled' title="Two-Factor Authentication Enabled")
|
|
i.fa.fa-fw.fa-shield
|
|
|
|
.dropdown-wrapper.stamp(@click="dropdown = !dropdown" v-on-clickaway='away')
|
|
i.fa.fa-fw.fa-ellipsis-v
|
|
transition(name="pop")
|
|
.dropdown(v-show="dropdown")
|
|
.title Actions
|
|
.action(v-on:click='$parent.$emit("edit", id)')
|
|
i.fa.fa-fw.fa-pencil
|
|
| Edit User
|
|
.action(v-if='bannable' v-on:click='$parent.$emit("ban", id)')
|
|
i.fa.fa-fw.fa-ban
|
|
| Ban User
|
|
.separator
|
|
.action(v-if='!activated' v-on:click='$parent.$emit("activation", id)')
|
|
i.fa.fa-fw.fa-envelope
|
|
| Activation Email
|
|
.action(v-if="totp_enabled" v-on:click='$parent.$emit("totp-revoke", id)')
|
|
i.fa.fa-fw.fa-shield
|
|
| Revoke 2FA
|
|
.action(v-on:click='$parent.$emit("reset-password", id)')
|
|
i.fa.fa-fw.fa-envelope
|
|
| Password Email
|
|
|
|
|
|
.display_name {{ display_name }}
|
|
.name {{ id }} - {{ username }} ({{ uuid }})
|
|
.section
|
|
span.key Email
|
|
span.value {{ email }}
|
|
.section
|
|
span.key Privilege
|
|
span.value {{ nw_privilege }}
|
|
.section
|
|
span.key Last IP
|
|
span.value {{ ip_address }}
|
|
.section
|
|
span.key Registered
|
|
span.value {{ new Date(created_at).toString() }}
|
|
</template>
|
|
|
|
<script type="text/javascript">
|
|
import { directive as onClickaway } from 'vue-clickaway'
|
|
|
|
export default {
|
|
props: ['avatar_file', 'activated', 'display_name', 'id', 'username', 'uuid', 'email', 'nw_privilege', 'created_at', 'password', 'bannable', 'ip_address', 'totp_enabled'],
|
|
directives: {
|
|
onClickaway: onClickaway,
|
|
},
|
|
data: function () {
|
|
return {
|
|
dropdown: false
|
|
}
|
|
},
|
|
methods: {
|
|
away: function () {
|
|
this.dropdown = false
|
|
}
|
|
}
|
|
}
|
|
</script>
|