feat: generate code
This commit is contained in:
parent
a158735157
commit
efbd1d25a1
@ -6,26 +6,29 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>Name: </td>
|
<td>Name: </td>
|
||||||
<td><input v-model="name" /></td>
|
<td><input v-model="name" /></td>
|
||||||
<td v-if="id" class="admin-edit-player__table-cell-delete" rowspan="5">
|
<td v-if="id" class="admin-edit-player__table-cell-delete">
|
||||||
<span class="admin-edit-player__button-delete" @click="deletePlayer">delete player</span>
|
<span class="admin-edit-player__button-delete" @click="deletePlayer">delete player</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Score: </td>
|
<td>Score: </td>
|
||||||
<td><input v-model="score" /></td>
|
<td><input v-model="score" /></td>
|
||||||
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Authcode: </td>
|
<td>Authcode: </td>
|
||||||
<td><input v-model="authcode" size="6" maxlength="6" /></td>
|
<td><input v-model="authcode" size="6" maxlength="6" /></td>
|
||||||
|
<td><span class="admin-edit-player__button-generate-code" @click="generateCode">generate code</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"> </td>
|
<td colspan="3"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<button class="admin-edit-player__button-save" @click="save">{{id ? 'save' : 'create'}}</button>
|
<button class="admin-edit-player__button-save" @click="save">{{id ? 'save' : 'create'}}</button>
|
||||||
</td>
|
</td>
|
||||||
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</Infobox>
|
</Infobox>
|
||||||
@ -54,6 +57,12 @@ export default {
|
|||||||
await this.$engine.deletePlayer({ id: this.id })
|
await this.$engine.deletePlayer({ id: this.id })
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
},
|
},
|
||||||
|
generateCode() {
|
||||||
|
this.authcode = ''
|
||||||
|
for (var i = 0; i < 6; i++) {
|
||||||
|
this.authcode += '' + Math.floor(Math.floor(Math.random() * 10000) / 100) % 10
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -101,5 +110,15 @@ export default {
|
|||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&__button-generate-code {
|
||||||
|
margin-left: 3em;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: Dosis;
|
||||||
|
color: #d0d0d0;
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user