Skip to content

Commit d4ef329

Browse files
committed
New collapsible js functionality and collapsing Azure UPI templates
1 parent 1f14b40 commit d4ef329

31 files changed

+259
-5
lines changed

_javascripts/collapsible.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const collapsibleButtonHTML = "<div id='collapsibleButtonDiv'><button type='button' name='button-collapse-expand-all' id='button-collapse-expand-all' aria-labelledby='label-collapse-expand-all' class='fa fa-angle-double-up button-collapse-expand' onclick='collapseExpandAll()'></button><span role='tooltip' id='label-collapse-expand-all' class='span-collapse-expand-all' onclick='collapseExpandAll()'>Collapse all</span></div>";
2+
3+
const collapsibleDetails = document.getElementsByTagName("details");
4+
5+
for (var i=0; i < collapsibleDetails.length; i++) {
6+
collapsibleDetails[i].insertAdjacentHTML('beforebegin', collapsibleButtonHTML);
7+
}
8+
9+
function collapseExpandAll() {
10+
const collapseExpandButtons = document.getElementsByClassName("button-collapse-expand");
11+
const collapsibleTooltip = document.getElementsByClassName("span-collapse-expand-all");
12+
13+
if (collapsibleTooltip[0].innerHTML == "Collapse all") {
14+
for (var i=0; i < collapsibleDetails.length; i++) {
15+
collapsibleDetails[i].removeAttribute("open");
16+
}
17+
for (var j=0; j < collapsibleTooltip.length; j++) {
18+
collapsibleTooltip[j].innerHTML = "Expand all";
19+
}
20+
for (var k=0; k < collapseExpandButtons.length; k++) {
21+
collapseExpandButtons[k].classList.remove("fa-angle-double-up");
22+
collapseExpandButtons[k].classList.add("fa-angle-double-down");
23+
}
24+
} else {
25+
for (var i=0; i < collapsibleDetails.length; i++) {
26+
collapsibleDetails[i].setAttribute("open", "");
27+
}
28+
for (var j=0; j < collapsibleTooltip.length; j++) {
29+
collapsibleTooltip[j].innerHTML = "Collapse all";
30+
}
31+
for (var k=0; k < collapseExpandButtons.length; k++) {
32+
collapseExpandButtons[k].classList.remove("fa-angle-double-down");
33+
collapseExpandButtons[k].classList.add("fa-angle-double-up");
34+
}
35+
}
36+
}

_stylesheets/docs.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,53 @@ table > tbody > tr > td > div > div > p > code {
512512
line-height: 1.6;
513513
color: #6e6e6e;
514514
}
515+
/* Collapsible content */
516+
details {
517+
width: 100%;
518+
margin-bottom: 10px;
519+
}
520+
details > summary {
521+
font-size: 0.92em;
522+
padding: 4px 6px;
523+
background-color: #f9f9f9;
524+
border: none;
525+
box-shadow: 2px 2px 2px #8a8a8a;
526+
cursor: pointer;
527+
margin-top: 0.8em;
528+
}
529+
details > div {
530+
border-radius: 0 0 5px 5px;
531+
background-color: #f9f9f9;
532+
padding: 4px 6px;
533+
margin: 0.5em 0.7em;
534+
box-shadow: 2px 2px 2px #8a8a8a;
535+
}
536+
#collapsibleButtonDiv {
537+
position: relative;
538+
width: 100%;
539+
padding: 1em 0em;
540+
font-size: .92em;
541+
}
542+
button[name="button-collapse-expand-all"] {
543+
position: absolute;
544+
right: 100px;
545+
bottom: 0px;
546+
margin-right: 10px;
547+
z-index: 1;
548+
}
549+
.span-collapse-expand-all {
550+
display:inline-block;
551+
width: 100px;
552+
position: absolute;
553+
right: 0px;
554+
bottom: 0px;
555+
text-align: justify;
556+
z-index: 1;
557+
}
558+
.span-collapse-expand-all:hover {
559+
cursor: pointer;
560+
}
561+
/* END Collapsible content */
515562
@media only screen and (min-width: 768px) {
516563
#toctitle, .sidebarblock > .content > .title {
517564
line-height: 1.4;

_templates/_page_openshift.html.erb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
<script src="https://docs.openshift.com/container-platform/4.1/_javascripts/page-loader.js" type="text/javascript"></script>
156156
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" type="text/javascript"></script>
157157
<script src="https://docs.openshift.com/container-platform/4.1/_javascripts/clipboard.js" type="text/javascript"></script>
158+
<script src="https://docs.openshift.com/container-platform/4.1/_javascripts/collapsible.js" type="text/javascript"></script>
158159

159160
<script>
160161
var dk = '<%= distro_key %>';
@@ -197,6 +198,11 @@
197198
$(this).parent().find("[id^='ssgSpan']").toggleClass("fa-caret-right fa-caret-down");
198199
});
199200

201+
const collapsibleContent = document.getElementsByTagName("details");
202+
for (var i=0; i < collapsibleContent.length; i++) {
203+
collapsibleContent[i].setAttribute("open", "");
204+
}
205+
200206
});
201207
/*]]>*/
202208
</script>

modules/installation-arm-bootstrap.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ You can use the following Azure Resource Manager (ARM) template to deploy the
99
bootstrap machine that you need for your {product-title} cluster:
1010

1111
.`04_bootstrap.json` ARM template
12+
[%collapsible]
13+
====
1214
[source,json]
1315
----
1416
include::https://raw.githubusercontent.com/openshift/installer/release-4.6/upi/azure/04_bootstrap.json[]
1517
----
18+
====

modules/installation-arm-control-plane.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ You can use the following Azure Resource Manager (ARM) template to deploy the
99
control plane machines that you need for your {product-title} cluster:
1010

1111
.`05_masters.json` ARM template
12+
[%collapsible]
13+
====
1214
[source,json]
1315
----
1416
include::https://raw.githubusercontent.com/openshift/installer/release-4.6/upi/azure/05_masters.json[]
1517
----
18+
====

modules/installation-arm-dns.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ networking objects and load balancers that you need for your {product-title}
1010
cluster:
1111

1212
.`03_infra.json` ARM template
13+
[%collapsible]
14+
====
1315
[source,json]
1416
----
1517
include::https://raw.githubusercontent.com/openshift/installer/release-4.6/upi/azure/03_infra.json[]
1618
----
19+
====

modules/installation-arm-image-storage.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ You can use the following Azure Resource Manager (ARM) template to deploy the
99
stored {op-system-first} image that you need for your {product-title} cluster:
1010

1111
.`02_storage.json` ARM template
12+
[%collapsible]
13+
====
1214
[source,json]
1315
----
1416
include::https://raw.githubusercontent.com/openshift/installer/release-4.6/upi/azure/02_storage.json[]
1517
----
18+
====

modules/installation-arm-vnet.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ You can use the following Azure Resource Manager (ARM) template to deploy the
99
VNet that you need for your {product-title} cluster:
1010

1111
.`01_vnet.json` ARM template
12+
[%collapsible]
13+
====
1214
[source,json]
1315
----
1416
include::https://raw.githubusercontent.com/openshift/installer/release-4.6/upi/azure/01_vnet.json[]
1517
----
18+
====

modules/installation-arm-worker.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ You can use the following Azure Resource Manager (ARM) template to deploy the
99
worker machines that you need for your {product-title} cluster:
1010

1111
.`06_workers.json` ARM template
12+
[%collapsible]
13+
====
1214
[source,json]
1315
----
1416
include::https://raw.githubusercontent.com/openshift/installer/release-4.6/upi/azure/06_workers.json[]
1517
----
18+
====

modules/installation-aws-permissions.adoc

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ you grant that user all of the required permissions. To deploy all components of
1212
cluster, the IAM user requires the following permissions:
1313

1414
.Required EC2 permissions for installation
15+
[%collapsible]
16+
====
1517
* `ec2:AllocateAddress`
1618
* `ec2:AssociateAddress`
1719
* `ec2:AuthorizeSecurityGroupEgress`
@@ -58,8 +60,11 @@ cluster, the IAM user requires the following permissions:
5860
* `ec2:RevokeSecurityGroupIngress`
5961
* `ec2:RunInstances`
6062
* `ec2:TerminateInstances`
63+
====
6164

6265
.Required permissions for creating network resources during installation
66+
[%collapsible]
67+
====
6368
* `ec2:AssociateDhcpOptions`
6469
* `ec2:AssociateRouteTable`
6570
* `ec2:AttachInternetGateway`
@@ -75,11 +80,14 @@ cluster, the IAM user requires the following permissions:
7580
* `ec2:ModifyVpcAttribute`
7681
7782
[NOTE]
78-
====
83+
=====
7984
If you use an existing VPC, your account does not require these permissions for creating network resources.
85+
=====
8086
====
8187

