mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-30 14:24:27 +02:00
disabled beta check for now
This commit is contained in:
parent
fd8c568d75
commit
d027352d79
@ -44,12 +44,11 @@ export const toggleBetaConfig = async (branch: string) => {
|
|||||||
const response = await fetch(`${API_URL}/app_config`, {
|
const response = await fetch(`${API_URL}/app_config`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
'update_branch': branch
|
update_branch: branch,
|
||||||
})
|
}),
|
||||||
|
|
||||||
});
|
});
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
return data;
|
return data;
|
||||||
|
@ -1,70 +1,66 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from "react";
|
||||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
KEY_CONFIG, getConfig,
|
KEY_CONFIG,
|
||||||
KEY_TOGGLE_CONFIG, toggleBetaConfig
|
getConfig,
|
||||||
} from '../../../api';
|
KEY_TOGGLE_CONFIG,
|
||||||
|
toggleBetaConfig,
|
||||||
|
} from "../../../api";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function BetaMode() {
|
export default function BetaMode() {
|
||||||
|
|
||||||
// gate for the toggle
|
// gate for the toggle
|
||||||
const [shouldSetCofig, setShouldSetConfig] = useState(false);
|
const [shouldSetCofig, setShouldSetConfig] = useState(false);
|
||||||
// next branch to get
|
// next branch to get
|
||||||
const [branchToGetNext, setBranchToGetNext] = useState("beta");
|
const [branchToGetNext, setBranchToGetNext] = useState("beta");
|
||||||
|
|
||||||
// our basic config
|
// our basic config
|
||||||
const { status: configStatus, data: configData } = useQuery([KEY_CONFIG], getConfig);
|
const { status: configStatus, data: configData } = useQuery(
|
||||||
const queryClient = useQueryClient()
|
[KEY_CONFIG],
|
||||||
|
getConfig
|
||||||
|
);
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
// the toggle config
|
// the toggle config
|
||||||
const { status: toggleStatus, data: toggleData } = useQuery([KEY_TOGGLE_CONFIG], () => toggleBetaConfig(branchToGetNext), {
|
const { status: toggleStatus, data: toggleData } = useQuery(
|
||||||
|
[KEY_TOGGLE_CONFIG],
|
||||||
|
() => toggleBetaConfig(branchToGetNext),
|
||||||
|
{
|
||||||
enabled: shouldSetCofig,
|
enabled: shouldSetCofig,
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// this is also in the Header Display
|
// this is also in the Header Display
|
||||||
// TODO: make this a custom hook
|
// TODO: make this a custom hook
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (configStatus === "success") {
|
||||||
if (configStatus === 'success') {
|
|
||||||
|
|
||||||
const { update_branch } = configData;
|
const { update_branch } = configData;
|
||||||
|
|
||||||
if (update_branch === 'main') {
|
if (update_branch === "main") {
|
||||||
setBranchToGetNext('beta');
|
setBranchToGetNext("beta");
|
||||||
} else {
|
} else {
|
||||||
// setIsBeta(true);
|
// setIsBeta(true);
|
||||||
setBranchToGetNext('main');
|
setBranchToGetNext("main");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}, [configStatus, configData]);
|
}, [configStatus, configData]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (toggleStatus === 'success') {
|
if (toggleStatus === "success") {
|
||||||
|
if (toggleData[0] == "OK") {
|
||||||
if (toggleData[0] == 'OK') {
|
|
||||||
// force a refetch of the config
|
// force a refetch of the config
|
||||||
queryClient.invalidateQueries([KEY_CONFIG])
|
queryClient.invalidateQueries([KEY_CONFIG]);
|
||||||
}
|
}
|
||||||
setShouldSetConfig(false);
|
setShouldSetConfig(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
}, [toggleStatus, toggleData, setShouldSetConfig]);
|
}, [toggleStatus, toggleData, setShouldSetConfig]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
|
disabled={true}
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={branchToGetNext === 'main'}
|
checked={branchToGetNext === "main"}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setShouldSetConfig(true);
|
setShouldSetConfig(true);
|
||||||
}}
|
}}
|
||||||
@ -73,4 +69,3 @@ export default function BetaMode() {
|
|||||||
</label>
|
</label>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@ function SettingsList() {
|
|||||||
<li className={AdvancedSettingItem}>
|
<li className={AdvancedSettingItem}>
|
||||||
<BetaMode />
|
<BetaMode />
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ import {
|
|||||||
} from "./headerDisplay.css.ts";
|
} from "./headerDisplay.css.ts";
|
||||||
|
|
||||||
export default function HeaderDisplay() {
|
export default function HeaderDisplay() {
|
||||||
|
|
||||||
const { status, data } = useQuery([KEY_CONFIG], getConfig);
|
const { status, data } = useQuery([KEY_CONFIG], getConfig);
|
||||||
|
|
||||||
const [version, setVersion] = useState("2.1.0");
|
const [version, setVersion] = useState("2.1.0");
|
||||||
|
@ -7,7 +7,7 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|||||||
|
|
||||||
import { enableMapSet } from "immer";
|
import { enableMapSet } from "immer";
|
||||||
|
|
||||||
import App from "./app";
|
import App from "./App";
|
||||||
|
|
||||||
import "./styles/index.css.ts";
|
import "./styles/index.css.ts";
|
||||||
|
|
||||||
|
@ -1,22 +1,20 @@
|
|||||||
import { recipe } from '@vanilla-extract/recipes';
|
import { recipe } from "@vanilla-extract/recipes";
|
||||||
|
|
||||||
|
|
||||||
export const button = recipe({
|
export const button = recipe({
|
||||||
variants: {
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
neutral: { background: 'whitesmoke' },
|
neutral: { background: "whitesmoke" },
|
||||||
brand: { background: 'blueviolet' },
|
brand: { background: "blueviolet" },
|
||||||
accent: { background: 'slateblue' }
|
accent: { background: "slateblue" },
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
small: { padding: 12 },
|
small: { padding: 12 },
|
||||||
medium: { padding: 16 },
|
medium: { padding: 16 },
|
||||||
large: { padding: 24 }
|
large: { padding: 24 },
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// export const card = recipe({
|
// export const card = recipe({
|
||||||
// variants: {
|
// variants: {
|
||||||
// color: {
|
// color: {
|
||||||
|
2
ui/frontend/dist/index.css
vendored
2
ui/frontend/dist/index.css
vendored
File diff suppressed because one or more lines are too long
16
ui/frontend/dist/index.html
vendored
16
ui/frontend/dist/index.html
vendored
@ -19,19 +19,7 @@
|
|||||||
<!-- THE STYLES ARE BEING USED IN THE REACT APP -->
|
<!-- THE STYLES ARE BEING USED IN THE REACT APP -->
|
||||||
<!-- WE NEED TO PORT OVER THE STYLES OVER TO THE REACT COMPONENTS -->
|
<!-- WE NEED TO PORT OVER THE STYLES OVER TO THE REACT COMPONENTS -->
|
||||||
<style>
|
<style>
|
||||||
/* body {
|
/* label {
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 11pt;
|
|
||||||
background-color: rgb(32, 33, 36);
|
|
||||||
color: #eee;
|
|
||||||
} */
|
|
||||||
a {
|
|
||||||
color: rgb(0, 102, 204);
|
|
||||||
}
|
|
||||||
a:visited {
|
|
||||||
color: rgb(0, 102, 204);
|
|
||||||
}
|
|
||||||
label {
|
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
}
|
}
|
||||||
#prompt {
|
#prompt {
|
||||||
@ -73,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
#guidance_scale {
|
#guidance_scale {
|
||||||
transform: translateY(30%);
|
transform: translateY(30%);
|
||||||
}
|
} */
|
||||||
#outputMsg {
|
#outputMsg {
|
||||||
font-size: small;
|
font-size: small;
|
||||||
}
|
}
|
||||||
|
26
ui/frontend/dist/index.js
vendored
26
ui/frontend/dist/index.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user