Skip to content

Commit

Permalink
#1.7
Browse files Browse the repository at this point in the history
1. Унифицировал формирование ссылок через функцию
  • Loading branch information
koa73 committed Jun 4, 2024
1 parent 54e5882 commit b9db03b
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions entities/ta/presentation/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ entities:

source: >
(
$refs := $eval($.functions."seaf.ta".get_refs, [{"c":"seaf.ta.components.server"}, $]);
$refs := $eval($.functions."seaf.ta".get_refs, [{"c":"seaf.ta.components.server"}, $]);
$get_link := $.functions."seaf.ta".get_link;
[[$."seaf.ta.components.server".$spread().(
$COMPONENT_ID := $keys()[0];
$.*.{
Expand All @@ -50,7 +51,7 @@ entities:
"office": office,
"fqdn_name": fqdn_name,
"link": '/entities/seaf.ta.components.server/list?ta-component-id=' & $COMPONENT_ID,
"dc_link" : "/entities/"& $refs."dc_id" &"/list?ta-component-id=" & dc_id
"dc_link" : $eval($get_link,{"hr":$refs."dc_id","val":dc_id})
}
)]^(title)]
)
Expand Down Expand Up @@ -105,6 +106,7 @@ entities:
source: >
(
$refs := $eval($.functions."seaf.ta".get_refs, [{"c":"seaf.ta.components.hw_storage"}, $]);
$get_link := $.functions."seaf.ta".get_link;
[[$."seaf.ta.components.hw_storage".$spread().(
$COMPONENT_ID := $keys()[0];
$.*.{
Expand All @@ -113,7 +115,7 @@ entities:
"dc_id": dc_id,
"office": office,
"link": '/entities/seaf.ta.components.hw_storage/list?ta-component-id=' & $COMPONENT_ID,
"dc_link" : "/entities/"& $refs."dc_id" &"/list?ta-component-id=" & dc_id
"dc_link" : $eval($get_link,{"hr":$refs."dc_id","val":dc_id})
}
)]^(title)]
)
Expand Down Expand Up @@ -175,6 +177,7 @@ entities:
source: >
(
$refs := $eval($.functions."seaf.ta".get_refs, [{"c":"seaf.ta.components.network"}, $]);
$get_link := $.functions."seaf.ta".get_link;
[[$."seaf.ta.components.network".$spread().(
$COMPONENT_ID := $keys()[0];
$.*.{
Expand All @@ -185,7 +188,7 @@ entities:
"office": office,
"model": model,
"link": '/entities/seaf.ta.components.network/list?ta-component-id=' & $COMPONENT_ID,
"dc_link" : "/entities/"& $refs."dc_id" &"/list?ta-component-id=" & dc_id
"dc_link" : $eval($get_link,{"hr":$refs."dc_id","val":dc_id})
}
)]^(title)]
)
Expand Down Expand Up @@ -293,6 +296,7 @@ entities:
source: >
(
$refs := $eval($.functions."seaf.ta".get_refs, [{"c":"seaf.ta.components.k8s_deployment"}, $]);
$get_link := $.functions."seaf.ta".get_link;
[[$."seaf.ta.components.k8s_deployment".$spread().(
$COMPONENT_ID := $keys()[0];
$.*.{
Expand All @@ -301,8 +305,8 @@ entities:
"kubernetes_id": kubernetes_id,
"availabilityzone_id": availabilityzone_id,
"link": '/entities/seaf.ta.components.k8s_deployment/list?ta-component-id=' & $COMPONENT_ID,
"avail_link" : "/entities/" & $refs."availabilityzone_id" &"/list?ta-component-id=" & availabilityzone_id,
"k_link" : "/entities/"& $refs."kubernetes_id" &"/list?ta-component-id=" & kubernetes_id[0]
"avail_link" : $eval($get_link,{"hr":$refs."availabilityzone_id","val":availabilityzone_id}),
"k_link" : $eval($get_link,{"hr":$refs."kubernetes_id","val":kubernetes_id})
}
)]^(title)]
)
Expand Down Expand Up @@ -358,6 +362,7 @@ entities:
source: >
(
$refs := $eval($.functions."seaf.ta".get_refs, [{"c":"seaf.ta.components.k8s_statefulset"}, $]);
$get_link := $.functions."seaf.ta".get_link;
[[$."seaf.ta.components.k8s_statefulset".$spread().(
$COMPONENT_ID := $keys()[0];
$.*.{
Expand All @@ -366,8 +371,8 @@ entities:
"kubernetes_id": kubernetes_id,
"availabilityzone_id": availabilityzone_id,
"link": '/entities/seaf.ta.components.k8s_statefulset/list?ta-component-id=' & $COMPONENT_ID,
"avail_link" : "/entities/"& $refs."availabilityzone_id" &"/list?ta-component-id=" & availabilityzone_id,
"k_link" : "/entities/"& $refs."kubernetes_id" &"/list?ta-component-id=" & kubernetes_id[0]
"avail_link" : $eval($get_link,{"hr":$refs."availabilityzone_id","val":availabilityzone_id}),
"k_link" : $eval($get_link,{"hr":$refs."kubernetes_id","val":kubernetes_id})
}
)]^(title)]
)
Expand Down Expand Up @@ -416,15 +421,15 @@ entities:
source: >
(
$refs := $eval($.functions."seaf.ta".get_refs, [{"c":"seaf.ta.components.k8s_pod"}, $]);
$get_link := $.functions."seaf.ta".get_link;
[[$."seaf.ta.components.k8s_pod".$spread().(
$COMPONENT_ID := $keys()[0];
$.*.{
"title": title,
"description": description,
"kubernetes_id": kubernetes_id,
"link": '/entities/seaf.ta.components.k8s_pod/list?ta-component-id=' & $COMPONENT_ID,
"k_link" : "/entities/"& $refs."kubernetes_id" &"/list?ta-component-id=" & kubernetes_id[0]
"k_link" : $eval($get_link,{"hr":$refs."kubernetes_id","val":kubernetes_id })
}
)]^(name)]
)
Expand Down

0 comments on commit b9db03b

Please sign in to comment.