Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Add inProgress support to BBAlert

天舟620f41b9842a
diff --git a/frontend/src/bbkit/BBAlert.vue b/frontend/src/bbkit/BBAlert.vue
index 254894304f..6c4017af30 100644
--- a/frontend/src/bbkit/BBAlert.vue
+++ b/frontend/src/bbkit/BBAlert.vue
@@ -215,41 +215,49 @@
</div>
</div>
</div>
- <div class="mt-5 flex justify-end">
- <button
- type="button"
- class="btn-normal mt-3 px-4 py-2 sm:mt-0 sm:w-auto"
- @click.prevent="cancel"
- >
- {{ cancelText }}
- </button>
- <button
- type="button"
- class="
- sm:ml-3
- inline-flex
- justify-center
- w-full
- rounded-md
- border border-transparent
- shadow-sm
- px-4
- py-2
- bg-error
- text-base
- font-medium
- text-white
- hover:bg-error-hover
- focus:outline-none
- focus-visible:ring-2
- focus:ring-offset-2 focus:ring-red-500
- sm:w-auto sm:text-sm
- "
- v-bind:class="okButtonStyle"
- @click.prevent="$emit('ok', payload)"
- >
- {{ okText }}
- </button>
+ <div
+ class="mt-5 flex"
+ :class="inProgress ? 'justify-between' : 'justify-end'"
+ >
+ <BBSpin v-if="inProgress" />
+ <div>
+ <button
+ type="button"
+ class="btn-normal mt-3 px-4 py-2 sm:mt-0 sm:w-auto"
+ @click.prevent="cancel"
+ :disabled="inProgress"
+ >
+ {{ cancelText }}
+ </button>
+ <button
+ type="button"
+ class="
+ sm:ml-3
+ inline-flex
+ justify-center
+ w-full
+ rounded-md
+ border border-transparent
+ shadow-sm
+ px-4
+ py-2
+ bg-error
+ text-base
+ font-medium
+ text-white
+ hover:bg-error-hover
+ focus:outline-none
+ focus-visible:ring-2
+ focus:ring-offset-2 focus:ring-red-500
+ sm:w-auto sm:text-sm
+ "
+ v-bind:class="okButtonStyle"
+ @click.prevent="$emit('ok', payload)"
+ :disabled="inProgress"
+ >
+ {{ okText }}
+ </button>
+ </div>
</div>
</div>
</div>
@@ -284,6 +292,10 @@ export default {
type: String,
default: "Cancel",
},
+ inProgress: {
+ type: Boolean,
+ default: true,
+ },
// Any payload pass through to "ok" and "cancel" events
payload: {},
},
@@ -293,7 +305,7 @@ export default {
};
const escHandler = (e: KeyboardEvent) => {
- if (e.code == "Escape") {
+ if (!props.inProgress && e.code == "Escape") {
cancel();
}
};