From d01c465a8d855846dbda35995d013445adfa46ca Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 8 Nov 2020 12:40:56 +0900 Subject: ユーザーピッカーに最近使用したユーザーを表示するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/user-select-dialog.vue | 36 +++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'src/client/components/user-select-dialog.vue') diff --git a/src/client/components/user-select-dialog.vue b/src/client/components/user-select-dialog.vue index e7bfcafbb3..cdb8990051 100644 --- a/src/client/components/user-select-dialog.vue +++ b/src/client/components/user-select-dialog.vue @@ -14,10 +14,10 @@ {{ $t('host') }} -
+
- +
@@ -28,6 +28,17 @@ {{ $t('noUsers') }}
+
+
+
+ +
+ + +
+
+
+
@@ -53,18 +64,23 @@ export default defineComponent({ return { username: '', host: '', + recentUsers: [], users: [], selected: null, faTimes, faCheck }; }, - mounted() { + async mounted() { this.focus(); this.$nextTick(() => { this.focus(); }); + + this.recentUsers = await os.api('users/show', { + userIds: this.$store.state.device.recentlyUsedUsers + }); }, methods: { @@ -90,6 +106,12 @@ export default defineComponent({ ok() { this.$emit('ok', this.selected); this.$refs.dialog.close(); + + // 最近使ったユーザー更新 + let recents = this.$store.state.device.recentlyUsedUsers; + recents = recents.filter(x => x !== this.selected.id); + recents.unshift(this.selected.id); + this.$store.commit('device/set', { key: 'recentlyUsedUsers', value: recents.splice(0, 16) }); }, cancel() { @@ -107,6 +129,14 @@ export default defineComponent({ overflow: auto; height: 100%; + &.result.hit { + padding: 0; + } + + &.recent { + padding: 0; + } + > .inputs { > .input { display: inline-block; -- cgit v1.2.3-freya