Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #37

Merged
merged 18 commits into from
Oct 18, 2024
Merged

Dev #37

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ node_modules
dist
dist-ssr
*.local

../.DS_Store
# Editor directories and files
.idea
.vscode
.DS_Store
../.idea/
*.suo
*.ntvs*
*.njsproj
Expand Down
15 changes: 15 additions & 0 deletions gui/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/assets/nebulous-f9e3bcad.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NebulOus</title>
<script type="module" crossorigin src="/assets/index-2c89f4e5.js"></script>
<link rel="stylesheet" href="/assets/index-220aeee3.css">
</head>
<body>
<div id="app"></div>

</body>
</html>
4 changes: 2 additions & 2 deletions gui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/src/assets/svg/nebulous.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nebulous</title>
<title>NebulOus</title>
</head>
<body>
<div id="app"></div>
Expand Down
64 changes: 64 additions & 0 deletions gui/src/assets/svg/nebulous.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 16 additions & 7 deletions gui/src/components/Modal/ResourceCreation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {SNACKBAR_MESSAGE_TYPES} from "@/constants"
import {IResourcePayload} from "@/types/resource.ts"
import ResourceForm from "@/components/Modal/ResourceForm.vue";
import {IPlatform} from "@/interfaces/platform.interface.ts";
import { IRegion } from "@/interfaces/resources.interface.ts"
import { IRegion, IType } from "@/interfaces/resources.interface.ts"

const resourceStore = useResourceStore()
const uiStore = useUIStore()
Expand All @@ -35,6 +35,7 @@ const resourceData = reactive<IResourcePayload>({
_platform: [{"uuid":'','title':''} as IPlatform], // TODO Remove this
securityGroup:"",
regions:"",
excludedInstanceTypes: "",
subnet:"",
endpoint:"",
identityVersion:"",
Expand All @@ -56,7 +57,11 @@ const externalServerValidation = () => true

const rules = {
title: { required, externalServerValidation },
platform: { required, externalServerValidation }
platform: { required, externalServerValidation },
credentials: {
user: { required, externalServerValidation },
secret: { required, externalServerValidation },
}
}

const $externalResults = reactive({})
Expand All @@ -68,15 +73,19 @@ const closeModal = (skipConfirmation: boolean = false) => {


const createResource = async () => {
// Map regions from objects to string (comma-separated region identifiers)
if (Array.isArray(resourceData.regions)) {
resourceData.regions = resourceData.regions.map((region: IRegion) => region.region).join(',');
}


if (!(await v$.value.$validate())) {
console.log("Failed validation");
return;
}
// Map regions from objects
if (Array.isArray(resourceData.regions)) {
resourceData.regions = resourceData.regions.map((region: IRegion) => region.region).join(',');
}
// Map excludedInstanceTypes from objects
if (Array.isArray(resourceData.excludedInstanceTypes)) {
resourceData.excludedInstanceTypes = resourceData.excludedInstanceTypes.map((type: IType) => type.instanceType).join(',');
}

resourceStore
.createResource(resourceData)
Expand Down
Loading