Skip to content

Commit

Permalink
Merge pull request CloudOrc#260 from dlimeng/dev-python
Browse files Browse the repository at this point in the history
Dev python
  • Loading branch information
dlimeng authored Dec 30, 2023
2 parents 14b84c1 + 52c473c commit 9a506d5
Show file tree
Hide file tree
Showing 18 changed files with 700 additions and 319 deletions.
2 changes: 1 addition & 1 deletion solidui-web/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

# URL of the backend service of solidui-views
# URL of the backend service of solidui-entrance
solidui_url="http://127.0.0.1:12345"
solidui_url_models="http://127.0.0.1:5110"
solidui_url_kernel="http://127.0.0.1:5010"
Expand Down
6 changes: 5 additions & 1 deletion solidui-web/config/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@ module.exports = merge(baseConfig, {
proxy: {
'/solidui/models/generate': {
target: `${process.env.PROXY_SERVER}:5110`,
changeOrigin: true,
// target: `http://localhost:5110`,
changeOrigin: true,
pathRewrite: {}
},
'/solidui/kernel/restart': {
target: `${process.env.PROXY_SERVER}:5010`,
// target: `http://localhost:5010`,
changeOrigin: true,
pathRewrite: {}
},
'/solidui/models/api/api': {
target: `${process.env.PROXY_SERVER}:5110`,
// target: `http://localhost:5110`,
changeOrigin: true,
pathRewrite: {}
},
'/solidui': {
target: `${process.env.PROXY_SERVER}:80`,
// target: `${process.env.PROXY_SERVER}`,
changeOrigin: true,
pathRewrite: {}
}
Expand Down
2 changes: 1 addition & 1 deletion solidui-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SolidUI",
"version": "0.4.0",
"version": "0.5.0",
"main": "index.js",
"repository": "[email protected]:CloudOrc/SolidUI.git",
"author": "solidui",
Expand Down
95 changes: 0 additions & 95 deletions solidui-web/pom.xml

This file was deleted.

14 changes: 14 additions & 0 deletions solidui-web/src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,27 @@ const modelui = {
kernel_restart: () => ApiService.post(`/solidui/kernel/restart`),
};

const modelType = {
query: <T>(params: any) =>
ApiService.get<T>("/solidui/models/model_types", params),
delete: <T>(id: string | number) =>
ApiService.delete<T>(`/solidui/models/model_types/${id}`),
update: <T>(data: any) =>
ApiService.put<T>("/solidui/models/model_types", data),
queryById: <T>(id: string | number) =>
ApiService.get<T>(`/solidui/models/model_types/${id}`),
create: <T>(data: any) =>
ApiService.post<T>("/solidui/models/model_types", data),
};

const Apis = {
model,
images,
user,
project,
datasource,
modelui,
modelType,
};

export default Apis;
3 changes: 2 additions & 1 deletion solidui-web/src/layouts/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import React, { useState, useEffect } from "react";
import { Outlet, useNavigate, useLocation } from "react-router-dom";
import { useCookie } from "react-use";
import type { MenuProps } from "antd";
import { DesktopOutlined, PieChartOutlined } from "@ant-design/icons";
import { DesktopOutlined, PieChartOutlined,KeyOutlined } from "@ant-design/icons";
import { Menu, Dropdown, Avatar } from "antd";
import Apis from "@/apis";
import "./DefaultLayout.less";
Expand All @@ -45,6 +45,7 @@ function getItem(
const items: MenuItem[] = [
getItem("Project", "/project", <PieChartOutlined rev={1} />),
getItem("Datasource", "/datasource", <DesktopOutlined rev={1} />),
getItem("KeysManager", "/key", <KeyOutlined rev={1} />),
];

export default function DefaultLayout() {
Expand Down
96 changes: 24 additions & 72 deletions solidui-web/src/pages/Designer/Properties/PagePropertiesPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@
*/

import React from "react";
import { LeftOutlined, RightOutlined } from "@ant-design/icons";
import usePageProperties from "./usePageProperties";
import PagePagePropertiesPanel from "./page/PagePagePropertiesPanel";
import PageModeluiPropertiesPanel from "./page/PageModeluiDialogPanel";
import {LeftExpand, RightExpand} from "@icon-park/react";

export default function PagePropertiesPanel() {
const { currentTabKey, mainRef, renderTabs, modelOpen, setModelOpen } = usePageProperties({
const {
currentTabKey,
mainRef,
renderTabs,
modelStatus,
onClosePanel,
onOpenPanel,
} = usePageProperties({
tabs: [
{
key: "Page",
Expand All @@ -35,8 +42,6 @@ export default function PagePropertiesPanel() {
],
});

const [modelWidth, setModelWidth] = React.useState<number>(326);

function renderPanel() {
if (currentTabKey === "Page") {
return <PagePagePropertiesPanel />;
Expand All @@ -46,95 +51,42 @@ export default function PagePropertiesPanel() {
}
return undefined;
}

function handleChangeOpen(type: string) {
const dom: any = document.getElementById("section-properties");
const DbConfig: any = document.getElementById("db-config");
const asideEastContainer: any = document.getElementById(
"aside-east__container",
);
if (type === "close") {
setModelWidth(dom.offsetWidth);
dom.style.width = 0;
setModelOpen(false);
if (DbConfig) {
DbConfig.style.display = "none";
}

} else {
dom.style.width = modelWidth + "px";
setModelOpen(true);
if (DbConfig) {
DbConfig.style.display = "block";
}

}
}

const modelOpen = modelStatus === "display";
return (
<>
<header className="conf-header">{renderTabs()}</header>
<main className="conf-main" ref={mainRef}>
{renderPanel()}
</main>
{modelOpen && currentTabKey === "Modelui" ? (
{currentTabKey === "Modelui" && (
<div
className="expand"
style={{
position: "absolute",
left: 0,
left: modelOpen ? 0 : -20,
top: 0,
zIndex: 99,
display: "flex",
alignItems: "center",
height: "100%",
}}
>
<LeftExpand
theme="outline"
size="20"
fill="#757272"
strokeWidth={2}
strokeLinejoin="miter"
strokeLinecap="square"
style={{
cursor: "pointer",
}}
onClick={() => {
handleChangeOpen("close");
}}
/>
</div>
) : (
currentTabKey === "Modelui" && (
<div
className="expand"
style={{
position: "absolute",
left: -20,
top: 0,
zIndex: 99,
display: "flex",
alignItems: "center",
height: "100%",
}}
>
<RightExpand
theme="outline"
size="20"
fill="#757272"
strokeWidth={2}
strokeLinejoin="miter"
strokeLinecap="square"
style={{
cursor: "pointer",
{modelOpen ? (
<RightOutlined
rev={1}
onClick={() => {
onClosePanel();
}}
/>
) : (
<LeftOutlined
rev={1}
onClick={() => {
handleChangeOpen("open");
onOpenPanel("large");
}}
/>
</div>
)
)}
</div>
)}
</>
);
Expand Down
Loading

0 comments on commit 9a506d5

Please sign in to comment.