Commit 036a555e authored by Hidde-Jan Jongsma's avatar Hidde-Jan Jongsma

Add navigation to Utils view

parent 3c2be141
<template>
<div class="create-token-form">
<div class="create-request-form">
<b-form @submit.prevent="createRequest">
<h1>Create request</h1>
<b-form-radio-group label="Request type">
<b-form-radio v-model="requestType" value="credential-verify-request">
CredentialVerifyRequest
......@@ -23,7 +21,7 @@
<b-button type="submit" variant="primary">Submit</b-button>
</b-form>
<b-card class="mt-3" header="Request">
<b-card class="mt-3" header="Request" :border-variant="borderVariant">
<pre class="m-0">{{ JSON.stringify(result, null, 2) }}</pre>
</b-card>
</div>
......@@ -39,8 +37,20 @@ export default {
requestType: "",
token: "",
result: null,
error: null,
};
},
computed: {
borderVariant() {
if (this.error === true) {
return "danger";
} else if (this.error === false) {
return "success";
}
return "";
},
},
methods: {
async createRequest() {
try {
......@@ -53,9 +63,11 @@ export default {
},
});
console.log(result.data);
this.error = false;
this.result = result.data;
} catch (e) {
console.error(e);
this.error = true;
this.result = e.response?.data;
}
},
},
......
<template>
<div class="create-token-form">
<b-form @submit.prevent="createToken">
<h1>Create request token</h1>
<b-form-group
label="Organization ID"
description="The organization for which you want to create a credential request."
......@@ -17,7 +15,7 @@
<b-form-group
label="Credential Type"
description="The organization specific credential type you want to perform"
description="The organization specific credential type you want to perform."
>
<b-form-select
v-model="credentialType"
......@@ -43,7 +41,7 @@
<b-form-group
label="Callback URL"
description="Url to redirect the user to with the response. The response
JWT is appended directly to the URL"
JWT is appended directly to the URL."
>
<b-form-input v-model="callbackUrl" required></b-form-input>
</b-form-group>
......@@ -59,7 +57,7 @@
<b-form-group
label="Request data"
description="Credential data used for issue requests"
description="Credential data used for issue requests."
invalid-feedback="Please enter valid JSON"
:state="dataState"
>
......
import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Utils from "../views/Utils.vue";
import CreateToken from "../views/utils/CreateToken.vue";
import CreateIssueRequest from "../views/CreateIssueRequest.vue";
import CreateVerifyRequest from "../views/CreateVerifyRequest.vue";
import PerformIssueRequest from "../views/PerformIssueRequest.vue";
import PerformVerifyRequest from "../views/PerformVerifyRequest.vue";
import ConnectorSelect from "../components/ConnectorSelect.vue";
Vue.use(VueRouter);
......@@ -23,11 +25,13 @@ const routes = [
path: "/utils",
name: "Utils",
component: Utils,
},
{
path: "/connector",
name: "Connector",
component: ConnectorSelect,
children: [
{
path: "/utils/create-token",
name: "CreateToken",
component: CreateToken,
},
],
},
{
path: "/issue/:connector/:requestId",
......@@ -56,7 +60,7 @@ const routes = [
];
const router = new VueRouter({
mode: "hash",
mode: "hash", // FIXME history in production.
base: process.env.BASE_URL,
routes,
});
......
<template>
<div class="utils">
<create-token-form></create-token-form>
<hr />
<create-request-form></create-request-form>
<b-navbar>
<b-navbar-brand>TNO SSI Provider</b-navbar-brand>
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
<b-navbar-nav>
<b-nav-item :to="{ name: 'CreateToken' }">Create token</b-nav-item>
<b-nav-item href="#" disabled>Organizations</b-nav-item>
<b-nav-item href="#" disabled>Credential types</b-nav-item>
<b-nav-item href="#" disabled>Jolocom types</b-nav-item>
</b-navbar-nav>
</b-navbar>
<router-view></router-view>
</div>
</template>
<script>
import CreateTokenForm from "../components/utils/CreateTokenForm.vue";
import CreateRequestForm from "../components/utils/CreateRequestForm.vue";
export default {
name: "Utils",
components: {
CreateTokenForm,
CreateRequestForm,
},
};
</script>
<template>
<div class="create-request-token">
<h1>Create request token</h1>
<create-token-form></create-token-form>
<hr />
<h1>Debug token</h1>
<create-request-form></create-request-form>
<hr />
</div>
</template>
<script>
import CreateTokenForm from "../../components/utils/CreateTokenForm.vue";
import CreateRequestForm from "../../components/utils/CreateRequestForm.vue";
export default {
name: "CreateToken",
components: {
CreateTokenForm,
CreateRequestForm,
},
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment