2023-01-13 13:40:33 +09:00
|
|
|
import { computed, ref, reactive } from "vue";
|
|
|
|
import { $i } from "./account";
|
|
|
|
import { search } from "@/scripts/search";
|
|
|
|
import * as os from "@/os";
|
|
|
|
import { i18n } from "@/i18n";
|
|
|
|
import { ui } from "@/config";
|
|
|
|
import { unisonReload } from "@/scripts/unison-reload";
|
2023-02-11 08:41:19 +09:00
|
|
|
import { defaultStore } from "@/store";
|
|
|
|
import { instance } from "@/instance";
|
|
|
|
import { host } from "@/config";
|
|
|
|
import XTutorial from "@/components/MkTutorialDialog.vue";
|
2020-10-17 20:12:00 +09:00
|
|
|
|
2022-07-14 17:42:12 +09:00
|
|
|
export const navbarItemDef = reactive({
|
2020-10-17 20:12:00 +09:00
|
|
|
notifications: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "notifications",
|
|
|
|
icon: "ph-bell-bold ph-lg",
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2023-01-13 13:40:33 +09:00
|
|
|
indicated: computed(() => $i?.hasUnreadNotification),
|
|
|
|
to: "/my/notifications",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
messaging: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "messaging",
|
|
|
|
icon: "ph-chats-teardrop-bold ph-lg",
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2023-01-13 13:40:33 +09:00
|
|
|
indicated: computed(() => $i?.hasUnreadMessagingMessage),
|
|
|
|
to: "/my/messaging",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
drive: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "drive",
|
|
|
|
icon: "ph-cloud-bold ph-lg",
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2023-01-13 13:40:33 +09:00
|
|
|
to: "/my/drive",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
followRequests: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "followRequests",
|
|
|
|
icon: "ph-hand-waving-bold ph-lg",
|
|
|
|
show: computed(() => $i?.isLocked),
|
|
|
|
indicated: computed(() => $i?.hasPendingReceivedFollowRequest),
|
|
|
|
to: "/my/follow-requests",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
explore: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "explore",
|
|
|
|
icon: "ph-compass-bold ph-lg",
|
|
|
|
to: "/explore",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
announcements: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "announcements",
|
|
|
|
icon: "ph-megaphone-simple-bold ph-lg",
|
|
|
|
indicated: computed(() => $i?.hasUnreadAnnouncement),
|
|
|
|
to: "/announcements",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
search: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "search",
|
|
|
|
icon: "ph-magnifying-glass-bold ph-lg",
|
2020-10-17 20:12:00 +09:00
|
|
|
action: () => search(),
|
|
|
|
},
|
|
|
|
lists: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "lists",
|
|
|
|
icon: "ph-list-bullets-bold ph-lg",
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2023-01-13 13:40:33 +09:00
|
|
|
to: "/my/lists",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
2022-06-30 10:53:40 +09:00
|
|
|
/*
|
2020-10-17 20:12:00 +09:00
|
|
|
groups: {
|
|
|
|
title: 'groups',
|
2022-11-08 05:29:56 +09:00
|
|
|
icon: 'ph-users-three-bold ph-lg',
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 20:12:00 +09:00
|
|
|
to: '/my/groups',
|
|
|
|
},
|
2022-06-30 10:53:40 +09:00
|
|
|
*/
|
2020-10-17 20:12:00 +09:00
|
|
|
antennas: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "antennas",
|
|
|
|
icon: "ph-flying-saucer-bold ph-lg",
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2023-01-13 13:40:33 +09:00
|
|
|
to: "/my/antennas",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
favorites: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "favorites",
|
|
|
|
icon: "ph-bookmark-simple-bold ph-lg",
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2023-01-13 13:40:33 +09:00
|
|
|
to: "/my/favorites",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
pages: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "pages",
|
|
|
|
icon: "ph-file-text-bold ph-lg",
|
|
|
|
to: "/pages",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
2021-04-24 22:38:24 +09:00
|
|
|
gallery: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "gallery",
|
|
|
|
icon: "ph-image-square-bold ph-lg",
|
|
|
|
to: "/gallery",
|
2021-04-24 22:38:24 +09:00
|
|
|
},
|
2020-11-15 12:04:54 +09:00
|
|
|
clips: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "clip",
|
|
|
|
icon: "ph-paperclip-bold ph-lg",
|
2020-12-19 10:55:52 +09:00
|
|
|
show: computed(() => $i != null),
|
2023-01-13 13:40:33 +09:00
|
|
|
to: "/my/clips",
|
2020-11-15 12:04:54 +09:00
|
|
|
},
|
2020-10-17 20:12:00 +09:00
|
|
|
channels: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "channel",
|
|
|
|
icon: "ph-television-bold ph-lg",
|
|
|
|
to: "/channels",
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
2022-09-14 08:53:34 +09:00
|
|
|
groups: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "groups",
|
|
|
|
icon: "ph-users-three-bold ph-lg",
|
|
|
|
to: "/my/groups",
|
2022-09-14 08:53:34 +09:00
|
|
|
},
|
2020-11-03 17:00:47 +09:00
|
|
|
ui: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "switchUi",
|
|
|
|
icon: "ph-layout-bold ph-lg",
|
2020-11-03 17:00:47 +09:00
|
|
|
action: (ev) => {
|
2023-01-13 13:40:33 +09:00
|
|
|
os.popupMenu(
|
|
|
|
[
|
|
|
|
{
|
|
|
|
text: i18n.ts.default,
|
|
|
|
active: ui === "default" || ui === null,
|
|
|
|
action: () => {
|
|
|
|
localStorage.setItem("ui", "default");
|
|
|
|
unisonReload();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: i18n.ts.deck,
|
|
|
|
active: ui === "deck",
|
|
|
|
action: () => {
|
|
|
|
localStorage.setItem("ui", "deck");
|
|
|
|
unisonReload();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: i18n.ts.classic,
|
|
|
|
active: ui === "classic",
|
|
|
|
action: () => {
|
|
|
|
localStorage.setItem("ui", "classic");
|
|
|
|
unisonReload();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ev.currentTarget ?? ev.target,
|
|
|
|
);
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
},
|
2022-07-05 19:29:44 +09:00
|
|
|
reload: {
|
2023-01-13 13:40:33 +09:00
|
|
|
title: "reload",
|
|
|
|
icon: "ph-arrows-clockwise-bold ph-lg",
|
2022-07-05 19:29:44 +09:00
|
|
|
action: (ev) => {
|
|
|
|
location.reload();
|
|
|
|
},
|
|
|
|
},
|
2023-02-10 07:48:25 +09:00
|
|
|
help: {
|
|
|
|
title: "help",
|
|
|
|
icon: "ph-question-bold ph-lg",
|
|
|
|
action: (ev) => {
|
2023-02-11 08:41:19 +09:00
|
|
|
os.popupMenu(
|
|
|
|
[
|
|
|
|
{
|
|
|
|
text: instance.name ?? host,
|
|
|
|
type: "label",
|
2023-02-10 07:48:25 +09:00
|
|
|
},
|
2023-02-11 08:41:19 +09:00
|
|
|
{
|
|
|
|
type: "link",
|
|
|
|
text: i18n.ts.instanceInfo,
|
|
|
|
icon: "ph-info-bold ph-lg",
|
|
|
|
to: "/about",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: "link",
|
|
|
|
text: i18n.ts.aboutMisskey,
|
|
|
|
icon: "ph-lightbulb-bold ph-lg",
|
|
|
|
to: "/about-calckey",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: "link",
|
|
|
|
text: i18n.ts._apps.apps,
|
|
|
|
icon: "ph-device-mobile-bold ph-lg",
|
|
|
|
to: "/apps",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: "button",
|
|
|
|
action: async () => {
|
|
|
|
defaultStore.set("tutorial", 0);
|
|
|
|
os.popup(XTutorial, {}, {}, "closed");
|
2023-02-10 07:48:25 +09:00
|
|
|
},
|
2023-02-11 08:41:19 +09:00
|
|
|
text: i18n.ts.replayTutorial,
|
|
|
|
icon: "ph-circle-wavy-question-bold ph-lg",
|
|
|
|
},
|
|
|
|
null,
|
|
|
|
{
|
|
|
|
type: "parent",
|
|
|
|
text: i18n.ts.developer,
|
|
|
|
icon: "ph-code-bold ph-lg",
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
type: "link",
|
|
|
|
to: "/api-console",
|
|
|
|
text: "API Console",
|
|
|
|
icon: "ph-terminal-window-bold ph-lg",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: i18n.ts.document,
|
|
|
|
icon: "ph-file-doc-bold ph-lg",
|
|
|
|
action: () => {
|
|
|
|
window.open("/api-doc", "_blank");
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: "link",
|
|
|
|
to: "/scratchpad",
|
|
|
|
text: "AiScript Scratchpad",
|
|
|
|
icon: "ph-scribble-loop-bold ph-lg",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ev.currentTarget ?? ev.target,
|
2023-02-10 07:48:25 +09:00
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 22:09:40 +09:00
|
|
|
});
|