Skip to content

Commit

Permalink
devop: generate names for uuids
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Feb 13, 2025
1 parent 3cf90f1 commit 73f87c2
Show file tree
Hide file tree
Showing 4 changed files with 609 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
v-for="(entity, index) in backups"
:key="`entity-${entity.userId}-${index}`"
>
<td>{{ concatId(entity.userId) }}</td>
<td>{{ generateRandomNameWithSeed('_', entity.userId) }}</td>
<td>{{ formatDate(entity.updatedAt) }}</td>
<td>
<span
Expand Down Expand Up @@ -127,6 +127,7 @@ import SettingsInnerHeader from '@action/views/settings/components/settings-inne
import SettingsSwitch from '@action/views/settings/components/settings-switch.vue';
import deleteIcon from '@/ui/action/icons/actions/trash.vue';
import BalanceLoader from '@action/icons/common/balance-loader.vue';
import { generateRandomNameWithSeed } from '@enkryptcom/utils';
const backupState = new BackupState();
const loading = ref(true);
Expand Down Expand Up @@ -155,10 +156,6 @@ const toggleBackups = async (checked: boolean) => {
loading.value = false;
};
const concatId = (userId: string) => {
return `${userId.slice(0, 4)}...${userId.slice(-4)}`;
};
const deleteBackup = async (userId: string) => {
loading.value = true;
await backupState.deleteBackup(userId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'backup-detected__backup-item',
]"
>
{{ generateRandomNameWithSeed('_', backup.userId) }} -
{{ new Date(backup.updatedAt).toLocaleString() }}
</a>
</div>
Expand Down Expand Up @@ -43,6 +44,7 @@ import BackupState from '@/libs/backup-state';
import { ListBackupType } from '@/libs/backup-state/types';
import { useRouter } from 'vue-router';
import { routes } from '../restore-wallet/routes';
import { generateRandomNameWithSeed } from '@enkryptcom/utils';
const selectedBackup = ref<ListBackupType>();
const backups = ref<ListBackupType[]>([]);
Expand Down
2 changes: 2 additions & 0 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
naclEncrypt,
NACL_VERSION,
} from "./nacl-encrypt-decrypt";
import { generateRandomNameWithSeed } from "./random-names";

const bufferToHex = (buf: Buffer | Uint8Array, nozerox = false): string =>
nozerox
Expand Down Expand Up @@ -54,4 +55,5 @@ export {
naclDecrypt,
naclEncrypt,
NACL_VERSION,
generateRandomNameWithSeed,
};
Loading

0 comments on commit 73f87c2

Please sign in to comment.