|  | @ -55,6 +55,9 @@ | 
			
		
	
		
		
			
				
					|  |  |                                     {{ $t("needPushEvery", [monitor.interval]) }}<br /> |  |  |                                     {{ $t("needPushEvery", [monitor.interval]) }}<br /> | 
			
		
	
		
		
			
				
					|  |  |                                     {{ $t("pushOptionalParams", ["msg, ping"]) }} |  |  |                                     {{ $t("pushOptionalParams", ["msg, ping"]) }} | 
			
		
	
		
		
			
				
					|  |  |                                 </div> |  |  |                                 </div> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                                 <button class="btn btn-primary" type="button" @click="resetToken"> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                                     {{ $t("Reset Token") }} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                                 </button> | 
			
		
	
		
		
			
				
					|  |  |                             </div> |  |  |                             </div> | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |                             <!-- Keyword --> |  |  |                             <!-- Keyword --> | 
			
		
	
	
		
		
			
				
					|  | @ -287,6 +290,8 @@ import { genSecret, isDev } from "../util.ts"; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | const toast = useToast(); |  |  | const toast = useToast(); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | const pushTokenLength = 32; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | export default { |  |  | export default { | 
			
		
	
		
		
			
				
					|  |  |     components: { |  |  |     components: { | 
			
		
	
		
		
			
				
					|  |  |         CopyableInput, |  |  |         CopyableInput, | 
			
		
	
	
		
		
			
				
					|  | @ -370,7 +375,9 @@ export default { | 
			
		
	
		
		
			
				
					|  |  |         "monitor.type"() { |  |  |         "monitor.type"() { | 
			
		
	
		
		
			
				
					|  |  |             if (this.monitor.type === "push") { |  |  |             if (this.monitor.type === "push") { | 
			
		
	
		
		
			
				
					|  |  |                 if (! this.monitor.pushToken) { |  |  |                 if (! this.monitor.pushToken) { | 
			
		
	
		
		
			
				
					
					|  |  |                     this.monitor.pushToken = genSecret(10); |  |  |                     // ideally this would require checking if the generated token is already used | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |                     // it's very unlikely to get a collision though (62^32 ~ 2.27265788 * 10^57 unique tokens) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                     this.monitor.pushToken = genSecret(pushTokenLength); | 
			
		
	
		
		
			
				
					|  |  |                 } |  |  |                 } | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
	
		
		
			
				
					|  | @ -470,6 +477,10 @@ export default { | 
			
		
	
		
		
			
				
					|  |  |             return true; |  |  |             return true; | 
			
		
	
		
		
			
				
					|  |  |         }, |  |  |         }, | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         resetToken() { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             this.monitor.pushToken = genSecret(pushTokenLength); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         }, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |         async submit() { |  |  |         async submit() { | 
			
		
	
		
		
			
				
					|  |  |             this.processing = true; |  |  |             this.processing = true; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | 
 |