mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-22 08:13:11 +01:00
Add search feature
This commit is contained in:
parent
02bbf59083
commit
0894b3fd25
4
resources/js/app.js
vendored
4
resources/js/app.js
vendored
@ -12,10 +12,10 @@ import Edit from './views/Edit'
|
||||
import NotFound from './views/Error'
|
||||
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import { faPlus, faQrcode, faImage, faTrash, faEdit, faCheck, faLock, faLockOpen } from '@fortawesome/free-solid-svg-icons'
|
||||
import { faPlus, faQrcode, faImage, faTrash, faEdit, faCheck, faLock, faLockOpen, faSearch } from '@fortawesome/free-solid-svg-icons'
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
||||
|
||||
library.add(faPlus, faQrcode, faImage, faTrash, faEdit, faCheck, faLock, faLockOpen);
|
||||
library.add(faPlus, faQrcode, faImage, faTrash, faEdit, faCheck, faLock, faLockOpen, faSearch);
|
||||
|
||||
Vue.component('font-awesome-icon', FontAwesomeIcon)
|
||||
|
||||
|
@ -1,8 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="container" v-if="this.showAccounts">
|
||||
<div class="columns is-gapless is-mobile is-centered">
|
||||
<div class="column is-three-quarters-mobile is-one-third-tablet is-one-quarter-desktop is-one-quarter-widescreen is-one-quarter-fullhd">
|
||||
<div class="field">
|
||||
<div class="control has-icons-right">
|
||||
<input type="text" class="input is-rounded is-search" v-model="search" placeholder="">
|
||||
<span class="icon is-small is-right">
|
||||
<font-awesome-icon :icon="['fas', 'search']" v-if="!search" />
|
||||
<a class="delete" v-if="search" @click="search = '' "></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="buttons are-large is-centered">
|
||||
<span v-for="account in accounts" class="button is-black has-background-black-bis twofaccount" >
|
||||
<span v-for="account in filteredAccounts" class="button is-black has-background-black-bis twofaccount" >
|
||||
<span @click.stop="getAccount(account.id)">
|
||||
<img :src="'storage/icons/' + account.icon" v-if="account.icon">
|
||||
{{ account.service }}
|
||||
@ -88,6 +101,7 @@
|
||||
accounts : [],
|
||||
ShowTwofaccountInModal : false,
|
||||
twofaccount: {},
|
||||
search: '',
|
||||
token : null,
|
||||
username : null,
|
||||
editMode: this.InitialEditMode,
|
||||
@ -96,6 +110,17 @@
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
filteredAccounts() {
|
||||
return this.accounts.filter(
|
||||
item => {
|
||||
return item.service.toLowerCase().includes(this.search.toLowerCase()) || item.account.toLowerCase().includes(this.search.toLowerCase());
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
props: ['InitialEditMode'],
|
||||
|
||||
mounted(){
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="section">
|
||||
<div class="section main-section">
|
||||
<main class="py-4">
|
||||
<router-view></router-view>
|
||||
</main>
|
||||
|
12
resources/sass/app.scss
vendored
12
resources/sass/app.scss
vendored
@ -8,6 +8,10 @@
|
||||
//@import '~bootstrap/scss/bootstrap';
|
||||
@import '~bulma/bulma';
|
||||
|
||||
.main-section {
|
||||
padding: 1.5rem 1.5rem 8rem 1.5rem;
|
||||
}
|
||||
|
||||
nav.level {
|
||||
padding: 0 20px;
|
||||
/*postion: fixed;*/
|
||||
@ -104,6 +108,14 @@ nav.level {
|
||||
color: hsl(0, 0%, 48%);
|
||||
}
|
||||
|
||||
.control.has-icons-left .icon, .control.has-icons-right .icon {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.is-search {
|
||||
border-color: hsl(0, 0%, 21%);
|
||||
}
|
||||
|
||||
.modal .field.is-grouped:last-child {
|
||||
justify-content: flex-end;
|
||||
padding-top: 20px;
|
||||
|
Loading…
Reference in New Issue
Block a user