Refactoring

This commit is contained in:
syuilo 2020-11-03 20:36:12 +09:00
parent 7353d729d7
commit 3c59c6fc9b
69 changed files with 157 additions and 285 deletions

View file

@ -22,10 +22,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('error'),
icon: faExclamationTriangle
}]
},
faExclamationTriangle
};

View file

@ -87,10 +87,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('aboutMisskey'),
icon: null
}]
},
version,
faInfoCircle

View file

@ -37,10 +37,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('about'),
icon: faInfoCircle
}]
},
version,
serverInfo: null,

View file

@ -31,10 +31,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('announcements'),
icon: faBroadcastTower
}]
},
pagination: {
endpoint: 'announcements',

View file

@ -41,10 +41,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: 'API console',
icon: faTerminal
}]
},
endpoint: '',

View file

@ -51,10 +51,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('installedApps'),
icon: faPlug,
}],
},
pagination: {
endpoint: 'i/apps',

View file

@ -46,15 +46,11 @@ export default defineComponent({
data() {
return {
INFO: computed(() => this.channelId ? {
header: [{
title: this.$t('_channel.edit'),
icon: faSatelliteDish,
}],
} : {
header: [{
title: this.$t('_channel.create'),
icon: faSatelliteDish,
}],
}),
channel: null,
name: null,

View file

@ -54,10 +54,8 @@ export default defineComponent({
data() {
return {
INFO: computed(() => this.channel ? {
header: [{
title: this.channel.name,
icon: faSatelliteDish,
}],
} : null),
channel: null,
showBanner: true,

View file

@ -43,10 +43,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('channel'),
icon: faSatelliteDish
}]
},
tab: 'featured',
featuredPagination: {

View file

@ -43,10 +43,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.title,
icon: faFileAlt
}],
},
faFileAlt,
title: '',

View file

@ -21,10 +21,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('help'),
icon: faQuestionCircle
}],
},
docs: [],
faQuestionCircle

View file

@ -18,10 +18,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: computed(() => this.folder ? this.folder.name : this.$t('drive')),
icon: faCloud,
}],
action: {
icon: faEllipsisH,
handler: this.menu

View file

@ -93,10 +93,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('explore'),
icon: faHashtag
}],
},
pinnedUsers: { endpoint: 'pinned-users' },
popularUsers: { endpoint: 'users', limit: 10, noPaging: true, params: {

View file

@ -19,10 +19,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('favorites'),
icon: faStar
}]
},
pagination: {
endpoint: 'i/favorites',

View file

@ -18,10 +18,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('featured'),
icon: faFireAlt
}],
},
pagination: {
endpoint: 'notes/featured',

View file

@ -44,10 +44,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('followRequests'),
icon: faUserClock,
}],
},
pagination: {
endpoint: 'following/requests/list',

View file

@ -84,10 +84,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('abuseReports'),
icon: faExclamationCircle
}],
},
searchUsername: '',
searchHost: '',

View file

@ -45,10 +45,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('announcements'),
icon: faBroadcastTower
}]
},
announcements: [],
faBroadcastTower, faSave, faTrashAlt, faPlus

View file

@ -68,10 +68,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('customEmojis'),
icon: faLaugh
}],
icon: faLaugh,
action: {
icon: faPlus,
handler: this.add

View file

@ -79,10 +79,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('federation'),
icon: faGlobe
}],
},
host: '',
state: 'federating',

View file

@ -84,10 +84,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('files'),
icon: faCloud
}],
},
q: null,
origin: 'local',

View file

@ -86,7 +86,7 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
tabs: [{
id: 'index',
title: null,
tooltip: this.$t('instance'),

View file

@ -49,10 +49,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('serverLogs'),
icon: faStream
}]
},
logs: [],
logLevel: 'all',

View file

@ -31,10 +31,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('jobQueue'),
icon: faExchangeAlt,
}],
},
connection: os.stream.useSharedConnection('queueStats'),
faExchangeAlt, faTrashAlt

View file

@ -38,10 +38,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('relays'),
icon: faProjectDiagram,
}],
},
relays: [],
inbox: '',

View file

@ -257,10 +257,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('instance'),
icon: faCog,
}],
},
url,
proxyAccount: null,

View file

@ -101,10 +101,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('users'),
icon: faUsers
}],
icon: faUsers,
action: {
icon: faSearch,
handler: this.searchUser

View file

@ -18,10 +18,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('mentions'),
icon: faAt
}],
},
pagination: {
endpoint: 'notes/mentions',

View file

@ -18,10 +18,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('directNotes'),
icon: faEnvelope
}],
},
pagination: {
endpoint: 'notes/mentions',

View file

@ -53,10 +53,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('messaging'),
icon: faComments
}]
},
fetching: true,
moreFetching: false,

