1825 extensibility v1 see serverless logs using subscriptions in twnty cli or settings serverkess section (#16321)
- Adds a log section to settings serverless functions test tab <img width="1303" height="827" alt="image" src="https://github.com/user-attachments/assets/2ce70558-91bc-4cfc-aced-42ac9e0226bf" /> - Adds a new subscription endpoint to graphql api `serverlessFunctionLogs` that that emit function logs - Adds a new command `twenty app logs` to `twenty-sdk` to watch logs in terminal <img width="1109" height="182" alt="image" src="https://github.com/user-attachments/assets/2e874060-e99d-4978-ab9c-c91e52cb7478" /> <img width="1061" height="176" alt="image" src="https://github.com/user-attachments/assets/1f533e32-7435-4d7b-89c6-d1154816a8ab" /> - add new version for create-twenty-app and twenty-sdk `0.1.3`
This commit is contained in:
+19
-1
@@ -6,6 +6,8 @@ import { useRecoilState } from 'recoil';
|
||||
import { H2Title, IconPlayerPlay } from 'twenty-ui/display';
|
||||
import { Button, CodeEditor, CoreEditorHeader } from 'twenty-ui/input';
|
||||
import { Section } from 'twenty-ui/layout';
|
||||
import { InputLabel } from '@/ui/input/components/InputLabel';
|
||||
import { TextArea } from '@/ui/input/components/TextArea';
|
||||
|
||||
const StyledInputsContainer = styled.div`
|
||||
display: flex;
|
||||
@@ -38,6 +40,8 @@ export const SettingsServerlessFunctionTestTab = ({
|
||||
}));
|
||||
};
|
||||
|
||||
const testLogsTextAreaId = `${serverlessFunctionId}-test-logs`;
|
||||
|
||||
return (
|
||||
<Section>
|
||||
<H2Title
|
||||
@@ -63,15 +67,29 @@ export const SettingsServerlessFunctionTestTab = ({
|
||||
<CodeEditor
|
||||
value={JSON.stringify(serverlessFunctionTestData.input, null, 4)}
|
||||
language="json"
|
||||
height={200}
|
||||
height={100}
|
||||
onChange={onChange}
|
||||
variant="with-header"
|
||||
/>
|
||||
</StyledCodeEditorContainer>
|
||||
<ServerlessFunctionExecutionResult
|
||||
serverlessFunctionTestData={serverlessFunctionTestData}
|
||||
maxHeight={
|
||||
serverlessFunctionTestData.output.logs.length > 0 ? 200 : undefined
|
||||
}
|
||||
isTesting={isTesting}
|
||||
/>
|
||||
{serverlessFunctionTestData.output.logs.length > 0 && (
|
||||
<StyledCodeEditorContainer>
|
||||
<InputLabel>Logs</InputLabel>
|
||||
<TextArea
|
||||
textAreaId={testLogsTextAreaId}
|
||||
value={isTesting ? '' : serverlessFunctionTestData.output.logs}
|
||||
maxRows={20}
|
||||
disabled
|
||||
/>
|
||||
</StyledCodeEditorContainer>
|
||||
)}
|
||||
</StyledInputsContainer>
|
||||
</Section>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user