Skip to content

Commit

Permalink
Merge pull request #10 from omnia-network/luca/deployment-frontend-form
Browse files Browse the repository at this point in the history
feat: deployment frontend form
  • Loading branch information
ilbertt authored May 19, 2024
2 parents 4e86e78 + 8ea6e02 commit 05df509
Show file tree
Hide file tree
Showing 49 changed files with 4,671 additions and 2,639 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ dist/

# environment variables
.env

.idea
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ The steps are as follows:
This script mints ICPs on the local Ledger canister for the account ID corresponding to the `default` DFX identity (`dfx identity use default`). You can change the account ID to whom the ICPs are paid by modifying the `DEFAULT_ACCOUNT_ID` variable in the [`deploy-local-backend-with-icp-ledger.sh`](./scripts/deploy-local-backend-with-icp-ledger.sh) script.
> Note: You need to have the dfx identity `minter` created in order to mint ICPs. If you don't have it, you can create it by running the following command:
```bash
dfx identity new minter
```
4. Open the local backend canister Candid UI and call the `address()` method or run the following command:
```bash
Expand Down
60 changes: 60 additions & 0 deletions akash/example-sdl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: "3.0"
services:
ic-websocket-gateway:
image: omniadevs/ic-websocket-gateway:v1.4.1
command:
- /ic-ws-gateway/ic_websocket_gateway
- --gateway-address
- 0.0.0.0:8080
- --ic-network-url
- https://icp-api.io
- --polling-interval
- "400"
args: null
env: null
expose:
- port: 8080
as: 80
proto: TCP
to:
- service: null
global: true
http_options: null
ip: null
accept:
- example.com
http_options: null
dependencies: null
params: null
profiles:
compute:
ic-websocket-gateway:
resources:
cpu:
units: "0.5"
attributes: null
memory:
size: 512Mi
attributes: null
storage:
- name: null
size: 512Mi
attributes: null
gpu:
units: "0"
id: null
placement:
dcloud:
attributes: null
signedBy: null
pricing:
ic-websocket-gateway:
denom: uakt
value: null
amount: 1000
deployment:
ic-websocket-gateway:
dcloud:
profile: ic-websocket-gateway
count: 1
endpoints: null
3 changes: 1 addition & 2 deletions deps/pulled.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"canisters": {
"rdmx6-jaaaa-aaaaa-aaadq-cai": {
"name": "internet_identity",
"wasm_hash": "ca2aecfea2a599c20d46031d7b15a23af047d95e193fd709241d58b5527eb1fc",
"wasm_hash_download": "ca2aecfea2a599c20d46031d7b15a23af047d95e193fd709241d58b5527eb1fc",
"wasm_hash": "764cff569a98a3c4d54cba6750fda63f554fc53e7d42a6365d9bdec3280d63c3",
"init_guide": "Use '(null)' for sensible defaults. See the candid interface for more details.",
"init_arg": null,
"candid_args": "(opt InternetIdentityInit)",
Expand Down
87 changes: 44 additions & 43 deletions frontend/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import ClipboardCopyButton from "@/components/clipboard-copy-button";
import { Spinner } from "@/components/spinner";
import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
Expand Down Expand Up @@ -52,50 +53,50 @@ export default function DashboardLayout({
return (
<main className="flex min-h-screen flex-col items-center justify-between">
<div className="flex flex-col w-full">
<div className="border-b">
<div className="flex h-16 items-center px-4">
<div className="ml-auto flex items-center space-x-4 justify-end">
<TooltipProvider>
<Tooltip delayDuration={100}>
<TooltipTrigger className="flex flex-row items-center gap-2">
Principal: <pre className="text-primary">{shortPrincipal(userPrincipal!)}</pre>
</TooltipTrigger>
<TooltipContent
side="bottom"
sideOffset={10}
align="end"
>
<pre>{userPrincipal?.toText()}</pre>
</TooltipContent>
</Tooltip>
<Tooltip delayDuration={100}>
<TooltipTrigger className="flex flex-row items-center gap-2">
Ledger Account ID: <pre className="text-primary">{shortAccountId(userAccountId!)}</pre>
</TooltipTrigger>
<TooltipContent
side="bottom"
sideOffset={10}
align="end"
>
<pre>{userAccountId?.toHex()}</pre>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<div className="flex flex-row items-center gap-2">
Ledger balance:
{(!ledgerData.isLoading && ledgerData.balanceE8s !== null) ? <pre className="text-primary">{displayE8sAsIcp(ledgerData.balanceE8s)}</pre> : null}
<Button
variant="ghost"
size="icon"
onClick={fetchBalance}
disabled={ledgerData.isLoading}
>
{ledgerData.isLoading ? <Spinner /> : <RefreshCw className="h-4 w-4" />}
</Button>
</div>
<Button variant="outline" onClick={handleLogout}>Logout</Button>
</div>
<div className="border-b sticky top-0 flex h-16 items-center px-4 space-x-4 justify-end bg-background">
<TooltipProvider>
<Tooltip delayDuration={100}>
<TooltipTrigger className="flex flex-row items-center gap-2">
Principal:
<pre className="text-primary">{shortPrincipal(userPrincipal!)}</pre>
<ClipboardCopyButton text={userPrincipal!.toText()} />
</TooltipTrigger>
<TooltipContent
side="bottom"
sideOffset={10}
align="end"
>
<pre>{userPrincipal?.toText()}</pre>
</TooltipContent>
</Tooltip>
<Tooltip delayDuration={100}>
<TooltipTrigger className="flex flex-row items-center gap-2">
Ledger Account ID:
<pre className="text-primary">{shortAccountId(userAccountId!)}</pre>
<ClipboardCopyButton text={userAccountId!.toHex()} />
</TooltipTrigger>
<TooltipContent
side="bottom"
sideOffset={10}
align="end"
>
<pre>{userAccountId?.toHex()}</pre>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<div className="flex flex-row items-center gap-2">
Ledger balance:
{(!ledgerData.isLoading && ledgerData.balanceE8s !== null) ? <pre className="text-primary">{displayE8sAsIcp(ledgerData.balanceE8s)}</pre> : null}
<Button
variant="ghost"
size="icon"
onClick={fetchBalance}
disabled={ledgerData.isLoading}
>
{ledgerData.isLoading ? <Spinner /> : <RefreshCw className="h-4 w-4" />}
</Button>
</div>
<Button variant="outline" onClick={handleLogout}>Logout</Button>
</div>
{children}
</div>
Expand Down
Loading

0 comments on commit 05df509

Please sign in to comment.