mirror of
https://github.com/khairul169/vaulterm.git
synced 2026-09-15 17:03:30 +07:00
feat: add auth, hosts, & keychains ownership
This commit is contained in:
@@ -2,6 +2,7 @@ import React from "react";
|
||||
import Terminal from "./terminal";
|
||||
import { BASE_WS_URL } from "@/lib/api";
|
||||
import VNCViewer from "./vncviewer";
|
||||
import { useAuthStore } from "@/stores/auth";
|
||||
|
||||
type SSHSessionProps = {
|
||||
type: "ssh";
|
||||
@@ -28,7 +29,8 @@ export type InteractiveSessionProps = {
|
||||
} & (SSHSessionProps | PVESessionProps | IncusSessionProps);
|
||||
|
||||
const InteractiveSession = ({ type, params }: InteractiveSessionProps) => {
|
||||
const query = new URLSearchParams(params);
|
||||
const { token } = useAuthStore();
|
||||
const query = new URLSearchParams({ ...params, sid: token || "" });
|
||||
const url = `${BASE_WS_URL}/ws/term?${query}`;
|
||||
|
||||
switch (type) {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import React from "react";
|
||||
import { Button, GetProps } from "tamagui";
|
||||
import Icons from "../ui/icons";
|
||||
import useThemeStore from "@/stores/theme";
|
||||
|
||||
type Props = GetProps<typeof Button> & {
|
||||
iconSize?: number;
|
||||
};
|
||||
|
||||
const ThemeSwitcher = ({ iconSize = 24, ...props }: Props) => {
|
||||
const { theme, toggle } = useThemeStore();
|
||||
|
||||
return (
|
||||
<Button
|
||||
icon={
|
||||
<Icons
|
||||
name={
|
||||
theme === "light" ? "white-balance-sunny" : "moon-waning-crescent"
|
||||
}
|
||||
size={iconSize}
|
||||
/>
|
||||
}
|
||||
onPress={toggle}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default ThemeSwitcher;
|
||||
Reference in New Issue
Block a user