Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f0bb5072
Commit
f0bb5072
authored
Mar 31, 2020
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dropdown selector for knative domain
when instance-level domain exists, provide it as an option
parent
99842868
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
33 deletions
+122
-33
app/assets/javascripts/clusters/clusters_bundle.js
app/assets/javascripts/clusters/clusters_bundle.js
+10
-5
app/assets/javascripts/clusters/components/applications.vue
app/assets/javascripts/clusters/components/applications.vue
+14
-7
app/assets/javascripts/clusters/components/knative_domain_editor.vue
...javascripts/clusters/components/knative_domain_editor.vue
+90
-18
app/assets/javascripts/clusters/stores/clusters_store.js
app/assets/javascripts/clusters/stores/clusters_store.js
+7
-2
app/controllers/clusters/applications_controller.rb
app/controllers/clusters/applications_controller.rb
+1
-1
No files found.
app/assets/javascripts/clusters/clusters_bundle.js
View file @
f0bb5072
...
@@ -259,7 +259,7 @@ export default class Clusters {
...
@@ -259,7 +259,7 @@ export default class Clusters {
eventHub
.
$on
(
'
installApplication
'
,
this
.
installApplication
);
eventHub
.
$on
(
'
installApplication
'
,
this
.
installApplication
);
eventHub
.
$on
(
'
updateApplication
'
,
data
=>
this
.
updateApplication
(
data
));
eventHub
.
$on
(
'
updateApplication
'
,
data
=>
this
.
updateApplication
(
data
));
eventHub
.
$on
(
'
saveKnativeDomain
'
,
data
=>
this
.
saveKnativeDomain
(
data
));
eventHub
.
$on
(
'
saveKnativeDomain
'
,
data
=>
this
.
saveKnativeDomain
(
data
));
eventHub
.
$on
(
'
setKnative
Hostname
'
,
data
=>
this
.
setKnativeHostname
(
data
));
eventHub
.
$on
(
'
setKnative
Domain
'
,
data
=>
this
.
setKnativeDomain
(
data
));
eventHub
.
$on
(
'
uninstallApplication
'
,
data
=>
this
.
uninstallApplication
(
data
));
eventHub
.
$on
(
'
uninstallApplication
'
,
data
=>
this
.
uninstallApplication
(
data
));
eventHub
.
$on
(
'
setCrossplaneProviderStack
'
,
data
=>
this
.
setCrossplaneProviderStack
(
data
));
eventHub
.
$on
(
'
setCrossplaneProviderStack
'
,
data
=>
this
.
setCrossplaneProviderStack
(
data
));
eventHub
.
$on
(
'
setIngressModSecurityEnabled
'
,
data
=>
this
.
setIngressModSecurityEnabled
(
data
));
eventHub
.
$on
(
'
setIngressModSecurityEnabled
'
,
data
=>
this
.
setIngressModSecurityEnabled
(
data
));
...
@@ -275,7 +275,7 @@ export default class Clusters {
...
@@ -275,7 +275,7 @@ export default class Clusters {
eventHub
.
$off
(
'
installApplication
'
,
this
.
installApplication
);
eventHub
.
$off
(
'
installApplication
'
,
this
.
installApplication
);
eventHub
.
$off
(
'
updateApplication
'
,
this
.
updateApplication
);
eventHub
.
$off
(
'
updateApplication
'
,
this
.
updateApplication
);
eventHub
.
$off
(
'
saveKnativeDomain
'
);
eventHub
.
$off
(
'
saveKnativeDomain
'
);
eventHub
.
$off
(
'
setKnative
Hostname
'
);
eventHub
.
$off
(
'
setKnative
Domain
'
);
eventHub
.
$off
(
'
setCrossplaneProviderStack
'
);
eventHub
.
$off
(
'
setCrossplaneProviderStack
'
);
eventHub
.
$off
(
'
uninstallApplication
'
);
eventHub
.
$off
(
'
uninstallApplication
'
);
eventHub
.
$off
(
'
setIngressModSecurityEnabled
'
);
eventHub
.
$off
(
'
setIngressModSecurityEnabled
'
);
...
@@ -521,10 +521,15 @@ export default class Clusters {
...
@@ -521,10 +521,15 @@ export default class Clusters {
});
});
}
}
setKnative
Hostname
(
data
)
{
setKnative
Domain
(
data
)
{
const
appId
=
data
.
id
;
const
appId
=
data
.
id
;
this
.
store
.
updateAppProperty
(
appId
,
'
isEditingHostName
'
,
true
);
this
.
store
.
updateAppProperty
(
appId
,
'
isEditingDomain
'
,
true
);
this
.
store
.
updateAppProperty
(
appId
,
'
hostname
'
,
data
.
hostname
);
this
.
store
.
updateAppProperty
(
appId
,
'
hostname
'
,
data
.
domain
);
this
.
store
.
updateAppProperty
(
appId
,
'
pagesDomain
'
,
data
.
domainId
?
{
id
:
data
.
domainId
,
domain
:
data
.
domain
}
:
null
,
);
}
}
setCrossplaneProviderStack
(
data
)
{
setCrossplaneProviderStack
(
data
)
{
...
...
app/assets/javascripts/clusters/components/applications.vue
View file @
f0bb5072
...
@@ -240,16 +240,20 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
...
@@ -240,16 +240,20 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
this
.
helmInstallIllustration
=
helmInstallIllustration
;
this
.
helmInstallIllustration
=
helmInstallIllustration
;
},
},
methods
:
{
methods
:
{
saveKnativeDomain
(
hostname
)
{
saveKnativeDomain
()
{
eventHub
.
$emit
(
'
saveKnativeDomain
'
,
{
eventHub
.
$emit
(
'
saveKnativeDomain
'
,
{
id
:
'
knative
'
,
id
:
'
knative
'
,
params
:
{
hostname
},
params
:
{
hostname
:
this
.
applications
.
knative
.
hostname
,
pages_domain_id
:
this
.
applications
.
knative
.
pagesDomain
?.
id
,
},
});
});
},
},
setKnative
Hostname
(
hostname
)
{
setKnative
Domain
({
domainId
,
domain
}
)
{
eventHub
.
$emit
(
'
setKnative
Hostname
'
,
{
eventHub
.
$emit
(
'
setKnative
Domain
'
,
{
id
:
'
knative
'
,
id
:
'
knative
'
,
hostname
,
domainId
,
domain
,
});
});
},
},
setCrossplaneProviderStack
(
stack
)
{
setCrossplaneProviderStack
(
stack
)
{
...
@@ -591,7 +595,10 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
...
@@ -591,7 +595,10 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
:request-reason=
"applications.knative.requestReason"
:request-reason=
"applications.knative.requestReason"
:installed=
"applications.knative.installed"
:installed=
"applications.knative.installed"
:install-failed=
"applications.knative.installFailed"
:install-failed=
"applications.knative.installFailed"
:install-application-request-params=
"{ hostname: applications.knative.hostname }"
:install-application-request-params=
"{
hostname: applications.knative.hostname,
pages_domain_id: applications.knative.pagesDomain && applications.knative.pagesDomain.id,
}"
:installed-via=
"installedVia"
:installed-via=
"installedVia"
:uninstallable=
"applications.knative.uninstallable"
:uninstallable=
"applications.knative.uninstallable"
:uninstall-successful=
"applications.knative.uninstallSuccessful"
:uninstall-successful=
"applications.knative.uninstallSuccessful"
...
@@ -628,7 +635,7 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
...
@@ -628,7 +635,7 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
:knative=
"knative"
:knative=
"knative"
:ingress-dns-help-path=
"ingressDnsHelpPath"
:ingress-dns-help-path=
"ingressDnsHelpPath"
@
save=
"saveKnativeDomain"
@
save=
"saveKnativeDomain"
@
set=
"setKnative
Hostname
"
@
set=
"setKnative
Domain
"
/>
/>
</div>
</div>
</application-row>
</application-row>
...
...
app/assets/javascripts/clusters/components/knative_domain_editor.vue
View file @
f0bb5072
<
script
>
<
script
>
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlDropdownDivider
,
GlDropdownItem
,
GlLoadingIcon
,
GlSearchBoxByType
,
}
from
'
@gitlab/ui
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
LoadingButton
from
'
~/vue_shared/components/loading_button.vue
'
;
import
ClipboardButton
from
'
../../vue_shared/components/clipboard_button.vue
'
;
import
ClipboardButton
from
'
../../vue_shared/components/clipboard_button.vue
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
import
{
__
,
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
APPLICATION_STATUS
}
from
'
~/clusters/constants
'
;
import
{
APPLICATION_STATUS
}
from
'
~/clusters/constants
'
;
...
@@ -13,6 +19,10 @@ export default {
...
@@ -13,6 +19,10 @@ export default {
LoadingButton
,
LoadingButton
,
ClipboardButton
,
ClipboardButton
,
GlLoadingIcon
,
GlLoadingIcon
,
GlDropdown
,
GlDropdownDivider
,
GlDropdownItem
,
GlSearchBoxByType
,
},
},
props
:
{
props
:
{
knative
:
{
knative
:
{
...
@@ -25,6 +35,11 @@ export default {
...
@@ -25,6 +35,11 @@ export default {
required
:
false
,
required
:
false
,
},
},
},
},
data
()
{
return
{
searchQuery
:
''
,
};
},
computed
:
{
computed
:
{
saveButtonDisabled
()
{
saveButtonDisabled
()
{
return
[
UNINSTALLING
,
UPDATING
].
includes
(
this
.
knative
.
status
);
return
[
UNINSTALLING
,
UPDATING
].
includes
(
this
.
knative
.
status
);
...
@@ -49,9 +64,31 @@ export default {
...
@@ -49,9 +64,31 @@ export default {
return
this
.
knative
.
hostname
;
return
this
.
knative
.
hostname
;
},
},
set
(
hostname
)
{
set
(
hostname
)
{
this
.
$emit
(
'
set
'
,
hostname
);
this
.
selectCustomDomain
(
hostname
);
},
},
},
},
domainDropdownText
()
{
return
this
.
knativeHostname
||
s__
(
'
ClusterIntegration|Select existing domain or use new
'
);
},
useQueryText
()
{
return
sprintf
(
s__
(
'
ClusterIntegration|Use %{query}
'
),
{
query
:
`<code>
${
this
.
searchQuery
}
</code>`
,
},
false
,
);
},
availableDomains
()
{
return
this
.
knative
.
availableDomains
||
[];
},
filteredDomains
()
{
const
query
=
this
.
searchQuery
.
toLowerCase
();
return
this
.
availableDomains
.
filter
(({
domain
})
=>
domain
.
toLowerCase
().
includes
(
query
));
},
showDomainsDropdown
()
{
return
this
.
availableDomains
.
length
>
0
;
},
},
},
watch
:
{
watch
:
{
knativeUpdateSuccessful
(
updateSuccessful
)
{
knativeUpdateSuccessful
(
updateSuccessful
)
{
...
@@ -60,6 +97,14 @@ export default {
...
@@ -60,6 +97,14 @@ export default {
}
}
},
},
},
},
methods
:
{
selectDomain
({
id
,
domain
})
{
this
.
$emit
(
'
set
'
,
{
domain
,
domainId
:
id
});
},
selectCustomDomain
(
domain
)
{
this
.
$emit
(
'
set
'
,
{
domain
,
domainId
:
null
});
},
},
};
};
</
script
>
</
script
>
...
@@ -72,22 +117,49 @@ export default {
...
@@ -72,22 +117,49 @@ export default {
{{
s__
(
'
ClusterIntegration|Something went wrong while updating Knative domain name.
'
)
}}
{{
s__
(
'
ClusterIntegration|Something went wrong while updating Knative domain name.
'
)
}}
</div>
</div>
<template>
<div
<div
:class=
"
{ 'col-md-6': knativeInstalled, 'col-12': !knativeInstalled }"
:class=
"
{ 'col-md-6': knativeInstalled, 'col-12': !knativeInstalled }"
class="form-group col-sm-12 mb-0"
class="form-group col-sm-12 mb-0"
>
<label
for=
"knative-domainname"
>
<strong>
{{
s__
(
'
ClusterIntegration|Knative Domain Name:
'
)
}}
</strong>
</label>
<gl-dropdown
v-if=
"showDomainsDropdown"
:text=
"domainDropdownText"
toggle-class=
"dropdown-menu-toggle"
class=
"w-100 mb-2"
>
>
<label
for=
"knative-domainname"
>
<gl-search-box-by-type
<strong>
{{
s__
(
'
ClusterIntegration|Knative Domain Name:
'
)
}}
</strong>
v-model.trim=
"searchQuery"
</label>
:placeholder=
"s__('ClusterIntegration|Search domains')"
<input
class=
"m-2"
id=
"knative-domainname"
v-model=
"knativeHostname"
type=
"text"
class=
"form-control js-knative-domainname"
/>
/>
</div>
<gl-dropdown-item
</
template
>
v-for=
"domain in filteredDomains"
:key=
"domain.id"
@
click=
"selectDomain(domain)"
>
<span
class=
"ml-1"
>
{{
domain
.
domain
}}
</span>
</gl-dropdown-item>
<template
v-if=
"searchQuery"
>
<gl-dropdown-divider
/>
<gl-dropdown-item
key=
"custom-domain"
@
click=
"selectCustomDomain(searchQuery)"
>
<span
class=
"ml-1"
v-html=
"useQueryText"
></span>
</gl-dropdown-item>
</
template
>
</gl-dropdown>
<input
v-else
id=
"knative-domainname"
v-model=
"knativeHostname"
type=
"text"
class=
"form-control js-knative-domainname"
/>
</div>
<
template
v-if=
"knativeInstalled"
>
<
template
v-if=
"knativeInstalled"
>
<div
class=
"form-group col-sm-12 col-md-6 pl-md-0 mb-0 mt-3 mt-md-0"
>
<div
class=
"form-group col-sm-12 col-md-6 pl-md-0 mb-0 mt-3 mt-md-0"
>
<label
for=
"knative-endpoint"
>
<label
for=
"knative-endpoint"
>
...
@@ -144,7 +216,7 @@ export default {
...
@@ -144,7 +216,7 @@ export default {
:loading=
"saving"
:loading=
"saving"
:disabled=
"saveButtonDisabled"
:disabled=
"saveButtonDisabled"
:label=
"saveButtonLabel"
:label=
"saveButtonLabel"
@
click=
"$emit('save'
, knativeHostname
)"
@
click=
"$emit('save')"
/>
/>
</
template
>
</
template
>
</div>
</div>
...
...
app/assets/javascripts/clusters/stores/clusters_store.js
View file @
f0bb5072
...
@@ -93,7 +93,7 @@ export default class ClusterStore {
...
@@ -93,7 +93,7 @@ export default class ClusterStore {
...
applicationInitialState
,
...
applicationInitialState
,
title
:
s__
(
'
ClusterIntegration|Knative
'
),
title
:
s__
(
'
ClusterIntegration|Knative
'
),
hostname
:
null
,
hostname
:
null
,
isEditing
HostName
:
false
,
isEditing
Domain
:
false
,
externalIp
:
null
,
externalIp
:
null
,
externalHostname
:
null
,
externalHostname
:
null
,
updateSuccessful
:
false
,
updateSuccessful
:
false
,
...
@@ -234,7 +234,12 @@ export default class ClusterStore {
...
@@ -234,7 +234,12 @@ export default class ClusterStore {
'
jupyter
'
,
'
jupyter
'
,
);
);
}
else
if
(
appId
===
KNATIVE
)
{
}
else
if
(
appId
===
KNATIVE
)
{
if
(
!
this
.
state
.
applications
.
knative
.
isEditingHostName
)
{
if
(
serverAppEntry
.
available_domains
)
{
this
.
state
.
applications
.
knative
.
availableDomains
=
serverAppEntry
.
available_domains
;
}
if
(
!
this
.
state
.
applications
.
knative
.
isEditingDomain
)
{
this
.
state
.
applications
.
knative
.
pagesDomain
=
serverAppEntry
.
pages_domain
||
this
.
state
.
applications
.
knative
.
pagesDomain
;
this
.
state
.
applications
.
knative
.
hostname
=
this
.
state
.
applications
.
knative
.
hostname
=
serverAppEntry
.
hostname
||
this
.
state
.
applications
.
knative
.
hostname
;
serverAppEntry
.
hostname
||
this
.
state
.
applications
.
knative
.
hostname
;
}
}
...
...
app/controllers/clusters/applications_controller.rb
View file @
f0bb5072
...
@@ -47,7 +47,7 @@ class Clusters::ApplicationsController < Clusters::BaseController
...
@@ -47,7 +47,7 @@ class Clusters::ApplicationsController < Clusters::BaseController
end
end
def
cluster_application_params
def
cluster_application_params
params
.
permit
(
:application
,
:hostname
,
:email
,
:stack
,
:modsecurity_enabled
,
:modsecurity_mode
)
params
.
permit
(
:application
,
:hostname
,
:
pages_domain_id
,
:
email
,
:stack
,
:modsecurity_enabled
,
:modsecurity_mode
)
end
end
def
cluster_application_destroy_params
def
cluster_application_destroy_params
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment