Show only "app_name" and "valid_until" (OAuth tokens table)

This commit is contained in:
Maxim Filippov 2019-02-18 00:01:18 +03:00
parent afbe524a2e
commit c71f411ad6
3 changed files with 5 additions and 14 deletions

View file

@ -1,11 +1,6 @@
<<<<<<< HEAD
import { compose } from 'vue-compose' import { compose } from 'vue-compose'
import unescape from 'lodash/unescape' import unescape from 'lodash/unescape'
import get from 'lodash/get' import get from 'lodash/get'
=======
import { unescape, truncate } from 'lodash'
>>>>>>> Add OAuth Tokens management to settings
import TabSwitcher from '../tab_switcher/tab_switcher.js' import TabSwitcher from '../tab_switcher/tab_switcher.js'
import ImageCropper from '../image_cropper/image_cropper.vue' import ImageCropper from '../image_cropper/image_cropper.vue'
import StyleSwitcher from '../style_switcher/style_switcher.vue' import StyleSwitcher from '../style_switcher/style_switcher.vue'
@ -94,20 +89,17 @@ const UserSettings = {
direct: { selected: this.newDefaultScope === 'direct' } direct: { selected: this.newDefaultScope === 'direct' }
} }
}, },
<<<<<<< HEAD
currentSaveStateNotice () { currentSaveStateNotice () {
return this.$store.state.interface.settings.currentSaveStateNotice return this.$store.state.interface.settings.currentSaveStateNotice
======= },
oauthTokens () { oauthTokens () {
return this.$store.state.oauthTokens.tokens.map(oauthToken => { return this.$store.state.oauthTokens.tokens.map(oauthToken => {
return { return {
id: oauthToken.id, id: oauthToken.id,
token: truncate(oauthToken.token, { length: 15 }), appName: oauthToken.app_name,
refreshToken: truncate(oauthToken.refresh_token, { length: 15 }),
validUntil: new Date(oauthToken.valid_until).toLocaleDateString() validUntil: new Date(oauthToken.valid_until).toLocaleDateString()
} }
}) })
>>>>>>> Add OAuth Tokens management to settings
} }
}, },
methods: { methods: {

View file

@ -126,16 +126,14 @@
<table class="oauth-tokens"> <table class="oauth-tokens">
<thead> <thead>
<tr> <tr>
<th>{{$t('settings.token')}}</th> <th>{{$t('settings.app_name')}}</th>
<th>{{$t('settings.refresh_token')}}</th>
<th>{{$t('settings.valid_until')}}</th> <th>{{$t('settings.valid_until')}}</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="oauthToken in oauthTokens" :key="oauthToken.id"> <tr v-for="oauthToken in oauthTokens" :key="oauthToken.id">
<td>{{oauthToken.token}}</td> <td>{{oauthToken.appName}}</td>
<td>{{oauthToken.refreshToken}}</td>
<td>{{oauthToken.validUntil}}</td> <td>{{oauthToken.validUntil}}</td>
<td class="actions"> <td class="actions">
<button class="btn btn-default" @click="revokeToken(oauthToken.id)"> <button class="btn btn-default" @click="revokeToken(oauthToken.id)">

View file

@ -106,6 +106,7 @@
} }
}, },
"settings": { "settings": {
"app_name": "App name",
"attachmentRadius": "Attachments", "attachmentRadius": "Attachments",
"attachments": "Attachments", "attachments": "Attachments",
"autoload": "Enable automatic loading when scrolled to the bottom", "autoload": "Enable automatic loading when scrolled to the bottom",