1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-22 15:14:16 +02:00

refactor(frontend): ID生成処理を統一

This commit is contained in:
syuilo
2025-06-03 07:37:08 +09:00
parent 3bc81522c6
commit 93d17aff6c
16 changed files with 35 additions and 20 deletions

View File

@@ -97,6 +97,7 @@ import { i18n } from '@/i18n.js';
import { definePage } from '@/page.js';
import MkFolder from '@/components/MkFolder.vue';
import MkTextarea from '@/components/MkTextarea.vue';
import { genId } from '@/utility/id.js';
const announcementsStatus = ref<'active' | 'archived'>('active');
@@ -117,7 +118,7 @@ watch(announcementsStatus, (to) => {
function add() {
announcements.value.unshift({
_id: Math.random().toString(36),
_id: genId(),
id: null,
title: 'New announcement',
text: '',

View File

@@ -57,6 +57,7 @@ import { misskeyApi } from '@/utility/misskey-api.js';
import { useStream } from '@/stream.js';
import { i18n } from '@/i18n.js';
import MkFolder from '@/components/MkFolder.vue';
import { genId } from '@/utility/id.js';
const connection = markRaw(useStream().useChannel('queueStats'));
@@ -113,7 +114,7 @@ onMounted(() => {
connection.on('stats', onStats);
connection.on('statsLog', onStatsLog);
connection.send('requestLog', {
id: Math.random().toString().substring(2, 10),
id: genId(),
length: 200,
});
});

View File

@@ -41,6 +41,7 @@ import XChart from './overview.queue.chart.vue';
import type { ApQueueDomain } from '@/pages/admin/queue.vue';
import number from '@/filters/number.js';
import { useStream } from '@/stream.js';
import { genId } from '@/utility/id.js';
const connection = markRaw(useStream().useChannel('queueStats'));
@@ -92,7 +93,7 @@ onMounted(() => {
connection.on('stats', onStats);
connection.on('statsLog', onStatsLog);
connection.send('requestLog', {
id: Math.random().toString().substring(2, 10),
id: genId(),
length: 100,
});
});

View File

@@ -84,6 +84,7 @@ import { useStream } from '@/stream.js';
import { i18n } from '@/i18n.js';
import { definePage } from '@/page.js';
import MkFoldableSection from '@/components/MkFoldableSection.vue';
import { genId } from '@/utility/id.js';
const rootEl = useTemplateRef('rootEl');
const serverInfo = ref<Misskey.entities.ServerInfoResponse | null>(null);
@@ -170,7 +171,7 @@ onMounted(async () => {
nextTick(() => {
queueStatsConnection.send('requestLog', {
id: Math.random().toString().substring(2, 10),
id: genId(),
length: 100,
});
});