Commit 8cf39c51 authored by Hidde-Jan Jongsma's avatar Hidde-Jan Jongsma

Improve token creation form

parent 3265e3c0
......@@ -30,10 +30,10 @@
<b-form-group label="Request data">
<b-form-textarea
class="data-input"
:value="JSON.stringify(data, null, 2)"
:options="[1]"
required
@input="(val) => (this.data = JSON.parse(val))"
@input="(val) => (data = JSON.parse(val))"
></b-form-textarea>
</b-form-group>
......@@ -41,7 +41,7 @@
</b-form>
<b-card class="mt-3" header="Created Token">
<pre class="m-0">{{ token }}</pre>
<pre class="token-output m-0">{{ token }}</pre>
</b-card>
</div>
</template>
......@@ -71,6 +71,17 @@ export default {
});
},
},
async mounted() {
try {
const result = await axios.get("/api/organizations");
console.log(result);
this.organizations = result.data.map((o) => {
return { value: o.id, text: `${o.name} (${o.id})` };
});
} catch (e) {
console.error(e);
}
},
methods: {
async createToken() {
try {
......@@ -105,16 +116,16 @@ export default {
}
},
},
async mounted() {
try {
const result = await axios.get("/api/organizations");
console.log(result);
this.organizations = result.data.map((o) => {
return { value: o.id, text: `${o.name} (${o.id})` };
});
} catch (e) {
console.error(e);
}
},
};
</script>
<style scoped>
.data-input {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace;
}
.token-output {
white-space: pre-wrap;
}
</style>
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