-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd16bd8
commit 3bf78a4
Showing
28 changed files
with
497 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,74 @@ | ||
# soroban-cli-gui | ||
# SOROBAN CLI GUI | ||
|
||
SOROBAN CLI GUI is a cross platform, electron based application designed to streamline the use of the Soroban CLI. It offers a user-friendly interface for managing projects, identities, networks, and contract methods with ease. | ||
|
||
--- | ||
|
||
## Installation | ||
|
||
To use this application, you must have soroban cli installed on your operating system. | ||
|
||
> This application is compatible with latest soroban v0.23.0, please make sure you have installed this version or newer of soroban! | ||
- To install soroban, follow the instructions in link below: | ||
- [Install Soroban](https://soroban.stellar.org/docs/getting-started/setup) | ||
|
||
- To verify that soroban properly installed, run: | ||
```soroban --version``` | ||
|
||
Now that you have soroban installed, you can install the SOROBAN CLI GUI application by following the instructions below. | ||
|
||
### macOS (Apple Silicon | Intel) | ||
|
||
1. Download the latest release for macOS | ||
1. [Apple Silicon]() | ||
2. [Intel]() | ||
2. Open the downloaded file and drag the application to Applications folder. | ||
|
||
### 🐧 Linux | ||
|
||
1. Download the latest release for Linux | ||
1. [App Image]() | ||
2. [Snap]() | ||
|
||
2. Follow the general instructions to install the application on your Linux distribution. | ||
1. [App Image](https://docs.appimage.org/introduction/quickstart.html#ref-quickstart) | ||
2. [Snap](https://snapcraft.io/docs/installing-snapd) | ||
|
||
### 💻 Windows (Not Fully Supported) | ||
|
||
You can still use the SOROBAN CLI GUI application on Windows by following the instructions below. | ||
|
||
1. Install WSL 2 by following the instructions [on microsoft docs](https://learn.microsoft.com/en-us/windows/wsl/install). | ||
2. Once you have WSL installed, you can install soroban cli by following the instructions for Linux. | ||
3. Follow the instructions for Linux to install the SOROBAN CLI GUI application. | ||
--- | ||
|
||
## Key Features | ||
|
||
**Project Management:** This feature allows users to efficiently manage their projects. It includes capabilities to create new projects, add existing ones from your device, and delete projects that are no longer needed. | ||
|
||
**Identity Management:** This component focuses on managing user identities. Users can generate new identities, add existing ones, delete unnecessary identities, and seamlessly switch between different identities. | ||
|
||
**Contract Interactions:** This feature is centered around interactions with contracts (project based). Users can interact with them using a variety of contract commands, arguments, and flags through a user-friendly interface. | ||
|
||
**Network Management:** Network management is facilitated through the ability to add and remove networks. Users can also display the list of networks. | ||
|
||
> **P.S:** Review the [latest release notes](https://github.com/tolgayayci/soroban-cli-gui/releases/tag/v0.1.0) for more information about the features and capabilities of the SOROBAN CLI GUI application. | ||
## Contributing | ||
|
||
Contributions are welcomed! If you have feature requests, bug notifications or want to contribute some code, please follow the instructions below. | ||
- **Feature Requests:** Use the [feature requests issue](https://github.com/tolgayayci/soroban-cli-gui/issues/new?assignees=tolgayayci&labels=enhancement&projects=&template=feature_request.md&title=%5BFEAT%5D) template. | ||
- **Bug Reports:** Use the [bug reports issue](https://github.com/tolgayayci/soroban-cli-gui/issues/new?assignees=tolgayayci&labels=bug&projects=&template=bug_report.md&title=%5BBUG%5D) template. | ||
- **Code Contributions** | ||
- Fork this repository | ||
- Create a new branch | ||
- Make your changes | ||
- Commit your changes | ||
- Push to the branch that you opened | ||
- Create a new pull request with some details about your changes | ||
|
||
## License | ||
|
||
SOROBAN CLI GUI is released under the **MIT**. See ([LICENSE](https://github.com/tolgayayci/soroban-cli-gui/blob/main/LICENSE)) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
renderer/components/contracts/command-status-config.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import dynamic from "next/dynamic"; | ||
import { useEffect, useState } from "react"; | ||
import Link from "next/link"; | ||
|
||
import { | ||
Accordion, | ||
AccordionContent, | ||
AccordionItem, | ||
AccordionTrigger, | ||
} from "components/ui/accordion"; | ||
import { Button } from "components/ui/button"; | ||
import { Alert, AlertDescription, AlertTitle } from "components/ui/alert"; | ||
import { AlertCircle, ThumbsUpIcon, ThumbsDownIcon } from "lucide-react"; | ||
import { ScrollArea, ScrollBar } from "components/ui/scroll-area"; | ||
|
||
export default function CommandStatusConfig({ | ||
canister, | ||
projectPath, | ||
commandOutput, | ||
commandError, | ||
}: { | ||
canister: any; | ||
projectPath: string; | ||
commandOutput: string; | ||
commandError: string; | ||
}) { | ||
const [canisterStatus, setCanisterStatus] = useState<any>(null); | ||
const [accordionValue, setAccordionValue] = useState<string>("status"); | ||
|
||
useEffect(() => { | ||
// Set the accordion to open the last item if there is command output or an error | ||
if (commandOutput || commandError) { | ||
setAccordionValue("output"); | ||
} else { | ||
setAccordionValue("status"); | ||
} | ||
}, [commandOutput, commandError]); | ||
|
||
function parseCliOutput(output) { | ||
const result = {}; | ||
// Replace multiple spaces with a single space and then split the string into parts. | ||
const parts = output.replace(/\s+/g, " ").trim().split(" "); | ||
|
||
let currentKey = ""; | ||
let currentValue = ""; | ||
|
||
parts.forEach((part) => { | ||
if (part.endsWith(":")) { | ||
// If the current part ends with a colon, it's a key. | ||
if (currentKey && currentValue) { | ||
// Save the previous key-value pair. | ||
result[currentKey] = currentValue.trim(); | ||
} | ||
// Start a new key-value pair. | ||
currentKey = part.slice(0, -1); // Remove the colon from the key. | ||
currentValue = ""; | ||
} else { | ||
// Otherwise, it's part of the value. | ||
currentValue += part + " "; | ||
} | ||
}); | ||
|
||
// Don't forget to add the last key-value pair. | ||
if (currentKey && currentValue) { | ||
result[currentKey] = currentValue.trim(); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
return ( | ||
<ScrollArea className="h-[calc(100vh-200px)] overflow-y-auto"> | ||
<Accordion | ||
type="single" | ||
value={accordionValue} | ||
onValueChange={setAccordionValue} | ||
collapsible | ||
className="w-full space-y-4" | ||
> | ||
<AccordionItem value="output" className="border px-3 rounded-lg"> | ||
<AccordionTrigger className="text-sm"> | ||
Canister Output | ||
</AccordionTrigger> | ||
<AccordionContent> | ||
<div> | ||
{commandOutput && ( | ||
<Alert> | ||
<ThumbsUpIcon className="h-4 w-4 text-green-600" /> | ||
<AlertTitle>Command Output</AlertTitle> | ||
<AlertDescription>{commandOutput}</AlertDescription> | ||
</Alert> | ||
)} | ||
{commandError && ( | ||
<Alert variant="destructive"> | ||
<AlertCircle className="h-4 w-4" /> | ||
<AlertTitle>Error</AlertTitle> | ||
<AlertDescription>{commandError}</AlertDescription> | ||
</Alert> | ||
)} | ||
</div> | ||
</AccordionContent> | ||
</AccordionItem> | ||
</Accordion> | ||
<ScrollBar /> | ||
</ScrollArea> | ||
); | ||
} |
Oops, something went wrong.