Minor cleanup.
This commit is contained in:
@@ -2,3 +2,4 @@ VITE_FIREBASE_CONFIG={"apiKey":"AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU","authDo
|
|||||||
VITE_GRAPHQL_ENDPOINT=https://db.imex.online/v1/graphql
|
VITE_GRAPHQL_ENDPOINT=https://db.imex.online/v1/graphql
|
||||||
VITE_FIREBASE_CONFIG_TEST={ "apiKey":"AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c", "authDomain":"imex-test.firebaseapp.com", "projectId":"imex-test", "storageBucket":"imex-test.appspot.com", "messagingSenderId":"991923618608", "appId":"1:991923618608:web:633437569cdad78299bef5", "measurementId":"G-TW0XLZEH18"}
|
VITE_FIREBASE_CONFIG_TEST={ "apiKey":"AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c", "authDomain":"imex-test.firebaseapp.com", "projectId":"imex-test", "storageBucket":"imex-test.appspot.com", "messagingSenderId":"991923618608", "appId":"1:991923618608:web:633437569cdad78299bef5", "measurementId":"G-TW0XLZEH18"}
|
||||||
VITE_GRAPHQL_ENDPOINT_TEST=https://db.test.bodyshop.app/v1/graphql
|
VITE_GRAPHQL_ENDPOINT_TEST=https://db.test.bodyshop.app/v1/graphql
|
||||||
|
VITE_COMPANY=IMEX
|
||||||
@@ -2,3 +2,4 @@ VITE_FIREBASE_CONFIG={"apiKey":"AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc","authDo
|
|||||||
VITE_GRAPHQL_ENDPOINT=https://db.dev.imex.online/v1/graphql
|
VITE_GRAPHQL_ENDPOINT=https://db.dev.imex.online/v1/graphql
|
||||||
VITE_FIREBASE_CONFIG_TEST={ "apiKey":"AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c", "authDomain":"imex-test.firebaseapp.com", "projectId":"imex-test", "storageBucket":"imex-test.appspot.com", "messagingSenderId":"991923618608", "appId":"1:991923618608:web:633437569cdad78299bef5", "measurementId":"G-TW0XLZEH18"}
|
VITE_FIREBASE_CONFIG_TEST={ "apiKey":"AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c", "authDomain":"imex-test.firebaseapp.com", "projectId":"imex-test", "storageBucket":"imex-test.appspot.com", "messagingSenderId":"991923618608", "appId":"1:991923618608:web:633437569cdad78299bef5", "measurementId":"G-TW0XLZEH18"}
|
||||||
VITE_GRAPHQL_ENDPOINT_TEST=https://db.test.bodyshop.app/v1/graphql
|
VITE_GRAPHQL_ENDPOINT_TEST=https://db.test.bodyshop.app/v1/graphql
|
||||||
|
VITE_COMPANY=IMEX
|
||||||
@@ -2,3 +2,4 @@ VITE_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "a
|
|||||||
VITE_GRAPHQL_ENDPOINT=https://db.romeonline.io/v1/graphql
|
VITE_GRAPHQL_ENDPOINT=https://db.romeonline.io/v1/graphql
|
||||||
VITE_FIREBASE_CONFIG_TEST={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
VITE_FIREBASE_CONFIG_TEST={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
||||||
VITE_GRAPHQL_ENDPOINT_TEST=https://db.test.romeonline.io/v1/graphql
|
VITE_GRAPHQL_ENDPOINT_TEST=https://db.test.romeonline.io/v1/graphql
|
||||||
|
VITE_COMPANY=ROME
|
||||||
|
Before Width: | Height: | Size: 320 KiB After Width: | Height: | Size: 320 KiB |
@@ -13,8 +13,8 @@
|
|||||||
"typecheck": "npm run typecheck:node && npm run typecheck:web",
|
"typecheck": "npm run typecheck:node && npm run typecheck:web",
|
||||||
"start": "electron-vite preview",
|
"start": "electron-vite preview",
|
||||||
"dev": "electron-vite dev",
|
"dev": "electron-vite dev",
|
||||||
"build:mac:imex": "electron-vite build --mode imex && electron-builder --config electron-builder.imex.yml",
|
"build:imex": "electron-vite build --mode imex && electron-builder --config electron-builder.imex.yml",
|
||||||
"build:mac:rome": "electron-vite build --mode rome && electron-builder --config electron-builder.rome.yml",
|
"build:rome": "electron-vite build --mode rome && electron-builder --config electron-builder.rome.yml",
|
||||||
"postinstall": "electron-builder install-app-deps",
|
"postinstall": "electron-builder install-app-deps",
|
||||||
"build:unpack": "npm run build && electron-builder --dir",
|
"build:unpack": "npm run build && electron-builder --dir",
|
||||||
"build:win": "npm run build && electron-builder --win",
|
"build:win": "npm run build && electron-builder --win",
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 320 KiB |
@@ -8,6 +8,7 @@ import {
|
|||||||
} from "../util/ems-util";
|
} from "../util/ems-util";
|
||||||
import uppercaseObjectKeys from "../util/uppercaseObjectKeys";
|
import uppercaseObjectKeys from "../util/uppercaseObjectKeys";
|
||||||
import { EmsPartsOrder } from "./ems-parts-order-interfaces";
|
import { EmsPartsOrder } from "./ems-parts-order-interfaces";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
const EmsPartsOrderGeneratePflFile = async (
|
const EmsPartsOrderGeneratePflFile = async (
|
||||||
partsOrder: EmsPartsOrder,
|
partsOrder: EmsPartsOrder,
|
||||||
@@ -15,7 +16,7 @@ const EmsPartsOrderGeneratePflFile = async (
|
|||||||
try {
|
try {
|
||||||
let records;
|
let records;
|
||||||
|
|
||||||
if (partsOrder.job.cieca_pfl) {
|
if (partsOrder.job.cieca_pfl && !_.isEmpty(partsOrder.job.cieca_pfl)) {
|
||||||
Object.keys(partsOrder.job.cieca_pfl).map((key) => {
|
Object.keys(partsOrder.job.cieca_pfl).map((key) => {
|
||||||
const record: DecodedPflLine = partsOrder.job.cieca_pfl[key];
|
const record: DecodedPflLine = partsOrder.job.cieca_pfl[key];
|
||||||
return uppercaseObjectKeys(record);
|
return uppercaseObjectKeys(record);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { DBFFile } from "dbffile";
|
import { DBFFile } from "dbffile";
|
||||||
|
import _ from "lodash";
|
||||||
import errorTypeCheck from "../../util/errorTypeCheck";
|
import errorTypeCheck from "../../util/errorTypeCheck";
|
||||||
import { DecodedPfmLine } from "../decoder/decode-pfm.interface";
|
import { DecodedPfmLine } from "../decoder/decode-pfm.interface";
|
||||||
import { pfmFieldLineDescriptors } from "../util/ems-interface/fielddescriptors/pfm-field-descriptors";
|
import { pfmFieldLineDescriptors } from "../util/ems-interface/fielddescriptors/pfm-field-descriptors";
|
||||||
@@ -14,7 +15,7 @@ const EmsPartsOrderGeneratePfmFile = async (
|
|||||||
): Promise<boolean> => {
|
): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
let records;
|
let records;
|
||||||
if (partsOrder.job.materials) {
|
if (partsOrder.job.materials && !_.isEmpty(partsOrder.job.materials)) {
|
||||||
records = Object.keys(partsOrder.job.materials).map((key) => {
|
records = Object.keys(partsOrder.job.materials).map((key) => {
|
||||||
const record: DecodedPfmLine = partsOrder.job.materials[key];
|
const record: DecodedPfmLine = partsOrder.job.materials[key];
|
||||||
return uppercaseObjectKeys(record);
|
return uppercaseObjectKeys(record);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import log from "electron-log/main";
|
|||||||
import { autoUpdater } from "electron-updater";
|
import { autoUpdater } from "electron-updater";
|
||||||
import path, { join } from "path";
|
import path, { join } from "path";
|
||||||
import appIcon from "../../resources/diamond.png?asset";
|
import appIcon from "../../resources/diamond.png?asset";
|
||||||
import icon from "../../resources/icon.png?asset";
|
|
||||||
import {
|
import {
|
||||||
default as ErrorTypeCheck,
|
default as ErrorTypeCheck,
|
||||||
default as errorTypeCheck,
|
default as errorTypeCheck,
|
||||||
@@ -54,7 +53,7 @@ function createWindow(): void {
|
|||||||
minWidth: 600,
|
minWidth: 600,
|
||||||
minHeight: 400,
|
minHeight: 400,
|
||||||
//autoHideMenuBar: true,
|
//autoHideMenuBar: true,
|
||||||
...(process.platform === "linux" ? { icon } : {}),
|
...(process.platform === "linux" ? { icon: appIcon } : {}),
|
||||||
title: "Shop Partner",
|
title: "Shop Partner",
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: join(__dirname, "../preload/index.js"),
|
preload: join(__dirname, "../preload/index.js"),
|
||||||
|
|||||||
@@ -64,7 +64,11 @@ const ipcMainHandleAuthStateChanged = async (
|
|||||||
};
|
};
|
||||||
|
|
||||||
const ipMainHandleResetPassword = async (): Promise<void> => {
|
const ipMainHandleResetPassword = async (): Promise<void> => {
|
||||||
shell.openExternal("https://imex.online/resetpassword");
|
shell.openExternal(
|
||||||
|
import.meta.env.VITE_COMPANY === "IMEX"
|
||||||
|
? "https://imex.online/resetpassword"
|
||||||
|
: "https://romeonline.io/resetpassword",
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { ipcMainHandleAuthStateChanged, ipMainHandleResetPassword };
|
export { ipcMainHandleAuthStateChanged, ipMainHandleResetPassword };
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ const store = new Store({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// store.onDidAnyChange((newValue, oldValue) => {
|
// store.onDidAnyChange((newValue, oldValue) => {
|
||||||
// console.log("Settings changed", newValue, oldValue);
|
|
||||||
// const mainWindow = BrowserWindow.getAllWindows()[0];
|
// const mainWindow = BrowserWindow.getAllWindows()[0];
|
||||||
// mainWindow?.webContents.send(ipcTypes.toRenderer.store.didChange, newValue);
|
// mainWindow?.webContents.send(ipcTypes.toRenderer.store.didChange, newValue);
|
||||||
// });
|
// });
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "@ant-design/v5-patch-for-react-19";
|
import "@ant-design/v5-patch-for-react-19";
|
||||||
import { Layout, Skeleton } from "antd";
|
import { Layout, Skeleton, ConfigProvider, Badge } from "antd";
|
||||||
import { User } from "firebase/auth";
|
import { User } from "firebase/auth";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { ErrorBoundary } from "react-error-boundary";
|
import { ErrorBoundary } from "react-error-boundary";
|
||||||
@@ -40,35 +40,49 @@ const App: React.FC = () => {
|
|||||||
// Clean up the listener when component unmounts
|
// Clean up the listener when component unmounts
|
||||||
return (): void => unsubscribe();
|
return (): void => unsubscribe();
|
||||||
}, []);
|
}, []);
|
||||||
|
const isTest = window.api.isTest();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Provider store={reduxStore}>
|
<ConfigProvider
|
||||||
<HashRouter>
|
theme={{
|
||||||
<ErrorBoundary FallbackComponent={ErrorBoundaryFallback}>
|
token: {},
|
||||||
<NotificationProvider>
|
components: {
|
||||||
<Skeleton loading={user === false} active>
|
Card: {
|
||||||
<Layout style={{ minHeight: "100vh" }}>
|
borderRadius: 8,
|
||||||
{!user ? (
|
colorBgBase: "#ffaacc",
|
||||||
<SignInForm />
|
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
||||||
) : (
|
},
|
||||||
<>
|
},
|
||||||
<Layout.Header>
|
}}
|
||||||
<NavigationHeader />
|
>
|
||||||
</Layout.Header>
|
<Provider store={reduxStore}>
|
||||||
<Layout.Content style={{ padding: "0 24px" }}>
|
<HashRouter>
|
||||||
<UpdateAvailable />
|
<ErrorBoundary FallbackComponent={ErrorBoundaryFallback}>
|
||||||
<Routes>
|
<NotificationProvider>
|
||||||
<Route path="/" element={<Settings />} />
|
<Skeleton loading={user === false} active>
|
||||||
</Routes>
|
<Layout style={{ minHeight: "100vh" }}>
|
||||||
</Layout.Content>
|
{!user ? (
|
||||||
</>
|
<SignInForm />
|
||||||
)}
|
) : (
|
||||||
</Layout>
|
<Badge.Ribbon
|
||||||
</Skeleton>
|
text={isTest && "Connected to Test"}
|
||||||
</NotificationProvider>
|
color={isTest && "red"}
|
||||||
</ErrorBoundary>
|
>
|
||||||
</HashRouter>
|
<Layout.Content style={{ padding: "0 24px" }}>
|
||||||
</Provider>
|
<UpdateAvailable />
|
||||||
|
<Routes>
|
||||||
|
<Route path="/" element={<Settings />} />
|
||||||
|
</Routes>
|
||||||
|
</Layout.Content>
|
||||||
|
</Badge.Ribbon>
|
||||||
|
)}
|
||||||
|
</Layout>
|
||||||
|
</Skeleton>
|
||||||
|
</NotificationProvider>
|
||||||
|
</ErrorBoundary>
|
||||||
|
</HashRouter>
|
||||||
|
</Provider>
|
||||||
|
</ConfigProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
import { is } from "@electron-toolkit/utils";
|
|
||||||
import { auth } from "@renderer/util/firebase";
|
|
||||||
import { Badge, Layout, Menu } from "antd";
|
|
||||||
import { MenuItemType } from "antd/es/menu/interface";
|
|
||||||
import { signOut } from "firebase/auth";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { NavLink } from "react-router";
|
|
||||||
|
|
||||||
const NavigationHeader: React.FC = () => {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
//const isWatcherStarted = useAppSelector(selectWatcherStatus);
|
|
||||||
const menuItems: MenuItemType[] = [
|
|
||||||
{ label: <NavLink to="/">{t("navigation.home")}</NavLink>, key: "home" },
|
|
||||||
{
|
|
||||||
label: t("navigation.signout"),
|
|
||||||
key: "watchlist",
|
|
||||||
onClick: (): void => {
|
|
||||||
signOut(auth);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const isTest = window.api.isTest();
|
|
||||||
return (
|
|
||||||
<Badge.Ribbon text={isTest && "TEST ENV"} color={isTest && "red"}>
|
|
||||||
<Layout.Header style={{ display: "flex", alignItems: "center" }}>
|
|
||||||
<Menu
|
|
||||||
theme="dark"
|
|
||||||
mode="horizontal"
|
|
||||||
defaultSelectedKeys={["2"]}
|
|
||||||
items={menuItems}
|
|
||||||
style={{ flex: 1, minWidth: 0 }}
|
|
||||||
/>
|
|
||||||
</Layout.Header>
|
|
||||||
</Badge.Ribbon>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default NavigationHeader;
|
|
||||||
@@ -19,6 +19,11 @@ import { useEffect, useState } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import ipcTypes from "../../../../util/ipcTypes.json";
|
import ipcTypes from "../../../../util/ipcTypes.json";
|
||||||
|
|
||||||
|
const colSpans = {
|
||||||
|
md: 12,
|
||||||
|
sm: 24,
|
||||||
|
};
|
||||||
|
|
||||||
const SettingsWatcher: React.FC = () => {
|
const SettingsWatcher: React.FC = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const isWatcherStarted = useAppSelector(selectWatcherStatus);
|
const isWatcherStarted = useAppSelector(selectWatcherStatus);
|
||||||
@@ -96,8 +101,8 @@ const SettingsWatcher: React.FC = () => {
|
|||||||
color={isWatcherStarted ? "green" : "red"}
|
color={isWatcherStarted ? "green" : "red"}
|
||||||
>
|
>
|
||||||
<Card title={t("settings.labels.watcherstatus")}>
|
<Card title={t("settings.labels.watcherstatus")}>
|
||||||
<Row>
|
<Row gutter={[16, 16]}>
|
||||||
<Col md={12} xs={24}>
|
<Col {...colSpans}>
|
||||||
{isWatcherStarted ? (
|
{isWatcherStarted ? (
|
||||||
<Button onClick={handleStop}>
|
<Button onClick={handleStop}>
|
||||||
{t("settings.actions.stopwatcher")}
|
{t("settings.actions.stopwatcher")}
|
||||||
@@ -108,7 +113,7 @@ const SettingsWatcher: React.FC = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Col>
|
</Col>
|
||||||
<Col md={12} xs={24}>
|
<Col {...colSpans}>
|
||||||
<Space direction="vertical" wrap>
|
<Space direction="vertical" wrap>
|
||||||
<Switch
|
<Switch
|
||||||
checked={!pollingState.enabled}
|
checked={!pollingState.enabled}
|
||||||
|
|||||||
@@ -5,23 +5,26 @@ import Welcome from "../Welcome/Welcome";
|
|||||||
import SettingsPpcFilepath from "./Settings.PpcFilePath";
|
import SettingsPpcFilepath from "./Settings.PpcFilePath";
|
||||||
import SettingsEmsOutFilePath from "./Settings.EmsOutFilePath";
|
import SettingsEmsOutFilePath from "./Settings.EmsOutFilePath";
|
||||||
|
|
||||||
|
const colSpans = {
|
||||||
|
md: 12,
|
||||||
|
sm: 24,
|
||||||
|
};
|
||||||
const Settings: React.FC = () => {
|
const Settings: React.FC = () => {
|
||||||
console.log("is test?", window.api.isTest());
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Welcome />
|
<Welcome />
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col {...colSpans}>
|
||||||
<SettingsWatchedPaths />
|
<SettingsWatchedPaths />
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col {...colSpans}>
|
||||||
<SettingsWatcher />
|
<SettingsWatcher />
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col {...colSpans}>
|
||||||
<SettingsPpcFilepath />
|
<SettingsPpcFilepath />
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col {...colSpans}>
|
||||||
<SettingsEmsOutFilePath />
|
<SettingsEmsOutFilePath />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { auth } from "@renderer/util/firebase";
|
import { auth } from "@renderer/util/firebase";
|
||||||
import type { FormProps } from "antd";
|
import type { FormProps } from "antd";
|
||||||
import { Alert, Button, Form, Input, Space } from "antd";
|
import { Alert, Button, Form, Input, Space, Card, Typography } from "antd";
|
||||||
import log from "electron-log/renderer";
|
import log from "electron-log/renderer";
|
||||||
import { signInWithEmailAndPassword } from "firebase/auth";
|
import { signInWithEmailAndPassword } from "firebase/auth";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -8,6 +8,8 @@ import { useTranslation } from "react-i18next";
|
|||||||
import errorTypeCheck from "../../../../util/errorTypeCheck";
|
import errorTypeCheck from "../../../../util/errorTypeCheck";
|
||||||
import ipcTypes from "../../../../util/ipcTypes.json";
|
import ipcTypes from "../../../../util/ipcTypes.json";
|
||||||
|
|
||||||
|
const { Title } = Typography;
|
||||||
|
|
||||||
type FieldType = {
|
type FieldType = {
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -39,36 +41,90 @@ const SignInForm: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form
|
<Card
|
||||||
name="desktop-sign-in"
|
style={{
|
||||||
labelCol={{ span: 8 }}
|
maxWidth: 600,
|
||||||
wrapperCol={{ span: 16 }}
|
margin: "auto auto",
|
||||||
style={{ maxWidth: 600 }}
|
borderRadius: 8,
|
||||||
initialValues={{ remember: true }}
|
paddingLeft: 48,
|
||||||
onFinish={onFinish}
|
paddingRight: 48,
|
||||||
onFinishFailed={onFinishFailed}
|
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
||||||
autoComplete="off"
|
}}
|
||||||
>
|
>
|
||||||
<Form.Item<FieldType>
|
<div style={{ textAlign: "center", marginBottom: 24 }}>
|
||||||
label="Username"
|
<Title level={2}>
|
||||||
name="username"
|
{import.meta.env.VITE_COMPANY === "IMEX"
|
||||||
rules={[{ required: true }]}
|
? t("title.imex")
|
||||||
|
: t("title.rome")}
|
||||||
|
</Title>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Form
|
||||||
|
name="desktop-sign-in"
|
||||||
|
layout="vertical"
|
||||||
|
onFinish={onFinish}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
autoComplete="off"
|
||||||
|
requiredMark={false}
|
||||||
>
|
>
|
||||||
<Input />
|
{error && (
|
||||||
</Form.Item>
|
<Form.Item>
|
||||||
<Form.Item<FieldType>
|
<Alert
|
||||||
label="Password"
|
message={error}
|
||||||
name="password"
|
type="error"
|
||||||
rules={[{ required: true }]}
|
showIcon
|
||||||
>
|
style={{ marginBottom: 16 }}
|
||||||
<Input.Password />
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={null}>
|
)}
|
||||||
<Space>
|
|
||||||
<Button type="primary" loading={loading} htmlType="submit">
|
<Form.Item<FieldType>
|
||||||
|
label="Username"
|
||||||
|
name="username"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: t(
|
||||||
|
"auth.login.usernameRequired",
|
||||||
|
"Please enter your username",
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input size="large" />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item<FieldType>
|
||||||
|
label="Password"
|
||||||
|
name="password"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: t(
|
||||||
|
"auth.login.passwordRequired",
|
||||||
|
"Please enter your password",
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input.Password size="large" />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
loading={loading}
|
||||||
|
htmlType="submit"
|
||||||
|
size="large"
|
||||||
|
block
|
||||||
|
>
|
||||||
{t("auth.login.login")}
|
{t("auth.login.login")}
|
||||||
</Button>
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item style={{ marginBottom: 0, textAlign: "center" }}>
|
||||||
<Button
|
<Button
|
||||||
|
type="link"
|
||||||
onClick={(): void => {
|
onClick={(): void => {
|
||||||
window.electron.ipcRenderer.send(
|
window.electron.ipcRenderer.send(
|
||||||
ipcTypes.toMain.user.resetPassword,
|
ipcTypes.toMain.user.resetPassword,
|
||||||
@@ -77,15 +133,10 @@ const SignInForm: React.FC = () => {
|
|||||||
>
|
>
|
||||||
{t("auth.login.resetpassword")}
|
{t("auth.login.resetpassword")}
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
|
||||||
</Form.Item>
|
|
||||||
{error && (
|
|
||||||
<Form.Item label={null}>
|
|
||||||
<Alert message={error} type="error" />
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
</Form>
|
||||||
<Form.Item label={null}></Form.Item>
|
</Card>
|
||||||
</Form>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SignInForm;
|
export default SignInForm;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
"stopwatcher": "Stop Watcher\n"
|
"stopwatcher": "Stop Watcher\n"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"emsOutFilePath": "EMS Out File Path (Parts Order, etc.)",
|
||||||
"pollinginterval": "Polling Interval (ms)",
|
"pollinginterval": "Polling Interval (ms)",
|
||||||
"ppcfilepath": "Parts Price Change File Path",
|
"ppcfilepath": "Parts Price Change File Path",
|
||||||
"started": "Started",
|
"started": "Started",
|
||||||
@@ -36,6 +37,10 @@
|
|||||||
"watcherstatus": "Watcher Status"
|
"watcherstatus": "Watcher Status"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"title": {
|
||||||
|
"imex": "ImEX Online",
|
||||||
|
"rome": "Rome Online"
|
||||||
|
},
|
||||||
"updates": {
|
"updates": {
|
||||||
"apply": "Apply Update",
|
"apply": "Apply Update",
|
||||||
"available": "An update is available.",
|
"available": "An update is available.",
|
||||||
|
|||||||
@@ -237,6 +237,19 @@
|
|||||||
<folder_node>
|
<folder_node>
|
||||||
<name>labels</name>
|
<name>labels</name>
|
||||||
<children>
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>emsOutFilePath</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>pollinginterval</name>
|
<name>pollinginterval</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -345,6 +358,37 @@
|
|||||||
</folder_node>
|
</folder_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
|
<folder_node>
|
||||||
|
<name>title</name>
|
||||||
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>imex</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>rome</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
</children>
|
||||||
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
<name>updates</name>
|
<name>updates</name>
|
||||||
<children>
|
<children>
|
||||||
|
|||||||
Reference in New Issue
Block a user