Merge branch 'dev' into feature/profilePage
This commit is contained in:
commit
f8ab2f12be
11 changed files with 580 additions and 452 deletions
1
.github/workflows/pre-release.yml
vendored
1
.github/workflows/pre-release.yml
vendored
|
|
@ -38,6 +38,7 @@ jobs:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
draft: false
|
draft: false
|
||||||
generateReleaseNotes: true
|
generateReleaseNotes: true
|
||||||
|
prerelease: true
|
||||||
tag: v${{ steps.check-version.outputs.version }}
|
tag: v${{ steps.check-version.outputs.version }}
|
||||||
commit: main
|
commit: main
|
||||||
- name: Publish to PyPI
|
- name: Publish to PyPI
|
||||||
|
|
|
||||||
6
Makefile
6
Makefile
|
|
@ -41,10 +41,10 @@ run_frontend:
|
||||||
cd src/frontend && npm start
|
cd src/frontend && npm start
|
||||||
|
|
||||||
run_cli:
|
run_cli:
|
||||||
poetry run langflow --path src/frontend/build
|
poetry run langflow run --path src/frontend/build
|
||||||
|
|
||||||
run_cli_debug:
|
run_cli_debug:
|
||||||
poetry run langflow --path src/frontend/build --log-level debug
|
poetry run langflow run --path src/frontend/build --log-level debug
|
||||||
|
|
||||||
setup_devcontainer:
|
setup_devcontainer:
|
||||||
make init
|
make init
|
||||||
|
|
@ -69,7 +69,7 @@ backend:
|
||||||
build_and_run:
|
build_and_run:
|
||||||
echo 'Removing dist folder'
|
echo 'Removing dist folder'
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
make build && poetry run pip install dist/*.tar.gz && poetry run langflow
|
make build && poetry run pip install dist/*.tar.gz && poetry run langflow run
|
||||||
|
|
||||||
build_and_install:
|
build_and_install:
|
||||||
echo 'Removing dist folder'
|
echo 'Removing dist folder'
|
||||||
|
|
|
||||||
990
poetry.lock
generated
990
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -13,7 +13,6 @@ from langflow.api.v1.schemas import BuildStatus, BuiltResponse, InitResponse, St
|
||||||
|
|
||||||
from langflow.graph.graph.base import Graph
|
from langflow.graph.graph.base import Graph
|
||||||
from langflow.services.auth.utils import get_current_active_user, get_current_user
|
from langflow.services.auth.utils import get_current_active_user, get_current_user
|
||||||
from langflow.services.utils import get_session
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
from langflow.services.utils import get_chat_manager, get_session
|
from langflow.services.utils import get_chat_manager, get_session
|
||||||
from cachetools import LRUCache
|
from cachetools import LRUCache
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ export default function CodeTabsComponent({
|
||||||
key={idx} // Remember to add a unique key prop
|
key={idx} // Remember to add a unique key prop
|
||||||
>
|
>
|
||||||
{idx < 4 ? (
|
{idx < 4 ? (
|
||||||
<div className="w-full h-full flex flex-col">
|
<div className="flex h-full w-full flex-col">
|
||||||
{tab.description && (
|
{tab.description && (
|
||||||
<div
|
<div
|
||||||
className="mb-2 w-full text-left text-sm"
|
className="mb-2 w-full text-left text-sm"
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export default function Header(): JSX.Element {
|
||||||
const { notificationCenter } = useContext(alertContext);
|
const { notificationCenter } = useContext(alertContext);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { logout, autoLogin, isAdmin, userData } = useContext(AuthContext);
|
const { logout, autoLogin, isAdmin, userData } = useContext(AuthContext);
|
||||||
const { stars } = useContext(darkContext);
|
const { stars, gradientIndex } = useContext(darkContext);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -139,7 +139,7 @@ export default function Header(): JSX.Element {
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
"h-7 w-7 rounded-full focus-visible:outline-0 " +
|
"h-7 w-7 rounded-full focus-visible:outline-0 " +
|
||||||
(userData?.profile_image ?? gradients[parseInt(userData?.id ?? "", 30) % gradients.length])
|
(userData?.profile_image ?? gradients[gradientIndex])
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ const DialogOverlay = React.forwardRef<
|
||||||
<DialogPrimitive.Overlay
|
<DialogPrimitive.Overlay
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
"fixed top-0 right-0 left-0 bottom-0 overflow-auto inset-0 z-50 bg-blur-shared backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
"fixed inset-0 bottom-0 left-0 right-0 top-0 z-50 overflow-auto bg-blur-shared backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
@ -44,7 +44,7 @@ const DialogContent = React.forwardRef<
|
||||||
<DialogPrimitive.Content
|
<DialogPrimitive.Content
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
"noundo nocopy flex text-start overflow-auto z-50 justify-center items-left flex-col w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-bottom-[48%] data-[state=open]:slide-in-from-bottom-[48%] sm:rounded-lg md:w-full",
|
"noundo nocopy items-left z-50 flex w-full max-w-lg flex-col justify-center gap-4 overflow-auto border bg-background p-6 text-start shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-bottom-[48%] data-[state=open]:slide-in-from-bottom-[48%] sm:rounded-lg md:w-full",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ const initialValue = {
|
||||||
setDark: () => {},
|
setDark: () => {},
|
||||||
stars: 0,
|
stars: 0,
|
||||||
setStars: (stars) => 0,
|
setStars: (stars) => 0,
|
||||||
|
gradientIndex: 0,
|
||||||
|
setGradientIndex: () => 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const darkContext = createContext<darkContextType>(initialValue);
|
export const darkContext = createContext<darkContextType>(initialValue);
|
||||||
|
|
@ -16,6 +18,7 @@ export function DarkProvider({ children }) {
|
||||||
JSON.parse(window.localStorage.getItem("isDark")!) ?? false
|
JSON.parse(window.localStorage.getItem("isDark")!) ?? false
|
||||||
);
|
);
|
||||||
const [stars, setStars] = useState<number>(0);
|
const [stars, setStars] = useState<number>(0);
|
||||||
|
const [gradientIndex, setGradientIndex] = useState<number>(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchStars() {
|
async function fetchStars() {
|
||||||
|
|
@ -23,6 +26,9 @@ export function DarkProvider({ children }) {
|
||||||
setStars(starsCount);
|
setStars(starsCount);
|
||||||
}
|
}
|
||||||
fetchStars();
|
fetchStars();
|
||||||
|
const min = 0;
|
||||||
|
const max = 30;
|
||||||
|
setGradientIndex(Math.floor(Math.random() * (max - min + 1)) + min);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -41,6 +47,8 @@ export function DarkProvider({ children }) {
|
||||||
stars,
|
stars,
|
||||||
dark,
|
dark,
|
||||||
setDark,
|
setDark,
|
||||||
|
setGradientIndex,
|
||||||
|
gradientIndex,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,10 @@ function ApiInterceptor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await renewAccessToken(refreshToken);
|
const res = await renewAccessToken(refreshToken);
|
||||||
login(res?.data?.access_token, res?.data?.refresh_token);
|
if (res?.data?.access_token && res?.data?.refresh_token) {
|
||||||
|
login(res?.data?.access_token, res?.data?.refresh_token);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (error?.config?.headers) {
|
if (error?.config?.headers) {
|
||||||
delete error.config.headers["Authorization"];
|
delete error.config.headers["Authorization"];
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,9 @@ export async function autoLogin() {
|
||||||
|
|
||||||
export async function renewAccessToken(token: string) {
|
export async function renewAccessToken(token: string) {
|
||||||
try {
|
try {
|
||||||
return await api.post(`${BASE_URL_API}refresh?token=${token}`);
|
if (token) {
|
||||||
|
return await api.post(`${BASE_URL_API}refresh?token=${token}`);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error:", error);
|
console.log("Error:", error);
|
||||||
throw error;
|
throw error;
|
||||||
|
|
@ -473,7 +475,10 @@ export async function updateUser(user_id: string, user: changeUser) {
|
||||||
|
|
||||||
export async function resetPassword(user_id: string, user: resetPasswordType) {
|
export async function resetPassword(user_id: string, user: resetPasswordType) {
|
||||||
try {
|
try {
|
||||||
const res = await api.patch(`${BASE_URL_API}users/${user_id}/reset-password`, user);
|
const res = await api.patch(
|
||||||
|
`${BASE_URL_API}users/${user_id}/reset-password`,
|
||||||
|
user
|
||||||
|
);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,8 @@ export type darkContextType = {
|
||||||
setDark: (newState: {}) => void;
|
setDark: (newState: {}) => void;
|
||||||
stars: number;
|
stars: number;
|
||||||
setStars: (stars: number) => void;
|
setStars: (stars: number) => void;
|
||||||
|
gradientIndex: number;
|
||||||
|
setGradientIndex: (index: number) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type locationContextType = {
|
export type locationContextType = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue