Skip to content

Commit 10a6bfd

Browse files
replace routes with a stricted one
1 parent d377694 commit 10a6bfd

File tree

20 files changed

+174
-110
lines changed

20 files changed

+174
-110
lines changed

frontend/kubecloud-v2/assets/scss/vuetify.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@
44
$body-font-family: string.unquote('Inter, sans-serif'),
55
$heading-font-family: string.unquote('Inter, sans-serif'),
66
);
7+
8+
.text-accent {
9+
@extend .text-grey;
10+
}
11+
12+
.rounded-xl {
13+
border-radius: 18px !important;
14+
}

frontend/kubecloud-v2/components/AppFooter.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<v-spacer />
1414
<v-col cols="auto">
15-
<v-btn size="small" text="Documentation" to="/docs" variant="plain" />
15+
<v-btn size="small" text="Documentation" :to="ROUTES.Docs()" variant="plain" />
1616
<v-btn
1717
size="small"
1818
text="Github"
@@ -23,10 +23,10 @@
2323
<v-btn
2424
size="small"
2525
text="Terms & Conditions"
26-
to="/terms-and-conditions"
26+
:to="ROUTES.TermsAndConditions()"
2727
variant="plain"
2828
/>
29-
<v-btn size="small" text="Privacy Policy" to="/privacy-policy" variant="plain" />
29+
<v-btn size="small" text="Privacy Policy" :to="ROUTES.PrivacyPolicy()" variant="plain" />
3030
</v-col>
3131
</v-row>
3232

frontend/kubecloud-v2/components/AppNavbar.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
>
77
<v-container class="d-flex align-center py-0">
88
<div class="mr-16">
9-
<NuxtLink to="/">
9+
<NuxtLink :to="ROUTES.Home()">
1010
<v-img src="~/assets/images/logo.png" width="124" height="33" />
1111
</NuxtLink>
1212
</div>
@@ -39,21 +39,21 @@
3939
<v-spacer />
4040

4141
<template v-if="!authenticated">
42-
<span v-if="$route.path === '/sign-in'" class="text-caption opacity-70 mr-2">
42+
<span v-if="$route.path === ROUTES.SignIn()" class="text-caption opacity-70 mr-2">
4343
Don't have an account?
4444
</span>
4545

46-
<span v-if="$route.path === '/sign-up'" class="text-caption opacity-70 mr-2">
46+
<span v-if="$route.path === ROUTES.SignUp()" class="text-caption opacity-70 mr-2">
4747
Already have an account?
4848
</span>
4949

50-
<v-btn v-if="$route.path !== '/sign-up'" variant="outlined" to="/sign-up" text="Sign up" />
50+
<v-btn v-if="$route.path !== ROUTES.SignUp()" variant="outlined" :to="ROUTES.SignUp()" text="Sign up" />
5151

5252
<v-btn
53-
v-if="$route.path !== '/sign-in'"
53+
v-if="$route.path !== ROUTES.SignIn()"
5454
variant="tonal"
5555
color="primary"
56-
to="/sign-in"
56+
:to="ROUTES.SignIn()"
5757
text="Sign in"
5858
class="ml-2"
5959
/>
@@ -73,9 +73,9 @@
7373
</template>
7474

7575
<v-list>
76-
<v-list-item link title="Admin Panel" prepend-icon="mdi-shield-crown" to="/admin" />
77-
<v-list-item link title="Dashboard" prepend-icon="mdi-view-dashboard" to="/dashboard" />
78-
<v-list-item link title="Profile" prepend-icon="mdi-account" to="/profile" />
76+
<v-list-item link title="Admin Panel" prepend-icon="mdi-shield-crown" :to="ROUTES.Admin()" />
77+
<v-list-item link title="Dashboard" prepend-icon="mdi-view-dashboard" :to="ROUTES.Dashboard()" />
78+
<v-list-item link title="Profile" prepend-icon="mdi-account" :to="ROUTES.Profile()" />
7979
<v-divider />
8080
<v-list-item
8181
link
@@ -94,12 +94,12 @@
9494
import type { VBtn } from "vuetify/components/VBtn"
9595
9696
const route = useRoute()
97-
const routes = ref([
98-
{ title: "Home", path: "/" },
99-
{ title: "Features", path: "/features" },
100-
{ title: "Docs", path: "/docs" },
101-
{ title: "Use Cases", path: "/use-cases" },
102-
])
97+
const routes = [
98+
{ title: "Home", path: ROUTES.Home() },
99+
{ title: "Features", path: ROUTES.Features() },
100+
{ title: "Docs", path: ROUTES.Docs() },
101+
{ title: "Use Cases", path: ROUTES.UseCases() },
102+
]
103103
104104
const navbarLinkItems = useTemplateRefsList<VBtn>()
105105
const indicatorTransform = ref({ offset: 0, width: 0 })
@@ -133,7 +133,7 @@ const authenticated = computed(() => !!accessToken.value)
133133
function logout() {
134134
accessToken.value = ""
135135
refreshToken.value = ""
136-
router.push("/")
136+
router.push(ROUTES.Home())
137137
}
138138
</script>
139139

