Skip to content

Commit

Permalink
use docker env to build the default connection
Browse files Browse the repository at this point in the history
Signed-off-by: ryjiang <[email protected]>
  • Loading branch information
shanghaikid committed Jul 30, 2024
1 parent 32c02d0 commit 32e1c8d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 0 additions & 8 deletions client/src/consts/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,3 @@ export const DEFAULT_ATTU_VARCHAR_MAX_LENGTH = 32;
export const DEFAULT_ATTU_ELEMENT_TYPE = 4; // int32
export const DEFAULT_ATTU_DIM = 128;
export const MIN_INT64 = `-9223372036854775807`; // safe int64 min value
export const DEFAULT_CONNECTION = {
address: '127.0.0.1:19530',
database: 'default',
token: '',
username: '',
password: '',
time: -1,
};
20 changes: 14 additions & 6 deletions client/src/pages/connect/AuthForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
MILVUS_CLIENT_ID,
ATTU_AUTH_HISTORY,
MILVUS_DATABASE,
DEFAULT_CONNECTION,
MILVUS_URL,
} from '@/consts';
import { CustomRadio } from '@/components/customRadio/CustomRadio';
import Icons from '@/components/icons/Icons';
Expand All @@ -24,6 +24,15 @@ type Connection = AuthReq & {
time: number;
};

const DEFAULT_CONNECTION = {
address: MILVUS_URL || '127.0.0.1:19530',
database: MILVUS_DATABASE,
token: '',
username: '',
password: '',
time: -1,
};

export const AuthForm = () => {
// styles
const classes = useStyles();
Expand Down Expand Up @@ -122,11 +131,11 @@ export const AuthForm = () => {
},
];

// if history connections are more than 16, remove the first one, but it should keep the default one
// if the count of history connections are more than 16, remove the first one, but it should keep the default one
if (newHistory.length > 16) {
newHistory.shift();
}

// save to local storage
window.localStorage.setItem(
ATTU_AUTH_HISTORY,
Expand Down Expand Up @@ -173,8 +182,7 @@ export const AuthForm = () => {

// save to local storage
window.localStorage.setItem(ATTU_AUTH_HISTORY, JSON.stringify(newHistory));

// sort by time, put '--' to the end
// sort by time
newHistory.sort((a, b) => {
return new Date(b.time).getTime() - new Date(a.time).getTime();
});
Expand All @@ -194,7 +202,7 @@ export const AuthForm = () => {
connections.push(DEFAULT_CONNECTION);
}

// sort by time, put '--' to the end
// sort by time
connections.sort((a, b) => {
return new Date(b.time).getTime() - new Date(a.time).getTime();
});
Expand Down

0 comments on commit 32e1c8d

Please sign in to comment.