Merge remote-tracking branch 'upstream/develop' into refactor-frontend-types
This commit is contained in:
commit
0752ae4ae1
|
@ -16,6 +16,12 @@
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
- Enhance: ハッシュタグ入力時に、本文の末尾の行に何も書かれていない場合は新たにスペースを追加しないように
|
- Enhance: ハッシュタグ入力時に、本文の末尾の行に何も書かれていない場合は新たにスペースを追加しないように
|
||||||
|
- Fix: v2023.12.0で追加された「モデレーターがユーザーのアイコンもしくはバナー画像を未設定状態にできる機能」が管理画面上で正しく表示されていない問題を修正
|
||||||
|
- Enhance: チャンネルノートのピン留めをノートのメニューからできるよ
|
||||||
|
|
||||||
|
### Server
|
||||||
|
- Enhance: 連合先のレートリミットに引っかかった際にリトライするようになりました
|
||||||
|
- Enhance: ActivityPub Deliver queueでBodyを事前処理するように (#12916)
|
||||||
|
|
||||||
## 2023.12.2
|
## 2023.12.2
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ Also, the later tasks are more indefinite and are subject to change as developme
|
||||||
This is the phase we are at now. We need to make a high-maintenance environment that can withstand future development.
|
This is the phase we are at now. We need to make a high-maintenance environment that can withstand future development.
|
||||||
|
|
||||||
- ~~Make the number of type errors zero (backend)~~ → Done ✔️
|
- ~~Make the number of type errors zero (backend)~~ → Done ✔️
|
||||||
|
- Make the number of type errors zero (frontend)
|
||||||
- Improve CI
|
- Improve CI
|
||||||
- ~~Fix tests~~ → Done ✔️
|
- ~~Fix tests~~ → Done ✔️
|
||||||
- Fix random test failures - https://github.com/misskey-dev/misskey/issues/7985 and https://github.com/misskey-dev/misskey/issues/7986
|
- Fix random test failures - https://github.com/misskey-dev/misskey/issues/7985 and https://github.com/misskey-dev/misskey/issues/7986
|
||||||
|
|
|
@ -672,6 +672,7 @@ export interface Locale {
|
||||||
"other": string;
|
"other": string;
|
||||||
"regenerateLoginToken": string;
|
"regenerateLoginToken": string;
|
||||||
"regenerateLoginTokenDescription": string;
|
"regenerateLoginTokenDescription": string;
|
||||||
|
"theKeywordWhenSearchingForCustomEmoji": string;
|
||||||
"setMultipleBySeparatingWithSpace": string;
|
"setMultipleBySeparatingWithSpace": string;
|
||||||
"fileIdOrUrl": string;
|
"fileIdOrUrl": string;
|
||||||
"behavior": string;
|
"behavior": string;
|
||||||
|
|
|
@ -669,6 +669,7 @@ useGlobalSettingDesc: "オンにすると、アカウントの通知設定が使
|
||||||
other: "その他"
|
other: "その他"
|
||||||
regenerateLoginToken: "ログイントークンを再生成"
|
regenerateLoginToken: "ログイントークンを再生成"
|
||||||
regenerateLoginTokenDescription: "ログインに使用される内部トークンを再生成します。通常この操作を行う必要はありません。再生成すると、全てのデバイスでログアウトされます。"
|
regenerateLoginTokenDescription: "ログインに使用される内部トークンを再生成します。通常この操作を行う必要はありません。再生成すると、全てのデバイスでログアウトされます。"
|
||||||
|
theKeywordWhenSearchingForCustomEmoji: "カスタム絵文字を検索する時のキーワードになります。"
|
||||||
setMultipleBySeparatingWithSpace: "スペースで区切って複数設定できます。"
|
setMultipleBySeparatingWithSpace: "スペースで区切って複数設定できます。"
|
||||||
fileIdOrUrl: "ファイルIDまたはURL"
|
fileIdOrUrl: "ファイルIDまたはURL"
|
||||||
behavior: "動作"
|
behavior: "動作"
|
||||||
|
|
|
@ -16,6 +16,7 @@ import type { DbQueue, DeliverQueue, EndedPollNotificationQueue, InboxQueue, Obj
|
||||||
import type { DbJobData, DeliverJobData, RelationshipJobData, ThinUser } from '../queue/types.js';
|
import type { DbJobData, DeliverJobData, RelationshipJobData, ThinUser } from '../queue/types.js';
|
||||||
import type httpSignature from '@peertube/http-signature';
|
import type httpSignature from '@peertube/http-signature';
|
||||||
import type * as Bull from 'bullmq';
|
import type * as Bull from 'bullmq';
|
||||||
|
import { ApRequestCreator } from '@/core/activitypub/ApRequestService.js';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class QueueService {
|
export class QueueService {
|
||||||
|
@ -74,11 +75,15 @@ export class QueueService {
|
||||||
if (content == null) return null;
|
if (content == null) return null;
|
||||||
if (to == null) return null;
|
if (to == null) return null;
|
||||||
|
|
||||||
|
const contentBody = JSON.stringify(content);
|
||||||
|
const digest = ApRequestCreator.createDigest(contentBody);
|
||||||
|
|
||||||
const data: DeliverJobData = {
|
const data: DeliverJobData = {
|
||||||
user: {
|
user: {
|
||||||
id: user.id,
|
id: user.id,
|
||||||
},
|
},
|
||||||
content,
|
content: contentBody,
|
||||||
|
digest,
|
||||||
to,
|
to,
|
||||||
isSharedInbox,
|
isSharedInbox,
|
||||||
};
|
};
|
||||||
|
@ -103,6 +108,8 @@ export class QueueService {
|
||||||
@bindThis
|
@bindThis
|
||||||
public async deliverMany(user: ThinUser, content: IActivity | null, inboxes: Map<string, boolean>) {
|
public async deliverMany(user: ThinUser, content: IActivity | null, inboxes: Map<string, boolean>) {
|
||||||
if (content == null) return null;
|
if (content == null) return null;
|
||||||
|
const contentBody = JSON.stringify(content);
|
||||||
|
const digest = ApRequestCreator.createDigest(contentBody);
|
||||||
|
|
||||||
const opts = {
|
const opts = {
|
||||||
attempts: this.config.deliverJobMaxAttempts ?? 12,
|
attempts: this.config.deliverJobMaxAttempts ?? 12,
|
||||||
|
@ -117,7 +124,8 @@ export class QueueService {
|
||||||
name: d[0],
|
name: d[0],
|
||||||
data: {
|
data: {
|
||||||
user,
|
user,
|
||||||
content,
|
content: contentBody,
|
||||||
|
digest,
|
||||||
to: d[0],
|
to: d[0],
|
||||||
isSharedInbox: d[1],
|
isSharedInbox: d[1],
|
||||||
} as DeliverJobData,
|
} as DeliverJobData,
|
||||||
|
|
|
@ -97,6 +97,8 @@ export class ApInboxService {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof Error || typeof err === 'string') {
|
if (err instanceof Error || typeof err === 'string') {
|
||||||
this.logger.error(err);
|
this.logger.error(err);
|
||||||
|
} else {
|
||||||
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -256,7 +258,7 @@ export class ApInboxService {
|
||||||
|
|
||||||
const targetUri = getApId(activity.object);
|
const targetUri = getApId(activity.object);
|
||||||
|
|
||||||
this.announceNote(actor, activity, targetUri);
|
await this.announceNote(actor, activity, targetUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
@ -288,7 +290,7 @@ export class ApInboxService {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// 対象が4xxならスキップ
|
// 対象が4xxならスキップ
|
||||||
if (err instanceof StatusError) {
|
if (err instanceof StatusError) {
|
||||||
if (err.isClientError) {
|
if (!err.isRetryable) {
|
||||||
this.logger.warn(`Ignored announce target ${targetUri} - ${err.statusCode}`);
|
this.logger.warn(`Ignored announce target ${targetUri} - ${err.statusCode}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -373,7 +375,7 @@ export class ApInboxService {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isPost(object)) {
|
if (isPost(object)) {
|
||||||
this.createNote(resolver, actor, object, false, activity);
|
await this.createNote(resolver, actor, object, false, activity);
|
||||||
} else {
|
} else {
|
||||||
this.logger.warn(`Unknown type: ${getApType(object)}`);
|
this.logger.warn(`Unknown type: ${getApType(object)}`);
|
||||||
}
|
}
|
||||||
|
@ -404,7 +406,7 @@ export class ApInboxService {
|
||||||
await this.apNoteService.createNote(note, resolver, silent);
|
await this.apNoteService.createNote(note, resolver, silent);
|
||||||
return 'ok';
|
return 'ok';
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof StatusError && err.isClientError) {
|
if (err instanceof StatusError && !err.isRetryable) {
|
||||||
return `skip ${err.statusCode}`;
|
return `skip ${err.statusCode}`;
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw err;
|
||||||
|
|
|
@ -34,9 +34,9 @@ type PrivateKey = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export class ApRequestCreator {
|
export class ApRequestCreator {
|
||||||
static createSignedPost(args: { key: PrivateKey, url: string, body: string, additionalHeaders: Record<string, string> }): Signed {
|
static createSignedPost(args: { key: PrivateKey, url: string, body: string, digest?: string, additionalHeaders: Record<string, string> }): Signed {
|
||||||
const u = new URL(args.url);
|
const u = new URL(args.url);
|
||||||
const digestHeader = `SHA-256=${crypto.createHash('sha256').update(args.body).digest('base64')}`;
|
const digestHeader = args.digest ?? this.createDigest(args.body);
|
||||||
|
|
||||||
const request: Request = {
|
const request: Request = {
|
||||||
url: u.href,
|
url: u.href,
|
||||||
|
@ -59,6 +59,10 @@ export class ApRequestCreator {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static createDigest(body: string) {
|
||||||
|
return `SHA-256=${crypto.createHash('sha256').update(body).digest('base64')}`;
|
||||||
|
}
|
||||||
|
|
||||||
static createSignedGet(args: { key: PrivateKey, url: string, additionalHeaders: Record<string, string> }): Signed {
|
static createSignedGet(args: { key: PrivateKey, url: string, additionalHeaders: Record<string, string> }): Signed {
|
||||||
const u = new URL(args.url);
|
const u = new URL(args.url);
|
||||||
|
|
||||||
|
@ -145,8 +149,8 @@ export class ApRequestService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async signedPost(user: { id: MiUser['id'] }, url: string, object: unknown): Promise<void> {
|
public async signedPost(user: { id: MiUser['id'] }, url: string, object: unknown, digest?: string): Promise<void> {
|
||||||
const body = JSON.stringify(object);
|
const body = typeof object === 'string' ? object : JSON.stringify(object);
|
||||||
|
|
||||||
const keypair = await this.userKeypairService.getUserKeypair(user.id);
|
const keypair = await this.userKeypairService.getUserKeypair(user.id);
|
||||||
|
|
||||||
|
@ -157,6 +161,7 @@ export class ApRequestService {
|
||||||
},
|
},
|
||||||
url,
|
url,
|
||||||
body,
|
body,
|
||||||
|
digest,
|
||||||
additionalHeaders: {
|
additionalHeaders: {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -216,7 +216,7 @@ export class ApNoteService {
|
||||||
return { status: 'ok', res };
|
return { status: 'ok', res };
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return {
|
return {
|
||||||
status: (e instanceof StatusError && e.isClientError) ? 'permerror' : 'temperror',
|
status: (e instanceof StatusError && !e.isRetryable) ? 'permerror' : 'temperror',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -351,6 +351,7 @@ export class NoteEntityService implements OnModuleInit {
|
||||||
color: channel.color,
|
color: channel.color,
|
||||||
isSensitive: channel.isSensitive,
|
isSensitive: channel.isSensitive,
|
||||||
allowRenoteToExternal: channel.allowRenoteToExternal,
|
allowRenoteToExternal: channel.allowRenoteToExternal,
|
||||||
|
userId: channel.userId,
|
||||||
} : undefined,
|
} : undefined,
|
||||||
mentions: note.mentions.length > 0 ? note.mentions : undefined,
|
mentions: note.mentions.length > 0 ? note.mentions : undefined,
|
||||||
uri: note.uri ?? undefined,
|
uri: note.uri ?? undefined,
|
||||||
|
|
|
@ -71,8 +71,11 @@ export default class Logger {
|
||||||
let log = `${l} ${worker}\t[${contexts.join(' ')}]\t${m}`;
|
let log = `${l} ${worker}\t[${contexts.join(' ')}]\t${m}`;
|
||||||
if (envOption.withLogTime) log = chalk.gray(time) + ' ' + log;
|
if (envOption.withLogTime) log = chalk.gray(time) + ' ' + log;
|
||||||
|
|
||||||
console.log(important ? chalk.bold(log) : log);
|
const args: unknown[] = [important ? chalk.bold(log) : log];
|
||||||
if (level === 'error' && data) console.log(data);
|
if (data != null) {
|
||||||
|
args.push(data);
|
||||||
|
}
|
||||||
|
console.log(...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
|
|
@ -7,6 +7,7 @@ export class StatusError extends Error {
|
||||||
public statusCode: number;
|
public statusCode: number;
|
||||||
public statusMessage?: string;
|
public statusMessage?: string;
|
||||||
public isClientError: boolean;
|
public isClientError: boolean;
|
||||||
|
public isRetryable: boolean;
|
||||||
|
|
||||||
constructor(message: string, statusCode: number, statusMessage?: string) {
|
constructor(message: string, statusCode: number, statusMessage?: string) {
|
||||||
super(message);
|
super(message);
|
||||||
|
@ -14,5 +15,6 @@ export class StatusError extends Error {
|
||||||
this.statusCode = statusCode;
|
this.statusCode = statusCode;
|
||||||
this.statusMessage = statusMessage;
|
this.statusMessage = statusMessage;
|
||||||
this.isClientError = typeof this.statusCode === 'number' && this.statusCode >= 400 && this.statusCode < 500;
|
this.isClientError = typeof this.statusCode === 'number' && this.statusCode >= 400 && this.statusCode < 500;
|
||||||
|
this.isRetryable = !this.isClientError || this.statusCode === 429;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,6 +152,10 @@ export const packedNoteSchema = {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
|
userId: {
|
||||||
|
type: 'string',
|
||||||
|
optional: false, nullable: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
localOnly: {
|
localOnly: {
|
||||||
|
|
|
@ -72,7 +72,7 @@ export class DeliverProcessorService {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.apRequestService.signedPost(job.data.user, job.data.to, job.data.content);
|
await this.apRequestService.signedPost(job.data.user, job.data.to, job.data.content, job.data.digest);
|
||||||
|
|
||||||
// Update stats
|
// Update stats
|
||||||
this.federatedInstanceService.fetch(host).then(i => {
|
this.federatedInstanceService.fetch(host).then(i => {
|
||||||
|
@ -111,7 +111,7 @@ export class DeliverProcessorService {
|
||||||
|
|
||||||
if (res instanceof StatusError) {
|
if (res instanceof StatusError) {
|
||||||
// 4xx
|
// 4xx
|
||||||
if (res.isClientError) {
|
if (!res.isRetryable) {
|
||||||
// 相手が閉鎖していることを明示しているため、配送停止する
|
// 相手が閉鎖していることを明示しているため、配送停止する
|
||||||
if (job.data.isSharedInbox && res.statusCode === 410) {
|
if (job.data.isSharedInbox && res.statusCode === 410) {
|
||||||
this.federatedInstanceService.fetch(host).then(i => {
|
this.federatedInstanceService.fetch(host).then(i => {
|
||||||
|
|
|
@ -85,7 +85,7 @@ export class InboxProcessorService {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// 対象が4xxならスキップ
|
// 対象が4xxならスキップ
|
||||||
if (err instanceof StatusError) {
|
if (err instanceof StatusError) {
|
||||||
if (err.isClientError) {
|
if (!err.isRetryable) {
|
||||||
throw new Bull.UnrecoverableError(`skip: Ignored deleted actors on both ends ${activity.actor} - ${err.statusCode}`);
|
throw new Bull.UnrecoverableError(`skip: Ignored deleted actors on both ends ${activity.actor} - ${err.statusCode}`);
|
||||||
}
|
}
|
||||||
throw new Error(`Error in actor ${activity.actor} - ${err.statusCode}`);
|
throw new Error(`Error in actor ${activity.actor} - ${err.statusCode}`);
|
||||||
|
|
|
@ -71,7 +71,7 @@ export class WebhookDeliverProcessorService {
|
||||||
|
|
||||||
if (res instanceof StatusError) {
|
if (res instanceof StatusError) {
|
||||||
// 4xx
|
// 4xx
|
||||||
if (res.isClientError) {
|
if (!res.isRetryable) {
|
||||||
throw new Bull.UnrecoverableError(`${res.statusCode} ${res.statusMessage}`);
|
throw new Bull.UnrecoverableError(`${res.statusCode} ${res.statusMessage}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,9 @@ export type DeliverJobData = {
|
||||||
/** Actor */
|
/** Actor */
|
||||||
user: ThinUser;
|
user: ThinUser;
|
||||||
/** Activity */
|
/** Activity */
|
||||||
content: unknown;
|
content: string;
|
||||||
|
/** Digest header */
|
||||||
|
digest: string;
|
||||||
/** inbox URL to deliver */
|
/** inbox URL to deliver */
|
||||||
to: string;
|
to: string;
|
||||||
/** whether it is sharedInbox */
|
/** whether it is sharedInbox */
|
||||||
|
|
|
@ -24,7 +24,7 @@ import type * as misskey from 'misskey-js';
|
||||||
|
|
||||||
describe('2要素認証', () => {
|
describe('2要素認証', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
const config = loadConfig();
|
const config = loadConfig();
|
||||||
const password = 'test';
|
const password = 'test';
|
||||||
|
|
|
@ -37,7 +37,7 @@ describe('アンテナ', () => {
|
||||||
// - srcのenumにgroupが残っている
|
// - srcのenumにgroupが残っている
|
||||||
// - userGroupIdが残っている, isActiveがない
|
// - userGroupIdが残っている, isActiveがない
|
||||||
type Antenna = misskey.entities.Antenna | Packed<'Antenna'>;
|
type Antenna = misskey.entities.Antenna | Packed<'Antenna'>;
|
||||||
type User = misskey.entities.MeSignup;
|
type User = misskey.entities.SignupResponse;
|
||||||
type Note = misskey.entities.Note;
|
type Note = misskey.entities.Note;
|
||||||
|
|
||||||
// アンテナを作成できる最小のパラメタ
|
// アンテナを作成できる最小のパラメタ
|
||||||
|
|
|
@ -24,15 +24,15 @@ describe('API visibility', () => {
|
||||||
describe('Note visibility', () => {
|
describe('Note visibility', () => {
|
||||||
//#region vars
|
//#region vars
|
||||||
/** ヒロイン */
|
/** ヒロイン */
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
/** フォロワー */
|
/** フォロワー */
|
||||||
let follower: misskey.entities.MeSignup;
|
let follower: misskey.entities.SignupResponse;
|
||||||
/** 非フォロワー */
|
/** 非フォロワー */
|
||||||
let other: misskey.entities.MeSignup;
|
let other: misskey.entities.SignupResponse;
|
||||||
/** 非フォロワーでもリプライやメンションをされた人 */
|
/** 非フォロワーでもリプライやメンションをされた人 */
|
||||||
let target: misskey.entities.MeSignup;
|
let target: misskey.entities.SignupResponse;
|
||||||
/** specified mentionでmentionを飛ばされる人 */
|
/** specified mentionでmentionを飛ばされる人 */
|
||||||
let target2: misskey.entities.MeSignup;
|
let target2: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
/** public-post */
|
/** public-post */
|
||||||
let pub: any;
|
let pub: any;
|
||||||
|
|
|
@ -13,9 +13,9 @@ import type * as misskey from 'misskey-js';
|
||||||
|
|
||||||
describe('API', () => {
|
describe('API', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
let carol: misskey.entities.MeSignup;
|
let carol: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
|
|
|
@ -14,9 +14,9 @@ describe('Block', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
|
|
||||||
// alice blocks bob
|
// alice blocks bob
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
let carol: misskey.entities.MeSignup;
|
let carol: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
|
|
|
@ -17,10 +17,10 @@ import type * as misskey from 'misskey-js';
|
||||||
describe('Endpoints', () => {
|
describe('Endpoints', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
|
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
let carol: misskey.entities.MeSignup;
|
let carol: misskey.entities.SignupResponse;
|
||||||
let dave: misskey.entities.MeSignup;
|
let dave: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
|
|
|
@ -25,7 +25,7 @@ const JSON_UTF8 = 'application/json; charset=utf-8';
|
||||||
describe('Webリソース', () => {
|
describe('Webリソース', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
|
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let aliceUploadedFile: any;
|
let aliceUploadedFile: any;
|
||||||
let alicesPost: any;
|
let alicesPost: any;
|
||||||
let alicePage: any;
|
let alicePage: any;
|
||||||
|
@ -34,7 +34,7 @@ describe('Webリソース', () => {
|
||||||
let aliceGalleryPost: any;
|
let aliceGalleryPost: any;
|
||||||
let aliceChannel: any;
|
let aliceChannel: any;
|
||||||
|
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
type Request = {
|
type Request = {
|
||||||
path: string,
|
path: string,
|
||||||
|
|
|
@ -13,8 +13,8 @@ import type * as misskey from 'misskey-js';
|
||||||
describe('FF visibility', () => {
|
describe('FF visibility', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
|
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
|
|
|
@ -20,12 +20,12 @@ describe('Account Move', () => {
|
||||||
let url: URL;
|
let url: URL;
|
||||||
|
|
||||||
let root: any;
|
let root: any;
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
let carol: misskey.entities.MeSignup;
|
let carol: misskey.entities.SignupResponse;
|
||||||
let dave: misskey.entities.MeSignup;
|
let dave: misskey.entities.SignupResponse;
|
||||||
let eve: misskey.entities.MeSignup;
|
let eve: misskey.entities.SignupResponse;
|
||||||
let frank: misskey.entities.MeSignup;
|
let frank: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
let Users: UsersRepository;
|
let Users: UsersRepository;
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,9 @@ describe('Mute', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
|
|
||||||
// alice mutes carol
|
// alice mutes carol
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
let carol: misskey.entities.MeSignup;
|
let carol: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
|
|
|
@ -16,8 +16,8 @@ describe('Note', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
let Notes: any;
|
let Notes: any;
|
||||||
|
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
|
|
|
@ -75,7 +75,7 @@ function getMeta(html: string): { transactionId: string | undefined, clientName:
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchDecision(transactionId: string, user: misskey.entities.MeSignup, { cancel }: { cancel?: boolean } = {}): Promise<Response> {
|
function fetchDecision(transactionId: string, user: misskey.entities.SignupResponse, { cancel }: { cancel?: boolean } = {}): Promise<Response> {
|
||||||
return fetch(new URL('/oauth/decision', host), {
|
return fetch(new URL('/oauth/decision', host), {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
body: new URLSearchParams({
|
body: new URLSearchParams({
|
||||||
|
@ -90,14 +90,14 @@ function fetchDecision(transactionId: string, user: misskey.entities.MeSignup, {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchDecisionFromResponse(response: Response, user: misskey.entities.MeSignup, { cancel }: { cancel?: boolean } = {}): Promise<Response> {
|
async function fetchDecisionFromResponse(response: Response, user: misskey.entities.SignupResponse, { cancel }: { cancel?: boolean } = {}): Promise<Response> {
|
||||||
const { transactionId } = getMeta(await response.text());
|
const { transactionId } = getMeta(await response.text());
|
||||||
assert.ok(transactionId);
|
assert.ok(transactionId);
|
||||||
|
|
||||||
return await fetchDecision(transactionId, user, { cancel });
|
return await fetchDecision(transactionId, user, { cancel });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchAuthorizationCode(user: misskey.entities.MeSignup, scope: string, code_challenge: string): Promise<{ client: AuthorizationCode, code: string }> {
|
async function fetchAuthorizationCode(user: misskey.entities.SignupResponse, scope: string, code_challenge: string): Promise<{ client: AuthorizationCode, code: string }> {
|
||||||
const client = new AuthorizationCode(clientConfig);
|
const client = new AuthorizationCode(clientConfig);
|
||||||
|
|
||||||
const response = await fetch(client.authorizeURL({
|
const response = await fetch(client.authorizeURL({
|
||||||
|
@ -150,8 +150,8 @@ describe('OAuth', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
let fastify: FastifyInstance;
|
let fastify: FastifyInstance;
|
||||||
|
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
let sender: (reply: FastifyReply) => void;
|
let sender: (reply: FastifyReply) => void;
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,9 @@ describe('Renote Mute', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
|
|
||||||
// alice mutes carol
|
// alice mutes carol
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
let carol: misskey.entities.MeSignup;
|
let carol: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
|
|
|
@ -32,15 +32,15 @@ describe('Streaming', () => {
|
||||||
|
|
||||||
describe('Streaming', () => {
|
describe('Streaming', () => {
|
||||||
// Local users
|
// Local users
|
||||||
let ayano: misskey.entities.MeSignup;
|
let ayano: misskey.entities.SignupResponse;
|
||||||
let kyoko: misskey.entities.MeSignup;
|
let kyoko: misskey.entities.SignupResponse;
|
||||||
let chitose: misskey.entities.MeSignup;
|
let chitose: misskey.entities.SignupResponse;
|
||||||
let kanako: misskey.entities.MeSignup;
|
let kanako: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
// Remote users
|
// Remote users
|
||||||
let akari: misskey.entities.MeSignup;
|
let akari: misskey.entities.SignupResponse;
|
||||||
let chinatsu: misskey.entities.MeSignup;
|
let chinatsu: misskey.entities.SignupResponse;
|
||||||
let takumi: misskey.entities.MeSignup;
|
let takumi: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
let kyokoNote: any;
|
let kyokoNote: any;
|
||||||
let kanakoNote: any;
|
let kanakoNote: any;
|
||||||
|
|
|
@ -13,9 +13,9 @@ import type * as misskey from 'misskey-js';
|
||||||
describe('Note thread mute', () => {
|
describe('Note thread mute', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
|
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let bob: misskey.entities.MeSignup;
|
let bob: misskey.entities.SignupResponse;
|
||||||
let carol: misskey.entities.MeSignup;
|
let carol: misskey.entities.SignupResponse;
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
app = await startServer();
|
app = await startServer();
|
||||||
|
|
|
@ -13,7 +13,7 @@ import type * as misskey from 'misskey-js';
|
||||||
describe('users/notes', () => {
|
describe('users/notes', () => {
|
||||||
let app: INestApplicationContext;
|
let app: INestApplicationContext;
|
||||||
|
|
||||||
let alice: misskey.entities.MeSignup;
|
let alice: misskey.entities.SignupResponse;
|
||||||
let jpgNote: any;
|
let jpgNote: any;
|
||||||
let pngNote: any;
|
let pngNote: any;
|
||||||
let jpgPngNote: any;
|
let jpgPngNote: any;
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
"escape-regexp": "0.0.1",
|
"escape-regexp": "0.0.1",
|
||||||
"estree-walker": "3.0.3",
|
"estree-walker": "3.0.3",
|
||||||
"eventemitter3": "5.0.1",
|
"eventemitter3": "5.0.1",
|
||||||
"gsap": "3.12.4",
|
|
||||||
"idb-keyval": "6.2.1",
|
"idb-keyval": "6.2.1",
|
||||||
"insert-text-at-cursor": "0.3.0",
|
"insert-text-at-cursor": "0.3.0",
|
||||||
"is-file-animated": "1.0.2",
|
"is-file-animated": "1.0.2",
|
||||||
|
|
|
@ -11,7 +11,8 @@ import { miLocalStorage } from '@/local-storage.js';
|
||||||
import { MenuButton } from '@/types/menu.js';
|
import { MenuButton } from '@/types/menu.js';
|
||||||
import { del, get, set } from '@/scripts/idb-proxy.js';
|
import { del, get, set } from '@/scripts/idb-proxy.js';
|
||||||
import { apiUrl } from '@/config.js';
|
import { apiUrl } from '@/config.js';
|
||||||
import { waiting, api, popup, popupMenu, success, alert } from '@/os.js';
|
import { waiting, popup, popupMenu, success, alert } from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { unisonReload, reloadChannel } from '@/scripts/unison-reload.js';
|
import { unisonReload, reloadChannel } from '@/scripts/unison-reload.js';
|
||||||
|
|
||||||
// TODO: 他のタブと永続化されたstateを同期
|
// TODO: 他のタブと永続化されたstateを同期
|
||||||
|
@ -23,9 +24,14 @@ const accountData = miLocalStorage.getItem('account');
|
||||||
// TODO: 外部からはreadonlyに
|
// TODO: 外部からはreadonlyに
|
||||||
export const $i = accountData ? reactive(JSON.parse(accountData) as Account) : null;
|
export const $i = accountData ? reactive(JSON.parse(accountData) as Account) : null;
|
||||||
|
|
||||||
export const iAmModerator = $i != null && ($i.isAdmin || $i.isModerator);
|
export const iAmModerator = $i != null && ($i.isAdmin === true || $i.isModerator === true);
|
||||||
export const iAmAdmin = $i != null && $i.isAdmin;
|
export const iAmAdmin = $i != null && $i.isAdmin;
|
||||||
|
|
||||||
|
export function signinRequired() {
|
||||||
|
if ($i == null) throw new Error('signin required');
|
||||||
|
return $i;
|
||||||
|
}
|
||||||
|
|
||||||
export let notesCount = $i == null ? 0 : $i.notesCount;
|
export let notesCount = $i == null ? 0 : $i.notesCount;
|
||||||
export function incNotesCount() {
|
export function incNotesCount() {
|
||||||
notesCount++;
|
notesCount++;
|
||||||
|
@ -246,7 +252,7 @@ export async function openAccountMenu(opts: {
|
||||||
}
|
}
|
||||||
|
|
||||||
const storedAccounts = await getAccounts().then(accounts => accounts.filter(x => x.id !== $i.id));
|
const storedAccounts = await getAccounts().then(accounts => accounts.filter(x => x.id !== $i.id));
|
||||||
const accountsPromise = api('users/show', { userIds: storedAccounts.map(x => x.id) });
|
const accountsPromise = misskeyApi('users/show', { userIds: storedAccounts.map(x => x.id) });
|
||||||
|
|
||||||
function createItem(account: Misskey.entities.UserDetailed) {
|
function createItem(account: Misskey.entities.UserDetailed) {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { Cache } from '@/scripts/cache.js';
|
import { Cache } from '@/scripts/cache.js';
|
||||||
import { api } from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
|
||||||
export const clipsCache = new Cache<Misskey.entities.Clip[]>(1000 * 60 * 30, () => api('clips/list'));
|
export const clipsCache = new Cache<Misskey.entities.Clip[]>(1000 * 60 * 30, () => misskeyApi('clips/list'));
|
||||||
export const rolesCache = new Cache(1000 * 60 * 30, () => api('admin/roles/list'));
|
export const rolesCache = new Cache(1000 * 60 * 30, () => misskeyApi('admin/roles/list'));
|
||||||
export const userListsCache = new Cache<Misskey.entities.UserList[]>(1000 * 60 * 30, () => api('users/lists/list'));
|
export const userListsCache = new Cache<Misskey.entities.UserList[]>(1000 * 60 * 30, () => misskeyApi('users/lists/list'));
|
||||||
export const antennasCache = new Cache<Misskey.entities.Antenna[]>(1000 * 60 * 30, () => api('antennas/list'));
|
export const antennasCache = new Cache<Misskey.entities.Antenna[]>(1000 * 60 * 30, () => misskeyApi('antennas/list'));
|
||||||
|
|
|
@ -17,7 +17,7 @@ import * as Misskey from 'misskey-js';
|
||||||
import MkMention from './MkMention.vue';
|
import MkMention from './MkMention.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { host as localHost } from '@/config.js';
|
import { host as localHost } from '@/config.js';
|
||||||
import { api } from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
|
||||||
const user = ref<Misskey.entities.UserLite>();
|
const user = ref<Misskey.entities.UserLite>();
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ const props = defineProps<{
|
||||||
movedTo: string; // user id
|
movedTo: string; // user id
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
api('users/show', { userId: props.movedTo }).then(u => user.value = u);
|
misskeyApi('users/show', { userId: props.movedTo }).then(u => user.value = u);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
|
|
|
@ -55,6 +55,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { onMounted, ref, computed } from 'vue';
|
import { onMounted, ref, computed } from 'vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { ACHIEVEMENT_TYPES, ACHIEVEMENT_BADGES, claimAchievement } from '@/scripts/achievements.js';
|
import { ACHIEVEMENT_TYPES, ACHIEVEMENT_BADGES, claimAchievement } from '@/scripts/achievements.js';
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ const achievements = ref<Misskey.entities.UsersAchievementsResponse | null>(null
|
||||||
const lockedAchievements = computed(() => ACHIEVEMENT_TYPES.filter(x => !(achievements.value ?? []).some(a => a.name === x)));
|
const lockedAchievements = computed(() => ACHIEVEMENT_TYPES.filter(x => !(achievements.value ?? []).some(a => a.name === x)));
|
||||||
|
|
||||||
function fetch() {
|
function fetch() {
|
||||||
os.api('users/achievements', { userId: props.user.id }).then(res => {
|
misskeyApi('users/achievements', { userId: props.user.id }).then(res => {
|
||||||
achievements.value = [];
|
achievements.value = [];
|
||||||
for (const t of ACHIEVEMENT_TYPES) {
|
for (const t of ACHIEVEMENT_TYPES) {
|
||||||
const a = res.find(x => x.name === t);
|
const a = res.find(x => x.name === t);
|
||||||
|
|
|
@ -25,6 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { onMounted, shallowRef } from 'vue';
|
import { onMounted, shallowRef } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import MkModal from '@/components/MkModal.vue';
|
import MkModal from '@/components/MkModal.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
@ -49,7 +50,7 @@ async function ok() {
|
||||||
}
|
}
|
||||||
|
|
||||||
modal.value?.close();
|
modal.value?.close();
|
||||||
os.api('i/read-announcement', { announcementId: props.announcement.id });
|
misskeyApi('i/read-announcement', { announcementId: props.announcement.id });
|
||||||
updateAccount({
|
updateAccount({
|
||||||
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== props.announcement.id),
|
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== props.announcement.id),
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,6 +45,7 @@ import contains from '@/scripts/contains.js';
|
||||||
import { char2twemojiFilePath, char2fluentEmojiFilePath } from '@/scripts/emoji-base.js';
|
import { char2twemojiFilePath, char2fluentEmojiFilePath } from '@/scripts/emoji-base.js';
|
||||||
import { acct } from '@/filters/user.js';
|
import { acct } from '@/filters/user.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { emojilist, getEmojiName } from '@/scripts/emojilist.js';
|
import { emojilist, getEmojiName } from '@/scripts/emojilist.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
@ -201,7 +202,7 @@ function exec() {
|
||||||
users.value = JSON.parse(cache);
|
users.value = JSON.parse(cache);
|
||||||
fetching.value = false;
|
fetching.value = false;
|
||||||
} else {
|
} else {
|
||||||
os.api('users/search-by-username-and-host', {
|
misskeyApi('users/search-by-username-and-host', {
|
||||||
username: props.q,
|
username: props.q,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
detail: false,
|
detail: false,
|
||||||
|
@ -224,7 +225,7 @@ function exec() {
|
||||||
hashtags.value = hashtags;
|
hashtags.value = hashtags;
|
||||||
fetching.value = false;
|
fetching.value = false;
|
||||||
} else {
|
} else {
|
||||||
os.api('hashtags/search', {
|
misskeyApi('hashtags/search', {
|
||||||
query: props.q,
|
query: props.q,
|
||||||
limit: 30,
|
limit: 30,
|
||||||
}).then(searchedHashtags => {
|
}).then(searchedHashtags => {
|
||||||
|
|
|
@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
userIds: string[];
|
userIds: string[];
|
||||||
|
@ -27,7 +27,7 @@ const props = withDefaults(defineProps<{
|
||||||
const users = ref<Misskey.entities.UserLite[]>([]);
|
const users = ref<Misskey.entities.UserLite[]>([]);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
users.value = await os.api('users/show', {
|
users.value = await misskeyApi('users/show', {
|
||||||
userIds: props.userIds,
|
userIds: props.userIds,
|
||||||
}) as unknown as Misskey.entities.UserLite[];
|
}) as unknown as Misskey.entities.UserLite[];
|
||||||
});
|
});
|
||||||
|
|
|
@ -131,6 +131,10 @@ function onMousedown(evt: MouseEvent): void {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
transition: background 0.1s ease;
|
transition: background 0.1s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
&:not(:disabled):hover {
|
&:not(:disabled):hover {
|
||||||
background: var(--buttonHoverBg);
|
background: var(--buttonHoverBg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
|
@ -44,12 +44,12 @@ async function onClick() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isFollowing.value) {
|
if (isFollowing.value) {
|
||||||
await os.api('channels/unfollow', {
|
await misskeyApi('channels/unfollow', {
|
||||||
channelId: props.channel.id,
|
channelId: props.channel.id,
|
||||||
});
|
});
|
||||||
isFollowing.value = false;
|
isFollowing.value = false;
|
||||||
} else {
|
} else {
|
||||||
await os.api('channels/follow', {
|
await misskeyApi('channels/follow', {
|
||||||
channelId: props.channel.id,
|
channelId: props.channel.id,
|
||||||
});
|
});
|
||||||
isFollowing.value = true;
|
isFollowing.value = true;
|
||||||
|
|
|
@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { onMounted, ref, shallowRef, watch, PropType } from 'vue';
|
import { onMounted, ref, shallowRef, watch, PropType } from 'vue';
|
||||||
import { Chart } from 'chart.js';
|
import { Chart } from 'chart.js';
|
||||||
import gradient from 'chartjs-plugin-gradient';
|
import gradient from 'chartjs-plugin-gradient';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
||||||
import { chartVLine } from '@/scripts/chart-vline.js';
|
import { chartVLine } from '@/scripts/chart-vline.js';
|
||||||
|
@ -282,7 +282,7 @@ const exportData = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchFederationChart = async (): Promise<typeof chartData> => {
|
const fetchFederationChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/federation', { limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/federation', { limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Received',
|
name: 'Received',
|
||||||
|
@ -332,7 +332,7 @@ const fetchFederationChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchApRequestChart = async (): Promise<typeof chartData> => {
|
const fetchApRequestChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/ap-request', { limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/ap-request', { limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'In',
|
name: 'In',
|
||||||
|
@ -354,7 +354,7 @@ const fetchApRequestChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchNotesChart = async (type: string): Promise<typeof chartData> => {
|
const fetchNotesChart = async (type: string): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/notes', { limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/notes', { limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'All',
|
name: 'All',
|
||||||
|
@ -401,7 +401,7 @@ const fetchNotesChart = async (type: string): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchNotesTotalChart = async (): Promise<typeof chartData> => {
|
const fetchNotesTotalChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/notes', { limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/notes', { limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Combined',
|
name: 'Combined',
|
||||||
|
@ -420,7 +420,7 @@ const fetchNotesTotalChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchUsersChart = async (total: boolean): Promise<typeof chartData> => {
|
const fetchUsersChart = async (total: boolean): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/users', { limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/users', { limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Combined',
|
name: 'Combined',
|
||||||
|
@ -448,7 +448,7 @@ const fetchUsersChart = async (total: boolean): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchActiveUsersChart = async (): Promise<typeof chartData> => {
|
const fetchActiveUsersChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/active-users', { limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/active-users', { limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Read & Write',
|
name: 'Read & Write',
|
||||||
|
@ -500,7 +500,7 @@ const fetchActiveUsersChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchDriveChart = async (): Promise<typeof chartData> => {
|
const fetchDriveChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/drive', { limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/drive', { limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
bytes: true,
|
bytes: true,
|
||||||
series: [{
|
series: [{
|
||||||
|
@ -536,7 +536,7 @@ const fetchDriveChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchDriveFilesChart = async (): Promise<typeof chartData> => {
|
const fetchDriveFilesChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/drive', { limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/drive', { limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'All',
|
name: 'All',
|
||||||
|
@ -571,7 +571,7 @@ const fetchDriveFilesChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchInstanceRequestsChart = async (): Promise<typeof chartData> => {
|
const fetchInstanceRequestsChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'In',
|
name: 'In',
|
||||||
|
@ -593,7 +593,7 @@ const fetchInstanceRequestsChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchInstanceUsersChart = async (total: boolean): Promise<typeof chartData> => {
|
const fetchInstanceUsersChart = async (total: boolean): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Users',
|
name: 'Users',
|
||||||
|
@ -608,7 +608,7 @@ const fetchInstanceUsersChart = async (total: boolean): Promise<typeof chartData
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchInstanceNotesChart = async (total: boolean): Promise<typeof chartData> => {
|
const fetchInstanceNotesChart = async (total: boolean): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Notes',
|
name: 'Notes',
|
||||||
|
@ -623,7 +623,7 @@ const fetchInstanceNotesChart = async (total: boolean): Promise<typeof chartData
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchInstanceFfChart = async (total: boolean): Promise<typeof chartData> => {
|
const fetchInstanceFfChart = async (total: boolean): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Following',
|
name: 'Following',
|
||||||
|
@ -646,7 +646,7 @@ const fetchInstanceFfChart = async (total: boolean): Promise<typeof chartData> =
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchInstanceDriveUsageChart = async (total: boolean): Promise<typeof chartData> => {
|
const fetchInstanceDriveUsageChart = async (total: boolean): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
bytes: true,
|
bytes: true,
|
||||||
series: [{
|
series: [{
|
||||||
|
@ -662,7 +662,7 @@ const fetchInstanceDriveUsageChart = async (total: boolean): Promise<typeof char
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchInstanceDriveFilesChart = async (total: boolean): Promise<typeof chartData> => {
|
const fetchInstanceDriveFilesChart = async (total: boolean): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/instance', { host: props.args?.host, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Drive files',
|
name: 'Drive files',
|
||||||
|
@ -677,7 +677,7 @@ const fetchInstanceDriveFilesChart = async (total: boolean): Promise<typeof char
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchPerUserNotesChart = async (): Promise<typeof chartData> => {
|
const fetchPerUserNotesChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/user/notes', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/user/notes', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [...(props.args?.withoutAll ? [] : [{
|
series: [...(props.args?.withoutAll ? [] : [{
|
||||||
name: 'All',
|
name: 'All',
|
||||||
|
@ -709,7 +709,7 @@ const fetchPerUserNotesChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchPerUserPvChart = async (): Promise<typeof chartData> => {
|
const fetchPerUserPvChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/user/pv', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/user/pv', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Unique PV (user)',
|
name: 'Unique PV (user)',
|
||||||
|
@ -736,7 +736,7 @@ const fetchPerUserPvChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchPerUserFollowingChart = async (): Promise<typeof chartData> => {
|
const fetchPerUserFollowingChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/user/following', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/user/following', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Local',
|
name: 'Local',
|
||||||
|
@ -751,7 +751,7 @@ const fetchPerUserFollowingChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchPerUserFollowersChart = async (): Promise<typeof chartData> => {
|
const fetchPerUserFollowersChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/user/following', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/user/following', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
series: [{
|
series: [{
|
||||||
name: 'Local',
|
name: 'Local',
|
||||||
|
@ -766,7 +766,7 @@ const fetchPerUserFollowersChart = async (): Promise<typeof chartData> => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchPerUserDriveChart = async (): Promise<typeof chartData> => {
|
const fetchPerUserDriveChart = async (): Promise<typeof chartData> => {
|
||||||
const raw = await os.apiGet('charts/user/drive', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
const raw = await misskeyApiGet('charts/user/drive', { userId: props.args?.user?.id, limit: props.limit, span: props.span });
|
||||||
return {
|
return {
|
||||||
bytes: true,
|
bytes: true,
|
||||||
series: [{
|
series: [{
|
||||||
|
|
|
@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div :class="$style.codeEditorScroller">
|
<div :class="$style.codeEditorScroller">
|
||||||
<textarea
|
<textarea
|
||||||
ref="inputEl"
|
ref="inputEl"
|
||||||
v-model="vModel"
|
v-model="v"
|
||||||
:class="[$style.textarea]"
|
:class="[$style.textarea]"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:required="required"
|
:required="required"
|
||||||
|
@ -58,7 +58,6 @@ const emit = defineEmits<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const { modelValue } = toRefs(props);
|
const { modelValue } = toRefs(props);
|
||||||
const vModel = ref<string>(modelValue.value ?? '');
|
|
||||||
const v = ref<string>(modelValue.value ?? '');
|
const v = ref<string>(modelValue.value ?? '');
|
||||||
const focused = ref(false);
|
const focused = ref(false);
|
||||||
const changed = ref(false);
|
const changed = ref(false);
|
||||||
|
@ -79,15 +78,14 @@ const onKeydown = (ev: KeyboardEvent) => {
|
||||||
|
|
||||||
if (ev.code === 'Enter') {
|
if (ev.code === 'Enter') {
|
||||||
const pos = inputEl.value?.selectionStart ?? 0;
|
const pos = inputEl.value?.selectionStart ?? 0;
|
||||||
const posEnd = inputEl.value?.selectionEnd ?? vModel.value.length;
|
const posEnd = inputEl.value?.selectionEnd ?? v.value.length;
|
||||||
if (pos === posEnd) {
|
if (pos === posEnd) {
|
||||||
const lines = vModel.value.slice(0, pos).split('\n');
|
const lines = v.value.slice(0, pos).split('\n');
|
||||||
const currentLine = lines[lines.length - 1];
|
const currentLine = lines[lines.length - 1];
|
||||||
const currentLineSpaces = currentLine.match(/^\s+/);
|
const currentLineSpaces = currentLine.match(/^\s+/);
|
||||||
const posDelta = currentLineSpaces ? currentLineSpaces[0].length : 0;
|
const posDelta = currentLineSpaces ? currentLineSpaces[0].length : 0;
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
vModel.value = vModel.value.slice(0, pos) + '\n' + (currentLineSpaces ? currentLineSpaces[0] : '') + vModel.value.slice(pos);
|
v.value = v.value.slice(0, pos) + '\n' + (currentLineSpaces ? currentLineSpaces[0] : '') + v.value.slice(pos);
|
||||||
v.value = vModel.value;
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
inputEl.value?.setSelectionRange(pos + 1 + posDelta, pos + 1 + posDelta);
|
inputEl.value?.setSelectionRange(pos + 1 + posDelta, pos + 1 + posDelta);
|
||||||
});
|
});
|
||||||
|
@ -97,9 +95,8 @@ const onKeydown = (ev: KeyboardEvent) => {
|
||||||
|
|
||||||
if (ev.key === 'Tab') {
|
if (ev.key === 'Tab') {
|
||||||
const pos = inputEl.value?.selectionStart ?? 0;
|
const pos = inputEl.value?.selectionStart ?? 0;
|
||||||
const posEnd = inputEl.value?.selectionEnd ?? vModel.value.length;
|
const posEnd = inputEl.value?.selectionEnd ?? v.value.length;
|
||||||
vModel.value = vModel.value.slice(0, pos) + '\t' + vModel.value.slice(posEnd);
|
v.value = v.value.slice(0, pos) + '\t' + v.value.slice(posEnd);
|
||||||
v.value = vModel.value;
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
inputEl.value?.setSelectionRange(pos + 1, pos + 1);
|
inputEl.value?.setSelectionRange(pos + 1, pos + 1);
|
||||||
});
|
});
|
||||||
|
|
|
@ -35,6 +35,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { computed, defineAsyncComponent, ref } from 'vue';
|
import { computed, defineAsyncComponent, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { claimAchievement } from '@/scripts/achievements.js';
|
import { claimAchievement } from '@/scripts/achievements.js';
|
||||||
|
@ -144,7 +145,7 @@ function onDrop(ev: DragEvent) {
|
||||||
if (driveFile != null && driveFile !== '') {
|
if (driveFile != null && driveFile !== '') {
|
||||||
const file = JSON.parse(driveFile);
|
const file = JSON.parse(driveFile);
|
||||||
emit('removeFile', file.id);
|
emit('removeFile', file.id);
|
||||||
os.api('drive/files/update', {
|
misskeyApi('drive/files/update', {
|
||||||
fileId: file.id,
|
fileId: file.id,
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
});
|
});
|
||||||
|
@ -160,7 +161,7 @@ function onDrop(ev: DragEvent) {
|
||||||
if (folder.id === props.folder.id) return;
|
if (folder.id === props.folder.id) return;
|
||||||
|
|
||||||
emit('removeFolder', folder.id);
|
emit('removeFolder', folder.id);
|
||||||
os.api('drive/folders/update', {
|
misskeyApi('drive/folders/update', {
|
||||||
folderId: folder.id,
|
folderId: folder.id,
|
||||||
parentId: props.folder.id,
|
parentId: props.folder.id,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -214,7 +215,7 @@ function rename() {
|
||||||
default: props.folder.name,
|
default: props.folder.name,
|
||||||
}).then(({ canceled, result: name }) => {
|
}).then(({ canceled, result: name }) => {
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
os.api('drive/folders/update', {
|
misskeyApi('drive/folders/update', {
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
name: name,
|
name: name,
|
||||||
});
|
});
|
||||||
|
@ -222,7 +223,7 @@ function rename() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteFolder() {
|
function deleteFolder() {
|
||||||
os.api('drive/folders/delete', {
|
misskeyApi('drive/folders/delete', {
|
||||||
folderId: props.folder.id,
|
folderId: props.folder.id,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
if (defaultStore.state.uploadFolder === props.folder.id) {
|
if (defaultStore.state.uploadFolder === props.folder.id) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -112,7 +112,7 @@ function onDrop(ev: DragEvent) {
|
||||||
if (driveFile != null && driveFile !== '') {
|
if (driveFile != null && driveFile !== '') {
|
||||||
const file = JSON.parse(driveFile);
|
const file = JSON.parse(driveFile);
|
||||||
emit('removeFile', file.id);
|
emit('removeFile', file.id);
|
||||||
os.api('drive/files/update', {
|
misskeyApi('drive/files/update', {
|
||||||
fileId: file.id,
|
fileId: file.id,
|
||||||
folderId: props.folder ? props.folder.id : null,
|
folderId: props.folder ? props.folder.id : null,
|
||||||
});
|
});
|
||||||
|
@ -126,7 +126,7 @@ function onDrop(ev: DragEvent) {
|
||||||
// 移動先が自分自身ならreject
|
// 移動先が自分自身ならreject
|
||||||
if (props.folder && folder.id === props.folder.id) return;
|
if (props.folder && folder.id === props.folder.id) return;
|
||||||
emit('removeFolder', folder.id);
|
emit('removeFolder', folder.id);
|
||||||
os.api('drive/folders/update', {
|
misskeyApi('drive/folders/update', {
|
||||||
folderId: folder.id,
|
folderId: folder.id,
|
||||||
parentId: props.folder ? props.folder.id : null,
|
parentId: props.folder ? props.folder.id : null,
|
||||||
});
|
});
|
||||||
|
|
|
@ -103,6 +103,7 @@ import XNavFolder from '@/components/MkDrive.navFolder.vue';
|
||||||
import XFolder from '@/components/MkDrive.folder.vue';
|
import XFolder from '@/components/MkDrive.folder.vue';
|
||||||
import XFile from '@/components/MkDrive.file.vue';
|
import XFile from '@/components/MkDrive.file.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { useStream } from '@/stream.js';
|
import { useStream } from '@/stream.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
@ -255,7 +256,7 @@ function onDrop(ev: DragEvent): any {
|
||||||
const file = JSON.parse(driveFile);
|
const file = JSON.parse(driveFile);
|
||||||
if (files.value.some(f => f.id === file.id)) return;
|
if (files.value.some(f => f.id === file.id)) return;
|
||||||
removeFile(file.id);
|
removeFile(file.id);
|
||||||
os.api('drive/files/update', {
|
misskeyApi('drive/files/update', {
|
||||||
fileId: file.id,
|
fileId: file.id,
|
||||||
folderId: folder.value ? folder.value.id : null,
|
folderId: folder.value ? folder.value.id : null,
|
||||||
});
|
});
|
||||||
|
@ -271,7 +272,7 @@ function onDrop(ev: DragEvent): any {
|
||||||
if (folder.value && droppedFolder.id === folder.value.id) return false;
|
if (folder.value && droppedFolder.id === folder.value.id) return false;
|
||||||
if (folders.value.some(f => f.id === droppedFolder.id)) return false;
|
if (folders.value.some(f => f.id === droppedFolder.id)) return false;
|
||||||
removeFolder(droppedFolder.id);
|
removeFolder(droppedFolder.id);
|
||||||
os.api('drive/folders/update', {
|
misskeyApi('drive/folders/update', {
|
||||||
folderId: droppedFolder.id,
|
folderId: droppedFolder.id,
|
||||||
parentId: folder.value ? folder.value.id : null,
|
parentId: folder.value ? folder.value.id : null,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -308,7 +309,7 @@ function urlUpload() {
|
||||||
placeholder: i18n.ts.uploadFromUrlDescription,
|
placeholder: i18n.ts.uploadFromUrlDescription,
|
||||||
}).then(({ canceled, result: url }) => {
|
}).then(({ canceled, result: url }) => {
|
||||||
if (canceled || !url) return;
|
if (canceled || !url) return;
|
||||||
os.api('drive/files/upload-from-url', {
|
misskeyApi('drive/files/upload-from-url', {
|
||||||
url: url,
|
url: url,
|
||||||
folderId: folder.value ? folder.value.id : undefined,
|
folderId: folder.value ? folder.value.id : undefined,
|
||||||
});
|
});
|
||||||
|
@ -326,7 +327,7 @@ function createFolder() {
|
||||||
placeholder: i18n.ts.folderName,
|
placeholder: i18n.ts.folderName,
|
||||||
}).then(({ canceled, result: name }) => {
|
}).then(({ canceled, result: name }) => {
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
os.api('drive/folders/create', {
|
misskeyApi('drive/folders/create', {
|
||||||
name: name,
|
name: name,
|
||||||
parentId: folder.value ? folder.value.id : undefined,
|
parentId: folder.value ? folder.value.id : undefined,
|
||||||
}).then(createdFolder => {
|
}).then(createdFolder => {
|
||||||
|
@ -342,7 +343,7 @@ function renameFolder(folderToRename: Misskey.entities.DriveFolder) {
|
||||||
default: folderToRename.name,
|
default: folderToRename.name,
|
||||||
}).then(({ canceled, result: name }) => {
|
}).then(({ canceled, result: name }) => {
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
os.api('drive/folders/update', {
|
misskeyApi('drive/folders/update', {
|
||||||
folderId: folderToRename.id,
|
folderId: folderToRename.id,
|
||||||
name: name,
|
name: name,
|
||||||
}).then(updatedFolder => {
|
}).then(updatedFolder => {
|
||||||
|
@ -353,7 +354,7 @@ function renameFolder(folderToRename: Misskey.entities.DriveFolder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteFolder(folderToDelete: Misskey.entities.DriveFolder) {
|
function deleteFolder(folderToDelete: Misskey.entities.DriveFolder) {
|
||||||
os.api('drive/folders/delete', {
|
misskeyApi('drive/folders/delete', {
|
||||||
folderId: folderToDelete.id,
|
folderId: folderToDelete.id,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// 削除時に親フォルダに移動
|
// 削除時に親フォルダに移動
|
||||||
|
@ -437,7 +438,7 @@ function move(target?: Misskey.entities.DriveFolder | Misskey.entities.DriveFold
|
||||||
|
|
||||||
fetching.value = true;
|
fetching.value = true;
|
||||||
|
|
||||||
os.api('drive/folders/show', {
|
misskeyApi('drive/folders/show', {
|
||||||
folderId: target,
|
folderId: target,
|
||||||
}).then(folderToMove => {
|
}).then(folderToMove => {
|
||||||
folder.value = folderToMove;
|
folder.value = folderToMove;
|
||||||
|
@ -536,7 +537,7 @@ async function fetch() {
|
||||||
const foldersMax = 30;
|
const foldersMax = 30;
|
||||||
const filesMax = 30;
|
const filesMax = 30;
|
||||||
|
|
||||||
const foldersPromise = os.api('drive/folders', {
|
const foldersPromise = misskeyApi('drive/folders', {
|
||||||
folderId: folder.value ? folder.value.id : null,
|
folderId: folder.value ? folder.value.id : null,
|
||||||
limit: foldersMax + 1,
|
limit: foldersMax + 1,
|
||||||
}).then(fetchedFolders => {
|
}).then(fetchedFolders => {
|
||||||
|
@ -547,7 +548,7 @@ async function fetch() {
|
||||||
return fetchedFolders;
|
return fetchedFolders;
|
||||||
});
|
});
|
||||||
|
|
||||||
const filesPromise = os.api('drive/files', {
|
const filesPromise = misskeyApi('drive/files', {
|
||||||
folderId: folder.value ? folder.value.id : null,
|
folderId: folder.value ? folder.value.id : null,
|
||||||
type: props.type,
|
type: props.type,
|
||||||
limit: filesMax + 1,
|
limit: filesMax + 1,
|
||||||
|
@ -572,7 +573,7 @@ function fetchMoreFolders() {
|
||||||
|
|
||||||
const max = 30;
|
const max = 30;
|
||||||
|
|
||||||
os.api('drive/folders', {
|
misskeyApi('drive/folders', {
|
||||||
folderId: folder.value ? folder.value.id : null,
|
folderId: folder.value ? folder.value.id : null,
|
||||||
type: props.type,
|
type: props.type,
|
||||||
untilId: folders.value.at(-1)?.id,
|
untilId: folders.value.at(-1)?.id,
|
||||||
|
@ -595,7 +596,7 @@ function fetchMoreFiles() {
|
||||||
const max = 30;
|
const max = 30;
|
||||||
|
|
||||||
// ファイル一覧取得
|
// ファイル一覧取得
|
||||||
os.api('drive/files', {
|
misskeyApi('drive/files', {
|
||||||
folderId: folder.value ? folder.value.id : null,
|
folderId: folder.value ? folder.value.id : null,
|
||||||
type: props.type,
|
type: props.type,
|
||||||
untilId: files.value.at(-1)?.id,
|
untilId: files.value.at(-1)?.id,
|
||||||
|
|
|
@ -10,11 +10,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
|
||||||
const meta = ref<Misskey.entities.MetaResponse>();
|
const meta = ref<Misskey.entities.MetaResponse>();
|
||||||
|
|
||||||
os.api('meta', { detail: true }).then(gotMeta => {
|
misskeyApi('meta', { detail: true }).then(gotMeta => {
|
||||||
meta.value = gotMeta;
|
meta.value = gotMeta;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -38,11 +38,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { useStream } from '@/stream.js';
|
import { useStream } from '@/stream.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { claimAchievement } from '@/scripts/achievements.js';
|
import { claimAchievement } from '@/scripts/achievements.js';
|
||||||
import { $i } from '@/account.js';
|
import { $i } from '@/account.js';
|
||||||
import { defaultStore } from "@/store.js";
|
import { defaultStore } from '@/store.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
user: Misskey.entities.UserDetailed,
|
user: Misskey.entities.UserDetailed,
|
||||||
|
@ -63,7 +64,7 @@ const wait = ref(false);
|
||||||
const connection = useStream().useChannel('main');
|
const connection = useStream().useChannel('main');
|
||||||
|
|
||||||
if (props.user.isFollowing == null) {
|
if (props.user.isFollowing == null) {
|
||||||
os.api('users/show', {
|
misskeyApi('users/show', {
|
||||||
userId: props.user.id,
|
userId: props.user.id,
|
||||||
})
|
})
|
||||||
.then(onFollowChange);
|
.then(onFollowChange);
|
||||||
|
@ -88,17 +89,17 @@ async function onClick() {
|
||||||
|
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
|
|
||||||
await os.api('following/delete', {
|
await misskeyApi('following/delete', {
|
||||||
userId: props.user.id,
|
userId: props.user.id,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (hasPendingFollowRequestFromYou.value) {
|
if (hasPendingFollowRequestFromYou.value) {
|
||||||
await os.api('following/requests/cancel', {
|
await misskeyApi('following/requests/cancel', {
|
||||||
userId: props.user.id,
|
userId: props.user.id,
|
||||||
});
|
});
|
||||||
hasPendingFollowRequestFromYou.value = false;
|
hasPendingFollowRequestFromYou.value = false;
|
||||||
} else {
|
} else {
|
||||||
await os.api('following/create', {
|
await misskeyApi('following/create', {
|
||||||
userId: props.user.id,
|
userId: props.user.id,
|
||||||
withReplies: defaultStore.state.defaultWithReplies,
|
withReplies: defaultStore.state.defaultWithReplies,
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<MkSpacer :marginMin="20" :marginMax="32">
|
<MkSpacer :marginMin="20" :marginMax="32">
|
||||||
<div class="_gaps_m">
|
<div v-if="Object.keys(form).filter(item => !form[item].hidden).length > 0" class="_gaps_m">
|
||||||
<template v-for="item in Object.keys(form).filter(item => !form[item].hidden)">
|
<template v-for="item in Object.keys(form).filter(item => !form[item].hidden)">
|
||||||
<MkInput v-if="form[item].type === 'number'" v-model="values[item]" type="number" :step="form[item].step || 1">
|
<MkInput v-if="form[item].type === 'number'" v-model="values[item]" type="number" :step="form[item].step || 1">
|
||||||
<template #label><span v-text="form[item].label || item"></span><span v-if="form[item].required === false"> ({{ i18n.ts.optional }})</span></template>
|
<template #label><span v-text="form[item].label || item"></span><span v-if="form[item].required === false"> ({{ i18n.ts.optional }})</span></template>
|
||||||
|
@ -55,6 +55,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</MkButton>
|
</MkButton>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else class="_fullinfo">
|
||||||
|
<img :src="infoImageUrl" class="_ghost"/>
|
||||||
|
<div>{{ i18n.ts.nothing }}</div>
|
||||||
|
</div>
|
||||||
</MkSpacer>
|
</MkSpacer>
|
||||||
</MkModalWindow>
|
</MkModalWindow>
|
||||||
</template>
|
</template>
|
||||||
|
@ -70,6 +74,7 @@ import MkButton from './MkButton.vue';
|
||||||
import MkRadios from './MkRadios.vue';
|
import MkRadios from './MkRadios.vue';
|
||||||
import MkModalWindow from '@/components/MkModalWindow.vue';
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
import { infoImageUrl } from '@/instance.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
title: string;
|
title: string;
|
||||||
|
|
|
@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, nextTick, watch, shallowRef, ref } from 'vue';
|
import { onMounted, nextTick, watch, shallowRef, ref } from 'vue';
|
||||||
import { Chart } from 'chart.js';
|
import { Chart } from 'chart.js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
||||||
import { alpha } from '@/scripts/color.js';
|
import { alpha } from '@/scripts/color.js';
|
||||||
|
@ -72,19 +72,19 @@ async function renderChart() {
|
||||||
let values;
|
let values;
|
||||||
|
|
||||||
if (props.src === 'active-users') {
|
if (props.src === 'active-users') {
|
||||||
const raw = await os.api('charts/active-users', { limit: chartLimit, span: 'day' });
|
const raw = await misskeyApi('charts/active-users', { limit: chartLimit, span: 'day' });
|
||||||
values = raw.readWrite;
|
values = raw.readWrite;
|
||||||
} else if (props.src === 'notes') {
|
} else if (props.src === 'notes') {
|
||||||
const raw = await os.api('charts/notes', { limit: chartLimit, span: 'day' });
|
const raw = await misskeyApi('charts/notes', { limit: chartLimit, span: 'day' });
|
||||||
values = raw.local.inc;
|
values = raw.local.inc;
|
||||||
} else if (props.src === 'ap-requests-inbox-received') {
|
} else if (props.src === 'ap-requests-inbox-received') {
|
||||||
const raw = await os.api('charts/ap-request', { limit: chartLimit, span: 'day' });
|
const raw = await misskeyApi('charts/ap-request', { limit: chartLimit, span: 'day' });
|
||||||
values = raw.inboxReceived;
|
values = raw.inboxReceived;
|
||||||
} else if (props.src === 'ap-requests-deliver-succeeded') {
|
} else if (props.src === 'ap-requests-deliver-succeeded') {
|
||||||
const raw = await os.api('charts/ap-request', { limit: chartLimit, span: 'day' });
|
const raw = await misskeyApi('charts/ap-request', { limit: chartLimit, span: 'day' });
|
||||||
values = raw.deliverSucceeded;
|
values = raw.deliverSucceeded;
|
||||||
} else if (props.src === 'ap-requests-deliver-failed') {
|
} else if (props.src === 'ap-requests-deliver-failed') {
|
||||||
const raw = await os.api('charts/ap-request', { limit: chartLimit, span: 'day' });
|
const raw = await misskeyApi('charts/ap-request', { limit: chartLimit, span: 'day' });
|
||||||
values = raw.deliverFailed;
|
values = raw.deliverFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkMiniChart from '@/components/MkMiniChart.vue';
|
import MkMiniChart from '@/components/MkMiniChart.vue';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||||
import { getProxiedImageUrlNullable } from '@/scripts/media-proxy.js';
|
import { getProxiedImageUrlNullable } from '@/scripts/media-proxy.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -27,7 +27,7 @@ const props = defineProps<{
|
||||||
|
|
||||||
const chartValues = ref<number[] | null>(null);
|
const chartValues = ref<number[] | null>(null);
|
||||||
|
|
||||||
os.apiGet('charts/instance', { host: props.instance.host, limit: 16 + 1, span: 'day' }).then(res => {
|
misskeyApiGet('charts/instance', { host: props.instance.host, limit: 16 + 1, span: 'day' }).then(res => {
|
||||||
// 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く
|
// 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く
|
||||||
res['requests.received'].splice(0, 1);
|
res['requests.received'].splice(0, 1);
|
||||||
chartValues.value = res['requests.received'];
|
chartValues.value = res['requests.received'];
|
||||||
|
|
|
@ -90,6 +90,7 @@ import MkSelect from '@/components/MkSelect.vue';
|
||||||
import MkChart from '@/components/MkChart.vue';
|
import MkChart from '@/components/MkChart.vue';
|
||||||
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import MkHeatmap from '@/components/MkHeatmap.vue';
|
import MkHeatmap from '@/components/MkHeatmap.vue';
|
||||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
||||||
|
@ -162,7 +163,7 @@ function createDoughnut(chartEl, tooltip, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
os.apiGet('federation/stats', { limit: 30 }).then(fedStats => {
|
misskeyApiGet('federation/stats', { limit: 30 }).then(fedStats => {
|
||||||
createDoughnut(subDoughnutEl.value, externalTooltipHandler1, fedStats.topSubInstances.map(x => ({
|
createDoughnut(subDoughnutEl.value, externalTooltipHandler1, fedStats.topSubInstances.map(x => ({
|
||||||
name: x.host,
|
name: x.host,
|
||||||
color: x.themeColor,
|
color: x.themeColor,
|
||||||
|
|
|
@ -170,6 +170,7 @@ import { checkWordMute } from '@/scripts/check-word-mute.js';
|
||||||
import { userPage } from '@/filters/user.js';
|
import { userPage } from '@/filters/user.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import * as sound from '@/scripts/sound.js';
|
import * as sound from '@/scripts/sound.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { defaultStore, noteViewInterruptors } from '@/store.js';
|
import { defaultStore, noteViewInterruptors } from '@/store.js';
|
||||||
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
||||||
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
|
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
|
||||||
|
@ -277,7 +278,7 @@ const keymap = {
|
||||||
};
|
};
|
||||||
|
|
||||||
provide('react', (reaction: string) => {
|
provide('react', (reaction: string) => {
|
||||||
os.api('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
reaction: reaction,
|
reaction: reaction,
|
||||||
});
|
});
|
||||||
|
@ -298,7 +299,7 @@ if (props.mock) {
|
||||||
|
|
||||||
if (!props.mock) {
|
if (!props.mock) {
|
||||||
useTooltip(renoteButton, async (showing) => {
|
useTooltip(renoteButton, async (showing) => {
|
||||||
const renotes = await os.api('notes/renotes', {
|
const renotes = await misskeyApi('notes/renotes', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
limit: 11,
|
limit: 11,
|
||||||
});
|
});
|
||||||
|
@ -350,7 +351,7 @@ function react(viaKeyboard = false): void {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
os.api('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
reaction: '❤️',
|
reaction: '❤️',
|
||||||
});
|
});
|
||||||
|
@ -371,7 +372,7 @@ function react(viaKeyboard = false): void {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
os.api('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
reaction: reaction,
|
reaction: reaction,
|
||||||
});
|
});
|
||||||
|
@ -393,7 +394,7 @@ function undoReact(note): void {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
os.api('notes/reactions/delete', {
|
misskeyApi('notes/reactions/delete', {
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -453,7 +454,7 @@ function showRenoteMenu(viaKeyboard = false): void {
|
||||||
icon: 'ti ti-trash',
|
icon: 'ti ti-trash',
|
||||||
danger: true,
|
danger: true,
|
||||||
action: () => {
|
action: () => {
|
||||||
os.api('notes/delete', {
|
misskeyApi('notes/delete', {
|
||||||
noteId: note.value.id,
|
noteId: note.value.id,
|
||||||
});
|
});
|
||||||
isDeleted.value = true;
|
isDeleted.value = true;
|
||||||
|
@ -499,7 +500,7 @@ function focusAfter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function readPromo() {
|
function readPromo() {
|
||||||
os.api('promo/read', {
|
misskeyApi('promo/read', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
});
|
});
|
||||||
isDeleted.value = true;
|
isDeleted.value = true;
|
||||||
|
|
|
@ -210,6 +210,7 @@ import { checkWordMute } from '@/scripts/check-word-mute.js';
|
||||||
import { userPage } from '@/filters/user.js';
|
import { userPage } from '@/filters/user.js';
|
||||||
import { notePage } from '@/filters/note.js';
|
import { notePage } from '@/filters/note.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import * as sound from '@/scripts/sound.js';
|
import * as sound from '@/scripts/sound.js';
|
||||||
import { defaultStore, noteViewInterruptors } from '@/store.js';
|
import { defaultStore, noteViewInterruptors } from '@/store.js';
|
||||||
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
||||||
|
@ -292,7 +293,7 @@ const keymap = {
|
||||||
};
|
};
|
||||||
|
|
||||||
provide('react', (reaction: string) => {
|
provide('react', (reaction: string) => {
|
||||||
os.api('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
reaction: reaction,
|
reaction: reaction,
|
||||||
});
|
});
|
||||||
|
@ -326,7 +327,7 @@ useNoteCapture({
|
||||||
});
|
});
|
||||||
|
|
||||||
useTooltip(renoteButton, async (showing) => {
|
useTooltip(renoteButton, async (showing) => {
|
||||||
const renotes = await os.api('notes/renotes', {
|
const renotes = await misskeyApi('notes/renotes', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
limit: 11,
|
limit: 11,
|
||||||
});
|
});
|
||||||
|
@ -371,7 +372,7 @@ function react(viaKeyboard = false): void {
|
||||||
if (appearNote.value.reactionAcceptance === 'likeOnly') {
|
if (appearNote.value.reactionAcceptance === 'likeOnly') {
|
||||||
sound.play('reaction');
|
sound.play('reaction');
|
||||||
|
|
||||||
os.api('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
reaction: '❤️',
|
reaction: '❤️',
|
||||||
});
|
});
|
||||||
|
@ -387,7 +388,7 @@ function react(viaKeyboard = false): void {
|
||||||
reactionPicker.show(reactButton.value, reaction => {
|
reactionPicker.show(reactButton.value, reaction => {
|
||||||
sound.play('reaction');
|
sound.play('reaction');
|
||||||
|
|
||||||
os.api('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
reaction: reaction,
|
reaction: reaction,
|
||||||
});
|
});
|
||||||
|
@ -403,7 +404,7 @@ function react(viaKeyboard = false): void {
|
||||||
function undoReact(note): void {
|
function undoReact(note): void {
|
||||||
const oldReaction = note.myReaction;
|
const oldReaction = note.myReaction;
|
||||||
if (!oldReaction) return;
|
if (!oldReaction) return;
|
||||||
os.api('notes/reactions/delete', {
|
misskeyApi('notes/reactions/delete', {
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -446,7 +447,7 @@ function showRenoteMenu(viaKeyboard = false): void {
|
||||||
icon: 'ti ti-trash',
|
icon: 'ti ti-trash',
|
||||||
danger: true,
|
danger: true,
|
||||||
action: () => {
|
action: () => {
|
||||||
os.api('notes/delete', {
|
misskeyApi('notes/delete', {
|
||||||
noteId: note.value.id,
|
noteId: note.value.id,
|
||||||
});
|
});
|
||||||
isDeleted.value = true;
|
isDeleted.value = true;
|
||||||
|
@ -468,7 +469,7 @@ const repliesLoaded = ref(false);
|
||||||
|
|
||||||
function loadReplies() {
|
function loadReplies() {
|
||||||
repliesLoaded.value = true;
|
repliesLoaded.value = true;
|
||||||
os.api('notes/children', {
|
misskeyApi('notes/children', {
|
||||||
noteId: appearNote.value.id,
|
noteId: appearNote.value.id,
|
||||||
limit: 30,
|
limit: 30,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
@ -480,7 +481,7 @@ const conversationLoaded = ref(false);
|
||||||
|
|
||||||
function loadConversation() {
|
function loadConversation() {
|
||||||
conversationLoaded.value = true;
|
conversationLoaded.value = true;
|
||||||
os.api('notes/conversation', {
|
misskeyApi('notes/conversation', {
|
||||||
noteId: appearNote.value.replyId,
|
noteId: appearNote.value.replyId,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
conversation.value = res.reverse();
|
conversation.value = res.reverse();
|
||||||
|
|
|
@ -46,7 +46,7 @@ import MkNoteHeader from '@/components/MkNoteHeader.vue';
|
||||||
import MkSubNoteContent from '@/components/MkSubNoteContent.vue';
|
import MkSubNoteContent from '@/components/MkSubNoteContent.vue';
|
||||||
import MkCwButton from '@/components/MkCwButton.vue';
|
import MkCwButton from '@/components/MkCwButton.vue';
|
||||||
import { notePage } from '@/filters/note.js';
|
import { notePage } from '@/filters/note.js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { $i } from '@/account.js';
|
import { $i } from '@/account.js';
|
||||||
import { userPage } from '@/filters/user.js';
|
import { userPage } from '@/filters/user.js';
|
||||||
|
@ -68,7 +68,7 @@ const showContent = ref(false);
|
||||||
const replies = ref<Misskey.entities.Note[]>([]);
|
const replies = ref<Misskey.entities.Note[]>([]);
|
||||||
|
|
||||||
if (props.detail) {
|
if (props.detail) {
|
||||||
os.api('notes/children', {
|
misskeyApi('notes/children', {
|
||||||
noteId: props.note.id,
|
noteId: props.note.id,
|
||||||
limit: 5,
|
limit: 5,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
|
@ -145,7 +145,7 @@ import { getNoteSummary } from '@/scripts/get-note-summary.js';
|
||||||
import { notePage } from '@/filters/note.js';
|
import { notePage } from '@/filters/note.js';
|
||||||
import { userPage } from '@/filters/user.js';
|
import { userPage } from '@/filters/user.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { $i } from '@/account.js';
|
import { $i } from '@/account.js';
|
||||||
import { infoImageUrl } from '@/instance.js';
|
import { infoImageUrl } from '@/instance.js';
|
||||||
|
|
||||||
|
@ -162,12 +162,12 @@ const followRequestDone = ref(false);
|
||||||
|
|
||||||
const acceptFollowRequest = () => {
|
const acceptFollowRequest = () => {
|
||||||
followRequestDone.value = true;
|
followRequestDone.value = true;
|
||||||
os.api('following/requests/accept', { userId: props.notification.user.id });
|
misskeyApi('following/requests/accept', { userId: props.notification.user.id });
|
||||||
};
|
};
|
||||||
|
|
||||||
const rejectFollowRequest = () => {
|
const rejectFollowRequest = () => {
|
||||||
followRequestDone.value = true;
|
followRequestDone.value = true;
|
||||||
os.api('following/requests/reject', { userId: props.notification.user.id });
|
misskeyApi('following/requests/reject', { userId: props.notification.user.id });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, watch } from 'vue';
|
import { reactive, watch } from 'vue';
|
||||||
import gsap from 'gsap';
|
|
||||||
import number from '@/filters/number.js';
|
import number from '@/filters/number.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -20,8 +19,24 @@ const tweened = reactive({
|
||||||
number: 0,
|
number: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(() => props.value, (n) => {
|
watch(() => props.value, (to, from) => {
|
||||||
gsap.to(tweened, { duration: 1, number: Number(n) || 0 });
|
// requestAnimationFrameを利用して、500msでfromからtoまでを1次関数的に変化させる
|
||||||
|
let start: number | null = null;
|
||||||
|
|
||||||
|
function step(timestamp: number) {
|
||||||
|
if (start === null) {
|
||||||
|
start = timestamp;
|
||||||
|
}
|
||||||
|
const elapsed = timestamp - start;
|
||||||
|
tweened.number = (from ?? 0) + (to - (from ?? 0)) * elapsed / 500;
|
||||||
|
if (elapsed < 500) {
|
||||||
|
window.requestAnimationFrame(step);
|
||||||
|
} else {
|
||||||
|
tweened.number = to;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.requestAnimationFrame(step);
|
||||||
}, {
|
}, {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
});
|
});
|
||||||
|
|
|
@ -46,6 +46,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { computed, ComputedRef, isRef, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, ref, shallowRef, watch } from 'vue';
|
import { computed, ComputedRef, isRef, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, ref, shallowRef, watch } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { onScrollTop, isTopVisible, getBodyScrollHeight, getScrollContainer, onScrollBottom, scrollToBottom, scroll, isBottomVisible } from '@/scripts/scroll.js';
|
import { onScrollTop, isTopVisible, getBodyScrollHeight, getScrollContainer, onScrollBottom, scrollToBottom, scroll, isBottomVisible } from '@/scripts/scroll.js';
|
||||||
import { useDocumentVisibility } from '@/scripts/use-document-visibility.js';
|
import { useDocumentVisibility } from '@/scripts/use-document-visibility.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
|
@ -203,7 +204,7 @@ async function init(): Promise<void> {
|
||||||
queue.value = new Map();
|
queue.value = new Map();
|
||||||
fetching.value = true;
|
fetching.value = true;
|
||||||
const params = props.pagination.params ? isRef(props.pagination.params) ? props.pagination.params.value : props.pagination.params : {};
|
const params = props.pagination.params ? isRef(props.pagination.params) ? props.pagination.params.value : props.pagination.params : {};
|
||||||
await os.api(props.pagination.endpoint, {
|
await misskeyApi(props.pagination.endpoint, {
|
||||||
...params,
|
...params,
|
||||||
limit: props.pagination.limit ?? 10,
|
limit: props.pagination.limit ?? 10,
|
||||||
allowPartial: true,
|
allowPartial: true,
|
||||||
|
@ -239,7 +240,7 @@ const fetchMore = async (): Promise<void> => {
|
||||||
if (!more.value || fetching.value || moreFetching.value || items.value.size === 0) return;
|
if (!more.value || fetching.value || moreFetching.value || items.value.size === 0) return;
|
||||||
moreFetching.value = true;
|
moreFetching.value = true;
|
||||||
const params = props.pagination.params ? isRef(props.pagination.params) ? props.pagination.params.value : props.pagination.params : {};
|
const params = props.pagination.params ? isRef(props.pagination.params) ? props.pagination.params.value : props.pagination.params : {};
|
||||||
await os.api(props.pagination.endpoint, {
|
await misskeyApi(props.pagination.endpoint, {
|
||||||
...params,
|
...params,
|
||||||
limit: SECOND_FETCH_LIMIT,
|
limit: SECOND_FETCH_LIMIT,
|
||||||
...(props.pagination.offsetMode ? {
|
...(props.pagination.offsetMode ? {
|
||||||
|
@ -303,7 +304,7 @@ const fetchMoreAhead = async (): Promise<void> => {
|
||||||
if (!more.value || fetching.value || moreFetching.value || items.value.size === 0) return;
|
if (!more.value || fetching.value || moreFetching.value || items.value.size === 0) return;
|
||||||
moreFetching.value = true;
|
moreFetching.value = true;
|
||||||
const params = props.pagination.params ? isRef(props.pagination.params) ? props.pagination.params.value : props.pagination.params : {};
|
const params = props.pagination.params ? isRef(props.pagination.params) ? props.pagination.params.value : props.pagination.params : {};
|
||||||
await os.api(props.pagination.endpoint, {
|
await misskeyApi(props.pagination.endpoint, {
|
||||||
...params,
|
...params,
|
||||||
limit: SECOND_FETCH_LIMIT,
|
limit: SECOND_FETCH_LIMIT,
|
||||||
...(props.pagination.offsetMode ? {
|
...(props.pagination.offsetMode ? {
|
||||||
|
|
|
@ -41,7 +41,9 @@ import MkInput from '@/components/MkInput.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkModalWindow from '@/components/MkModalWindow.vue';
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { $i } from '@/account.js';
|
import { signinRequired } from '@/account.js';
|
||||||
|
|
||||||
|
const $i = signinRequired();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'done', v: { password: string; token: string | null; }): void;
|
(ev: 'done', v: { password: string; token: string | null; }): void;
|
||||||
|
|
|
@ -32,11 +32,13 @@ import * as Misskey from 'misskey-js';
|
||||||
import { sum } from '@/scripts/array.js';
|
import { sum } from '@/scripts/array.js';
|
||||||
import { pleaseLogin } from '@/scripts/please-login.js';
|
import { pleaseLogin } from '@/scripts/please-login.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { useInterval } from '@/scripts/use-interval.js';
|
import { useInterval } from '@/scripts/use-interval.js';
|
||||||
|
import { WithNonNullable } from '@/type.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
note: Misskey.entities.Note;
|
note: WithNonNullable<Misskey.entities.Note, 'poll'>;
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
@ -83,7 +85,7 @@ const vote = async (id) => {
|
||||||
});
|
});
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
|
|
||||||
await os.api('notes/polls/vote', {
|
await misskeyApi('notes/polls/vote', {
|
||||||
noteId: props.note.id,
|
noteId: props.note.id,
|
||||||
choice: id,
|
choice: id,
|
||||||
});
|
});
|
||||||
|
|
|
@ -115,12 +115,13 @@ import { extractMentions } from '@/scripts/extract-mentions.js';
|
||||||
import { formatTimeString } from '@/scripts/format-time-string.js';
|
import { formatTimeString } from '@/scripts/format-time-string.js';
|
||||||
import { Autocomplete } from '@/scripts/autocomplete.js';
|
import { Autocomplete } from '@/scripts/autocomplete.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { selectFiles } from '@/scripts/select-file.js';
|
import { selectFiles } from '@/scripts/select-file.js';
|
||||||
import { defaultStore, notePostInterruptors, postFormActions } from '@/store.js';
|
import { defaultStore, notePostInterruptors, postFormActions } from '@/store.js';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import { $i, notesCount, incNotesCount, getAccounts, openAccountMenu as openAccountMenu_ } from '@/account.js';
|
import { signinRequired, notesCount, incNotesCount, getAccounts, openAccountMenu as openAccountMenu_ } from '@/account.js';
|
||||||
import { uploadFile } from '@/scripts/upload.js';
|
import { uploadFile } from '@/scripts/upload.js';
|
||||||
import { deepClone } from '@/scripts/clone.js';
|
import { deepClone } from '@/scripts/clone.js';
|
||||||
import MkRippleEffect from '@/components/MkRippleEffect.vue';
|
import MkRippleEffect from '@/components/MkRippleEffect.vue';
|
||||||
|
@ -129,6 +130,8 @@ import { claimAchievement } from '@/scripts/achievements.js';
|
||||||
import { emojiPicker } from '@/scripts/emoji-picker.js';
|
import { emojiPicker } from '@/scripts/emoji-picker.js';
|
||||||
import { mfmFunctionPicker } from '@/scripts/mfm-function-picker.js';
|
import { mfmFunctionPicker } from '@/scripts/mfm-function-picker.js';
|
||||||
|
|
||||||
|
const $i = signinRequired();
|
||||||
|
|
||||||
const modal = inject('modal');
|
const modal = inject('modal');
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
|
@ -307,7 +310,7 @@ if (props.reply && props.reply.text != null) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($i?.isSilenced && visibility.value === 'public') {
|
if ($i.isSilenced && visibility.value === 'public') {
|
||||||
visibility.value = 'home';
|
visibility.value = 'home';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,7 +331,7 @@ if (props.reply && ['home', 'followers', 'specified'].includes(props.reply.visib
|
||||||
|
|
||||||
if (visibility.value === 'specified') {
|
if (visibility.value === 'specified') {
|
||||||
if (props.reply.visibleUserIds) {
|
if (props.reply.visibleUserIds) {
|
||||||
os.api('users/show', {
|
misskeyApi('users/show', {
|
||||||
userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId),
|
userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId),
|
||||||
}).then(users => {
|
}).then(users => {
|
||||||
users.forEach(pushVisibleUser);
|
users.forEach(pushVisibleUser);
|
||||||
|
@ -336,7 +339,7 @@ if (props.reply && ['home', 'followers', 'specified'].includes(props.reply.visib
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.reply.userId !== $i.id) {
|
if (props.reply.userId !== $i.id) {
|
||||||
os.api('users/show', { userId: props.reply.userId }).then(user => {
|
misskeyApi('users/show', { userId: props.reply.userId }).then(user => {
|
||||||
pushVisibleUser(user);
|
pushVisibleUser(user);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -383,7 +386,7 @@ function addMissingMention() {
|
||||||
|
|
||||||
for (const x of extractMentions(ast)) {
|
for (const x of extractMentions(ast)) {
|
||||||
if (!visibleUsers.value.some(u => (u.username === x.username) && (u.host === x.host))) {
|
if (!visibleUsers.value.some(u => (u.username === x.username) && (u.host === x.host))) {
|
||||||
os.api('users/show', { username: x.username, host: x.host }).then(user => {
|
misskeyApi('users/show', { username: x.username, host: x.host }).then(user => {
|
||||||
visibleUsers.value.push(user);
|
visibleUsers.value.push(user);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -460,7 +463,7 @@ function setVisibility() {
|
||||||
|
|
||||||
os.popup(defineAsyncComponent(() => import('@/components/MkVisibilityPicker.vue')), {
|
os.popup(defineAsyncComponent(() => import('@/components/MkVisibilityPicker.vue')), {
|
||||||
currentVisibility: visibility.value,
|
currentVisibility: visibility.value,
|
||||||
isSilenced: $i?.isSilenced,
|
isSilenced: $i.isSilenced,
|
||||||
localOnly: localOnly.value,
|
localOnly: localOnly.value,
|
||||||
src: visibilityButton.value,
|
src: visibilityButton.value,
|
||||||
}, {
|
}, {
|
||||||
|
@ -784,7 +787,7 @@ async function post(ev?: MouseEvent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
posting.value = true;
|
posting.value = true;
|
||||||
os.api('notes/create', postData, token).then(() => {
|
misskeyApi('notes/create', postData, token).then(() => {
|
||||||
if (props.freezeAfterPosted) {
|
if (props.freezeAfterPosted) {
|
||||||
posted.value = true;
|
posted.value = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -24,6 +24,7 @@ import { defineAsyncComponent, inject } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
|
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
|
const Sortable = defineAsyncComponent(() => import('vuedraggable').then(x => x.default));
|
||||||
|
@ -61,7 +62,7 @@ function toggleSensitive(file) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
os.api('drive/files/update', {
|
misskeyApi('drive/files/update', {
|
||||||
fileId: file.id,
|
fileId: file.id,
|
||||||
isSensitive: !file.isSensitive,
|
isSensitive: !file.isSensitive,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -78,7 +79,7 @@ async function rename(file) {
|
||||||
allowEmpty: false,
|
allowEmpty: false,
|
||||||
});
|
});
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
os.api('drive/files/update', {
|
misskeyApi('drive/files/update', {
|
||||||
fileId: file.id,
|
fileId: file.id,
|
||||||
name: result,
|
name: result,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -96,7 +97,7 @@ async function describe(file) {
|
||||||
}, {
|
}, {
|
||||||
done: caption => {
|
done: caption => {
|
||||||
let comment = caption.length === 0 ? null : caption;
|
let comment = caption.length === 0 ? null : caption;
|
||||||
os.api('drive/files/update', {
|
misskeyApi('drive/files/update', {
|
||||||
fileId: file.id,
|
fileId: file.id,
|
||||||
comment: comment,
|
comment: comment,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|
|
@ -45,7 +45,8 @@ import { ref } from 'vue';
|
||||||
import { $i, getAccounts } from '@/account.js';
|
import { $i, getAccounts } from '@/account.js';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import { api, apiWithDialog, promiseDialog } from '@/os.js';
|
import { apiWithDialog, promiseDialog } from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
|
@ -82,7 +83,7 @@ function subscribe() {
|
||||||
pushSubscription.value = subscription;
|
pushSubscription.value = subscription;
|
||||||
|
|
||||||
// Register
|
// Register
|
||||||
pushRegistrationInServer.value = await api('sw/register', {
|
pushRegistrationInServer.value = await misskeyApi('sw/register', {
|
||||||
endpoint: subscription.endpoint,
|
endpoint: subscription.endpoint,
|
||||||
auth: encode(subscription.getKey('auth')),
|
auth: encode(subscription.getKey('auth')),
|
||||||
publickey: encode(subscription.getKey('p256dh')),
|
publickey: encode(subscription.getKey('p256dh')),
|
||||||
|
@ -159,7 +160,7 @@ if (navigator.serviceWorker == null) {
|
||||||
supported.value = true;
|
supported.value = true;
|
||||||
|
|
||||||
if (pushSubscription.value) {
|
if (pushSubscription.value) {
|
||||||
const res = await api('sw/show-registration', {
|
const res = await misskeyApi('sw/show-registration', {
|
||||||
endpoint: pushSubscription.value.endpoint,
|
endpoint: pushSubscription.value.endpoint,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ import * as Misskey from 'misskey-js';
|
||||||
import XDetails from '@/components/MkReactionsViewer.details.vue';
|
import XDetails from '@/components/MkReactionsViewer.details.vue';
|
||||||
import MkReactionIcon from '@/components/MkReactionIcon.vue';
|
import MkReactionIcon from '@/components/MkReactionIcon.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi, misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||||
import { useTooltip } from '@/scripts/use-tooltip.js';
|
import { useTooltip } from '@/scripts/use-tooltip.js';
|
||||||
import { $i } from '@/account.js';
|
import { $i } from '@/account.js';
|
||||||
import MkReactionEffect from '@/components/MkReactionEffect.vue';
|
import MkReactionEffect from '@/components/MkReactionEffect.vue';
|
||||||
|
@ -69,11 +70,11 @@ async function toggleReaction() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
os.api('notes/reactions/delete', {
|
misskeyApi('notes/reactions/delete', {
|
||||||
noteId: props.note.id,
|
noteId: props.note.id,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
if (oldReaction !== props.reaction) {
|
if (oldReaction !== props.reaction) {
|
||||||
os.api('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: props.note.id,
|
noteId: props.note.id,
|
||||||
reaction: props.reaction,
|
reaction: props.reaction,
|
||||||
});
|
});
|
||||||
|
@ -87,7 +88,7 @@ async function toggleReaction() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
os.api('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: props.note.id,
|
noteId: props.note.id,
|
||||||
reaction: props.reaction,
|
reaction: props.reaction,
|
||||||
});
|
});
|
||||||
|
@ -117,7 +118,7 @@ onMounted(() => {
|
||||||
|
|
||||||
if (!mock) {
|
if (!mock) {
|
||||||
useTooltip(buttonEl, async (showing) => {
|
useTooltip(buttonEl, async (showing) => {
|
||||||
const reactions = await os.apiGet('notes/reactions', {
|
const reactions = await misskeyApiGet('notes/reactions', {
|
||||||
noteId: props.note.id,
|
noteId: props.note.id,
|
||||||
type: props.reaction,
|
type: props.reaction,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
|
|
|
@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, nextTick, shallowRef, ref } from 'vue';
|
import { onMounted, nextTick, shallowRef, ref } from 'vue';
|
||||||
import { Chart } from 'chart.js';
|
import { Chart } from 'chart.js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
||||||
import { alpha } from '@/scripts/color.js';
|
import { alpha } from '@/scripts/color.js';
|
||||||
|
@ -43,7 +43,7 @@ async function renderChart() {
|
||||||
|
|
||||||
const maxDays = wide ? 10 : narrow ? 5 : 7;
|
const maxDays = wide ? 10 : narrow ? 5 : 7;
|
||||||
|
|
||||||
let raw = await os.api('retention', { });
|
let raw = await misskeyApi('retention', { });
|
||||||
|
|
||||||
raw = raw.slice(0, maxDays + 1);
|
raw = raw.slice(0, maxDays + 1);
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
||||||
import { chartVLine } from '@/scripts/chart-vline.js';
|
import { chartVLine } from '@/scripts/chart-vline.js';
|
||||||
import { alpha } from '@/scripts/color.js';
|
import { alpha } from '@/scripts/color.js';
|
||||||
import { initChart } from '@/scripts/init-chart.js';
|
import { initChart } from '@/scripts/init-chart.js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
|
||||||
initChart();
|
initChart();
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ const getDate = (ymd: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
let raw = await os.api('retention', { });
|
let raw = await misskeyApi('retention', { });
|
||||||
|
|
||||||
const vLineColor = defaultStore.state.darkMode ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 0, 0, 0.2)';
|
const vLineColor = defaultStore.state.darkMode ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 0, 0, 0.2)';
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,14 @@ const emit = defineEmits<{
|
||||||
(ev: 'end'): void;
|
(ev: 'end'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const particles = [];
|
const particles: {
|
||||||
|
size: number;
|
||||||
|
xA: number;
|
||||||
|
yA: number;
|
||||||
|
xB: number;
|
||||||
|
yB: number;
|
||||||
|
color: string;
|
||||||
|
}[] = [];
|
||||||
const origin = 64;
|
const origin = 64;
|
||||||
const colors = ['#FF1493', '#00FFFF', '#FFE202'];
|
const colors = ['#FF1493', '#00FFFF', '#FFE202'];
|
||||||
const zIndex = os.claimZIndex('high');
|
const zIndex = os.claimZIndex('high');
|
||||||
|
|
|
@ -59,6 +59,7 @@ import MkInput from '@/components/MkInput.vue';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import { host as configHost } from '@/config.js';
|
import { host as configHost } from '@/config.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { login } from '@/account.js';
|
import { login } from '@/account.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
|
@ -95,7 +96,7 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
function onUsernameChange(): void {
|
function onUsernameChange(): void {
|
||||||
os.api('users/show', {
|
misskeyApi('users/show', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
}).then(userResponse => {
|
}).then(userResponse => {
|
||||||
user.value = userResponse;
|
user.value = userResponse;
|
||||||
|
@ -120,7 +121,7 @@ async function queryKey(): Promise<void> {
|
||||||
credentialRequest.value = null;
|
credentialRequest.value = null;
|
||||||
queryingKey.value = false;
|
queryingKey.value = false;
|
||||||
signing.value = true;
|
signing.value = true;
|
||||||
return os.api('signin', {
|
return misskeyApi('signin', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
credential: credential.toJSON(),
|
credential: credential.toJSON(),
|
||||||
|
@ -142,7 +143,7 @@ function onSubmit(): void {
|
||||||
signing.value = true;
|
signing.value = true;
|
||||||
if (!totpLogin.value && user.value && user.value.twoFactorEnabled) {
|
if (!totpLogin.value && user.value && user.value.twoFactorEnabled) {
|
||||||
if (webAuthnSupported() && user.value.securityKeys) {
|
if (webAuthnSupported() && user.value.securityKeys) {
|
||||||
os.api('signin', {
|
misskeyApi('signin', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
@ -159,7 +160,7 @@ function onSubmit(): void {
|
||||||
signing.value = false;
|
signing.value = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
os.api('signin', {
|
misskeyApi('signin', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
token: user.value?.twoFactorEnabled ? token.value : undefined,
|
token: user.value?.twoFactorEnabled ? token.value : undefined,
|
||||||
|
|
|
@ -84,6 +84,7 @@ import MkInput from './MkInput.vue';
|
||||||
import MkCaptcha, { type Captcha } from '@/components/MkCaptcha.vue';
|
import MkCaptcha, { type Captcha } from '@/components/MkCaptcha.vue';
|
||||||
import * as config from '@/config.js';
|
import * as config from '@/config.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { login } from '@/account.js';
|
import { login } from '@/account.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
@ -180,7 +181,7 @@ function onChangeUsername(): void {
|
||||||
usernameState.value = 'wait';
|
usernameState.value = 'wait';
|
||||||
usernameAbortController.value = new AbortController();
|
usernameAbortController.value = new AbortController();
|
||||||
|
|
||||||
os.api('username/available', {
|
misskeyApi('username/available', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
}, undefined, usernameAbortController.value.signal).then(result => {
|
}, undefined, usernameAbortController.value.signal).then(result => {
|
||||||
usernameState.value = result.available ? 'ok' : 'unavailable';
|
usernameState.value = result.available ? 'ok' : 'unavailable';
|
||||||
|
@ -203,7 +204,7 @@ function onChangeEmail(): void {
|
||||||
emailState.value = 'wait';
|
emailState.value = 'wait';
|
||||||
emailAbortController.value = new AbortController();
|
emailAbortController.value = new AbortController();
|
||||||
|
|
||||||
os.api('email-address/available', {
|
misskeyApi('email-address/available', {
|
||||||
emailAddress: email.value,
|
emailAddress: email.value,
|
||||||
}, undefined, emailAbortController.value.signal).then(result => {
|
}, undefined, emailAbortController.value.signal).then(result => {
|
||||||
emailState.value = result.available ? 'ok' :
|
emailState.value = result.available ? 'ok' :
|
||||||
|
@ -245,7 +246,7 @@ async function onSubmit(): Promise<void> {
|
||||||
submitting.value = true;
|
submitting.value = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await os.api('signup', {
|
await misskeyApi('signup', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
emailAddress: email.value,
|
emailAddress: email.value,
|
||||||
|
@ -262,7 +263,7 @@ async function onSubmit(): Promise<void> {
|
||||||
});
|
});
|
||||||
emit('signupEmailPending');
|
emit('signupEmailPending');
|
||||||
} else {
|
} else {
|
||||||
const res = await os.api('signin', {
|
const res = await misskeyApi('signin', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
password: password.value,
|
password: password.value,
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,13 +11,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:pagination="paginationQuery"
|
:pagination="paginationQuery"
|
||||||
:noGap="!defaultStore.state.showGapBetweenNotesInTimeline"
|
:noGap="!defaultStore.state.showGapBetweenNotesInTimeline"
|
||||||
@queue="emit('queue', $event)"
|
@queue="emit('queue', $event)"
|
||||||
@status="prComponent.setDisabled($event)"
|
@status="prComponent?.setDisabled($event)"
|
||||||
/>
|
/>
|
||||||
</MkPullToRefresh>
|
</MkPullToRefresh>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, watch, onUnmounted, provide, ref } from 'vue';
|
import { computed, watch, onUnmounted, provide, ref, shallowRef } from 'vue';
|
||||||
import { Connection } from 'misskey-js/built/streaming.js';
|
import { Connection } from 'misskey-js/built/streaming.js';
|
||||||
import MkNotes from '@/components/MkNotes.vue';
|
import MkNotes from '@/components/MkNotes.vue';
|
||||||
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
|
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
|
||||||
|
@ -62,12 +62,14 @@ type TimelineQueryType = {
|
||||||
roleId?: string
|
roleId?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const prComponent = ref<InstanceType<typeof MkPullToRefresh>>();
|
const prComponent = shallowRef<InstanceType<typeof MkPullToRefresh>>();
|
||||||
const tlComponent = ref<InstanceType<typeof MkNotes>>();
|
const tlComponent = shallowRef<InstanceType<typeof MkNotes>>();
|
||||||
|
|
||||||
let tlNotesCount = 0;
|
let tlNotesCount = 0;
|
||||||
|
|
||||||
const prepend = note => {
|
function prepend(note) {
|
||||||
|
if (tlComponent.value == null) return;
|
||||||
|
|
||||||
tlNotesCount++;
|
tlNotesCount++;
|
||||||
|
|
||||||
if (instance.notesPerOneAd > 0 && tlNotesCount % instance.notesPerOneAd === 0) {
|
if (instance.notesPerOneAd > 0 && tlNotesCount % instance.notesPerOneAd === 0) {
|
||||||
|
@ -81,7 +83,7 @@ const prepend = note => {
|
||||||
if (props.sound) {
|
if (props.sound) {
|
||||||
sound.play($i && (note.userId === $i.id) ? 'noteMy' : 'note');
|
sound.play($i && (note.userId === $i.id) ? 'noteMy' : 'note');
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: Connection;
|
||||||
let connection2: Connection;
|
let connection2: Connection;
|
||||||
|
@ -246,6 +248,8 @@ onUnmounted(() => {
|
||||||
|
|
||||||
function reloadTimeline() {
|
function reloadTimeline() {
|
||||||
return new Promise<void>((res) => {
|
return new Promise<void>((res) => {
|
||||||
|
if (tlComponent.value == null) return;
|
||||||
|
|
||||||
tlNotesCount = 0;
|
tlNotesCount = 0;
|
||||||
|
|
||||||
tlComponent.value.pagingComponent?.reload().then(() => {
|
tlComponent.value.pagingComponent?.reload().then(() => {
|
||||||
|
|
|
@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:withOkButton="true"
|
:withOkButton="true"
|
||||||
:okButtonDisabled="false"
|
:okButtonDisabled="false"
|
||||||
:canClose="false"
|
:canClose="false"
|
||||||
@close="dialog.close()"
|
@close="dialog?.close()"
|
||||||
@closed="$emit('closed')"
|
@closed="$emit('closed')"
|
||||||
@ok="ok()"
|
@ok="ok()"
|
||||||
>
|
>
|
||||||
|
@ -87,7 +87,7 @@ function ok(): void {
|
||||||
name: name.value,
|
name: name.value,
|
||||||
permissions: Object.keys(permissions.value).filter(p => permissions.value[p]),
|
permissions: Object.keys(permissions.value).filter(p => permissions.value[p]),
|
||||||
});
|
});
|
||||||
dialog.value.close();
|
dialog.value?.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableAll(): void {
|
function disableAll(): void {
|
||||||
|
|
|
@ -13,8 +13,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
>
|
>
|
||||||
<div v-show="showing" ref="el" :class="$style.root" class="_acrylic _shadow" :style="{ zIndex, maxWidth: maxWidth + 'px' }">
|
<div v-show="showing" ref="el" :class="$style.root" class="_acrylic _shadow" :style="{ zIndex, maxWidth: maxWidth + 'px' }">
|
||||||
<slot>
|
<slot>
|
||||||
|
<template v-if="text">
|
||||||
<Mfm v-if="asMfm" :text="text"/>
|
<Mfm v-if="asMfm" :text="text"/>
|
||||||
<span v-else>{{ text }}</span>
|
<span v-else>{{ text }}</span>
|
||||||
|
</template>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
@ -53,6 +55,7 @@ const el = shallowRef<HTMLElement>();
|
||||||
const zIndex = os.claimZIndex('high');
|
const zIndex = os.claimZIndex('high');
|
||||||
|
|
||||||
function setPosition() {
|
function setPosition() {
|
||||||
|
if (!el.value || !props.targetElement) return;
|
||||||
const data = calcPopupPosition(el.value, {
|
const data = calcPopupPosition(el.value, {
|
||||||
anchorElement: props.targetElement,
|
anchorElement: props.targetElement,
|
||||||
direction: props.direction,
|
direction: props.direction,
|
||||||
|
|
|
@ -4,12 +4,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MkModal ref="modal" :zPriority="'middle'" @click="$refs.modal.close()" @closed="$emit('closed')">
|
<MkModal ref="modal" :zPriority="'middle'" @click="modal?.close()" @closed="$emit('closed')">
|
||||||
<div :class="$style.root">
|
<div :class="$style.root">
|
||||||
<div :class="$style.title"><MkSparkle>{{ i18n.ts.misskeyUpdated }}</MkSparkle></div>
|
<div :class="$style.title"><MkSparkle>{{ i18n.ts.misskeyUpdated }}</MkSparkle></div>
|
||||||
<div :class="$style.version">✨{{ version }}🚀</div>
|
<div :class="$style.version">✨{{ version }}🚀</div>
|
||||||
<MkButton full @click="whatIsNew">{{ i18n.ts.whatIsNew }}</MkButton>
|
<MkButton full @click="whatIsNew">{{ i18n.ts.whatIsNew }}</MkButton>
|
||||||
<MkButton :class="$style.gotIt" primary full @click="$refs.modal.close()">{{ i18n.ts.gotIt }}</MkButton>
|
<MkButton :class="$style.gotIt" primary full @click="modal?.close()">{{ i18n.ts.gotIt }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
</MkModal>
|
</MkModal>
|
||||||
</template>
|
</template>
|
||||||
|
@ -25,10 +25,10 @@ import { confetti } from '@/scripts/confetti.js';
|
||||||
|
|
||||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
|
const modal = shallowRef<InstanceType<typeof MkModal>>();
|
||||||
|
|
||||||
const whatIsNew = () => {
|
function whatIsNew() {
|
||||||
modal.value.close();
|
modal.value?.close();
|
||||||
window.open(`https://misskey-hub.net/docs/releases/#_${version.replace(/\./g, '')}`, '_blank');
|
window.open(`https://misskey-hub.net/docs/releases/#_${version.replace(/\./g, '')}`, '_blank');
|
||||||
};
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
confetti({
|
confetti({
|
||||||
|
|
|
@ -56,6 +56,7 @@ import MkModalWindow from '@/components/MkModalWindow.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import MkTextarea from '@/components/MkTextarea.vue';
|
import MkTextarea from '@/components/MkTextarea.vue';
|
||||||
import MkSwitch from '@/components/MkSwitch.vue';
|
import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
|
@ -121,7 +122,7 @@ async function del() {
|
||||||
});
|
});
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
|
|
||||||
os.api('admin/announcements/delete', {
|
misskeyApi('admin/announcements/delete', {
|
||||||
id: props.announcement.id,
|
id: props.announcement.id,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
emit('done', {
|
emit('done', {
|
||||||
|
|
|
@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import MkMiniChart from '@/components/MkMiniChart.vue';
|
import MkMiniChart from '@/components/MkMiniChart.vue';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||||
import { acct } from '@/filters/user.js';
|
import { acct } from '@/filters/user.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
|
@ -32,7 +32,7 @@ const chartValues = ref<number[] | null>(null);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.withChart) {
|
if (props.withChart) {
|
||||||
os.apiGet('charts/user/notes', { userId: props.user.id, limit: 16 + 1, span: 'day' }).then(res => {
|
misskeyApiGet('charts/user/notes', { userId: props.user.id, limit: 16 + 1, span: 'day' }).then(res => {
|
||||||
// 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く
|
// 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く
|
||||||
res.inc.splice(0, 1);
|
res.inc.splice(0, 1);
|
||||||
chartValues.value = res.inc;
|
chartValues.value = res.inc;
|
||||||
|
|
|
@ -60,6 +60,7 @@ import * as Misskey from 'misskey-js';
|
||||||
import MkFollowButton from '@/components/MkFollowButton.vue';
|
import MkFollowButton from '@/components/MkFollowButton.vue';
|
||||||
import { userPage } from '@/filters/user.js';
|
import { userPage } from '@/filters/user.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { getUserMenu } from '@/scripts/get-user-menu.js';
|
import { getUserMenu } from '@/scripts/get-user-menu.js';
|
||||||
import number from '@/filters/number.js';
|
import number from '@/filters/number.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
@ -97,7 +98,7 @@ onMounted(() => {
|
||||||
Misskey.acct.parse(props.q.substring(1)) :
|
Misskey.acct.parse(props.q.substring(1)) :
|
||||||
{ userId: props.q };
|
{ userId: props.q };
|
||||||
|
|
||||||
os.api('users/show', query).then(res => {
|
misskeyApi('users/show', query).then(res => {
|
||||||
if (!props.showing) return;
|
if (!props.showing) return;
|
||||||
user.value = res;
|
user.value = res;
|
||||||
});
|
});
|
||||||
|
|
|
@ -62,7 +62,7 @@ import * as Misskey from 'misskey-js';
|
||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
import FormSplit from '@/components/form/split.vue';
|
import FormSplit from '@/components/form/split.vue';
|
||||||
import MkModalWindow from '@/components/MkModalWindow.vue';
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { $i } from '@/account.js';
|
import { $i } from '@/account.js';
|
||||||
|
@ -90,7 +90,7 @@ const search = () => {
|
||||||
users.value = [];
|
users.value = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
os.api('users/search-by-username-and-host', {
|
misskeyApi('users/search-by-username-and-host', {
|
||||||
username: username.value,
|
username: username.value,
|
||||||
host: host.value,
|
host: host.value,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
|
@ -118,7 +118,7 @@ const cancel = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
os.api('users/show', {
|
misskeyApi('users/show', {
|
||||||
userIds: defaultStore.state.recentlyUsedUsers,
|
userIds: defaultStore.state.recentlyUsedUsers,
|
||||||
}).then(users => {
|
}).then(users => {
|
||||||
if (props.includeSelf && users.find(x => $i ? x.id === $i.id : true) == null) {
|
if (props.includeSelf && users.find(x => $i ? x.id === $i.id : true) == null) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ import { i18n } from '@/i18n.js';
|
||||||
import MkSwitch from '@/components/MkSwitch.vue';
|
import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
|
||||||
const isLocked = ref(false);
|
const isLocked = ref(false);
|
||||||
const hideOnlineStatus = ref(false);
|
const hideOnlineStatus = ref(false);
|
||||||
|
@ -57,7 +57,7 @@ const noCrawle = ref(false);
|
||||||
const preventAiLearning = ref(true);
|
const preventAiLearning = ref(true);
|
||||||
|
|
||||||
watch([isLocked, hideOnlineStatus, noCrawle, preventAiLearning], () => {
|
watch([isLocked, hideOnlineStatus, noCrawle, preventAiLearning], () => {
|
||||||
os.api('i/update', {
|
misskeyApi('i/update', {
|
||||||
isLocked: !!isLocked.value,
|
isLocked: !!isLocked.value,
|
||||||
hideOnlineStatus: !!hideOnlineStatus.value,
|
hideOnlineStatus: !!hideOnlineStatus.value,
|
||||||
noCrawle: !!noCrawle.value,
|
noCrawle: !!noCrawle.value,
|
||||||
|
|
|
@ -29,7 +29,7 @@ import * as Misskey from 'misskey-js';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
user: Misskey.entities.UserDetailed;
|
user: Misskey.entities.UserDetailed;
|
||||||
|
@ -39,7 +39,7 @@ const isFollowing = ref(false);
|
||||||
|
|
||||||
async function follow() {
|
async function follow() {
|
||||||
isFollowing.value = true;
|
isFollowing.value = true;
|
||||||
os.api('following/create', {
|
misskeyApi('following/create', {
|
||||||
userId: props.user.id,
|
userId: props.user.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { onMounted, shallowRef, ref } from 'vue';
|
||||||
import { Chart } from 'chart.js';
|
import { Chart } from 'chart.js';
|
||||||
import gradient from 'chartjs-plugin-gradient';
|
import gradient from 'chartjs-plugin-gradient';
|
||||||
import tinycolor from 'tinycolor2';
|
import tinycolor from 'tinycolor2';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
import { useChartTooltip } from '@/scripts/use-chart-tooltip.js';
|
||||||
import { chartVLine } from '@/scripts/chart-vline.js';
|
import { chartVLine } from '@/scripts/chart-vline.js';
|
||||||
|
@ -53,7 +53,7 @@ async function renderChart() {
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
const raw = await os.api('charts/active-users', { limit: chartLimit, span: 'day' });
|
const raw = await misskeyApi('charts/active-users', { limit: chartLimit, span: 'day' });
|
||||||
|
|
||||||
const vLineColor = defaultStore.state.darkMode ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 0, 0, 0.2)';
|
const vLineColor = defaultStore.state.darkMode ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 0, 0, 0.2)';
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ import MkTimeline from '@/components/MkTimeline.vue';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import { instanceName } from '@/config.js';
|
import { instanceName } from '@/config.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import MkNumber from '@/components/MkNumber.vue';
|
import MkNumber from '@/components/MkNumber.vue';
|
||||||
|
@ -68,11 +69,11 @@ import XActiveUsersChart from '@/components/MkVisitorDashboard.ActiveUsersChart.
|
||||||
const meta = ref<Misskey.entities.MetaResponse | null>(null);
|
const meta = ref<Misskey.entities.MetaResponse | null>(null);
|
||||||
const stats = ref<Misskey.entities.StatsResponse | null>(null);
|
const stats = ref<Misskey.entities.StatsResponse | null>(null);
|
||||||
|
|
||||||
os.api('meta', { detail: true }).then(_meta => {
|
misskeyApi('meta', { detail: true }).then(_meta => {
|
||||||
meta.value = _meta;
|
meta.value = _meta;
|
||||||
});
|
});
|
||||||
|
|
||||||
os.api('stats', {}).then((res) => {
|
misskeyApi('stats', {}).then((res) => {
|
||||||
stats.value = res;
|
stats.value = res;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,7 @@ function top() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function maximize() {
|
function maximize() {
|
||||||
|
if (rootEl.value == null) return;
|
||||||
maximized.value = true;
|
maximized.value = true;
|
||||||
unResizedTop = rootEl.value.style.top;
|
unResizedTop = rootEl.value.style.top;
|
||||||
unResizedLeft = rootEl.value.style.left;
|
unResizedLeft = rootEl.value.style.left;
|
||||||
|
@ -155,6 +156,7 @@ function maximize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function unMaximize() {
|
function unMaximize() {
|
||||||
|
if (rootEl.value == null) return;
|
||||||
maximized.value = false;
|
maximized.value = false;
|
||||||
rootEl.value.style.top = unResizedTop;
|
rootEl.value.style.top = unResizedTop;
|
||||||
rootEl.value.style.left = unResizedLeft;
|
rootEl.value.style.left = unResizedLeft;
|
||||||
|
@ -163,6 +165,7 @@ function unMaximize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function minimize() {
|
function minimize() {
|
||||||
|
if (rootEl.value == null) return;
|
||||||
minimized.value = true;
|
minimized.value = true;
|
||||||
unResizedWidth = rootEl.value.style.width;
|
unResizedWidth = rootEl.value.style.width;
|
||||||
unResizedHeight = rootEl.value.style.height;
|
unResizedHeight = rootEl.value.style.height;
|
||||||
|
@ -171,8 +174,8 @@ function minimize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function unMinimize() {
|
function unMinimize() {
|
||||||
|
if (rootEl.value == null) return;
|
||||||
const main = rootEl.value;
|
const main = rootEl.value;
|
||||||
if (main == null) return;
|
|
||||||
|
|
||||||
minimized.value = false;
|
minimized.value = false;
|
||||||
rootEl.value.style.width = unResizedWidth;
|
rootEl.value.style.width = unResizedWidth;
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { onMounted, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkNote from '@/components/MkNote.vue';
|
import MkNote from '@/components/MkNote.vue';
|
||||||
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
block: Misskey.entities.PageBlock,
|
block: Misskey.entities.PageBlock,
|
||||||
|
@ -26,7 +26,7 @@ const note = ref<Misskey.entities.Note | null>(null);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.block.note == null) return;
|
if (props.block.note == null) return;
|
||||||
os.api('notes/show', { noteId: props.block.note })
|
misskeyApi('notes/show', { noteId: props.block.note })
|
||||||
.then(result => {
|
.then(result => {
|
||||||
note.value = result;
|
note.value = result;
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import { shallowRef, computed, markRaw, watch } from 'vue';
|
import { shallowRef, computed, markRaw, watch } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { api, apiGet } from '@/os.js';
|
import { misskeyApi, misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||||
import { useStream } from '@/stream.js';
|
import { useStream } from '@/stream.js';
|
||||||
import { get, set } from '@/scripts/idb-proxy.js';
|
import { get, set } from '@/scripts/idb-proxy.js';
|
||||||
|
|
||||||
|
@ -52,11 +52,11 @@ export async function fetchCustomEmojis(force = false) {
|
||||||
|
|
||||||
let res;
|
let res;
|
||||||
if (force) {
|
if (force) {
|
||||||
res = await api('emojis', {});
|
res = await misskeyApi('emojis', {});
|
||||||
} else {
|
} else {
|
||||||
const lastFetchedAt = await get('lastEmojisFetchedAt');
|
const lastFetchedAt = await get('lastEmojisFetchedAt');
|
||||||
if (lastFetchedAt && (now - lastFetchedAt) < 1000 * 60 * 60) return;
|
if (lastFetchedAt && (now - lastFetchedAt) < 1000 * 60 * 60) return;
|
||||||
res = await apiGet('emojis', {});
|
res = await misskeyApiGet('emojis', {});
|
||||||
}
|
}
|
||||||
|
|
||||||
customEmojis.value = res.emojis;
|
customEmojis.value = res.emojis;
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
|
|
||||||
export default (v, digits = 0) => {
|
export default (v, digits = 0) => {
|
||||||
if (v == null) return '?';
|
if (v == null) return '?';
|
||||||
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB', 'RB', 'QB'];
|
||||||
if (v === 0) return '0';
|
if (v === 0) return '0';
|
||||||
const isMinus = v < 0;
|
const isMinus = v < 0;
|
||||||
if (isMinus) v = -v;
|
if (isMinus) v = -v;
|
||||||
const i = Math.floor(Math.log(v) / Math.log(1024));
|
const i = Math.floor(Math.log(v) / Math.log(1024));
|
||||||
return (isMinus ? '-' : '') + (v / Math.pow(1024, i)).toFixed(digits).replace(/\.0+$/, '') + sizes[i];
|
return (isMinus ? '-' : '') + (v / Math.pow(1024, i)).toFixed(digits).replace(/(\.[1-9]*)0+$/, '$1').replace(/\.$/, '') + (sizes[i] ?? `e+${ i * 3 }B`);
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
export default (v, fractionDigits = 0) => {
|
||||||
|
if (v == null) return 'N/A';
|
||||||
|
if (v === 0) return '0';
|
||||||
|
const sizes = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y', 'R', 'Q'];
|
||||||
|
const isMinus = v < 0;
|
||||||
|
if (isMinus) v = -v;
|
||||||
|
const i = Math.floor(Math.log(v) / Math.log(1000));
|
||||||
|
return (isMinus ? '-' : '') + (v / Math.pow(1000, i)).toFixed(fractionDigits).replace(/(\.[1-9]*)0+$/, '$1').replace(/\.$/, '') + (sizes[i] ?? `e+${ i * 3 }`);
|
||||||
|
};
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import { computed, reactive } from 'vue';
|
import { computed, reactive } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { api } from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { miLocalStorage } from '@/local-storage.js';
|
import { miLocalStorage } from '@/local-storage.js';
|
||||||
import { DEFAULT_INFO_IMAGE_URL, DEFAULT_NOT_FOUND_IMAGE_URL, DEFAULT_SERVER_ERROR_IMAGE_URL } from '@/const.js';
|
import { DEFAULT_INFO_IMAGE_URL, DEFAULT_NOT_FOUND_IMAGE_URL, DEFAULT_SERVER_ERROR_IMAGE_URL } from '@/const.js';
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ export const infoImageUrl = computed(() => instance.infoImageUrl ?? DEFAULT_INFO
|
||||||
export const notFoundImageUrl = computed(() => instance.notFoundImageUrl ?? DEFAULT_NOT_FOUND_IMAGE_URL);
|
export const notFoundImageUrl = computed(() => instance.notFoundImageUrl ?? DEFAULT_NOT_FOUND_IMAGE_URL);
|
||||||
|
|
||||||
export async function fetchInstance() {
|
export async function fetchInstance() {
|
||||||
const meta = await api('meta', {
|
const meta = await misskeyApi('meta', {
|
||||||
detail: false,
|
detail: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,11 @@
|
||||||
|
|
||||||
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
||||||
|
|
||||||
import { pendingApiRequestsCount, api, apiGet } from '@/scripts/api.js';
|
|
||||||
export { pendingApiRequestsCount, api, apiGet };
|
|
||||||
import { Component, markRaw, Ref, ref, defineAsyncComponent } from 'vue';
|
import { Component, markRaw, Ref, ref, defineAsyncComponent } from 'vue';
|
||||||
import { EventEmitter } from 'eventemitter3';
|
import { EventEmitter } from 'eventemitter3';
|
||||||
import insertTextAtCursor from 'insert-text-at-cursor';
|
import insertTextAtCursor from 'insert-text-at-cursor';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import MkPostFormDialog from '@/components/MkPostFormDialog.vue';
|
import MkPostFormDialog from '@/components/MkPostFormDialog.vue';
|
||||||
import MkWaitingDialog from '@/components/MkWaitingDialog.vue';
|
import MkWaitingDialog from '@/components/MkWaitingDialog.vue';
|
||||||
|
@ -33,7 +32,7 @@ export const apiWithDialog = ((
|
||||||
data: Record<string, any> = {},
|
data: Record<string, any> = {},
|
||||||
token?: string | null | undefined,
|
token?: string | null | undefined,
|
||||||
) => {
|
) => {
|
||||||
const promise = api(endpoint, data, token);
|
const promise = misskeyApi(endpoint, data, token);
|
||||||
promiseDialog(promise, null, async (err) => {
|
promiseDialog(promise, null, async (err) => {
|
||||||
let title = null;
|
let title = null;
|
||||||
let text = err.message + '\n' + (err as any).id;
|
let text = err.message + '\n' + (err as any).id;
|
||||||
|
@ -83,7 +82,7 @@ export const apiWithDialog = ((
|
||||||
});
|
});
|
||||||
|
|
||||||
return promise;
|
return promise;
|
||||||
}) as typeof api;
|
}) as typeof misskeyApi;
|
||||||
|
|
||||||
export function promiseDialog<T extends Promise<any>>(
|
export function promiseDialog<T extends Promise<any>>(
|
||||||
promise: T,
|
promise: T,
|
||||||
|
@ -621,7 +620,7 @@ export function checkExistence(fileData: ArrayBuffer): Promise<any> {
|
||||||
const data = new FormData();
|
const data = new FormData();
|
||||||
data.append('md5', getMD5(fileData));
|
data.append('md5', getMD5(fileData));
|
||||||
|
|
||||||
os.api('drive/files/find-by-hash', {
|
api('drive/files/find-by-hash', {
|
||||||
md5: getMD5(fileData)
|
md5: getMD5(fileData)
|
||||||
}).then(resp => {
|
}).then(resp => {
|
||||||
resolve(resp.length > 0 ? resp[0] : null);
|
resolve(resp.length > 0 ? resp[0] : null);
|
||||||
|
|
|
@ -29,7 +29,7 @@ import { ref, computed } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import { version } from '@/config.js';
|
import { version } from '@/config.js';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { unisonReload } from '@/scripts/unison-reload.js';
|
import { unisonReload } from '@/scripts/unison-reload.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
@ -46,7 +46,7 @@ const loaded = ref(false);
|
||||||
const serverIsDead = ref(false);
|
const serverIsDead = ref(false);
|
||||||
const meta = ref<Misskey.entities.MetaResponse | null>(null);
|
const meta = ref<Misskey.entities.MetaResponse | null>(null);
|
||||||
|
|
||||||
os.api('meta', {
|
misskeyApi('meta', {
|
||||||
detail: false,
|
detail: false,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
loaded.value = true;
|
loaded.value = true;
|
||||||
|
|
|
@ -114,7 +114,7 @@ import FormSplit from '@/components/form/split.vue';
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
import MkKeyValue from '@/components/MkKeyValue.vue';
|
import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||||
import MkInstanceStats from '@/components/MkInstanceStats.vue';
|
import MkInstanceStats from '@/components/MkInstanceStats.vue';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import number from '@/filters/number.js';
|
import number from '@/filters/number.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
@ -136,7 +136,7 @@ watch(tab, () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const initStats = () => os.api('stats', {
|
const initStats = () => misskeyApi('stats', {
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
stats.value = res;
|
stats.value = res;
|
||||||
});
|
});
|
||||||
|
|
|
@ -79,6 +79,7 @@ import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import bytes from '@/filters/bytes.js';
|
import bytes from '@/filters/bytes.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
import { iAmAdmin, iAmModerator } from '@/account.js';
|
import { iAmAdmin, iAmModerator } from '@/account.js';
|
||||||
|
@ -93,8 +94,8 @@ const props = defineProps<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
async function fetch() {
|
async function fetch() {
|
||||||
file.value = await os.api('drive/files/show', { fileId: props.fileId });
|
file.value = await misskeyApi('drive/files/show', { fileId: props.fileId });
|
||||||
info.value = await os.api('admin/drive/show-file', { fileId: props.fileId });
|
info.value = await misskeyApi('admin/drive/show-file', { fileId: props.fileId });
|
||||||
isSensitive.value = file.value.isSensitive;
|
isSensitive.value = file.value.isSensitive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +114,7 @@ async function del() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function toggleIsSensitive(v) {
|
async function toggleIsSensitive(v) {
|
||||||
await os.api('drive/files/update', { fileId: props.fileId, isSensitive: v });
|
await misskeyApi('drive/files/update', { fileId: props.fileId, isSensitive: v });
|
||||||
isSensitive.value = v;
|
isSensitive.value = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,11 +219,12 @@ import FormSuspense from '@/components/form/suspense.vue';
|
||||||
import MkFileListForAdmin from '@/components/MkFileListForAdmin.vue';
|
import MkFileListForAdmin from '@/components/MkFileListForAdmin.vue';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { url } from '@/config.js';
|
import { url } from '@/config.js';
|
||||||
import { acct } from '@/filters/user.js';
|
import { acct } from '@/filters/user.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { iAmAdmin, $i } from '@/account.js';
|
import { iAmAdmin, $i, iAmModerator } from '@/account.js';
|
||||||
import MkRolePreview from '@/components/MkRolePreview.vue';
|
import MkRolePreview from '@/components/MkRolePreview.vue';
|
||||||
import MkPagination from '@/components/MkPagination.vue';
|
import MkPagination from '@/components/MkPagination.vue';
|
||||||
|
|
||||||
|
@ -262,11 +263,11 @@ const announcementsPagination = {
|
||||||
const expandedRoles = ref([]);
|
const expandedRoles = ref([]);
|
||||||
|
|
||||||
function createFetcher() {
|
function createFetcher() {
|
||||||
return () => Promise.all([os.api('users/show', {
|
return () => Promise.all([misskeyApi('users/show', {
|
||||||
userId: props.userId,
|
userId: props.userId,
|
||||||
}), os.api('admin/show-user', {
|
}), misskeyApi('admin/show-user', {
|
||||||
userId: props.userId,
|
userId: props.userId,
|
||||||
}), iAmAdmin ? os.api('admin/get-user-ips', {
|
}), iAmAdmin ? misskeyApi('admin/get-user-ips', {
|
||||||
userId: props.userId,
|
userId: props.userId,
|
||||||
}) : Promise.resolve(null)]).then(([_user, _info, _ips]) => {
|
}) : Promise.resolve(null)]).then(([_user, _info, _ips]) => {
|
||||||
user.value = _user;
|
user.value = _user;
|
||||||
|
@ -278,7 +279,7 @@ function createFetcher() {
|
||||||
moderationNote.value = info.value.moderationNote;
|
moderationNote.value = info.value.moderationNote;
|
||||||
|
|
||||||
watch(moderationNote, async () => {
|
watch(moderationNote, async () => {
|
||||||
await os.api('admin/update-user-note', { userId: user.value.id, text: moderationNote.value });
|
await misskeyApi('admin/update-user-note', { userId: user.value.id, text: moderationNote.value });
|
||||||
await refreshUser();
|
await refreshUser();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -301,7 +302,7 @@ async function resetPassword() {
|
||||||
if (confirm.canceled) {
|
if (confirm.canceled) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
const { password } = await os.api('admin/reset-password', {
|
const { password } = await misskeyApi('admin/reset-password', {
|
||||||
userId: user.value.id,
|
userId: user.value.id,
|
||||||
});
|
});
|
||||||
os.alert({
|
os.alert({
|
||||||
|
@ -319,7 +320,7 @@ async function toggleSuspend(v) {
|
||||||
if (confirm.canceled) {
|
if (confirm.canceled) {
|
||||||
suspended.value = !v;
|
suspended.value = !v;
|
||||||
} else {
|
} else {
|
||||||
await os.api(v ? 'admin/suspend-user' : 'admin/unsuspend-user', { userId: user.value.id });
|
await misskeyApi(v ? 'admin/suspend-user' : 'admin/unsuspend-user', { userId: user.value.id });
|
||||||
await refreshUser();
|
await refreshUser();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,7 +332,7 @@ async function unsetUserAvatar() {
|
||||||
});
|
});
|
||||||
if (confirm.canceled) return;
|
if (confirm.canceled) return;
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
await os.api('admin/unset-user-avatar', { userId: user.value.id });
|
await misskeyApi('admin/unset-user-avatar', { userId: user.value.id });
|
||||||
os.success();
|
os.success();
|
||||||
};
|
};
|
||||||
await process().catch(err => {
|
await process().catch(err => {
|
||||||
|
@ -350,7 +351,7 @@ async function unsetUserBanner() {
|
||||||
});
|
});
|
||||||
if (confirm.canceled) return;
|
if (confirm.canceled) return;
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
await os.api('admin/unset-user-banner', { userId: user.value.id });
|
await misskeyApi('admin/unset-user-banner', { userId: user.value.id });
|
||||||
os.success();
|
os.success();
|
||||||
};
|
};
|
||||||
await process().catch(err => {
|
await process().catch(err => {
|
||||||
|
@ -369,7 +370,7 @@ async function deleteAllFiles() {
|
||||||
});
|
});
|
||||||
if (confirm.canceled) return;
|
if (confirm.canceled) return;
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
await os.api('admin/delete-all-files-of-a-user', { userId: user.value.id });
|
await misskeyApi('admin/delete-all-files-of-a-user', { userId: user.value.id });
|
||||||
os.success();
|
os.success();
|
||||||
};
|
};
|
||||||
await process().catch(err => {
|
await process().catch(err => {
|
||||||
|
@ -406,7 +407,7 @@ async function deleteAccount() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function assignRole() {
|
async function assignRole() {
|
||||||
const roles = await os.api('admin/roles/list');
|
const roles = await misskeyApi('admin/roles/list');
|
||||||
|
|
||||||
const { canceled, result: roleId } = await os.select({
|
const { canceled, result: roleId } = await os.select({
|
||||||
title: i18n.ts._role.chooseRoleToAssign,
|
title: i18n.ts._role.chooseRoleToAssign,
|
||||||
|
@ -482,7 +483,7 @@ watch(() => props.userId, () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(user, () => {
|
watch(user, () => {
|
||||||
os.api('ap/get', {
|
misskeyApi('ap/get', {
|
||||||
uri: user.value.uri ?? `${url}/users/${user.value.id}`,
|
uri: user.value.uri ?? `${url}/users/${user.value.id}`,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
ap.value = res;
|
ap.value = res;
|
||||||
|
|
|
@ -96,6 +96,7 @@ import MkFolder from '@/components/MkFolder.vue';
|
||||||
import MkSelect from '@/components/MkSelect.vue';
|
import MkSelect from '@/components/MkSelect.vue';
|
||||||
import FormSplit from '@/components/form/split.vue';
|
import FormSplit from '@/components/form/split.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
|
||||||
|
@ -108,7 +109,7 @@ const daysOfWeek: string[] = [i18n.ts._weekday.sunday, i18n.ts._weekday.monday,
|
||||||
const filterType = ref('all');
|
const filterType = ref('all');
|
||||||
let publishing: boolean | null = null;
|
let publishing: boolean | null = null;
|
||||||
|
|
||||||
os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
misskeyApi('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
||||||
if (adsResponse != null) {
|
if (adsResponse != null) {
|
||||||
ads.value = adsResponse.map(r => {
|
ads.value = adsResponse.map(r => {
|
||||||
const exdate = new Date(r.expiresAt);
|
const exdate = new Date(r.expiresAt);
|
||||||
|
@ -174,7 +175,7 @@ function remove(ad) {
|
||||||
|
|
||||||
function save(ad) {
|
function save(ad) {
|
||||||
if (ad.id == null) {
|
if (ad.id == null) {
|
||||||
os.api('admin/ad/create', {
|
misskeyApi('admin/ad/create', {
|
||||||
...ad,
|
...ad,
|
||||||
expiresAt: new Date(ad.expiresAt).getTime(),
|
expiresAt: new Date(ad.expiresAt).getTime(),
|
||||||
startsAt: new Date(ad.startsAt).getTime(),
|
startsAt: new Date(ad.startsAt).getTime(),
|
||||||
|
@ -191,7 +192,7 @@ function save(ad) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
os.api('admin/ad/update', {
|
misskeyApi('admin/ad/update', {
|
||||||
...ad,
|
...ad,
|
||||||
expiresAt: new Date(ad.expiresAt).getTime(),
|
expiresAt: new Date(ad.expiresAt).getTime(),
|
||||||
startsAt: new Date(ad.startsAt).getTime(),
|
startsAt: new Date(ad.startsAt).getTime(),
|
||||||
|
@ -210,7 +211,7 @@ function save(ad) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function more() {
|
function more() {
|
||||||
os.api('admin/ad/list', { untilId: ads.value.reduce((acc, ad) => ad.id != null ? ad : acc).id, publishing: publishing }).then(adsResponse => {
|
misskeyApi('admin/ad/list', { untilId: ads.value.reduce((acc, ad) => ad.id != null ? ad : acc).id, publishing: publishing }).then(adsResponse => {
|
||||||
if (adsResponse == null) return;
|
if (adsResponse == null) return;
|
||||||
ads.value = ads.value.concat(adsResponse.map(r => {
|
ads.value = ads.value.concat(adsResponse.map(r => {
|
||||||
const exdate = new Date(r.expiresAt);
|
const exdate = new Date(r.expiresAt);
|
||||||
|
@ -227,7 +228,7 @@ function more() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
misskeyApi('admin/ad/list', { publishing: publishing }).then(adsResponse => {
|
||||||
if (adsResponse == null) return;
|
if (adsResponse == null) return;
|
||||||
ads.value = adsResponse.map(r => {
|
ads.value = adsResponse.map(r => {
|
||||||
const exdate = new Date(r.expiresAt);
|
const exdate = new Date(r.expiresAt);
|
||||||
|
|
|
@ -79,6 +79,7 @@ import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
import MkRadios from '@/components/MkRadios.vue';
|
import MkRadios from '@/components/MkRadios.vue';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
|
@ -86,7 +87,7 @@ import MkTextarea from '@/components/MkTextarea.vue';
|
||||||
|
|
||||||
const announcements = ref<any[]>([]);
|
const announcements = ref<any[]>([]);
|
||||||
|
|
||||||
os.api('admin/announcements/list').then(announcementResponse => {
|
misskeyApi('admin/announcements/list').then(announcementResponse => {
|
||||||
announcements.value = announcementResponse;
|
announcements.value = announcementResponse;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -112,7 +113,7 @@ function del(announcement) {
|
||||||
}).then(({ canceled }) => {
|
}).then(({ canceled }) => {
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
announcements.value = announcements.value.filter(x => x !== announcement);
|
announcements.value = announcements.value.filter(x => x !== announcement);
|
||||||
os.api('admin/announcements/delete', announcement);
|
misskeyApi('admin/announcements/delete', announcement);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,13 +135,13 @@ async function save(announcement) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function more() {
|
function more() {
|
||||||
os.api('admin/announcements/list', { untilId: announcements.value.reduce((acc, announcement) => announcement.id != null ? announcement : acc).id }).then(announcementResponse => {
|
misskeyApi('admin/announcements/list', { untilId: announcements.value.reduce((acc, announcement) => announcement.id != null ? announcement : acc).id }).then(announcementResponse => {
|
||||||
announcements.value = announcements.value.concat(announcementResponse);
|
announcements.value = announcements.value.concat(announcementResponse);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
os.api('admin/announcements/list').then(announcementResponse => {
|
misskeyApi('admin/announcements/list').then(announcementResponse => {
|
||||||
announcements.value = announcementResponse;
|
announcements.value = announcementResponse;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,7 @@ import MkButton from '@/components/MkButton.vue';
|
||||||
import FormSuspense from '@/components/form/suspense.vue';
|
import FormSuspense from '@/components/form/suspense.vue';
|
||||||
import FormSlot from '@/components/form/slot.vue';
|
import FormSlot from '@/components/form/slot.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { fetchInstance } from '@/instance.js';
|
import { fetchInstance } from '@/instance.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
|
@ -86,7 +87,7 @@ const turnstileSiteKey = ref<string | null>(null);
|
||||||
const turnstileSecretKey = ref<string | null>(null);
|
const turnstileSecretKey = ref<string | null>(null);
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const meta = await os.api('admin/meta');
|
const meta = await misskeyApi('admin/meta');
|
||||||
hcaptchaSiteKey.value = meta.hcaptchaSiteKey;
|
hcaptchaSiteKey.value = meta.hcaptchaSiteKey;
|
||||||
hcaptchaSecretKey.value = meta.hcaptchaSecretKey;
|
hcaptchaSecretKey.value = meta.hcaptchaSecretKey;
|
||||||
recaptchaSiteKey.value = meta.recaptchaSiteKey;
|
recaptchaSiteKey.value = meta.recaptchaSiteKey;
|
||||||
|
|
|
@ -101,6 +101,7 @@ import MkInput from '@/components/MkInput.vue';
|
||||||
import MkTextarea from '@/components/MkTextarea.vue';
|
import MkTextarea from '@/components/MkTextarea.vue';
|
||||||
import FormSuspense from '@/components/form/suspense.vue';
|
import FormSuspense from '@/components/form/suspense.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { instance, fetchInstance } from '@/instance.js';
|
import { instance, fetchInstance } from '@/instance.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
@ -122,7 +123,7 @@ const notFoundImageUrl = ref<string | null>(null);
|
||||||
const manifestJsonOverride = ref<string>('{}');
|
const manifestJsonOverride = ref<string>('{}');
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const meta = await os.api('admin/meta');
|
const meta = await misskeyApi('admin/meta');
|
||||||
iconUrl.value = meta.iconUrl;
|
iconUrl.value = meta.iconUrl;
|
||||||
app192IconUrl.value = meta.app192IconUrl;
|
app192IconUrl.value = meta.app192IconUrl;
|
||||||
app512IconUrl.value = meta.app512IconUrl;
|
app512IconUrl.value = meta.app512IconUrl;
|
||||||
|
|
|
@ -21,13 +21,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import FormSuspense from '@/components/form/suspense.vue';
|
import FormSuspense from '@/components/form/suspense.vue';
|
||||||
import MkKeyValue from '@/components/MkKeyValue.vue';
|
import MkKeyValue from '@/components/MkKeyValue.vue';
|
||||||
import * as os from '@/os.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import bytes from '@/filters/bytes.js';
|
import bytes from '@/filters/bytes.js';
|
||||||
import number from '@/filters/number.js';
|
import number from '@/filters/number.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
|
||||||
const databasePromiseFactory = () => os.api('admin/get-table-stats').then(res => Object.entries(res).sort((a, b) => b[1].size - a[1].size));
|
const databasePromiseFactory = () => misskeyApi('admin/get-table-stats').then(res => Object.entries(res).sort((a, b) => b[1].size - a[1].size));
|
||||||
|
|
||||||
const headerActions = computed(() => []);
|
const headerActions = computed(() => []);
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ import FormSuspense from '@/components/form/suspense.vue';
|
||||||
import FormSplit from '@/components/form/split.vue';
|
import FormSplit from '@/components/form/split.vue';
|
||||||
import FormSection from '@/components/form/section.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { fetchInstance, instance } from '@/instance.js';
|
import { fetchInstance, instance } from '@/instance.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
@ -87,7 +88,7 @@ const smtpUser = ref<string>('');
|
||||||
const smtpPass = ref<string>('');
|
const smtpPass = ref<string>('');
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const meta = await os.api('admin/meta');
|
const meta = await misskeyApi('admin/meta');
|
||||||
enableEmail.value = meta.enableEmail;
|
enableEmail.value = meta.enableEmail;
|
||||||
email.value = meta.email;
|
email.value = meta.email;
|
||||||
smtpSecure.value = meta.smtpSecure;
|
smtpSecure.value = meta.smtpSecure;
|
||||||
|
|
|
@ -42,6 +42,7 @@ import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
import FormSuspense from '@/components/form/suspense.vue';
|
import FormSuspense from '@/components/form/suspense.vue';
|
||||||
import FormSection from '@/components/form/section.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { fetchInstance } from '@/instance.js';
|
import { fetchInstance } from '@/instance.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
@ -50,7 +51,7 @@ const deeplAuthKey = ref<string>('');
|
||||||
const deeplIsPro = ref<boolean>(false);
|
const deeplIsPro = ref<boolean>(false);
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const meta = await os.api('admin/meta');
|
const meta = await misskeyApi('admin/meta');
|
||||||
deeplAuthKey.value = meta.deeplAuthKey;
|
deeplAuthKey.value = meta.deeplAuthKey;
|
||||||
deeplIsPro.value = meta.deeplIsPro;
|
deeplIsPro.value = meta.deeplIsPro;
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue