Minor UI fixes & CI.

This commit is contained in:
Patrick Fic
2025-04-01 13:08:31 -07:00
parent 88dd8adfa5
commit 6b82d443eb
4 changed files with 98 additions and 75 deletions

View File

@@ -5,6 +5,16 @@ jobs:
partner-win-build: partner-win-build:
executor: executor:
name: win/default name: win/default
parameters:
tenantID:
type: string
default: $AZURE_TENANT_ID
clientID:
type: string
default: $AZURE_CLIENT_ID
clientSecret:
type: string
default: $AZURE_CLIENT_SECRET
steps: steps:
- checkout - checkout
- run: - run:
@@ -23,13 +33,13 @@ jobs:
- run: - run:
name: Build Electron App for Windows name: Build Electron App for Windows
# environment: environment:
# AZURE_TENANT_ID: <<>> AZURE_TENANT_ID: << parameters.tenantID >>
# AZURE_CLIENT_ID: <<>> AZURE_CLIENT_ID: << parameters.clientID >>
# AZURE_CLIENT_SECRET: <<>> AZURE_CLIENT_SECRET: << parameters.clientSecret >>
command: npm run build:win command: npm run build:win
- store_artifacts: # - store_artifacts:
path: .\dist # path: .\dist
workflows: workflows:
deploy_and_build: deploy_and_build:

View File

@@ -1,7 +1,5 @@
import { selectWatcherStatus } from "@renderer/redux/app.slice";
import { useAppSelector } from "@renderer/redux/reduxHooks";
import { auth } from "@renderer/util/firebase"; import { auth } from "@renderer/util/firebase";
import { Badge, Layout, Menu } from "antd"; import { Layout, Menu } from "antd";
import { MenuItemType } from "antd/es/menu/interface"; import { MenuItemType } from "antd/es/menu/interface";
import { signOut } from "firebase/auth"; import { signOut } from "firebase/auth";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@@ -9,7 +7,7 @@ import { NavLink } from "react-router";
const NavigationHeader: React.FC = () => { const NavigationHeader: React.FC = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const isWatcherStarted = useAppSelector(selectWatcherStatus); //const isWatcherStarted = useAppSelector(selectWatcherStatus);
const menuItems: MenuItemType[] = [ const menuItems: MenuItemType[] = [
{ label: <NavLink to="/">{t("navigation.home")}</NavLink>, key: "home" }, { label: <NavLink to="/">{t("navigation.home")}</NavLink>, key: "home" },
{ {
@@ -19,30 +17,26 @@ const NavigationHeader: React.FC = () => {
signOut(auth); signOut(auth);
}, },
}, },
// {
// label: <NavLink to="/settings">{t("navigation.settings")}</NavLink>,
// key: "settings",
// },
]; ];
return ( return (
<Badge.Ribbon // <Badge.Ribbon
text={ // text={
isWatcherStarted // isWatcherStarted
? t("settings.labels.started") // ? t("settings.labels.started")
: t("settings.labels.stopped") // : t("settings.labels.stopped")
} // }
color={isWatcherStarted ? "green" : "red"} // color={isWatcherStarted ? "green" : "red"}
> // >
<Layout.Header style={{ display: "flex", alignItems: "center" }}> <Layout.Header style={{ display: "flex", alignItems: "center" }}>
<Menu <Menu
theme="dark" theme="dark"
mode="horizontal" mode="horizontal"
defaultSelectedKeys={["2"]} defaultSelectedKeys={["2"]}
items={menuItems} items={menuItems}
style={{ flex: 1, minWidth: 0 }} style={{ flex: 1, minWidth: 0 }}
/> />
</Layout.Header> </Layout.Header>
</Badge.Ribbon> // </Badge.Ribbon>
); );
}; };

View File

