misskey-js側で手動定義されていた型を自動生成された型に移行(ただしapi.jsonがvalidでなくなってしまったので後で修正する)
This commit is contained in:
parent
62e15ab1f1
commit
0874bd91ba
|
|
@ -36,6 +36,9 @@ import { packedGalleryPostSchema } from '@/models/json-schema/gallery-post.js';
|
|||
import { packedEmojiDetailedSchema, packedEmojiSimpleSchema } from '@/models/json-schema/emoji.js';
|
||||
import { packedFlashSchema } from '@/models/json-schema/flash.js';
|
||||
import { packedAnnouncementSchema } from '@/models/json-schema/announcement.js';
|
||||
import { enumUserOriginSchema } from '@/models/json-schema/enum-user-origin.js';
|
||||
import { enumUserSortingSchema } from '@/models/json-schema/enum-user-sorting.js';
|
||||
import { enumNotificationTypeSchema } from '@/models/json-schema/enum-notification-type.js';
|
||||
|
||||
export const refs = {
|
||||
UserLite: packedUserLiteSchema,
|
||||
|
|
@ -71,6 +74,11 @@ export const refs = {
|
|||
EmojiSimple: packedEmojiSimpleSchema,
|
||||
EmojiDetailed: packedEmojiDetailedSchema,
|
||||
Flash: packedFlashSchema,
|
||||
|
||||
// enum
|
||||
UserOrigin: enumUserOriginSchema,
|
||||
UserSorting: enumUserSortingSchema,
|
||||
NotificationType: enumNotificationTypeSchema,
|
||||
};
|
||||
|
||||
export type Packed<x extends keyof typeof refs> = SchemaType<typeof refs[x]>;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { notificationTypes } from '@/types.js';
|
||||
|
||||
export const enumNotificationTypeSchema = {
|
||||
type: 'string',
|
||||
enum: [...notificationTypes, 'reaction:grouped', 'renote:grouped'],
|
||||
} as const;
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export const enumUserOriginSchema = {
|
||||
type: 'string',
|
||||
enum: ['combined', 'local', 'remote'],
|
||||
} as const;
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export const enumUserSortingSchema = {
|
||||
type: 'string',
|
||||
enum: [
|
||||
'+follower',
|
||||
'-follower',
|
||||
'+createdAt',
|
||||
'-createdAt',
|
||||
'+updatedAt',
|
||||
'-updatedAt',
|
||||
],
|
||||
} as const;
|
||||
|
|
@ -21,7 +21,7 @@ export const packedNotificationSchema = {
|
|||
type: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
enum: [...notificationTypes, 'reaction:grouped', 'renote:grouped'],
|
||||
ref: 'NotificationType',
|
||||
},
|
||||
user: {
|
||||
type: 'object',
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ export const paramDef = {
|
|||
sinceId: { type: 'string', format: 'misskey:id' },
|
||||
untilId: { type: 'string', format: 'misskey:id' },
|
||||
state: { type: 'string', nullable: true, default: null },
|
||||
reporterOrigin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' },
|
||||
targetUserOrigin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' },
|
||||
reporterOrigin: { type: 'string', ref: 'UserOrigin', default: 'combined' },
|
||||
targetUserOrigin: { type: 'string', ref: 'UserOrigin', default: 'combined' },
|
||||
forwarded: { type: 'boolean', default: false },
|
||||
},
|
||||
required: [],
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export const paramDef = {
|
|||
untilId: { type: 'string', format: 'misskey:id' },
|
||||
userId: { type: 'string', format: 'misskey:id', nullable: true },
|
||||
type: { type: 'string', nullable: true, pattern: /^[a-zA-Z0-9\/\-*]+$/.toString().slice(1, -1) },
|
||||
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'local' },
|
||||
origin: { type: 'string', ref: 'UserOrigin', default: 'local' },
|
||||
hostname: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
|
|
|
|||
|
|
@ -327,6 +327,82 @@ export const meta = {
|
|||
type: 'number',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
backgroundImageUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
deeplAuthKey: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
deeplIsPro: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
defaultDarkTheme: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
defaultLightTheme: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
disableRegistration: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
impressumUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
maintainerEmail: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
maintainerName: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
objectStorageS3ForcePathStyle: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
privacyPolicyUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
repositoryUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
summalyProxy: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
themeColor: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
tosUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
uri: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
version: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export const paramDef = {
|
|||
offset: { type: 'integer', default: 0 },
|
||||
sort: { type: 'string', enum: ['+follower', '-follower', '+createdAt', '-createdAt', '+updatedAt', '-updatedAt', '+lastActiveDate', '-lastActiveDate'] },
|
||||
state: { type: 'string', enum: ['all', 'alive', 'available', 'admin', 'moderator', 'adminOrModerator', 'suspended'], default: 'all' },
|
||||
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' },
|
||||
origin: { type: 'string', ref: 'UserOrigin', default: 'combined' },
|
||||
username: { type: 'string', nullable: true, default: null },
|
||||
hostname: {
|
||||
type: 'string',
|
||||
|
|
|
|||
|
|
@ -36,13 +36,32 @@ export const paramDef = {
|
|||
blocked: { type: 'boolean', nullable: true },
|
||||
notResponding: { type: 'boolean', nullable: true },
|
||||
suspended: { type: 'boolean', nullable: true },
|
||||
silenced: { type: "boolean", nullable: true },
|
||||
silenced: { type: 'boolean', nullable: true },
|
||||
federating: { type: 'boolean', nullable: true },
|
||||
subscribing: { type: 'boolean', nullable: true },
|
||||
publishing: { type: 'boolean', nullable: true },
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 },
|
||||
offset: { type: 'integer', default: 0 },
|
||||
sort: { type: 'string' },
|
||||
sort: {
|
||||
type: 'string',
|
||||
optional: true, nullable: true,
|
||||
enum: [
|
||||
'+pubSub',
|
||||
'-pubSub',
|
||||
'+notes',
|
||||
'-notes',
|
||||
'+users',
|
||||
'-users',
|
||||
'+following',
|
||||
'-following',
|
||||
'+followers',
|
||||
'-followers',
|
||||
'+firstRetrievedAt',
|
||||
'-firstRetrievedAt',
|
||||
'+latestRequestReceivedAt',
|
||||
'-latestRequestReceivedAt',
|
||||
],
|
||||
},
|
||||
},
|
||||
required: [],
|
||||
} as const;
|
||||
|
|
@ -103,18 +122,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}
|
||||
}
|
||||
|
||||
if (typeof ps.silenced === "boolean") {
|
||||
if (typeof ps.silenced === 'boolean') {
|
||||
const meta = await this.metaService.fetch(true);
|
||||
|
||||
if (ps.silenced) {
|
||||
if (meta.silencedHosts.length === 0) {
|
||||
return [];
|
||||
}
|
||||
query.andWhere("instance.host IN (:...silences)", {
|
||||
query.andWhere('instance.host IN (:...silences)', {
|
||||
silences: meta.silencedHosts,
|
||||
});
|
||||
} else if (meta.silencedHosts.length > 0) {
|
||||
query.andWhere("instance.host NOT IN (:...silences)", {
|
||||
query.andWhere('instance.host NOT IN (:...silences)', {
|
||||
silences: meta.silencedHosts,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ export const paramDef = {
|
|||
properties: {
|
||||
tag: { type: 'string' },
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||
sort: { type: 'string', enum: ['+follower', '-follower', '+createdAt', '-createdAt', '+updatedAt', '-updatedAt'] },
|
||||
sort: { type: 'string', ref: 'UserSorting' },
|
||||
state: { type: 'string', enum: ['all', 'alive'], default: 'all' },
|
||||
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'local' },
|
||||
origin: { type: 'string', ref: 'UserOrigin', default: 'local' },
|
||||
},
|
||||
required: ['tag', 'sort'],
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ export const meta = {
|
|||
items: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'InviteCode',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -250,6 +250,33 @@ export const meta = {
|
|||
},
|
||||
},
|
||||
},
|
||||
backgroundImageUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
impressumUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
logoImageUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
privacyPolicyUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
serverRules: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
themeColor: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ export const paramDef = {
|
|||
properties: {
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||
offset: { type: 'integer', default: 0 },
|
||||
sort: { type: 'string', enum: ['+follower', '-follower', '+createdAt', '-createdAt', '+updatedAt', '-updatedAt'] },
|
||||
sort: { type: 'string', ref: 'UserSorting' },
|
||||
state: { type: 'string', enum: ['all', 'alive'], default: 'all' },
|
||||
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'local' },
|
||||
origin: { type: 'string', ref: 'UserOrigin', default: 'local' },
|
||||
hostname: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export const paramDef = {
|
|||
query: { type: 'string' },
|
||||
offset: { type: 'integer', default: 0 },
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||
origin: { type: 'string', enum: ['local', 'remote', 'combined'], default: 'combined' },
|
||||
origin: { type: 'string', ref: 'UserOrigin', default: 'combined' },
|
||||
detail: { type: 'boolean', default: true },
|
||||
},
|
||||
required: ['query'],
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ const size = computed(() => props.asReactionPicker ? reactionPickerSize.value :
|
|||
const width = computed(() => props.asReactionPicker ? reactionPickerWidth.value : 3);
|
||||
const height = computed(() => props.asReactionPicker ? reactionPickerHeight.value : 2);
|
||||
const q = ref<string>('');
|
||||
const searchResultCustom = ref<Misskey.entities.CustomEmoji[]>([]);
|
||||
const searchResultCustom = ref<Misskey.entities.EmojiSimple[]>([]);
|
||||
const searchResultUnicode = ref<UnicodeEmojiDef[]>([]);
|
||||
const tab = ref<'index' | 'custom' | 'unicode' | 'tags'>('index');
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ watch(q, () => {
|
|||
const searchCustom = () => {
|
||||
const max = 100;
|
||||
const emojis = customEmojis.value;
|
||||
const matches = new Set<Misskey.entities.CustomEmoji>();
|
||||
const matches = new Set<Misskey.entities.EmojiSimple>();
|
||||
|
||||
const exactMatch = emojis.find(emoji => emoji.name === newQ);
|
||||
if (exactMatch) matches.add(exactMatch);
|
||||
|
|
@ -288,7 +288,7 @@ watch(q, () => {
|
|||
searchResultUnicode.value = Array.from(searchUnicode());
|
||||
});
|
||||
|
||||
function filterAvailable(emoji: Misskey.entities.CustomEmoji): boolean {
|
||||
function filterAvailable(emoji: Misskey.entities.EmojiSimple): boolean {
|
||||
return (emoji.roleIdsThatCanBeUsedThisEmojiAsReaction == null || emoji.roleIdsThatCanBeUsedThisEmojiAsReaction.length === 0) || ($i && $i.roles.some(r => emoji.roleIdsThatCanBeUsedThisEmojiAsReaction.includes(r.id)));
|
||||
}
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ function reset() {
|
|||
q.value = '';
|
||||
}
|
||||
|
||||
function getKey(emoji: string | Misskey.entities.CustomEmoji | UnicodeEmojiDef): string {
|
||||
function getKey(emoji: string | Misskey.entities.EmojiSimple | UnicodeEmojiDef): string {
|
||||
return typeof emoji === 'string' ? emoji : 'char' in emoji ? emoji.char : `:${emoji.name}:`;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,15 +21,15 @@ import * as os from '@/os.js';
|
|||
import { getProxiedImageUrlNullable } from '@/scripts/media-proxy.js';
|
||||
|
||||
const props = defineProps<{
|
||||
instance: Misskey.entities.Instance;
|
||||
instance: Misskey.entities.FederationInstance;
|
||||
}>();
|
||||
|
||||
let chartValues = $ref<number[] | null>(null);
|
||||
|
||||
os.apiGet('charts/instance', { host: props.instance.host, limit: 16 + 1, span: 'day' }).then(res => {
|
||||
// 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く
|
||||
res.requests.received.splice(0, 1);
|
||||
chartValues = res.requests.received;
|
||||
res['requests.received'].splice(0, 1);
|
||||
chartValues = res['requests.received'];
|
||||
});
|
||||
|
||||
function getInstanceIcon(instance): string {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ import { i18n } from '@/i18n.js';
|
|||
import * as os from '@/os.js';
|
||||
|
||||
const props = defineProps<{
|
||||
invite: Misskey.entities.Invite;
|
||||
invite: Misskey.entities.InviteCode;
|
||||
moderator?: boolean;
|
||||
}>();
|
||||
|
||||
|
|
|
|||
|
|
@ -67,15 +67,14 @@ import number from '@/filters/number.js';
|
|||
import MkNumber from '@/components/MkNumber.vue';
|
||||
import XActiveUsersChart from '@/components/MkVisitorDashboard.ActiveUsersChart.vue';
|
||||
|
||||
let meta = $ref<Misskey.entities.Instance>();
|
||||
let stats = $ref(null);
|
||||
let meta = $ref<Misskey.entities.MetaResponse | null>(null);
|
||||
let stats = $ref<Misskey.entities.StatsResponse | null>(null);
|
||||
|
||||
os.api('meta', { detail: true }).then(_meta => {
|
||||
meta = _meta;
|
||||
});
|
||||
|
||||
os.api('stats', {
|
||||
}).then((res) => {
|
||||
os.api('stats', {}).then((res) => {
|
||||
stats = res;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { useStream } from '@/stream.js';
|
|||
import { get, set } from '@/scripts/idb-proxy.js';
|
||||
|
||||
const storageCache = await get('emojis');
|
||||
export const customEmojis = shallowRef<Misskey.entities.CustomEmoji[]>(Array.isArray(storageCache) ? storageCache : []);
|
||||
export const customEmojis = shallowRef<Misskey.entities.EmojiSimple[]>(Array.isArray(storageCache) ? storageCache : []);
|
||||
export const customEmojiCategories = computed<[ ...string[], null ]>(() => {
|
||||
const categories = new Set<string>();
|
||||
for (const emoji of customEmojis.value) {
|
||||
|
|
@ -21,7 +21,7 @@ export const customEmojiCategories = computed<[ ...string[], null ]>(() => {
|
|||
return markRaw([...Array.from(categories), null]);
|
||||
});
|
||||
|
||||
export const customEmojisMap = new Map<string, Misskey.entities.CustomEmoji>();
|
||||
export const customEmojisMap = new Map<string, Misskey.entities.EmojiSimple>();
|
||||
watch(customEmojis, emojis => {
|
||||
customEmojisMap.clear();
|
||||
for (const emoji of emojis) {
|
||||
|
|
@ -38,7 +38,7 @@ stream.on('emojiAdded', emojiData => {
|
|||
});
|
||||
|
||||
stream.on('emojiUpdated', emojiData => {
|
||||
customEmojis.value = customEmojis.value.map(item => emojiData.emojis.find(search => search.name === item.name) as Misskey.entities.CustomEmoji ?? item);
|
||||
customEmojis.value = customEmojis.value.map(item => emojiData.emojis.find(search => search.name === item.name) as Misskey.entities.EmojiSimple ?? item);
|
||||
set('emojis', customEmojis.value);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const cached = miLocalStorage.getItem('instance');
|
|||
|
||||
// TODO: instanceをリアクティブにするかは再考の余地あり
|
||||
|
||||
export const instance: Misskey.entities.InstanceMetadata = reactive(cached ? JSON.parse(cached) : {
|
||||
export const instance: Misskey.entities.MetaResponse = reactive(cached ? JSON.parse(cached) : {
|
||||
// TODO: set default values
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ import { $i } from '@/account.js';
|
|||
|
||||
const customEmojiTags = getCustomEmojiTags();
|
||||
let q = $ref('');
|
||||
let searchEmojis = $ref<Misskey.entities.CustomEmoji[]>(null);
|
||||
let searchEmojis = $ref<Misskey.entities.EmojiSimple[]>(null);
|
||||
let selectedTags = $ref(new Set());
|
||||
|
||||
function search() {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import * as os from '@/os.js';
|
|||
import { i18n } from '@/i18n.js';
|
||||
|
||||
const props = defineProps<{
|
||||
session: Misskey.entities.AuthSession;
|
||||
session: Misskey.entities.AuthSessionShowResponse;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ const props = defineProps<{
|
|||
}>();
|
||||
|
||||
let state = $ref<'waiting' | 'accepted' | 'fetch-session-error' | 'denied' | null>(null);
|
||||
let session = $ref<Misskey.entities.AuthSession | null>(null);
|
||||
let session = $ref<Misskey.entities.AuthSessionShowResponse | null>(null);
|
||||
|
||||
function accepted() {
|
||||
state = 'accepted';
|
||||
|
|
|
|||
|
|
@ -144,8 +144,8 @@ const props = defineProps<{
|
|||
|
||||
let tab = $ref('overview');
|
||||
let chartSrc = $ref('instance-requests');
|
||||
let meta = $ref<Misskey.entities.AdminInstanceMetadata | null>(null);
|
||||
let instance = $ref<Misskey.entities.Instance | null>(null);
|
||||
let meta = $ref<Misskey.entities.AdminMetaResponse | null>(null);
|
||||
let instance = $ref<Misskey.entities.FederationInstance | null>(null);
|
||||
let suspended = $ref(false);
|
||||
let isBlocked = $ref(false);
|
||||
let isSilenced = $ref(false);
|
||||
|
|
@ -169,10 +169,10 @@ async function fetch(): Promise<void> {
|
|||
instance = await os.api('federation/show-instance', {
|
||||
host: props.host,
|
||||
});
|
||||
suspended = instance.isSuspended;
|
||||
isBlocked = instance.isBlocked;
|
||||
isSilenced = instance.isSilenced;
|
||||
faviconUrl = getProxiedImageUrlNullable(instance.faviconUrl, 'preview') ?? getProxiedImageUrlNullable(instance.iconUrl, 'preview');
|
||||
suspended = instance?.isSuspended ?? false;
|
||||
isBlocked = instance?.isBlocked ?? false;
|
||||
isSilenced = instance?.isSilenced ?? false;
|
||||
faviconUrl = getProxiedImageUrlNullable(instance?.faviconUrl, 'preview') ?? getProxiedImageUrlNullable(instance?.iconUrl, 'preview');
|
||||
}
|
||||
|
||||
async function toggleBlock(): Promise<void> {
|
||||
|
|
@ -188,8 +188,9 @@ async function toggleSilenced(): Promise<void> {
|
|||
if (!meta) throw new Error('No meta?');
|
||||
if (!instance) throw new Error('No instance?');
|
||||
const { host } = instance;
|
||||
const silencedHosts = meta.silencedHosts ?? [];
|
||||
await os.api('admin/update-meta', {
|
||||
silencedHosts: isSilenced ? meta.silencedHosts.concat([host]) : meta.silencedHosts.filter(x => x !== host),
|
||||
silencedHosts: isSilenced ? silencedHosts.concat([host]) : silencedHosts.filter(x => x !== host),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkPagination ref="pagingComponent" :pagination="pagination">
|
||||
<template #default="{ items }">
|
||||
<div class="_gaps_s">
|
||||
<MkInviteCode v-for="item in (items as Misskey.entities.Invite[])" :key="item.id" :invite="item" :onDeleted="deleted"/>
|
||||
<MkInviteCode v-for="item in (items as Misskey.entities.InviteCode[])" :key="item.id" :invite="item" :onDeleted="deleted"/>
|
||||
</div>
|
||||
</template>
|
||||
</MkPagination>
|
||||
|
|
|
|||
|
|
@ -48,11 +48,15 @@ import MkNumber from '@/components/MkNumber.vue';
|
|||
import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue';
|
||||
import { getProxiedImageUrl } from '@/scripts/media-proxy.js';
|
||||
|
||||
let meta = $ref<Misskey.entities.Instance>();
|
||||
let instances = $ref<any[]>();
|
||||
let meta = $ref<Misskey.entities.MetaResponse>();
|
||||
let instances = $ref<Misskey.entities.FederationInstance[]>();
|
||||
|
||||
function getInstanceIcon(instance): string {
|
||||
return getProxiedImageUrl(instance.iconUrl, 'preview');
|
||||
function getInstanceIcon(instance: Misskey.entities.FederationInstance): string {
|
||||
if (!instance.iconUrl) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return getProxiedImageUrl(instance.iconUrl, 'preview');
|
||||
}
|
||||
|
||||
os.api('meta', { detail: true }).then(_meta => {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ const props = defineProps<{
|
|||
refreshIntervalSec?: number;
|
||||
}>();
|
||||
|
||||
const instances = ref<Misskey.entities.Instance[]>([]);
|
||||
const instances = ref<Misskey.entities.FederationInstance[]>([]);
|
||||
const fetching = ref(true);
|
||||
let key = $ref(0);
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue