mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-26 08:01:38 +00:00
fix: improve workspace specific tags behavior
This commit is contained in:
@@ -148,9 +148,10 @@ async fn get_custom_tags(Query(query): Query<CustomTagQuery>) -> JsonResult<Vec<
|
||||
let tags_o = CUSTOM_TAGS_PER_WORKSPACE.read().await;
|
||||
let workspace_tags = tags_o
|
||||
.1
|
||||
.get(&workspace)
|
||||
.map(|x| x.clone())
|
||||
.unwrap_or_default();
|
||||
.iter()
|
||||
.filter(|(_, workspaces)| workspaces.contains(&workspace))
|
||||
.map(|(tag, _)| tag.clone())
|
||||
.collect::<Vec<String>>();
|
||||
let all_tags = tags_o.0.clone();
|
||||
return Ok(Json(
|
||||
all_tags
|
||||
@@ -163,8 +164,7 @@ async fn get_custom_tags(Query(query): Query<CustomTagQuery>) -> JsonResult<Vec<
|
||||
let workspace_tags = tags_o
|
||||
.1
|
||||
.iter()
|
||||
.map(|(workspace, tags)| tags.iter().map(move |tag| format!("{tag}({workspace})")))
|
||||
.flatten()
|
||||
.map(|(tag, workspaces)| format!("{}({})", tag, workspaces.join("+")))
|
||||
.collect::<Vec<String>>();
|
||||
let all_tags = tags_o.0.clone();
|
||||
return Ok(Json(
|
||||
|
||||
@@ -296,12 +296,7 @@ pub async fn reload_custom_tags_setting(db: &DB) -> error::Result<()> {
|
||||
let mut l = ALL_TAGS.write().await;
|
||||
*l = [
|
||||
custom_tags.0.clone(),
|
||||
custom_tags
|
||||
.1
|
||||
.values()
|
||||
.flatten()
|
||||
.map(|x| x.to_string())
|
||||
.collect_vec(),
|
||||
custom_tags.1.keys().map(|x| x.to_string()).collect_vec(),
|
||||
]
|
||||
.concat();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import CloseButton from './common/CloseButton.svelte'
|
||||
import Toggle from './Toggle.svelte'
|
||||
import Tooltip from './Tooltip.svelte'
|
||||
import { userStore, workerTags } from '$lib/stores'
|
||||
import { userStore, workerTags, workspaceStore } from '$lib/stores'
|
||||
import { Button } from './common'
|
||||
import { WorkerService } from '$lib/gen'
|
||||
import DateTimeInput from './DateTimeInput.svelte'
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
async function loadWorkerGroups() {
|
||||
if (!$workerTags) {
|
||||
$workerTags = await WorkerService.getCustomTags()
|
||||
$workerTags = await WorkerService.getCustomTags({ workspace: $workspaceStore })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/components/common'
|
||||
import { ExternalLink, RotateCw, Loader2 } from 'lucide-svelte'
|
||||
import { workerTags } from '$lib/stores'
|
||||
import { workerTags, workspaceStore } from '$lib/stores'
|
||||
import AssignableTags from './AssignableTags.svelte'
|
||||
import { WorkerService } from '$lib/gen'
|
||||
import WorkerTagSelect from './WorkerTagSelect.svelte'
|
||||
@@ -13,7 +13,7 @@
|
||||
loadWorkerGroups()
|
||||
async function loadWorkerGroups() {
|
||||
if (!$workerTags) {
|
||||
$workerTags = await WorkerService.getCustomTags()
|
||||
$workerTags = await WorkerService.getCustomTags({ workspace: $workspaceStore })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { getContext } from 'svelte'
|
||||
import type { FlowEditorContext } from '../types'
|
||||
import { workerTags } from '$lib/stores'
|
||||
import { workerTags, workspaceStore } from '$lib/stores'
|
||||
import { WorkerService } from '$lib/gen'
|
||||
import WorkerTagSelect from '$lib/components/WorkerTagSelect.svelte'
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
async function loadWorkerGroups() {
|
||||
if (!$workerTags) {
|
||||
$workerTags = await WorkerService.getCustomTags()
|
||||
$workerTags = await WorkerService.getCustomTags({ workspace: $workspaceStore })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -13,7 +13,7 @@ const version = JSON.parse(json)
|
||||
const config = {
|
||||
server: {
|
||||
https: false,
|
||||
port: 3000,
|
||||
port: 3006,
|
||||
proxy: {
|
||||
'^/api/.*': {
|
||||
target: process.env.REMOTE ?? 'https://app.windmill.dev/',
|
||||
|
||||
Reference in New Issue
Block a user