Skip to content

Commit

Permalink
Show role on admin menu
Browse files Browse the repository at this point in the history
  • Loading branch information
atsu1125 authored and fs5m8 committed Jan 2, 2023
1 parent 4a9c814 commit ed80968
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
32 changes: 23 additions & 9 deletions src/client/app/admin/views/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
</div>
<div class="me">
<img class="avatar" :src="i.avatarUrl" alt="avatar"/>
<p class="name"><mk-user-name :user="i"/></p>
<div class="info">
<div class="name"><mk-user-name :user="$store.state.i"/></div>
<span class="role">{{ $store.getters.role }}</span>
</div>
</div>
<ul>
<li><router-link to="/dashboard" active-class="active"><fa icon="home" fixed-width/>{{ $t('dashboard') }}</router-link></li>
Expand Down Expand Up @@ -214,14 +217,25 @@ export default Vue.extend({
border-radius 100%
vertical-align middle
> .name
margin 0 16px
padding 0
color #fff
overflow hidden
text-overflow ellipsis
white-space nowrap
font-size 15px
> .info
> .name
margin 0 16px
padding 0
color #fff
overflow hidden
text-overflow ellipsis
white-space nowrap
font-size 15px
> .role
margin 0 16px
padding 3px
border-radius 3px
font-size 12px
color #fff
background-color rgba(255, 255, 255, 0.1)
overflow hidden
text-overflow ellipsis
white-space nowrap
> .back-to-misskey
margin 16px 16px 0 16px
Expand Down
2 changes: 2 additions & 0 deletions src/client/app/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export default (os: MiOS) => new Vuex.Store({

isAdmin: state => state.i && state.i.isAdmin,

role: state => state.i?.isAdmin ? 'Admin' : state.i?.isModerator ? 'Moderator' : null,

home: state => state.settings.homeProfiles[state.device.homeProfile],

mobileHome: state => state.settings.mobileHomeProfiles[state.device.mobileHomeProfile],
Expand Down

0 comments on commit ed80968

Please sign in to comment.