Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CSAN
Csan
Commits
2c422435
Commit
2c422435
authored
Jul 08, 2020
by
AllForNothing
Browse files
Add query string for getting registry
Signed-off-by:
AllForNothing
<
sshijun@vmware.com
>
parent
b56a49ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
src/portal/src/app/project/create-project/create-project.component.ts
...rc/app/project/create-project/create-project.component.ts
+6
-5
No files found.
src/portal/src/app/project/create-project/create-project.component.ts
View file @
2c422435
...
...
@@ -23,8 +23,8 @@ import {
OnChanges
,
SimpleChanges
,
AfterViewInit
,
ElementRef
}
from
"
@angular/core
"
;
import
{
NgForm
,
Validators
,
AbstractControl
}
from
"
@angular/forms
"
;
import
{
fromEvent
,
Subject
,
Subscription
}
from
"
rxjs
"
;
import
{
NgForm
,
Validators
}
from
"
@angular/forms
"
;
import
{
fromEvent
,
Subscription
}
from
"
rxjs
"
;
import
{
TranslateService
}
from
"
@ngx-translate/core
"
;
import
{
MessageHandlerService
}
from
"
../../shared/message-handler/message-handler.service
"
;
import
{
InlineAlertComponent
}
from
"
../../shared/inline-alert/inline-alert.component
"
;
...
...
@@ -32,6 +32,7 @@ import { Project } from "../project";
import
{
QuotaUnits
,
QuotaUnlimited
}
from
"
../../../lib/entities/shared.const
"
;
import
{
Endpoint
,
EndpointService
,
ProjectService
,
QuotaHardInterface
}
from
'
../../../lib/services
'
;
import
{
clone
,
getByte
,
GetIntegerAndUnit
,
validateLimit
}
from
"
../../../lib/utils/utils
"
;
import
{
HttpParams
}
from
'
@angular/common/http
'
;
@
Component
({
...
...
@@ -74,7 +75,7 @@ export class CreateProjectComponent implements OnInit, AfterViewInit, OnChanges
checkNameSubscribe
:
Subscription
;
registries
:
Endpoint
[]
=
[];
supportedRegistryType
:
string
[]
=
[
'
docker-hub
'
,
'
harbor
'
]
;
supportedRegistryType
QueryString
:
string
=
"
type={
docker-hub
harbor
}
"
;
constructor
(
private
projectService
:
ProjectService
,
private
translateService
:
TranslateService
,
...
...
@@ -87,10 +88,10 @@ export class CreateProjectComponent implements OnInit, AfterViewInit, OnChanges
}
getRegistries
()
{
this
.
endpointService
.
getEndpoints
()
this
.
endpointService
.
getEndpoints
(
null
,
new
HttpParams
().
set
(
'
q
'
,
this
.
supportedRegistryTypeQueryString
)
)
.
subscribe
(
targets
=>
{
if
(
targets
&&
targets
.
length
)
{
this
.
registries
=
targets
.
filter
(
item
=>
this
.
supportedRegistryType
.
indexOf
(
item
.
type
)
!==
-
1
)
;
this
.
registries
=
targets
;
}
},
error
=>
{
this
.
messageHandlerService
.
handleError
(
error
);
...
...
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