|
115 | 115 | }
|
116 | 116 | }
|
117 | 117 |
|
118 |
| - Dashboard.Poller = function(kinesis, map, console) { |
119 |
| - const streamName = 'wildrydes'; |
| 118 | + Dashboard.Poller = function(kinesis, streamName, map, console) { |
120 | 119 | const shardIteratorType = 'LATEST';
|
121 | 120 | const pollFrequency = 1000;
|
122 | 121 |
|
|
189 | 188 | $(window).on('load', function() {
|
190 | 189 | const map = Dashboard.Map(L).init('map').render();
|
191 | 190 |
|
192 |
| - if (Cookies.get('cognitoIdentityPoolId') !== undefined) { |
| 191 | + if (Cookies.get('cognitoIdentityPoolId') !== undefined || Cookies.get('kinesisStreamName') !== undefined) { |
193 | 192 | $('#cognitoIdentityPoolId').val(Cookies.get('cognitoIdentityPoolId'));
|
| 193 | + $('#kinesisStreamName').val(Cookies.get('kinesisStreamName')); |
194 | 194 | $('#modal').on('shown.bs.modal', () => $('button').focus());
|
195 | 195 | }
|
196 | 196 |
|
197 | 197 | $('form').on('submit', function(e) {
|
198 | 198 | e.preventDefault();
|
199 | 199 |
|
200 | 200 | const cognitoIdentityPoolId = $('#cognitoIdentityPoolId').val();
|
201 |
| - const region = cognitoIdentityPoolId.substring(0, cognitoIdentityPoolId.indexOf(":")) |
| 201 | + const kinesisStreamName = $('$kinesisStreamName').val(); |
| 202 | + const region = cognitoIdentityPoolId.substring(0, cognitoIdentityPoolId.indexOf(":")); |
202 | 203 |
|
203 | 204 | AWS.config.region = region;
|
204 | 205 | AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
|
209 | 210 |
|
210 | 211 | kinesis.listStreams().promise()
|
211 | 212 | .then(() => Cookies.set("cognitoIdentityPoolId", cognitoIdentityPoolId))
|
212 |
| - .then(() => Dashboard.Poller(kinesis, map, console).poll()) |
| 213 | + .then(() => Dashboard.Poller(kinesis, kinesisStreamName, map, console).poll()) |
213 | 214 | .then(() => $('#modal').modal('hide'))
|
214 | 215 | .catch((err) => $('#modal .notice').text(err).show());
|
215 | 216 | });
|
|
0 commit comments