parent
							
								
									55be9cc9d1
								
							
						
					
					
						commit
						056fef70da
					
				
					 6 changed files with 74 additions and 37 deletions
				
			
		|  | @ -104,6 +104,8 @@ unblockConfirm: "ブロック解除しますか?" | ||||||
| suspendConfirm: "凍結しますか?" | suspendConfirm: "凍結しますか?" | ||||||
| unsuspendConfirm: "解凍しますか?" | unsuspendConfirm: "解凍しますか?" | ||||||
| selectList: "リストを選択" | selectList: "リストを選択" | ||||||
|  | selectAntenna: "アンテナを選択" | ||||||
|  | selectWidget: "ウィジェットを選択" | ||||||
| customEmojis: "カスタム絵文字" | customEmojis: "カスタム絵文字" | ||||||
| emoji: "絵文字" | emoji: "絵文字" | ||||||
| emojiName: "絵文字名" | emojiName: "絵文字名" | ||||||
|  | @ -535,6 +537,8 @@ enableAll: "全て有効にする" | ||||||
| disableAll: "全て無効にする" | disableAll: "全て無効にする" | ||||||
| tokenRequested: "アカウントへのアクセス許可" | tokenRequested: "アカウントへのアクセス許可" | ||||||
| pluginTokenRequestedDescription: "このプラグインはここで設定した権限を行使できるようになります。" | pluginTokenRequestedDescription: "このプラグインはここで設定した権限を行使できるようになります。" | ||||||
|  | notificationType: "通知の種類" | ||||||
|  | edit: "編集" | ||||||
| useStarForReactionFallback: "リアクション絵文字が不明な場合、代わりに★を使う" | useStarForReactionFallback: "リアクション絵文字が不明な場合、代わりに★を使う" | ||||||
| emailConfig: "メールサーバー設定" | emailConfig: "メールサーバー設定" | ||||||
| enableEmail: "メール配信機能を有効化する" | enableEmail: "メール配信機能を有効化する" | ||||||
|  | @ -1225,10 +1229,27 @@ _notification: | ||||||
|   yourFollowRequestAccepted: "フォローリクエストが承認されました" |   yourFollowRequestAccepted: "フォローリクエストが承認されました" | ||||||
|   youWereInvitedToGroup: "グループに招待されました" |   youWereInvitedToGroup: "グループに招待されました" | ||||||
| 
 | 
 | ||||||
|  |   _types: | ||||||
|  |     all: "すべて" | ||||||
|  |     follow: "フォロー" | ||||||
|  |     mention: "メンション" | ||||||
|  |     reply: "リプライ" | ||||||
|  |     renote: "Renote" | ||||||
|  |     quote: "引用" | ||||||
|  |     reaction: "リアクション" | ||||||
|  |     pollVote: "投票" | ||||||
|  |     receiveFollowRequest: "フォローリクエスト" | ||||||
|  | 
 | ||||||
| _deck: | _deck: | ||||||
|   alwaysShowMainColumn: "常にメインカラムを表示" |   alwaysShowMainColumn: "常にメインカラムを表示" | ||||||
|   columnAlign: "カラムの寄せ" |   columnAlign: "カラムの寄せ" | ||||||
|   addColumn: "カラムを追加" |   addColumn: "カラムを追加" | ||||||
|  |   swapLeft: "左に移動" | ||||||
|  |   swapRight: "右に移動" | ||||||
|  |   swapUp: "上に移動" | ||||||
|  |   swapDown: "下に移動" | ||||||
|  |   stackLeft: "左に重ねる" | ||||||
|  |   popRight: "右に出す" | ||||||
| 
 | 
 | ||||||
|   _columns: |   _columns: | ||||||
|     widgets: "ウィジェット" |     widgets: "ウィジェット" | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ | ||||||
| 		<fa :icon="faSatellite"/><span style="margin-left: 8px;">{{ column.name }}</span> | 		<fa :icon="faSatellite"/><span style="margin-left: 8px;">{{ column.name }}</span> | ||||||
| 	</template> | 	</template> | ||||||
| 
 | 
 | ||||||
