Skip to content

Commit 8e9d796

Browse files
authored
Merge pull request #47 from hypersign-protocol/pageSepration
Page sepration
2 parents dbd4f45 + 2a5d755 commit 8e9d796

File tree

7 files changed

+648
-48
lines changed

7 files changed

+648
-48
lines changed

src/App.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,11 @@ export default {
560560
title: "Credential",
561561
icon: "fa fa-certificate",
562562
})
563-
563+
menu.push({
564+
href: "/studio/ssi/usage/" + this.getSelectedService.appId,
565+
title: "Usages",
566+
icon: "fa fa-chart-bar",
567+
})
564568
565569
menu.push({
566570
href: "/studio/ssi/credit/" + this.getSelectedService.appId,

src/router.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const Credential = () => import('./views/playground/Sessions.vue')
1212
const CredentialDetails = () => import('./views/playground/SessionsDetails.vue')
1313
const DIDs = () => import('./views/playground/DID.vue')
1414
const SSIDashboardCredit = () => import('./views/playground/SSIDashboardCredit.vue')
15+
const SSIDashboardUsage = () => import('./views/playground/SSIDashboardUsages.vue')
1516
const KYCCreditDashboard = () => import('./views/playground/KYCDashboardCredit.vue')
1617
const UsageS = () => import('./views/playground/Usage.vue')
1718
const OnChainKycSystems = () => import('./views/playground/OnChainKycSystems.vue')
@@ -125,6 +126,15 @@ const router = new Router({
125126
title: `${config.app.name} - SSI Credit`
126127
}
127128
},
129+
{
130+
path: '/studio/ssi/usage/:appId',
131+
name: 'Usage',
132+
component: SSIDashboardUsage,
133+
meta: {
134+
requiresAuth: true,
135+
title: `${config.app.name} - Usages`
136+
}
137+
},
128138
{
129139
path: '/studio/onchainkyc/credit/:appId',
130140
name: 'KYCCredit',

src/views/playground/CredentialStatus.vue

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ h5 span {
193193
@input="OnSchemaSelectDropDownChange(selectedSchema)"
194194
@change="OnSchemaSelectDropDownChange(selectedSchema)" />
195195
<datalist id="schema">
196-
<option v-for="browser in selectOptions" :key="browser.selected" :value="browser.value"
196+
<option v-for="schema in schemaIdsList" :key="schema.value"
197+
:value="schema.value"
197198
class="form-control">
198-
{{ browser.text }}
199+
{{ schema.text }}
199200
</option>
200201
</datalist>
201202
<!-- <span
@@ -532,6 +533,7 @@ export default {
532533
schemaConfigVisible: false,
533534
issuerConfigVisible: false,
534535
credentialDocumentToView: "",
536+
schemaIdsList:[],
535537
booleanOption: [
536538
{ text: true, value: true },
537539
{ text: false, value: false },
@@ -610,6 +612,26 @@ export default {
610612
errorMessage:"",
611613
selectedCredential:""
612614
};
615+
},
616+
async mounted() {
617+
try {
618+
const schemaIds=this.schemaList.map(schema=>{
619+
if(schema.id&&schema.id!==undefined && schema.status === 'Registered'){
620+
return {
621+
text:schema.schemaDocument.name + " "+ `{${UtilsMixin.methods.truncate(schema.id, 60)}}`,
622+
value:schema.id
623+
}
624+
}
625+
else{
626+
return null
627+
}
628+
})
629+
this.schemaIdsList = schemaIds.filter(x => x)
630+
this.schemaIdsList.unshift({ value: null, text: "Please select a schema" })
631+
return this.schemaIdsList;
632+
} catch (error) {
633+
return this.notifyErr(error.message)
634+
}
613635
},
614636
async created() {
615637
try {
@@ -637,6 +659,7 @@ export default {
637659
methods: {
638660
...mapActions('mainStore', [
639661
'fetchCredentialList',
662+
'fetchSchemaList',
640663
'resolveCredential',
641664
'checkBlockchainStatusOfSSI',
642665
'resolveSchema',
@@ -726,8 +749,10 @@ export default {
726749
this.reasonForCredentialUpdate = "";
727750
this.verificationMethodId = "";
728751
this.errorMessage = "";
752+
this.warningMessage="";
729753
},
730754
async handleCredentialAction(credentialId,action){
755+
this.resetForm()
731756
this.vcId = credentialId;
732757
this.selectedAction =action ;
733758
this.selectedCredential= this.credentialList.find(x=>x.id===credentialId)
@@ -757,13 +782,13 @@ export default {
757782
}
758783
let fetchedCredStatus;
759784
const { revoked, suspended, issuer } =this.selectedCredential.credentialStatus;
760-
if (!revoked && !suspended) {
761-
fetchedCredStatus='LIVE'
762-
} else if (!suspended) {
763-
fetchedCredStatus="SUSPEND"
764-
}else{
765-
fetchedCredStatus="REVOKE"
766-
}
785+
if (revoked) {
786+
fetchedCredStatus = "REVOKE";
787+
} else if (suspended) {
788+
fetchedCredStatus = "SUSPEND";
789+
} else {
790+
fetchedCredStatus = "LIVE";
791+
}
767792
//check for status
768793
switch (this.selectedAction) {
769794
case "LIVE":
@@ -774,7 +799,7 @@ export default {
774799
break;
775800
case "SUSPEND":
776801
if (fetchedCredStatus === "SUSPEND") {
777-
this.errorMessage = "Credential is already Live.";
802+
this.errorMessage = "Credential is already SUSPENDED.";
778803
}
779804
break;
780805
case "REVOKE":

src/views/playground/KYCDashboardCredit.vue

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,26 @@ h5 span {
158158
<div class="">
159159
<div class="">
160160
<p><b>Total Credits</b></p>
161-
<p>
162-
<span style="font-size:xx-large;">
163-
{{ numberFormat(myKYCCredits.allRemainingCredits) }}
164-
</span> <span style="font-size:larger;">/</span>
165-
<span style="font-size:larger; color: grey">
166-
{{ numberFormat(myKYCCredits.allAvailableCredits) }}
161+
<p v-if="myKYCCredits.allRemainingCredits === 0 && myKYCCredits.allAvailableCredits === 0">
162+
<span style="font-size: xx-large;">
163+
{{ numberFormat(myKYCCredits.allRemainingCredits) }}
164+
</span>
165+
</p>
166+
<p v-else>
167+
<span style="font-size: xx-large;">
168+
{{ numberFormat(myKYCCredits.allRemainingCredits) }}
169+
</span>
170+
<span style="font-size: larger;">/</span>
171+
<span style="font-size: larger; color: grey">
172+
{{ numberFormat(myKYCCredits.allAvailableCredits) }}
173+
</span>
174+
</p>
175+
<p v-if="this.timeRemaining==='Expired'">
176+
<span style="font-size:small; color: grey">
177+
Expired
167178
</span>
168179
</p>
169-
<p>
180+
<p v-else>
170181
<span style="font-size:small; color: grey">
171182
Expires In: {{ this.timeRemaining }}
172183
</span>

src/views/playground/SSIDashboardCredit.vue

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -185,34 +185,6 @@ h5 span {
185185
</div>
186186
</div>
187187

188-
<!--Usage -->
189-
<div class="">
190-
<div class="" style="text-align: left">
191-
<div class="form-group" style="display:flex">
192-
<h3 style="text-align: left;">Usage</h3>
193-
</div>
194-
</div>
195-
</div>
196-
<div class="row">
197-
<div class="col-4">
198-
<v-card class="p-4">
199-
<canvas id="didChart"></canvas>
200-
</v-card>
201-
</div>
202-
203-
<div class="col-4">
204-
<v-card class="p-4">
205-
<canvas id="credChart"></canvas>
206-
</v-card>
207-
</div>
208-
209-
<div class="col-4">
210-
<v-card class="p-4">
211-
<canvas id="schemaChart"></canvas>
212-
</v-card>
213-
</div>
214-
</div>
215-
216188
<!-- Credit History -->
217189
<!--
218190

0 commit comments

Comments
 (0)