mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 08:18:08 +00:00
fix: filter available scopes based on existing variables in env var input
This commit is contained in:
1 parent
e3df380a04
commit
99d22ae7d6
2 files changed
+16
-4
No files matched your search
@@ -17,8 +17,15 @@
|
||||
selectedIndex: 0,
|
||||
cursorPosition: 0,
|
||||
currentScope: null,
|
||||
availableScopes: ['team', 'project', 'environment', 'server'],
|
||||
availableVars: @js($availableVars),
|
||||
get availableScopes() {
|
||||
// Only include scopes that have at least one variable
|
||||
const allScopes = ['team', 'project', 'environment', 'server'];
|
||||
return allScopes.filter(scope => {
|
||||
const vars = this.availableVars[scope];
|
||||
return vars && vars.length > 0;
|
||||
});
|
||||
},
|
||||
scopeUrls: @js($scopeUrls),
|
||||
|
||||
handleInput() {
|
||||
@@ -54,6 +61,11 @@
|
||||
|
||||
if (content === '') {
|
||||
this.currentScope = null;
|
||||
// Only show dropdown if there are available scopes with variables
|
||||
if (this.availableScopes.length === 0) {
|
||||
this.showDropdown = false;
|
||||
return;
|
||||
}
|
||||
this.suggestions = this.availableScopes.map(scope => ({
|
||||
type: 'scope',
|
||||
value: scope,
|
||||
|
||||
Reference in new issue
Block a user