diff --git a/packages/playground/package.json b/packages/playground/package.json index adb32dd828..5a1d4be524 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -31,6 +31,8 @@ "vue-router": "^4.1.6", "vuetify": "^3.1.15", "web-ssh-keygen": "^0.1.2", + "chart.js": "^4.4.0", + "vue-chartjs": "^5.2.0", "moment": "^2.29.4" }, "devDependencies": { @@ -39,6 +41,7 @@ "@types/marked": "^5.0.0", "@types/node": "^18.14.2", "@types/qrcode": "^1.5.0", + "@types/chart.js": "^2.9.38", "@vitejs/plugin-vue": "^4.0.0", "@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-typescript": "^11.0.2", diff --git a/packages/playground/src/components/line_chart.vue b/packages/playground/src/components/line_chart.vue new file mode 100644 index 0000000000..564f8652f9 --- /dev/null +++ b/packages/playground/src/components/line_chart.vue @@ -0,0 +1,78 @@ + + + + diff --git a/packages/playground/src/components/pie_chart.vue b/packages/playground/src/components/pie_chart.vue new file mode 100644 index 0000000000..eab8852fc8 --- /dev/null +++ b/packages/playground/src/components/pie_chart.vue @@ -0,0 +1,49 @@ + + + + diff --git a/packages/playground/src/components/simulator.vue b/packages/playground/src/components/simulator.vue new file mode 100644 index 0000000000..a9ff76f1b2 --- /dev/null +++ b/packages/playground/src/components/simulator.vue @@ -0,0 +1,406 @@ + + + + + diff --git a/packages/playground/src/plugins/vuetify.ts b/packages/playground/src/plugins/vuetify.ts index aefe3b1a8a..38bee4b0d7 100644 --- a/packages/playground/src/plugins/vuetify.ts +++ b/packages/playground/src/plugins/vuetify.ts @@ -21,6 +21,7 @@ const vuetify = createVuetify({ primary: "#1aa18f", secondary: "#74DDC3", title: "#1AA18F", + disclaimer: "#4D776D", info: "#7de3c8", warning: "#FFCC00", link: "#5695ff", diff --git a/packages/playground/src/portal/simulator_view.vue b/packages/playground/src/portal/simulator_view.vue new file mode 100644 index 0000000000..2c86ab505e --- /dev/null +++ b/packages/playground/src/portal/simulator_view.vue @@ -0,0 +1,69 @@ + + + diff --git a/packages/playground/src/router/index.ts b/packages/playground/src/router/index.ts index 5d30113037..116158eda7 100644 --- a/packages/playground/src/router/index.ts +++ b/packages/playground/src/router/index.ts @@ -53,6 +53,12 @@ const router = createRouter({ component: () => import("../calculator/resource_pricing.vue"), meta: { title: "Resource Pricing" }, }, + + { + path: "simulator", + component: () => import("../portal/simulator_view.vue"), + meta: { title: "Twin" }, + }, ], }, { diff --git a/packages/playground/src/types/index.ts b/packages/playground/src/types/index.ts index b14c3c9da7..88d8a1dcae 100644 --- a/packages/playground/src/types/index.ts +++ b/packages/playground/src/types/index.ts @@ -4,6 +4,34 @@ import type { INode } from "@/utils/filter_nodes"; import type * as validators from "../utils/validators"; +export enum ProfileTypes { + DIY, + TITAN, +} + +export enum Certification { + NONE = 0, + CERTIFIED = 1, + GOLD_CERTIFIED = 2, +} + +export interface FarmingProfileOptions { + type: ProfileTypes; + name: string; + memory: number; + cpu: number; + hdd: number; + ssd: number; + price: number; + priceAfter5Years: number; + maximumTokenPrice: number; + powerUtilization: number; + powerCost: number; + certified: Certification; + publicIp: boolean; + investmentCostHW: number; + nuRequiredPerCu: number; +} export interface K8SWorker { name: string; cpu: number;