Skip to content

Commit

Permalink
limit number of groups to 5 in ce
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Aug 28, 2023
1 parent 697f94a commit 1db214f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
13 changes: 13 additions & 0 deletions backend/windmill-api/src/groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,19 @@ async fn create_group(

check_name_conflict(&mut tx, &w_id, &ng.name).await?;

#[cfg(not(feature = "enterprise"))]
{
let nb_groups = sqlx::query_scalar!("SELECT COUNT(*) FROM group_ WHERE name != 'all'",)
.fetch_one(&mut *tx)
.await?;
if nb_groups.unwrap_or(0) >= 5 {
return Err(Error::BadRequest(
"You have reached the maximum number of groups without an enterprise license"
.to_string(),
));
}
}

sqlx::query!(
"INSERT INTO group_ (workspace_id, name, summary, extra_perms) VALUES ($1, $2, $3, $4)",
w_id,
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/lib/components/common/button/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@
on:blur
class={twMerge(
buttonClass,
disabled ? '!bg-surface-disabled !text-disabled !cursor-not-allowed' : ''
disabled
? '!bg-surface-disabled !text-tertiary border border-disabled !cursor-not-allowed'
: ''
)}
{id}
tabindex={disabled ? -1 : 0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
<div class="flex flex-col gap-1 md:flex-row w-full p-4">
<div class="flex gap-2 grow mb-2">
<div class="flex gap-1 relative max-w-36 min-w-[50px]">
<div class="text-xs absolute -top-4 truncate">Jobs Waiting for Worker</div>
<div class="text-xs absolute -top-4 truncate">Jobs waiting for a worker</div>
<div class="mt-1">{queue_count ? ($queue_count ?? 0).toFixed(0) : '...'}</div>
</div>
<div class="flex"
Expand Down

0 comments on commit 1db214f

Please sign in to comment.