mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-08 22:03:09 +02:00
enhance: PWAのshort_nameを設定可能に
This commit is contained in:
parent
063d24ad4f
commit
8f77350089
11 changed files with 39 additions and 2 deletions
|
@ -30,6 +30,7 @@
|
|||
- Feat: プロフィールでのリンク検証
|
||||
- Feat: 通知をテストできるようになりました
|
||||
- Feat: PWAのアイコンが設定できるようになりました
|
||||
- Enhance: サーバー名の略称が設定できるようになりました
|
||||
- Enhance: アンテナの受信ソースに指定したユーザを除外するものを追加
|
||||
- Enhance: 二要素認証設定時のセキュリティを強化
|
||||
- パスワード入力が必要な操作を行う際、二要素認証が有効であれば確認コードの入力も必要になりました
|
||||
|
|
2
locales/index.d.ts
vendored
2
locales/index.d.ts
vendored
|
@ -1158,6 +1158,8 @@ export interface Locale {
|
|||
"appIconStyleRecommendation": string;
|
||||
"appIconResolutionMustBe": string;
|
||||
"manifestJsonOverride": string;
|
||||
"shortName": string;
|
||||
"shortNameDescription": string;
|
||||
};
|
||||
"_accountMigration": {
|
||||
"moveFrom": string;
|
||||
|
|
|
@ -1156,6 +1156,8 @@ _serverSettings:
|
|||
appIconStyleRecommendation: "円形もしくは角丸にクロップされる場合があるため、塗り潰された余白のある背景を持つことが推奨されます。"
|
||||
appIconResolutionMustBe: "解像度は必ず{resolution}である必要があります。"
|
||||
manifestJsonOverride: "manifest.jsonのオーバーライド"
|
||||
shortName: "略称"
|
||||
shortNameDescription: "サーバーの正式名称が長い場合に、代わりに表示することのできる略称や通称。"
|
||||
|
||||
_accountMigration:
|
||||
moveFrom: "別のアカウントからこのアカウントに移行"
|
||||
|
|
11
packages/backend/migration/1695440131671-short-name.js
Normal file
11
packages/backend/migration/1695440131671-short-name.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
export class ShortName1695440131671 {
|
||||
name = 'ShortName1695440131671'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "shortName" character varying(64)`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "shortName"`);
|
||||
}
|
||||
}
|
|
@ -20,6 +20,11 @@ export class MiMeta {
|
|||
})
|
||||
public name: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true,
|
||||
})
|
||||
public shortName: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 1024, nullable: true,
|
||||
})
|
||||
|
|
|
@ -321,6 +321,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
maintainerEmail: instance.maintainerEmail,
|
||||
version: this.config.version,
|
||||
name: instance.name,
|
||||
shortName: instance.shortName,
|
||||
uri: this.config.url,
|
||||
description: instance.description,
|
||||
langs: instance.langs,
|
||||
|
|
|
@ -44,6 +44,7 @@ export const paramDef = {
|
|||
backgroundImageUrl: { type: 'string', nullable: true },
|
||||
logoImageUrl: { type: 'string', nullable: true },
|
||||
name: { type: 'string', nullable: true },
|
||||
shortName: { type: 'string', nullable: true },
|
||||
description: { type: 'string', nullable: true },
|
||||
defaultLightTheme: { type: 'string', nullable: true },
|
||||
defaultDarkTheme: { type: 'string', nullable: true },
|
||||
|
@ -188,6 +189,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
set.name = ps.name;
|
||||
}
|
||||
|
||||
if (ps.shortName !== undefined) {
|
||||
set.shortName = ps.shortName;
|
||||
}
|
||||
|
||||
if (ps.description !== undefined) {
|
||||
set.description = ps.description;
|
||||
}
|
||||
|
|
|
@ -114,10 +114,10 @@ export class ClientServerService {
|
|||
let manifest = {
|
||||
// 空文字列の場合右辺を使いたいため
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||
'short_name': instance.name || 'Misskey',
|
||||
'short_name': instance.shortName || instance.name || this.config.host,
|
||||
// 空文字列の場合右辺を使いたいため
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||
'name': instance.name || 'Misskey',
|
||||
'name': instance.name || this.config.host,
|
||||
'start_url': '/',
|
||||
'display': 'standalone',
|
||||
'background_color': '#313a42',
|
||||
|
|
|
@ -14,6 +14,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template #label>{{ i18n.ts.instanceName }}</template>
|
||||
</MkInput>
|
||||
|
||||
<MkInput v-model="shortName">
|
||||
<template #label>{{ i18n.ts._serverSettings.shortName }} ({{ i18n.ts.optional }})</template>
|
||||
<template #caption>{{ i18n.ts._serverSettings.shortNameDescription }}</template>
|
||||
</MkInput>
|
||||
|
||||
<MkTextarea v-model="description">
|
||||
<template #label>{{ i18n.ts.instanceDescription }}</template>
|
||||
</MkTextarea>
|
||||
|
@ -118,6 +123,7 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|||
import MkButton from '@/components/MkButton.vue';
|
||||
|
||||
let name: string | null = $ref(null);
|
||||
let shortName: string | null = $ref(null);
|
||||
let description: string | null = $ref(null);
|
||||
let maintainerName: string | null = $ref(null);
|
||||
let maintainerEmail: string | null = $ref(null);
|
||||
|
@ -133,6 +139,7 @@ let deeplIsPro: boolean = $ref(false);
|
|||
async function init(): Promise<void> {
|
||||
const meta = await os.api('admin/meta');
|
||||
name = meta.name;
|
||||
shortName = meta.shortName;
|
||||
description = meta.description;
|
||||
maintainerName = meta.maintainerName;
|
||||
maintainerEmail = meta.maintainerEmail;
|
||||
|
@ -149,6 +156,7 @@ async function init(): Promise<void> {
|
|||
function save(): void {
|
||||
os.apiWithDialog('admin/update-meta', {
|
||||
name,
|
||||
shortName: shortName === '' ? null : shortName,
|
||||
description,
|
||||
maintainerName,
|
||||
maintainerEmail,
|
||||
|
|
|
@ -2404,6 +2404,7 @@ type LiteInstanceMetadata = {
|
|||
maintainerEmail: string | null;
|
||||
version: string;
|
||||
name: string | null;
|
||||
shortName: string | null;
|
||||
uri: string;
|
||||
description: string | null;
|
||||
langs: string[];
|
||||
|
|
|
@ -298,6 +298,7 @@ export type LiteInstanceMetadata = {
|
|||
maintainerEmail: string | null;
|
||||
version: string;
|
||||
name: string | null;
|
||||
shortName: string | null;
|
||||
uri: string;
|
||||
description: string | null;
|
||||
langs: string[];
|
||||
|
|
Loading…
Reference in a new issue