Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit 5064a5b

Browse files
✨ API logs permalink, navbar chages
1 parent 3fb59ef commit 5064a5b

File tree

5 files changed

+105
-7
lines changed

5 files changed

+105
-7
lines changed

components/Navbar.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@
66
<span>Staart</span>
77
</nuxt-link>
88
<nav v-if="isAuthenticated" :class="{ 'nav--visible-true': showNav }">
9-
<nuxt-link class="item" :to="`/dashboard/${activeOrganization}`"
9+
<nuxt-link
10+
v-if="activeOrganization"
11+
class="item"
12+
:to="`/dashboard/${activeOrganization}`"
1013
>Dashboard</nuxt-link
1114
>
12-
<nuxt-link class="item" to="/dashboard">Dashboard</nuxt-link>
13-
<nuxt-link class="item" :to="`/manage/${activeOrganization}/settings`"
15+
<nuxt-link v-else class="item" to="/dashboard">Dashboard</nuxt-link>
16+
<nuxt-link
17+
v-if="activeOrganization"
18+
class="item"
19+
:to="`/manage/${activeOrganization}/settings`"
1420
>Settings</nuxt-link
1521
>
22+
<nuxt-link v-else class="item" to="/settings">Settings</nuxt-link>
1623
<span>
1724
<button
1825
class="item item--type-less"

pages/dashboard/settings.vue

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<template>
2+
<main>
3+
<div class="container container--size-small">
4+
<Loading message="Loading your settings" />
5+
</div>
6+
</main>
7+
</template>
8+
9+
<script lang="ts">
10+
import { Component, Vue } from "vue-property-decorator";
11+
import { mapGetters } from "vuex";
12+
import Loading from "@/components/Loading.vue";
13+
14+
@Component({
15+
middleware: "auth",
16+
components: {
17+
Loading
18+
}
19+
})
20+
export default class Dashboard extends Vue {
21+
private mounted() {
22+
const team = this.$store.getters["auth/activeOrganization"];
23+
if (team && team !== "undefined") {
24+
this.$router.replace(`/settings/${team}`);
25+
} else {
26+
this.$store
27+
.dispatch("settings/getMemberships")
28+
.then(memberships => {
29+
if (memberships.data && memberships.data.length) {
30+
if (
31+
memberships.data[0].organization &&
32+
memberships.data[0].organization.username
33+
) {
34+
this.$router.replace(
35+
`/settings/${memberships.data[0].organization.username}`
36+
);
37+
} else {
38+
this.$router.replace(
39+
`/settings/${memberships.data[0].organizationId}`
40+
);
41+
}
42+
} else {
43+
this.$router.replace("/onboarding/organization");
44+
}
45+
})
46+
.catch(() => {});
47+
}
48+
}
49+
}
50+
</script>
51+
52+
<style lang="scss" scoped>
53+
header {
54+
background-color: #fff;
55+
padding: 10vh 0;
56+
margin-bottom: 10vh;
57+
h1 {
58+
margin: 0 0 2rem 0;
59+
}
60+
}
61+
</style>

pages/manage/_team/developer/api-keys/index.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@
7070
>
7171
<font-awesome-icon class="icon" icon="eye" fixed-width />
7272
</router-link>
73+
<router-link
74+
:to="
75+
`/manage/${$route.params.team}/developer/logs?key=${apiKey.id}`
76+
"
77+
aria-label="Logs"
78+
data-balloon-pos="up"
79+
class="button button--type-icon"
80+
>
81+
<font-awesome-icon
82+
class="icon"
83+
icon="chart-line"
84+
fixed-width
85+
/>
86+
</router-link>
7387
<button
7488
aria-label="Delete"
7589
data-balloon-pos="up"
@@ -156,7 +170,8 @@ import {
156170
faArrowDown,
157171
faSync,
158172
faTrash,
159-
faEye
173+
faEye,
174+
faChartLine
160175
} from "@fortawesome/free-solid-svg-icons";
161176
import Loading from "@/components/Loading.vue";
162177
import Confirm from "@/components/Confirm.vue";
@@ -170,7 +185,7 @@ import { User } from "@/types/auth";
170185
import { ApiKeys, emptyPagination, ApiKey } from "@/types/manage";
171186
import translations from "@/locales/en";
172187
const scopes = translations.scopes;
173-
library.add(faArrowDown, faSync, faTrash, faEye);
188+
library.add(faArrowDown, faSync, faTrash, faEye, faChartLine);
174189
175190
@Component({
176191
components: {

pages/manage/_team/developer/logs.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@
8989
{{ log._source.method }}
9090
</td>
9191
<td>
92-
<code>{{ log._source.url.split("?")[0] }}</code>
92+
<input
93+
v-if="log._source && log._source.url"
94+
class="input input--font-monospace input--padding-condensed"
95+
:value="log._source.url"
96+
disabled
97+
/>
9398
</td>
9499
<td v-if="log._source && log._source.statusCode">
95100
<HTTPStatus :status="log._source.statusCode" />
@@ -219,6 +224,8 @@ export default class ManageSettings extends Vue {
219224
this.apiKeys = {
220225
...this.$store.getters["manage/apiKeys"](this.$route.params.team)
221226
};
227+
const tryNum = parseInt(this.$route.query.key as string);
228+
if (!isNaN(tryNum)) this.activeApiKey = tryNum;
222229
this.data = {
223230
...this.$store.getters["manage/apiKeyLogs"](
224231
this.$route.params.team,
@@ -243,7 +250,7 @@ export default class ManageSettings extends Vue {
243250
this.loading = "";
244251
})
245252
.then(apiKeyId => {
246-
if (apiKeyId) this.activeApiKey = apiKeyId;
253+
if (apiKeyId && !this.activeApiKey) this.activeApiKey = apiKeyId;
247254
return this.loadData();
248255
})
249256
.catch(error => {

styles/ui.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,14 @@ code {
435435
&:disabled {
436436
background-color: rgba($color-primary, 0.025);
437437
}
438+
&.input--font-monospace {
439+
font-family: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
440+
font-size: 90%;
441+
}
442+
&.input--padding-condensed {
443+
padding-top: 0.5rem;
444+
padding-bottom: 0.5rem;
445+
}
438446
}
439447

440448
.container--type-settings {

0 commit comments

Comments
 (0)