Compare commits

...

6 Commits

Author SHA1 Message Date
zyoshoka 5e31426241
Merge da68a29dbe into 4d562e7439 2025-02-13 20:09:08 +09:00
おさむのひと 4d562e7439
enhance(frontend): ノートに埋め込まれたメディアのコンテキストメニューから管理者用のファイル管理画面を開けるように (#15460)
* enhance(frontend): ノートに埋め込まれたメディアのコンテキストメニューから管理者用のファイル管理画面を開けるように

* fix icon

* fix menu

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
2025-02-13 11:09:04 +00:00
syuilo 30df768d26 Update about-misskey.vue 2025-02-12 20:55:12 +09:00
zyoshoka da68a29dbe
chore: bump @sentry/vue to 9.0.0 2025-02-11 19:41:16 +09:00
zyoshoka d0fd3a1875
Merge branch 'develop' into sentry-frontend 2025-02-11 11:02:30 +09:00
zyoshoka 486fca7f31
enhance: implement `sentryForFrontend` 2025-02-09 19:02:07 +09:00
18 changed files with 205 additions and 14 deletions

View File

@ -165,6 +165,8 @@ id: 'aidx'
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'
#sentryForFrontend:
# enableBrowserTracing: true
# enableReplay: true
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

View File

@ -177,6 +177,8 @@ id: 'aidx'
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'
#sentryForFrontend:
# enableBrowserTracing: true
# enableReplay: true
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

View File

@ -259,6 +259,8 @@ id: 'aidx'
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'
#sentryForFrontend:
# enableBrowserTracing: true
# enableReplay: true
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

View File

@ -152,6 +152,8 @@ id: 'aidx'
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'
#sentryForFrontend:
# enableBrowserTracing: true
# enableReplay: true
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

View File

@ -2,6 +2,8 @@
### General
- Feat: アクセストークン発行時に通知するように
- Enhance: フロントエンドのエラートラッキングができるように
- `.config/default.yml`中の項目`sentryForFrontend`を適宜設定してください。
### Client
- Feat: 投稿フォームで画像をプレビュー可能に
@ -9,6 +11,7 @@
- Enhance: アンテナ、リスト等の名前をカラム名のデフォルト値にするように `#13992`
- Enhance: クライアントエラー画面の多言語対応
- Enhance: 開発者モードでメニューからファイルIDをコピー出来るように `#15441'
- Enhance: ノートに埋め込まれたメディアのコンテキストメニューから管理者用のファイル管理画面を開けるように ( #15440 )
- Fix: コンディショナルロールを手動で割り当てできる導線を削除 `#13529`
- Fix: 埋め込みプレイヤーから外部ページに移動できない問題を修正

View File

@ -173,6 +173,8 @@ id: "aidx"
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'
#sentryForFrontend:
# enableBrowserTracing: true
# enableReplay: true
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

View File

@ -189,6 +189,7 @@
"devDependencies": {
"@jest/globals": "29.7.0",
"@nestjs/platform-express": "10.4.7",
"@sentry/vue": "9.0.0",
"@simplewebauthn/types": "10.0.0",
"@swc/jest": "0.2.37",
"@types/accepts": "1.3.7",

View File

@ -7,7 +7,8 @@ import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';
import * as yaml from 'js-yaml';
import * as Sentry from '@sentry/node';
import type * as Sentry from '@sentry/node';
import type * as SentryVue from '@sentry/vue';
import type { RedisOptions } from 'ioredis';
type RedisOptionsSource = Partial<RedisOptions> & {
@ -62,7 +63,7 @@ type Source = {
scope?: 'local' | 'global' | string[];
};
sentryForBackend?: { options: Partial<Sentry.NodeOptions>; enableNodeProfiling: boolean; };
sentryForFrontend?: { options: Partial<Sentry.NodeOptions> };
sentryForFrontend?: { options: Partial<SentryVue.BrowserOptions> & { dsn: string }; enableBrowserTracing: boolean; enableReplay: boolean; };
publishTarballInsteadOfProvideRepositoryUrl?: boolean;
@ -196,7 +197,7 @@ export type Config = {
redisForTimelines: RedisOptions & RedisOptionsSource;
redisForReactions: RedisOptions & RedisOptionsSource;
sentryForBackend: { options: Partial<Sentry.NodeOptions>; enableNodeProfiling: boolean; } | undefined;
sentryForFrontend: { options: Partial<Sentry.NodeOptions> } | undefined;
sentryForFrontend: { options: Partial<SentryVue.BrowserOptions> & { dsn: string }; enableBrowserTracing: boolean; enableReplay: boolean; } | undefined;
perChannelMaxNoteCacheCount: number;
perUserNotificationsMaxCount: number;
deactivateAntennaThreshold: number;

View File

@ -128,6 +128,7 @@ export class MetaEntityService {
policies: { ...DEFAULT_POLICIES, ...instance.policies },
sentryForFrontend: this.config.sentryForFrontend ?? null,
mediaProxy: this.config.mediaProxy,
enableUrlPreview: instance.urlPreviewEnabled,
noteSearchableScope: (this.config.meilisearch == null || this.config.meilisearch.scope !== 'local') ? 'global' : 'local',

View File

@ -207,6 +207,31 @@ export const packedMetaLiteSchema = {
type: 'boolean',
optional: false, nullable: false,
},
sentryForFrontend: {
type: 'object',
optional: false, nullable: true,
properties: {
options: {
type: 'object',
optional: false, nullable: false,
properties: {
dsn: {
type: 'string',
optional: false, nullable: false,
},
},
additionalProperties: true,
},
enableBrowserTracing: {
type: 'boolean',
optional: false, nullable: false,
},
enableReplay: {
type: 'boolean',
optional: false, nullable: false,
},
},
},
mediaProxy: {
type: 'string',
optional: false, nullable: false,

View File

@ -23,6 +23,7 @@
"@rollup/plugin-json": "6.1.0",
"@rollup/plugin-replace": "5.0.7",
"@rollup/pluginutils": "5.1.3",
"@sentry/vue": "9.0.0",
"@syuilo/aiscript": "0.19.0",
"@tabler/icons-webfont": "https://github.com/misskey-dev/tabler-icons/archive/refs/tags/3.29.0-mi.1913+5921534bc.tar.gz",
"@twemoji/parser": "15.1.1",

View File

@ -4,7 +4,7 @@
*/
import { createApp, defineAsyncComponent, markRaw } from 'vue';
import { ui } from '@@/js/config.js';
import { apiUrl, ui } from '@@/js/config.js';
import { common } from './common.js';
import * as Misskey from 'misskey-js';
import type { Component } from 'vue';
@ -27,7 +27,7 @@ import type { Keymap } from '@/scripts/hotkey.js';
import { addCustomEmoji, removeCustomEmojis, updateCustomEmojis } from '@/custom-emojis.js';
export async function mainBoot() {
const { isClientUpdated } = await common(() => {
const { isClientUpdated, app } = await common(() => {
let uiStyle = ui;
const searchParams = new URLSearchParams(window.location.search);
@ -60,6 +60,34 @@ export async function mainBoot() {
return createApp(rootComponent);
});
if (instance.sentryForFrontend) {
const Sentry = await import('@sentry/vue');
Sentry.init({
app,
integrations: [
...(instance.sentryForFrontend.enableBrowserTracing ? [Sentry.browserTracingIntegration()] : []),
...(instance.sentryForFrontend.enableReplay ? [Sentry.replayIntegration()] : []),
],
// Set tracesSampleRate to 1.0 to capture 100%
tracesSampleRate: 1.0,
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
...(instance.sentryForFrontend.enableBrowserTracing ? {
tracePropagationTargets: [apiUrl],
} : {}),
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
...(instance.sentryForFrontend.enableReplay ? {
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
} : {}),
...instance.sentryForFrontend.options,
});
}
reactionPicker.init();
emojiPicker.init();

View File

@ -217,10 +217,9 @@ function showMenu(ev: MouseEvent) {
});
}
const details: MenuItem[] = [];
if ($i?.id === props.audio.userId) {
menu.push({
type: 'divider',
}, {
details.push({
type: 'link',
text: i18n.ts._fileViewer.title,
icon: 'ti ti-info-circle',
@ -228,6 +227,19 @@ function showMenu(ev: MouseEvent) {
});
}
if (iAmModerator) {
details.push({
type: 'link',
text: i18n.ts.moderation,
icon: 'ti ti-photo-exclamation',
to: `/admin/file/${props.audio.id}`,
});
}
if (details.length > 0) {
menu.push({ type: 'divider' }, ...details);
}
if (defaultStore.state.devMode) {
menu.push({ type: 'divider' }, {
icon: 'ti ti-id',

View File

@ -133,10 +133,9 @@ function showMenu(ev: MouseEvent) {
});
}
const details: MenuItem[] = [];
if ($i?.id === props.image.userId) {
menuItems.push({
type: 'divider',
}, {
details.push({
type: 'link',
text: i18n.ts._fileViewer.title,
icon: 'ti ti-info-circle',
@ -144,6 +143,19 @@ function showMenu(ev: MouseEvent) {
});
}
if (iAmModerator) {
details.push({
type: 'link',
text: i18n.ts.moderation,
icon: 'ti ti-photo-exclamation',
to: `/admin/file/${props.image.id}`,
});
}
if (details.length > 0) {
menuItems.push({ type: 'divider' }, ...details);
}
if (defaultStore.state.devMode) {
menuItems.push({ type: 'divider' }, {
icon: 'ti ti-id',

View File

@ -242,10 +242,9 @@ function showMenu(ev: MouseEvent) {
});
}
const details: MenuItem[] = [];
if ($i?.id === props.video.userId) {
menu.push({
type: 'divider',
}, {
details.push({
type: 'link',
text: i18n.ts._fileViewer.title,
icon: 'ti ti-info-circle',
@ -253,6 +252,19 @@ function showMenu(ev: MouseEvent) {
});
}
if (iAmModerator) {
details.push({
type: 'link',
text: i18n.ts.moderation,
icon: 'ti ti-photo-exclamation',
to: `/admin/file/${props.video.id}`,
});
}
if (details.length > 0) {
menu.push({ type: 'divider' }, ...details);
}
if (defaultStore.state.devMode) {
menu.push({ type: 'divider' }, {
icon: 'ti ti-id',

View File

@ -109,6 +109,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<div>
<a style="display: inline-block;" class="pepabo" title="GMO Pepabo" href="https://pepabo.com/" target="_blank"><img style="width: 100%;" src="https://assets.misskey-hub.net/sponsors/gmo_pepabo.svg" alt="GMO Pepabo"></a>
</div>
<div>
<a style="display: inline-block;" class="purpledotdigital" title="Purple Dot Digital" href="https://purpledotdigital.com/" target="_blank"><img style="width: 100%;" src="https://assets.misskey-hub.net/sponsors/purple-dot-digital.jpg" alt="Purple Dot Digital"></a>
</div>
</div>
</FormSection>
<FormSection>

View File

@ -5070,6 +5070,14 @@ export type components = {
enableEmail: boolean;
enableServiceWorker: boolean;
translatorAvailable: boolean;
sentryForFrontend: {
options: {
dsn: string;
[key: string]: unknown;
};
enableBrowserTracing: boolean;
enableReplay: boolean;
} | null;
mediaProxy: string;
enableUrlPreview: boolean;
backgroundImageUrl: string | null;

View File

@ -532,6 +532,9 @@ importers:
'@nestjs/platform-express':
specifier: 10.4.7
version: 10.4.7(@nestjs/common@10.4.7(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.7)
'@sentry/vue':
specifier: 9.0.0
version: 9.0.0(vue@3.5.12(typescript@5.6.3))
'@simplewebauthn/types':
specifier: 10.0.0
version: 10.0.0
@ -706,6 +709,9 @@ importers:
'@rollup/pluginutils':
specifier: 5.1.3
version: 5.1.3(rollup@4.26.0)
'@sentry/vue':
specifier: 9.0.0
version: 9.0.0(vue@3.5.12(typescript@5.6.3))
'@syuilo/aiscript':
specifier: 0.19.0
version: 0.19.0
@ -3459,10 +3465,34 @@ packages:
'@sec-ant/readable-stream@0.4.1':
resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==}
'@sentry-internal/browser-utils@9.0.0':
resolution: {integrity: sha512-J5aBL0RV42WNx9xlw2a2MK1BBXAOwxYT2Hc9VNkuygwGzVEFimZEUKlaYKaDbM/XRUA0TRcYQaKkmGKqpDbxxw==}
engines: {node: '>=18'}
'@sentry-internal/feedback@9.0.0':
resolution: {integrity: sha512-4k4MxnvNFYbA8mPBOgY0gbK/e6dFA8JTDmt88NppSuBowu1uIYnVEFB3DWyaLvi60RXcbT4LnKvo70LTCpIEfQ==}
engines: {node: '>=18'}
'@sentry-internal/replay-canvas@9.0.0':
resolution: {integrity: sha512-KjN7Dx9CctwU06xfTEQjWz/MK00fDbHF2GUStDYe83Rt+8CmYXUHMRTr/UEMQxL8rH1O4JEGUH5fFWxTWu2gxw==}
engines: {node: '>=18'}
'@sentry-internal/replay@9.0.0':
resolution: {integrity: sha512-TqcOA6QhEqq4afR34rb/e0rpusafGh3XujW6hO0AIuv0inpfWhCN6i71hGR0Qt0gJNJaStiNu4Rrwj1AsebGTQ==}
engines: {node: '>=18'}
'@sentry/browser@9.0.0':
resolution: {integrity: sha512-+BgusObsLnHwiA+xLm9d3YmdzRXFSUTG7YSSZYZ94NpQdnQlEb6a0ER6abCzmxmKAhNykf5MzLrPRz65bL83WQ==}
engines: {node: '>=18'}
'@sentry/core@8.38.0':
resolution: {integrity: sha512-sGD+5TEHU9G7X7zpyaoJxpOtwjTjvOd1f/MKBrWW2vf9UbYK+GUJrOzLhMoSWp/pHSYgvObkJkDb/HwieQjvhQ==}
engines: {node: '>=14.18'}
'@sentry/core@9.0.0':
resolution: {integrity: sha512-oaOOC1rQ5NHuOJ5ciw5NjdvmgG+q3UJS5v+s1d2eFzi/n5OpxULvqce4aG3XDBJ/Hu+fxW+fbVW96JwAKNk2Tg==}
engines: {node: '>=18'}
'@sentry/node@8.38.0':
resolution: {integrity: sha512-nwW0XqZFQseXYn0i6i6nKPkbjgHMBEFSF9TnK6mHHqJHHObHIZ6qu5CfvGKgxATia8JPIg9NN8XcyYOnQMi07w==}
engines: {node: '>=14.18'}
@ -3490,6 +3520,16 @@ packages:
resolution: {integrity: sha512-3X7MgIKIx+2q5Al7QkhaRB4wV6DvzYsaeIwdqKUzGLuRjXmNgJrLoU87TAwQRmZ6Wr3IoEpThZZMNrzYPXxArw==}
engines: {node: '>=14.18'}
'@sentry/vue@9.0.0':
resolution: {integrity: sha512-uXfiX4pFXQ5BvOp8/i+eDE1dWuyXHCgi4H32NG5uKt+y5XKNjpZ0Iz2kaqLiBY2ypcoQKzplDveieGZZh3OvCA==}
engines: {node: '>=18'}
peerDependencies:
pinia: 2.x
vue: 2.x || 3.x
peerDependenciesMeta:
pinia:
optional: true
'@shikijs/core@1.22.2':
resolution: {integrity: sha512-bvIQcd8BEeR1yFvOYv6HDiyta2FFVePbzeowf5pPS1avczrPK+cjmaxxh0nx5QzbON7+Sv0sQfQVciO7bN72sg==}
@ -13625,11 +13665,39 @@ snapshots:
'@sec-ant/readable-stream@0.4.1': {}
'@sentry-internal/browser-utils@9.0.0':
dependencies:
'@sentry/core': 9.0.0
'@sentry-internal/feedback@9.0.0':
dependencies:
'@sentry/core': 9.0.0
'@sentry-internal/replay-canvas@9.0.0':
dependencies:
'@sentry-internal/replay': 9.0.0
'@sentry/core': 9.0.0
'@sentry-internal/replay@9.0.0':
dependencies:
'@sentry-internal/browser-utils': 9.0.0
'@sentry/core': 9.0.0
'@sentry/browser@9.0.0':
dependencies:
'@sentry-internal/browser-utils': 9.0.0
'@sentry-internal/feedback': 9.0.0
'@sentry-internal/replay': 9.0.0
'@sentry-internal/replay-canvas': 9.0.0
'@sentry/core': 9.0.0
'@sentry/core@8.38.0':
dependencies:
'@sentry/types': 8.38.0
'@sentry/utils': 8.38.0
'@sentry/core@9.0.0': {}
'@sentry/node@8.38.0':
dependencies:
'@opentelemetry/api': 1.9.0
@ -13700,6 +13768,12 @@ snapshots:
dependencies:
'@sentry/types': 8.38.0
'@sentry/vue@9.0.0(vue@3.5.12(typescript@5.6.3))':
dependencies:
'@sentry/browser': 9.0.0
'@sentry/core': 9.0.0
vue: 3.5.12(typescript@5.6.3)
'@shikijs/core@1.22.2':
dependencies:
'@shikijs/engine-javascript': 1.22.2