Merge branch 'develop' into more-share-page-querys

This commit is contained in:
tamaina 2021-07-26 22:14:22 +09:00
commit 3581bf9a06
121 changed files with 3221 additions and 615 deletions

View file

@ -90,7 +90,7 @@ export default defineComponent({
stats: null,
serverInfo: null,
connection: null,
queueConnection: os.stream.useChannel('queueStats'),
queueConnection: markRaw(os.stream.useChannel('queueStats')),
memUsage: 0,
chartCpuMem: null,
chartNet: null,
@ -121,7 +121,7 @@ export default defineComponent({
os.api('admin/server-info', {}).then(res => {
this.serverInfo = res;
this.connection = os.stream.useChannel('serverStats');
this.connection = markRaw(os.stream.useChannel('serverStats'));
this.connection.on('stats', this.onStats);
this.connection.on('statsLog', this.onStatsLog);
this.connection.send('requestLog', {

View file

@ -11,7 +11,7 @@
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { defineComponent, markRaw } from 'vue';
import MkButton from '@client/components/ui/button.vue';
import XQueue from './queue.chart.vue';
import FormBase from '@client/components/form/base.vue';
@ -35,7 +35,7 @@ export default defineComponent({
title: this.$ts.jobQueue,
icon: 'fas fa-clipboard-list',
},
connection: os.stream.useChannel('queueStats'),
connection: markRaw(os.stream.useChannel('queueStats')),
}
},

View file

@ -37,7 +37,7 @@
</template>
<script lang="ts">
import { defineAsyncComponent, defineComponent } from 'vue';
import { defineAsyncComponent, defineComponent, markRaw } from 'vue';
import { getAcct } from '@/misc/acct';
import MkButton from '@client/components/ui/button.vue';
import { acct } from '../../filters/user';
@ -63,7 +63,7 @@ export default defineComponent({
},
mounted() {
this.connection = os.stream.useChannel('messagingIndex');
this.connection = markRaw(os.stream.useChannel('messagingIndex'));
this.connection.on('message', this.onMessage);
this.connection.on('read', this.onRead);

View file

@ -36,7 +36,7 @@
</template>
<script lang="ts">
import { computed, defineComponent } from 'vue';
import { computed, defineComponent, markRaw } from 'vue';
import XList from '@client/components/date-separated-list.vue';
import XMessage from './messaging-room.message.vue';
import XForm from './messaging-room.form.vue';
@ -141,10 +141,10 @@ const Component = defineComponent({
this.group = group;
}
this.connection = os.stream.useChannel('messaging', {
this.connection = markRaw(os.stream.useChannel('messaging', {
otherparty: this.user ? this.user.id : undefined,
group: this.group ? this.group.id : undefined,
});
}));
this.connection.on('message', this.onMessage);
this.connection.on('read', this.onRead);

View file

@ -5,7 +5,7 @@
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { defineComponent, markRaw } from 'vue';
import GameSetting from './game.setting.vue';
import GameBoard from './game.board.vue';
import * as os from '@client/os';
@ -61,9 +61,9 @@ export default defineComponent({
if (this.connection) {
this.connection.dispose();
}
this.connection = os.stream.useChannel('gamesReversiGame', {
this.connection = markRaw(os.stream.useChannel('gamesReversiGame', {
gameId: this.game.id
});
}));
this.connection.on('started', this.onStarted);
});
},

View file

@ -60,7 +60,7 @@
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { defineComponent, markRaw } from 'vue';
import * as os from '@client/os';
import MkButton from '@client/components/ui/button.vue';
import MkFolder from '@client/components/ui/folder.vue';
@ -92,7 +92,7 @@ export default defineComponent({
mounted() {
if (this.$i) {
this.connection = os.stream.useChannel('gamesReversi');
this.connection = markRaw(os.stream.useChannel('gamesReversi'));
this.connection.on('invited', this.onInvited);

View file

@ -37,6 +37,7 @@
<FormSwitch v-model:value="showGapBetweenNotesInTimeline">{{ $ts.showGapBetweenNotesInTimeline }}</FormSwitch>
<FormSwitch v-model:value="loadRawImages">{{ $ts.loadRawImages }}</FormSwitch>
<FormSwitch v-model:value="disableShowingAnimatedImages">{{ $ts.disableShowingAnimatedImages }}</FormSwitch>
<FormSwitch v-model:value="squareAvatars">{{ $ts.squareAvatars }}</FormSwitch>
<FormSwitch v-model:value="useSystemFont">{{ $ts.useSystemFont }}</FormSwitch>
<FormSwitch v-model:value="useOsNativeEmojis">{{ $ts.useOsNativeEmojis }}
<div><Mfm text="🍮🍦🍭🍩🍰🍫🍬🥞🍪" :key="useOsNativeEmojis"/></div>
@ -145,6 +146,7 @@ export default defineComponent({
instanceTicker: defaultStore.makeGetterSetter('instanceTicker'),
enableInfiniteScroll: defaultStore.makeGetterSetter('enableInfiniteScroll'),
useReactionPickerForContextMenu: defaultStore.makeGetterSetter('useReactionPickerForContextMenu'),
squareAvatars: defaultStore.makeGetterSetter('squareAvatars'),
},
watch: {
@ -176,6 +178,10 @@ export default defineComponent({
this.reloadAsk();
},
squareAvatars() {
this.reloadAsk();
},
showGapBetweenNotesInTimeline() {
this.reloadAsk();
},

View file

@ -26,7 +26,7 @@
<template #label>{{ $ts.clientSettings }}</template>
<FormLink :active="page === 'general'" replace to="/settings/general"><template #icon><i class="fas fa-cogs"></i></template>{{ $ts.general }}</FormLink>
<FormLink :active="page === 'theme'" replace to="/settings/theme"><template #icon><i class="fas fa-palette"></i></template>{{ $ts.theme }}</FormLink>
<FormLink :active="page === 'sidebar'" replace to="/settings/sidebar"><template #icon><i class="fas fa-list-ul"></i></template>{{ $ts.sidebar }}</FormLink>
<FormLink :active="page === 'menu'" replace to="/settings/menu"><template #icon><i class="fas fa-list-ul"></i></template>{{ $ts.menu }}</FormLink>
<FormLink :active="page === 'sounds'" replace to="/settings/sounds"><template #icon><i class="fas fa-music"></i></template>{{ $ts.sounds }}</FormLink>
<FormLink :active="page === 'plugin'" replace to="/settings/plugin"><template #icon><i class="fas fa-plug"></i></template>{{ $ts.plugins }}</FormLink>
</FormGroup>
@ -121,7 +121,7 @@ export default defineComponent({
case 'theme': return defineAsyncComponent(() => import('./theme.vue'));
case 'theme/install': return defineAsyncComponent(() => import('./theme.install.vue'));
case 'theme/manage': return defineAsyncComponent(() => import('./theme.manage.vue'));
case 'sidebar': return defineAsyncComponent(() => import('./sidebar.vue'));
case 'menu': return defineAsyncComponent(() => import('./menu.vue'));
case 'sounds': return defineAsyncComponent(() => import('./sounds.vue'));
case 'custom-css': return defineAsyncComponent(() => import('./custom-css.vue'));
case 'deck': return defineAsyncComponent(() => import('./deck.vue'));

View file

@ -1,18 +1,18 @@
<template>
<FormBase>
<FormTextarea v-model:value="items" tall>
<span>{{ $ts.sidebar }}</span>
<FormTextarea v-model:value="items" tall manual-save>
<span>{{ $ts.menu }}</span>
<template #desc><button class="_textButton" @click="addItem">{{ $ts.addItem }}</button></template>
</FormTextarea>
<FormRadios v-model="sidebarDisplay">
<FormRadios v-model="menuDisplay">
<template #desc>{{ $ts.display }}</template>
<option value="full">{{ $ts._sidebar.full }}</option>
<option value="icon">{{ $ts._sidebar.icon }}</option>
<!-- <MkRadio v-model="sidebarDisplay" value="hide" disabled>{{ $ts._sidebar.hide }}</MkRadio>--> <!-- TODO: サイドバーを完全に隠せるようにすると別途ハンバーガーボタンのようなものをUIに表示する必要があり面倒 -->
<option value="sideFull">{{ $ts._menuDisplay.sideFull }}</option>
<option value="sideIcon">{{ $ts._menuDisplay.sideIcon }}</option>
<option value="top">{{ $ts._menuDisplay.top }}</option>
<!-- <MkRadio v-model="menuDisplay" value="hide" disabled>{{ $ts._menuDisplay.hide }}</MkRadio>--> <!-- TODO: サイドバーを完全に隠せるようにすると別途ハンバーガーボタンのようなものをUIに表示する必要があり面倒 -->
</FormRadios>
<FormButton @click="save()" primary><i class="fas fa-save"></i> {{ $ts.save }}</FormButton>
<FormButton @click="reset()" danger><i class="fas fa-redo"></i> {{ $ts.default }}</FormButton>
</FormBase>
</template>
@ -26,7 +26,7 @@ import FormBase from '@client/components/form/base.vue';
import FormGroup from '@client/components/form/group.vue';
import FormButton from '@client/components/form/button.vue';
import * as os from '@client/os';
import { sidebarDef } from '@client/sidebar';
import { menuDef } from '@client/menu';
import { defaultStore } from '@client/store';
import * as symbols from '@client/symbols';
import { unisonReload } from '@client/scripts/unison-reload';
@ -44,11 +44,11 @@ export default defineComponent({
data() {
return {
[symbols.PAGE_INFO]: {
title: this.$ts.sidebar,
title: this.$ts.menu,
icon: 'fas fa-list-ul'
},
menuDef: sidebarDef,
items: '',
menuDef: menuDef,
items: defaultStore.state.menu.join('\n'),
}
},
@ -57,11 +57,17 @@ export default defineComponent({
return this.items.trim().split('\n').filter(x => x.trim() !== '');
},
sidebarDisplay: defaultStore.makeGetterSetter('sidebarDisplay')
menuDisplay: defaultStore.makeGetterSetter('menuDisplay')
},
created() {
this.items = this.$store.state.menu.join('\n');
watch: {
menuDisplay() {
this.reloadAsk();
},
items() {
this.save();
},
},
mounted() {
@ -85,7 +91,6 @@ export default defineComponent({
});
if (canceled) return;
this.items = [...this.splited, item].join('\n');
this.save();
},
save() {
@ -96,7 +101,6 @@ export default defineComponent({
reset() {
this.$store.reset('menu');
this.items = this.$store.state.menu.join('\n');
this.reloadAsk();
},
async reloadAsk() {