|
6 | 6 | publicKey: { value: "", required: true }, |
7 | 7 | privateKey: { value: "", required: true }, |
8 | 8 | gcmApiKey: { value: "" }, |
| 9 | + timeout: { value: 0 }, |
9 | 10 | name: { value: "" } |
10 | 11 | }, |
11 | 12 | label: function () { |
12 | 13 | return this.name || this.subject; |
13 | 14 | }, |
14 | 15 | oneditprepare: function () { |
15 | 16 | var node = this; |
| 17 | + |
| 18 | + // Older nodes (version 0.0.3 and below) have no timeout option, so set it to 0 (= no custom timeout) |
| 19 | + if (this.timeout == undefined) { |
| 20 | + $('#node-config-input-timeout').val(0); |
| 21 | + } |
16 | 22 |
|
17 | 23 | $("#node-input-generateKeyPair").click(function () { |
18 | 24 | if ($("#node-config-input-publicKey").val() || $("#node-config-input-privateKey").val()) { |
|
61 | 67 | <label for="node-config-input-gcmApiKey"><i class="icon-tag"></i> GCM API Key (for older browsers)</label> |
62 | 68 | <input type="text" id="node-config-input-gcmApiKey" placeholder="The API key to send with the GCM request"> |
63 | 69 | </div> |
| 70 | + <div class="form-row"> |
| 71 | + <label for="node-config-input-timeout"><i class="icon-tag"></i> Timeout</label> |
| 72 | + <input type="number" id="node-config-input-timeout"> |
| 73 | + </div> |
64 | 74 | <div class="form-row"> |
65 | 75 | <label for="node-config-input-name"><i class="icon-tag"></i> Name</label> |
66 | 76 | <input type="text" id="node-config-input-name" placeholder="Name"> |
|
71 | 81 | <p>Configuration for VAPID. You can generate the key pair using the <i>"Generate VAPID keypair"</i> button or online here: <a href="https://web-push-codelab.glitch.me/" target="_blank">https://web-push-codelab.glitch.me</a>.</p> |
72 | 82 | <p>Read more about the VAPID specification here: <a href="https://tools.ietf.org/html/rfc8292" target="_blank">https://tools.ietf.org/html/rfc8292</a>.</p> |
73 | 83 | <p>For Chrome prior to version 52 and some old browsers, you're also still required to include a <code>gcm_sender_id</code> in your web app's manifest.json.</p> |
| 84 | + <p>Optionally a timeout can be specified (in milliseconds). A timeout value of 0 is considered as no timeout.</p> |
74 | 85 | </script> |
75 | 86 |
|
76 | 87 |
|
0 commit comments