Merge remote-branch 'misskey/develop'

This commit is contained in:
NoriDev 2023-05-24 16:17:03 +09:00
commit ae68abca40
11 changed files with 894 additions and 832 deletions

View file

@ -60,7 +60,7 @@
"@typescript-eslint/eslint-plugin": "5.59.5",
"@typescript-eslint/parser": "5.59.5",
"cross-env": "7.0.3",
"cypress": "12.12.0",
"cypress": "12.13.0",
"eslint": "8.40.0",
"start-server-and-test": "2.0.0"
},

View file

@ -63,9 +63,9 @@
"@fastify/multipart": "7.6.0",
"@fastify/static": "6.10.1",
"@fastify/view": "7.4.1",
"@nestjs/common": "9.4.1",
"@nestjs/core": "9.4.1",
"@nestjs/testing": "9.4.1",
"@nestjs/common": "9.4.2",
"@nestjs/core": "9.4.2",
"@nestjs/testing": "9.4.2",
"@peertube/http-signature": "1.7.0",
"@sinonjs/fake-timers": "10.0.2",
"@swc/cli": "0.1.62",
@ -104,7 +104,7 @@
"jsdom": "21.1.1",
"json5": "2.2.3",
"jsonld": "8.1.1",
"meilisearch": "0.32.3",
"meilisearch": "0.32.4",
"jsrsasign": "10.8.6",
"mfm-js": "0.23.3",
"mime-types": "2.1.35",
@ -180,11 +180,11 @@
"@types/jsonld": "1.5.8",
"@types/jsrsasign": "10.5.8",
"@types/mime-types": "2.1.1",
"@types/node": "20.2.1",
"@types/node": "20.2.3",
"@types/node-fetch": "3.0.3",
"@types/nodemailer": "6.4.8",
"@types/oauth": "0.9.1",
"@types/pg": "8.6.6",
"@types/pg": "8.10.1",
"@types/pug": "2.0.6",
"@types/punycode": "2.1.0",
"@types/qrcode": "1.5.0",
@ -198,7 +198,7 @@
"@types/sinonjs__fake-timers": "8.1.2",
"@types/tinycolor2": "1.4.3",
"@types/tmp": "0.2.3",
"@types/unzipper": "0.10.5",
"@types/unzipper": "0.10.6",
"@types/uuid": "9.0.1",
"@types/vary": "1.1.0",
"@types/web-push": "3.3.2",

View file

