mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 07:10:53 +00:00
Update component descriptions and add InlineCode component
This commit is contained in:
parent
c76132fec0
commit
f4b92789e7
17
CommonUI/src/Components/InlineCode/InlineCode.tsx
Normal file
17
CommonUI/src/Components/InlineCode/InlineCode.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import React, { FunctionComponent, ReactElement } from 'react';
|
||||
|
||||
export interface ComponentProps {
|
||||
text: string;
|
||||
}
|
||||
|
||||
const InlineCode: FunctionComponent<ComponentProps> = (
|
||||
props: ComponentProps
|
||||
): ReactElement => {
|
||||
return (
|
||||
<span className="font-medium text-xs text-gray-500 border-gray-300 border-2 p-1 pl-2 pr-2 rounded">
|
||||
{props.text}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
export default InlineCode;
|
@ -14,7 +14,7 @@ export interface ComponentProps<TBaseModel extends BaseModel> {
|
||||
modelType: { new (): TBaseModel };
|
||||
fieldName: keyof TBaseModel;
|
||||
title: string;
|
||||
description: string;
|
||||
description: string | ReactElement;
|
||||
modelId: ObjectID;
|
||||
onUpdateComplete?: undefined | ((updatedValue: ObjectID) => void);
|
||||
}
|
||||
@ -66,7 +66,7 @@ const ResetObjectID: <TBaseModel extends BaseModel>(
|
||||
<>
|
||||
<Card
|
||||
title={`${props.title}`}
|
||||
description={`${props.description}`}
|
||||
description={props.description}
|
||||
buttons={[
|
||||
{
|
||||
title: `Reset ${tableColumnName}`,
|
||||
|
@ -21,6 +21,7 @@ import ErrorMessage from 'CommonUI/src/Components/ErrorMessage/ErrorMessage';
|
||||
import FieldType from 'CommonUI/src/Components/Types/FieldType';
|
||||
import DisabledWarning from '../../../Components/Monitor/DisabledWarning';
|
||||
import useAsyncEffect from 'use-async-effect';
|
||||
import InlineCode from 'CommonUI/src/Components/InlineCode/InlineCode';
|
||||
import DuplicateModel from 'CommonUI/src/Components/DuplicateModel/DuplicateModel';
|
||||
import { GetReactElementFunction } from 'CommonUI/src/Types/FunctionTypes';
|
||||
import { PromiseVoidFunction } from 'Common/Types/FunctionTypes';
|
||||
@ -137,7 +138,20 @@ const MonitorCriteria: FunctionComponent<PageComponentProps> = (
|
||||
}}
|
||||
fieldName={'incomingRequestSecretKey'}
|
||||
title={'Reset Incoming Request Secret Key'}
|
||||
description={`Your current incoming request secret key is: ${monitor.incomingRequestSecretKey?.toString()}. Resetting the secret key will generate a new key. Secret is used to authenticate incoming requests.`}
|
||||
description={
|
||||
<p className="mt-2">
|
||||
Your current incoming request secret key is:{' '}
|
||||
<InlineCode
|
||||
text={
|
||||
monitor.incomingRequestSecretKey?.toString() ||
|
||||
'No key generated'
|
||||
}
|
||||
/>{' '}
|
||||
Resetting the secret key will generate a new
|
||||
key. Secret is used to authenticate incoming
|
||||
requests.
|
||||
</p>
|
||||
}
|
||||
modelId={modelId}
|
||||
/>
|
||||
</div>
|
||||
@ -154,7 +168,20 @@ const MonitorCriteria: FunctionComponent<PageComponentProps> = (
|
||||
}}
|
||||
fieldName={'serverMonitorSecretKey'}
|
||||
title={'Reset Server Monitor Secret Key'}
|
||||
description={`Your current server monitor secret key is: ${monitor.serverMonitorSecretKey?.toString()}. Resetting the secret key will generate a new key. Secret is used to authenticate monitoring agents deployed on the.`}
|
||||
description={
|
||||
<p className="mt-2">
|
||||
Your current server monitor secret key is:{' '}
|
||||
<InlineCode
|
||||
text={
|
||||
monitor.serverMonitorSecretKey?.toString() ||
|
||||
'No key generated'
|
||||
}
|
||||
/>{' '}
|
||||
Resetting the secret key will generate a new
|
||||
key. Secret is used to authenticate
|
||||
monitoring agents deployed on the.
|
||||
</p>
|
||||
}
|
||||
modelId={modelId}
|
||||
/>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
"dep-check": "npm install -g depcheck && depcheck ./ --skip-missing=true",
|
||||
"test": "rm -rf build && jest --detectOpenHandles",
|
||||
"coverage": "jest --detectOpenHandles --coverage",
|
||||
"publish": "PACKAGE_NAME=@oneuptime/infrastructure-agent && bash ../Scripts/NPM/Publish.sh"
|
||||
"publish": "PACKAGE_NAME=@oneuptime/infrastructure-agent && bash ./Scripts/NPM/Publish.sh"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
|
Loading…
Reference in New Issue
Block a user