Skip to content
Merged
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
28 changes: 25 additions & 3 deletions src/views/ClusterCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@
</v-col>
</v-row>
</v-container>
<v-snackbar
v-model="snackbar"
>
{{ snackbarInner }}

<template v-slot:actions>
<v-btn
color="pink"
variant="text"
@click="snackbar = false"
>
Close
</v-btn>
</template>
</v-snackbar>
</template>

<script lang="ts" setup>
Expand All @@ -56,6 +71,9 @@ const clusterName = ref("");
const nodeCount = ref(1);
const ports = ref(["6443:6443"]);

const snackbar = ref(false);
const snackbarInner = ref("Cluster creation failed");

const addPortMapping = () => {
ports.value.push("host");
};
Expand All @@ -80,11 +98,15 @@ const createCluster = () => {
],
};
ClustersService.clusterCreateClustersPost(clusterReq).then((res) => {
console.log("creation success ", +res);
console.log("creation success ", res);
snackbar.value = true;
snackbarInner.value = "Cluster created successfully.";
router.push("/clusters");
})
.catch((err) => {
console.log("creation failed ", +err);
.catch(() => {
snackbar.value = true;
snackbarInner.value = "Cluster creation failed: Limits exceeded.";

});
};

Expand Down