fix(style): add worker
This commit is contained in:
@@ -188,6 +188,10 @@
|
||||
font-size: var(--font-size-base);
|
||||
}
|
||||
|
||||
.font-size-13 {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.font-size-14 {
|
||||
font-size: var(--font-size-middle);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { createFromIconfontCN } from '@ant-design/icons';
|
||||
// import './iconfont/iconfont.js';
|
||||
|
||||
const IconFont = createFromIconfontCN({
|
||||
scriptUrl: '//at.alicdn.com/t/c/font_4613488_f316s64919m.js'
|
||||
scriptUrl: '//at.alicdn.com/t/c/font_4613488_hlvsvytu57b.js'
|
||||
});
|
||||
|
||||
export default IconFont;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import React, { useCallback, useMemo, useRef } from 'react';
|
||||
|
||||
type Point = { x: number; y: number; lineWidth: number };
|
||||
type Stroke = Point[];
|
||||
@@ -130,6 +130,7 @@ export default function useDrawing(props: {
|
||||
const getTransformedPoint = useCallback(
|
||||
(offsetX: number, offsetY: number) => {
|
||||
const { current: scale } = autoScale;
|
||||
console.log('lineWidth:----------', lineWidth, autoScale.current);
|
||||
|
||||
const { x: translateX, y: translateY } = translatePos.current;
|
||||
|
||||
@@ -146,6 +147,7 @@ export default function useDrawing(props: {
|
||||
|
||||
const getTransformLineWidth = useCallback(
|
||||
(w = 1) => {
|
||||
console.log('lineWidth:', lineWidth, autoScale.current);
|
||||
const width = w || lineWidth;
|
||||
return width / autoScale.current;
|
||||
},
|
||||
|
||||
@@ -196,6 +196,7 @@ const CanvasImageEditor: React.FC<CanvasImageEditorProps> = forwardRef(
|
||||
const onReset = useCallback(() => {
|
||||
clearOverlayCanvas();
|
||||
setStrokes([]);
|
||||
setMaskStrokes([]);
|
||||
saveImage();
|
||||
currentStroke.current = [];
|
||||
console.log('Resetting strokes', currentStroke.current);
|
||||
@@ -513,9 +514,9 @@ const CanvasImageEditor: React.FC<CanvasImageEditorProps> = forwardRef(
|
||||
<ToolsBar
|
||||
handleBrushSizeChange={handleBrushSizeChange}
|
||||
undo={undo}
|
||||
onReset={onReset}
|
||||
uploadButton={uploadButton}
|
||||
onClear={onReset}
|
||||
handleFitView={handleFitView}
|
||||
uploadButton={uploadButton}
|
||||
disabled={disabled}
|
||||
lineWidth={lineWidth}
|
||||
loading={loading}
|
||||
|
||||
@@ -19,7 +19,7 @@ interface ToolsBarProps {
|
||||
uploadButton: React.ReactNode;
|
||||
handleBrushSizeChange: (value: number) => void;
|
||||
undo: () => void;
|
||||
onReset: () => void;
|
||||
onClear: () => void;
|
||||
handleFitView: () => void;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ const ToolsBar: React.FC<ToolsBarProps> = (props) => {
|
||||
lineWidth,
|
||||
handleBrushSizeChange,
|
||||
undo,
|
||||
onReset,
|
||||
onClear,
|
||||
uploadButton,
|
||||
handleFitView
|
||||
} = props;
|
||||
@@ -83,7 +83,7 @@ const ToolsBar: React.FC<ToolsBarProps> = (props) => {
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title={intl.formatMessage({ id: 'common.button.clear' })}>
|
||||
<Button onClick={onReset} size="middle" type="text" disabled={disabled}>
|
||||
<Button onClick={onClear} size="middle" type="text" disabled={disabled}>
|
||||
<ClearOutlined className="font-size-14" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
|
||||
@@ -336,6 +336,10 @@ body {
|
||||
|
||||
.ant-pro-sider .ant-layout-sider-children {
|
||||
background-color: var(--color-fill-sider);
|
||||
// box-shadow:
|
||||
// 0px 1px 2px 0px rgb(0 0 0 / 30%),
|
||||
// 0px 2px 6px 2px rgb(0 0 0 / 15%);
|
||||
// border-radius: 0 16px 16px 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -443,7 +443,10 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
||||
{
|
||||
key: '1',
|
||||
label: (
|
||||
<span style={{ fontWeight: 'var(--font-weight-medium)' }}>
|
||||
<span
|
||||
style={{ fontWeight: 'var(--font-weight-medium)' }}
|
||||
className="font-size-14"
|
||||
>
|
||||
{intl.formatMessage({ id: 'resources.form.advanced' })}
|
||||
</span>
|
||||
),
|
||||
|
||||
@@ -80,13 +80,15 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
</Button>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>1. {intl.formatMessage({ id: 'resources.worker.add.step1' })}</h3>
|
||||
<h3 className="font-size-14 font-600">
|
||||
1. {intl.formatMessage({ id: 'resources.worker.add.step1' })}
|
||||
</h3>
|
||||
<HighlightCode
|
||||
code={addWorkerGuide.container.getToken}
|
||||
theme="dark"
|
||||
lang="bash"
|
||||
></HighlightCode>
|
||||
<h3 className="m-t-10">
|
||||
<h3 className="m-t-10 font-size-14 font-600">
|
||||
2. {intl.formatMessage({ id: 'resources.worker.add.step2' })}{' '}
|
||||
<span
|
||||
className="font-size-12"
|
||||
@@ -119,7 +121,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
></div>
|
||||
)}
|
||||
<HighlightCode theme="dark" code={code} lang="bash"></HighlightCode>
|
||||
<h3 className="m-b-0 m-t-10">
|
||||
<h3 className="m-b-0 m-t-10 font-size-14 font-600">
|
||||
3. {intl.formatMessage({ id: 'resources.worker.add.step3' })}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@@ -417,7 +417,9 @@ const ModelFiles = () => {
|
||||
render: (text: string, record: ListItem) => (
|
||||
<span className="flex flex-column" style={{ width: '100%' }}>
|
||||
{record.source === modelSourceMap.local_path_value ? (
|
||||
intl.formatMessage({ id: 'models.form.localPath' })
|
||||
<AutoTooltip ghost>
|
||||
{intl.formatMessage({ id: 'models.form.localPath' })}
|
||||
</AutoTooltip>
|
||||
) : (
|
||||
<AutoTooltip ghost>{generateSource(record)}</AutoTooltip>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import HighlightCode from '@/components/highlight-code';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { addWorkerGuide } from '../config';
|
||||
|
||||
type ViewModalProps = { token: string };
|
||||
@@ -10,32 +10,41 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
|
||||
const origin = window.location.origin;
|
||||
|
||||
const labels = useMemo(
|
||||
() => ({
|
||||
step1: intl.formatMessage({ id: 'resources.worker.add.step1' }),
|
||||
step2: intl.formatMessage({ id: 'resources.worker.add.step2' }),
|
||||
step2Tips: intl.formatMessage({ id: 'resources.worker.add.step2.tips' }),
|
||||
step3: intl.formatMessage({ id: 'resources.worker.add.step3' }),
|
||||
linuxOrMac: intl.formatMessage({ id: 'resources.worker.linuxormaxos' })
|
||||
}),
|
||||
[intl]
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="script-install">
|
||||
<h3>1. {intl.formatMessage({ id: 'resources.worker.add.step1' })}</h3>
|
||||
<h4>{intl.formatMessage({ id: 'resources.worker.linuxormaxos' })}</h4>
|
||||
<h3 className="font-size-14 font-600">1. {labels.step1}</h3>
|
||||
<h4 className="font-size-13">{labels.linuxOrMac}</h4>
|
||||
<HighlightCode
|
||||
code={addWorkerGuide.mac.getToken}
|
||||
theme="dark"
|
||||
></HighlightCode>
|
||||
<h4 className="m-t-6">Windows </h4>
|
||||
<h4 className="m-t-6 font-size-13">Windows </h4>
|
||||
<HighlightCode
|
||||
code={addWorkerGuide.win.getToken}
|
||||
theme="dark"
|
||||
></HighlightCode>
|
||||
<h3 className="m-t-10">
|
||||
2. {intl.formatMessage({ id: 'resources.worker.add.step2' })}{' '}
|
||||
<h3 className="m-t-10 font-size-14 font-600">
|
||||
2. {labels.step2}{' '}
|
||||
<span
|
||||
className="font-size-12"
|
||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `(${intl.formatMessage({
|
||||
id: 'resources.worker.add.step2.tips'
|
||||
})})`
|
||||
__html: `(${labels.step2Tips})`
|
||||
}}
|
||||
></span>
|
||||
</h3>
|
||||
<h4>{intl.formatMessage({ id: 'resources.worker.linuxormaxos' })}</h4>
|
||||
<h4 className="font-size-13">{labels.linuxOrMac}</h4>
|
||||
<HighlightCode
|
||||
code={addWorkerGuide.mac.registerWorker({
|
||||
server: origin,
|
||||
@@ -43,7 +52,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
})}
|
||||
theme="dark"
|
||||
></HighlightCode>
|
||||
<h4 className="m-t-6">Windows </h4>
|
||||
<h4 className="m-t-6 font-size-13">Windows </h4>
|
||||
<HighlightCode
|
||||
theme="dark"
|
||||
code={addWorkerGuide.win.registerWorker({
|
||||
@@ -51,9 +60,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
token: '${mytoken}'
|
||||
})}
|
||||
></HighlightCode>
|
||||
<h3 className="m-b-0 m-t-10">
|
||||
3. {intl.formatMessage({ id: 'resources.worker.add.step3' })}
|
||||
</h3>
|
||||
<h3 className="m-b-0 m-t-10 font-size-14 font-600">3. {labels.step3}</h3>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user