Add IsConsistent property to identify undecipherable accounts

This commit is contained in:
Bubka 2020-11-06 21:49:43 +01:00
parent 289a208847
commit 428c83ad82
3 changed files with 19 additions and 5 deletions

View File

@ -39,7 +39,7 @@ class TwoFAccount extends Model implements Sortable
*
* @var array
*/
protected $appends = ['otpType', 'counter'];
protected $appends = ['otpType', 'counter', 'isConsistent'];
/**
@ -244,4 +244,17 @@ public function getAccountAttribute($value)
}
}
/**
* Null empty icon resource has gone
*
* @param string $value
* @return string
*
*/
public function getIsConsistentAttribute($value)
{
return $this->uri === '*encrypted*' || $this->account === '*encrypted*' ? false : true;
}
}

View File

@ -17,10 +17,10 @@ import {
faEllipsisH,
faBars,
faSpinner,
faCaretUp,
faCaretDown,
faLayerGroup,
faMinusCircle,
faExclamationCircle,
} from '@fortawesome/free-solid-svg-icons'
import {
@ -42,10 +42,10 @@ library.add(
faBars,
faSpinner,
faGithubAlt,
faCaretUp,
faCaretDown,
faLayerGroup,
faMinusCircle,
faExclamationCircle,
);
Vue.component('font-awesome-icon', FontAwesomeIcon)

View File

@ -60,7 +60,7 @@
<div class="tfa-content is-size-3 is-size-4-mobile" @click.stop="showAccount(account)">
<div class="tfa-text has-ellipsis">
<img :src="'/storage/icons/' + account.icon" v-if="account.icon && $root.appSettings.showAccountsIcons">
{{ account.service }}
{{ account.service }}<font-awesome-icon class="has-text-danger is-size-5 ml-2" v-if="$root.appSettings.useEncryption && account.isConsistent === false" :icon="['fas', 'exclamation-circle']" />
<span class="is-family-primary is-size-6 is-size-7-mobile has-text-grey ">{{ account.account }}</span>
</div>
</div>
@ -299,7 +299,8 @@
id : data.id,
service : data.service,
account : data.account ? data.account : '-',
icon : data.icon
icon : data.icon,
isConsistent : data.isConsistent
})
})