| 	<x-timeline ref="timeline" src="antenna" :antenna="column.antennaId" @after="() => $emit('loaded')"/> | 	<x-timeline v-if="column.antennaId" ref="timeline" src="antenna" :antenna="column.antennaId" @after="() => $emit('loaded')"/> | ||||||
| </x-column> | </x-column> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
|  | @ -33,7 +33,6 @@ export default Vue.extend({ | ||||||
| 
 | 
 | ||||||
| 	data() { | 	data() { | ||||||
| 		return { | 		return { | ||||||
| 			menu: null, |  | ||||||
| 			faSatellite | 			faSatellite | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
|  | @ -47,28 +46,36 @@ export default Vue.extend({ | ||||||
| 	created() { | 	created() { | ||||||
| 		this.menu = [{ | 		this.menu = [{ | ||||||
| 			icon: faCog, | 			icon: faCog, | ||||||
| 			text: this.$t('antenna'), | 			text: this.$t('selectAntenna'), | ||||||
| 			action: async () => { | 			action: this.setAntenna | ||||||
| 				const antennas = await this.$root.api('antennas/list'); |  | ||||||
| 				this.$root.dialog({ |  | ||||||
| 					title: this.$t('antenna'), |  | ||||||
| 					type: null, |  | ||||||
| 					select: { |  | ||||||
| 						items: antennas.map(x => ({ |  | ||||||
| 							value: x, text: x.name |  | ||||||
| 						})) |  | ||||||
| 					}, |  | ||||||
| 					showCancelButton: true |  | ||||||
| 				}).then(({ canceled, result: antenna }) => { |  | ||||||
| 					if (canceled) return; |  | ||||||
| 					this.column.antennaId = antenna.id; |  | ||||||
| 					this.$store.commit('deviceUser/updateDeckColumn', this.column); |  | ||||||
| 				}); |  | ||||||
| 			} |  | ||||||
| 		}]; | 		}]; | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
|  | 	mounted() { | ||||||
|  | 		if (this.column.antennaId == null) { | ||||||
|  | 			this.setAntenna(); | ||||||
|  | 		} | ||||||
|  | 	}, | ||||||
|  | 
 | ||||||
| 	methods: { | 	methods: { | ||||||
|  | 		async setAntenna() { | ||||||
|  | 			const antennas = await this.$root.api('antennas/list'); | ||||||
|  | 			const { canceled, result: antenna } = await this.$root.dialog({ | ||||||
|  | 				title: this.$t('selectAntenna'), | ||||||
|  | 				type: null, | ||||||
|  | 				select: { | ||||||
|  | 					items: antennas.map(x => ({ | ||||||
|  | 						value: x, text: x.name | ||||||
|  | 					})), | ||||||
|  | 				default: this.column.antennaId | ||||||
|  | 				}, | ||||||
|  | 				showCancelButton: true | ||||||
|  | 			}); | ||||||
|  | 			if (canceled) return; | ||||||
|  | 			Vue.set(this.column, 'antennaId', antenna.id); | ||||||
|  | 			this.$store.commit('deviceUser/updateDeckColumn', this.column); | ||||||
|  | 		}, | ||||||
|  | 
 | ||||||
| 		focus() { | 		focus() { | ||||||
| 			(this.$refs.timeline as any).focus(); | 			(this.$refs.timeline as any).focus(); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | @ -150,37 +150,37 @@ export default Vue.extend({ | ||||||
| 				} | 				} | ||||||
| 			}, null, { | 			}, null, { | ||||||
| 				icon: faArrowLeft, | 				icon: faArrowLeft, | ||||||
| 				text: this.$t('swap-left'), | 				text: this.$t('_deck.swapLeft'), | ||||||
| 				action: () => { | 				action: () => { | ||||||
| 					this.$store.commit('deviceUser/swapLeftDeckColumn', this.column.id); | 					this.$store.commit('deviceUser/swapLeftDeckColumn', this.column.id); | ||||||
| 				} | 				} | ||||||
| 			}, { | 			}, { | ||||||
| 				icon: faArrowRight, | 				icon: faArrowRight, | ||||||
| 				text: this.$t('swap-right'), | 				text: this.$t('_deck.swapRight'), | ||||||
| 				action: () => { | 				action: () => { | ||||||
| 					this.$store.commit('deviceUser/swapRightDeckColumn', this.column.id); | 					this.$store.commit('deviceUser/swapRightDeckColumn', this.column.id); | ||||||
| 				} | 				} | ||||||
| 			}, this.isStacked ? { | 			}, this.isStacked ? { | ||||||
| 				icon: faArrowUp, | 				icon: faArrowUp, | ||||||
| 				text: this.$t('swap-up'), | 				text: this.$t('_deck.swapUp'), | ||||||
| 				action: () => { | 				action: () => { | ||||||
| 					this.$store.commit('deviceUser/swapUpDeckColumn', this.column.id); | 					this.$store.commit('deviceUser/swapUpDeckColumn', this.column.id); | ||||||
| 				} | 				} | ||||||
| 			} : undefined, this.isStacked ? { | 			} : undefined, this.isStacked ? { | ||||||
| 				icon: faArrowDown, | 				icon: faArrowDown, | ||||||
| 				text: this.$t('swap-down'), | 				text: this.$t('_deck.swapDown'), | ||||||
| 				action: () => { | 				action: () => { | ||||||
| 					this.$store.commit('deviceUser/swapDownDeckColumn', this.column.id); | 					this.$store.commit('deviceUser/swapDownDeckColumn', this.column.id); | ||||||
| 				} | 				} | ||||||
| 			} : undefined, null, { | 			} : undefined, null, { | ||||||
| 				icon: faWindowRestore, | 				icon: faWindowRestore, | ||||||
| 				text: this.$t('stack-left'), | 				text: this.$t('_deck.stackLeft'), | ||||||
| 				action: () => { | 				action: () => { | ||||||
| 					this.$store.commit('deviceUser/stackLeftDeckColumn', this.column.id); | 					this.$store.commit('deviceUser/stackLeftDeckColumn', this.column.id); | ||||||
| 				} | 				} | ||||||
| 			}, this.isStacked ? { | 			}, this.isStacked ? { | ||||||
| 				icon: faWindowMaximize, | 				icon: faWindowMaximize, | ||||||
| 				text: this.$t('pop-right'), | 				text: this.$t('_deck.popRight'), | ||||||
| 				action: () => { | 				action: () => { | ||||||
| 					this.$store.commit('deviceUser/popRightDeckColumn', this.column.id); | 					this.$store.commit('deviceUser/popRightDeckColumn', this.column.id); | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
|  | @ -46,7 +46,7 @@ export default Vue.extend({ | ||||||
| 	created() { | 	created() { | ||||||
| 		this.menu = [{ | 		this.menu = [{ | ||||||
| 			icon: faCog, | 			icon: faCog, | ||||||
| 			text: this.$t('list'), | 			text: this.$t('selectList'), | ||||||
| 			action: this.setList | 			action: this.setList | ||||||
| 		}]; | 		}]; | ||||||
| 	}, | 	}, | ||||||
|  | @ -61,7 +61,7 @@ export default Vue.extend({ | ||||||
| 		async setList() { | 		async setList() { | ||||||
| 			const lists = await this.$root.api('users/lists/list'); | 			const lists = await this.$root.api('users/lists/list'); | ||||||
| 			const { canceled, result: list } = await this.$root.dialog({ | 			const { canceled, result: list } = await this.$root.dialog({ | ||||||
| 				title: this.$t('list'), | 				title: this.$t('selectList'), | ||||||
| 				type: null, | 				type: null, | ||||||
| 				select: { | 				select: { | ||||||
| 					items: lists.map(x => ({ | 					items: lists.map(x => ({ | ||||||
|  |  | ||||||
|  | @ -45,14 +45,14 @@ export default Vue.extend({ | ||||||
| 
 | 
 | ||||||
| 		this.menu = [{ | 		this.menu = [{ | ||||||
| 			icon: faCog, | 			icon: faCog, | ||||||
| 			text: this.$t('@.notification-type'), | 			text: this.$t('notificationType'), | ||||||
| 			action: () => { | 			action: () => { | ||||||
| 				this.$root.dialog({ | 				this.$root.dialog({ | ||||||
| 					title: this.$t('@.notification-type'), | 					title: this.$t('notificationType'), | ||||||
| 					type: null, | 					type: null, | ||||||
| 					select: { | 					select: { | ||||||
| 						items: ['all', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest'].map(x => ({ | 						items: ['all', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest'].map(x => ({ | ||||||
| 							value: x, text: this.$t('@.notification-types.' + x) | 							value: x, text: this.$t(`_notification._types.${x}`) | ||||||
| 						})) | 						})) | ||||||
| 						default: this.column.notificationType, | 						default: this.column.notificationType, | ||||||
| 					}, | 					}, | ||||||
|  |  | ||||||
|  | @ -5,9 +5,12 @@ | ||||||
| 	<div class="wtdtxvec"> | 	<div class="wtdtxvec"> | ||||||
| 		<template v-if="edit"> | 		<template v-if="edit"> | ||||||
| 			<header> | 			<header> | ||||||
| 				<select v-model="widgetAdderSelected" @change="addWidget"> | 				<mk-select v-model="widgetAdderSelected" style="margin-bottom: var(--margin)"> | ||||||
| 					<option v-for="widget in widgets" :value="widget" :key="widget">{{ widget }}</option> | 					<template #label>{{ $t('selectWidget') }}</template> | ||||||
| 				</select> | 					<option v-for="widget in widgets" :value="widget" :key="widget">{{ $t(`_widgets.${widget}`) }}</option> | ||||||
|  | 				</mk-select> | ||||||
|  | 				<mk-button inline @click="addWidget" primary><fa :icon="faPlus"/> {{ $t('add') }}</mk-button> | ||||||
|  | 				<mk-button inline @click="edit = false">{{ $t('close') }}</mk-button> | ||||||
| 			</header> | 			</header> | ||||||
| 			<x-draggable | 			<x-draggable | ||||||
| 				:list="column.widgets" | 				:list="column.widgets" | ||||||
|  | @ -15,7 +18,7 @@ | ||||||
| 				@sort="onWidgetSort" | 				@sort="onWidgetSort" | ||||||
| 			> | 			> | ||||||
| 				<div v-for="widget in column.widgets" class="customize-container" :key="widget.id" @click="widgetFunc(widget.id)"> | 				<div v-for="widget in column.widgets" class="customize-container" :key="widget.id" @click="widgetFunc(widget.id)"> | ||||||
| 					<button class="remove _button" @click="removeWidget(widget)"><fa :icon="faTimes"/></button> | 					<button class="remove _button" @click.prevent.stop="removeWidget(widget)"><fa :icon="faTimes"/></button> | ||||||
| 					<component :is="`mkw-${widget.name}`" :widget="widget" :ref="widget.id" :is-customize-mode="true" :column="column"/> | 					<component :is="`mkw-${widget.name}`" :widget="widget" :ref="widget.id" :is-customize-mode="true" :column="column"/> | ||||||
| 				</div> | 				</div> | ||||||
| 			</x-draggable> | 			</x-draggable> | ||||||
|  | @ -29,7 +32,9 @@ | ||||||
| import Vue from 'vue'; | import Vue from 'vue'; | ||||||
| import * as XDraggable from 'vuedraggable'; | import * as XDraggable from 'vuedraggable'; | ||||||
| import { v4 as uuid } from 'uuid'; | import { v4 as uuid } from 'uuid'; | ||||||
| import { faWindowMaximize, faTimes, faCog } from '@fortawesome/free-solid-svg-icons'; | import { faWindowMaximize, faTimes, faCog, faPlus } from '@fortawesome/free-solid-svg-icons'; | ||||||
|  | import MkSelect from '../../components/ui/select.vue'; | ||||||
|  | import MkButton from '../../components/ui/button.vue'; | ||||||
| import XColumn from './column.vue'; | import XColumn from './column.vue'; | ||||||
| import { widgets } from '../../widgets'; | import { widgets } from '../../widgets'; | ||||||
| 
 | 
 | ||||||
|  | @ -37,6 +42,8 @@ export default Vue.extend({ | ||||||
| 	components: { | 	components: { | ||||||
| 		XColumn, | 		XColumn, | ||||||
| 		XDraggable, | 		XDraggable, | ||||||
|  | 		MkSelect, | ||||||
|  | 		MkButton, | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 	props: { | 	props: { | ||||||
|  | @ -56,7 +63,7 @@ export default Vue.extend({ | ||||||
| 			menu: null, | 			menu: null, | ||||||
| 			widgetAdderSelected: null, | 			widgetAdderSelected: null, | ||||||
| 			widgets, | 			widgets, | ||||||
| 			faWindowMaximize, faTimes | 			faWindowMaximize, faTimes, faPlus | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
|  | @ -80,6 +87,8 @@ export default Vue.extend({ | ||||||
| 		}, | 		}, | ||||||
| 
 | 
 | ||||||
| 		addWidget() { | 		addWidget() { | ||||||
|  | 			if (this.widgetAdderSelected == null) return; | ||||||
|  | 
 | ||||||
| 			this.$store.commit('deviceUser/addDeckWidget', { | 			this.$store.commit('deviceUser/addDeckWidget', { | ||||||
| 				id: this.column.id, | 				id: this.column.id, | ||||||
| 				widget: { | 				widget: { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue