|
1 | 1 | <template>
|
2 | 2 | <div id="main">
|
3 | 3 | <b-navbar toggleable="md" variant="faded">
|
4 |
| - <b-navbar-brand to="/summary"> |
5 |
| - Cloudsplaining |
6 |
| - </b-navbar-brand> |
| 4 | + <b-navbar-brand to="/summary"> Cloudsplaining </b-navbar-brand> |
7 | 5 | <b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
|
8 | 6 |
|
9 | 7 | <b-collapse id="nav-collapse" is-nav>
|
10 | 8 | <b-navbar-nav>
|
11 |
| - <b-nav-item to="/customer-policies">Customer Policies</b-nav-item> |
12 |
| - <b-nav-item to="/inline-policies">Inline Policies</b-nav-item> |
| 9 | + <b-nav-item to="/customer-policies" |
| 10 | + >Customer Policies</b-nav-item |
| 11 | + > |
| 12 | + <b-nav-item to="/inline-policies" |
| 13 | + >Inline Policies</b-nav-item |
| 14 | + > |
13 | 15 | <b-nav-item to="/aws-policies">AWS Policies</b-nav-item>
|
14 | 16 | <b-nav-item to="/iam-principals">IAM Principals</b-nav-item>
|
15 |
| - <b-nav-item to="/guidance">Guidance</b-nav-item> |
16 |
| - <b-nav-item to="/appendices">Appendices</b-nav-item> |
| 17 | + <b-nav-item v-if="show_guidance_nav" to="/guidance" |
| 18 | + >Guidance</b-nav-item |
| 19 | + > |
| 20 | + <b-nav-item v-if="show_appendices_nav" to="/appendices" |
| 21 | + >Appendices</b-nav-item |
| 22 | + > |
17 | 23 | <!-- <b-nav-item to="/task-table">Task Table Demo</b-nav-item> -->
|
18 | 24 | </b-navbar-nav>
|
19 | 25 | <b-navbar-nav class="ml-auto">
|
20 |
| - <b-nav-text><strong>Account ID:</strong> {{ account_id }} | <strong>Account Name:</strong> {{ account_name }}</b-nav-text> |
| 26 | + <b-nav-text |
| 27 | + ><strong>Account ID:</strong> {{ account_id }} | |
| 28 | + <strong>Account Name:</strong> |
| 29 | + {{ account_name }}</b-nav-text |
| 30 | + > |
21 | 31 | </b-navbar-nav>
|
22 | 32 | </b-collapse>
|
23 | 33 | </b-navbar>
|
24 | 34 |
|
25 | 35 | <b-container class="mt-3 pb-3 report">
|
26 | 36 | <b-tabs nav-class="d-none">
|
27 | 37 | <router-view />
|
28 |
| - <!-- <b-tab key="task-table">--> |
29 |
| -<!-- <br>--> |
30 |
| -<!-- <h3>Tasks (demo WIP)</h3>--> |
31 |
| -<!-- <br>--> |
32 |
| -<!--<!– <h3>Customer-Managed Policies</h3>–>--> |
33 |
| -<!--<!– <TaskTable managedBy="Customer" v-bind:items_mapping="getTaskTableMapping('Customer')"/>–>--> |
34 |
| -<!--<!– <br>–>--> |
35 |
| -<!-- <!–TODO: Figure out the overlap issue where the two tables results in a double info field in Customer policies–>--> |
36 |
| -<!-- <h3>AWS-Managed Policies</h3>--> |
37 |
| -<!-- <TaskTable managedBy="AWS" v-bind:items_mapping="getTaskTableMapping('AWS')"/>--> |
38 |
| -<!-- <!–TODO: Task table for Inline Policies–>--> |
39 |
| -<!--<!– <h3>Inline Policies</h3>–>--> |
40 |
| -<!--<!– <TaskTable v-bind:policyNameMapping="getInlinePolicyNameMapping()"/>–>--> |
41 |
| -<!-- </b-tab> --> |
| 38 | + <!-- <b-tab key="task-table">--> |
| 39 | + <!-- <br>--> |
| 40 | + <!-- <h3>Tasks (demo WIP)</h3>--> |
| 41 | + <!-- <br>--> |
| 42 | + <!--<!– <h3>Customer-Managed Policies</h3>–>--> |
| 43 | + <!--<!– <TaskTable managedBy="Customer" v-bind:items_mapping="getTaskTableMapping('Customer')"/>–>--> |
| 44 | + <!--<!– <br>–>--> |
| 45 | + <!-- <!–TODO: Figure out the overlap issue where the two tables results in a double info field in Customer policies–>--> |
| 46 | + <!-- <h3>AWS-Managed Policies</h3>--> |
| 47 | + <!-- <TaskTable managedBy="AWS" v-bind:items_mapping="getTaskTableMapping('AWS')"/>--> |
| 48 | + <!-- <!–TODO: Task table for Inline Policies–>--> |
| 49 | + <!--<!– <h3>Inline Policies</h3>–>--> |
| 50 | + <!--<!– <TaskTable v-bind:policyNameMapping="getInlinePolicyNameMapping()"/>–>--> |
| 51 | + <!-- </b-tab> --> |
42 | 52 | </b-tabs>
|
43 | 53 | </b-container>
|
44 | 54 | <b-container>
|
45 | 55 | <b-row class="mt-5">
|
46 | 56 | <b-col class="text-center text-muted">
|
47 | 57 | Report Generated: {{ report_generated_time }} ⋄
|
48 | 58 | Cloudsplaining version:
|
49 |
| - <b-link href="https://github.com/salesforce/cloudsplaining">{{ cloudsplaining_version }}</b-link> |
| 59 | + <b-link |
| 60 | + href="https://github.com/salesforce/cloudsplaining" |
| 61 | + >{{ cloudsplaining_version }}</b-link |
| 62 | + > |
50 | 63 | </b-col>
|
51 | 64 | </b-row>
|
52 | 65 | </b-container>
|
53 | 66 | </div>
|
54 | 67 | </template>
|
55 | 68 |
|
56 | 69 | <script>
|
57 |
| - const managedPoliciesUtil = require('./util/managed-policies'); |
58 |
| - const inlinePoliciesUtil = require('./util/inline-policies'); |
59 |
| - const taskTableUtil = require('./util/task-table'); |
60 |
| - const sampleData = require('./sampleData'); |
| 70 | +const managedPoliciesUtil = require("./util/managed-policies"); |
| 71 | +const inlinePoliciesUtil = require("./util/inline-policies"); |
| 72 | +const taskTableUtil = require("./util/task-table"); |
| 73 | +const sampleData = require("./sampleData"); |
61 | 74 |
|
62 |
| - console.log(`process.env.NODE_ENV: ${process.env.NODE_ENV}`) |
| 75 | +console.log(`process.env.NODE_ENV: ${process.env.NODE_ENV}`); |
63 | 76 |
|
64 |
| - // This conditionally loads the local sample data if you are developing, but not if you are viewing the report |
| 77 | +// This conditionally loads the local sample data if you are developing, but not if you are viewing the report |
65 | 78 |
|
| 79 | +// eslint-disable-next-line no-undef |
| 80 | +if (process.env.NODE_ENV === "development" || isLocalExample === true) { |
66 | 81 | // eslint-disable-next-line no-undef
|
67 |
| - if ((process.env.NODE_ENV === "development") || (isLocalExample === true)) { |
68 |
| - // eslint-disable-next-line no-undef |
69 |
| - console.log(`isLocalExample is set to: ${isLocalExample}`) |
70 |
| - console.log(`process.env.NODE_ENV: ${process.env.NODE_ENV}`) |
71 |
| - console.log(`Note: a report generated with the Python template will not have isLocalExample set to True, because that uses a separate template.html file, which has isLocalExample set to False.`) |
72 |
| - // eslint-disable-next-line no-unused-vars,no-undef |
73 |
| - iam_data = sampleData.sample_iam_data; |
74 |
| - // eslint-disable-next-line no-undef |
75 |
| - console.log(`IAM Data keys inside the development if statement: ${Object.keys(iam_data)}`); |
76 |
| - // eslint-disable-next-line no-unused-vars,no-undef |
77 |
| - account_id = "12345678912"; |
78 |
| - // eslint-disable-next-line no-unused-vars,no-undef |
79 |
| - account_name = "example"; |
80 |
| - // eslint-disable-next-line no-unused-vars,no-undef |
81 |
| - report_generated_time = "2020-09-01"; |
82 |
| - // eslint-disable-next-line no-unused-vars,no-undef |
83 |
| - cloudsplaining_version = "0.2.2"; |
84 |
| - } |
85 |
| - else { |
86 |
| - // eslint-disable-next-line no-undef |
87 |
| - console.log(`isLocalExample is set to: ${isLocalExample}`) |
88 |
| - } |
| 82 | + console.log(`isLocalExample is set to: ${isLocalExample}`); |
| 83 | + console.log(`process.env.NODE_ENV: ${process.env.NODE_ENV}`); |
| 84 | + console.log( |
| 85 | + `Note: a report generated with the Python template will not have isLocalExample set to True, because that uses a separate template.html file, which has isLocalExample set to False.` |
| 86 | + ); |
| 87 | + // eslint-disable-next-line no-unused-vars,no-undef |
| 88 | + iam_data = sampleData.sample_iam_data; |
89 | 89 |
|
| 90 | + console.log( |
| 91 | + `IAM Data keys inside the development if statement: ${Object.keys( |
| 92 | + // eslint-disable-next-line no-undef |
| 93 | + iam_data |
| 94 | + )}` |
| 95 | + ); |
| 96 | + // eslint-disable-next-line no-unused-vars,no-undef |
| 97 | + account_id = "12345678912"; |
| 98 | + // eslint-disable-next-line no-unused-vars,no-undef |
| 99 | + account_name = "example"; |
| 100 | + // eslint-disable-next-line no-unused-vars,no-undef |
| 101 | + report_generated_time = "2020-09-01"; |
| 102 | + // eslint-disable-next-line no-unused-vars,no-undef |
| 103 | + cloudsplaining_version = "0.2.2"; |
| 104 | +} else { |
90 | 105 | // eslint-disable-next-line no-undef
|
91 |
| - console.log(`IAM Data keys outside of the NODE_ENV if statements: ${Object.keys(iam_data)}`); |
| 106 | + console.log(`isLocalExample is set to: ${isLocalExample}`); |
| 107 | +} |
92 | 108 |
|
93 |
| -
|
94 |
| - function getManagedPolicyNameMapping(managedBy) { |
| 109 | +console.log( |
| 110 | + `IAM Data keys outside of the NODE_ENV if statements: ${Object.keys( |
95 | 111 | // eslint-disable-next-line no-undef
|
96 |
| - return managedPoliciesUtil.getManagedPolicyNameMapping(iam_data, managedBy) |
97 |
| - } |
| 112 | + iam_data |
| 113 | + )}` |
| 114 | +); |
98 | 115 |
|
99 |
| - function getInlinePolicyNameMapping() { |
100 |
| - // eslint-disable-next-line no-undef |
101 |
| - return inlinePoliciesUtil.getInlinePolicyNameMapping(iam_data) |
102 |
| - } |
| 116 | +function getManagedPolicyNameMapping(managedBy) { |
| 117 | + // eslint-disable-next-line no-undef |
| 118 | + return managedPoliciesUtil.getManagedPolicyNameMapping(iam_data, managedBy); |
| 119 | +} |
103 | 120 |
|
104 |
| - function getTaskTableMapping(managedBy) { |
105 |
| - // eslint-disable-next-line no-undef |
106 |
| - return taskTableUtil.getTaskTableMapping(iam_data, managedBy) |
107 |
| - } |
| 121 | +function getInlinePolicyNameMapping() { |
| 122 | + // eslint-disable-next-line no-undef |
| 123 | + return inlinePoliciesUtil.getInlinePolicyNameMapping(iam_data); |
| 124 | +} |
108 | 125 |
|
| 126 | +function getTaskTableMapping(managedBy) { |
| 127 | + // eslint-disable-next-line no-undef |
| 128 | + return taskTableUtil.getTaskTableMapping(iam_data, managedBy); |
| 129 | +} |
109 | 130 |
|
110 |
| - export default { |
111 |
| - name: 'App', |
112 |
| - mounted: function() |
113 |
| - { |
114 |
| - // Workaround for handling anchors when vue-router is in hash mode |
115 |
| - // https://stackoverflow.com/a/45206192 |
116 |
| - setTimeout(() => this.scrollFix(this.$route.hash), 1); |
| 131 | +export default { |
| 132 | + name: "App", |
| 133 | + mounted: function () { |
| 134 | + // Workaround for handling anchors when vue-router is in hash mode |
| 135 | + // https://stackoverflow.com/a/45206192 |
| 136 | + setTimeout(() => this.scrollFix(this.$route.hash), 1); |
| 137 | + }, |
| 138 | + data() { |
| 139 | + return { |
| 140 | + // eslint-disable-next-line no-undef |
| 141 | + sharedState: iam_data, |
| 142 | + // eslint-disable-next-line no-undef |
| 143 | + account_id: account_id, |
| 144 | + // eslint-disable-next-line no-undef |
| 145 | + account_name: account_name, |
| 146 | + // eslint-disable-next-line no-undef |
| 147 | + report_generated_time: report_generated_time, |
| 148 | + // eslint-disable-next-line no-undef |
| 149 | + cloudsplaining_version: cloudsplaining_version, |
| 150 | + // eslint-disable-next-line no-undef |
| 151 | + show_guidance_nav: show_guidance_nav === "True", |
| 152 | + // eslint-disable-next-line no-undef |
| 153 | + show_appendices_nav: show_appendices_nav === "True", |
| 154 | + }; |
| 155 | + }, |
| 156 | + computed: { |
| 157 | + iam_data() { |
| 158 | + return this.sharedState; |
| 159 | + }, |
| 160 | + }, |
| 161 | + methods: { |
| 162 | + getManagedPolicyNameMapping: function (managedBy) { |
| 163 | + return getManagedPolicyNameMapping(managedBy); |
117 | 164 | },
|
118 |
| - data() { |
119 |
| - return { |
120 |
| - // eslint-disable-next-line no-undef |
121 |
| - sharedState: iam_data, |
122 |
| - // eslint-disable-next-line no-undef |
123 |
| - account_id: account_id, |
124 |
| - // eslint-disable-next-line no-undef |
125 |
| - account_name: account_name, |
126 |
| - // eslint-disable-next-line no-undef |
127 |
| - report_generated_time: report_generated_time, |
128 |
| - // eslint-disable-next-line no-undef |
129 |
| - cloudsplaining_version: cloudsplaining_version, |
130 |
| - }; |
| 165 | + getInlinePolicyNameMapping: function () { |
| 166 | + return getInlinePolicyNameMapping(); |
131 | 167 | },
|
132 |
| - computed: { |
133 |
| - iam_data() { |
134 |
| - return this.sharedState |
135 |
| - } |
| 168 | + getTaskTableMapping: function (managedBy) { |
| 169 | + return getTaskTableMapping(managedBy); |
136 | 170 | },
|
137 |
| - methods: { |
138 |
| - getManagedPolicyNameMapping: function (managedBy) { |
139 |
| - return getManagedPolicyNameMapping(managedBy) |
140 |
| - }, |
141 |
| - getInlinePolicyNameMapping: function () { |
142 |
| - return getInlinePolicyNameMapping() |
143 |
| - }, |
144 |
| - getTaskTableMapping: function (managedBy) { |
145 |
| - return getTaskTableMapping(managedBy) |
146 |
| - }, |
147 |
| - scrollFix: function(hashbang) |
148 |
| - { |
149 |
| - location.hash = hashbang; |
150 |
| - } |
| 171 | + scrollFix: function (hashbang) { |
| 172 | + location.hash = hashbang; |
151 | 173 | },
|
152 |
| - provide() { |
153 |
| - return { |
154 |
| - iam_data: this.iam_data, |
155 |
| - getManagedPolicyNameMapping: this.getManagedPolicyNameMapping, |
156 |
| - getInlinePolicyNameMapping: this.getInlinePolicyNameMapping, |
157 |
| - } |
158 |
| - } |
159 |
| - } |
| 174 | + }, |
| 175 | + provide() { |
| 176 | + return { |
| 177 | + iam_data: this.iam_data, |
| 178 | + getManagedPolicyNameMapping: this.getManagedPolicyNameMapping, |
| 179 | + getInlinePolicyNameMapping: this.getInlinePolicyNameMapping, |
| 180 | + }; |
| 181 | + }, |
| 182 | +}; |
160 | 183 | </script>
|
161 | 184 |
|
162 | 185 | <style>
|
163 |
| - #main { |
164 |
| - font-family: Avenir, Helvetica, Arial, sans-serif; |
165 |
| - -webkit-font-smoothing: antialiased; |
166 |
| - -moz-osx-font-smoothing: grayscale; |
167 |
| - text-align: left; |
168 |
| - color: #2c3e50; |
169 |
| - } |
| 186 | +#main { |
| 187 | + font-family: Avenir, Helvetica, Arial, sans-serif; |
| 188 | + -webkit-font-smoothing: antialiased; |
| 189 | + -moz-osx-font-smoothing: grayscale; |
| 190 | + text-align: left; |
| 191 | + color: #2c3e50; |
| 192 | +} |
170 | 193 |
|
171 |
| - .router-link-exact-active { |
172 |
| - font-weight: bold; |
173 |
| - } |
| 194 | +.router-link-exact-active { |
| 195 | + font-weight: bold; |
| 196 | +} |
174 | 197 | </style>
|
0 commit comments