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 (
+
+
+ );
+};
diff --git a/frontend/src/Pages/index.tsx b/frontend/src/Pages/index.tsx
index 56000d6..9030121 100644
--- a/frontend/src/Pages/index.tsx
+++ b/frontend/src/Pages/index.tsx
@@ -7,6 +7,11 @@ import {
Home20Regular, Info20Regular, Settings20Regular, Storage20Regular
} from '@fluentui/react-icons';
import {Home} from './Home';
+import {Chat} from './Chat';
+import {Models} from './Models';
+import {Train} from './Train';
+import {Settings} from './Settings';
+import {About} from './About';
type NavigationItem = {
label: string;
@@ -28,7 +33,7 @@ export const pages: NavigationItem[] = [
label: "Chat",
path: "/chat",
icon:,
- element: ,
+ element: ,
top:true
},
{
@@ -42,28 +47,28 @@ export const pages: NavigationItem[] = [
label: "Models",
path: "/models",
icon:,
- element: ,
+ element: ,
top:true
},
{
label: "Train",
path: "/train",
icon:,
- element: ,
+ element: ,
top:true
},
{
label: "Settings",
path: "/settings",
icon:,
- element: ,
+ element: ,
top:false
},
{
label: "About",
path: "/about",
icon:,
- element: ,
+ element: ,
top:false
}
];
diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/backend_golang/App.d.ts
similarity index 67%
rename from frontend/wailsjs/go/main/App.d.ts
rename to frontend/wailsjs/go/backend_golang/App.d.ts
index 02a3bb9..dbdfe76 100644
--- a/frontend/wailsjs/go/main/App.d.ts
+++ b/frontend/wailsjs/go/backend_golang/App.d.ts
@@ -1,4 +1,4 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
-export function Greet(arg1:string):Promise;
+export function SaveConfig(arg1:any):Promise;
diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/backend_golang/App.js
similarity index 55%
rename from frontend/wailsjs/go/main/App.js
rename to frontend/wailsjs/go/backend_golang/App.js
index c71ae77..5566d48 100644
--- a/frontend/wailsjs/go/main/App.js
+++ b/frontend/wailsjs/go/backend_golang/App.js
@@ -2,6 +2,6 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
-export function Greet(arg1) {
- return window['go']['main']['App']['Greet'](arg1);
+export function SaveConfig(arg1) {
+ return window['go']['backend_golang']['App']['SaveConfig'](arg1);
}
diff --git a/main.go b/main.go
index b3df244..3906e26 100644
--- a/main.go
+++ b/main.go
@@ -3,6 +3,8 @@ package main
import (
"embed"
+ backend "rwkv-runner/backend-golang"
+
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
@@ -13,7 +15,7 @@ var assets embed.FS
func main() {
// Create an instance of the app structure
- app := NewApp()
+ app := backend.NewApp()
// Create application with options
err := wails.Run(&options.App{
@@ -25,7 +27,7 @@ func main() {
AssetServer: &assetserver.Options{
Assets: assets,
},
- OnStartup: app.startup,
+ OnStartup: app.OnStartup,
Bind: []interface{}{
app,
},