From 279a5cac350bd3f64b74cdc9c66df1d77f3803f6 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 9 Dec 2022 14:28:50 -0800 Subject: [PATCH] Initial migration UI b6 Style improvements to moved --- locales/en-US.yml | 10 +- package.json | 2 +- .../src/server/api/endpoints/i/move.ts | 3 +- packages/client/src/components/MkMoved.vue | 13 ++- .../client/src/components/MkRemoteCaution.vue | 1 - packages/client/src/pages/admin/migration.vue | 91 +++++++++++++++++++ packages/client/src/pages/settings/index.vue | 5 + .../client/src/pages/settings/security.vue | 8 +- packages/client/src/pages/user/home.vue | 2 +- packages/client/src/router.ts | 4 + 10 files changed, 122 insertions(+), 17 deletions(-) create mode 100644 packages/client/src/pages/admin/migration.vue diff --git a/locales/en-US.yml b/locales/en-US.yml index aaef40b347..e6040cf0a3 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -149,7 +149,7 @@ addAccount: "Add account" loginFailed: "Failed to sign in" showOnRemote: "View on remote instance" general: "General" -accountMoved: "User has moved to a new account." +accountMoved: "User has moved to a new account:" wallpaper: "Wallpaper" setWallpaper: "Set wallpaper" removeWallpaper: "Remove wallpaper" @@ -921,6 +921,14 @@ swipeOnDesktop: "Allow mobile-style swiping on desktop" logoImageUrl: "Logo image URL" showAdminUpdates: "Indicate a new Calckey version is avaliable (admin only)" replayTutorial: "Replay tutorial" +migration: "Migration" +moveTo: "Move current account to new account" +moveToLabel: "Account you're moving to" +moveAccount: "Move account!" +moveAccountDescription: "This process is irriversable. Make sure you've set up an alias for this account on your new account before moving. Please enter the tag of the account formatted like @person@instance.com" +moveFrom: "Move to this account from an older account" +moveFromLabel: "Old account" +moveFromDescription: "This will set an alias of your old account so that you can move from that account to this current one. Please enter the tag of the account formatted like @person@instance.com" _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing NSFW media via Machine Learning. This will slightly increase the load on the server." diff --git a/package.json b/package.json index 635d3614a7..9940402baa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "13.0.0-b5", + "version": "13.0.0-b6", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/backend/src/server/api/endpoints/i/move.ts b/packages/backend/src/server/api/endpoints/i/move.ts index a1ee31d51e..c67a7bdf55 100644 --- a/packages/backend/src/server/api/endpoints/i/move.ts +++ b/packages/backend/src/server/api/endpoints/i/move.ts @@ -40,7 +40,6 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { - - + // TODO return; }); diff --git a/packages/client/src/components/MkMoved.vue b/packages/client/src/components/MkMoved.vue index 6251d93a8c..7789af0018 100644 --- a/packages/client/src/components/MkMoved.vue +++ b/packages/client/src/components/MkMoved.vue @@ -1,8 +1,8 @@ @@ -16,12 +16,11 @@ defineProps<{ }>(); - diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 9a03c8f288..f6ca654ef4 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -134,6 +134,11 @@ const menuDef = computed(() => [{ }, { title: i18n.ts.otherSettings, items: [{ + icon: 'ph-airplane-takeoff-bold ph-lg', + text: i18n.ts.migration, + to: '/settings/migration', + active: currentPage?.route.name === 'migration', + }, { icon: 'ph-package-bold ph-lg', text: i18n.ts.importAndExport, to: '/settings/import-export', diff --git a/packages/client/src/pages/settings/security.vue b/packages/client/src/pages/settings/security.vue index db59f9b8a4..a5fbc774ee 100644 --- a/packages/client/src/pages/settings/security.vue +++ b/packages/client/src/pages/settings/security.vue @@ -9,7 +9,7 @@ - + @@ -52,7 +52,7 @@ const pagination = { limit: 5, }; -async function change() { +async function change(): Promise { const { canceled: canceled1, result: currentPassword } = await os.inputText({ title: i18n.ts.currentPassword, type: 'password', @@ -78,14 +78,14 @@ async function change() { }); return; } - + os.apiWithDialog('i/change-password', { currentPassword, newPassword, }); } -function regenerateToken() { +function regenerateToken(): void { os.inputText({ title: i18n.ts.password, type: 'password', diff --git a/packages/client/src/pages/user/home.vue b/packages/client/src/pages/user/home.vue index 8877bce724..65ccdb88b8 100644 --- a/packages/client/src/pages/user/home.vue +++ b/packages/client/src/pages/user/home.vue @@ -7,8 +7,8 @@
- +