diff --git a/app.go b/backend-golang/app.go similarity index 57% rename from app.go rename to backend-golang/app.go index af53038..855f0dc 100644 --- a/app.go +++ b/backend-golang/app.go @@ -1,8 +1,7 @@ -package main +package backend_golang import ( "context" - "fmt" ) // App struct @@ -17,11 +16,6 @@ func NewApp() *App { // startup is called when the app starts. The context is saved // so we can call the runtime methods -func (a *App) startup(ctx context.Context) { +func (a *App) OnStartup(ctx context.Context) { a.ctx = ctx } - -// Greet returns a greeting for the given name -func (a *App) Greet(name string) string { - return fmt.Sprintf("Hello %s, It's show time!", name) -} diff --git a/backend-golang/config.go b/backend-golang/config.go new file mode 100644 index 0000000..86c3f8b --- /dev/null +++ b/backend-golang/config.go @@ -0,0 +1,18 @@ +package backend_golang + +import ( + "encoding/json" + "os" +) + +func (a *App) SaveConfig(config interface{}) string { + jsonData, err := json.MarshalIndent(config, "", " ") + if err != nil { + return err.Error() + } + + if err := os.WriteFile("config.json", jsonData, 0644); err != nil { + return err.Error() + } + return "" +} diff --git a/frontend/src/Pages/About.tsx b/frontend/src/Pages/About.tsx new file mode 100644 index 0000000..adf2eae --- /dev/null +++ b/frontend/src/Pages/About.tsx @@ -0,0 +1,10 @@ +import React, {FC} from 'react'; +import {Text} from '@fluentui/react-components'; + +export const About: FC = () => { + return ( +
+ In Development +
+ ); +}; diff --git a/frontend/src/Pages/Chat.tsx b/frontend/src/Pages/Chat.tsx new file mode 100644 index 0000000..fad2bfc --- /dev/null +++ b/frontend/src/Pages/Chat.tsx @@ -0,0 +1,10 @@ +import React, {FC} from 'react'; +import {Text} from '@fluentui/react-components'; + +export const Chat: FC = () => { + return ( +
+ In Development +
+ ); +}; diff --git a/frontend/src/Pages/Configs.tsx b/frontend/src/Pages/Configs.tsx index 864fb3b..6f34b28 100644 --- a/frontend/src/Pages/Configs.tsx +++ b/frontend/src/Pages/Configs.tsx @@ -1,20 +1,271 @@ -import {Checkbox, Input, Text} from '@fluentui/react-components'; -import { FC } from "react"; -import { Section } from "./Section"; +import { + Avatar, + Button, + createTableColumn, + Dropdown, + Input, + PresenceBadgeStatus, + Select, + Slider, + Switch, + TableCellLayout, + TableColumnDefinition, + Text, + Tooltip +} from '@fluentui/react-components'; +import { + AddCircle20Regular, + Delete20Regular, + DocumentPdfRegular, + DocumentRegular, + EditRegular, + FolderRegular, + OpenRegular, + PeopleRegular, + Save20Regular, + VideoRegular +} from '@fluentui/react-icons'; +import React, {FC} from 'react'; +import {Section} from './components/Section'; +import {Labeled} from './components/Labeled'; +import {ToolTipButton} from './components/ToolTipButton'; + +type FileCell = { + label: string; + icon: JSX.Element; +}; + +type LastUpdatedCell = { + label: string; + timestamp: number; +}; + +type LastUpdateCell = { + label: string; + icon: JSX.Element; +}; + +type AuthorCell = { + label: string; + status: PresenceBadgeStatus; +}; + +type Item = { + file: FileCell; + author: AuthorCell; + lastUpdated: LastUpdatedCell; + lastUpdate: LastUpdateCell; +}; + +const items: Item[] = [ + { + file: {label: 'Meeting notes', icon: }, + author: {label: 'Max Mustermann', status: 'available'}, + lastUpdated: {label: '7h ago', timestamp: 1}, + lastUpdate: { + label: 'You edited this', + icon: + } + }, + { + file: {label: 'Thursday presentation', icon: }, + author: {label: 'Erika Mustermann', status: 'busy'}, + lastUpdated: {label: 'Yesterday at 1:45 PM', timestamp: 2}, + lastUpdate: { + label: 'You recently opened this', + icon: + } + }, + { + file: {label: 'Training recording', icon: }, + author: {label: 'John Doe', status: 'away'}, + lastUpdated: {label: 'Yesterday at 1:45 PM', timestamp: 2}, + lastUpdate: { + label: 'You recently opened this', + icon: + } + }, + { + file: {label: 'Purchase order', icon: }, + author: {label: 'Jane Doe', status: 'offline'}, + lastUpdated: {label: 'Tue at 9:30 AM', timestamp: 3}, + lastUpdate: { + label: 'You shared this in a Teams chat', + icon: + } + } +]; + +const columns: TableColumnDefinition[] = [ + createTableColumn({ + columnId: 'file', + compare: (a, b) => { + return a.file.label.localeCompare(b.file.label); + }, + renderHeaderCell: () => { + return 'File'; + }, + renderCell: (item) => { + return ( + + {item.file.label} + + ); + } + }), + createTableColumn({ + columnId: 'author', + compare: (a, b) => { + return a.author.label.localeCompare(b.author.label); + }, + renderHeaderCell: () => { + return 'Author'; + }, + renderCell: (item) => { + return ( + + } + > + {item.author.label} + + ); + } + }), + createTableColumn({ + columnId: 'lastUpdated', + compare: (a, b) => { + return a.lastUpdated.timestamp - b.lastUpdated.timestamp; + }, + renderHeaderCell: () => { + return 'Last updated'; + }, + + renderCell: (item) => { + return item.lastUpdated.label; + } + }), + createTableColumn({ + columnId: 'lastUpdate', + compare: (a, b) => { + return a.lastUpdate.label.localeCompare(b.lastUpdate.label); + }, + renderHeaderCell: () => { + return 'Last update'; + }, + renderCell: (item) => { + return ( + + {item.lastUpdate.label} + + ); + } + }) +]; + +// +// > +// {({ item, rowId }) => ( +// key={rowId}> +// {({ renderCell }) => ( +// {renderCell(item)} +// )} +// +// )} +// +// export const Configs: FC = () => { - return ( -
- Configs -
- - -
- } - /> - - ); + return ( +
+ Configs +
+ + }/> + }/> + }/> +
+ } + /> +
+
+ + }/> + + + 1000 +
+ }/> + +
+ + }/> + + }/> +
+
+ + }/> + + }/> +
+ + } + /> +
+
+ + + + + }/> + + + + + + }/> +
+
+ + }/> + + }/> +
+ + } + /> +
+ +
+ + ); }; diff --git a/frontend/src/Pages/Home.tsx b/frontend/src/Pages/Home.tsx index 91c2fcf..7dc81a9 100644 --- a/frontend/src/Pages/Home.tsx +++ b/frontend/src/Pages/Home.tsx @@ -1,4 +1,4 @@ -import {Combobox, CompoundButton, Link, Option, Text} from '@fluentui/react-components'; +import {Button, CompoundButton, Dropdown, Link, Option, Text} from '@fluentui/react-components'; import React, {FC, ReactElement} from 'react'; import Banner from '../assets/images/banner.jpg'; import { @@ -8,6 +8,7 @@ import { Storage20Regular } from '@fluentui/react-icons'; import {useNavigate} from 'react-router'; +import {SaveConfig} from '../../wailsjs/go/backend_golang/App'; type NavCard = { label: string; @@ -81,7 +82,7 @@ export const Home: FC = () => { Help
- { if (data.optionValue) @@ -99,8 +100,8 @@ export const Home: FC = () => { - - Run + +
diff --git a/frontend/src/Pages/Models.tsx b/frontend/src/Pages/Models.tsx new file mode 100644 index 0000000..550a2b2 --- /dev/null +++ b/frontend/src/Pages/Models.tsx @@ -0,0 +1,10 @@ +import React, {FC} from 'react'; +import {Text} from '@fluentui/react-components'; + +export const Models: FC = () => { + return ( +
+ In Development +
+ ); +}; diff --git a/frontend/src/Pages/Section.tsx b/frontend/src/Pages/Section.tsx deleted file mode 100644 index c0605af..0000000 --- a/frontend/src/Pages/Section.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { FC, ReactElement } from "react"; -import { SectionTitle } from "./SectionTitle"; - -export const Section: FC<{ title: string; content: ReactElement }> = ({ title, content }) => { - return ( -
- - {content} -
- ); -}; diff --git a/frontend/src/Pages/SectionTitle.tsx b/frontend/src/Pages/SectionTitle.tsx deleted file mode 100644 index 2f075d9..0000000 --- a/frontend/src/Pages/SectionTitle.tsx +++ /dev/null @@ -1,4 +0,0 @@ -import { Text } from "@fluentui/react-components"; -import { FC } from "react"; - -export const SectionTitle: FC<{ label: string }> = ({ label }) => {label}; diff --git a/frontend/src/Pages/Settings.tsx b/frontend/src/Pages/Settings.tsx new file mode 100644 index 0000000..e3e4709 --- /dev/null +++ b/frontend/src/Pages/Settings.tsx @@ -0,0 +1,10 @@ +import React, {FC} from 'react'; +import {Text} from '@fluentui/react-components'; + +export const Settings: FC = () => { + return ( +
+ In Development +
+ ); +}; diff --git a/frontend/src/Pages/Train.tsx b/frontend/src/Pages/Train.tsx new file mode 100644 index 0000000..6eec528 --- /dev/null +++ b/frontend/src/Pages/Train.tsx @@ -0,0 +1,10 @@ +import React, {FC} from 'react'; +import {Text} from '@fluentui/react-components'; + +export const Train: FC = () => { + return ( +
+ In Development +
+ ); +}; diff --git a/frontend/src/Pages/components/Labeled.tsx b/frontend/src/Pages/components/Labeled.tsx new file mode 100644 index 0000000..ab60b4b --- /dev/null +++ b/frontend/src/Pages/components/Labeled.tsx @@ -0,0 +1,16 @@ +import {FC, ReactElement} from 'react'; +import {Label, Tooltip} from '@fluentui/react-components'; + +export const Labeled: FC<{ label: string; desc?: string, content: ReactElement }> = ({label, desc, content}) => { + return ( +
+ {desc ? + + + : + + } + {content} +
+ ); +}; diff --git a/frontend/src/Pages/components/Section.tsx b/frontend/src/Pages/components/Section.tsx new file mode 100644 index 0000000..c14a598 --- /dev/null +++ b/frontend/src/Pages/components/Section.tsx @@ -0,0 +1,14 @@ +import {FC, ReactElement} from 'react'; +import {Text} from '@fluentui/react-components'; + +export const Section: FC<{ title: string; desc?: string, content: ReactElement }> = ({title, desc, content}) => { + return ( +
+
+ {title} + {desc && {desc}} +
+ {content} +
+ ); +}; diff --git a/frontend/src/Pages/components/ToolTipButton.tsx b/frontend/src/Pages/components/ToolTipButton.tsx new file mode 100644 index 0000000..b977e06 --- /dev/null +++ b/frontend/src/Pages/components/ToolTipButton.tsx @@ -0,0 +1,10 @@ +import React, {FC, ReactElement} from 'react'; +import {Button, Tooltip} from '@fluentui/react-components'; + +export const ToolTipButton: FC<{ desc: string, icon: ReactElement }> = ({desc, icon}) => { + return ( + +