frontend/kubecloud-v2/components/MarkdownEditor.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const text = ref("")
140140
let quill: Quill | null = null
141141
142142
const { isRevealed, reveal, cancel, confirm } = useDialog<undefined, HTMLFormElement>()
143-
const formats = markRaw([
143+
const formats = [
144144
{ format: "bold", icon: "format-bold" },
145145
{ format: "italic", icon: "format-italic" },
146146
{ format: "underline", icon: "format-underline" },
@@ -159,7 +159,7 @@ const formats = markRaw([
159159
},
160160
{ format: "strike", icon: "format-strikethrough-variant" },
161161
{ format: "blockquote", icon: "format-quote-close" },
162-
])
162+
]
163163
164164
const font = ref("sans")
165165
watchImmediate(font, f => quill?.format("font", f))

frontend/kubecloud-v2/components/PasswordInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ const showConfirmPassword = ref(false)
9090
const confirmPassword = ref("")
9191
9292
// prettier-ignore
93-
const passwordRules = markRaw([
93+
const passwordRules = [
9494
{ label: "One uppercase letter (A-Z)", rule: (v: string) => v.match(/[A-Z]/) !== null },
9595
{ label: "One lowercase letter (a-z)", rule: (v: string) => v.match(/[a-z]/) !== null },
9696
{ label: "One number (0-9)", rule: (v: string) => v.match(/\d/) !== null },
9797
{ label: "One special character (!@#$%^&*)", rule: (v: string) => v.match(/[!@#$%^&*]/) !== null },
9898
{ label: "At least 8 characters", rule: (v: string) => v.length >= 8 },
9999
{ label: "Passwords should match", rule: (v: string) => !!v && v === confirmPassword.value },
100-
])
100+
]
101101
</script>

frontend/kubecloud-v2/components/SignInForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</template>
3636
</v-text-field>
3737

38-
<NuxtLink to="/forgot-password" class="text-link text-caption d-inline-block mt-2 mb-8">
38+
<NuxtLink :to="ROUTES.ForgotPassword()" class="text-link text-caption d-inline-block mt-2 mb-8">
3939
Forgot Password?
4040
</NuxtLink>
4141

frontend/kubecloud-v2/components/StatsCard.vue

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<template>
2-
<v-card>
3-
<div class="d-flex align-center justify-center">
4-
<v-avatar
5-
:icon="icon"
6-
:color="color"
7-
variant="tonal"
8-
:size="50"
9-
rounded="lg"
10-
/>
11-
</div>
2+
<v-card class="text-center">
3+
<v-avatar
4+
:icon="icon"
5+
:color="color"
6+
variant="tonal"
7+
:size="50"
8+
rounded="lg"
9+
/>
1210

13-
<p class="text-center text-h4 font-weight-bold mt-4 mb-1 text-no-wrap" v-text="value" />
14-
<p class="text-center text-subtitle-2 text-uppercase opacity-50" v-text="title" />
11+
<p class="text-h4 font-weight-bold mt-4 mb-1 text-no-wrap" v-text="value" />
12+
<p class="text-subtitle-2 text-uppercase text-accent" v-text="title" />
1513
</v-card>
1614
</template>
1715

frontend/kubecloud-v2/components/dialogs/InvoiceDialogCard.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@
6060
<template #actions>
6161
<v-btn
6262
component="a"
63-
variant="text"
64-
prepend-icon="mdi-download"
65-
text="Download"
63+
:variant="downloaded ? 'tonal' : 'text'"
64+
:prepend-icon="downloaded ? 'mdi-check' : 'mdi-download'"
65+
:text="downloaded ? `00:0${remaining}` : 'Download'"
6666
color="success"
6767
download="invoice.json"
6868
:href="binary"
69+
:disabled="downloaded"
70+
@click="startDownload(3)"
6971
/>
7072
</template>
7173
</DialogCardLayout>
@@ -92,4 +94,6 @@ const binary = computed(() => {
9294
9395
return URL.createObjectURL(blob)
9496
})
97+
98+
const { isActive: downloaded, start: startDownload, remaining } = useCountdown(3)
9599
</script>

frontend/kubecloud-v2/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"dev": "nuxt dev",
88
"generate": "nuxt generate",
99
"preview": "nuxt preview",
10-
"postinstall": "openapi-generator-cli generate && nuxt prepare",
10+
"postinstall": "nuxt prepare",
1111
"prepare": "npm run audit",
1212
"lint": "eslint .",
1313
"lint:fix": "eslint . --fix",
1414
"typecheck": "nuxt typecheck",
15-
"audit": "yarn audit --summary --level critical"
15+
"audit": "yarn audit --summary --level critical",
16+
"generate:api": "openapi-generator-cli generate"
1617
},
1718
"dependencies": {
1819
"@mdi/font": "^7.4.47",

frontend/kubecloud-v2/pages/admin.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<StickySidebarLayout :is-open="isOpen" :is-fluid="isFluid">
33
<template #sidebar>
44
<v-list class="overflow-hidden w-100">
5-
<v-list-item link exact title="Overview" to="/admin" />
6-
<v-list-item link exact title="Users" to="/admin/users" />
7-
<v-list-item link exact title="Vouchers" to="/admin/vouchers" />
8-
<v-list-item link exact title="System" to="/admin/system" />
9-
<v-list-item link exact title="Invoices" to="/admin/invoices" />
10-
<v-list-item link exact title="Payments" to="/admin/payments" />
11-
<v-list-item link exact title="Emails" to="/admin/emails" />
12-
<v-list-item link exact title="Workflows" to="/admin/workflows" />
5+
<v-list-item link exact title="Overview" :to="ROUTES.Admin()" />
6+
<v-list-item link exact title="Users" :to="ROUTES.Admin.Users()" />
7+
<v-list-item link exact title="Vouchers" :to="ROUTES.Admin.Vouchers()" />
8+
<v-list-item link exact title="System" :to="ROUTES.Admin.System()" />
9+
<v-list-item link exact title="Invoices" :to="ROUTES.Admin.Invoices()" />
10+
<v-list-item link exact title="Payments" :to="ROUTES.Admin.Payments()" />
11+
<v-list-item link exact title="Emails" :to="ROUTES.Admin.Emails()" />
12+
<v-list-item link exact title="Workflows" :to="ROUTES.Admin.Workflows()" />
1313
</v-list>
1414
</template>
1515

0 commit comments

Comments
 (0)