mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
restructure files onto electron-vite boilerplate
This commit is contained in:
parent
91ce2cd8a1
commit
1cf587bc8f
457 changed files with 9927 additions and 11705 deletions
|
|
@ -1,39 +1,41 @@
|
|||
import { Group } from '@mantine/core';
|
||||
import { openModal, closeAllModals } from '@mantine/modals';
|
||||
import { closeAllModals, openModal } from '@mantine/modals';
|
||||
import isElectron from 'is-electron';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
RiLockLine,
|
||||
RiWindowFill,
|
||||
RiArrowLeftSLine,
|
||||
RiArrowRightSLine,
|
||||
RiLayoutRightLine,
|
||||
RiLayoutLeftLine,
|
||||
RiEdit2Line,
|
||||
RiSettings3Line,
|
||||
RiServerLine,
|
||||
RiGithubLine,
|
||||
RiExternalLinkLine,
|
||||
RiCloseCircleLine,
|
||||
RiEdit2Line,
|
||||
RiExternalLinkLine,
|
||||
RiGithubLine,
|
||||
RiLayoutLeftLine,
|
||||
RiLayoutRightLine,
|
||||
RiLockLine,
|
||||
RiServerLine,
|
||||
RiSettings3Line,
|
||||
RiWindowFill,
|
||||
} from 'react-icons/ri';
|
||||
import { useNavigate } from 'react-router';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import packageJson from '../../../../../package.json';
|
||||
|
||||
import { ServerListItem, ServerType } from '/@/renderer/api/types';
|
||||
import { DropdownMenu } from '/@/renderer/components';
|
||||
import { ServerList } from '/@/renderer/features/servers';
|
||||
import { EditServerForm } from '/@/renderer/features/servers/components/edit-server-form';
|
||||
import { AppRoute } from '/@/renderer/router/routes';
|
||||
import {
|
||||
useAppStoreActions,
|
||||
useAuthStoreActions,
|
||||
useCurrentServer,
|
||||
useServerList,
|
||||
useAuthStoreActions,
|
||||
useSidebarStore,
|
||||
useAppStoreActions,
|
||||
} from '/@/renderer/store';
|
||||
import { ServerListItem, ServerType } from '/@/renderer/api/types';
|
||||
import packageJson from '../../../../../package.json';
|
||||
|
||||
const browser = isElectron() ? window.electron.browser : null;
|
||||
const localSettings = isElectron() ? window.electron.localSettings : null;
|
||||
const browser = isElectron() ? window.api.browser : null;
|
||||
const localSettings = isElectron() ? window.api.localSettings : null;
|
||||
|
||||
export const AppMenu = () => {
|
||||
const { t } = useTranslation();
|
||||
|
|
@ -50,7 +52,7 @@ export const AppMenu = () => {
|
|||
};
|
||||
|
||||
const handleCredentialsModal = async (server: ServerListItem) => {
|
||||
let password: string | null = null;
|
||||
let password: null | string = null;
|
||||
|
||||
try {
|
||||
if (localSettings && server.savePassword) {
|
||||
|
|
@ -63,9 +65,9 @@ export const AppMenu = () => {
|
|||
children: server && (
|
||||
<EditServerForm
|
||||
isUpdate
|
||||
onCancel={closeAllModals}
|
||||
password={password}
|
||||
server={server}
|
||||
onCancel={closeAllModals}
|
||||
/>
|
||||
),
|
||||
size: 'sm',
|
||||
|
|
@ -153,7 +155,6 @@ export const AppMenu = () => {
|
|||
|
||||
return (
|
||||
<DropdownMenu.Item
|
||||
key={`server-${server.id}`}
|
||||
$isActive={server.id === currentServer?.id}
|
||||
icon={
|
||||
isSessionExpired ? (
|
||||
|
|
@ -162,6 +163,7 @@ export const AppMenu = () => {
|
|||
<RiServerLine />
|
||||
)
|
||||
}
|
||||
key={`server-${server.id}`}
|
||||
onClick={() => {
|
||||
if (!isSessionExpired) return handleSetCurrentServer(server);
|
||||
return handleCredentialsModal(server);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import type { ReactNode } from 'react';
|
||||
|
||||
import { Group } from '@mantine/core';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { WindowControls } from '../../window-controls';
|
||||
|
||||
interface TitlebarProps {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue