Skip to content

Commit

Permalink
Fix label size limit to 32bytes
Browse files Browse the repository at this point in the history
Signed-off-by: rovast <rovast@163.com>
  • Loading branch information
rovast committed Jul 14, 2023
1 parent 4cfe166 commit 1b3a0e1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"animate.css": "^4.1.1",
"apexcharts": "^3.37.1",
"axios": "^1.2.1",
"crypto-js": "^4.1.1",
"daisyui": "^3.2.1",
"dayjs": "^1.11.6",
"ethers": "^6.1.0",
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/components/Modal/new-deployment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getContainerContract } from "@/utils/contract/container";
import { reactive, onBeforeUnmount } from "vue";
import type { EventLog } from "ethers";
import eventBus from "@/utils/event-bus";
import { getCurrentSiteName } from "@/utils/shared";
import { getCurrentSiteName, md5 } from "@/utils/shared";
import { useLang } from "@/hooks/useLang";
const { t } = useLang();
import { useAccountStore } from "@/store/modules/account";
Expand Down Expand Up @@ -38,7 +38,10 @@ const listenIfNeeded = () => {
contract.on("*", (event: EventLog) => {
const name = event.fragment.name;
if (name !== "requestContainerDeployFulfilled") return;
// console.log("event listened", name);
// console.log("event", event);
if (name !== "RequestContainerDeployFulfilled") return;
data.resReady = true;
eventBus.emit("deploymentSuccess", true);
Expand All @@ -61,7 +64,7 @@ const handleSubmit = async () => {
`https://stc-test.${getCurrentSiteName(
"gw"
)}.oneitfarm.com/brige/providers/deployment`,
accountStore.publicKey
md5(accountStore.publicKey)
);
await transaction.wait();
Expand Down
8 changes: 2 additions & 6 deletions src/components/Modal/new-pod.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ import { getPodContract, PARAM } from "@/utils/contract/pod";
import { reactive, onBeforeUnmount } from "vue";
import type { EventLog } from "ethers";
import eventBus from "@/utils/event-bus";
import { getCurrentSiteName } from "@/utils/shared";
import { getCurrentSiteName, md5 } from "@/utils/shared";
import { useAccountStore } from "@/store/modules/account";
const accountStore = useAccountStore();
defineOptions({
name: "pod-modal"
});
const data = reactive({
res: "",
loading: false,
Expand Down Expand Up @@ -56,7 +52,7 @@ const handleSubmit = async () => {
`https://stc-test.${getCurrentSiteName(
"gw"
)}.oneitfarm.com/brige/providers/pod`,
accountStore.publicKey
md5(accountStore.publicKey)
);
await transaction.wait();
Expand Down
5 changes: 5 additions & 0 deletions src/utils/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useModalStore } from "@/store/modules/modal";
import moment from "moment";
import { getConfig } from "@/config";
import type { EthersError } from "ethers";
import CryptoJS from "crypto-js";

export function formatTime(timeStr, formatStr = "YYYY/MM/DD HH:mm:ss") {
if (!timeStr) {
Expand Down Expand Up @@ -148,3 +149,7 @@ export function handleEtherError(error: EthersError) {

window.alert(error.info?.error?.message || msg(error.code));
}

export function md5(str: string) {
return CryptoJS.MD5(str).toString();
}

0 comments on commit 1b3a0e1

Please sign in to comment.