Skip to content

Commit

Permalink
Merge pull request #3005 from threefoldtech/development_fix_deploy_wo…
Browse files Browse the repository at this point in the history
…rker

Fix worker deploying k8s/caprover
  • Loading branch information
MohamedElmdary authored Jun 23, 2024
2 parents a7dd02a + 0c59df0 commit 08a275d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
17 changes: 11 additions & 6 deletions packages/playground/src/components/manage_worker_dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
<slot name="list"></slot>
</template>

<form-validator v-model="valid" v-else>
<slot name="deploy"></slot>
</form-validator>
<d-tabs v-else :tabs="[{ title: 'Config', value: 'config' }]">
<template #config>
<slot name="deploy"></slot>
</template>
</d-tabs>

<template #footer-actions>
<template #footer-actions="{ validateBeforeDeploy }">
<v-btn color="anchor" v-if="!deleting" @click="$emit('close')"> Close </v-btn>
<v-btn
color="error"
Expand All @@ -34,7 +36,11 @@
>
Delete
</v-btn>
<v-btn color="secondary" :disabled="!valid" @click="$emit('deploy', layout)" v-if="showType === 1">
<v-btn
color="secondary"
@click="validateBeforeDeploy(() => $emit('deploy', layout), false)"
v-if="showType === 1"
>
Deploy
</v-btn>
</template>
Expand Down Expand Up @@ -74,7 +80,6 @@ const emits = defineEmits<{
const layout = ref();
const showType = ref(props.workers.length === 0 ? 1 : 0);
const valid = ref(true);
const deletingDialog = ref(false);
function onDelete() {
Expand Down
5 changes: 3 additions & 2 deletions packages/playground/src/components/weblet_layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ provideService({
},
});
function validateBeforeDeploy(fn: () => void) {
function validateBeforeDeploy(fn: () => void, documentScrollend = true) {
const forms = __forms;
let errorInput: [number, any, boolean] | null = null;
Expand Down Expand Up @@ -243,7 +243,8 @@ function validateBeforeDeploy(fn: () => void) {
return;
}
document.addEventListener("scrollend", _improveUx, { once: true });
documentScrollend && document.addEventListener("scrollend", _improveUx, { once: true });
!documentScrollend && setTimeout(_improveUx, 500);
_input.scrollIntoView({ behavior: "smooth", block: "center" });
async function _improveUx() {
Expand Down

0 comments on commit 08a275d

Please sign in to comment.