8288
.Required Elasticloadbalancing permissions for installation
89+
[%collapsible]
90+
====
8391
* `elasticloadbalancing:AddTags`
8492
* `elasticloadbalancing:ApplySecurityGroupsToLoadBalancer`
8593
* `elasticloadbalancing:AttachLoadBalancerToSubnets`
@@ -104,8 +112,11 @@ If you use an existing VPC, your account does not require these permissions for
104112
* `elasticloadbalancing:RegisterInstancesWithLoadBalancer`
105113
* `elasticloadbalancing:RegisterTargets`
106114
* `elasticloadbalancing:SetLoadBalancerPoliciesOfListener`
115+
====
107116

108117
.Required IAM permissions for installation
118+
[%collapsible]
119+
====
109120
* `iam:AddRoleToInstanceProfile`
110121
* `iam:CreateInstanceProfile`
111122
* `iam:CreateRole`
@@ -124,8 +135,11 @@ If you use an existing VPC, your account does not require these permissions for
124135
* `iam:RemoveRoleFromInstanceProfile`
125136
* `iam:SimulatePrincipalPolicy`
126137
* `iam:TagRole`
138+
====
127139

128140
.Required Route53 permissions for installation
141+
[%collapsible]
142+
====
129143
* `route53:ChangeResourceRecordSets`
130144
* `route53:ChangeTagsForResource`
131145
* `route53:CreateHostedZone`
@@ -137,8 +151,11 @@ If you use an existing VPC, your account does not require these permissions for
137151
* `route53:ListResourceRecordSets`
138152
* `route53:ListTagsForResource`
139153
* `route53:UpdateHostedZoneComment`
154+
====
140155

141156
.Required S3 permissions for installation
157+
[%collapsible]
158+
====
142159
* `s3:CreateBucket`
143160
* `s3:DeleteBucket`
144161
* `s3:GetAccelerateConfiguration`
@@ -159,8 +176,11 @@ If you use an existing VPC, your account does not require these permissions for
159176
* `s3:PutBucketAcl`
160177
* `s3:PutBucketTagging`
161178
* `s3:PutEncryptionConfiguration`
179+
====
162180

163181
.S3 permissions that cluster Operators require
182+
[%collapsible]
183+
====
164184
* `s3:DeleteObject`
165185
* `s3:GetObject`
166186
* `s3:GetObjectAcl`
@@ -169,8 +189,11 @@ If you use an existing VPC, your account does not require these permissions for
169189
* `s3:PutObject`
170190
* `s3:PutObjectAcl`
171191
* `s3:PutObjectTagging`
192+
====
172193

173194
.Required permissions to delete base cluster resources
195+
[%collapsible]
196+
====
174197
* `autoscaling:DescribeAutoScalingGroups`
175198
* `ec2:DeleteNetworkInterface`
176199
* `ec2:DeleteVolume`
@@ -184,8 +207,11 @@ If you use an existing VPC, your account does not require these permissions for
184207
* `s3:DeleteObject`
185208
* `s3:ListBucketVersions`
186209
* `tag:GetResources`
210+
====
187211

188212
.Required permissions to delete network resources
213+
[%collapsible]
214+
====
189215
* `ec2:DeleteDhcpOptions`
190216
* `ec2:DeleteInternetGateway`
191217
* `ec2:DeleteNatGateway`
@@ -199,11 +225,14 @@ If you use an existing VPC, your account does not require these permissions for
199225
* `ec2:ReplaceRouteTableAssociation`
200226
201227
[NOTE]
202-
====
228+
=====
203229
If you use an existing VPC, your account does not require these permissions to delete network resources.
230+
=====
204231
====
205232

206233
.Additional IAM and S3 permissions that are required to create manifests
234+
[%collapsible]
235+
====
207236
* `iam:CreateAccessKey`
208237
* `iam:CreateUser`
209238
* `iam:DeleteAccessKey`
@@ -221,3 +250,4 @@ If you use an existing VPC, your account does not require these permissions to d
221250
* `s3:HeadBucket`
222251
* `s3:ListBucketMultipartUploads`
223252
* `s3:AbortMultipartUpload`
253+
====

0 commit comments

Comments
 (0)