@ -4,7 +4,7 @@ import * as Redis from 'ioredis';
import { DataSource } from 'typeorm';
import { MeiliSearch } from 'meilisearch';
import { DI } from './di-symbols.js';
import { loadConfig } from './config.js';
import { Config, loadConfig } from './config.js';
import { createPostgresDataSource } from './postgres.js';
import { RepositoryModule } from './models/RepositoryModule.js';
import type { Provider, OnApplicationShutdown } from '@nestjs/common';
@ -25,7 +25,7 @@ const $db: Provider = {
const $meilisearch: Provider = {
provide: DI.meilisearch,
useFactory: (config) => {
useFactory: (config: Config) => {
if (config.meilisearch) {
return new MeiliSearch({
host: `${config.meilisearch.ssl ? 'https' : 'http' }://${config.meilisearch.host}:${config.meilisearch.port}`,
@ -40,7 +40,7 @@ const $meilisearch: Provider = {
const $redis: Provider = {
provide: DI.redis,
useFactory: (config) => {
useFactory: (config: Config) => {
return new Redis.Redis({
port: config.redis.port,
host: config.redis.host,
@ -55,7 +55,7 @@ const $redis: Provider = {
const $redisForPub: Provider = {
provide: DI.redisForPub,
useFactory: (config) => {
useFactory: (config: Config) => {
const redis = new Redis.Redis({
port: config.redisForPubsub.port,
host: config.redisForPubsub.host,
@ -71,7 +71,7 @@ const $redisForPub: Provider = {
const $redisForSub: Provider = {
provide: DI.redisForSub,
useFactory: (config) => {
useFactory: (config: Config) => {
const redis = new Redis.Redis({
port: config.redisForPubsub.port,
host: config.redisForPubsub.host,

View file

@ -160,37 +160,41 @@
<path d="M12 9v2m0 4v.01"></path>
<path d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75"></path>
</svg>
<h1>An error has occurred!</h1>
<button class="button-big" onclick="location.reload();">
<span class="button-label-big">Refresh</span>
<h1>Failed to load<br>読み込みに失敗しました</h1>
<button class="button-big" onclick="location.reload(true);">
<span class="button-label-big">Reload / リロード</span>
</button>
<p class="dont-worry">Don't worry, it's (probably) not your fault.</p>
<p>If the problem persists after refreshing, please contact your instance's administrator.<br>You may also try the following options:</p>
<p>Update your os and browser.</p>
<p>Disable an adblocker.</p>
<a href="/flush">
<button class="button-small">
<span class="button-label-small">Clear preferences and cache</span>
</button>
</a>
<br>
<a href="/cli">
<button class="button-small">
<span class="button-label-small">Start the simple client</span>
</button>
</a>
<br>
<a href="/bios">
<button class="button-small">
<span class="button-label-small">Start the repair tool</span>
</button>
</a>
<p><b>The following actions may solve the problem. / 以下を行うと解決する可能性があります</b></p>
<p>Clear the browser cache / ブラウザのキャッシュをクリアする</p>
<p>Update your os and browser / ブラウザおよびOSを最新バージョンに更新する</p>
<p>Disable an adblocker / アドブロッカーを無効にする</p>
<details style="color: #86b300;">
<summary>Other options / その他のオプション</summary>
<a href="/flush">
<button class="button-small">
<span class="button-label-small">Clear preferences and cache</span>
</button>
</a>
<br>
<a href="/cli">
<button class="button-small">
<span class="button-label-small">Start the simple client</span>
</button>
</a>
<br>
<a href="/bios">
<button class="button-small">
<span class="button-label-small">Start the repair tool</span>
</button>
</a>
</details>
<br>
<div id="errors"></div>
`;
errorsElement = document.getElementById('errors');
}
const detailsElement = document.createElement('details');
detailsElement.id = 'errorInfo';
detailsElement.innerHTML = `
<br>
<summary>
@ -272,7 +276,7 @@
.button-label-big {
color: #222;
font-weight: bold;
font-size: 20px;
font-size: 1.2em;
padding: 12px;
}
@ -292,11 +296,6 @@
font-size: 16px;
}
.dont-worry,
#msg {
font-size: 18px;
}
.icon-warning {
color: #dec340;
height: 4rem;
@ -304,14 +303,15 @@
}
h1 {
font-size: 32px;
font-size: 1.5em;
margin: 1em;
}
code {
font-family: "JetBrains Mono", Fira, FiraCode, monospace;
}
details {
#errorInfo {
background: #333;
margin-bottom: 2rem;
padding: 0.5rem 1rem;
@ -321,16 +321,16 @@
margin: auto;
}
summary {
#errorInfo summary {
cursor: pointer;
}
summary > * {
#errorInfo summary > * {
display: inline;
}
@media screen and (max-width: 500px) {
details {
#errorInfo {
width: 50%;
}
`)

View file

@ -22,7 +22,7 @@
"@syuilo/aiscript": "0.13.3",
"@tabler/icons-webfont": "2.17.0",
"@vitejs/plugin-vue": "4.2.3",
"@vue-macros/reactivity-transform": "0.3.7",
"@vue-macros/reactivity-transform": "0.3.8",
"@vue/compiler-sfc": "3.3.4",
"autosize": "6.0.1",
"broadcast-channel": "4.20.2",
@ -54,7 +54,7 @@
"punycode": "2.3.0",
"querystring": "0.2.1",
"rndstr": "1.0.0",
"rollup": "3.22.0",
"rollup": "3.23.0",
"s-age": "1.1.2",
"sanitize-html": "2.10.0",
"sass": "1.62.1",
@ -78,37 +78,37 @@
"vuedraggable": "next"
},
"devDependencies": {
"@storybook/addon-actions": "7.0.12",
"@storybook/addon-essentials": "7.0.12",
"@storybook/addon-interactions": "7.0.12",
"@storybook/addon-links": "7.0.12",
"@storybook/addon-storysource": "7.0.12",
"@storybook/addons": "7.0.12",
"@storybook/blocks": "7.0.12",
"@storybook/core-events": "7.0.12",
"@storybook/addon-actions": "7.0.15",
"@storybook/addon-essentials": "7.0.15",
"@storybook/addon-interactions": "7.0.15",
"@storybook/addon-links": "7.0.15",
"@storybook/addon-storysource": "7.0.15",
"@storybook/addons": "7.0.15",
"@storybook/blocks": "7.0.15",
"@storybook/core-events": "7.0.15",
"@storybook/jest": "0.1.0",
"@storybook/manager-api": "7.0.12",
"@storybook/preview-api": "7.0.12",
"@storybook/react": "7.0.12",
"@storybook/react-vite": "7.0.12",
"@storybook/manager-api": "7.0.15",
"@storybook/preview-api": "7.0.15",
"@storybook/react": "7.0.15",
"@storybook/react-vite": "7.0.15",
"@storybook/testing-library": "0.1.0",
"@storybook/theming": "7.0.12",
"@storybook/types": "7.0.12",
"@storybook/vue3": "7.0.12",
"@storybook/vue3-vite": "7.0.12",
"@storybook/theming": "7.0.15",
"@storybook/types": "7.0.15",
"@storybook/vue3": "7.0.15",
"@storybook/vue3-vite": "7.0.15",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/vue": "7.0.0",
"@types/escape-regexp": "0.0.1",
"@types/estree": "1.0.1",
"@types/gulp": "4.0.10",
"@types/gulp-rename": "2.0.2",
"@types/matter-js": "0.18.3",
"@types/matter-js": "0.18.4",
"@types/micromatch": "4.0.2",
"@types/node": "20.2.1",
"@types/node": "20.2.3",
"@types/punycode": "2.1.0",
"@types/sanitize-html": "2.9.0",
"@types/seedrandom": "3.0.5",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/testing-library__jest-dom": "^5.14.6",
"@types/throttle-debounce": "5.0.0",
"@types/tinycolor2": "1.4.3",
"@types/uuid": "9.0.1",
@ -118,13 +118,13 @@
"@typescript-eslint/parser": "5.59.5",
"@vitest/coverage-c8": "0.31.1",
"@vue/runtime-core": "3.3.4",
"astring": "1.8.4",
"astring": "1.8.5",
"chokidar-cli": "3.0.0",
"cross-env": "7.0.3",
"cypress": "12.12.0",
"cypress": "12.13.0",
"eslint": "8.40.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-vue": "9.13.0",
"eslint-plugin-vue": "9.14.0",
"fast-glob": "3.2.12",
"happy-dom": "9.19.2",
"micromatch": "3.1.10",
@ -134,7 +134,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"start-server-and-test": "2.0.0",
"storybook": "7.0.12",
"storybook": "7.0.15",
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
"summaly": "github:misskey-dev/summaly",
"vite-plugin-turbosnap": "1.0.2",

View file

@ -5,7 +5,9 @@ import '@/style.scss';
import { mainBoot } from './boot/main-boot';
import { subBoot } from './boot/sub-boot';
if (['/share', '/auth', '/miauth'].includes(location.pathname)) {
const subBootPaths = ['/share', '/auth', '/miauth', '/signup-complete'];
if (subBootPaths.some(i => location.pathname === i || location.pathname.startsWith(i + '/'))) {
subBoot();
} else {
mainBoot();

View file

@ -1,16 +1,16 @@
<template>
<div v-show="props.modelValue.length != 0" class="skeikyzd">
<Sortable :modelValue="props.modelValue" class="files" itemKey="id" :animation="150" :delay="100" :delayOnTouchOnly="true" @update:modelValue="v => emit('update:modelValue', v)">
<div v-show="props.modelValue.length != 0" :class="$style.root">
<Sortable :modelValue="props.modelValue" :class="$style.files" itemKey="id" :animation="150" :delay="100" :delayOnTouchOnly="true" @update:modelValue="v => emit('update:modelValue', v)">
<template #item="{element}">
<div class="file" @click="showFileMenu(element, $event)" @contextmenu.prevent="showFileMenu(element, $event)">
<MkDriveFileThumbnail :data-id="element.id" class="thumbnail" :file="element" fit="cover"/>
<div v-if="element.isSensitive" class="sensitive">
<i class="ti ti-alert-triangle icon"></i>
<div :class="$style.file" @click="showFileMenu(element, $event)" @contextmenu.prevent="showFileMenu(element, $event)">
<MkDriveFileThumbnail :data-id="element.id" :class="$style.thumbnail" :file="element" fit="cover"/>
<div v-if="element.isSensitive" :class="$style.sensitive">
<i class="ti ti-alert-triangle" style="margin: auto;"></i>
</div>
</div>
</template>
</Sortable>
<p class="remain">{{ 16 - props.modelValue.length }}/16</p>
<p :class="$style.remain">{{ 16 - props.modelValue.length }}/16</p>
</div>
</template>
@ -108,60 +108,53 @@ function showFileMenu(file, ev: MouseEvent) {
}
</script>
<style lang="scss" scoped>
.skeikyzd {
<style lang="scss" module>
.root {
padding: 8px 16px;
position: relative;
}
> .files {
display: flex;
flex-wrap: wrap;
.files {
display: flex;
flex-wrap: wrap;
}
> .file {
position: relative;
width: 64px;
height: 64px;
margin-right: 4px;
border-radius: 4px;
overflow: hidden;
cursor: move;
.file {
position: relative;
width: 64px;
height: 64px;
margin-right: 4px;
border-radius: 4px;
overflow: hidden;
cursor: move;
}
&:hover > .remove {
display: block;
}
.thumbnail {
width: 100%;
height: 100%;
z-index: 1;
color: var(--fg);
}
> .thumbnail {
width: 100%;
height: 100%;
z-index: 1;
color: var(--fg);
}
.sensitive {
display: flex;
position: absolute;
width: 64px;
height: 64px;
top: 0;
left: 0;
z-index: 2;
background: rgba(17, 17, 17, .7);
color: #fff;
}
> .sensitive {
display: flex;
position: absolute;
width: 64px;
height: 64px;
top: 0;
left: 0;
z-index: 2;
background: rgba(17, 17, 17, .7);
color: #fff;
> .icon {
margin: auto;
}
}
}
}
> .remain {
display: block;
position: absolute;
top: 8px;
right: 8px;
margin: 0;
padding: 0;
}
.remain {
display: block;
position: absolute;
top: 8px;
right: 8px;
margin: 0;
padding: 0;
font-size: 90%;
}
</style>

View file

@ -1,37 +1,83 @@
<template>
<div>
{{ i18n.ts.processing }}
<div :class="$style.root">
<MkAnimBg style="position: fixed; top: 0;"/>
<div :class="$style.formContainer">
<form :class="$style.form" class="_panel" @submit.prevent="submit()">
<div :class="$style.banner">
<i class="ti ti-user-check"></i>
</div>
<div class="_gaps_m" style="padding: 32px;">
<div>{{ i18n.t('clickToFinishEmailVerification', { ok: i18n.ts.gotIt }) }}</div>
<div>
<MkButton gradate large rounded type="submit" :disabled="submitting" data-cy-admin-ok style="margin: 0 auto;">
{{ submitting ? i18n.ts.processing : i18n.ts.gotIt }}<MkEllipsis v-if="submitting"/>
</MkButton>
</div>
</div>
</form>
</div>
</div>
</template>
<script lang="ts" setup>
import { onMounted } from 'vue';
import * as os from '@/os';
import { } from 'vue';
import MkButton from '@/components/MkButton.vue';
import MkAnimBg from '@/components/MkAnimBg.vue';
import { login } from '@/account';
import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata';
import * as os from '@/os';
let submitting = $ref(false);
const props = defineProps<{
code: string;
}>();
onMounted(async () => {
await os.alert({
type: 'info',
text: i18n.t('clickToFinishEmailVerification', { ok: i18n.ts.gotIt }),
});
const res = await os.apiWithDialog('signup-pending', {
function submit() {
if (submitting) return;
submitting = true;
os.api('signup-pending', {
code: props.code,
}).then(res => {
return login(res.i, '/');
}).catch(() => {
submitting = false;
os.alert({
type: 'error',
text: i18n.ts.somethingHappened,
});
});
login(res.i, '/');
});
const headerActions = $computed(() => []);
const headerTabs = $computed(() => []);
definePageMetadata({
title: i18n.ts.signup,
icon: 'ti ti-user',
});
}
</script>
<style lang="scss" module>
.root {
}
.formContainer {
min-height: 100svh;
padding: 32px 32px 64px 32px;
box-sizing: border-box;
display: grid;
place-content: center;
}
.form {
position: relative;
z-index: 10;
border-radius: var(--radius);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
overflow: clip;
max-width: 500px;
}
.banner {
padding: 16px;
text-align: center;
font-size: 26px;
background-color: var(--accentedBg);
color: var(--accent);
}
</style>

View file

@ -72,7 +72,3 @@ defineExpose<WidgetComponentExpose>({
id: props.widget ? props.widget.id : null,
});
</script>
<style lang="scss" scoped>
</style>

View file

@ -1,8 +1,10 @@
<template>
<div data-cy-mkw-onlineUsers class="mkw-onlineUsers" :class="{ _panel: !widgetProps.transparent, pad: !widgetProps.transparent }">
<I18n v-if="onlineUsersCount" :src="i18n.ts.onlineUsersCount" textTag="span" class="text">
<template #n><b>{{ number(onlineUsersCount) }}</b></template>
</I18n>
<div data-cy-mkw-onlineUsers :class="[$style.root, { _panel: !widgetProps.transparent, [$style.pad]: !widgetProps.transparent }]">
<span :class="$style.text">
<I18n v-if="onlineUsersCount" :src="i18n.ts.onlineUsersCount" textTag="span">
<template #n><b style="color: #41b781;">{{ number(onlineUsersCount) }}</b></template>
</I18n>
</span>
</div>
</template>
@ -55,22 +57,16 @@ defineExpose<WidgetComponentExpose>({
});
</script>
<style lang="scss" scoped>
.mkw-onlineUsers {
<style lang="scss" module>
.root {
text-align: center;
&.pad {
padding: 16px 0;
}
}
> .text {
::v-deep(b) {
color: #41b781;
}
::v-deep(span) {
opacity: 0.7;
}
}
.text {
color: var(--fgTransparentWeak);
}
</style>

File diff suppressed because it is too large Load diff