From 0854f2e180be7b2ed4e7ea68d7f45cc156a95627 Mon Sep 17 00:00:00 2001
From: MeiMei <30769358+mei23@users.noreply.github.com>
Date: Sat, 26 Jan 2019 17:53:35 +0900
Subject: 管理画面からリモートユーザー情報を更新できるように (#3992)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/client/app/admin/views/users.vue | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

(limited to 'src/client/app/admin/views/users.vue')

diff --git a/src/client/app/admin/views/users.vue b/src/client/app/admin/views/users.vue
index 6b829a2f8d..09d074eee2 100644
--- a/src/client/app/admin/views/users.vue
+++ b/src/client/app/admin/views/users.vue
@@ -20,6 +20,7 @@
 						<ui-button @click="suspendUser" :disabled="suspending"><fa :icon="faSnowflake"/> {{ $t('suspend') }}</ui-button>
 						<ui-button @click="unsuspendUser" :disabled="unsuspending">{{ $t('unsuspend') }}</ui-button>
 					</ui-horizon-group>
+					<ui-button v-if="user.host != null" @click="updateRemoteUser"><fa :icon="faSync"/> {{ $t('update-remote-user') }}</ui-button>
 					<ui-textarea v-if="user" :value="user | json5" readonly tall style="margin-top:16px;"></ui-textarea>
 				</div>
 			</div>
@@ -65,7 +66,7 @@
 import Vue from 'vue';
 import i18n from '../../i18n';
 import parseAcct from "../../../../misc/acct/parse";
-import { faCertificate, faUsers, faTerminal, faSearch, faKey } from '@fortawesome/free-solid-svg-icons';
+import { faCertificate, faUsers, faTerminal, faSearch, faKey, faSync } from '@fortawesome/free-solid-svg-icons';
 import { faSnowflake } from '@fortawesome/free-regular-svg-icons';
 import XUser from './users.user.vue';
 
@@ -89,7 +90,7 @@ export default Vue.extend({
 			offset: 0,
 			users: [],
 			existMore: false,
-			faTerminal, faCertificate, faUsers, faSnowflake, faSearch, faKey
+			faTerminal, faCertificate, faUsers, faSnowflake, faSearch, faKey, faSync
 		};
 	},
 
@@ -265,6 +266,17 @@ export default Vue.extend({
 			this.refreshUser();
 		},
 
+		async updateRemoteUser() {
+			this.$root.api('admin/update-remote-user', { userId: this.user._id }).then(res => {
+				this.$root.dialog({
+					type: 'success',
+					text: this.$t('remote-user-updated')
+				});
+			});
+
+			this.refreshUser();
+		},
+
 		async getConfirmed(text: string): Promise<Boolean> {
 			const confirm = await this.$root.dialog({
 				type: 'warning',
-- 
cgit v1.2.3-freya

