| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -324,30 +324,71 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          <fa icon="floppy-disk" class="fa-fw" color="white"></fa> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </button> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        <button | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-4 rounded bg-slate-200 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="setApiServerInput(Constants.PROD_ENDORSER_API_SERVER)" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-3 rounded bg-slate-200 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="apiServerInput = AppConstants.PROD_ENDORSER_API_SERVER" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        > | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          Use Prod | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </button> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        <button | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-4 rounded bg-slate-200 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="setApiServerInput(Constants.TEST_ENDORSER_API_SERVER)" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-3 rounded bg-slate-200 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="apiServerInput = AppConstants.TEST_ENDORSER_API_SERVER" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        > | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          Use Test | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </button> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        <button | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-4 rounded bg-slate-200 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="setApiServerInput(Constants.LOCAL_ENDORSER_API_SERVER)" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-3 rounded bg-slate-200 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="apiServerInput = AppConstants.LOCAL_ENDORSER_API_SERVER" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        > | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          Use Local | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </button> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      </div> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      <div class="flex py-4"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        <h2 class="text-slate-500 text-sm font-bold mb-2"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          Notification Push Server | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </h2> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        <input | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          type="text" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="block w-full rounded border border-slate-400 px-3 py-2" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          v-model="webPushServerInput" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        /> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        <button | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          v-if="webPushServerInput != webPushServer" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-4 rounded bg-red-500 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="onClickSavePushServer()" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        > | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          <fa icon="floppy-disk" class="fa-fw" color="white"></fa> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </button> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        <button | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-3 rounded bg-slate-200 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="webPushServerInput = AppConstants.PROD_PUSH_SERVER" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        > | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          Use Prod | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </button> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        <button | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-3 rounded bg-slate-200 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="webPushServerInput = AppConstants.TEST1_PUSH_SERVER" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        > | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          Use Test 1 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </button> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        <button | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          class="px-3 rounded bg-slate-200 border border-slate-400" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          @click="webPushServerInput = AppConstants.TEST2_PUSH_SERVER" | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        > | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          Use Test 2 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </button> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      </div> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      <span class="px-4 text-sm" v-if="!webPushServerInput"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        When that setting is blank, this app will use the default web push | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        server URL: | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        {{ AppConstants.DEFAULT_PUSH_SERVER }} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      </span> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    </div> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  </section> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					</template> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					<script lang="ts"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { AxiosError } from "axios"; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { AxiosError, AxiosRequestConfig } from "axios"; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import "dexie-export-import"; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { Component, Vue } from "vue-facing-decorator"; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { useClipboard } from "@vueuse/core"; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -381,7 +422,7 @@ interface IAccount { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					export default class AccountViewView extends Vue { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  $notify!: (notification: Notification, timeout?: number) => void; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  Constants = AppString; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  AppConstants = AppString; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  activeDid = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  apiServer = ""; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -392,6 +433,8 @@ export default class AccountViewView extends Vue { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  numAccounts = 0; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  publicHex = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  publicBase64 = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  webPushServer = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  webPushServerInput = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  limits: RateLimits | null = null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  limitsMessage = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -516,6 +559,8 @@ export default class AccountViewView extends Vue { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      (settings?.firstName || "") + | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      (settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    this.isRegistered = !!settings?.isRegistered; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    this.webPushServer = (settings?.webPushServer as string) || ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    this.webPushServerInput = (settings?.webPushServer as string) || ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    this.showContactGives = !!settings?.showContactGivesInline; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -740,7 +785,7 @@ export default class AccountViewView extends Vue { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  private async fetchRateLimits(identity: IIdentifier) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    const url = `${this.apiServer}/api/report/rateLimits`; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    const headers = await this.getHeaders(identity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    return await this.axios.get(url, { headers }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    return await this.axios.get(url, { headers } as AxiosRequestConfig); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  /** | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -844,8 +889,12 @@ export default class AccountViewView extends Vue { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    this.apiServer = this.apiServerInput; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  setApiServerInput(value: string) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    this.apiServerInput = value; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  async onClickSavePushServer() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    await db.open(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    db.settings.update(MASTER_SETTINGS_KEY, { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      webPushServer: this.webPushServerInput, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    this.webPushServer = this.webPushServerInput; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					</script> | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					
  |