Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
844347acf9 | ||
|
|
eeae9b4405 | ||
|
|
feef94f873 |
1
ui/dist/assets/index-Cg0yCJnh.css
vendored
Normal file
1
ui/dist/assets/index-Cg0yCJnh.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
ui/dist/assets/index-Kh_0Jotc.css
vendored
1
ui/dist/assets/index-Kh_0Jotc.css
vendored
File diff suppressed because one or more lines are too long
4
ui/dist/index.html
vendored
4
ui/dist/index.html
vendored
@@ -5,8 +5,8 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Certimate - Your Trusted SSL Automation Partner</title>
|
<title>Certimate - Your Trusted SSL Automation Partner</title>
|
||||||
<script type="module" crossorigin src="/assets/index-BKUIxIk5.js"></script>
|
<script type="module" crossorigin src="/assets/index-D8T6Buyh.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-Kh_0Jotc.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-Cg0yCJnh.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-background">
|
<body class="bg-background">
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
|
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
@@ -136,44 +137,46 @@ export function AccessEdit({
|
|||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>{op == "add" ? "添加" : "编辑"}授权</DialogTitle>
|
<DialogTitle>{op == "add" ? "添加" : "编辑"}授权</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<div className="container">
|
<ScrollArea className="max-h-[80vh]">
|
||||||
<Label>服务商</Label>
|
<div className="container py-3">
|
||||||
|
<Label>服务商</Label>
|
||||||
|
|
||||||
<Select
|
<Select
|
||||||
onValueChange={(val) => {
|
onValueChange={(val) => {
|
||||||
console.log(val);
|
console.log(val);
|
||||||
setConfigType(val);
|
setConfigType(val);
|
||||||
}}
|
}}
|
||||||
defaultValue={configType}
|
defaultValue={configType}
|
||||||
>
|
>
|
||||||
<SelectTrigger className="mt-3">
|
<SelectTrigger className="mt-3">
|
||||||
<SelectValue placeholder="请选择服务商" />
|
<SelectValue placeholder="请选择服务商" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectGroup>
|
<SelectGroup>
|
||||||
<SelectLabel>服务商</SelectLabel>
|
<SelectLabel>服务商</SelectLabel>
|
||||||
{typeKeys.map((key) => (
|
{typeKeys.map((key) => (
|
||||||
<SelectItem value={key} key={key}>
|
<SelectItem value={key} key={key}>
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex items-center space-x-2 rounded cursor-pointer",
|
"flex items-center space-x-2 rounded cursor-pointer",
|
||||||
getOptionCls(key)
|
getOptionCls(key)
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={accessTypeMap.get(key)?.[1]}
|
src={accessTypeMap.get(key)?.[1]}
|
||||||
className="h-6 w-6"
|
className="h-6 w-6"
|
||||||
/>
|
/>
|
||||||
<div>{accessTypeMap.get(key)?.[0]}</div>
|
<div>{accessTypeMap.get(key)?.[0]}</div>
|
||||||
</div>
|
</div>
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
</SelectGroup>
|
</SelectGroup>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
|
|
||||||
{form}
|
{form}
|
||||||
</div>
|
</div>
|
||||||
|
</ScrollArea>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { save } from "@/repository/access";
|
|||||||
import { ClientResponseError } from "pocketbase";
|
import { ClientResponseError } from "pocketbase";
|
||||||
import { PbErrorData } from "@/domain/base";
|
import { PbErrorData } from "@/domain/base";
|
||||||
import { readFileContent } from "@/lib/file";
|
import { readFileContent } from "@/lib/file";
|
||||||
|
import { useRef, useState } from "react";
|
||||||
|
|
||||||
const AccessSSHForm = ({
|
const AccessSSHForm = ({
|
||||||
data,
|
data,
|
||||||
@@ -27,6 +28,11 @@ const AccessSSHForm = ({
|
|||||||
onAfterReq: () => void;
|
onAfterReq: () => void;
|
||||||
}) => {
|
}) => {
|
||||||
const { addAccess, updateAccess } = useConfig();
|
const { addAccess, updateAccess } = useConfig();
|
||||||
|
|
||||||
|
const fileInputRef = useRef<HTMLInputElement | null>(null);
|
||||||
|
|
||||||
|
const [fileName, setFileName] = useState("");
|
||||||
|
|
||||||
const formSchema = z.object({
|
const formSchema = z.object({
|
||||||
id: z.string().optional(),
|
id: z.string().optional(),
|
||||||
name: z.string().min(1).max(64),
|
name: z.string().min(1).max(64),
|
||||||
@@ -38,7 +44,7 @@ const AccessSSHForm = ({
|
|||||||
username: z.string().min(1).max(64),
|
username: z.string().min(1).max(64),
|
||||||
password: z.string().min(0).max(64),
|
password: z.string().min(0).max(64),
|
||||||
key: z.string().min(0).max(20480),
|
key: z.string().min(0).max(20480),
|
||||||
keyFile: z.string().optional(),
|
keyFile: z.any().optional(),
|
||||||
command: z.string().min(1).max(2048),
|
command: z.string().min(1).max(2048),
|
||||||
certPath: z.string().min(0).max(2048),
|
certPath: z.string().min(0).max(2048),
|
||||||
keyPath: z.string().min(0).max(2048),
|
keyPath: z.string().min(0).max(2048),
|
||||||
@@ -127,9 +133,16 @@ const AccessSSHForm = ({
|
|||||||
) => {
|
) => {
|
||||||
const file = event.target.files?.[0];
|
const file = event.target.files?.[0];
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
const content = await readFileContent(file);
|
const savedFile = file;
|
||||||
|
setFileName(savedFile.name);
|
||||||
|
const content = await readFileContent(savedFile);
|
||||||
form.setValue("key", content);
|
form.setValue("key", content);
|
||||||
form.setValue("keyFile", "");
|
};
|
||||||
|
|
||||||
|
const handleSelectFileClick = () => {
|
||||||
|
console.log(fileInputRef.current);
|
||||||
|
|
||||||
|
fileInputRef.current?.click();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -279,12 +292,26 @@ const AccessSSHForm = ({
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Key(使用证书登录)</FormLabel>
|
<FormLabel>Key(使用证书登录)</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<div>
|
||||||
placeholder="请输入Key"
|
<Button
|
||||||
{...field}
|
type={"button"}
|
||||||
type="file"
|
variant={"secondary"}
|
||||||
onChange={handleFileChange}
|
size={"sm"}
|
||||||
/>
|
className="w-48"
|
||||||
|
onClick={handleSelectFileClick}
|
||||||
|
>
|
||||||
|
{fileName ? fileName : "请选择文件"}
|
||||||
|
</Button>
|
||||||
|
<Input
|
||||||
|
placeholder="请输入Key"
|
||||||
|
{...field}
|
||||||
|
ref={fileInputRef}
|
||||||
|
className="hidden"
|
||||||
|
hidden
|
||||||
|
type="file"
|
||||||
|
onChange={handleFileChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ export default function Dashboard() {
|
|||||||
href="https://github.com/usual2970/certimate/releases"
|
href="https://github.com/usual2970/certimate/releases"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
Certimate v0.1.2
|
Certimate v0.1.3
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ const Dashboard = () => {
|
|||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<div className="text-muted-foreground">控制面板</div>
|
<div className="text-muted-foreground">控制面板</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex mt-10 gap-5 flex-col md:flex-row">
|
<div className="flex mt-10 gap-5 flex-col flex-wrap md:flex-row">
|
||||||
<div className="w-full md:w-[300px] flex items-center rounded-md p-3 shadow-lg border">
|
<div className="w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border">
|
||||||
<div className="p-3">
|
<div className="p-3">
|
||||||
<SquareSigma size={48} strokeWidth={1} className="text-blue-400" />
|
<SquareSigma size={48} strokeWidth={1} className="text-blue-400" />
|
||||||
</div>
|
</div>
|
||||||
@@ -80,7 +80,7 @@ const Dashboard = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full md:w-[300px] flex items-center rounded-md p-3 shadow-lg border">
|
<div className="w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border">
|
||||||
<div className="p-3">
|
<div className="p-3">
|
||||||
<CalendarX2 size={48} strokeWidth={1} className="text-red-400" />
|
<CalendarX2 size={48} strokeWidth={1} className="text-red-400" />
|
||||||
</div>
|
</div>
|
||||||
@@ -101,7 +101,7 @@ const Dashboard = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="border w-full md:w-[300px] flex items-center rounded-md p-3 shadow-lg">
|
<div className="border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg">
|
||||||
<div className="p-3">
|
<div className="p-3">
|
||||||
<LoaderPinwheel
|
<LoaderPinwheel
|
||||||
size={48}
|
size={48}
|
||||||
@@ -126,7 +126,7 @@ const Dashboard = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="border w-full md:w-[300px] flex items-center rounded-md p-3 shadow-lg">
|
<div className="border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg">
|
||||||
<div className="p-3">
|
<div className="p-3">
|
||||||
<Ban size={48} strokeWidth={1} className="text-gray-400" />
|
<Ban size={48} strokeWidth={1} className="text-gray-400" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ module.exports = {
|
|||||||
padding: "2rem",
|
padding: "2rem",
|
||||||
screens: {
|
screens: {
|
||||||
"2xl": "1400px",
|
"2xl": "1400px",
|
||||||
|
'3xl': '1920px',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
extend: {
|
extend: {
|
||||||
|
|||||||
Reference in New Issue
Block a user