Browse Source

fix default server display in advanced section & refactor UI

starred-projects
Trent Larson 8 months ago
parent
commit
2db52cb72e
  1. 193
      src/views/AccountViewView.vue

193
src/views/AccountViewView.vue

@ -231,9 +231,9 @@
</p> </p>
<!-- Deep Identity Details --> <!-- Deep Identity Details -->
<h2 class="text-sm uppercase font-semibold mb-3"> <span class="text-slate-500 text-sm font-bold mb-2">
Deep Identifier Details Deep Identifier Details
</h2> </span>
<div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4"> <div class="bg-slate-100 rounded-md overflow-hidden px-4 py-3 mb-4">
<div class="text-slate-500 text-sm font-bold">Public Key (base 64)</div> <div class="text-slate-500 text-sm font-bold">Public Key (base 64)</div>
<div <div
@ -287,13 +287,23 @@
</div> </div>
</div> </div>
<!-- id used by puppeteer test script -->
<router-link
id="switch-identity-link"
:to="{ name: 'identity-switcher' }"
class="block w-fit text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2"
>
Switch Identifier
</router-link>
<label <label
for="toggleShowAmounts" for="toggleShowAmounts"
class="flex items-center justify-between cursor-pointer my-4" class="flex items-center justify-between cursor-pointer my-4"
@click="handleChange" @click="handleChange"
> >
<!-- label --> <!-- label -->
<h2>Show amounts given with contacts</h2> <span class="text-slate-500 text-sm font-bold">Contacts</span>
<span class="ml-2">Show amounts given</span>
<!-- toggle --> <!-- toggle -->
<div class="relative ml-2"> <div class="relative ml-2">
<!-- input --> <!-- input -->
@ -313,7 +323,7 @@
</label> </label>
<div class="grid-cols-2 mb-4"> <div class="grid-cols-2 mb-4">
<span class="text-slate-500 text-sm font-bold mb-2">Data Import</span> <span class="text-slate-500 text-sm font-bold">Import</span>
<input type="file" @change="uploadFile" class="ml-2" /> <input type="file" @change="uploadFile" class="ml-2" />
<div v-if="showContactImport()"> <div v-if="showContactImport()">
<button <button
@ -327,100 +337,83 @@
</div> </div>
</div> </div>
<div class="flex py-2"> <div>
<button> <h2 class="text-slate-500 text-sm font-bold mt-4">Claim Server</h2>
<router-link <div class="flex px-4 py-4">
:to="{ name: 'statistics' }" Server
class="block w-fit text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2" <input
type="text"
class="block w-full rounded border border-slate-400 px-3 py-2"
v-model="apiServerInput"
/>
<button
v-if="apiServerInput != apiServer"
class="px-4 rounded bg-red-500 border border-slate-400"
@click="onClickSaveApiServer()"
> >
See Global Animated History of Giving <fa icon="floppy-disk" class="fa-fw" color="white"></fa>
</router-link> </button>
</button> <button
</div> class="px-3 rounded bg-slate-200 border border-slate-400"
@click="apiServerInput = AppConstants.PROD_ENDORSER_API_SERVER"
<!-- id used by puppeteer test script --> >
<router-link Use Prod
id="switch-identity-link" </button>
:to="{ name: 'identity-switcher' }" <button
class="block w-fit text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2" class="px-3 rounded bg-slate-200 border border-slate-400"
> @click="apiServerInput = AppConstants.TEST_ENDORSER_API_SERVER"
Switch Identifier >
</router-link> Use Test
</button>
<button
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"> <label
<h2 class="text-slate-500 text-sm font-bold mb-2">Claim Server</h2> for="toggleProdWarningMessage"
<input class="flex items-center justify-between cursor-pointer px-4 py-4"
type="text" @click="toggleProdWarning"
class="block w-full rounded border border-slate-400 px-3 py-2"
v-model="apiServerInput"
/>
<button
v-if="apiServerInput != apiServer"
class="px-4 rounded bg-red-500 border border-slate-400"
@click="onClickSaveApiServer()"
>
<fa icon="floppy-disk" class="fa-fw" color="white"></fa>
</button>
<button
class="px-3 rounded bg-slate-200 border border-slate-400"
@click="apiServerInput = AppConstants.PROD_ENDORSER_API_SERVER"
>
Use Prod
</button>
<button
class="px-3 rounded bg-slate-200 border border-slate-400"
@click="apiServerInput = AppConstants.TEST_ENDORSER_API_SERVER"
> >
Use Test <!-- label -->
</button> <h2>Show warning if on prod server</h2>
<button <!-- toggle -->
class="px-3 rounded bg-slate-200 border border-slate-400" <div class="relative ml-2">
@click="apiServerInput = AppConstants.LOCAL_ENDORSER_API_SERVER" <!-- input -->
<input type="checkbox" v-model="warnIfProdServer" class="sr-only" />
<!-- line -->
<div class="block bg-slate-500 w-14 h-8 rounded-full"></div>
<!-- dot -->
<div
class="dot absolute left-1 top-1 bg-slate-400 w-6 h-6 rounded-full transition"
></div>
</div>
</label>
<label
for="toggleTestWarningMessage"
class="flex items-center justify-between cursor-pointer px-4 py-4"
@click="toggleTestWarning"
> >
Use Local <!-- label -->
</button> <h2>Show warning if on non-prod server</h2>
<!-- toggle -->
<div class="relative ml-2">
<!-- input -->
<input type="checkbox" v-model="warnIfTestServer" class="sr-only" />
<!-- line -->
<div class="block bg-slate-500 w-14 h-8 rounded-full"></div>
<!-- dot -->
<div
class="dot absolute left-1 top-1 bg-slate-400 w-6 h-6 rounded-full transition"
></div>
</div>
</label>
</div> </div>
<label
for="toggleProdWarningMessage"
class="flex items-center justify-between cursor-pointer my-4"
@click="toggleProdWarning"
>
<!-- label -->
<h2>Show warning if on prod server</h2>
<!-- toggle -->
<div class="relative ml-2">
<!-- input -->
<input type="checkbox" v-model="warnIfProdServer" class="sr-only" />
<!-- line -->
<div class="block bg-slate-500 w-14 h-8 rounded-full"></div>
<!-- dot -->
<div
class="dot absolute left-1 top-1 bg-slate-400 w-6 h-6 rounded-full transition"
></div>
</div>
</label>
<label
for="toggleTestWarningMessage"
class="flex items-center justify-between cursor-pointer my-4"
@click="toggleTestWarning"
>
<!-- label -->
<h2>Show warning if on non-prod server</h2>
<!-- toggle -->
<div class="relative ml-2">
<!-- input -->
<input type="checkbox" v-model="warnIfTestServer" class="sr-only" />
<!-- line -->
<div class="block bg-slate-500 w-14 h-8 rounded-full"></div>
<!-- dot -->
<div
class="dot absolute left-1 top-1 bg-slate-400 w-6 h-6 rounded-full transition"
></div>
</div>
</label>
<div class="flex py-4"> <div class="flex py-4">
<h2 class="text-slate-500 text-sm font-bold mb-2"> <h2 class="text-slate-500 text-sm font-bold mb-2">
Notification Push Server Notification Push Server
@ -459,8 +452,19 @@
<span class="px-4 text-sm" v-if="!webPushServerInput"> <span class="px-4 text-sm" v-if="!webPushServerInput">
When that setting is blank, this app will use the default web push When that setting is blank, this app will use the default web push
server URL: server URL:
{{ AppConstants.DEFAULT_PUSH_SERVER }} {{ DEFAULT_PUSH_SERVER }}
</span> </span>
<div class="flex mt-4">
<button>
<router-link
:to="{ name: 'statistics' }"
class="block w-fit text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mb-2"
>
See Global Animated History of Giving
</router-link>
</button>
</div>
</div> </div>
</section> </section>
</template> </template>
@ -476,7 +480,7 @@ import { useClipboard } from "@vueuse/core";
import QuickNav from "@/components/QuickNav.vue"; import QuickNav from "@/components/QuickNav.vue";
import TopMessage from "@/components/TopMessage.vue"; import TopMessage from "@/components/TopMessage.vue";
import { AppString } from "@/constants/app"; import { AppString, DEFAULT_PUSH_SERVER } from "@/constants/app";
import { db, accountsDB } from "@/db/index"; import { db, accountsDB } from "@/db/index";
import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings"; import { MASTER_SETTINGS_KEY, Settings } from "@/db/tables/settings";
import { accessToken } from "@/libs/crypto"; import { accessToken } from "@/libs/crypto";
@ -507,6 +511,7 @@ export default class AccountViewView extends Vue {
$notify!: (notification: Notification, timeout?: number) => void; $notify!: (notification: Notification, timeout?: number) => void;
AppConstants = AppString; AppConstants = AppString;
DEFAULT_PUSH_SERVER = DEFAULT_PUSH_SERVER;
activeDid = ""; activeDid = "";
apiServer = ""; apiServer = "";

Loading…
Cancel
Save