Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Melodic
melodic-frontend
Commits
3661f649
Commit
3661f649
authored
Nov 19, 2019
by
Alicja Reniewicz
Browse files
id for all ByonDefinition elements
parent
9d77a1c2
Changes
12
Hide whitespace changes
Inline
Side-by-side
src/app/application/model/ip-address.ts
View file @
3661f649
...
...
@@ -7,6 +7,7 @@ export enum IpVersion {
}
export
class
IpAddress
{
id
:
number
;
ipAddressType
:
IpAddressType
;
ipVersion
:
string
;
value
:
string
;
...
...
src/app/application/model/login-credential.ts
View file @
3661f649
export
class
LoginCredential
{
id
:
number
;
username
:
string
;
password
:
string
;
privateKey
:
string
;
...
...
src/app/application/model/node-properties.ts
View file @
3661f649
...
...
@@ -2,6 +2,7 @@ import {OperatingSystem} from '../../process/process-details/offer/model/operati
import
{
GeoLocation
}
from
'
../../process/process-details/offer/model/geo-location
'
;
export
class
NodeProperties
{
id
:
number
;
providerId
:
string
;
numberOfCores
:
number
;
memory
:
number
;
...
...
src/app/byon/byon-definition-form/byon-definition-form.component.ts
View file @
3661f649
...
...
@@ -66,6 +66,7 @@ export class ByonDefinitionFormComponent implements OnInit {
}
);
this
.
loginCredentialForm
=
this
.
formBuilder
.
group
({
id
:
this
.
byonData
?
this
.
byonData
.
loginCredential
.
id
:
null
,
username
:
this
.
byonData
?
new
FormControl
({
value
:
this
.
byonData
.
loginCredential
.
username
,
disabled
:
this
.
isReadMode
})
:
[
''
,
Validators
.
required
],
password
:
this
.
byonData
?
new
FormControl
({
value
:
this
.
byonData
.
loginCredential
.
password
,
disabled
:
this
.
isReadMode
})
...
...
@@ -77,6 +78,7 @@ export class ByonDefinitionFormComponent implements OnInit {
validators
:
oneOfTwoFieldsRequiredValidator
(
'
password
'
,
'
privateKey
'
)
});
this
.
geoLocationForm
=
this
.
formBuilder
.
group
({
id
:
this
.
byonData
?
this
.
byonData
.
nodeProperties
.
geoLocation
.
id
:
null
,
city
:
this
.
byonData
?
new
FormControl
({
value
:
this
.
byonData
.
nodeProperties
.
geoLocation
.
city
,
disabled
:
this
.
isReadMode
})
:
[
''
,
Validators
.
required
],
country
:
this
.
byonData
?
new
FormControl
({
value
:
this
.
byonData
.
nodeProperties
.
geoLocation
.
country
,
disabled
:
this
.
isReadMode
})
...
...
@@ -90,6 +92,7 @@ export class ByonDefinitionFormComponent implements OnInit {
});
this
.
operatingSystemForm
=
this
.
formBuilder
.
group
({
id
:
this
.
byonData
?
this
.
byonData
.
nodeProperties
.
operatingSystem
.
id
:
null
,
operatingSystemFamily
:
this
.
byonData
?
new
FormControl
({
value
:
this
.
byonData
.
nodeProperties
.
operatingSystem
.
operatingSystemFamily
,
disabled
:
this
.
isReadMode
...
...
@@ -105,6 +108,7 @@ export class ByonDefinitionFormComponent implements OnInit {
});
this
.
nodePropertiesForm
=
this
.
formBuilder
.
group
({
id
:
this
.
byonData
?
this
.
byonData
.
nodeProperties
.
id
:
null
,
providerId
:
this
.
byonData
?
new
FormControl
({
value
:
this
.
byonData
.
nodeProperties
.
providerId
,
disabled
:
this
.
isReadMode
})
:
[
''
,
Validators
.
required
],
numberOfCores
:
this
.
byonData
?
new
FormControl
({
value
:
this
.
byonData
.
nodeProperties
.
numberOfCores
,
disabled
:
this
.
isReadMode
})
...
...
src/app/byon/byon-list-common/byon-list-common.component.ts
View file @
3661f649
import
{
Component
,
OnInit
,
ViewChild
}
from
'
@angular/core
'
;
import
{
MatPaginator
,
MatSnackBar
,
MatSort
,
MatTableDataSource
}
from
'
@angular/material
'
;
import
{
Byon
}
from
'
../model/byon
'
;
import
{
IpAddressType
}
from
'
../../application/model/ip-address
'
;
import
{
IpAddressType
,
IpVersion
}
from
'
../../application/model/ip-address
'
;
import
{
Cloud
}
from
'
../../process/process-details/offer/model/cloud
'
;
import
{
ByonService
}
from
'
../service/byon.service
'
;
import
{
AppInjector
}
from
'
../../injector/app-injector
'
;
...
...
@@ -41,9 +41,10 @@ export class ByonListCommonComponent implements OnInit {
}
}
getPublicIp
(
byon
:
Byon
):
string
{
getPublicIp
V4
(
byon
:
Byon
):
string
{
const
publicIP
=
byon
.
ipAddresses
.
find
(
value
=>
value
.
ipAddressType
.
toString
()
===
IpAddressType
[
IpAddressType
.
PUBLIC_IP
]);
.
find
(
value
=>
(
value
.
ipAddressType
.
toString
()
===
IpAddressType
[
IpAddressType
.
PUBLIC_IP
]
&&
value
.
ipVersion
.
toString
()
===
IpVersion
[
IpVersion
.
V4
]));
return
publicIP
?
publicIP
.
value
:
'
UNKNOWN
'
;
}
...
...
@@ -71,7 +72,7 @@ export class ByonListCommonComponent implements OnInit {
this
.
data
.
sortingDataAccessor
=
(
item
,
property
)
=>
{
switch
(
property
)
{
case
'
publicIpAddress
'
:
return
this
.
getPublicIp
(
item
);
return
this
.
getPublicIp
V4
(
item
);
case
'
cores
'
:
return
item
.
nodeProperties
.
numberOfCores
;
case
'
memory
'
:
...
...
@@ -93,7 +94,7 @@ export class ByonListCommonComponent implements OnInit {
}
private
getByonDefinitionAsString
(
byon
:
Byon
)
{
return
`
${
byon
.
name
}
${
this
.
getPublicIp
(
byon
)}
${
byon
.
nodeProperties
.
numberOfCores
}
${
byon
.
nodeProperties
.
memory
}
return
`
${
byon
.
name
}
${
this
.
getPublicIp
V4
(
byon
)}
${
byon
.
nodeProperties
.
numberOfCores
}
${
byon
.
nodeProperties
.
memory
}
${
byon
.
nodeProperties
.
disk
}
${
this
.
getSystemWithVersion
(
byon
)}
${
this
.
getLocation
(
byon
)}
${
this
.
getProviderName
(
byon
)}
`
;
}
}
src/app/byon/byon-list/byon-list.component.html
View file @
3661f649
...
...
@@ -35,9 +35,9 @@
</ng-container>
<ng-container
matColumnDef=
"publicIpAddress"
>
<th
mat-header-cell
*matHeaderCellDef
mat-sort-header
>
Public IP address
</th>
<th
mat-header-cell
*matHeaderCellDef
mat-sort-header
>
Public IP
v4
address
</th>
<td
mat-cell
*matCellDef=
"let row"
(click)=
"onReadByonDefinitionClick(row)"
>
{{getPublicIp(row)}}
{{getPublicIp
V4
(row)}}
</td>
</ng-container>
...
...
src/app/byon/byon-list/byon-list.component.ts
View file @
3661f649
...
...
@@ -48,6 +48,7 @@ export class ByonListComponent extends ByonListCommonComponent implements OnInit
});
},
error1
=>
{
this
.
byonLoadingInProgress
=
false
;
this
.
cloudsList
=
[];
this
.
snackBar
.
open
(
`Problem by getting data about clouds:
${
error1
.
error
.
message
}
`
,
'
Close
'
);
});
...
...
@@ -58,7 +59,7 @@ export class ByonListComponent extends ByonListCommonComponent implements OnInit
}
onSshConnectionClick
(
byon
:
Byon
)
{
this
.
webSshService
.
createSshConnection
(
byon
.
loginCredential
,
this
.
getPublicIp
(
byon
),
byon
.
name
);
this
.
webSshService
.
createSshConnection
(
byon
.
loginCredential
,
this
.
getPublicIp
V4
(
byon
),
byon
.
name
);
}
onEditByonDefinitionClick
(
byon
:
Byon
)
{
...
...
src/app/common-template/menu/menu.component.html
View file @
3661f649
...
...
@@ -25,6 +25,7 @@
<a
mat-list-item
routerLink=
"/process/details/deployment"
>
Deployed artifacts
</a>
<a
mat-list-item
routerLink=
"."
>
Melodic components
</a>
<a
mat-list-item
routerLink=
"/provider/cloud-definition"
>
Providers settings
</a>
<a
mat-list-item
routerLink=
"/byon"
>
Byons settings
</a>
<a
mat-list-item
routerLink=
"/process/details/offer"
>
Offers
</a>
<a
*ngIf=
"isAdmin()"
mat-list-item
routerLink=
"/user"
>
Manage users
</a>
<a
mat-list-item
routerLink=
"/user/password"
>
Change password
</a>
...
...
src/app/deploying-application/byon-definitions/byon-definitions.component.html
View file @
3661f649
...
...
@@ -34,8 +34,8 @@
</ng-container>
<ng-container
matColumnDef=
"publicIpAddress"
>
<th
mat-header-cell
*matHeaderCellDef
mat-sort-header
>
public IP address
</th>
<td
mat-cell
*matCellDef=
"let row"
>
{{getPublicIp(row)}}
</td>
<th
mat-header-cell
*matHeaderCellDef
mat-sort-header
>
public IP
v4
address
</th>
<td
mat-cell
*matCellDef=
"let row"
>
{{getPublicIp
V4
(row)}}
</td>
</ng-container>
<ng-container
matColumnDef=
"cores"
>
...
...
src/app/deploying-application/byon-definitions/byon-definitions.component.ts
View file @
3661f649
...
...
@@ -62,7 +62,8 @@ export class ByonDefinitionsComponent extends ByonListCommonComponent implements
isByonFromCloudiator
(
byon
:
Byon
)
{
return
this
.
byonInCloudiatorList
.
find
(
valueFromList
=>
this
.
getPublicIp
(
valueFromList
)
===
this
.
getPublicIp
(
byon
));
.
find
(
valueFromList
=>
(
this
.
getPublicIpV4
(
valueFromList
)
===
this
.
getPublicIpV4
(
byon
)
&&
valueFromList
.
name
===
byon
.
name
));
}
getByonDefinitionList
()
{
...
...
@@ -96,7 +97,8 @@ export class ByonDefinitionsComponent extends ByonListCommonComponent implements
byonDefValue
.
forEach
(
value
=>
{
if
(
this
.
isByonFromCloudiator
(
value
))
{
value
.
id
=
this
.
byonInCloudiatorList
.
find
(
valueFromList
=>
this
.
getPublicIp
(
valueFromList
)
===
this
.
getPublicIp
(
value
)).
id
;
.
find
(
valueFromList
=>
(
this
.
getPublicIpV4
(
valueFromList
)
===
this
.
getPublicIpV4
(
value
)
&&
valueFromList
.
name
===
value
.
name
)).
id
;
}
});
}
...
...
src/app/process/process-details/offer/model/geo-location.ts
View file @
3661f649
export
class
GeoLocation
{
id
:
number
;
city
:
string
;
country
:
string
;
latitude
:
number
;
...
...
src/app/process/process-details/offer/model/operating-system.ts
View file @
3661f649
export
class
OperatingSystem
{
id
:
number
;
operatingSystemFamily
:
string
;
operatingSystemArchitecture
:
string
;
operatingSystemVersion
:
number
;
...
...
Write
Preview
Supports
Markdown
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