merge: all upstream changes
This commit is contained in:
commit
f8f128b347
170 changed files with 4490 additions and 2218 deletions
|
@ -18,13 +18,13 @@
|
|||
"dependencies": {
|
||||
"@discordapp/twemoji": "14.1.2",
|
||||
"@github/webauthn-json": "2.1.1",
|
||||
"@phosphor-icons/web": "^2.0.3",
|
||||
"@rollup/plugin-alias": "5.0.0",
|
||||
"@rollup/plugin-json": "6.0.0",
|
||||
"@rollup/plugin-replace": "5.0.2",
|
||||
"@rollup/pluginutils": "5.0.4",
|
||||
"@rollup/plugin-alias": "5.0.1",
|
||||
"@rollup/plugin-json": "6.0.1",
|
||||
"@rollup/plugin-replace": "5.0.3",
|
||||
"@rollup/pluginutils": "5.0.5",
|
||||
"@syuilo/aiscript": "0.16.0",
|
||||
"@vitejs/plugin-vue": "4.3.4",
|
||||
"@phosphor-icons/web": "^2.0.3",
|
||||
"@vitejs/plugin-vue": "4.4.0",
|
||||
"@vue-macros/reactivity-transform": "0.3.23",
|
||||
"@vue/compiler-sfc": "3.3.4",
|
||||
"astring": "1.8.6",
|
||||
|
@ -38,7 +38,7 @@
|
|||
"chartjs-chart-matrix": "2.0.1",
|
||||
"chartjs-plugin-gradient": "0.6.1",
|
||||
"chartjs-plugin-zoom": "2.0.1",
|
||||
"chromatic": "7.2.0",
|
||||
"chromatic": "7.2.3",
|
||||
"compare-versions": "6.1.0",
|
||||
"cropperjs": "2.0.0-beta.4",
|
||||
"date-fns": "2.30.0",
|
||||
|
@ -53,13 +53,13 @@
|
|||
"matter-js": "0.19.0",
|
||||
"mfm-js": "0.23.3",
|
||||
"misskey-js": "workspace:*",
|
||||
"photoswipe": "5.4.1",
|
||||
"photoswipe": "5.4.2",
|
||||
"prismjs": "1.29.0",
|
||||
"punycode": "2.3.0",
|
||||
"querystring": "0.2.1",
|
||||
"rollup": "3.29.4",
|
||||
"rollup": "4.0.2",
|
||||
"sanitize-html": "2.11.0",
|
||||
"sass": "1.68.0",
|
||||
"sass": "1.69.1",
|
||||
"strict-event-emitter-types": "2.0.0",
|
||||
"textarea-caret": "3.1.0",
|
||||
"three": "0.157.0",
|
||||
|
@ -72,70 +72,70 @@
|
|||
"uuid": "9.0.1",
|
||||
"v-code-diff": "1.7.1",
|
||||
"vanilla-tilt": "1.8.1",
|
||||
"vite": "4.4.9",
|
||||
"vite": "4.4.11",
|
||||
"vue": "3.3.4",
|
||||
"vue-prism-editor": "2.0.0-alpha.2",
|
||||
"vuedraggable": "next"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/addon-actions": "7.4.5",
|
||||
"@storybook/addon-essentials": "7.4.5",
|
||||
"@storybook/addon-interactions": "7.4.5",
|
||||
"@storybook/addon-links": "7.4.5",
|
||||
"@storybook/addon-storysource": "7.4.5",
|
||||
"@storybook/addons": "7.4.5",
|
||||
"@storybook/blocks": "7.4.5",
|
||||
"@storybook/core-events": "7.4.5",
|
||||
"@storybook/jest": "0.2.2",
|
||||
"@storybook/manager-api": "7.4.5",
|
||||
"@storybook/preview-api": "7.4.5",
|
||||
"@storybook/react": "7.4.5",
|
||||
"@storybook/react-vite": "7.4.5",
|
||||
"@storybook/testing-library": "0.2.1",
|
||||
"@storybook/theming": "7.4.5",
|
||||
"@storybook/types": "7.4.5",
|
||||
"@storybook/vue3": "7.4.5",
|
||||
"@storybook/vue3-vite": "7.4.5",
|
||||
"@storybook/addon-actions": "7.4.6",
|
||||
"@storybook/addon-essentials": "7.4.6",
|
||||
"@storybook/addon-interactions": "7.4.6",
|
||||
"@storybook/addon-links": "7.4.6",
|
||||
"@storybook/addon-storysource": "7.4.6",
|
||||
"@storybook/addons": "7.4.6",
|
||||
"@storybook/blocks": "7.4.6",
|
||||
"@storybook/core-events": "7.4.6",
|
||||
"@storybook/jest": "0.2.3",
|
||||
"@storybook/manager-api": "7.4.6",
|
||||
"@storybook/preview-api": "7.4.6",
|
||||
"@storybook/react": "7.4.6",
|
||||
"@storybook/react-vite": "7.4.6",
|
||||
"@storybook/testing-library": "0.2.2",
|
||||
"@storybook/theming": "7.4.6",
|
||||
"@storybook/types": "7.4.6",
|
||||
"@storybook/vue3": "7.4.6",
|
||||
"@storybook/vue3-vite": "7.4.6",
|
||||
"@testing-library/vue": "7.0.0",
|
||||
"@types/escape-regexp": "0.0.1",
|
||||
"@types/estree": "1.0.2",
|
||||
"@types/matter-js": "0.19.1",
|
||||
"@types/micromatch": "4.0.3",
|
||||
"@types/node": "20.7.1",
|
||||
"@types/node": "20.8.4",
|
||||
"@types/punycode": "2.1.0",
|
||||
"@types/sanitize-html": "2.9.1",
|
||||
"@types/throttle-debounce": "5.0.0",
|
||||
"@types/tinycolor2": "1.4.4",
|
||||
"@types/uuid": "9.0.4",
|
||||
"@types/uuid": "9.0.5",
|
||||
"@types/websocket": "1.0.7",
|
||||
"@types/ws": "8.5.6",
|
||||
"@typescript-eslint/eslint-plugin": "6.7.3",
|
||||
"@typescript-eslint/parser": "6.7.3",
|
||||
"@vitest/coverage-v8": "0.34.5",
|
||||
"@typescript-eslint/eslint-plugin": "6.7.5",
|
||||
"@typescript-eslint/parser": "6.7.5",
|
||||
"@vitest/coverage-v8": "0.34.6",
|
||||
"@vue/runtime-core": "3.3.4",
|
||||
"acorn": "8.10.0",
|
||||
"cross-env": "7.0.3",
|
||||
"cypress": "13.3.0",
|
||||
"eslint": "8.50.0",
|
||||
"eslint": "8.51.0",
|
||||
"eslint-plugin-import": "2.28.1",
|
||||
"eslint-plugin-vue": "9.17.0",
|
||||
"fast-glob": "3.3.1",
|
||||
"happy-dom": "10.0.3",
|
||||
"micromatch": "4.0.5",
|
||||
"msw": "1.3.1",
|
||||
"msw": "1.3.2",
|
||||
"msw-storybook-addon": "1.8.0",
|
||||
"nodemon": "3.0.1",
|
||||
"prettier": "3.0.3",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"start-server-and-test": "2.0.1",
|
||||
"storybook": "7.4.5",
|
||||
"storybook": "7.4.6",
|
||||
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
|
||||
"summaly": "github:misskey-dev/summaly",
|
||||
"vite-plugin-turbosnap": "1.0.3",
|
||||
"vitest": "0.34.5",
|
||||
"vitest": "0.34.6",
|
||||
"vitest-fetch-mock": "0.2.2",
|
||||
"vue-eslint-parser": "9.3.1",
|
||||
"vue-tsc": "1.8.15"
|
||||
"vue-eslint-parser": "9.3.2",
|
||||
"vue-tsc": "1.8.18"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
-->
|
||||
|
||||
<template>
|
||||
<button class="_button" :class="$style.root" @mousedown="toggle">
|
||||
<b>{{ modelValue ? i18n.ts._cw.hide : i18n.ts._cw.show }}</b>
|
||||
<span v-if="!modelValue" :class="$style.label">{{ label }}</span>
|
||||
</button>
|
||||
<MkButton rounded full small @click="toggle"><b>{{ modelValue ? i18n.ts._cw.hide : i18n.ts._cw.show }}</b><span v-if="!modelValue" :class="$style.label">{{ label }}</span></MkButton>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
@ -15,6 +12,7 @@ import { computed } from 'vue';
|
|||
import * as Misskey from 'misskey-js';
|
||||
import { concat } from '@/scripts/array.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean;
|
||||
|
@ -33,25 +31,12 @@ const label = computed(() => {
|
|||
] as string[][]).join(' / ');
|
||||
});
|
||||
|
||||
const toggle = () => {
|
||||
function toggle() {
|
||||
emit('update:modelValue', !props.modelValue);
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
.root {
|
||||
display: inline-block;
|
||||
padding: 4px 8px;
|
||||
font-size: 0.76em;
|
||||
color: var(--cwFg);
|
||||
background: var(--cwBg);
|
||||
border-radius: 2px;
|
||||
|
||||
&:hover {
|
||||
background: var(--cwHoverBg);
|
||||
}
|
||||
}
|
||||
|
||||
.label {
|
||||
margin-left: 4px;
|
||||
|
||||
|
|
|
@ -49,8 +49,11 @@ import bytes from '@/filters/bytes.js';
|
|||
import * as os from '@/os.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { getDriveFileMenu } from '@/scripts/get-drive-file-menu.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
file: Misskey.entities.DriveFile;
|
||||
folder: Misskey.entities.DriveFolder | null;
|
||||
|
@ -75,7 +78,7 @@ function onClick(ev: MouseEvent) {
|
|||
if (props.selectMode) {
|
||||
emit('chosen', props.file);
|
||||
} else {
|
||||
os.popupMenu(getDriveFileMenu(props.file, props.folder), (ev.currentTarget ?? ev.target ?? undefined) as HTMLElement | undefined);
|
||||
router.push(`/my/drive/file/${props.file.id}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -615,6 +615,8 @@ defineExpose({
|
|||
height: 1.25em;
|
||||
vertical-align: -.25em;
|
||||
pointer-events: none;
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
:spellcheck="spellcheck"
|
||||
:step="step"
|
||||
:list="id"
|
||||
:min="min"
|
||||
:max="max"
|
||||
@focus="focused = true"
|
||||
@blur="focused = false"
|
||||
@keydown="onKeydown($event)"
|
||||
|
@ -59,6 +61,8 @@ const props = defineProps<{
|
|||
spellcheck?: boolean;
|
||||
step?: any;
|
||||
datalist?: string[];
|
||||
min?: number;
|
||||
max?: number;
|
||||
inline?: boolean;
|
||||
debounce?: boolean;
|
||||
manualSave?: boolean;
|
||||
|
|
|
@ -17,7 +17,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
:title="media.name"
|
||||
controls
|
||||
preload="metadata"
|
||||
@volumechange="volumechange"
|
||||
/>
|
||||
</div>
|
||||
<a
|
||||
|
@ -33,7 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted } from 'vue';
|
||||
import { onMounted, shallowRef, watch } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { soundConfigStore } from '@/scripts/sound.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
@ -43,15 +42,13 @@ const props = withDefaults(defineProps<{
|
|||
}>(), {
|
||||
});
|
||||
|
||||
const audioEl = $shallowRef<HTMLAudioElement | null>();
|
||||
const audioEl = shallowRef<HTMLAudioElement>();
|
||||
let hide = $ref(true);
|
||||
|
||||
function volumechange() {
|
||||
if (audioEl) soundConfigStore.set('mediaVolume', audioEl.volume);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (audioEl) audioEl.volume = soundConfigStore.state.mediaVolume;
|
||||
watch(audioEl, () => {
|
||||
if (audioEl.value) {
|
||||
audioEl.value.volume = 0.3;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</div>
|
||||
<div v-else :class="[$style.visible, (video.isSensitive && defaultStore.state.highlightSensitiveMedia) && $style.sensitiveContainer]">
|
||||
<video
|
||||
ref="videoEl"
|
||||
:class="$style.video"
|
||||
:poster="video.thumbnailUrl"
|
||||
:title="video.comment"
|
||||
|
@ -31,7 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, shallowRef, watch } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import bytes from '@/filters/bytes.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
|
@ -42,6 +43,14 @@ const props = defineProps<{
|
|||
}>();
|
||||
|
||||
const hide = ref((defaultStore.state.nsfw === 'force' || defaultStore.state.enableDataSaverMode) ? true : (props.video.isSensitive && defaultStore.state.nsfw !== 'ignore'));
|
||||
|
||||
const videoEl = shallowRef<HTMLVideoElement>();
|
||||
|
||||
watch(videoEl, () => {
|
||||
if (videoEl.value) {
|
||||
videoEl.value.volume = 0.3;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
|
|
@ -55,7 +55,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div style="container-type: inline-size;">
|
||||
<p v-if="appearNote.cw != null" :class="$style.cw">
|
||||
<Mfm v-if="appearNote.cw != ''" style="margin-right: 8px;" :text="appearNote.cw" :author="appearNote.user" :i="$i"/>
|
||||
<MkCwButton v-model="showContent" :note="appearNote" v-on:click.stop/>
|
||||
<MkCwButton v-model="showContent" :note="appearNote" style="margin: 4px 0;" v-on:click.stop/>
|
||||
</p>
|
||||
<div v-show="appearNote.cw == null || showContent" :class="[{ [$style.contentCollapsed]: collapsed }]" >
|
||||
<div :class="$style.text">
|
||||
|
@ -230,7 +230,7 @@ const muted = ref($i ? checkWordMute(appearNote, $i, $i.mutedWords) : false);
|
|||
const translation = ref<any>(null);
|
||||
const translating = ref(false);
|
||||
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance);
|
||||
const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || appearNote.userId === $i.id);
|
||||
const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || (appearNote.visibility === 'followers' && appearNote.userId === $i.id));
|
||||
let renoteCollapsed = $ref(defaultStore.state.collapseRenotes && isRenote && (($i && ($i.id === note.userId || $i.id === appearNote.userId)) || (appearNote.myReaction != null)));
|
||||
|
||||
const keymap = {
|
||||
|
|
|
@ -30,13 +30,15 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkSwitch :modelValue="agreeServerRules" style="margin-top: 16px;" @update:modelValue="updateAgreeServerRules">{{ i18n.ts.agree }}</MkSwitch>
|
||||
</MkFolder>
|
||||
|
||||
<MkFolder v-if="availableTos" :defaultOpen="true">
|
||||
<template #label>{{ i18n.ts.termsOfService }}</template>
|
||||
<template #suffix><i v-if="agreeTos" class="ph-check ph-bold ph-lg" style="color: var(--success)"></i></template>
|
||||
<MkFolder v-if="availableTos || availablePrivacyPolicy" :defaultOpen="true">
|
||||
<template #label>{{ tosPrivacyPolicyLabel }}</template>
|
||||
<template #suffix><i v-if="agreeTosAndPrivacyPolicy" class="ph-check ph-bold pg-lg" style="color: var(--success)"></i></template>
|
||||
<div class="_gaps_s">
|
||||
<div v-if="availableTos"><a :href="instance.tosUrl" class="_link" target="_blank">{{ i18n.ts.termsOfService }} <i class="ph-arrow-square-out ph-bold ph-lg"></i></a></div>
|
||||
<div v-if="availablePrivacyPolicy"><a :href="instance.privacyPolicyUrl" class="_link" target="_blank">{{ i18n.ts.privacyPolicy }} <i class="ph-arrow-square-out ph-bold ph-lg"></i></a></div>
|
||||
</div>
|
||||
|
||||
<a :href="instance.tosUrl" class="_link" target="_blank">{{ i18n.ts.termsOfService }} <i class="ph-arrow-square-out ph-bold ph-lg"></i></a>
|
||||
|
||||
<MkSwitch :modelValue="agreeTos" style="margin-top: 16px;" @update:modelValue="updateAgreeTos">{{ i18n.ts.agree }}</MkSwitch>
|
||||
<MkSwitch :modelValue="agreeTosAndPrivacyPolicy" style="margin-top: 16px;" @update:modelValue="updateAgreeTosAndPrivacyPolicy">{{ i18n.ts.agree }}</MkSwitch>
|
||||
</MkFolder>
|
||||
|
||||
<MkFolder :defaultOpen="true">
|
||||
|
@ -70,14 +72,15 @@ import MkInfo from '@/components/MkInfo.vue';
|
|||
import * as os from '@/os.js';
|
||||
|
||||
const availableServerRules = instance.serverRules.length > 0;
|
||||
const availableTos = instance.tosUrl != null;
|
||||
const availableTos = instance.tosUrl != null && instance.tosUrl !== '';
|
||||
const availablePrivacyPolicy = instance.privacyPolicyUrl != null && instance.privacyPolicyUrl !== '';
|
||||
|
||||
const agreeServerRules = ref(false);
|
||||
const agreeTos = ref(false);
|
||||
const agreeTosAndPrivacyPolicy = ref(false);
|
||||
const agreeNote = ref(false);
|
||||
|
||||
const agreed = computed(() => {
|
||||
return (!availableServerRules || agreeServerRules.value) && (!availableTos || agreeTos.value) && agreeNote.value;
|
||||
return (!availableServerRules || agreeServerRules.value) && ((!availableTos && !availablePrivacyPolicy) || agreeTosAndPrivacyPolicy.value) && agreeNote.value;
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
@ -85,6 +88,18 @@ const emit = defineEmits<{
|
|||
(ev: 'done'): void;
|
||||
}>();
|
||||
|
||||
const tosPrivacyPolicyLabel = computed(() => {
|
||||
if (availableTos && availablePrivacyPolicy) {
|
||||
return i18n.ts.tosAndPrivacyPolicy;
|
||||
} else if (availableTos) {
|
||||
return i18n.ts.termsOfService;
|
||||
} else if (availablePrivacyPolicy) {
|
||||
return i18n.ts.privacyPolicy;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
});
|
||||
|
||||
async function updateAgreeServerRules(v: boolean) {
|
||||
if (v) {
|
||||
const confirm = await os.confirm({
|
||||
|
@ -99,17 +114,19 @@ async function updateAgreeServerRules(v: boolean) {
|
|||
}
|
||||
}
|
||||
|
||||
async function updateAgreeTos(v: boolean) {
|
||||
async function updateAgreeTosAndPrivacyPolicy(v: boolean) {
|
||||
if (v) {
|
||||
const confirm = await os.confirm({
|
||||
type: 'question',
|
||||
title: i18n.ts.doYouAgree,
|
||||
text: i18n.t('iHaveReadXCarefullyAndAgree', { x: i18n.ts.termsOfService }),
|
||||
text: i18n.t('iHaveReadXCarefullyAndAgree', {
|
||||
x: tosPrivacyPolicyLabel.value,
|
||||
}),
|
||||
});
|
||||
if (confirm.canceled) return;
|
||||
agreeTos.value = true;
|
||||
agreeTosAndPrivacyPolicy.value = true;
|
||||
} else {
|
||||
agreeTos.value = false;
|
||||
agreeTosAndPrivacyPolicy.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import MkNotes from '@/components/MkNotes.vue';
|
|||
import { useStream } from '@/stream.js';
|
||||
import * as sound from '@/scripts/sound.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
|
@ -23,9 +24,11 @@ const props = withDefaults(defineProps<{
|
|||
role?: string;
|
||||
sound?: boolean;
|
||||
withRenotes?: boolean;
|
||||
withReplies?: boolean;
|
||||
onlyFiles?: boolean;
|
||||
}>(), {
|
||||
withRenotes: true,
|
||||
withReplies: false,
|
||||
onlyFiles: false,
|
||||
});
|
||||
|
||||
|
@ -38,7 +41,15 @@ provide('inChannel', computed(() => props.src === 'channel'));
|
|||
|
||||
const tlComponent: InstanceType<typeof MkNotes> = $ref();
|
||||
|
||||
let tlNotesCount = 0;
|
||||
|
||||
const prepend = note => {
|
||||
tlNotesCount++;
|
||||
|
||||
if (instance.notesPerOneAd > 0 && tlNotesCount % instance.notesPerOneAd === 0) {
|
||||
note._shouldInsertAd_ = true;
|
||||
}
|
||||
|
||||
tlComponent.pagingComponent?.prepend(note);
|
||||
|
||||
emit('note');
|
||||
|
@ -81,10 +92,12 @@ if (props.src === 'antenna') {
|
|||
endpoint = 'notes/local-timeline';
|
||||
query = {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
};
|
||||
connection = stream.useChannel('localTimeline', {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
|
@ -92,10 +105,12 @@ if (props.src === 'antenna') {
|
|||
endpoint = 'notes/hybrid-timeline';
|
||||
query = {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
};
|
||||
connection = stream.useChannel('hybridTimeline', {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
|
@ -129,12 +144,10 @@ if (props.src === 'antenna') {
|
|||
} else if (props.src === 'list') {
|
||||
endpoint = 'notes/user-list-timeline';
|
||||
query = {
|
||||
withRenotes: props.withRenotes,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
listId: props.list,
|
||||
};
|
||||
connection = stream.useChannel('userList', {
|
||||
withRenotes: props.withRenotes,
|
||||
withFiles: props.onlyFiles ? true : undefined,
|
||||
listId: props.list,
|
||||
});
|
||||
|
|
|
@ -104,7 +104,25 @@ function showMenu(ev) {
|
|||
action: () => {
|
||||
os.pageWindow('/about-sharkey');
|
||||
},
|
||||
}, null, {
|
||||
}, null, (instance.impressumUrl) ? {
|
||||
text: i18n.ts.impressum,
|
||||
icon: 'ph-newspaper-clipping ph-bold pg-lg',
|
||||
action: () => {
|
||||
window.open(instance.impressumUrl, '_blank');
|
||||
},
|
||||
} : undefined, (instance.tosUrl) ? {
|
||||
text: i18n.ts.termsOfService,
|
||||
icon: 'ph-notebook ph-bold pg-lg',
|
||||
action: () => {
|
||||
window.open(instance.tosUrl, '_blank');
|
||||
},
|
||||
} : undefined, (instance.privacyPolicyUrl) ? {
|
||||
text: i18n.ts.privacyPolicy,
|
||||
icon: 'ph-shield ph-bold pg-lg',
|
||||
action: () => {
|
||||
window.open(instance.privacyPolicyUrl, '_blank');
|
||||
},
|
||||
} : undefined, (!instance.impressumUrl && !instance.tosUrl && !instance.privacyPolicyUrl) ? undefined : null, {
|
||||
text: i18n.ts.help,
|
||||
icon: 'ph-question ph-bold ph-lg',
|
||||
action: () => {
|
||||
|
|
|
@ -46,14 +46,18 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template #value>{{ instance.maintainerEmail }}</template>
|
||||
</MkKeyValue>
|
||||
</FormSplit>
|
||||
<MkFolder v-if="instance.serverRules.length > 0">
|
||||
<template #label>{{ i18n.ts.serverRules }}</template>
|
||||
<FormLink v-if="instance.impressumUrl" :to="instance.impressumUrl" external>{{ i18n.ts.impressum }}</FormLink>
|
||||
<div class="_formLinks">
|
||||
<MkFolder v-if="instance.serverRules.length > 0">
|
||||
<template #label>{{ i18n.ts.serverRules }}</template>
|
||||
|
||||
<ol class="_gaps_s" :class="$style.rules">
|
||||
<li v-for="item in instance.serverRules" :class="$style.rule"><div :class="$style.ruleText" v-html="item"></div></li>
|
||||
</ol>
|
||||
</MkFolder>
|
||||
<FormLink v-if="instance.tosUrl" :to="instance.tosUrl" external>{{ i18n.ts.termsOfService }}</FormLink>
|
||||
<ol class="_gaps_s" :class="$style.rules">
|
||||
<li v-for="item, index in instance.serverRules" :key="index" :class="$style.rule"><div :class="$style.ruleText" v-html="item"></div></li>
|
||||
</ol>
|
||||
</MkFolder>
|
||||
<FormLink v-if="instance.tosUrl" :to="instance.tosUrl" external>{{ i18n.ts.termsOfService }}</FormLink>
|
||||
<FormLink v-if="instance.privacyPolicyUrl" :to="instance.privacyPolicyUrl" external>{{ i18n.ts.privacyPolicy }}</FormLink>
|
||||
</div>
|
||||
</div>
|
||||
</FormSection>
|
||||
|
||||
|
|
81
packages/frontend/src/pages/admin/external-services.vue
Normal file
81
packages/frontend/src/pages/admin/external-services.vue
Normal file
|
@ -0,0 +1,81 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<MkStickyContainer>
|
||||
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
||||
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
|
||||
<FormSuspense :p="init">
|
||||
<FormSection>
|
||||
<template #label>DeepL Translation</template>
|
||||
|
||||
<div class="_gaps_m">
|
||||
<MkInput v-model="deeplAuthKey">
|
||||
<template #prefix><i class="ph-key ph-bold ph-lg"></i></template>
|
||||
<template #label>DeepL Auth Key</template>
|
||||
</MkInput>
|
||||
<MkSwitch v-model="deeplIsPro">
|
||||
<template #label>Pro account</template>
|
||||
</MkSwitch>
|
||||
</div>
|
||||
</FormSection>
|
||||
</FormSuspense>
|
||||
</MkSpacer>
|
||||
<template #footer>
|
||||
<div :class="$style.footer">
|
||||
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="16">
|
||||
<MkButton primary rounded @click="save"><i class="ph-check ph-bold ph-lg"></i> {{ i18n.ts.save }}</MkButton>
|
||||
</MkSpacer>
|
||||
</div>
|
||||
</template>
|
||||
</MkStickyContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { } from 'vue';
|
||||
import XHeader from './_header_.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
import FormSection from '@/components/form/section.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { fetchInstance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
let deeplAuthKey: string = $ref('');
|
||||
let deeplIsPro: boolean = $ref(false);
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
deeplAuthKey = meta.deeplAuthKey;
|
||||
deeplIsPro = meta.deeplIsPro;
|
||||
}
|
||||
|
||||
function save() {
|
||||
os.apiWithDialog('admin/update-meta', {
|
||||
deeplAuthKey,
|
||||
deeplIsPro,
|
||||
}).then(() => {
|
||||
fetchInstance();
|
||||
});
|
||||
}
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
title: i18n.ts.externalServices,
|
||||
icon: 'ti ti-link',
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
.footer {
|
||||
-webkit-backdrop-filter: var(--blur, blur(15px));
|
||||
backdrop-filter: var(--blur, blur(15px));
|
||||
}
|
||||
</style>
|
|
@ -198,6 +198,11 @@ const menuDef = $computed(() => [{
|
|||
text: i18n.ts.proxyAccount,
|
||||
to: '/admin/proxy-account',
|
||||
active: currentPage?.route.name === 'proxy-account',
|
||||
}, {
|
||||
icon: 'ph-square-arrow-out ph-bold pg-lg',
|
||||
text: i18n.ts.externalServices,
|
||||
to: '/admin/external-services',
|
||||
active: currentPage?.route.name === 'external-services',
|
||||
}, {
|
||||
icon: 'ph-faders ph-bold ph-lg',
|
||||
text: i18n.ts.other,
|
||||
|
|
|
@ -25,6 +25,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template #label>{{ i18n.ts.tosUrl }}</template>
|
||||
</MkInput>
|
||||
|
||||
<MkInput v-model="privacyPolicyUrl">
|
||||
<template #prefix><i class="ti ti-link"></i></template>
|
||||
<template #label>{{ i18n.ts.privacyPolicyUrl }}</template>
|
||||
</MkInput>
|
||||
|
||||
<MkTextarea v-model="preservedUsernames">
|
||||
<template #label>{{ i18n.ts.preservedUsernames }}</template>
|
||||
<template #caption>{{ i18n.ts.preservedUsernamesDescription }}</template>
|
||||
|
@ -69,6 +74,7 @@ let emailRequiredForSignup: boolean = $ref(false);
|
|||
let sensitiveWords: string = $ref('');
|
||||
let preservedUsernames: string = $ref('');
|
||||
let tosUrl: string | null = $ref(null);
|
||||
let privacyPolicyUrl: string | null = $ref(null);
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
|
@ -77,6 +83,7 @@ async function init() {
|
|||
sensitiveWords = meta.sensitiveWords.join('\n');
|
||||
preservedUsernames = meta.preservedUsernames.join('\n');
|
||||
tosUrl = meta.tosUrl;
|
||||
privacyPolicyUrl = meta.privacyPolicyUrl;
|
||||
}
|
||||
|
||||
function save() {
|
||||
|
@ -84,6 +91,7 @@ function save() {
|
|||
disableRegistration: !enableRegistration,
|
||||
emailRequiredForSignup,
|
||||
tosUrl,
|
||||
privacyPolicyUrl,
|
||||
sensitiveWords: sensitiveWords.split('\n'),
|
||||
preservedUsernames: preservedUsernames.split('\n'),
|
||||
}).then(() => {
|
||||
|
|
|
@ -29,8 +29,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<span v-else-if="log.type === 'unmarkSensitiveDriveFile'">: @{{ log.info.fileUserUsername }}{{ log.info.fileUserHost ? '@' + log.info.fileUserHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'suspendRemoteInstance'">: {{ log.info.host }}</span>
|
||||
<span v-else-if="log.type === 'unsuspendRemoteInstance'">: {{ log.info.host }}</span>
|
||||
<span v-else-if="log.type === 'createGlobalAnnouncement'">: {{ log.info.announcement.title }}</span>
|
||||
<span v-else-if="log.type === 'updateGlobalAnnouncement'">: {{ log.info.before.title }}</span>
|
||||
<span v-else-if="log.type === 'deleteGlobalAnnouncement'">: {{ log.info.announcement.title }}</span>
|
||||
<span v-else-if="log.type === 'createUserAnnouncement'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'updateUserAnnouncement'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'deleteUserAnnouncement'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'deleteNote'">: @{{ log.info.noteUserUsername }}{{ log.info.noteUserHost ? '@' + log.info.noteUserHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'deleteDriveFile'">: @{{ log.info.fileUserUsername }}{{ log.info.fileUserHost ? '@' + log.info.fileUserHost : '' }}</span>
|
||||
</template>
|
||||
|
@ -88,6 +92,16 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<CodeDiff :context="5" :hideHeader="true" :oldString="JSON5.stringify(log.info.before, null, '\t')" :newString="JSON5.stringify(log.info.after, null, '\t')" language="javascript" maxHeight="300px"/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="log.type === 'updateGlobalAnnouncement'">
|
||||
<div :class="$style.diff">
|
||||
<CodeDiff :context="5" :hideHeader="true" :oldString="JSON5.stringify(log.info.before, null, '\t')" :newString="JSON5.stringify(log.info.after, null, '\t')" language="javascript" maxHeight="300px"/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="log.type === 'updateUserAnnouncement'">
|
||||
<div :class="$style.diff">
|
||||
<CodeDiff :context="5" :hideHeader="true" :oldString="JSON5.stringify(log.info.before, null, '\t')" :newString="JSON5.stringify(log.info.after, null, '\t')" language="javascript" maxHeight="300px"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<details>
|
||||
<summary>raw</summary>
|
||||
|
|
|
@ -34,6 +34,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</MkInput>
|
||||
</FormSplit>
|
||||
|
||||
<MkInput v-model="impressumUrl">
|
||||
<template #label>{{ i18n.ts.impressumUrl }}</template>
|
||||
<template #prefix><i class="ti ti-link"></i></template>
|
||||
<template #caption>{{ i18n.ts.impressumDescription }}</template>
|
||||
</MkInput>
|
||||
|
||||
<MkTextarea v-model="pinnedUsers">
|
||||
<template #label>{{ i18n.ts.pinnedUsers }}</template>
|
||||
<template #caption>{{ i18n.ts.pinnedUsersDescription }}</template>
|
||||
|
@ -81,16 +87,40 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</FormSection>
|
||||
|
||||
<FormSection>
|
||||
<template #label>DeepL Translation</template>
|
||||
<template #label>Timeline caching</template>
|
||||
|
||||
<div class="_gaps_m">
|
||||
<MkInput v-model="deeplAuthKey">
|
||||
<template #prefix><i class="ph-key ph-bold ph-lg"></i></template>
|
||||
<template #label>DeepL Auth Key</template>
|
||||
<MkInput v-model="perLocalUserUserTimelineCacheMax" type="number">
|
||||
<template #label>perLocalUserUserTimelineCacheMax</template>
|
||||
</MkInput>
|
||||
<MkSwitch v-model="deeplIsPro">
|
||||
<template #label>Pro account</template>
|
||||
</MkSwitch>
|
||||
|
||||
<MkInput v-model="perRemoteUserUserTimelineCacheMax" type="number">
|
||||
<template #label>perRemoteUserUserTimelineCacheMax</template>
|
||||
</MkInput>
|
||||
|
||||
<MkInput v-model="perUserHomeTimelineCacheMax" type="number">
|
||||
<template #label>perUserHomeTimelineCacheMax</template>
|
||||
</MkInput>
|
||||
|
||||
<MkInput v-model="perUserListTimelineCacheMax" type="number">
|
||||
<template #label>perUserListTimelineCacheMax</template>
|
||||
</MkInput>
|
||||
</div>
|
||||
</FormSection>
|
||||
|
||||
<FormSection>
|
||||
<template #label>{{ i18n.ts._ad.adsSettings }}</template>
|
||||
|
||||
<div class="_gaps_m">
|
||||
<div class="_gaps_s">
|
||||
<MkInput v-model="notesPerOneAd" :min="0" type="number">
|
||||
<template #label>{{ i18n.ts._ad.notesPerOneAd }}</template>
|
||||
<template #caption>{{ i18n.ts._ad.setZeroToDisable }}</template>
|
||||
</MkInput>
|
||||
<MkInfo v-if="notesPerOneAd > 0 && notesPerOneAd < 20" :warn="true">
|
||||
{{ i18n.ts._ad.adsTooClose }}
|
||||
</MkInfo>
|
||||
</div>
|
||||
</div>
|
||||
</FormSection>
|
||||
</div>
|
||||
|
@ -113,6 +143,7 @@ import XHeader from './_header_.vue';
|
|||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import FormSection from '@/components/form/section.vue';
|
||||
import FormSplit from '@/components/form/split.vue';
|
||||
import FormSuspense from '@/components/form/suspense.vue';
|
||||
|
@ -127,14 +158,18 @@ let shortName: string | null = $ref(null);
|
|||
let description: string | null = $ref(null);
|
||||
let maintainerName: string | null = $ref(null);
|
||||
let maintainerEmail: string | null = $ref(null);
|
||||
let impressumUrl: string | null = $ref(null);
|
||||
let pinnedUsers: string = $ref('');
|
||||
let cacheRemoteFiles: boolean = $ref(false);
|
||||
let cacheRemoteSensitiveFiles: boolean = $ref(false);
|
||||
let enableServiceWorker: boolean = $ref(false);
|
||||
let swPublicKey: any = $ref(null);
|
||||
let swPrivateKey: any = $ref(null);
|
||||
let deeplAuthKey: string = $ref('');
|
||||
let deeplIsPro: boolean = $ref(false);
|
||||
let perLocalUserUserTimelineCacheMax: number = $ref(0);
|
||||
let perRemoteUserUserTimelineCacheMax: number = $ref(0);
|
||||
let perUserHomeTimelineCacheMax: number = $ref(0);
|
||||
let perUserListTimelineCacheMax: number = $ref(0);
|
||||
let notesPerOneAd: number = $ref(0);
|
||||
|
||||
async function init(): Promise<void> {
|
||||
const meta = await os.api('admin/meta');
|
||||
|
@ -143,34 +178,42 @@ async function init(): Promise<void> {
|
|||
description = meta.description;
|
||||
maintainerName = meta.maintainerName;
|
||||
maintainerEmail = meta.maintainerEmail;
|
||||
impressumUrl = meta.impressumUrl;
|
||||
pinnedUsers = meta.pinnedUsers.join('\n');
|
||||
cacheRemoteFiles = meta.cacheRemoteFiles;
|
||||
cacheRemoteSensitiveFiles = meta.cacheRemoteSensitiveFiles;
|
||||
enableServiceWorker = meta.enableServiceWorker;
|
||||
swPublicKey = meta.swPublickey;
|
||||
swPrivateKey = meta.swPrivateKey;
|
||||
deeplAuthKey = meta.deeplAuthKey;
|
||||
deeplIsPro = meta.deeplIsPro;
|
||||
perLocalUserUserTimelineCacheMax = meta.perLocalUserUserTimelineCacheMax;
|
||||
perRemoteUserUserTimelineCacheMax = meta.perRemoteUserUserTimelineCacheMax;
|
||||
perUserHomeTimelineCacheMax = meta.perUserHomeTimelineCacheMax;
|
||||
perUserListTimelineCacheMax = meta.perUserListTimelineCacheMax;
|
||||
notesPerOneAd = meta.notesPerOneAd;
|
||||
}
|
||||
|
||||
function save(): void {
|
||||
os.apiWithDialog('admin/update-meta', {
|
||||
async function save(): void {
|
||||
await os.apiWithDialog('admin/update-meta', {
|
||||
name,
|
||||
shortName: shortName === '' ? null : shortName,
|
||||
description,
|
||||
maintainerName,
|
||||
maintainerEmail,
|
||||
impressumUrl,
|
||||
pinnedUsers: pinnedUsers.split('\n'),
|
||||
cacheRemoteFiles,
|
||||
cacheRemoteSensitiveFiles,
|
||||
enableServiceWorker,
|
||||
swPublicKey,
|
||||
swPrivateKey,
|
||||
deeplAuthKey,
|
||||
deeplIsPro,
|
||||
}).then(() => {
|
||||
fetchInstance();
|
||||
perLocalUserUserTimelineCacheMax,
|
||||
perRemoteUserUserTimelineCacheMax,
|
||||
perUserHomeTimelineCacheMax,
|
||||
perUserListTimelineCacheMax,
|
||||
notesPerOneAd,
|
||||
});
|
||||
|
||||
fetchInstance();
|
||||
}
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
|
|
|
@ -102,7 +102,6 @@ let searchKey = $ref('');
|
|||
const featuredPagination = $computed(() => ({
|
||||
endpoint: 'notes/featured' as const,
|
||||
limit: 10,
|
||||
offsetMode: true,
|
||||
params: {
|
||||
channelId: props.channelId,
|
||||
},
|
||||
|
|
302
packages/frontend/src/pages/drive.file.info.vue
Normal file
302
packages/frontend/src/pages/drive.file.info.vue
Normal file
|
@ -0,0 +1,302 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="_gaps">
|
||||
<MkInfo>{{ i18n.ts._fileViewer.thisPageCanBeSeenFromTheAuthor }}</MkInfo>
|
||||
<MkLoading v-if="fetching"/>
|
||||
<div v-else-if="file" class="_gaps">
|
||||
<div :class="$style.filePreviewRoot">
|
||||
<MkMediaList :mediaList="[file]"></MkMediaList>
|
||||
</div>
|
||||
<div :class="$style.fileQuickActionsRoot">
|
||||
<button class="_button" :class="$style.fileNameEditBtn" @click="rename()">
|
||||
<h2 class="_nowrap" :class="$style.fileName">{{ file.name }}</h2>
|
||||
<i class="ti ti-pencil" :class="$style.fileNameEditIcon"></i>
|
||||
</button>
|
||||
<div :class="$style.fileQuickActionsOthers">
|
||||
<button v-tooltip="i18n.ts.createNoteFromTheFile" class="_button" :class="$style.fileQuickActionsOthersButton" @click="postThis()">
|
||||
<i class="ti ti-pencil"></i>
|
||||
</button>
|
||||
<button v-if="isImage" v-tooltip="i18n.ts.cropImage" class="_button" :class="$style.fileQuickActionsOthersButton" @click="crop()">
|
||||
<i class="ti ti-crop"></i>
|
||||
</button>
|
||||
<button v-if="file.isSensitive" v-tooltip="i18n.ts.unmarkAsSensitive" class="_button" :class="$style.fileQuickActionsOthersButton" @click="toggleSensitive()">
|
||||
<i class="ti ti-eye"></i>
|
||||
</button>
|
||||
<button v-else v-tooltip="i18n.ts.markAsSensitive" class="_button" :class="$style.fileQuickActionsOthersButton" @click="toggleSensitive()">
|
||||
<i class="ti ti-eye-exclamation"></i>
|
||||
</button>
|
||||
<a v-tooltip="i18n.ts.download" :href="file.url" :download="file.name" class="_button" :class="$style.fileQuickActionsOthersButton">
|
||||
<i class="ti ti-download"></i>
|
||||
</a>
|
||||
<button v-tooltip="i18n.ts.delete" class="_button" :class="[$style.fileQuickActionsOthersButton, $style.danger]" @click="deleteFile()">
|
||||
<i class="ti ti-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button class="_button" :class="$style.fileAltEditBtn" @click="describe()">
|
||||
<MkKeyValue>
|
||||
<template #key>{{ i18n.ts.description }}</template>
|
||||
<template #value>{{ file.comment ? file.comment : `(${i18n.ts.none})` }}<i class="ti ti-pencil" :class="$style.fileAltEditIcon"></i></template>
|
||||
</MkKeyValue>
|
||||
</button>
|
||||
<MkKeyValue :class="$style.fileMetaDataChildren">
|
||||
<template #key>{{ i18n.ts._fileViewer.uploadedAt }}</template>
|
||||
<template #value><MkTime :time="file.createdAt" mode="detail"/></template>
|
||||
</MkKeyValue>
|
||||
<MkKeyValue :class="$style.fileMetaDataChildren">
|
||||
<template #key>{{ i18n.ts._fileViewer.type }}</template>
|
||||
<template #value>{{ file.type }}</template>
|
||||
</MkKeyValue>
|
||||
<MkKeyValue :class="$style.fileMetaDataChildren">
|
||||
<template #key>{{ i18n.ts._fileViewer.size }}</template>
|
||||
<template #value>{{ bytes(file.size) }}</template>
|
||||
</MkKeyValue>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="_fullinfo">
|
||||
<img :src="infoImageUrl" class="_ghost"/>
|
||||
<div>{{ i18n.ts.nothing }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, defineAsyncComponent, onMounted } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import MkMediaList from '@/components/MkMediaList.vue';
|
||||
import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||
import bytes from '@/filters/bytes.js';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import * as os from '@/os.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const props = defineProps<{
|
||||
fileId: string;
|
||||
}>();
|
||||
|
||||
const fetching = ref(true);
|
||||
const file = ref<Misskey.entities.DriveFile>();
|
||||
const isImage = computed(() => file.value?.type.startsWith('image/'));
|
||||
|
||||
async function fetch() {
|
||||
fetching.value = true;
|
||||
|
||||
file.value = await os.api('drive/files/show', {
|
||||
fileId: props.fileId,
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
return undefined;
|
||||
});
|
||||
|
||||
fetching.value = false;
|
||||
}
|
||||
|
||||
function postThis() {
|
||||
if (!file.value) return;
|
||||
|
||||
os.post({
|
||||
initialFiles: [file.value],
|
||||
});
|
||||
}
|
||||
|
||||
function crop() {
|
||||
if (!file.value) return;
|
||||
|
||||
os.cropImage(file.value, {
|
||||
aspectRatio: NaN,
|
||||
uploadFolder: file.value.folderId ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
function toggleSensitive() {
|
||||
if (!file.value) return;
|
||||
|
||||
os.apiWithDialog('drive/files/update', {
|
||||
fileId: file.value.id,
|
||||
isSensitive: !file.value.isSensitive,
|
||||
}).then(async () => {
|
||||
await fetch();
|
||||
}).catch(err => {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.error,
|
||||
text: err.message,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function rename() {
|
||||
if (!file.value) return;
|
||||
|
||||
os.inputText({
|
||||
title: i18n.ts.renameFile,
|
||||
placeholder: i18n.ts.inputNewFileName,
|
||||
default: file.value.name,
|
||||
}).then(({ canceled, result: name }) => {
|
||||
if (canceled) return;
|
||||
os.apiWithDialog('drive/files/update', {
|
||||
fileId: file.value.id,
|
||||
name: name,
|
||||
}).then(async () => {
|
||||
await fetch();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function describe() {
|
||||
if (!file.value) return;
|
||||
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), {
|
||||
default: file.value.comment ?? '',
|
||||
file: file.value,
|
||||
}, {
|
||||
done: caption => {
|
||||
os.apiWithDialog('drive/files/update', {
|
||||
fileId: file.value.id,
|
||||
comment: caption.length === 0 ? null : caption,
|
||||
}).then(async () => {
|
||||
await fetch();
|
||||
});
|
||||
},
|
||||
}, 'closed');
|
||||
}
|
||||
|
||||
async function deleteFile() {
|
||||
if (!file.value) return;
|
||||
|
||||
const { canceled } = await os.confirm({
|
||||
type: 'warning',
|
||||
text: i18n.t('driveFileDeleteConfirm', { name: file.value.name }),
|
||||
});
|
||||
|
||||
if (canceled) return;
|
||||
await os.apiWithDialog('drive/files/delete', {
|
||||
fileId: file.value.id,
|
||||
});
|
||||
|
||||
router.push('/my/drive');
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetch();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
||||
.filePreviewRoot {
|
||||
background: var(--panel);
|
||||
border-radius: var(--radius);
|
||||
// MkMediaList 内の上部マージン 4px
|
||||
padding: calc(1rem - 4px) 1rem 1rem;
|
||||
}
|
||||
|
||||
.fileQuickActionsRoot {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
@container (min-width: 500px) {
|
||||
.fileQuickActionsRoot {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.fileQuickActionsOthers {
|
||||
margin-left: auto;
|
||||
margin-right: 1rem;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
|
||||
.fileQuickActionsOthersButton {
|
||||
padding: .5rem;
|
||||
border-radius: 99rem;
|
||||
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
background-color: var(--accentedBg);
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&.danger {
|
||||
color: #ff2a2a;
|
||||
}
|
||||
|
||||
&.danger:hover,
|
||||
&.danger:focus-visible {
|
||||
background-color: rgba(255, 42, 42, .15);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fileNameEditBtn {
|
||||
padding: .5rem 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
font-weight: 700;
|
||||
border-radius: var(--radius);
|
||||
font-size: .8rem;
|
||||
|
||||
>.fileNameEditIcon {
|
||||
color: transparent;
|
||||
visibility: hidden;
|
||||
padding-left: .5rem;
|
||||
}
|
||||
|
||||
>.fileName {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(--accentedBg);
|
||||
|
||||
>.fileName,
|
||||
>.fileNameEditIcon {
|
||||
visibility: visible;
|
||||
color: var(--accent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fileMetaDataChildren {
|
||||
padding: .5rem 1rem;
|
||||
}
|
||||
|
||||
.fileAltEditBtn {
|
||||
text-align: start;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: .5rem 1rem;
|
||||
border-radius: var(--radius);
|
||||
|
||||
.fileAltEditIcon {
|
||||
display: inline-block;
|
||||
color: transparent;
|
||||
visibility: hidden;
|
||||
padding-left: .5rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: var(--accent);
|
||||
background-color: var(--accentedBg);
|
||||
|
||||
.fileAltEditIcon {
|
||||
color: var(--accent);
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
33
packages/frontend/src/pages/drive.file.notes.vue
Normal file
33
packages/frontend/src/pages/drive.file.notes.vue
Normal file
|
@ -0,0 +1,33 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="_gaps">
|
||||
<MkInfo>{{ i18n.ts._fileViewer.thisPageCanBeSeenFromTheAuthor }}</MkInfo>
|
||||
<MkNotes ref="tlComponent" :pagination="pagination"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { Paging } from '@/components/MkPagination.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import MkNotes from '@/components/MkNotes.vue';
|
||||
|
||||
const props = defineProps<{
|
||||
fileId: string;
|
||||
}>();
|
||||
|
||||
const realFileId = computed(() => props.fileId);
|
||||
|
||||
const pagination = ref<Paging>({
|
||||
endpoint: 'drive/files/attached-notes',
|
||||
limit: 10,
|
||||
params: {
|
||||
fileId: realFileId.value,
|
||||
},
|
||||
});
|
||||
</script>
|
52
packages/frontend/src/pages/drive.file.vue
Normal file
52
packages/frontend/src/pages/drive.file.vue
Normal file
|
@ -0,0 +1,52 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<MkStickyContainer>
|
||||
<template #header>
|
||||
<MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/>
|
||||
</template>
|
||||
|
||||
<MkSpacer v-if="tab === 'info'" :contentMax="800">
|
||||
<XFileInfo :fileId="fileId"/>
|
||||
</MkSpacer>
|
||||
|
||||
<MkSpacer v-else-if="tab === 'notes'" :contentMax="800">
|
||||
<XNotes :fileId="fileId"/>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, defineAsyncComponent } from 'vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
const props = defineProps<{
|
||||
fileId: string;
|
||||
}>();
|
||||
|
||||
const XFileInfo = defineAsyncComponent(() => import('./drive.file.info.vue'));
|
||||
const XNotes = defineAsyncComponent(() => import('./drive.file.notes.vue'));
|
||||
|
||||
const tab = ref('info');
|
||||
|
||||
const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => [{
|
||||
key: 'info',
|
||||
title: i18n.ts.info,
|
||||
icon: 'ti ti-info-circle',
|
||||
}, {
|
||||
key: 'notes',
|
||||
title: i18n.ts._fileViewer.attachedNotes,
|
||||
icon: 'ti ti-pencil',
|
||||
}]);
|
||||
|
||||
definePageMetadata(computed(() => ({
|
||||
title: i18n.ts._fileViewer.title,
|
||||
icon: 'ti ti-file',
|
||||
})));
|
||||
</script>
|
|
@ -22,7 +22,6 @@ import { i18n } from '@/i18n.js';
|
|||
const paginationForNotes = {
|
||||
endpoint: 'notes/featured' as const,
|
||||
limit: 10,
|
||||
offsetMode: true,
|
||||
};
|
||||
|
||||
const paginationForPolls = {
|
||||
|
|
|
@ -286,8 +286,7 @@ definePageMetadata(computed(() => {
|
|||
let title = i18n.ts._pages.newPage;
|
||||
if (props.initPageId) {
|
||||
title = i18n.ts._pages.editPage;
|
||||
}
|
||||
else if (props.initPageName && props.initUser) {
|
||||
} else if (props.initPageName && props.initUser) {
|
||||
title = i18n.ts._pages.readPage;
|
||||
}
|
||||
return {
|
||||
|
|
|
@ -139,21 +139,11 @@ const menuDef = computed(() => [{
|
|||
text: i18n.ts.roles,
|
||||
to: '/settings/roles',
|
||||
active: currentPage?.route.name === 'roles',
|
||||
}, {
|
||||
icon: 'ph-speaker-none ph-bold pg-lg',
|
||||
text: i18n.ts.instanceMute,
|
||||
to: '/settings/instance-mute',
|
||||
active: currentPage?.route.name === 'instance-mute',
|
||||
}, {
|
||||
icon: 'ph-prohibit ph-bold ph-lg',
|
||||
text: i18n.ts.muteAndBlock,
|
||||
to: '/settings/mute-block',
|
||||
active: currentPage?.route.name === 'mute-block',
|
||||
}, {
|
||||
icon: 'ph-speaker-x ph-bold ph-lg',
|
||||
text: i18n.ts.wordMute,
|
||||
to: '/settings/word-mute',
|
||||
active: currentPage?.route.name === 'word-mute',
|
||||
}, {
|
||||
icon: 'ph-key ph-bold pg-lg',
|
||||
text: 'API',
|
||||
|
|
|
@ -22,7 +22,6 @@ import MkButton from '@/components/MkButton.vue';
|
|||
import * as os from '@/os.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
|
||||
const instanceMutes = ref($i!.mutedInstances.join('\n'));
|
||||
const changed = ref(false);
|
||||
|
@ -46,13 +45,4 @@ async function save() {
|
|||
watch(instanceMutes, () => {
|
||||
changed.value = true;
|
||||
});
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
title: i18n.ts.instanceMute,
|
||||
icon: 'ph-prohibit ph-bold pg-lg',
|
||||
});
|
||||
</script>
|
|
@ -5,6 +5,20 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<template>
|
||||
<div class="_gaps_m">
|
||||
<MkFolder>
|
||||
<template #icon><i class="ti ti-message-off"></i></template>
|
||||
<template #label>{{ i18n.ts.wordMute }}</template>
|
||||
|
||||
<XWordMute/>
|
||||
</MkFolder>
|
||||
|
||||
<MkFolder>
|
||||
<template #icon><i class="ti ti-planet-off"></i></template>
|
||||
<template #label>{{ i18n.ts.instanceMute }}</template>
|
||||
|
||||
<XInstanceMute/>
|
||||
</MkFolder>
|
||||
|
||||
<MkFolder>
|
||||
<template #icon><i class="ti ti-repeat-off"></i></template>
|
||||
<template #label>{{ i18n.ts.mutedUsers }} ({{ i18n.ts.renote }})</template>
|
||||
|
@ -106,6 +120,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { } from 'vue';
|
||||
import XInstanceMute from './mute-block.instance-mute.vue';
|
||||
import XWordMute from './mute-block.word-mute.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import { userPage } from '@/filters/user.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
|
|
@ -91,13 +91,4 @@ async function save() {
|
|||
|
||||
changed.value = false;
|
||||
}
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
title: i18n.ts.wordMute,
|
||||
icon: 'ph-bell-slash ph-bold ph-lg',
|
||||
});
|
||||
</script>
|
|
@ -38,14 +38,12 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|||
|
||||
const masterVolume = computed(soundConfigStore.makeGetterSetter('sound_masterVolume'));
|
||||
|
||||
const soundsKeys = ['note', 'noteMy', 'notification', 'chat', 'chatBg', 'antenna', 'channel'] as const;
|
||||
const soundsKeys = ['note', 'noteMy', 'notification', 'antenna', 'channel'] as const;
|
||||
|
||||
const sounds = ref<Record<typeof soundsKeys[number], Ref<any>>>({
|
||||
note: soundConfigStore.reactiveState.sound_note,
|
||||
noteMy: soundConfigStore.reactiveState.sound_noteMy,
|
||||
notification: soundConfigStore.reactiveState.sound_notification,
|
||||
chat: soundConfigStore.reactiveState.sound_chat,
|
||||
chatBg: soundConfigStore.reactiveState.sound_chatBg,
|
||||
antenna: soundConfigStore.reactiveState.sound_antenna,
|
||||
channel: soundConfigStore.reactiveState.sound_channel,
|
||||
});
|
||||
|
|
|
@ -15,10 +15,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div :class="$style.tl">
|
||||
<MkTimeline
|
||||
ref="tlComponent"
|
||||
:key="src + withRenotes + onlyFiles"
|
||||
:key="src + withRenotes + withReplies + onlyFiles"
|
||||
:src="src.split(':')[0]"
|
||||
:list="src.split(':')[1]"
|
||||
:withRenotes="withRenotes"
|
||||
:withReplies="withReplies"
|
||||
:onlyFiles="onlyFiles"
|
||||
:sound="true"
|
||||
@queue="queueUpdated"
|
||||
|
@ -42,7 +43,7 @@ import { instance } from '@/instance.js';
|
|||
import { $i } from '@/account.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { miLocalStorage } from '@/local-storage.js';
|
||||
import { antennasCache, userListsCache } from '@/cache';
|
||||
import { antennasCache, userListsCache } from '@/cache.js';
|
||||
|
||||
provide('shouldOmitHeaderTitle', true);
|
||||
|
||||
|
@ -61,10 +62,15 @@ let queue = $ref(0);
|
|||
let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global');
|
||||
const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) });
|
||||
const withRenotes = $ref(true);
|
||||
const withReplies = $ref($i ? defaultStore.state.tlWithReplies : false);
|
||||
const onlyFiles = $ref(false);
|
||||
|
||||
watch($$(src), () => queue = 0);
|
||||
|
||||
watch($$(withReplies), (x) => {
|
||||
if ($i) defaultStore.set('tlWithReplies', x);
|
||||
});
|
||||
|
||||
function queueUpdated(q: number): void {
|
||||
queue = q;
|
||||
}
|
||||
|
@ -142,7 +148,11 @@ const headerActions = $computed(() => [{
|
|||
text: i18n.ts.showRenotes,
|
||||
icon: 'ph-repeat ph-bold ph-lg',
|
||||
ref: $$(withRenotes),
|
||||
}, {
|
||||
}, src === 'local' || src === 'social' ? {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRepliesToOthersInTimeline,
|
||||
ref: $$(withReplies),
|
||||
} : undefined, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.fileAttachedOnly,
|
||||
icon: 'ph-image ph-bold pg-lg',
|
||||
|
|
|
@ -61,20 +61,7 @@ function settings() {
|
|||
router.push(`/my/lists/${props.listId}`);
|
||||
}
|
||||
|
||||
async function timetravel() {
|
||||
const { canceled, result: date } = await os.inputDate({
|
||||
title: i18n.ts.date,
|
||||
});
|
||||
if (canceled) return;
|
||||
|
||||
tlEl.timetravel(date);
|
||||
}
|
||||
|
||||
const headerActions = $computed(() => list ? [{
|
||||
icon: 'ph-calendar ph-bold ph-lg',
|
||||
text: i18n.ts.jumpToSpecifiedDate,
|
||||
handler: timetravel,
|
||||
}, {
|
||||
icon: 'ph-gear ph-bold pg-lg',
|
||||
text: i18n.ts.settings,
|
||||
handler: settings,
|
||||
|
|
|
@ -131,15 +131,19 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<XFiles :key="user.id" :user="user"/>
|
||||
<XActivity :key="user.id" :user="user"/>
|
||||
</template>
|
||||
<!-- <div v-if="!disableNotes">
|
||||
<div style="margin-bottom: 8px; z-index: 1;">{{ i18n.ts.featured }}</div>
|
||||
<MkNotes :class="$style.tl" :noGap="true" :pagination="pagination"/>
|
||||
</div> -->
|
||||
<MkStickyContainer>
|
||||
<template #header>
|
||||
<MkTab v-model="noteview" :class="$style.tab">
|
||||
<option :value="null">{{ i18n.ts.notes }}</option>
|
||||
<option value="replies">{{ i18n.ts.notesAndReplies }}</option>
|
||||
<option value="replies">{{ i18n.ts.all }}</option>
|
||||
<option value="files">{{ i18n.ts.withFiles }}</option>
|
||||
</MkTab>
|
||||
</template>
|
||||
<MkNotes v-if="!disableNotes" :class="$style.tl" :noGap="true" :pagination="pagination"/>
|
||||
<MkNotes :class="$style.tl" :noGap="true" :pagination="AllPagination"/>
|
||||
</MkStickyContainer>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -248,11 +252,21 @@ watch($$(moderationNote), async () => {
|
|||
});
|
||||
|
||||
const pagination = {
|
||||
endpoint: 'users/featured-notes' as const,
|
||||
limit: 10,
|
||||
params: computed(() => ({
|
||||
userId: props.user.id
|
||||
})),
|
||||
};
|
||||
|
||||
const AllPagination = {
|
||||
endpoint: 'users/notes' as const,
|
||||
limit: 10,
|
||||
params: computed(() => ({
|
||||
userId: props.user.id,
|
||||
withReplies: noteview === 'replies' || noteview === 'files',
|
||||
withRenotes: noteview === 'all',
|
||||
withReplies: noteview === 'all' || noteview === 'files',
|
||||
withChannelNotes: noteview === 'all',
|
||||
withFiles: noteview === 'files',
|
||||
})),
|
||||
};
|
||||
|
|
|
@ -10,15 +10,18 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div :class="$style.root">
|
||||
<MkLoading v-if="fetching"/>
|
||||
<div v-if="!fetching && files.length > 0" :class="$style.stream">
|
||||
<MkA
|
||||
v-for="file in files"
|
||||
:key="file.note.id + file.file.id"
|
||||
:class="$style.img"
|
||||
:to="notePage(file.note)"
|
||||
>
|
||||
<!-- TODO: 画像以外のファイルに対応 -->
|
||||
<ImgWithBlurhash :hash="file.file.blurhash" :src="thumbnail(file.file)" :title="file.file.name"/>
|
||||
</MkA>
|
||||
<template v-for="file in files" :key="file.note.id + file.file.id">
|
||||
<div v-if="file.file.isSensitive && !showingFiles.includes(file.file.id)" :class="$style.sensitive" @click="showingFiles.push(file.file.id)">
|
||||
<div>
|
||||
<div><i class="ti ti-eye-exclamation"></i> {{ i18n.ts.sensitive }}</div>
|
||||
<div>{{ i18n.ts.clickToShow }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<MkA v-else :class="$style.img" :to="notePage(file.note)">
|
||||
<!-- TODO: 画像以外のファイルに対応 -->
|
||||
<ImgWithBlurhash :hash="file.file.blurhash" :src="thumbnail(file.file)" :title="file.file.name"/>
|
||||
</MkA>
|
||||
</template>
|
||||
</div>
|
||||
<p v-if="!fetching && files.length == 0" :class="$style.empty">{{ i18n.ts.nothing }}</p>
|
||||
</div>
|
||||
|
@ -45,6 +48,7 @@ let files = $ref<{
|
|||
note: Misskey.entities.Note;
|
||||
file: Misskey.entities.DriveFile;
|
||||
}[]>([]);
|
||||
let showingFiles = $ref<string[]>([]);
|
||||
|
||||
function thumbnail(image: Misskey.entities.DriveFile): string {
|
||||
return defaultStore.state.disableShowingAnimatedImages
|
||||
|
@ -94,4 +98,9 @@ onMounted(() => {
|
|||
padding: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sensitive {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -29,7 +29,7 @@ const props = defineProps<{
|
|||
user: Misskey.entities.UserDetailed;
|
||||
}>();
|
||||
|
||||
const include = ref<string | null>(null);
|
||||
const include = ref<string | null>('all');
|
||||
|
||||
const pagination = {
|
||||
endpoint: 'users/notes' as const,
|
||||
|
@ -38,6 +38,7 @@ const pagination = {
|
|||
userId: props.user.id,
|
||||
withRenotes: include.value === 'all',
|
||||
withReplies: include.value === 'all' || include.value === 'files',
|
||||
withChannelNotes: include.value === 'all',
|
||||
withFiles: include.value === 'files',
|
||||
})),
|
||||
};
|
||||
|
|
|
@ -126,18 +126,10 @@ export const routes = [{
|
|||
path: '/import-export',
|
||||
name: 'import-export',
|
||||
component: page(() => import('./pages/settings/import-export.vue')),
|
||||
}, {
|
||||
path: '/instance-mute',
|
||||
name: 'instance-mute',
|
||||
component: page(() => import('./pages/settings/instance-mute.vue')),
|
||||
}, {
|
||||
path: '/mute-block',
|
||||
name: 'mute-block',
|
||||
component: page(() => import('./pages/settings/mute-block.vue')),
|
||||
}, {
|
||||
path: '/word-mute',
|
||||
name: 'word-mute',
|
||||
component: page(() => import('./pages/settings/word-mute.vue')),
|
||||
}, {
|
||||
path: '/api',
|
||||
name: 'api',
|
||||
|
@ -435,6 +427,10 @@ export const routes = [{
|
|||
path: '/proxy-account',
|
||||
name: 'proxy-account',
|
||||
component: page(() => import('./pages/admin/proxy-account.vue')),
|
||||
}, {
|
||||
path: '/external-services',
|
||||
name: 'external-services',
|
||||
component: page(() => import('./pages/admin/external-services.vue')),
|
||||
}, {
|
||||
path: '/other-settings',
|
||||
name: 'other-settings',
|
||||
|
@ -471,6 +467,10 @@ export const routes = [{
|
|||
path: '/my/drive',
|
||||
component: page(() => import('./pages/drive.vue')),
|
||||
loginRequired: true,
|
||||
}, {
|
||||
path: '/my/drive/file/:fileId',
|
||||
component: page(() => import('./pages/drive.file.vue')),
|
||||
loginRequired: true,
|
||||
}, {
|
||||
path: '/my/follow-requests',
|
||||
component: page(() => import('./pages/follow-requests.vue')),
|
||||
|
|
|
@ -27,7 +27,7 @@ function rename(file: Misskey.entities.DriveFile) {
|
|||
|
||||
function describe(file: Misskey.entities.DriveFile) {
|
||||
os.popup(defineAsyncComponent(() => import('@/components/MkFileCaptionEditWindow.vue')), {
|
||||
default: file.comment != null ? file.comment : '',
|
||||
default: file.comment ?? '',
|
||||
file: file,
|
||||
}, {
|
||||
done: caption => {
|
||||
|
@ -112,6 +112,11 @@ export function getDriveFileMenu(file: Misskey.entities.DriveFile, folder?: Miss
|
|||
text: i18n.ts.download,
|
||||
icon: 'ph-download ph-bold ph-lg',
|
||||
download: file.name,
|
||||
}, null, {
|
||||
type: 'link',
|
||||
to: `/my/drive/file/${file.id}`,
|
||||
text: i18n.ts._fileViewer.title,
|
||||
icon: 'ph-file-text ph-bold pg-lg',
|
||||
}, null, {
|
||||
text: i18n.ts.delete,
|
||||
icon: 'ph-trash ph-bold ph-lg',
|
||||
|
|
|
@ -7,10 +7,6 @@ import { markRaw } from 'vue';
|
|||
import { Storage } from '@/pizzax.js';
|
||||
|
||||
export const soundConfigStore = markRaw(new Storage('sound', {
|
||||
mediaVolume: {
|
||||
where: 'device',
|
||||
default: 0.5,
|
||||
},
|
||||
sound_masterVolume: {
|
||||
where: 'device',
|
||||
default: 0.3,
|
||||
|
@ -27,14 +23,6 @@ export const soundConfigStore = markRaw(new Storage('sound', {
|
|||
where: 'account',
|
||||
default: { type: 'syuilo/n-ea', volume: 1 },
|
||||
},
|
||||
sound_chat: {
|
||||
where: 'account',
|
||||
default: { type: 'syuilo/pope1', volume: 1 },
|
||||
},
|
||||
sound_chatBg: {
|
||||
where: 'account',
|
||||
default: { type: 'syuilo/waon', volume: 1 },
|
||||
},
|
||||
sound_antenna: {
|
||||
where: 'account',
|
||||
default: { type: 'syuilo/triple', volume: 1 },
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
|
||||
import { ref } from 'vue';
|
||||
import tinycolor from 'tinycolor2';
|
||||
import { globalEvents } from '@/events';
|
||||
import { deepClone } from './clone.js';
|
||||
import { globalEvents } from '@/events.js';
|
||||
import lightTheme from '@/themes/_light.json5';
|
||||
import darkTheme from '@/themes/_dark.json5';
|
||||
import { miLocalStorage } from '@/local-storage.js';
|
||||
|
||||
export type Theme = {
|
||||
id: string;
|
||||
|
@ -16,11 +20,6 @@ export type Theme = {
|
|||
props: Record<string, string>;
|
||||
};
|
||||
|
||||
import lightTheme from '@/themes/_light.json5';
|
||||
import darkTheme from '@/themes/_dark.json5';
|
||||
import { deepClone } from './clone';
|
||||
import { miLocalStorage } from '@/local-storage.js';
|
||||
|
||||
export const themeProps = Object.keys(lightTheme.props).filter(key => !key.startsWith('X'));
|
||||
|
||||
export const getBuiltinThemes = () => Promise.all(
|
||||
|
@ -102,18 +101,11 @@ export function applyTheme(theme: Theme, persist = true) {
|
|||
|
||||
function compile(theme: Theme): Record<string, string> {
|
||||
function getColor(val: string): tinycolor.Instance {
|
||||
// ref (prop)
|
||||
if (val[0] === '@') {
|
||||
if (val[0] === '@') { // ref (prop)
|
||||
return getColor(theme.props[val.substring(1)]);
|
||||
}
|
||||
|
||||
// ref (const)
|
||||
else if (val[0] === '$') {
|
||||
} else if (val[0] === '$') { // ref (const)
|
||||
return getColor(theme.props[val]);
|
||||
}
|
||||
|
||||
// func
|
||||
else if (val[0] === ':') {
|
||||
} else if (val[0] === ':') { // func
|
||||
const parts = val.split('<');
|
||||
const func = parts.shift().substring(1);
|
||||
const arg = parseFloat(parts.shift());
|
||||
|
|
|
@ -365,6 +365,10 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||
where: 'device',
|
||||
default: false,
|
||||
},
|
||||
tlWithReplies: {
|
||||
where: 'device',
|
||||
default: false,
|
||||
},
|
||||
}));
|
||||
|
||||
// TODO: 他のタブと永続化されたstateを同期
|
||||
|
|
|
@ -54,9 +54,6 @@
|
|||
infoWarnBg: '#42321c',
|
||||
infoWarnFg: '#ffbd3e',
|
||||
switchBg: 'rgba(255, 255, 255, 0.15)',
|
||||
cwBg: '#687390',
|
||||
cwFg: '#393f4f',
|
||||
cwHoverBg: '#707b97',
|
||||
buttonBg: 'rgba(255, 255, 255, 0.05)',
|
||||
buttonHoverBg: 'rgba(255, 255, 255, 0.1)',
|
||||
buttonGradateA: '@accent',
|
||||
|
|
|
@ -54,9 +54,6 @@
|
|||
infoWarnBg: '#fff0db',
|
||||
infoWarnFg: '#8f6e31',
|
||||
switchBg: 'rgba(0, 0, 0, 0.15)',
|
||||
cwBg: '#b1b9c1',
|
||||
cwFg: '#fff',
|
||||
cwHoverBg: '#bbc4ce',
|
||||
buttonBg: 'rgba(0, 0, 0, 0.05)',
|
||||
buttonHoverBg: 'rgba(0, 0, 0, 0.1)',
|
||||
buttonGradateA: '@accent',
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
props: {
|
||||
bg: '#232125',
|
||||
fg: '#efdab9',
|
||||
cwBg: '#687390',
|
||||
cwFg: '#393f4f',
|
||||
link: '#78b0a0',
|
||||
warn: '#ecb637',
|
||||
badge: '#31b1ce',
|
||||
|
@ -29,7 +27,6 @@
|
|||
success: '#86b300',
|
||||
buttonBg: 'rgba(255, 255, 255, 0.05)',
|
||||
acrylicBg: ':alpha<0.5<@bg',
|
||||
cwHoverBg: '#707b97',
|
||||
indicator: '@accent',
|
||||
mentionMe: '#fb5d38',
|
||||
messageBg: '@bg',
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
X15: ':alpha<0<@panel',
|
||||
X16: ':alpha<0.7<@panel',
|
||||
X17: ':alpha<0.8<@bg',
|
||||
cwBg: '#687390',
|
||||
cwFg: '#393f4f',
|
||||
link: '@accent',
|
||||
warn: '#ecb637',
|
||||
badge: '#31b1ce',
|
||||
|
@ -46,7 +44,6 @@
|
|||
buttonBg: 'rgba(255, 255, 255, 0.05)',
|
||||
switchBg: 'rgba(255, 255, 255, 0.15)',
|
||||
acrylicBg: ':alpha<0.5<@bg',
|
||||
cwHoverBg: '#707b97',
|
||||
indicator: '@accent',
|
||||
mentionMe: '@mention',
|
||||
messageBg: '@bg',
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
X15: ':alpha<0<@panel',
|
||||
X16: ':alpha<0.7<@panel',
|
||||
X17: ':alpha<0.8<@bg',
|
||||
cwBg: '#687390',
|
||||
cwFg: '#393f4f',
|
||||
link: '@accent',
|
||||
warn: '#ecb637',
|
||||
badge: '#31b1ce',
|
||||
|
@ -46,7 +44,6 @@
|
|||
buttonBg: '#0000000d',
|
||||
switchBg: 'rgba(255, 255, 255, 0.15)',
|
||||
acrylicBg: ':alpha<0.5<@bg',
|
||||
cwHoverBg: '#707b97',
|
||||
indicator: '@accent',
|
||||
mentionMe: '@mention',
|
||||
messageBg: '@bg',
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
props: {
|
||||
bg: '#fafafa',
|
||||
fg: '#444',
|
||||
cwBg: '#b1b9c1',
|
||||
cwFg: '#fff',
|
||||
link: '#ff9400',
|
||||
warn: '#ecb637',
|
||||
badge: '#31b1ce',
|
||||
|
@ -32,7 +30,6 @@
|
|||
success: '#86b300',
|
||||
buttonBg: 'rgba(0, 0, 0, 0.05)',
|
||||
acrylicBg: ':alpha<0.5<@bg',
|
||||
cwHoverBg: '#bbc4ce',
|
||||
indicator: '@accent',
|
||||
mentionMe: '@mention',
|
||||
messageBg: '@bg',
|
||||
|
|
|
@ -68,7 +68,25 @@ export function openInstanceMenu(ev: MouseEvent) {
|
|||
text: i18n.ts.manageCustomEmojis,
|
||||
icon: 'ph-smiley ph-bold pg-lg',
|
||||
} : undefined],
|
||||
}, null, {
|
||||
}, null, (instance.impressumUrl) ? {
|
||||
text: i18n.ts.impressum,
|
||||
icon: 'ph-newspaper-clipping ph-bold pg-lg',
|
||||
action: () => {
|
||||
window.open(instance.impressumUrl, '_blank');
|
||||
},
|
||||
} : undefined, (instance.tosUrl) ? {
|
||||
text: i18n.ts.termsOfService,
|
||||
icon: 'ph-notebook ph-bold pg-lg',
|
||||
action: () => {
|
||||
window.open(instance.tosUrl, '_blank');
|
||||
},
|
||||
} : undefined, (instance.privacyPolicyUrl) ? {
|
||||
text: i18n.ts.privacyPolicy,
|
||||
icon: 'ph-shield ph-bold pg-lg',
|
||||
action: () => {
|
||||
window.open(instance.privacyPolicyUrl, '_blank');
|
||||
},
|
||||
} : undefined, (!instance.impressumUrl && !instance.tosUrl && !instance.privacyPolicyUrl) ? undefined : null, {
|
||||
text: i18n.ts.help,
|
||||
icon: 'ph-question ph-bold ph-lg',
|
||||
action: () => {
|
||||
|
|
|
@ -31,6 +31,7 @@ export type Column = {
|
|||
excludeTypes?: typeof notificationTypes[number][];
|
||||
tl?: 'home' | 'local' | 'social' | 'global';
|
||||
withRenotes?: boolean;
|
||||
withReplies?: boolean;
|
||||
onlyFiles?: boolean;
|
||||
};
|
||||
|
||||
|
|
|
@ -23,9 +23,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkTimeline
|
||||
v-else-if="column.tl"
|
||||
ref="timeline"
|
||||
:key="column.tl + withRenotes + onlyFiles"
|
||||
:key="column.tl + withRenotes + withReplies + onlyFiles"
|
||||
:src="column.tl"
|
||||
:withRenotes="withRenotes"
|
||||
:withReplies="withReplies"
|
||||
:onlyFiles="onlyFiles"
|
||||
/>
|
||||
</XColumn>
|
||||
|
@ -51,6 +52,7 @@ let disabled = $ref(false);
|
|||
const isLocalTimelineAvailable = (($i == null && instance.policies.ltlAvailable) || ($i != null && $i.policies.ltlAvailable));
|
||||
const isGlobalTimelineAvailable = (($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable));
|
||||
const withRenotes = $ref(props.column.withRenotes ?? true);
|
||||
const withReplies = $ref(props.column.withReplies ?? false);
|
||||
const onlyFiles = $ref(props.column.onlyFiles ?? false);
|
||||
|
||||
watch($$(withRenotes), v => {
|
||||
|
@ -107,7 +109,11 @@ const menu = [{
|
|||
type: 'switch',
|
||||
text: i18n.ts.showRenotes,
|
||||
ref: $$(withRenotes),
|
||||
}, {
|
||||
}, props.column.tl === 'local' || props.column.tl === 'social' ? {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRepliesToOthersInTimeline,
|
||||
ref: $$(withReplies),
|
||||
} : undefined, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.fileAttachedOnly,
|
||||
ref: $$(onlyFiles),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue