From a950b6193a2dfbda35fc01360d18406c1fb53a56 Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
Date: Sun, 29 Mar 2020 10:14:33 +0900
Subject: インスタンス一覧でソートできるように
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/client/pages/instance/federation.vue | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

(limited to 'src/client/pages/instance/federation.vue')

diff --git a/src/client/pages/instance/federation.vue b/src/client/pages/instance/federation.vue
index fa7c377720..b22f92ab26 100644
--- a/src/client/pages/instance/federation.vue
+++ b/src/client/pages/instance/federation.vue
@@ -3,9 +3,10 @@
 	<section class="_card instances">
 		<div class="_title"><fa :icon="faGlobe"/> {{ $t('instances') }}</div>
 		<div class="_content">
+			<mk-input v-model="host" :debounce="true"><span>{{ $t('host') }}</span></mk-input>
 			<div class="inputs" style="display: flex;">
-				<mk-input v-model="host" :debounce="true" style="margin: 0; flex: 1;"><span>{{ $t('host') }}</span></mk-input>
-				<mk-select v-model="state" style="margin: 0;">
+				<mk-select v-model="state" style="margin: 0; flex: 1;">
+					<template #label>{{ $t('state') }}</template>
 					<option value="all">{{ $t('all') }}</option>
 					<option value="federating">{{ $t('federating') }}</option>
 					<option value="subscribing">{{ $t('subscribing') }}</option>
@@ -14,11 +15,32 @@
 					<option value="blocked">{{ $t('blocked') }}</option>
 					<option value="notResponding">{{ $t('notResponding') }}</option>
 				</mk-select>
+				<mk-select v-model="sort" style="margin: 0; flex: 1;">
+					<template #label>{{ $t('sort') }}</template>
+					<option value="+pubSub">{{ $t('pubSub') }} ({{ $t('descendingOrder') }})</option>
+					<option value="-pubSub">{{ $t('pubSub') }} ({{ $t('ascendingOrder') }})</option>
+					<option value="+notes">{{ $t('notes') }} ({{ $t('descendingOrder') }})</option>
+					<option value="-notes">{{ $t('notes') }} ({{ $t('ascendingOrder') }})</option>
+					<option value="+users">{{ $t('users') }} ({{ $t('descendingOrder') }})</option>
+					<option value="-users">{{ $t('users') }} ({{ $t('ascendingOrder') }})</option>
+					<option value="+following">{{ $t('following') }} ({{ $t('descendingOrder') }})</option>
+					<option value="-following">{{ $t('following') }} ({{ $t('ascendingOrder') }})</option>
+					<option value="+followers">{{ $t('followers') }} ({{ $t('descendingOrder') }})</option>
+					<option value="-followers">{{ $t('followers') }} ({{ $t('ascendingOrder') }})</option>
+					<option value="+caughtAt">{{ $t('caughtAt') }} ({{ $t('descendingOrder') }})</option>
+					<option value="-caughtAt">{{ $t('caughtAt') }} ({{ $t('ascendingOrder') }})</option>
+					<option value="+lastCommunicatedAt">{{ $t('lastCommunicatedAt') }} ({{ $t('descendingOrder') }})</option>
+					<option value="-lastCommunicatedAt">{{ $t('lastCommunicatedAt') }} ({{ $t('ascendingOrder') }})</option>
+					<option value="+driveUsage">{{ $t('driveUsage') }} ({{ $t('descendingOrder') }})</option>
+					<option value="-driveUsage">{{ $t('driveUsage') }} ({{ $t('ascendingOrder') }})</option>
+					<option value="+driveFiles">{{ $t('driveFiles') }} ({{ $t('descendingOrder') }})</option>
+					<option value="-driveFiles">{{ $t('driveFiles') }} ({{ $t('ascendingOrder') }})</option>
+				</mk-select>
 			</div>
 		</div>
 		<div class="_content">
 			<mk-pagination :pagination="pagination" #default="{items}" class="instances" ref="instances" :key="host + state">
-				<div class="instance" v-for="(instance, i) in items" :key="instance.id" @click="info(instance)">
+				<div class="instance" v-for="instance in items" :key="instance.id" @click="info(instance)">
 					<div class="host"><fa :icon="faCircle" class="indicator" :class="getStatus(instance)"/><b>{{ instance.host }}</b></div>
 					<div class="status">
 						<span class="sub" v-if="instance.followersCount > 0"><fa :icon="faCaretDown" class="icon"/>Sub</span>
-- 
cgit v1.2.3-freya

