fix: update fields value
This commit is contained in:
@@ -55,7 +55,7 @@
|
|||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background-color: rgba(255, 255, 255, 25%);
|
background-color: var(--color-fill-spin-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy {
|
.copy {
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
|
|||||||
|
|
||||||
const createChunkConnection = async () => {
|
const createChunkConnection = async () => {
|
||||||
chunkRequedtRef.current?.current?.abort?.();
|
chunkRequedtRef.current?.current?.abort?.();
|
||||||
|
setLoading(true);
|
||||||
chunkRequedtRef.current = setChunkFetch({
|
chunkRequedtRef.current = setChunkFetch({
|
||||||
url,
|
url,
|
||||||
params: {
|
params: {
|
||||||
|
|||||||
+1
-1
@@ -71,7 +71,7 @@ html {
|
|||||||
--seal-transition-func: cubic-bezier(0, 0, 1, 1);
|
--seal-transition-func: cubic-bezier(0, 0, 1, 1);
|
||||||
--color-green-fill-light: rgb(243 251 248);
|
--color-green-fill-light: rgb(243 251 248);
|
||||||
--ant-rate-star-color: #fadb14;
|
--ant-rate-star-color: #fadb14;
|
||||||
--color-fill-spin-bg: rgba(255, 255, 255, 60%);
|
--color-fill-spin-bg: rgba(255, 255, 255, 15%);
|
||||||
--width-tooltip-max: 300px;
|
--width-tooltip-max: 300px;
|
||||||
--color-bg-tooltip: '#fff';
|
--color-bg-tooltip: '#fff';
|
||||||
--color-modal-content-bg: rgba(255, 255, 255, 90%);
|
--color-modal-content-bg: rgba(255, 255, 255, 90%);
|
||||||
|
|||||||
@@ -171,8 +171,8 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
|||||||
onValuesChange?.({}, form.getFieldsValue());
|
onValuesChange?.({}, form.getFieldsValue());
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSelectorOnBlur = () => {
|
const onSelectorChange = (field: string) => {
|
||||||
const workerSelector = form.getFieldValue('worker_selector');
|
const workerSelector = form.getFieldValue(field);
|
||||||
// check if all keys have values
|
// check if all keys have values
|
||||||
const hasEmptyValue = _.some(_.keys(workerSelector), (k: string) => {
|
const hasEmptyValue = _.some(_.keys(workerSelector), (k: string) => {
|
||||||
return !workerSelector[k];
|
return !workerSelector[k];
|
||||||
@@ -182,12 +182,23 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleSelectorOnBlur = () => {
|
||||||
|
onSelectorChange('worker_selector');
|
||||||
|
};
|
||||||
|
|
||||||
const handleDeleteWorkerSelector = (index: number) => {
|
const handleDeleteWorkerSelector = (index: number) => {
|
||||||
onValuesChange?.({}, form.getFieldsValue());
|
onValuesChange?.({}, form.getFieldsValue());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleEnvSelectorOnBlur = () => {
|
||||||
|
onSelectorChange('env');
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDeleteEnvSelector = (index: number) => {
|
||||||
|
onValuesChange?.({}, form.getFieldsValue());
|
||||||
|
};
|
||||||
|
|
||||||
const handleBackendVersionOnBlur = () => {
|
const handleBackendVersionOnBlur = () => {
|
||||||
const backendVersion = form.getFieldValue('backend_version');
|
|
||||||
onValuesChange?.({}, form.getFieldsValue());
|
onValuesChange?.({}, form.getFieldsValue());
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -450,6 +461,8 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
|||||||
})}
|
})}
|
||||||
labels={EnviromentVars}
|
labels={EnviromentVars}
|
||||||
btnText="common.button.vars"
|
btnText="common.button.vars"
|
||||||
|
onBlur={handleEnvSelectorOnBlur}
|
||||||
|
onDelete={handleDeleteEnvSelector}
|
||||||
onChange={handleEnviromentVarsChange}
|
onChange={handleEnviromentVarsChange}
|
||||||
></LabelSelector>
|
></LabelSelector>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
|
|
||||||
const handleOnValuesChange = (data: any) => {
|
const handleOnValuesChange = (data: any) => {
|
||||||
const formdata = form.getFieldsValue?.();
|
const formdata = form.getFieldsValue?.();
|
||||||
|
|
||||||
let alldata = {};
|
let alldata = {};
|
||||||
if (formdata.scheduleType === 'manual') {
|
if (formdata.scheduleType === 'manual') {
|
||||||
alldata = {
|
alldata = {
|
||||||
@@ -104,10 +105,16 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
alldata = {
|
alldata = {
|
||||||
..._.omit(formdata, ['gpu_selector']),
|
..._.omit(formdata, ['gpu_selector']),
|
||||||
env: formdata.env || {},
|
env: formdata.env || {},
|
||||||
worker_selector: originFormData.current?.worker_selector || null
|
worker_selector:
|
||||||
|
formdata.worker_selector ||
|
||||||
|
originFormData.current?.worker_selector ||
|
||||||
|
null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const isEqual = _.isEqualWith(alldata, originFormData.current, customizer);
|
|
||||||
|
const originalData = _.pick(originFormData.current, Object.keys(alldata));
|
||||||
|
|
||||||
|
const isEqual = _.isEqualWith(alldata, originalData, customizer);
|
||||||
if (isEqual) {
|
if (isEqual) {
|
||||||
setWarningStatus({
|
setWarningStatus({
|
||||||
show: false,
|
show: false,
|
||||||
|
|||||||
@@ -477,6 +477,7 @@ export const excludeFields = [
|
|||||||
'gpu_selector'
|
'gpu_selector'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// if some fields need to trigger manual check, add them here
|
||||||
export const updateExcludeFields = [
|
export const updateExcludeFields = [
|
||||||
'repo_id',
|
'repo_id',
|
||||||
'file_name',
|
'file_name',
|
||||||
@@ -487,10 +488,11 @@ export const updateExcludeFields = [
|
|||||||
'local_path',
|
'local_path',
|
||||||
'backend_version',
|
'backend_version',
|
||||||
'ollama_library_model_name',
|
'ollama_library_model_name',
|
||||||
'scheduleType',
|
|
||||||
'backend',
|
'backend',
|
||||||
'gpu_selector',
|
'gpu_selector',
|
||||||
'categories'
|
'categories',
|
||||||
|
'env',
|
||||||
|
'replicas'
|
||||||
];
|
];
|
||||||
|
|
||||||
export const formFields = [
|
export const formFields = [
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export default function useSelectorChange() {}
|
||||||
Reference in New Issue
Block a user