Merge branch 'develop' into sw-notification-action

This commit is contained in:
tamaina
2021-04-23 23:05:18 +09:00
59 changed files with 2755 additions and 1892 deletions

View File

@@ -25,9 +25,9 @@
</component>
</template>
<div class="divider"></div>
<button class="item _button" :class="{ active: $route.path === '/instance' || $route.path.startsWith('/instance/') }" v-if="$i.isAdmin || $i.isModerator" @click="oepnInstanceMenu">
<MkA v-if="$i.isAdmin || $i.isModerator" class="item" active-class="active" to="/instance">
<i class="fas fa-server fa-fw"></i><span class="text">{{ $ts.instance }}</span>
</button>
</MkA>
<button class="item _button" @click="more">
<i class="fa fa-ellipsis-h fa-fw"></i><span class="text">{{ $ts.more }}</span>
<span v-if="otherNavItemIndicated" class="indicator"><i class="fas fa-circle"></i></span>
@@ -157,11 +157,11 @@ export default defineComponent({
avatar: this.$i,
}, null, ...accountItemPromises, {
icon: 'fas fa-plus',
text: this.$ts.addAcount,
text: this.$ts.addAccount,
action: () => {
os.modalMenu([{
text: this.$ts.existingAcount,
action: () => { this.addAcount(); },
text: this.$ts.existingAccount,
action: () => { this.addAccount(); },
}, {
text: this.$ts.createAccount,
action: () => { this.createAccount(); },
@@ -172,71 +172,12 @@ export default defineComponent({
});
},
oepnInstanceMenu(ev) {
os.modalMenu([{
type: 'link',
text: this.$ts.dashboard,
to: '/instance',
icon: 'fas fa-tachometer-alt',
}, null, this.$i.isAdmin ? {
type: 'link',
text: this.$ts.settings,
to: '/instance/settings',
icon: 'fas fa-cog',
} : undefined, {
type: 'link',
text: this.$ts.customEmojis,
to: '/instance/emojis',
icon: 'fas fa-laugh',
}, {
type: 'link',
text: this.$ts.users,
to: '/instance/users',
icon: 'fas fa-users',
}, {
type: 'link',
text: this.$ts.files,
to: '/instance/files',
icon: 'fas fa-cloud',
}, {
type: 'link',
text: this.$ts.jobQueue,
to: '/instance/queue',
icon: 'fas fa-exchange-alt',
}, {
type: 'link',
text: this.$ts.federation,
to: '/instance/federation',
icon: 'fas fa-globe',
}, {
type: 'link',
text: this.$ts.relays,
to: '/instance/relays',
icon: 'fas fa-project-diagram',
}, {
type: 'link',
text: this.$ts.announcements,
to: '/instance/announcements',
icon: 'fas fa-broadcast-tower',
}, {
type: 'link',
text: this.$ts.abuseReports,
to: '/instance/abuses',
icon: 'fas fa-exclamation-circle',
}, {
type: 'link',
text: this.$ts.logs,
to: '/instance/logs',
icon: 'fas fa-stream',
}], ev.currentTarget || ev.target);
},
more(ev) {
os.popup(import('@client/components/launch-pad.vue'), {}, {
}, 'closed');
},
addAcount() {
addAccount() {
os.popup(import('@client/components/signin-dialog.vue'), {}, {
done: async res => {
await addAccount(res.id, res.i);

View File

@@ -1,6 +1,6 @@
<template>
<div class="npcljfve" :class="{ iconOnly }">
<button class="item _button account" @click="openAccountMenu">
<button class="item _button account" @click="openAccountMenu" v-click-anime>
<MkAvatar :user="$i" class="avatar"/><MkAcct class="text" :user="$i"/>
</button>
<div class="post" @click="post">
@@ -9,25 +9,25 @@
</MkButton>
</div>
<div class="divider"></div>
<MkA class="item index" active-class="active" to="/" exact>
<MkA class="item index" active-class="active" to="/" exact v-click-anime>
<i class="fas fa-home fa-fw"></i><span class="text">{{ $ts.timeline }}</span>
</MkA>
<template v-for="item in menu">
<div v-if="item === '-'" class="divider"></div>
<component v-else-if="menuDef[item] && (menuDef[item].show !== false)" :is="menuDef[item].to ? 'MkA' : 'button'" class="item _button" :class="item" active-class="active" v-on="menuDef[item].action ? { click: menuDef[item].action } : {}" :to="menuDef[item].to">
<component v-else-if="menuDef[item] && (menuDef[item].show !== false)" :is="menuDef[item].to ? 'MkA' : 'button'" class="item _button" :class="item" active-class="active" v-on="menuDef[item].action ? { click: menuDef[item].action } : {}" :to="menuDef[item].to" v-click-anime>
<i class="fa-fw" :class="menuDef[item].icon"></i><span class="text">{{ $ts[menuDef[item].title] }}</span>
<span v-if="menuDef[item].indicated" class="indicator"><i class="fas fa-circle"></i></span>
</component>
</template>
<div class="divider"></div>
<button class="item _button" :class="{ active: $route.path === '/instance' || $route.path.startsWith('/instance/') }" v-if="$i.isAdmin || $i.isModerator" @click="oepnInstanceMenu">
<MkA v-if="$i.isAdmin || $i.isModerator" class="item" active-class="active" to="/instance" :behavior="settingsWindowed ? 'modalWindow' : null" v-click-anime>
<i class="fas fa-server fa-fw"></i><span class="text">{{ $ts.instance }}</span>
</button>
<button class="item _button" @click="more">
</MkA>
<button class="item _button" @click="more" v-click-anime>
<i class="fas fa-ellipsis-h fa-fw"></i><span class="text">{{ $ts.more }}</span>
<span v-if="otherNavItemIndicated" class="indicator"><i class="fas fa-circle"></i></span>
</button>
<MkA class="item" active-class="active" to="/settings" :behavior="settingsWindowed ? 'modalWindow' : null">
<MkA class="item" active-class="active" to="/settings" :behavior="settingsWindowed ? 'modalWindow' : null" v-click-anime>
<i class="fas fa-cog fa-fw"></i><span class="text">{{ $ts.settings }}</span>
</MkA>
<div class="divider"></div>
@@ -141,11 +141,11 @@ export default defineComponent({
avatar: this.$i,
}, null, ...accountItemPromises, {
icon: 'fas fa-plus',
text: this.$ts.addAcount,
text: this.$ts.addAccount,
action: () => {
os.modalMenu([{
text: this.$ts.existingAcount,
action: () => { this.addAcount(); },
text: this.$ts.existingAccount,
action: () => { this.addAccount(); },
}, {
text: this.$ts.createAccount,
action: () => { this.createAccount(); },
@@ -156,71 +156,12 @@ export default defineComponent({
});
},
oepnInstanceMenu(ev) {
os.modalMenu([{
type: 'link',
text: this.$ts.dashboard,
to: '/instance',
icon: 'fas fa-tachometer-alt',
}, null, this.$i.isAdmin ? {
type: 'link',
text: this.$ts.settings,
to: '/instance/settings',
icon: 'fas fa-cog',
} : undefined, {
type: 'link',
text: this.$ts.customEmojis,
to: '/instance/emojis',
icon: 'fas fa-laugh',
}, {
type: 'link',
text: this.$ts.users,
to: '/instance/users',
icon: 'fas fa-users',
}, {
type: 'link',
text: this.$ts.files,
to: '/instance/files',
icon: 'fas fa-cloud',
}, {
type: 'link',
text: this.$ts.jobQueue,
to: '/instance/queue',
icon: 'fas fa-exchange-alt',
}, {
type: 'link',
text: this.$ts.federation,
to: '/instance/federation',
icon: 'fas fa-globe',
}, {
type: 'link',
text: this.$ts.relays,
to: '/instance/relays',
icon: 'fas fa-project-diagram',
}, {
type: 'link',
text: this.$ts.announcements,
to: '/instance/announcements',
icon: 'fas fa-broadcast-tower',
}, {
type: 'link',
text: this.$ts.abuseReports,
to: '/instance/abuses',
icon: 'fas fa-exclamation-circle',
}, {
type: 'link',
text: this.$ts.logs,
to: '/instance/logs',
icon: 'fas fa-stream',
}], ev.currentTarget || ev.target);
},
more(ev) {
os.popup(import('@client/components/launch-pad.vue'), {}, {
}, 'closed');
},
addAcount() {
addAccount() {
os.popup(import('@client/components/signin-dialog.vue'), {}, {
done: res => {
addAccount(res.id, res.i);

View File

@@ -218,6 +218,8 @@ export default defineComponent({
$widgets-hide-threshold: 1200px;
$nav-icon-only-width: 78px; // TODO: どこかに集約したい
--panelShadow: none;
// ほんとは単に 100vh と書きたいところだが... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
min-height: calc(var(--vh, 1vh) * 100);
box-sizing: border-box;
@@ -250,7 +252,7 @@ export default defineComponent({
display: flex;
justify-content: center;
max-width: 100%;
margin: 32px 0;
//margin: 32px 0;
&.fullView {
margin: 0;
@@ -276,6 +278,8 @@ export default defineComponent({
width: 750px;
margin: 0 16px 0 0;
background: var(--bg);
box-shadow: 0 0 0 1px var(--divider);
border-radius: 0;
--margin: 12px;
> .header {
@@ -308,12 +312,17 @@ export default defineComponent({
> .widgets {
//--panelShadow: none;
width: 300px;
margin-top: 16px;
@media (max-width: $widgets-hide-threshold) {
display: none;
}
}
> .sidebar {
margin-top: 16px;
}
@media (max-width: 850px) {
margin: 0;