@@ -1,16 +1,23 @@
import { import { CheckCircleFilled, ExclamationCircleFilled } from "@ant-design/icons";
CheckCircleOutlined,
ExclamationCircleOutlined,
} from "@ant-design/icons";
import { import {
selectWatcherError, selectWatcherError,
selectWatcherStatus, selectWatcherStatus,
} from "@renderer/redux/app.slice"; } from "@renderer/redux/app.slice";
import { useAppSelector } from "@renderer/redux/reduxHooks"; import { useAppSelector } from "@renderer/redux/reduxHooks";
import { Alert, Button, Card, InputNumber, Space, Switch } from "antd"; import {
Alert,
Badge,
Button,
Card,
Col,
InputNumber,
Row,
Space,
Switch,
} from "antd";
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";
import { useEffect, useState } from "react";
const SettingsWatcher: React.FC = () => { const SettingsWatcher: React.FC = () => {
const { t } = useTranslation(); const { t } = useTranslation();
@@ -72,47 +79,59 @@ const SettingsWatcher: React.FC = () => {
}; };
return ( return (
<Card title={t("settings.labels.watcherstatus")}> <Badge.Ribbon
<Space wrap> text={
{isWatcherStarted ? ( isWatcherStarted ? (
<Button onClick={handleStop}>
{t("settings.actions.stopwatcher")}
</Button>
) : (
<Button onClick={handleStart}>
{t("settings.actions.startwatcher")}
</Button>
)}
{isWatcherStarted ? (
<Space> <Space>
<CheckCircleOutlined style={{ color: "green" }} /> <CheckCircleFilled />
{t("settings.labels.started")} {t("settings.labels.started")}
</Space> </Space>
) : ( ) : (
<Space> <Space>
<ExclamationCircleOutlined style={{ color: "tomato" }} /> <ExclamationCircleFilled />
{t("settings.labels.stopped")} {t("settings.labels.stopped")}
</Space> </Space>
)} )
<Switch }
checked={!pollingState.enabled} color={isWatcherStarted ? "green" : "red"}
onChange={toggleWatcherMode} >
checkedChildren={t("settings.labels.watchermoderealtime")} <Card title={t("settings.labels.watcherstatus")}>
unCheckedChildren={t("settings.labels.watchermodepolling")} <Row>
/> <Col span={12}>
<Space size="small" wrap> {isWatcherStarted ? (
<span>{t("settings.labels.pollinginterval")}</span> <Button onClick={handleStop}>
<InputNumber {t("settings.actions.stopwatcher")}
title={t("settings.labels.pollinginterval")} </Button>
disabled={!pollingState.enabled} ) : (
min={1000} <Button onClick={handleStart}>
value={pollingState.interval} {t("settings.actions.startwatcher")}
onChange={handlePollingIntervalChange} </Button>
/> )}
</Space> </Col>
{watcherError && <Alert message={watcherError} />} <Col span={12}>
</Space> <Space direction="vertical" wrap>
</Card> <Switch
checked={!pollingState.enabled}
onChange={toggleWatcherMode}
checkedChildren={t("settings.labels.watchermoderealtime")}
unCheckedChildren={t("settings.labels.watchermodepolling")}
/>
<Space size="small" wrap>
<span>{t("settings.labels.pollinginterval")}</span>
<InputNumber
title={t("settings.labels.pollinginterval")}
disabled={!pollingState.enabled}
min={1000}
value={pollingState.interval}
onChange={handlePollingIntervalChange}
/>
</Space>
{watcherError && <Alert message={watcherError} />}
</Space>
</Col>
</Row>
</Card>
</Badge.Ribbon>
); );
}; };
export default SettingsWatcher; export default SettingsWatcher;

View File

@@ -5,14 +5,14 @@ import Welcome from "../Welcome/Welcome";
const Settings: React.FC = () => { const Settings: React.FC = () => {
return ( return (
<Row gutter={[32, 32]}> <Row gutter={[16, 16]}>
<Col span={24}> <Col span={24}>
<Welcome /> <Welcome />
</Col> </Col>
<Col span={24}> <Col span={12}>
<SettingsWatchedPaths /> <SettingsWatchedPaths />
</Col> </Col>
<Col span={24}> <Col span={12}>
<SettingsWatcher /> <SettingsWatcher />
</Col> </Col>
</Row> </Row>