Skip to content

Commit

Permalink
feat: reimplemented heartbeat button
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Dec 23, 2024
1 parent 4ef0c13 commit f7232bf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/components/APIManager/AddAPI.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ButtonPrimary from '@components/Buttons/ButtonPrimary'
import DropdownSheet from '@components/DropdownSheet'
import HeartbeatButton from '@components/Endpoint/HeartbeatButton'
import MultiDropdownSheet from '@components/MultiDropdownSheet'
import claudeModels from '@constants/API/ClaudeModels.json'
import { MaterialIcons } from '@expo/vector-icons'
Expand Down Expand Up @@ -113,6 +114,18 @@ const AddAPI = () => {
placeholder={template.defaultValues.modelEndpoint}
placeholderTextColor={Style.getColor('primary-text2')}
/>
<HeartbeatButton
api={values.modelEndpoint ?? ''}
apiFormat={(s) => s}
headers={
template.features.useKey
? {
[template.request.authHeader]:
template.request.authPrefix + values.key,
}
: {}
}
/>
</View>
)}

Expand Down
13 changes: 13 additions & 0 deletions app/components/APIManager/EditAPIModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ButtonPrimary from '@components/Buttons/ButtonPrimary'
import DropdownSheet from '@components/DropdownSheet'
import HeartbeatButton from '@components/Endpoint/HeartbeatButton'
import FadeBackrop from '@components/FadeBackdrop'
import MultiDropdownSheet from '@components/MultiDropdownSheet'
import { APIConfiguration } from '@constants/API/APIBuilder.types'
Expand Down Expand Up @@ -140,6 +141,18 @@ const EditAPIModal: React.FC<EditAPIModalProps> = ({ index, show, close, origina
placeholder={template.defaultValues.modelEndpoint}
placeholderTextColor={Style.getColor('primary-text2')}
/>
<HeartbeatButton
api={values.modelEndpoint ?? ''}
apiFormat={(s) => s}
headers={
template.features.useKey
? {
[template.request.authHeader]:
template.request.authPrefix + values.key,
}
: {}
}
/>
</View>
)}

Expand Down

0 comments on commit f7232bf

Please sign in to comment.