Skip to content

Commit

Permalink
Merge pull request #461 from l3vels/fix/pods-subnets
Browse files Browse the repository at this point in the history
fix: subnets & pods page
  • Loading branch information
Chkhikvadze authored May 31, 2024
2 parents 8c37fac + 0eb0d51 commit 743f8f7
Show file tree
Hide file tree
Showing 14 changed files with 443 additions and 156 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled, { css } from 'styled-components'
import ReactMarkdown from 'react-markdown'
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
import { atomDark } from 'react-syntax-highlighter/dist/esm/styles/prism'
import { atomDark, prism } from 'react-syntax-highlighter/dist/esm/styles/prism'
import remarkGfm from 'remark-gfm'
import { useModal } from 'hooks'
import { memo, useEffect, useState } from 'react'
Expand Down Expand Up @@ -133,7 +133,7 @@ const AiMessageMarkdown = ({ isReply = false, children }: { isReply?: boolean; c
return !inline && match ? (
<SyntaxHighlighter
children={String(children).replace(/\n$/, '')}
style={atomDark as any}
style={prism as any}
language={match[1]}
PreTag='div'
{...props}
Expand Down
3 changes: 1 addition & 2 deletions apps/ui/src/pages/ApiKeys/ApiKeys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ const ApiKeys = () => {

<ButtonPrimary
onClick={() => navigate('/api-key/create-api-key')}
leftIcon={Add}
size={Button.sizes?.SMALL}
size={Button.sizes?.MEDIUM}
>
{t('create-api-key')}
</ButtonPrimary>
Expand Down
5 changes: 2 additions & 3 deletions apps/ui/src/pages/ApiKeys/CreateApiKey/CreateApikeysForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ function CreateApiKeyForm() {
<FormikProvider value={formik}>
<StyledSectionWrapper>
<StyledHeaderGroup className='header_group'>
<div>
<div style={{ width: '100%' }}>
<StyledSectionTitle>Add API Key</StyledSectionTitle>
<StyledSectionDescription>Here is your API Key.</StyledSectionDescription>
</div>

<StyledButtonWrapper>
<BackButton />
<ButtonPrimary
onClick={formik?.handleSubmit}
size={Button.sizes?.SMALL}
size={Button.sizes?.MEDIUM}
disabled={isLoading}
>
{isLoading ? <Loader size={32} /> : 'Save'}
Expand Down
45 changes: 30 additions & 15 deletions apps/ui/src/pages/Navigation/MainNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import Integrations from 'share-ui/components/Icon/Icons/components/integrations
import FineTuning from 'share-ui/components/Icon/Icons/components/FineTuning'
// eslint-disable-next-line import/no-named-as-default
import Cloud from 'share-ui/components/Icon/Icons/components/Cloud'
import { API } from 'share-ui/components/Icon/Icons'

const MainNavigation = ({ user }: { user: any }) => {
const domainEnv = import.meta.env
Expand Down Expand Up @@ -177,22 +178,10 @@ const MainNavigation = ({ user }: { user: any }) => {
</StyledLi>
)} */}

{isModel && (
<Tooltip content={t('model')} position={Tooltip.positions.LEFT}>
<StyledLi
isActive={includes(active, 'models')}
onClick={() => onHandleClick('/models')}
>
<FineTuning size={30} />
{includes(active, 'models') && <StyledCorner />}
</StyledLi>
</Tooltip>
)}

<Tooltip content={'Pods'} position={Tooltip.positions.LEFT}>
<StyledLi
isActive={includes(active, 'pods')}
onClick={() => onHandleClick('/pods')}
onClick={() => onHandleClick('/pods/create-pod')}
>
<Cloud size={30} fill={includes(active, 'pods') ? '#ffffff' : '#000000'} />
{includes(active, 'pods') && <StyledCorner />}
Expand All @@ -214,6 +203,27 @@ const MainNavigation = ({ user }: { user: any }) => {
</Tooltip>
)}

{isModel && (
<Tooltip content={t('model')} position={Tooltip.positions.LEFT}>
<StyledLi
isActive={includes(active, 'models')}
onClick={() => onHandleClick('/models')}
>
<FineTuning size={30} />
{includes(active, 'models') && <StyledCorner />}
</StyledLi>
</Tooltip>
)}

<Tooltip content={t('api-keys')} position={Tooltip.positions.LEFT}>
<StyledLi
isActive={includes(active, 'api-key')}
onClick={() => onHandleClick('/api-key')}
>
<StyledAPIIcon size={40} />
</StyledLi>
</Tooltip>

{/* {isDiscover && (
<Tooltip content={t('discover')} position={Tooltip.positions.LEFT}>
<StyledLi
Expand Down Expand Up @@ -293,14 +303,14 @@ const StyledLi = styled.li<{ isActive?: boolean }>`
border-radius: 100px;
background: #000;
span{
color: #FFF;
}
path {
stroke: #FFF;
}
`}
`
Expand Down Expand Up @@ -410,3 +420,8 @@ const StyledCorner = styled.div`
top: 8px; /* Adjust this value based on your design */
right: -16px; /* Position the left corner */
`
const StyledAPIIcon = styled(API)`
path {
fill: ${({ theme }) => theme.body.iconColor};
}
`
222 changes: 110 additions & 112 deletions apps/ui/src/pages/Pods/FilterPods.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 743f8f7

Please sign in to comment.