fix(deploymentlog): show the checkbox only when container exsiting previous
This commit is contained in:
@@ -55,6 +55,12 @@ const ViewLogsModal: React.FC<ViewModalProps> = (props) => {
|
||||
);
|
||||
}, [countOptions, showPrevious]);
|
||||
|
||||
const hasPreviousContainer = useMemo(() => {
|
||||
return countOptions?.some((option) =>
|
||||
option.children?.some((child) => child.previous)
|
||||
);
|
||||
}, [countOptions]);
|
||||
|
||||
const handleCancel = useCallback(() => {
|
||||
logsViewerRef.current?.abort();
|
||||
onCancel();
|
||||
@@ -186,15 +192,15 @@ const ViewLogsModal: React.FC<ViewModalProps> = (props) => {
|
||||
{intl.formatMessage({ id: 'common.button.viewlog' })}
|
||||
</span>
|
||||
<span className="flex-center gap-8" style={{ height: 32 }}>
|
||||
{showCascader && (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 16,
|
||||
marginRight: 8
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 16,
|
||||
marginRight: 8
|
||||
}}
|
||||
>
|
||||
{hasPreviousContainer && (
|
||||
<Checkbox onChange={handleOnChecked} checked={showPrevious}>
|
||||
<Tooltip
|
||||
title={
|
||||
@@ -219,6 +225,9 @@ const ViewLogsModal: React.FC<ViewModalProps> = (props) => {
|
||||
<QuestionCircleOutlined style={{ marginLeft: 4 }} />
|
||||
</Tooltip>
|
||||
</Checkbox>
|
||||
)}
|
||||
|
||||
{showCascader && (
|
||||
<BaseSelect
|
||||
prefix={
|
||||
<span
|
||||
@@ -240,9 +249,8 @@ const ViewLogsModal: React.FC<ViewModalProps> = (props) => {
|
||||
onChange={handleContainerChange}
|
||||
style={{ width: 360 }}
|
||||
></BaseSelect>
|
||||
</div>
|
||||
)}
|
||||
|
||||
)}
|
||||
</div>
|
||||
<Button
|
||||
type="text"
|
||||
color="default"
|
||||
|
||||
@@ -9,6 +9,10 @@ const useOpenPlayground = () => {
|
||||
const plugin = getGPUStackPlugin();
|
||||
|
||||
const generateModelName = (row: any) => {
|
||||
// if has plugin, it means is enterpise edition, we need to generate the model name with org name prefix, otherwise, we just use the model name
|
||||
if (!plugin) {
|
||||
return row.name;
|
||||
}
|
||||
const org = getOrgById(row.owner_principal_id) ?? getCurrentOrg();
|
||||
|
||||
// The platform Org is always named ``default`` (backend constant
|
||||
@@ -30,8 +34,8 @@ const useOpenPlayground = () => {
|
||||
// ``owner_principal_id`` (an org principal id); fall back to the Org the
|
||||
// caller is currently acting under for the admin "All" view, where the
|
||||
// row's owner still resolves via the platform-wide org cache.
|
||||
// if has plugin, it means is enterpise edition, we need to generate the model name with org name prefix, otherwise, we just use the model name
|
||||
const rawModel = plugin ? generateModelName(row) : row.name;
|
||||
|
||||
const rawModel = generateModelName(row);
|
||||
const modelName = encodeURIComponent(rawModel);
|
||||
|
||||
for (const [category, path] of Object.entries(categoryToPathMap)) {
|
||||
|
||||
Reference in New Issue
Block a user