Skip to content

Commit

Permalink
feat: login
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Oct 25, 2024
1 parent a721dd3 commit 9a6d98d
Show file tree
Hide file tree
Showing 30 changed files with 28,442 additions and 664 deletions.
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"lib": "@/lib",
"hooks": "@/hooks"
}
}
}
26,494 changes: 26,444 additions & 50 deletions dashboard/assets/index-0PJiolov.js

Large diffs are not rendered by default.

1,207 changes: 1,206 additions & 1 deletion dashboard/assets/index-CzWJmHBz.css

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
<link rel="icon" type="image/svg+xml" href="/dashboard/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<script type="module" crossorigin src="/dashboard/assets/index-0PJiolov.js"></script>
<link rel="stylesheet" crossorigin href="/dashboard/assets/index-CzWJmHBz.css">
<script
type="module"
crossorigin
src="/dashboard/assets/index-0PJiolov.js"
></script>
<link
rel="stylesheet"
crossorigin
href="/dashboard/assets/index-CzWJmHBz.css"
/>
</head>
<body>
<div id="root"></div>
Expand Down
24 changes: 12 additions & 12 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ['dist'] },
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
)
);
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default {
tailwindcss: {},
autoprefixer: {},
},
}
};
50 changes: 28 additions & 22 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// src/App.tsx
import React from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import Header from './components/Header';
import Footer from './components/Footer';
// import PrivateRoute from './components/PrivateRoute';
import { cn } from './lib/utils';
import Service from './pages/Service';
import Server from './pages/Server';
import Setting from './pages/Setting';
import Task from './pages/Task';
import User from './pages/User';
import Alarm from './pages/Alarm';
import Intranet from './pages/Intranet';


import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Header from "./components/Header";
import Footer from "./components/Footer";
import { cn } from "./lib/utils";
import Service from "./pages/Service";
import Server from "./pages/Server";
import Setting from "./pages/Setting";
import Task from "./pages/Task";
import User from "./pages/User";
import Alarm from "./pages/Alarm";
import Intranet from "./pages/Intranet";
import Login from "./pages/Login";
import PrivateRoute from "./components/PrivateRoute";

const App: React.FC = () => {
return (
<Router basename={import.meta.env.BASE_URL}>
<div className={cn(
"min-h-screen font-sans antialiased flex w-full flex-col",
)}>

<div
className={cn(
"min-h-screen font-sans antialiased flex w-full flex-col",
)}
>
<main className="flex min-h-[calc(100vh_-_theme(spacing.16))] flex-1 bg-muted/50 flex-col gap-4">
<Header />
<Routes>
Expand All @@ -30,10 +30,16 @@ const App: React.FC = () => {
<Route path="/task" element={<Task />} />
<Route path="/alarm" element={<Alarm />} />
<Route path="/intranet" element={<Intranet />} />
<Route path="/setting" element={<Setting />} />

<Route
path="/setting"
element={
<PrivateRoute>
<Setting />
</PrivateRoute>
}
/>
<Route path="/user" element={<User />} />
{/* <Route path="/about" element={<About />} /> */}
<Route path="/login" element={<Login />} />
{/* <Route
path="/dashboard"
element={
Expand Down
26 changes: 13 additions & 13 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// src/components/Footer.tsx
import React from 'react';
import React from "react";

const Footer: React.FC = () => {
return (
<footer className="mx-auto w-full max-w-5xl px-4 lg:px-0 pb-4">
<section className="flex flex-col">
<section className="mt-1 flex items-center gap-2 text-[13px] font-light tracking-tight text-neutral-600/50 dark:text-neutral-300/50">
©2020-{new Date().getFullYear()}{" "}
<a href={"https://nezha.wiki"} target="_blank">
Nezha
</a>
</section>
</section>
</footer>
);
return (
<footer className="mx-auto w-full max-w-5xl px-4 lg:px-0 pb-4">
<section className="flex flex-col">
<section className="mt-1 flex items-center gap-2 text-[13px] font-light tracking-tight text-neutral-600/50 dark:text-neutral-300/50">
©2020-{new Date().getFullYear()}{" "}
<a href={"https://nezha.wiki"} target="_blank">
Nezha
</a>
</section>
</section>
</footer>
);
};

export default Footer;
Loading

0 comments on commit 9a6d98d

Please sign in to comment.