View file

@ -62,19 +62,15 @@ const Component = defineComponent({
data() {
return {
INFO: computed(() => !this.fetching ? this.user ? {
header: [{
userName: this.user,
avatar: this.user,
}],
action: {
icon: faEllipsisH,
handler: this.menu,
},
} : {
header: [{
title: this.group.name,
icon: faUsers
}],
icon: faUsers,
action: {
icon: faEllipsisH,
handler: this.menu,

View file

@ -29,10 +29,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('manageAntennas'),
icon: faSatellite
}],
icon: faSatellite,
action: {
icon: faPlus,
handler: this.create

View file

@ -48,10 +48,8 @@ export default defineComponent({
data() {
return {
INFO: computed(() => this.group ? {
header: [{
title: this.group.name,
icon: faUsers,
}],
} : null),
group: null,
users: [],

View file

@ -63,10 +63,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('groups'),
icon: faUsers
}],
},
tab: 'owned',
ownedPagination: {

View file

@ -26,10 +26,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('manageLists'),
icon: faListUl
}],
icon: faListUl,
action: {
icon: faPlus,
handler: this.create

View file

@ -47,10 +47,8 @@ export default defineComponent({
data() {
return {
INFO: computed(() => this.list ? {
header: [{
title: this.list.name,
icon: faListUl,
}],
} : null),
list: null,
users: [],

View file

@ -16,10 +16,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('notFound'),
icon: faExclamationTriangle
}]
},
}
},

View file

@ -51,10 +51,8 @@ export default defineComponent({
data() {
return {
INFO: computed(() => this.note ? {
header: [{
title: this.$t('note'),
avatar: this.note.user,
}],
} : null),
note: null,
hasPrev: false,

View file

@ -21,10 +21,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('notifications'),
icon: faBell
}]
},
};
},

View file

@ -57,10 +57,8 @@ export default defineComponent({
data() {
return {
INFO: computed(() => this.page ? {
header: [{
title: computed(() => this.page.title || this.page.name),
avatar: this.page.user,
}],
} : null),
page: null,
faHeartS, faHeartR

View file

@ -35,10 +35,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('pages'),
icon: faStickyNote
}],
icon: faStickyNote,
action: {
icon: faPlus,
handler: this.create

View file

@ -27,10 +27,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('_reversi.reversi'),
icon: faGamepad
}]
},
game: null,
connection: null,

View file

@ -76,10 +76,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('_reversi.reversi'),
icon: faGamepad
}]
},
games: [],
gamesFetching: true,

View file

@ -82,10 +82,8 @@ export default defineComponent({
data() {
return {
INFO: computed(() => this.user ? {
header: [{
title: this.$t('room'),
avatar: this.user,
}],
} : null),
user: null,
objectSelected: false,

View file

@ -44,10 +44,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('scratchpad'),
icon: faTerminal,
}],
},
code: '',
logs: [],

View file

@ -20,10 +20,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('searchWith', { q: this.$route.query.q }),
icon: faSearch
}],
},
pagination: {
endpoint: 'notes/search',

View file

@ -28,10 +28,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: 'API',
icon: faKey
}]
},
isDesktop: window.innerWidth >= 1100,
};

View file

@ -107,10 +107,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('general'),
icon: faCogs
}]
},
langs,
lang: localStorage.getItem('lang'),

View file

@ -55,10 +55,8 @@ export default defineComponent({
setup(props, context) {
const INFO = ref({
header: [{
title: i18n.global.t('settings'),
icon: faCog
}]
});
const narrow = ref(false);
const view = ref(null);

View file

@ -41,10 +41,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('integration'),
icon: faShareAlt
}]
},
apiUrl,
twitterForm: null,

View file

@ -49,10 +49,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('muteAndBlock'),
icon: faBan
}]
},
tab: 'mute',
mutingPagination: {

View file

@ -40,10 +40,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('notifications'),
icon: faBell
}]
},
faCog
}

View file

@ -42,10 +42,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('other'),
icon: faEllipsisH
}]
},
debug
}

View file

@ -38,10 +38,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('privacy'),
icon: faLockOpen
}]
},
isLocked: false,
autoAcceptFollowed: false,

View file

@ -81,10 +81,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('profile'),
icon: faUser
}]
},
host,
name: null,

View file

@ -37,10 +37,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('reaction'),
icon: faLaugh
}]
},
reactions: this.$store.state.settings.reactions.join(''),
changed: false,

View file

