初始化api

This commit is contained in:
whyour
2021-03-15 21:09:30 +08:00
parent f1f8ece8a2
commit 99a8dc78db
28 changed files with 664 additions and 49 deletions
+20 -14
View File
@@ -16,15 +16,18 @@ const Crontab = () => {
const getConfig = () => {
request.get(`${config.apiPrefix}config/config`).then((data) => {
setValue(data);
setValue(data.content);
});
};
const getSample = () => {
setLoading(true);
request.get(`${config.apiPrefix}config/sample`).then((data) => {
setSample(data);
}).finally(() => setLoading(false));
request
.get(`${config.apiPrefix}config/sample`)
.then((data) => {
setSample(data.content);
})
.finally(() => setLoading(false));
};
useEffect(() => {
@@ -63,16 +66,19 @@ const Crontab = () => {
}}
>
<ReactDiffViewer
styles={{ diffRemoved: {
overflowX: 'auto',
maxWidth: 300,
},
diffAdded: {
overflowX: 'auto',
maxWidth: 300,
},line: {
wordBreak: 'break-word',
}, }}
styles={{
diffRemoved: {
overflowX: 'auto',
maxWidth: 300,
},
diffAdded: {
overflowX: 'auto',
maxWidth: 300,
},
line: {
wordBreak: 'break-word',
},
}}
oldValue={value}
newValue={sample}
splitView={true}