Update TOTP Pr, begin password reset, add openapi.json for clarity.
This commit is contained in:
53
CONTRIBUTING
Normal file
53
CONTRIBUTING
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- [Node.js](https://nodejs.org/en/download/) (built with v24)
|
||||||
|
- [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
|
||||||
|
- [Git](https://git-scm.com/downloads)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. Clone the repository:
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/LukeGus/Termix
|
||||||
|
```
|
||||||
|
2. Install the dependencies for the server:
|
||||||
|
```sh
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running the development server
|
||||||
|
|
||||||
|
Run the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
This will start the Vite server. You can access Termix by going to `http://localhost:5174/`.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
1. **Fork the repository**: Click the "Fork" button at the top right of
|
||||||
|
the [repository page](https://github.com/LukeGus/Termix).
|
||||||
|
2. **Create a new branch**:
|
||||||
|
```sh
|
||||||
|
git checkout -b feature/my-new-feature
|
||||||
|
```
|
||||||
|
3. **Make your changes**: Implement your feature, fix, or improvement.
|
||||||
|
4. **Commit your changes**:
|
||||||
|
```sh
|
||||||
|
git commit -m "Add feature: my new feature"
|
||||||
|
```
|
||||||
|
5. **Push to your fork**:
|
||||||
|
```sh
|
||||||
|
git push origin feature/my-new-feature
|
||||||
|
```
|
||||||
|
6. **Open a pull request**: Go to the original repository and create a PR with a clear description.
|
||||||
|
|
||||||
|
## 📝 Guidelines
|
||||||
|
|
||||||
|
- Follow the existing code style. Use Tailwind CSS with shadcn components.
|
||||||
|
- Include meaningful commit messages.
|
||||||
|
- Link related issues when applicable.
|
||||||
2262
openapi.json
Normal file
2262
openapi.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ import {HostManager} from "@/ui/apps/Host Manager/HostManager.tsx"
|
|||||||
import {TabProvider, useTabs} from "@/ui/Navigation/Tabs/TabContext.tsx"
|
import {TabProvider, useTabs} from "@/ui/Navigation/Tabs/TabContext.tsx"
|
||||||
import {TopNavbar} from "@/ui/Navigation/TopNavbar.tsx";
|
import {TopNavbar} from "@/ui/Navigation/TopNavbar.tsx";
|
||||||
import { AdminSettings } from "@/ui/Admin/AdminSettings";
|
import { AdminSettings } from "@/ui/Admin/AdminSettings";
|
||||||
import { UserProfile } from "@/ui/UserProfile";
|
import { UserProfile } from "@/ui/User/UserProfile.tsx";
|
||||||
import { Toaster } from "@/components/ui/sonner";
|
import { Toaster } from "@/components/ui/sonner";
|
||||||
import { getUserInfo } from "@/ui/main-axios.ts";
|
import { getUserInfo } from "@/ui/main-axios.ts";
|
||||||
|
|
||||||
|
|||||||
24
src/ui/User/PasswordReset.tsx
Normal file
24
src/ui/User/PasswordReset.tsx
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from "@/components/ui/card.tsx";
|
||||||
|
import {Key} from "lucide-react";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export function PasswordReset() {
|
||||||
|
return (
|
||||||
|
<Card>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle className="flex items-center gap-2">
|
||||||
|
<Key className="w-5 h-5"/>
|
||||||
|
Password
|
||||||
|
</CardTitle>
|
||||||
|
<CardDescription>
|
||||||
|
Change your account password
|
||||||
|
</CardDescription>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<p className="text-sm text-muted-foreground">
|
||||||
|
Password change functionality can be implemented here
|
||||||
|
</p>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card.tsx";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button.tsx";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input.tsx";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label.tsx";
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert.tsx";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs.tsx";
|
||||||
import { Shield, Copy, Download, AlertCircle, CheckCircle2 } from "lucide-react";
|
import { Shield, Copy, Download, AlertCircle, CheckCircle2 } from "lucide-react";
|
||||||
import { setupTOTP, enableTOTP, disableTOTP, generateBackupCodes } from "@/ui/main-axios";
|
import { setupTOTP, enableTOTP, disableTOTP, generateBackupCodes } from "@/ui/main-axios.ts";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|
||||||
interface TOTPSetupProps {
|
interface TOTPSetupProps {
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
import React, {useState, useEffect} from "react";
|
import React, {useState, useEffect} from "react";
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from "@/components/ui/card.tsx";
|
||||||
import { Button } from "@/components/ui/button";
|
import {Button} from "@/components/ui/button.tsx";
|
||||||
import { Input } from "@/components/ui/input";
|
import {Input} from "@/components/ui/input.tsx";
|
||||||
import { Label } from "@/components/ui/label";
|
import {Label} from "@/components/ui/label.tsx";
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
import {Alert, AlertDescription, AlertTitle} from "@/components/ui/alert.tsx";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs.tsx";
|
||||||
import {User, Shield, Key, AlertCircle} from "lucide-react";
|
import {User, Shield, Key, AlertCircle} from "lucide-react";
|
||||||
import { TOTPSetup } from "@/ui/TOTPSetup";
|
import {TOTPSetup} from "@/ui/User/TOTPSetup.tsx";
|
||||||
import { getUserInfo } from "@/ui/main-axios";
|
import {getUserInfo} from "@/ui/main-axios.ts";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
|
import {PasswordReset} from "@/ui/User/PasswordReset.tsx";
|
||||||
|
|
||||||
interface UserProfileProps {
|
interface UserProfileProps {
|
||||||
isTopbarOpen?: boolean;
|
isTopbarOpen?: boolean;
|
||||||
@@ -92,10 +93,12 @@ export function UserProfile({ isTopbarOpen = true }: UserProfileProps) {
|
|||||||
<User className="w-4 h-4"/>
|
<User className="w-4 h-4"/>
|
||||||
Profile
|
Profile
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
|
{!userInfo.is_oidc && (
|
||||||
<TabsTrigger value="security" className="flex items-center gap-2">
|
<TabsTrigger value="security" className="flex items-center gap-2">
|
||||||
<Shield className="w-4 h-4"/>
|
<Shield className="w-4 h-4"/>
|
||||||
Security
|
Security
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
|
)}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|
||||||
<TabsContent value="profile" className="space-y-4">
|
<TabsContent value="profile" className="space-y-4">
|
||||||
@@ -125,13 +128,17 @@ export function UserProfile({ isTopbarOpen = true }: UserProfileProps) {
|
|||||||
<div>
|
<div>
|
||||||
<Label>Two-Factor Authentication</Label>
|
<Label>Two-Factor Authentication</Label>
|
||||||
<p className="text-lg font-medium mt-1">
|
<p className="text-lg font-medium mt-1">
|
||||||
{userInfo.totp_enabled ? (
|
{userInfo.is_oidc ? (
|
||||||
|
<span className="text-muted-foreground">Locked (OIDC Auth)</span>
|
||||||
|
) : (
|
||||||
|
userInfo.totp_enabled ? (
|
||||||
<span className="text-green-600 flex items-center gap-1">
|
<span className="text-green-600 flex items-center gap-1">
|
||||||
<Shield className="w-4 h-4"/>
|
<Shield className="w-4 h-4"/>
|
||||||
Enabled
|
Enabled
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<span className="text-muted-foreground">Disabled</span>
|
<span className="text-muted-foreground">Disabled</span>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -147,22 +154,9 @@ export function UserProfile({ isTopbarOpen = true }: UserProfileProps) {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{!userInfo.is_oidc && (
|
{!userInfo.is_oidc && (
|
||||||
<Card>
|
<PasswordReset>
|
||||||
<CardHeader>
|
|
||||||
<CardTitle className="flex items-center gap-2">
|
</PasswordReset>
|
||||||
<Key className="w-5 h-5" />
|
|
||||||
Password
|
|
||||||
</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
Change your account password
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<p className="text-sm text-muted-foreground">
|
|
||||||
Password change functionality can be implemented here
|
|
||||||
</p>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
)}
|
)}
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
Reference in New Issue
Block a user