Update dashboard user search input
This commit is contained in:
@@ -28,9 +28,6 @@
|
|||||||
<v-flex xs12 pa-1>
|
<v-flex xs12 pa-1>
|
||||||
<v-text-field label="Display Name" v-model="displayName"></v-text-field>
|
<v-text-field label="Display Name" v-model="displayName"></v-text-field>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 pa-1>
|
|
||||||
<v-text-field label="Password*" type="password" v-model="password"></v-text-field>
|
|
||||||
</v-flex>
|
|
||||||
|
|
||||||
<v-flex xs12 pa-1>
|
<v-flex xs12 pa-1>
|
||||||
<v-autocomplete
|
<v-autocomplete
|
||||||
@@ -120,19 +117,20 @@ module.exports = {
|
|||||||
limit: this.$store.state.dashboard_user.limit || 20
|
limit: this.$store.state.dashboard_user.limit || 20
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
validateBasic() {
|
validateBasic(requirePassword) {
|
||||||
if (!this.username) {
|
if (!this.username) {
|
||||||
alert('Username wajib diisi')
|
alert('Username wajib diisi')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (!this.password) {
|
if (requirePassword && !this.password) {
|
||||||
alert('Password wajib diisi')
|
alert('Password wajib diisi')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
async saveUser() {
|
async saveUser() {
|
||||||
if (!this.validateBasic()) return
|
this.password = window.prompt('Masukkan password untuk user ini') || ''
|
||||||
|
if (!this.validateBasic(true)) return
|
||||||
let resp = await this.$store.dispatch('dashboard_user/save', {
|
let resp = await this.$store.dispatch('dashboard_user/save', {
|
||||||
username: this.username,
|
username: this.username,
|
||||||
password: this.password,
|
password: this.password,
|
||||||
@@ -145,7 +143,8 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async resetPassword() {
|
async resetPassword() {
|
||||||
if (!this.validateBasic()) return
|
this.password = window.prompt('Masukkan password baru') || ''
|
||||||
|
if (!this.validateBasic(true)) return
|
||||||
let resp = await this.$store.dispatch('dashboard_user/reset_password', {
|
let resp = await this.$store.dispatch('dashboard_user/reset_password', {
|
||||||
username: this.username,
|
username: this.username,
|
||||||
password: this.password
|
password: this.password
|
||||||
|
|||||||
@@ -3,7 +3,16 @@
|
|||||||
<v-card class="mb-2 pa-2 searchbox">
|
<v-card class="mb-2 pa-2 searchbox">
|
||||||
<v-layout row wrap>
|
<v-layout row wrap>
|
||||||
<v-flex xs5 pa-1>
|
<v-flex xs5 pa-1>
|
||||||
<v-text-field label="Username" outline hide-details @keyup.enter="doSearch(1)" v-model="username"></v-text-field>
|
<v-text-field
|
||||||
|
label="search"
|
||||||
|
placeholder="ketikkan username"
|
||||||
|
autocomplete="off"
|
||||||
|
name="search_username_input"
|
||||||
|
outline
|
||||||
|
hide-details
|
||||||
|
@keyup.enter="doSearch(1)"
|
||||||
|
v-model="username"
|
||||||
|
></v-text-field>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs5 pa-1>
|
<v-flex xs5 pa-1>
|
||||||
<v-autocomplete
|
<v-autocomplete
|
||||||
|
|||||||
Reference in New Issue
Block a user