Feat: remote local timeline
This commit is contained in:
parent
35361f933e
commit
eee41cc6ba
7 changed files with 652 additions and 151 deletions
|
|
@ -152,6 +152,9 @@ function connectChannel() {
|
|||
roleId: props.role,
|
||||
});
|
||||
}
|
||||
if (props.src.startsWith('custom-timeline')) {
|
||||
return;
|
||||
}
|
||||
if (props.src !== 'directs' || props.src !== 'mentions') connection.on('note', prepend);
|
||||
}
|
||||
|
||||
|
|
@ -189,13 +192,13 @@ function updatePaginationQuery() {
|
|||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
};
|
||||
}else if (props.src === 'global') {
|
||||
} else if (props.src === 'global') {
|
||||
endpoint = 'notes/global-timeline';
|
||||
query = {
|
||||
withRenotes: props.withRenotes,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
};
|
||||
}else if(props.src === 'media'){
|
||||
} else if (props.src === 'media') {
|
||||
endpoint = 'notes/hybrid-timeline';
|
||||
query = {
|
||||
withFiles: true,
|
||||
|
|
@ -227,7 +230,13 @@ function updatePaginationQuery() {
|
|||
query = {
|
||||
roleId: props.role,
|
||||
};
|
||||
} else {
|
||||
} else if (props.src.startsWith('custom-timeline')) {
|
||||
endpoint = "notes/any-local-timeline";
|
||||
query = {
|
||||
host: defaultStore.state[`remoteLocalTimelineDomain${props.src.split("-")[2]}`],
|
||||
remoteToken:defaultStore.state[`remoteLocalTimelineToken${props.src.split("-")[2]}`]
|
||||
};
|
||||
}else {
|
||||
endpoint = null;
|
||||
query = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -220,6 +220,88 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template #label>{{ i18n.ts.other }}</template>
|
||||
|
||||
<div class="_gaps">
|
||||
<MkFolder>
|
||||
<template #label>リモートのローカルタイムラインをTLの上のバーのやつに表示する</template>
|
||||
<div style="padding: 0 16px;">
|
||||
<div v-if="maxLocalTimeline >= 1" style="padding: 16px 0 ;" >
|
||||
<MkInput v-model="remoteLocalTimelineName1" placeholder="prismisskey">
|
||||
<template #label>{{i18n.ts.name}}</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="remoteLocalTimelineDomain1" placeholder="prismisskey.space">
|
||||
<template #label>instance Url</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="remoteLocalTimelineToken1" placeholder="">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>Token</template>
|
||||
</MkInput>
|
||||
<MkSwitch v-model="remoteLocalTimelineEnable1">
|
||||
{{ i18n.ts.enable }}
|
||||
</MkSwitch>
|
||||
</div>
|
||||
<div v-if="maxLocalTimeline >= 2" style="padding: 16px 0 ;" >
|
||||
<MkInput v-model="remoteLocalTimelineName2" placeholder="prismisskey">
|
||||
<template #label>{{i18n.ts.name}}</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="remoteLocalTimelineDomain2" placeholder="prismisskey.space">
|
||||
<template #label>instance Url</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="remoteLocalTimelineToken2" placeholder="">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>Token</template>
|
||||
</MkInput>
|
||||
<MkSwitch v-model="remoteLocalTimelineEnable2">
|
||||
{{ i18n.ts.enable }}
|
||||
</MkSwitch>
|
||||
</div>
|
||||
<div v-if="maxLocalTimeline >= 3" style="padding: 16px 0 ;" >
|
||||
<MkInput v-model="remoteLocalTimelineName3" placeholder="prismisskey">
|
||||
<template #label>{{i18n.ts.name}}</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="remoteLocalTimelineDomain3" placeholder="prismisskey.space">
|
||||
<template #label>instance Url</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="remoteLocalTimelineToken3" placeholder="">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>Token</template>
|
||||
</MkInput>
|
||||
<MkSwitch v-model="remoteLocalTimelineEnable3">
|
||||
{{ i18n.ts.enable }}
|
||||
</MkSwitch>
|
||||
</div>
|
||||
<div v-if="maxLocalTimeline >= 4" style="padding: 16px 0 ;" >
|
||||
<MkInput v-model="remoteLocalTimelineName4" placeholder="prismisskey">
|
||||
<template #label>{{i18n.ts.name}}</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="remoteLocalTimelineDomain4" placeholder="prismisskey.space"/>
|
||||
<MkInput v-model="remoteLocalTimelineToken4" placeholder="">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>Token</template>
|
||||
</MkInput>
|
||||
<MkSwitch v-model="remoteLocalTimelineEnable4">
|
||||
{{ i18n.ts.enable }}
|
||||
</MkSwitch>
|
||||
</div>
|
||||
<div v-if="maxLocalTimeline >= 5" style="padding: 16px 0 ;" >
|
||||
<MkInput v-model="remoteLocalTimelineName5" placeholder="prismisskey">
|
||||
<template #label>{{i18n.ts.name}}</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="remoteLocalTimelineDomain5" placeholder="prismisskey.space">
|
||||
<template #label>instance Url</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="remoteLocalTimelineToken5" placeholder="">
|
||||
<template #prefix><i class="ti ti-key"></i></template>
|
||||
<template #label>Token</template>
|
||||
</MkInput>
|
||||
<MkSwitch v-model="remoteLocalTimelineEnable5">
|
||||
{{ i18n.ts.enable }}
|
||||
</MkSwitch>
|
||||
|
||||
</div>
|
||||
<MkButton @click="remoteLocaltimelineSave">
|
||||
{{ i18n.ts.save}}
|
||||
</MkButton>
|
||||
</div>
|
||||
</MkFolder>
|
||||
<MkFolder>
|
||||
<template #label>{{ i18n.ts.additionalEmojiDictionary }}</template>
|
||||
<div class="_buttons">
|
||||
|
|
@ -261,6 +343,7 @@ import { globalEvents } from '@/events.js';
|
|||
import { claimAchievement } from '@/scripts/achievements.js';
|
||||
import MkColorInput from '@/components/MkColorInput.vue';
|
||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
|
||||
const lang = ref(miLocalStorage.getItem('lang'));
|
||||
const fontSize = ref(miLocalStorage.getItem('fontSize'));
|
||||
|
|
@ -326,6 +409,29 @@ const showVisibilityColor = computed(defaultStore.makeGetterSetter('showVisibili
|
|||
const disableStreamingTimeline = computed(defaultStore.makeGetterSetter('disableStreamingTimeline'));
|
||||
const useGroupedNotifications = computed(defaultStore.makeGetterSetter('useGroupedNotifications'));
|
||||
const enableSeasonalScreenEffect = computed(defaultStore.makeGetterSetter('enableSeasonalScreenEffect'));
|
||||
const maxLocalTimeline = 3;
|
||||
const remoteLocalTimelineDomain1 = ref(defaultStore.state['remoteLocalTimelineDomain1']);
|
||||
const remoteLocalTimelineToken1 = ref(defaultStore.state['remoteLocalTimelineToken1']);
|
||||
const remoteLocalTimelineDomain2 = ref(defaultStore.state['remoteLocalTimelineDomain2']);
|
||||
const remoteLocalTimelineToken2 = ref(defaultStore.state['remoteLocalTimelineToken2']);
|
||||
const remoteLocalTimelineDomain3 = ref(defaultStore.state['remoteLocalTimelineDomain3']);
|
||||
const remoteLocalTimelineToken3 = ref(defaultStore.state['remoteLocalTimelineToken3']);
|
||||
const remoteLocalTimelineDomain4 = ref(defaultStore.state['remoteLocalTimelineDomain4']);
|
||||
const remoteLocalTimelineToken4 = ref(defaultStore.state['remoteLocalTimelineToken4']);
|
||||
const remoteLocalTimelineDomain5 = ref(defaultStore.state['remoteLocalTimelineDomain5']);
|
||||
const remoteLocalTimelineToken5 = ref(defaultStore.state['remoteLocalTimelineToken5']);
|
||||
const remoteLocalTimelineName1 = ref(defaultStore.state['remoteLocalTimelineName1']);
|
||||
const remoteLocalTimelineName2 = ref(defaultStore.state['remoteLocalTimelineName2']);
|
||||
const remoteLocalTimelineName3 = ref(defaultStore.state['remoteLocalTimelineName3']);
|
||||
const remoteLocalTimelineName4 = ref(defaultStore.state['remoteLocalTimelineName4']);
|
||||
const remoteLocalTimelineName5 = ref(defaultStore.state['remoteLocalTimelineName5']);
|
||||
|
||||
const remoteLocalTimelineEnable1 = computed(defaultStore.makeGetterSetter('remoteLocalTimelineEnable1'));
|
||||
const remoteLocalTimelineEnable2 = computed(defaultStore.makeGetterSetter('remoteLocalTimelineEnable2'));
|
||||
const remoteLocalTimelineEnable3 = computed(defaultStore.makeGetterSetter('remoteLocalTimelineEnable3'));
|
||||
const remoteLocalTimelineEnable4 = computed(defaultStore.makeGetterSetter('remoteLocalTimelineEnable4'));
|
||||
const remoteLocalTimelineEnable5 = computed(defaultStore.makeGetterSetter('remoteLocalTimelineEnable5'));
|
||||
|
||||
watch(lang, () => {
|
||||
miLocalStorage.setItem('lang', lang.value as string);
|
||||
miLocalStorage.removeItem('locale');
|
||||
|
|
@ -398,6 +504,30 @@ watch([
|
|||
await reloadAsk();
|
||||
});
|
||||
|
||||
async function remoteLocaltimelineSave() {
|
||||
os.alert({
|
||||
type: 'success',
|
||||
text: i18n.ts.saved,
|
||||
});
|
||||
await reloadAsk();
|
||||
defaultStore.set('remoteLocalTimelineDomain1', remoteLocalTimelineDomain1.value);
|
||||
defaultStore.set('remoteLocalTimelineToken1', remoteLocalTimelineToken1.value);
|
||||
defaultStore.set('remoteLocalTimelineDomain2', remoteLocalTimelineDomain2.value);
|
||||
defaultStore.set('remoteLocalTimelineToken2', remoteLocalTimelineToken2.value);
|
||||
defaultStore.set('remoteLocalTimelineDomain3', remoteLocalTimelineDomain3.value);
|
||||
defaultStore.set('remoteLocalTimelineToken3', remoteLocalTimelineToken3.value);
|
||||
defaultStore.set('remoteLocalTimelineDomain4', remoteLocalTimelineDomain4.value);
|
||||
defaultStore.set('remoteLocalTimelineToken4', remoteLocalTimelineToken4.value);
|
||||
defaultStore.set('remoteLocalTimelineDomain5', remoteLocalTimelineDomain5.value);
|
||||
defaultStore.set('remoteLocalTimelineToken5', remoteLocalTimelineToken5.value);
|
||||
defaultStore.set('remoteLocalTimelineName1', remoteLocalTimelineName1.value);
|
||||
defaultStore.set('remoteLocalTimelineName2', remoteLocalTimelineName2.value);
|
||||
defaultStore.set('remoteLocalTimelineName3', remoteLocalTimelineName3.value);
|
||||
defaultStore.set('remoteLocalTimelineName4', remoteLocalTimelineName4.value);
|
||||
defaultStore.set('remoteLocalTimelineName5', remoteLocalTimelineName5.value);
|
||||
|
||||
}
|
||||
|
||||
const emojiIndexLangs = ['en-US', 'ja-JP', 'ja-JP_hira'] as const;
|
||||
|
||||
function getEmojiIndexLangName(targetLang: typeof emojiIndexLangs[number]) {
|
||||
|
|
|
|||
|
|
@ -4,32 +4,32 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
-->
|
||||
|
||||
<template>
|
||||
<MkStickyContainer>
|
||||
<template #header><MkPageHeader v-model:tab="src" :actions="headerActions" :tabs="$i ? headerTabs : headerTabsWhenNotLogin" :displayMyAvatar="true"/></template>
|
||||
<MkSpacer :contentMax="800">
|
||||
<div ref="rootEl" v-hotkey.global="keymap">
|
||||
<MkInfo v-if="['home', 'local', 'social', 'global'].includes(src) && !defaultStore.reactiveState.timelineTutorials.value[src]" style="margin-bottom: var(--margin);" closable @close="closeTutorial()">
|
||||
<MkStickyContainer>
|
||||
<template #header><MkPageHeader v-model:tab="src" :actions="headerActions" :tabs="$i ? headerTabs : headerTabsWhenNotLogin" :displayMyAvatar="true"/></template>
|
||||
<MkSpacer :contentMax="800">
|
||||
<div ref="rootEl" v-hotkey.global="keymap">
|
||||
<MkInfo v-if="['home', 'local', 'social', 'global'].includes(src) && !defaultStore.reactiveState.timelineTutorials.value[src]" style="margin-bottom: var(--margin);" closable @close="closeTutorial()">
|
||||
{{ i18n.ts._timelineDescription[src] }}
|
||||
</MkInfo>
|
||||
<MkPostForm v-if="defaultStore.reactiveState.showFixedPostForm.value" :class="$style.postForm" class="post-form _panel" fixed style="margin-bottom: var(--margin);"/>
|
||||
<MkPostForm v-if="defaultStore.reactiveState.showFixedPostForm.value" :class="$style.postForm" class="post-form _panel" fixed style="margin-bottom: var(--margin);"/>
|
||||
|
||||
<div v-if="queue > 0" :class="$style.new"><button class="_buttonPrimary" :class="$style.newButton" @click="top()">{{ i18n.ts.newNoteRecived }}</button></div>
|
||||
<div :class="$style.tl">
|
||||
<MkTimeline
|
||||
ref="tlComponent"
|
||||
:key="src + withRenotes + withReplies + onlyFiles"
|
||||
:src="src.split(':')[0]"
|
||||
:list="src.split(':')[1]"
|
||||
:withRenotes="withRenotes"
|
||||
:withReplies="withReplies"
|
||||
:onlyFiles="onlyFiles"
|
||||
:sound="true"
|
||||
@queue="queueUpdated"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
<div v-if="queue > 0" :class="$style.new"><button class="_buttonPrimary" :class="$style.newButton" @click="top()">{{ i18n.ts.newNoteRecived }}</button></div>
|
||||
<div :class="$style.tl">
|
||||
<MkTimeline
|
||||
ref="tlComponent"
|
||||
:key="src + withRenotes + withReplies + onlyFiles"
|
||||
:src="src.split(':')[0]"
|
||||
:list="src.split(':')[1]"
|
||||
:withRenotes="withRenotes"
|
||||
:withReplies="withReplies"
|
||||
:onlyFiles="onlyFiles"
|
||||
:sound="true"
|
||||
@queue="queueUpdated"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -56,7 +56,7 @@ provide('shouldOmitHeaderTitle', true);
|
|||
const isLocalTimelineAvailable = ($i == null && instance.policies.ltlAvailable) || ($i != null && $i.policies.ltlAvailable);
|
||||
const isGlobalTimelineAvailable = ($i == null && instance.policies.gtlAvailable && defaultStore.state.showGlobalTimeline) || ($i != null && $i.policies.gtlAvailable && defaultStore.state.showGlobalTimeline);
|
||||
const keymap = {
|
||||
't': focus,
|
||||
't': focus,
|
||||
};
|
||||
|
||||
const tlComponent = shallowRef<InstanceType<typeof MkTimeline>>();
|
||||
|
|
@ -68,29 +68,33 @@ const src = computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src
|
|||
const withRenotes = ref(true);
|
||||
const withReplies = ref($i ? defaultStore.state.tlWithReplies : false);
|
||||
const onlyFiles = ref(false);
|
||||
const isShowMediaTimeline = ref(defaultStore.state.showMediaTimeline)
|
||||
|
||||
const isShowMediaTimeline = ref(defaultStore.state.showMediaTimeline);
|
||||
const remoteLocalTimelineEnable1 = ref(defaultStore.state.remoteLocalTimelineEnable1);
|
||||
const remoteLocalTimelineEnable2 = ref(defaultStore.state.remoteLocalTimelineEnable2);
|
||||
const remoteLocalTimelineEnable3 = ref(defaultStore.state.remoteLocalTimelineEnable3);
|
||||
const remoteLocalTimelineEnable4 = ref(defaultStore.state.remoteLocalTimelineEnable4);
|
||||
const remoteLocalTimelineEnable5 = ref(defaultStore.state.remoteLocalTimelineEnable5);
|
||||
watch(src, () => queue.value = 0);
|
||||
|
||||
watch(withReplies, (x) => {
|
||||
if ($i) defaultStore.set('tlWithReplies', x);
|
||||
if ($i) defaultStore.set('tlWithReplies', x);
|
||||
});
|
||||
|
||||
function queueUpdated(q: number): void {
|
||||
queue.value = q;
|
||||
queue.value = q;
|
||||
}
|
||||
|
||||
function top(): void {
|
||||
if (rootEl.value) scroll(rootEl.value, { top: 0 });
|
||||
if (rootEl.value) scroll(rootEl.value, { top: 0 });
|
||||
}
|
||||
|
||||
async function chooseList(ev: MouseEvent): Promise<void> {
|
||||
const lists = await userListsCache.fetch();
|
||||
const items : MenuItem[] = [
|
||||
const lists = await userListsCache.fetch();
|
||||
const items : MenuItem[] = [
|
||||
... lists.map(list => ({
|
||||
type: 'link' as const,
|
||||
text: list.name,
|
||||
to: `/timeline/list/${list.id}`,})),
|
||||
type: 'link' as const,
|
||||
text: list.name,
|
||||
to: `/timeline/list/${list.id}` })),
|
||||
(lists.length === 0 ? undefined : { type: 'divider' }),
|
||||
{
|
||||
type: 'link' as const,
|
||||
|
|
@ -98,18 +102,18 @@ async function chooseList(ev: MouseEvent): Promise<void> {
|
|||
text: i18n.ts.createNew,
|
||||
to: '/my/lists',
|
||||
},
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
}
|
||||
|
||||
async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
||||
const antennas = await antennasCache.fetch();
|
||||
const items : MenuItem[] = [
|
||||
const antennas = await antennasCache.fetch();
|
||||
const items : MenuItem[] = [
|
||||
... antennas.map(antenna => ({
|
||||
type: 'link' as const,
|
||||
text: antenna.name,
|
||||
indicate: antenna.hasUnreadNote,
|
||||
to: `/timeline/antenna/${antenna.id}`,})),
|
||||
type: 'link' as const,
|
||||
text: antenna.name,
|
||||
indicate: antenna.hasUnreadNote,
|
||||
to: `/timeline/antenna/${antenna.id}` })),
|
||||
(antennas.length === 0 ? undefined : { type: 'divider' }),
|
||||
{
|
||||
type: 'link' as const,
|
||||
|
|
@ -117,23 +121,23 @@ async function chooseAntenna(ev: MouseEvent): Promise<void> {
|
|||
text: i18n.ts.createNew,
|
||||
to: '/my/antennas',
|
||||
},
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
}
|
||||
|
||||
async function chooseChannel(ev: MouseEvent): Promise<void> {
|
||||
const channels = await misskeyApi('channels/my-favorites', {
|
||||
limit: 100,
|
||||
});
|
||||
const items: MenuItem[] = [
|
||||
const channels = await misskeyApi('channels/my-favorites', {
|
||||
limit: 100,
|
||||
});
|
||||
const items: MenuItem[] = [
|
||||
...channels.map(channel => {
|
||||
const lastReadedAt = miLocalStorage.getItemAsJson(`channelLastReadedAt:${channel.id}`) ?? null;
|
||||
const lastReadedAt = miLocalStorage.getItemAsJson(`channelLastReadedAt:${channel.id}`) ?? null;
|
||||
const hasUnreadNote = (lastReadedAt && channel.lastNotedAt) ? Date.parse(channel.lastNotedAt) > lastReadedAt : !!(!lastReadedAt && channel.lastNotedAt);
|
||||
|
||||
return {type: 'link' as const,
|
||||
text: channel.name,
|
||||
indicate: hasUnreadNote,
|
||||
to: `/channels/${channel.id}`,};
|
||||
return { type: 'link' as const,
|
||||
text: channel.name,
|
||||
indicate: hasUnreadNote,
|
||||
to: `/channels/${channel.id}` };
|
||||
}),
|
||||
(channels.length === 0 ? undefined : { type: 'divider' }),
|
||||
{
|
||||
|
|
@ -142,34 +146,34 @@ async function chooseChannel(ev: MouseEvent): Promise<void> {
|
|||
text: i18n.ts.createNew,
|
||||
to: '/channels',
|
||||
},
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
];
|
||||
os.popupMenu(items, ev.currentTarget ?? ev.target);
|
||||
}
|
||||
|
||||
function saveSrc(newSrc: 'home' | 'local' | 'media' | 'social' | 'global' | `list:${string}`): void {
|
||||
let userList = null;
|
||||
if (newSrc.startsWith('userList:')) {
|
||||
const id = newSrc.substring('userList:'.length);
|
||||
userList = defaultStore.reactiveState.pinnedUserLists.value.find(l => l.id === id);
|
||||
}
|
||||
defaultStore.set('tl', {
|
||||
src: newSrc,
|
||||
userList,
|
||||
});
|
||||
srcWhenNotSignin.value = newSrc;
|
||||
let userList = null;
|
||||
if (newSrc.startsWith('userList:')) {
|
||||
const id = newSrc.substring('userList:'.length);
|
||||
userList = defaultStore.reactiveState.pinnedUserLists.value.find(l => l.id === id);
|
||||
}
|
||||
defaultStore.set('tl', {
|
||||
src: newSrc,
|
||||
userList,
|
||||
});
|
||||
srcWhenNotSignin.value = newSrc;
|
||||
}
|
||||
|
||||
async function timetravel(): Promise<void> {
|
||||
const { canceled, result: date } = await os.inputDate({
|
||||
title: i18n.ts.date,
|
||||
});
|
||||
if (canceled) return;
|
||||
const { canceled, result: date } = await os.inputDate({
|
||||
title: i18n.ts.date,
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
tlComponent.value.timetravel(date);
|
||||
tlComponent.value.timetravel(date);
|
||||
}
|
||||
|
||||
function focus(): void {
|
||||
tlComponent.value.focus();
|
||||
tlComponent.value.focus();
|
||||
}
|
||||
|
||||
function closeTutorial(): void {
|
||||
|
|
@ -180,28 +184,28 @@ function closeTutorial(): void {
|
|||
}
|
||||
|
||||
const headerActions = computed(() => {
|
||||
const tmp = [
|
||||
{icon: 'ti ti-dots',
|
||||
text: i18n.ts.options,
|
||||
handler: (ev) => {
|
||||
os.popupMenu([{
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRenotes,
|
||||
const tmp = [
|
||||
{ icon: 'ti ti-dots',
|
||||
text: i18n.ts.options,
|
||||
handler: (ev) => {
|
||||
os.popupMenu([{
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRenotes,
|
||||
|
||||
ref: withRenotes,
|
||||
}, src.value === 'local' || src.value === 'social' ? {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRepliesToOthersInTimeline,
|
||||
ref: withReplies,
|
||||
disabled: onlyFiles,} : undefined, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.fileAttachedOnly,
|
||||
ref: withRenotes,
|
||||
}, src.value === 'local' || src.value === 'social' ? {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRepliesToOthersInTimeline,
|
||||
ref: withReplies,
|
||||
disabled: onlyFiles } : undefined, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.fileAttachedOnly,
|
||||
|
||||
ref: onlyFiles,
|
||||
disabled: src.value === 'local' || src.value === 'social' ? withReplies : false,
|
||||
}], ev.currentTarget ?? ev.target);
|
||||
},
|
||||
},
|
||||
ref: onlyFiles,
|
||||
disabled: src.value === 'local' || src.value === 'social' ? withReplies : false,
|
||||
}], ev.currentTarget ?? ev.target);
|
||||
},
|
||||
},
|
||||
];
|
||||
if (deviceKind === 'desktop') {
|
||||
tmp.unshift({
|
||||
|
|
@ -217,70 +221,95 @@ const headerActions = computed(() => {
|
|||
});
|
||||
|
||||
const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserLists.value.map(l => ({
|
||||
key: 'list:' + l.id,
|
||||
title: l.name,
|
||||
icon: 'ti ti-star',
|
||||
iconOnly: true,
|
||||
key: 'list:' + l.id,
|
||||
title: l.name,
|
||||
icon: 'ti ti-star',
|
||||
iconOnly: true,
|
||||
}))), {
|
||||
key: 'home',
|
||||
title: i18n.ts._timelines.home,
|
||||
icon: 'ti ti-home',
|
||||
iconOnly: true,
|
||||
key: 'home',
|
||||
title: i18n.ts._timelines.home,
|
||||
icon: 'ti ti-home',
|
||||
iconOnly: true,
|
||||
}, ...(isLocalTimelineAvailable ? [{
|
||||
key: 'local',
|
||||
title: i18n.ts._timelines.local,
|
||||
icon: 'ti ti-planet',
|
||||
iconOnly: true,
|
||||
key: 'local',
|
||||
title: i18n.ts._timelines.local,
|
||||
icon: 'ti ti-planet',
|
||||
iconOnly: true,
|
||||
}, ...(isShowMediaTimeline.value ? [{
|
||||
key: 'media',
|
||||
title: i18n.ts._timelines.media,
|
||||
icon: 'ti ti-photo',
|
||||
iconOnly: true,
|
||||
key: 'media',
|
||||
title: i18n.ts._timelines.media,
|
||||
icon: 'ti ti-photo',
|
||||
iconOnly: true,
|
||||
}] : []), {
|
||||
key: 'social',
|
||||
title: i18n.ts._timelines.social,
|
||||
icon: 'ti ti-universe',
|
||||
iconOnly: true,
|
||||
key: 'social',
|
||||
title: i18n.ts._timelines.social,
|
||||
icon: 'ti ti-universe',
|
||||
iconOnly: true,
|
||||
}] : []), ...(remoteLocalTimelineEnable1.value ? [{
|
||||
key: 'custom-timeline-1',
|
||||
title: defaultStore.state.remoteLocalTimelineName1,
|
||||
icon: 'ti ti-plus',
|
||||
iconOnly: false,
|
||||
}] : []), ...(remoteLocalTimelineEnable2.value ? [{
|
||||
key: 'custom-timeline-2',
|
||||
title: defaultStore.state.remoteLocalTimelineName2,
|
||||
icon: 'ti ti-plus',
|
||||
iconOnly: false,
|
||||
}] : []), ...(remoteLocalTimelineEnable3.value ? [{
|
||||
key: 'custom-timeline-3',
|
||||
title: defaultStore.state.remoteLocalTimelineName3,
|
||||
icon: 'ti ti-plus',
|
||||
iconOnly: false,
|
||||
}] : []), ...(remoteLocalTimelineEnable4.value ? [{
|
||||
key: 'custom-timeline-4',
|
||||
title: defaultStore.state.remoteLocalTimelineName4,
|
||||
icon: 'ti ti-plus',
|
||||
iconOnly: false,
|
||||
}] : []), ...(remoteLocalTimelineEnable5.value ? [{
|
||||
key: 'custom-timeline-5',
|
||||
title: defaultStore.state.remoteLocalTimelineName5,
|
||||
icon: 'ti ti-plus',
|
||||
iconOnly: false,
|
||||
}] : []), ...(isGlobalTimelineAvailable ? [{
|
||||
key: 'global',
|
||||
title: i18n.ts._timelines.global,
|
||||
icon: 'ti ti-whirl',
|
||||
iconOnly: true,
|
||||
key: 'global',
|
||||
title: i18n.ts._timelines.global,
|
||||
icon: 'ti ti-whirl',
|
||||
iconOnly: true,
|
||||
}] : []), {
|
||||
icon: 'ti ti-list',
|
||||
title: i18n.ts.lists,
|
||||
iconOnly: true,
|
||||
onClick: chooseList,
|
||||
icon: 'ti ti-list',
|
||||
title: i18n.ts.lists,
|
||||
iconOnly: true,
|
||||
onClick: chooseList,
|
||||
}, {
|
||||
icon: 'ti ti-antenna',
|
||||
title: i18n.ts.antennas,
|
||||
iconOnly: true,
|
||||
onClick: chooseAntenna,
|
||||
icon: 'ti ti-antenna',
|
||||
title: i18n.ts.antennas,
|
||||
iconOnly: true,
|
||||
onClick: chooseAntenna,
|
||||
}, {
|
||||
icon: 'ti ti-device-tv',
|
||||
title: i18n.ts.channel,
|
||||
iconOnly: true,
|
||||
onClick: chooseChannel,
|
||||
icon: 'ti ti-device-tv',
|
||||
title: i18n.ts.channel,
|
||||
iconOnly: true,
|
||||
onClick: chooseChannel,
|
||||
}] as Tab[]);
|
||||
|
||||
const headerTabsWhenNotLogin = computed(() => [
|
||||
...(isLocalTimelineAvailable ? [{
|
||||
key: 'local',
|
||||
title: i18n.ts._timelines.local,
|
||||
icon: 'ti ti-planet',
|
||||
iconOnly: true,
|
||||
}] : []),
|
||||
...(isGlobalTimelineAvailable ? [{
|
||||
key: 'global',
|
||||
title: i18n.ts._timelines.global,
|
||||
icon: 'ti ti-whirl',
|
||||
iconOnly: true,
|
||||
}] : []),
|
||||
...(isLocalTimelineAvailable ? [{
|
||||
key: 'local',
|
||||
title: i18n.ts._timelines.local,
|
||||
icon: 'ti ti-planet',
|
||||
iconOnly: true,
|
||||
}] : []),
|
||||
...(isGlobalTimelineAvailable ? [{
|
||||
key: 'global',
|
||||
title: i18n.ts._timelines.global,
|
||||
icon: 'ti ti-whirl',
|
||||
iconOnly: true,
|
||||
}] : []),
|
||||
] as Tab[]);
|
||||
|
||||
definePageMetadata(computed(() => ({
|
||||
title: i18n.ts.timeline,
|
||||
icon: src.value === 'local' ? 'ti ti-planet' : src.value === 'social' ? 'ti ti-universe' : src.value === 'global' ? 'ti ti-whirl' : 'ti ti-home',
|
||||
title: i18n.ts.timeline,
|
||||
icon: src.value === 'local' ? 'ti ti-planet' : src.value === 'social' ? 'ti ti-universe' : src.value === 'global' ? 'ti ti-whirl' : 'ti ti-home',
|
||||
})));
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -465,6 +465,86 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||
where: 'device',
|
||||
default: 44,
|
||||
},
|
||||
remoteLocalTimelineDomain1: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineDomain2: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineDomain3: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineDomain4: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineDomain5: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineToken1: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineToken2: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineToken3: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineToken4: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineToken5: {
|
||||
where: 'account',
|
||||
default: '',
|
||||
},
|
||||
remoteLocalTimelineEnable1: {
|
||||
where: 'account',
|
||||
default: false,
|
||||
},
|
||||
remoteLocalTimelineEnable2: {
|
||||
where: 'account',
|
||||
default: false,
|
||||
},
|
||||
remoteLocalTimelineEnable3: {
|
||||
where: 'account',
|
||||
default: false,
|
||||
},
|
||||
remoteLocalTimelineEnable4: {
|
||||
where: 'account',
|
||||
default: false,
|
||||
},
|
||||
remoteLocalTimelineEnable5: {
|
||||
where: 'account',
|
||||
default: false,
|
||||
},
|
||||
remoteLocalTimelineName1: {
|
||||
where: 'account',
|
||||
default: 'custom timeline 1',
|
||||
},
|
||||
remoteLocalTimelineName2: {
|
||||
where: 'account',
|
||||
default: 'custom timeline 2 ',
|
||||
},
|
||||
remoteLocalTimelineName3: {
|
||||
where: 'account',
|
||||
default: 'custom timeline 3',
|
||||
},
|
||||
remoteLocalTimelineName4: {
|
||||
where: 'account',
|
||||
default: 'custom timeline 4',
|
||||
},
|
||||
remoteLocalTimelineName5: {
|
||||
where: 'account',
|
||||
default: 'custom timeline 5',
|
||||
},
|
||||
onlyAndWithSave: {
|
||||
where: 'device',
|
||||
default: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue