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() { data() {
return { return {
INFO: { INFO: {
header: [{ title: this.$t('error'),
title: this.$t('error'), icon: faExclamationTriangle
icon: faExclamationTriangle
}]
}, },
faExclamationTriangle faExclamationTriangle
}; };

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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