Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Refactor signin/signup/passwordreset to a splash layout

Tianzhou Chenf780944c55b2
diff --git a/frontend/src/layouts/SplashLayout.vue b/frontend/src/layouts/SplashLayout.vue
new file mode 100644
index 0000000000..fc887b5583
--- /dev/null
+++ b/frontend/src/layouts/SplashLayout.vue
@@ -0,0 +1,35 @@
+<template>
+ <div class="min-h-screen flex">
+ <div class="hidden bg-main lg:block relative w-0 flex-1">
+ <!-- <img
+ class="absolute inset-0 h-full w-full object-cover"
+ src="../../assets/signin-splash.jpeg"
+ alt=""
+ /> -->
+ <div class="absolute top-0 right-0 p-8">
+ <h1 class="text-right text-4xl font-semibold tracking-tight space-y-2">
+ <span class="block text-white">Simple systems work</span>
+ <span class="block text-white">complex don't</span>
+ </h1>
+ <p
+ class="mt-6 text-right text-xl font-medium tracking-tight text-white"
+ >
+ Jim Gray
+ </p>
+ </div>
+ </div>
+ <div
+ class="flex-1 flex flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 lg:w-1/2 xl:px-24"
+ >
+ <router-view />
+ </div>
+ </div>
+</template>
+
+<script lang="ts">
+export default {
+ name: "SettingLayout",
+ components: {},
+ setup(props, ctx) {},
+};
+</script>
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index bddcae0ae2..fda3fdea1f 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -5,6 +5,7 @@ import {
RouteLocationNormalized,
RouteRecordRaw,
} from "vue-router";
+import SplashLayout from "../layouts/SplashLayout.vue";
import DashboardLayout from "../layouts/DashboardLayout.vue";
import BodyLayout from "../layouts/BodyLayout.vue";
import DashboardSidebar from "../views/DashboardSidebar.vue";
@@ -16,28 +17,40 @@ import { store } from "../store";
import { idFromSlug } from "../utils";
const HOME_MODULE = "workspace.home";
+const AUTH_MODULE = "auth";
const SIGNIN_MODULE = "auth.signin";
const SIGNUP_MODULE = "auth.signup";
const PASSWORD_RESET_MODULE = "auth.password.reset";
const routes: Array<RouteRecordRaw> = [
{
- path: "/signin",
- name: SIGNIN_MODULE,
- meta: { title: () => "Signin" },
- component: Signin,
- },
- {
- path: "/signup",
- name: SIGNUP_MODULE,
- meta: { title: () => "Signup" },
- component: Signup,
- },
- {
- path: "/password-reset",
- name: PASSWORD_RESET_MODULE,
- meta: { title: () => "Reset Password" },
- component: PasswordReset,
+ path: "/auth",
+ name: AUTH_MODULE,
+ component: SplashLayout,
+ children: [
+ {
+ path: "",
+ name: SIGNIN_MODULE,
+ meta: { title: () => "Signin" },
+ component: Signin,
+ alias: "signin",
+ props: true,
+ },
+ {
+ path: "signup",
+ name: SIGNUP_MODULE,
+ meta: { title: () => "Signup" },
+ component: Signup,
+ props: true,
+ },
+ {
+ path: "password-reset",
+ name: PASSWORD_RESET_MODULE,
+ meta: { title: () => "Reset Password" },
+ component: PasswordReset,
+ props: true,
+ },
+ ],
},
{
path: "/",
diff --git a/frontend/src/views/auth/PasswordReset.vue b/frontend/src/views/auth/PasswordReset.vue
index 8cbe7a414c..09996bc7a0 100644
--- a/frontend/src/views/auth/PasswordReset.vue
+++ b/frontend/src/views/auth/PasswordReset.vue
@@ -1,84 +1,56 @@
<template>
- <!--
- Tailwind UI components require Tailwind CSS v1.8 and the @tailwindcss/ui plugin.
- Read the documentation to get started: https://tailwindui.com/documentation
--->
- <div class="min-h-screen flex">
- <div class="hidden bg-main lg:block relative w-0 flex-1">
- <!-- <img
- class="absolute inset-0 h-full w-full object-cover"
- src="../../assets/signin-splash.jpeg"
- alt=""
- /> -->
- <div class="absolute top-0 right-0 p-8">
- <h1 class="text-right text-4xl font-semibold tracking-tight space-y-2">
- <span class="block text-white">Simple systems work</span>
- <span class="block text-white">complex don't</span>
- </h1>
- <p
- class="mt-6 text-right text-xl font-medium tracking-tight text-white"
- >
- Jim Gray
- </p>
- </div>
+ <div class="mx-auto w-full max-w-sm">
+ <div>
+ <img class="h-12 w-auto" src="../../assets/logo.svg" alt="Bytebase" />
+ <h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
+ Reset your password
+ </h2>
</div>
- <div
- class="flex-1 flex flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 lg:w-1/2 xl:px-24"
- >
- <div class="mx-auto w-full max-w-sm">
- <div>
- <img class="h-12 w-auto" src="../../assets/logo.svg" alt="Bytebase" />
- <h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
- Reset your password
- </h2>
- </div>
-
- <div class="mt-8">
- <div class="mt-6">
- <form @submit.prevent="trySignin" class="space-y-6">
- <div>
- <label
- for="email"
- class="block text-base font-medium leading-5 text-control"
- >
- Enter your email address and we will send you a password reset
- link
- </label>
- <div class="mt-4 rounded-md shadow-sm">
- <input
- id="email"
- type="email"
- v-model="email"
- required
- class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
- />
- </div>
- </div>
- <div>
- <span class="block w-full rounded-md shadow-sm">
- <button
- type="submit"
- class="btn-primary w-full flex justify-center py-2 px-4"
- >
- Send reset link
- </button>
- </span>
- </div>
- </form>
+ <div class="mt-8">
+ <div class="mt-6">
+ <form @submit.prevent="trySignin" class="space-y-6">
+ <div>
+ <label
+ for="email"
+ class="block text-base font-medium leading-5 text-control"
+ >
+ Enter your email address and we will send you a password reset
+ link
+ </label>
+ <div class="mt-4 rounded-md shadow-sm">
+ <input
+ id="email"
+ type="email"
+ v-model="email"
+ required
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
+ />
+ </div>
</div>
- </div>
- <div class="mt-6 relative">
- <div class="absolute inset-0 flex items-center" aria-hidden="true">
- <div class="w-full border-t border-control-border"></div>
+ <div>
+ <span class="block w-full rounded-md shadow-sm">
+ <button
+ type="submit"
+ class="btn-primary w-full flex justify-center py-2 px-4"
+ >
+ Send reset link
+ </button>
+ </span>
</div>
- <div class="relative flex justify-center text-sm">
- <router-link to="signin" class="accent-link bg-white px-2">
- Return to Sign in
- </router-link>
- </div>
- </div>
+ </form>
+ </div>
+ </div>
+
+ <div class="mt-6 relative">
+ <div class="absolute inset-0 flex items-center" aria-hidden="true">
+ <div class="w-full border-t border-control-border"></div>
+ </div>
+ <div class="relative flex justify-center text-sm">
+ <router-link to="/auth/signin" class="accent-link bg-white px-2">
+ Return to Sign in
+ </router-link>
</div>
</div>
</div>
diff --git a/frontend/src/views/auth/Signin.vue b/frontend/src/views/auth/Signin.vue
index 05280fde04..39abb0175e 100644
--- a/frontend/src/views/auth/Signin.vue
+++ b/frontend/src/views/auth/Signin.vue
@@ -1,127 +1,99 @@
<template>
- <!--
- Tailwind UI components require Tailwind CSS v1.8 and the @tailwindcss/ui plugin.
- Read the documentation to get started: https://tailwindui.com/documentation
--->
- <div class="min-h-screen flex">
- <div class="hidden bg-main lg:block relative w-0 flex-1">
- <!-- <img
- class="absolute inset-0 h-full w-full object-cover"
- src="../../assets/signin-splash.jpeg"
- alt=""
- /> -->
- <div class="absolute top-0 right-0 p-8">
- <h1 class="text-right text-4xl font-semibold tracking-tight space-y-2">
- <span class="block text-white">Simple systems work</span>
- <span class="block text-white">complex don't</span>
- </h1>
- <p
- class="mt-6 text-right text-xl font-medium tracking-tight text-white"
- >
- Jim Gray
- </p>
- </div>
+ <div class="mx-auto w-full max-w-sm">
+ <div>
+ <img class="h-12 w-auto" src="../../assets/logo.svg" alt="Bytebase" />
+ <h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
+ Sign in to your account
+ </h2>
</div>
- <div
- class="flex-1 flex flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 lg:w-1/2 xl:px-24"
- >
- <div class="mx-auto w-full max-w-sm">
- <div>
- <img class="h-12 w-auto" src="../../assets/logo.svg" alt="Bytebase" />
- <h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
- Sign in to your account
- </h2>
- </div>
-
- <div class="mt-8">
- <div class="mt-6">
- <form @submit.prevent="trySignin" class="space-y-6">
- <div>
- <label
- for="email"
- class="block text-sm font-medium leading-5 text-control"
- >
- Email
- </label>
- <div class="mt-1 rounded-md shadow-sm">
- <input
- id="email"
- type="email"
- v-model="state.email"
- required
- placeholder="[email protected]"
- class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
- />
- </div>
- </div>
- <div>
- <label
- for="password"
- class="block text-sm font-medium leading-5 text-control"
- >
- Password
- </label>
- <div class="mt-1 rounded-md shadow-sm">
- <input
- id="password"
- type="password"
- autocomplete="on"
- v-model="state.password"
- required
- class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
- />
- </div>
- </div>
+ <div class="mt-8">
+ <div class="mt-6">
+ <form @submit.prevent="trySignin" class="space-y-6">
+ <div>
+ <label
+ for="email"
+ class="block text-sm font-medium leading-5 text-control"
+ >
+ Email
+ </label>
+ <div class="mt-1 rounded-md shadow-sm">
+ <input
+ id="email"
+ type="email"
+ v-model="state.email"
+ required
+ placeholder="[email protected]"
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
+ />
+ </div>
+ </div>
- <div class="flex items-center justify-between">
- <div class="flex items-center">
- <input
- id="remember_me"
- type="checkbox"
- v-model="state.rememberMe"
- class="text-control form-checkbox h-4 w-4"
- />
- <label
- for="remember_me"
- class="ml-2 block text-sm leading-5 text-main"
- >
- Remember me
- </label>
- </div>
+ <div>
+ <label
+ for="password"
+ class="block text-sm font-medium leading-5 text-control"
+ >
+ Password
+ </label>
+ <div class="mt-1 rounded-md shadow-sm">
+ <input
+ id="password"
+ type="password"
+ autocomplete="on"
+ v-model="state.password"
+ required
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
+ />
+ </div>
+ </div>
- <div class="text-sm leading-5">
- <router-link to="password-reset" class="link">
- Forgot your password?
- </router-link>
- </div>
- </div>
+ <div class="flex items-center justify-between">
+ <div class="flex items-center">
+ <input
+ id="remember_me"
+ type="checkbox"
+ v-model="state.rememberMe"
+ class="text-control form-checkbox h-4 w-4"
+ />
+ <label
+ for="remember_me"
+ class="ml-2 block text-sm leading-5 text-main"
+ >
+ Remember me
+ </label>
+ </div>
- <div>
- <span class="block w-full rounded-md shadow-sm">
- <button
- type="submit"
- class="btn-primary w-full flex justify-center py-2 px-4"
- >
- Sign in
- </button>
- </span>
- </div>
- </form>
+ <div class="text-sm leading-5">
+ <router-link to="/auth/password-reset" class="link">
+ Forgot your password?
+ </router-link>
+ </div>
</div>
- </div>
- <div class="mt-6 relative">
- <div class="absolute inset-0 flex items-center" aria-hidden="true">
- <div class="w-full border-t border-control-border"></div>
- </div>
- <div class="relative flex justify-center text-sm">
- <span class="pl-2 bg-white text-control"> New to Bytebase? </span>
- <router-link to="signup" class="accent-link bg-white px-2">
- Sign up
- </router-link>
+ <div>
+ <span class="block w-full rounded-md shadow-sm">
+ <button
+ type="submit"
+ class="btn-primary w-full flex justify-center py-2 px-4"
+ >
+ Sign in
+ </button>
+ </span>
</div>
- </div>
+ </form>
+ </div>
+ </div>
+
+ <div class="mt-6 relative">
+ <div class="absolute inset-0 flex items-center" aria-hidden="true">
+ <div class="w-full border-t border-control-border"></div>
+ </div>
+ <div class="relative flex justify-center text-sm">
+ <span class="pl-2 bg-white text-control"> New to Bytebase? </span>
+ <router-link to="/auth/signup" class="accent-link bg-white px-2">
+ Sign up
+ </router-link>
</div>
</div>
</div>
diff --git a/frontend/src/views/auth/Signup.vue b/frontend/src/views/auth/Signup.vue
index 624a8f48d2..a077628a3b 100644
--- a/frontend/src/views/auth/Signup.vue
+++ b/frontend/src/views/auth/Signup.vue
@@ -1,122 +1,94 @@
<template>
- <!--
- Tailwind UI components require Tailwind CSS v1.8 and the @tailwindcss/ui plugin.
- Read the documentation to get started: https://tailwindui.com/documentation
--->
- <div class="min-h-screen flex">
- <div class="hidden bg-main lg:block relative w-0 flex-1">
- <!-- <img
- class="absolute inset-0 h-full w-full object-cover"
- src="../../assets/signin-splash.jpeg"
- alt=""
- /> -->
- <div class="absolute top-0 right-0 p-8">
- <h1 class="text-right text-4xl font-semibold tracking-tight space-y-2">
- <span class="block text-white">Simple systems work</span>
- <span class="block text-white">complex don't</span>
- </h1>
- <p
- class="mt-6 text-right text-xl font-medium tracking-tight text-white"
- >
- Jim Gray
- </p>
- </div>
+ <div class="mx-auto w-full max-w-sm">
+ <div>
+ <img class="h-12 w-auto" src="../../assets/logo.svg" alt="Bytebase" />
+ <h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
+ Register your account
+ </h2>
</div>
- <div
- class="flex-1 flex flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 lg:w-1/2 xl:px-24"
- >
- <div class="mx-auto w-full max-w-sm">
- <div>
- <img class="h-12 w-auto" src="../../assets/logo.svg" alt="Bytebase" />
- <h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
- Register your account
- </h2>
- </div>
-
- <div class="mt-8">
- <div class="mt-6">
- <form @submit.prevent="trySignup" class="space-y-6">
- <div>
- <label
- for="email"
- class="block text-sm font-medium leading-5 text-control"
- >
- Email
- </label>
- <div class="mt-1 rounded-md shadow-sm">
- <input
- id="email"
- type="email"
- v-model="state.email"
- required
- class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
- />
- </div>
- </div>
-
- <div>
- <label
- for="password"
- class="block text-sm font-medium leading-5 text-control"
- >
- Password
- </label>
- <div class="mt-1 rounded-md shadow-sm">
- <input
- id="password"
- type="password"
- autocomplete="on"
- v-model="state.password"
- required
- class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
- />
- </div>
- </div>
- <div class="flex items-center justify-between">
- <div class="flex items-center">
- <input
- id="remember_me"
- type="checkbox"
- v-model="state.rememberMe"
- class="text-control form-checkbox h-4 w-4"
- />
- <label
- for="remember_me"
- class="ml-2 block text-sm leading-5 text-main"
- >
- Remember me
- </label>
- </div>
- </div>
+ <div class="mt-8">
+ <div class="mt-6">
+ <form @submit.prevent="trySignup" class="space-y-6">
+ <div>
+ <label
+ for="email"
+ class="block text-sm font-medium leading-5 text-control"
+ >
+ Email
+ </label>
+ <div class="mt-1 rounded-md shadow-sm">
+ <input
+ id="email"
+ type="email"
+ v-model="state.email"
+ required
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
+ />
+ </div>
+ </div>
- <div>
- <span class="block w-full rounded-md shadow-sm">
- <button
- type="submit"
- class="btn-primary w-full flex justify-center py-2 px-4"
- >
- Register
- </button>
- </span>
- </div>
- </form>
+ <div>
+ <label
+ for="password"
+ class="block text-sm font-medium leading-5 text-control"
+ >
+ Password
+ </label>
+ <div class="mt-1 rounded-md shadow-sm">
+ <input
+ id="password"
+ type="password"
+ autocomplete="on"
+ v-model="state.password"
+ required
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
+ />
+ </div>
</div>
- </div>
- <div class="mt-6 relative">
- <div class="absolute inset-0 flex items-center" aria-hidden="true">
- <div class="w-full border-t border-control-border"></div>
+ <div class="flex items-center justify-between">
+ <div class="flex items-center">
+ <input
+ id="remember_me"
+ type="checkbox"
+ v-model="state.rememberMe"
+ class="text-control form-checkbox h-4 w-4"
+ />
+ <label
+ for="remember_me"
+ class="ml-2 block text-sm leading-5 text-main"
+ >
+ Remember me
+ </label>
+ </div>
</div>
- <div class="relative flex justify-center text-sm">
- <span class="pl-2 bg-white text-control">
- Already have an account?
+
+ <div>
+ <span class="block w-full rounded-md shadow-sm">
+ <button
+ type="submit"
+ class="btn-primary w-full flex justify-center py-2 px-4"
+ >
+ Register
+ </button>
</span>
- <router-link to="signin" class="accent-link px-2 bg-white">
- Sign in
- </router-link>
</div>
- </div>
+ </form>
+ </div>
+ </div>
+
+ <div class="mt-6 relative">
+ <div class="absolute inset-0 flex items-center" aria-hidden="true">
+ <div class="w-full border-t border-control-border"></div>
+ </div>
+ <div class="relative flex justify-center text-sm">
+ <span class="pl-2 bg-white text-control">
+ Already have an account?
+ </span>
+ <router-link to="/auth/signin" class="accent-link px-2 bg-white">
+ Sign in
+ </router-link>
</div>
</div>
</div>