End User License consent system added

This commit is contained in:
2022-02-12 00:50:51 +00:00
parent c699143013
commit a50d73bcdb
2 changed files with 320 additions and 180 deletions

View File

@@ -1,199 +1,214 @@
<template>
<div>
<v-row justify="center">
<v-dialog v-model="tfaDialog" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="text-h5">{{ authTwoFactor }}</span>
</v-card-title>
<v-card-text>
<v-text-field
v-model="pin"
:label="authEnterPin"
required
:error-messages="pinError"
autofocus
@keyup.enter="tfaVerify"
></v-text-field>
</v-card-text>
<v-card-actions>
<v-btn color="blue darken-1" text @click="cancelTfaVerify()">{{
cancel
}}</v-btn>
<v-spacer></v-spacer>
<v-btn
color="blue darken-1"
:disabled="pin == null || pin.length == 0"
text
@click="tfaVerify()"
>{{ authVerifyCode }}</v-btn
>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
<v-row align="center" justify="center" class="mx-auto mt-sm-12 mb-16">
<v-col cols="12" offset-md="4">
<form>
<v-row>
<!-- Customer logo -->
<v-col v-if="showCustomSmallLogo()" cols="12">
<div class="text-center">
<img :src="mediumLogoUrl" />
</div>
</v-col>
<v-col v-if="showCustomMediumLogo()" cols="7">
<div class="text-center">
<img :src="largeLogoUrl" />
</div>
</v-col>
<v-col v-if="showCustomLargeLogo()" cols="7">
<div class="text-center">
<img :src="largeLogoUrl" />
</div>
</v-col>
<!-- Small AyaNova logo -->
<v-col v-if="showSmallBrandLogo()" cols="12">
<v-img
:src="require('../assets/logo.svg')"
contain
height="64"
></v-img>
</v-col>
<!-- Large AyaNova logo. -->
<v-col v-if="showLargeBrandLogo()" cols="7" class="ml-16">
<v-img
:src="require('../assets/logo.svg')"
contain
height="128"
></v-img>
</v-col>
<v-col v-if="formState.errorBoxMessage" cols="12" md="7">
<gz-error
:error-box-message="formState.errorBoxMessage"
></gz-error>
</v-col>
<v-col v-if="showEvalUsers == true" cols="12" md="7">
<v-select
v-model="selectedTrialUserId"
:items="selectLists.trialUsers"
item-text="name"
item-value="l"
label="Trial mode example users"
prepend-icon="$ayiQuestionCircle"
return-object
data-cy="selecttrialuser"
@click:prepend="trialHelpClick"
@input="trialUserSelected"
>
</v-select>
</v-col>
<v-col cols="12" md="7">
<div v-if="!lcr">
<v-row justify="center">
<v-dialog v-model="tfaDialog" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="text-h5">{{ authTwoFactor }}</span>
</v-card-title>
<v-card-text>
<v-text-field
id="username"
v-model="input.username"
v-focus
name="username"
prepend-icon="$ayiUser"
v-model="pin"
:label="authEnterPin"
required
:error-messages="pinError"
autofocus
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
:error="errorBadCreds"
@keyup.enter="onEnterUserName"
@keyup.enter="tfaVerify"
></v-text-field>
</v-col>
<v-col cols="12" md="7">
<v-text-field
id="password"
v-model="input.password"
name="password"
:append-outer-icon="reveal ? '$ayiEye' : '$ayiEyeSlash'"
prepend-icon="$ayiKey"
:type="reveal ? 'text' : 'password'"
:error="errorBadCreds"
@keyup.enter="login"
@click:append-outer="reveal = !reveal"
></v-text-field>
</v-col>
<v-col cols="12" md="7" mt-1 mb-5>
</v-card-text>
<v-card-actions>
<v-btn color="blue darken-1" text @click="cancelTfaVerify()">{{
cancel
}}</v-btn>
<v-spacer></v-spacer>
<v-btn
color="primary"
value="LOGIN"
:data-cy="`loginbutton${errorBadCreds ? '_failedcreds' : ''}`"
@click="login()"
color="blue darken-1"
:disabled="pin == null || pin.length == 0"
text
@click="tfaVerify()"
>{{ authVerifyCode }}</v-btn
>
<v-icon>$ayiSignIn</v-icon>
</v-btn>
</v-col>
<template v-if="$ay.dev">
<v-col cols="12">
<span class="subtitle-2 secondary--text">DEVELOPMENT MODE</span>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
<v-row align="center" justify="center" class="mx-auto mt-sm-12 mb-16">
<v-col cols="12" offset-md="4">
<form>
<v-row>
<!-- Customer logo -->
<v-col v-if="showCustomSmallLogo()" cols="12">
<div class="text-center">
<img :src="mediumLogoUrl" />
</div>
</v-col>
</template>
</v-row>
</form>
</v-col>
</v-row>
<v-footer color="primary" padless absolute>
<div
v-if="showFooterLogo()"
style="text-align: center;"
class="mx-auto pa-4 mb-10 mb-sm-1 mt-n8"
>
<a
href="https://ayanova.com"
target="_blank"
style="text-decoration:none"
class="primary white--text text-caption"
<v-col v-if="showCustomMediumLogo()" cols="7">
<div class="text-center">
<img :src="largeLogoUrl" />
</div>
</v-col>
<v-col v-if="showCustomLargeLogo()" cols="7">
<div class="text-center">
<img :src="largeLogoUrl" />
</div>
</v-col>
<!-- Small AyaNova logo -->
<v-col v-if="showSmallBrandLogo()" cols="12">
<v-img
:src="require('../assets/logo.svg')"
contain
height="64"
></v-img>
</v-col>
<!-- Large AyaNova logo. -->
<v-col v-if="showLargeBrandLogo()" cols="7" class="ml-16">
<v-img
:src="require('../assets/logo.svg')"
contain
height="128"
></v-img>
</v-col>
<v-col v-if="formState.errorBoxMessage" cols="12" md="7">
<gz-error
:error-box-message="formState.errorBoxMessage"
></gz-error>
</v-col>
<v-col v-if="showEvalUsers == true" cols="12" md="7">
<v-select
v-model="selectedTrialUserId"
:items="selectLists.trialUsers"
item-text="name"
item-value="l"
label="Trial mode example users"
prepend-icon="$ayiQuestionCircle"
return-object
data-cy="selecttrialuser"
@click:prepend="trialHelpClick"
@input="trialUserSelected"
>
</v-select>
</v-col>
<v-col cols="12" md="7">
<v-text-field
id="username"
v-model="input.username"
v-focus
name="username"
prepend-icon="$ayiUser"
autofocus
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
:error="errorBadCreds"
@keyup.enter="onEnterUserName"
></v-text-field>
</v-col>
<v-col cols="12" md="7">
<v-text-field
id="password"
v-model="input.password"
name="password"
:append-outer-icon="reveal ? '$ayiEye' : '$ayiEyeSlash'"
prepend-icon="$ayiKey"
:type="reveal ? 'text' : 'password'"
:error="errorBadCreds"
@keyup.enter="login"
@click:append-outer="reveal = !reveal"
></v-text-field>
</v-col>
<v-col cols="12" md="7" mt-1 mb-5>
<v-btn
color="primary"
value="LOGIN"
:data-cy="`loginbutton${errorBadCreds ? '_failedcreds' : ''}`"
@click="login()"
>
<v-icon>$ayiSignIn</v-icon>
</v-btn>
</v-col>
<template v-if="$ay.dev">
<v-col cols="12">
<span class="subtitle-2 secondary--text"
>DEVELOPMENT MODE</span
>
</v-col>
</template>
</v-row>
</form>
</v-col>
</v-row>
<v-footer color="primary" padless absolute>
<div
v-if="showFooterLogo()"
style="text-align: center;"
class="mx-auto pa-4 mb-10 mb-sm-1 mt-n8"
>
<div v-if="showFooterLogo()" style="width: 100%;" class="mx-auto">
<v-img
style="margin: 0 auto;"
:src="require('../assets/logo.svg')"
width="48px"
height="48px"
max-height="48px"
max-width="48px"
contain
></v-img>
</div>
<div class="mx-auto">AyaNova {{ version }}</div>
<div class="mx-auto">
<span class="primary white--text text-caption">{{
copyright
}}</span>
</div>
</a>
</div>
<div v-else style="text-align: center;" class="mx-auto pa-4 mb-1 mb-sm-1">
<a
href="https://ayanova.com"
target="_blank"
style="text-decoration:none"
class="primary white--text text-caption"
<a
href="https://ayanova.com"
target="_blank"
style="text-decoration:none"
class="primary white--text text-caption"
>
<div v-if="showFooterLogo()" style="width: 100%;" class="mx-auto">
<v-img
style="margin: 0 auto;"
:src="require('../assets/logo.svg')"
width="48px"
height="48px"
max-height="48px"
max-width="48px"
contain
></v-img>
</div>
<div class="mx-auto">AyaNova {{ version }}</div>
<div class="mx-auto">
<span class="primary white--text text-caption">{{
copyright
}}</span>
</div>
</a>
</div>
<div
v-else
style="text-align: center;"
class="mx-auto pa-4 mb-1 mb-sm-1"
>
<div class="mx-auto">AyaNova {{ version }}</div>
<div class="mx-auto">
<span class="primary white--text text-caption">{{
copyright
}}</span>
</div>
</a>
</div>
</v-footer>
<a
href="https://ayanova.com"
target="_blank"
style="text-decoration:none"
class="primary white--text text-caption"
>
<div class="mx-auto">AyaNova {{ version }}</div>
<div class="mx-auto">
<span class="primary white--text text-caption">{{
copyright
}}</span>
</div>
</a>
</div>
</v-footer>
</div>
<div v-else>
<LICR :lcr="lcr" @accepted="lcr = false"></LICR>
</div>
</div>
</template>
<script>
import { processLogin, processLogout } from "../api/authutil";
import ayaNovaVersion from "../api/ayanova-version";
import LICR from "../components/lcr-control.vue";
export default {
components: {
LICR
},
data() {
return {
input: {
@@ -208,6 +223,7 @@ export default {
cancel: null,
pin: null,
tt: null,
lcr: false,
pinError: null,
loggedInWithKnownPassword: false,
hasSmallLogo: false,
@@ -368,6 +384,7 @@ export default {
vm.hasSmallLogo = res.data.sl;
vm.hasMediumLogo = res.data.ml;
vm.hasLargeLogo = res.data.ll;
vm.lcr = res.data.lcr; //license consent required flage
}
} catch (error) {
//squash it, this isn't critical