fix: api access info
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import icons from '@/components/icon-font/icons';
|
||||
import HotKeys from '@/config/hotkeys';
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import { modelCategoriesMap, modelSourceMap } from './index';
|
||||
|
||||
@@ -50,11 +49,6 @@ export const ActionList: ActionItem[] = [
|
||||
key: 'chat',
|
||||
icon: icons.ExperimentOutlined
|
||||
},
|
||||
{
|
||||
label: 'models.form.generic_proxy.button',
|
||||
key: 'proxy',
|
||||
icon: icons.CaptivePortal
|
||||
},
|
||||
{
|
||||
label: 'models.table.button.apiAccessInfo',
|
||||
key: 'api',
|
||||
@@ -157,27 +151,6 @@ export const generateSource = (record: any) => {
|
||||
return '';
|
||||
};
|
||||
|
||||
export const setModelActionList = (record: any) => {
|
||||
return _.filter(ActionList, (action: any) => {
|
||||
if (action.key === 'chat' || action.key === 'api') {
|
||||
return record.ready_replicas > 0;
|
||||
}
|
||||
if (action.key === 'start') {
|
||||
return record.replicas === 0;
|
||||
}
|
||||
|
||||
if (action.key === 'stop') {
|
||||
return record.replicas > 0;
|
||||
}
|
||||
|
||||
if (action.key === 'proxy') {
|
||||
return record.generic_proxy;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
export const modelFileActions = [
|
||||
{
|
||||
label: 'common.button.deploy',
|
||||
|
||||
@@ -25,6 +25,7 @@ export interface ListItem {
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
access_policy: 'public' | 'authed' | 'allowed_users';
|
||||
generic_proxy?: boolean;
|
||||
gpu_selector?: {
|
||||
gpu_ids: string[];
|
||||
gpus_per_replica?: number;
|
||||
|
||||
Reference in New Issue
Block a user