disable weights views for non-Studio

This commit is contained in:
Brandon Thomas committed 2024-02-07 03:50:11 -05:00
1 parent 155920b723
commit 55aa101f0d
2 files changed
+14

No files matched your search

@@ -373,6 +373,7 @@ class PageContainer extends React.Component<
render={props => (
<WeightPage
key={props.match.params.weight_token}
sessionWrapper={this.props.sessionWrapper}
sessionSubscriptionsWrapper={
this.props.sessionSubscriptionsWrapper
}
@@ -35,8 +35,11 @@ import WeightCoverImage from "components/common/WeightCoverImage";
import { BucketConfig } from "@storyteller/components/src/api/BucketConfig";
import SdInferencePanel from "./inference_panels/SdInferencePanel";
import SdCoverImagePanel from "./cover_image_panels/SdCoverImagePanel";
import { StudioNotAvailable } from "v2/view/_common/StudioNotAvailable";
import { SessionWrapper } from "@storyteller/components/src/session/SessionWrapper";
interface WeightProps {
sessionWrapper: SessionWrapper;
sessionSubscriptionsWrapper: SessionSubscriptionsWrapper;
inferenceJobs: Array<InferenceJob>;
ttsInferenceJobs: Array<TtsInferenceJob>;
@@ -49,6 +52,7 @@ interface WeightProps {
}
export default function WeightPage({
sessionWrapper,
sessionSubscriptionsWrapper,
inferenceJobs,
ttsInferenceJobs,
@@ -100,6 +104,15 @@ export default function WeightPage({
const deleteWeight = () => remove(!!user?.can_ban_users);
switch (weight?.weight_type) {
case WeightType.SD_15:
case WeightType.SDXL:
case WeightType.LORA:
if (!sessionWrapper.canAccessStudio()) {
return <StudioNotAvailable />
}
}
function renderWeightComponent(weight: Weight) {
switch (weight.weight_category) {
case WeightCategory.TTS: