Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit 7ddd596

Browse files
committed
feat: create time
1 parent 49283d0 commit 7ddd596

File tree

11 files changed

+35
-5
lines changed

11 files changed

+35
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "epherome-beta",
33
"private": true,
4-
"version": "1.0.0-3",
4+
"version": "1.0.0-4",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"devPath": "http://localhost:1420",
66
"distDir": "../dist"
77
},
8-
"package": { "productName": "Epherome", "version": "1.0.0-3" },
8+
"package": { "productName": "Epherome", "version": "1.0.0-4" },
99
"tauri": {
1010
"allowlist": {
1111
"all": true,

src/core/auth/offline.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@ import { cfg } from "../../stores/config";
22
import { uuidv4 } from "../../utils";
33

44
export default function createOfflineAccount(name: string) {
5-
cfg.accounts.add({ name, uuid: uuidv4(), type: "offline" }, true);
5+
cfg.accounts.add(
6+
{ name, uuid: uuidv4(), type: "offline", time: Date.now() },
7+
true
8+
);
69
}

src/core/auth/yggdrasil.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class YggdrasilAuthenticator {
4646
uuid: result.selectedProfile.id,
4747
authserver: this.server,
4848
token: result.accessToken,
49+
time: Date.now(),
4950
},
5051
true
5152
);

src/intl/root.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,6 @@ export default {
119119
toast: {
120120
copied: "Copied successfully.",
121121
},
122+
createTime: "Create Time",
122123
},
123124
};

src/pages/accounts/AccountDetailFragment.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from "react";
22
import Button from "../../components/Button";
33
import { MinecraftAccount } from "../../stores/struct";
4-
import { Status } from "../../utils";
4+
import { Status, getDateTimeString } from "../../utils";
55
import { YggdrasilAuthenticator } from "../../core/auth/yggdrasil";
66
import Spinner from "../../components/Spinner";
77
import { MdCheckCircle } from "react-icons/md";
@@ -35,6 +35,9 @@ export default function AccountDetailFragment(props: {
3535
{current.authserver}
3636
</Info>
3737
)}
38+
{current.time && (
39+
<Info name={t.createTime}>{getDateTimeString(current.time)}</Info>
40+
)}
3841
{current.type === "authlib" && (
3942
<div className="flex items-center my-3">
4043
{status === "loading" && <Spinner />}

src/pages/instances/CreateInstanceFragment.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export default function CreateInstanceFragment(props: {
1414
const onSubmit: FormEventHandler = (e) => {
1515
e.preventDefault();
1616
const data = new FormData(e.target as HTMLFormElement);
17-
cfg.instances.add({ ...resolve(data), isFolder: false }, true);
17+
cfg.instances.add(
18+
{ ...resolve(data), isFolder: false, time: Date.now() },
19+
true
20+
);
1821
props.goBack();
1922
};
2023

src/pages/instances/InstanceDetailFragment.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { t } from "../../intl";
55
import { MinecraftInstance } from "../../stores/struct";
66
import Info from "../../components/Info";
77
import { cfg } from "../../stores/config";
8+
import { getDateTimeString } from "../../utils";
89

910
export default function InstanceDetailFragment(props: {
1011
current: MinecraftInstance;
@@ -43,6 +44,9 @@ export default function InstanceDetailFragment(props: {
4344
{current.gameDir}
4445
</Info>
4546
<Info name={t.instances.version}>{current.version}</Info>
47+
{current.time && (
48+
<Info name={t.createTime}>{getDateTimeString(current.time)}</Info>
49+
)}
4650
<div className="flex justify-end">
4751
<Button onClick={props.onRemove} dangerous>
4852
{t.remove}

src/pages/instances/VersionDetail.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default function VersionDetail(props: {
3737
gameDir: dest,
3838
version: props.version.id,
3939
isFolder: false,
40+
time: Date.now(),
4041
},
4142
true
4243
);

src/stores/struct.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ export interface MinecraftAccount {
66
type: MinecraftAccountType;
77
authserver?: string;
88
token?: string;
9+
time?: number;
910
}
1011

1112
export interface MinecraftInstance {
1213
name: string;
1314
gameDir: string;
1415
version: string;
1516
isFolder: boolean;
17+
time?: number;
1618
}

0 commit comments

Comments
 (0)