@ -46,10 +46,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: 'RegEdit',
icon: faCode
}]
},
settings: JSON5.stringify(this.$store.state.settings, null, '\t'),

View file

@ -31,10 +31,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('security'),
icon: faLock
}]
},
faLock, faSyncAlt
}

View file

@ -43,10 +43,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('sidebar'),
icon: faListUl
}]
},
menuDef: sidebarDef,
items: '',

View file

@ -105,10 +105,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('theme'),
icon: faPalette
}]
},
builtinThemes,
installThemeCode: null,

View file

@ -48,10 +48,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('wordMute'),
icon: faCommentSlash
}]
},
tab: 'soft',
softMutedWords: '',

View file

@ -27,10 +27,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('share'),
icon: faShareAlt
}],
},
title: null,
text: null,

View file

@ -25,10 +25,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.tag,
icon: faHashtag
}],
},
pagination: {
endpoint: 'notes/search-by-tag',

View file

@ -152,10 +152,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: 'TEST',
icon: faExclamationTriangle
}]
},
dialogTitle: 'Hello',
dialogBody: 'World!',

View file

@ -121,10 +121,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: this.$t('themeEditor'),
icon: faPalette,
}],
},
theme: [] as ThemeViewModel,
name: '',

View file

@ -50,7 +50,7 @@ export default defineComponent({
queue: 0,
width: 0,
INFO: computed(() => {
const header = [{
const tabs = [{
id: 'home',
title: null,
tooltip: this.$t('_timelines.home'),
@ -60,7 +60,7 @@ export default defineComponent({
}];
if (!this.$store.state.instance.meta.disableLocalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin) {
header.push({
tabs.push({
id: 'local',
title: null,
tooltip: this.$t('_timelines.local'),
@ -69,7 +69,7 @@ export default defineComponent({
selected: computed(() => this.src === 'local')
});
header.push({
tabs.push({
id: 'social',
title: null,
tooltip: this.$t('_timelines.social'),
@ -80,7 +80,7 @@ export default defineComponent({
}
if (!this.$store.state.instance.meta.disableGlobalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin) {
header.push({
tabs.push({
id: 'global',
title: null,
tooltip: this.$t('_timelines.global'),
@ -90,7 +90,7 @@ export default defineComponent({
});
}
header.push({
tabs.push({
id: 'other',
title: null,
icon: faEllipsisH,
@ -99,7 +99,7 @@ export default defineComponent({
});
return {
header,
tabs,
action: {
icon: faPencilAlt,
handler: () => os.post()

View file

@ -160,10 +160,8 @@ export default defineComponent({
data() {
return {
INFO: computed(() => this.user ? {
header: [{
userName: this.user,
avatar: this.user,
}],
action: {
icon: faEllipsisH,
handler: this.menu

View file

@ -20,10 +20,8 @@ export default defineComponent({
data() {
return {
INFO: {
header: [{
title: instanceName || 'Misskey',
icon: null
}]
},
}
},

View file

@ -5,12 +5,20 @@
</transition>
<template v-if="info">
<div class="titleContainer">
<div class="title" v-for="header in info.header" :key="header.id" :class="{ _button: header.onClick, selected: header.selected }" @click="header.onClick" v-tooltip="header.tooltip">
<Fa v-if="header.icon" :icon="header.icon" :key="header.icon" class="icon"/>
<MkAvatar v-else-if="header.avatar" class="avatar" :user="header.avatar" :disable-preview="true"/>
<span v-if="header.title" class="text">{{ header.title }}</span>
<MkUserName v-else-if="header.userName" :user="header.userName" :nowrap="false" class="text"/>
<template v-if="info.tabs">
<div class="title" v-for="tab in info.tabs" :key="tab.id" :class="{ _button: tab.onClick, selected: tab.selected }" @click="tab.onClick" v-tooltip="tab.tooltip">
<Fa v-if="tab.icon" :icon="tab.icon" :key="tab.icon" class="icon"/>
<span v-if="tab.title" class="text">{{ tab.title }}</span>
</div>
</template>
<template v-else>
<div class="title">
<Fa v-if="info.icon" :icon="info.icon" :key="info.icon" class="icon"/>
<MkAvatar v-else-if="info.avatar" class="avatar" :user="info.avatar" :disable-preview="true"/>
<span v-if="info.title" class="text">{{ info.title }}</span>
<MkUserName v-else-if="info.userName" :user="info.userName" :nowrap="false" class="text"/>
</div>
</template>
</div>
<button class="_button action" v-if="info.action" @click="info.action.handler"><Fa :icon="info.action.icon" :key="info.action.icon"/></button>
</template>