config page
This commit is contained in:
parent
315c9acbe5
commit
593fc2e669
6 changed files with 56 additions and 9 deletions
|
|
@ -120,8 +120,9 @@ class ViewHistoryAction : AnAction() {
|
|||
class OpenConfigAction : AnAction() {
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
val continuePluginService = getContinuePluginService(e.project) ?: return
|
||||
val params = mapOf("profileId" to null)
|
||||
continuePluginService.coreMessenger?.request("config/openProfile", params, null) { _ -> }
|
||||
continuePluginService.continuePluginWindow?.content?.components?.get(0)?.requestFocus()
|
||||
val params = mapOf("path" to "/config", "toggle" to true)
|
||||
continuePluginService.sendToWebview("navigateTo", params)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,12 +132,12 @@
|
|||
<override-text place="GoToAction" text="View History"/>
|
||||
</action>
|
||||
|
||||
<action id="continue.openConfig"
|
||||
<action id="continue.openConfigPage"
|
||||
class="com.github.continuedev.continueintellijextension.actions.OpenConfigAction"
|
||||
icon="AllIcons.General.GearPlain"
|
||||
text="Open Continue Config"
|
||||
description="Open Continue Config">
|
||||
<override-text place="GoToAction" text="Open Continue Config"/>
|
||||
text="Continue Config"
|
||||
description="Continue Config">
|
||||
<override-text place="GoToAction" text="Continue Config"/>
|
||||
</action>
|
||||
|
||||
<action id="continue.openAccountDialog"
|
||||
|
|
@ -159,7 +159,7 @@
|
|||
<group id="ContinueSidebarActionsGroup">
|
||||
<reference ref="continue.newContinueSession"/>
|
||||
<reference ref="continue.viewHistory"/>
|
||||
<reference ref="continue.openConfig"/>
|
||||
<reference ref="continue.openConfigPage"/>
|
||||
<reference ref="continue.openAccountDialog"/>
|
||||
<reference ref="continue.openMorePage"/>
|
||||
</group>
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@
|
|||
"group": "Continue"
|
||||
},
|
||||
{
|
||||
"command": "continue.openConfig",
|
||||
"command": "continue.openConfigPage",
|
||||
"category": "Continue",
|
||||
"title": "Open Continue Config",
|
||||
"icon": "$(gear)",
|
||||
|
|
@ -522,7 +522,7 @@
|
|||
"when": "view == continue.continueGUIView"
|
||||
},
|
||||
{
|
||||
"command": "continue.openConfig",
|
||||
"command": "continue.openConfigPage",
|
||||
"group": "navigation@4",
|
||||
"when": "view == continue.continueGUIView"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import MorePage from "./pages/More";
|
|||
import Stats from "./pages/stats";
|
||||
import { ROUTES } from "./util/navigation";
|
||||
import { SubmenuContextProvidersProvider } from "./context/SubmenuContextProviders";
|
||||
import ConfigPage from "./pages/config";
|
||||
|
||||
const router = createMemoryRouter([
|
||||
{
|
||||
|
|
@ -52,6 +53,10 @@ const router = createMemoryRouter([
|
|||
path: ROUTES.CONFIG_ERROR,
|
||||
element: <ConfigErrorPage />,
|
||||
},
|
||||
{
|
||||
path: ROUTES.CONFIG,
|
||||
element: <ConfigPage />,
|
||||
},
|
||||
{
|
||||
path: "/migration",
|
||||
element: <MigrationPage />,
|
||||
|
|
|
|||
40
gui/src/pages/config/index.tsx
Normal file
40
gui/src/pages/config/index.tsx
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { useContext } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useNavigationListener } from "../../hooks/useNavigationListener";
|
||||
import PageHeader from "../../components/PageHeader";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { SharedConfigSchema } from "core/config/sharedConfig";
|
||||
import { Switch } from "@headlessui/react";
|
||||
import { updateConfig } from "../../redux/slices/configSlice";
|
||||
|
||||
function ConfigPage() {
|
||||
useNavigationListener();
|
||||
const dispatch = useAppDispatch();
|
||||
const navigate = useNavigate();
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
|
||||
const config = useAppSelector((state) => state.config.config);
|
||||
|
||||
function handleUpdateSharedConfig(sharedConfig: Partial<SharedConfigSchema>) {
|
||||
ideMessenger.post("config/updateSharedConfig", sharedConfig);
|
||||
|
||||
// TODO: Optimistic update in redux
|
||||
// dispatch(updateConfig({
|
||||
// ...config,
|
||||
// ...(sharedConfig.)
|
||||
// }))
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="overflow-y-scroll">
|
||||
<PageHeader onClick={() => navigate("/")} title="Chat" />
|
||||
|
||||
<div className="flex flex-col gap-2 overflow-y-scroll px-3">
|
||||
<Switch checked={true}>Hello</Switch>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ConfigPage;
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
export const ROUTES = {
|
||||
HOME: "/",
|
||||
CONFIG_ERROR: "/config-error",
|
||||
CONFIG: "/config",
|
||||
MORE: "/more",
|
||||
// EXAMPLE_ROUTE_WITH_PARAMS: (params: ParamsType) => `/route/${params}`,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue