|
@ -324,19 +324,55 @@ |
|
|
</button> |
|
|
</button> |
|
|
<button |
|
|
<button |
|
|
class="px-4 rounded bg-slate-200 border border-slate-400" |
|
|
class="px-4 rounded bg-slate-200 border border-slate-400" |
|
|
@click="setApiServerInput(Constants.PROD_ENDORSER_API_SERVER)" |
|
|
@click="apiServerInput = AppConstants.PROD_ENDORSER_API_SERVER" |
|
|
> |
|
|
> |
|
|
Use Prod |
|
|
Use Prod |
|
|
</button> |
|
|
</button> |
|
|
<button |
|
|
<button |
|
|
class="px-4 rounded bg-slate-200 border border-slate-400" |
|
|
class="px-4 rounded bg-slate-200 border border-slate-400" |
|
|
@click="setApiServerInput(Constants.TEST_ENDORSER_API_SERVER)" |
|
|
@click="apiServerInput = AppConstants.TEST_ENDORSER_API_SERVER" |
|
|
> |
|
|
> |
|
|
Use Test |
|
|
Use Test |
|
|
</button> |
|
|
</button> |
|
|
<button |
|
|
<button |
|
|
class="px-4 rounded bg-slate-200 border border-slate-400" |
|
|
class="px-4 rounded bg-slate-200 border border-slate-400" |
|
|
@click="setApiServerInput(Constants.LOCAL_ENDORSER_API_SERVER)" |
|
|
@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="pushServerInput" |
|
|
|
|
|
/> |
|
|
|
|
|
<button |
|
|
|
|
|
v-if="pushServerInput != pushServer" |
|
|
|
|
|
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-4 rounded bg-slate-200 border border-slate-400" |
|
|
|
|
|
@click="pushServerInput = AppConstants.PROD_PUSH_SERVER" |
|
|
|
|
|
> |
|
|
|
|
|
Use Prod |
|
|
|
|
|
</button> |
|
|
|
|
|
<button |
|
|
|
|
|
class="px-4 rounded bg-slate-200 border border-slate-400" |
|
|
|
|
|
@click="pushServerInput = AppConstants.TEST_PUSH_SERVER" |
|
|
|
|
|
> |
|
|
|
|
|
Use Test |
|
|
|
|
|
</button> |
|
|
|
|
|
<button |
|
|
|
|
|
class="px-4 rounded bg-slate-200 border border-slate-400" |
|
|
|
|
|
@click="pushServerInput = AppConstants.LOCAL_PUSH_SERVER" |
|
|
> |
|
|
> |
|
|
Use Local |
|
|
Use Local |
|
|
</button> |
|
|
</button> |
|
@ -346,7 +382,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
<script lang="ts"> |
|
|
import { AxiosError } from "axios"; |
|
|
import { AxiosError, AxiosRequestConfig } from "axios"; |
|
|
import "dexie-export-import"; |
|
|
import "dexie-export-import"; |
|
|
import { Component, Vue } from "vue-facing-decorator"; |
|
|
import { Component, Vue } from "vue-facing-decorator"; |
|
|
import { useClipboard } from "@vueuse/core"; |
|
|
import { useClipboard } from "@vueuse/core"; |
|
@ -380,7 +416,7 @@ interface IAccount { |
|
|
export default class AccountViewView extends Vue { |
|
|
export default class AccountViewView extends Vue { |
|
|
$notify!: (notification: Notification, timeout?: number) => void; |
|
|
$notify!: (notification: Notification, timeout?: number) => void; |
|
|
|
|
|
|
|
|
Constants = AppString; |
|
|
AppConstants = AppString; |
|
|
|
|
|
|
|
|
activeDid = ""; |
|
|
activeDid = ""; |
|
|
apiServer = ""; |
|
|
apiServer = ""; |
|
@ -391,6 +427,8 @@ export default class AccountViewView extends Vue { |
|
|
numAccounts = 0; |
|
|
numAccounts = 0; |
|
|
publicHex = ""; |
|
|
publicHex = ""; |
|
|
publicBase64 = ""; |
|
|
publicBase64 = ""; |
|
|
|
|
|
pushServer = ""; |
|
|
|
|
|
pushServerInput = ""; |
|
|
limits: RateLimits | null = null; |
|
|
limits: RateLimits | null = null; |
|
|
limitsMessage = ""; |
|
|
limitsMessage = ""; |
|
|
loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message |
|
|
loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message |
|
@ -515,6 +553,8 @@ export default class AccountViewView extends Vue { |
|
|
(settings?.firstName || "") + |
|
|
(settings?.firstName || "") + |
|
|
(settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3 |
|
|
(settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3 |
|
|
this.isRegistered = !!settings?.isRegistered; |
|
|
this.isRegistered = !!settings?.isRegistered; |
|
|
|
|
|
this.pushServer = (settings?.pushServer as string) || ""; |
|
|
|
|
|
this.pushServerInput = (settings?.pushServer as string) || ""; |
|
|
this.showContactGives = !!settings?.showContactGivesInline; |
|
|
this.showContactGives = !!settings?.showContactGivesInline; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -739,7 +779,7 @@ export default class AccountViewView extends Vue { |
|
|
private async fetchRateLimits(identity: IIdentifier) { |
|
|
private async fetchRateLimits(identity: IIdentifier) { |
|
|
const url = `${this.apiServer}/api/report/rateLimits`; |
|
|
const url = `${this.apiServer}/api/report/rateLimits`; |
|
|
const headers = await this.getHeaders(identity); |
|
|
const headers = await this.getHeaders(identity); |
|
|
return await this.axios.get(url, { headers }); |
|
|
return await this.axios.get(url, { headers } as AxiosRequestConfig); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -843,8 +883,12 @@ export default class AccountViewView extends Vue { |
|
|
this.apiServer = this.apiServerInput; |
|
|
this.apiServer = this.apiServerInput; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
setApiServerInput(value: string) { |
|
|
async onClickSavePushServer() { |
|
|
this.apiServerInput = value; |
|
|
await db.open(); |
|
|
|
|
|
db.settings.update(MASTER_SETTINGS_KEY, { |
|
|
|
|
|
pushServer: this.pushServerInput, |
|
|
|
|
|
}); |
|
|
|
|
|
this.pushServer = this.pushServerInput; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|