mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-15 11:18:12 +00:00
no message
This commit is contained in:
parent
9553e43fa8
commit
2686bfbf5e
46
electron/build.js
vendored
46
electron/build.js
vendored
@ -49,28 +49,30 @@ function genericPublish(url, version) {
|
|||||||
} else {
|
} else {
|
||||||
for (const filename of files) {
|
for (const filename of files) {
|
||||||
const localFile = path.join(filePath, filename)
|
const localFile = path.join(filePath, filename)
|
||||||
const fileStat = fs.statSync(localFile)
|
if (fse.existsSync(localFile)) {
|
||||||
if (fileStat.isFile()) {
|
const fileStat = fs.statSync(localFile)
|
||||||
const uploadOra = ora(`${filename} uploading...`).start()
|
if (fileStat.isFile()) {
|
||||||
const formData = new FormData()
|
const uploadOra = ora(`${filename} uploading...`).start()
|
||||||
formData.append("file", fs.createReadStream(localFile));
|
const formData = new FormData()
|
||||||
await axios({
|
formData.append("file", fs.createReadStream(localFile));
|
||||||
method: 'post',
|
await axios({
|
||||||
url: url,
|
method: 'post',
|
||||||
data: formData,
|
url: url,
|
||||||
maxContentLength: Infinity,
|
data: formData,
|
||||||
maxBodyLength: Infinity,
|
maxContentLength: Infinity,
|
||||||
headers: {
|
maxBodyLength: Infinity,
|
||||||
'Generic-Version': version,
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data;boundary=' + formData.getBoundary(),
|
'Generic-Version': version,
|
||||||
}
|
'Content-Type': 'multipart/form-data;boundary=' + formData.getBoundary(),
|
||||||
}).then(_ => {
|
}
|
||||||
uploadOra.succeed(`${filename} upload successful`)
|
}).then(_ => {
|
||||||
}).catch(_ => {
|
uploadOra.succeed(`${filename} upload successful`)
|
||||||
uploadOra.fail(`${filename} upload fail`)
|
}).catch(_ => {
|
||||||
}).finally(_ => {
|
uploadOra.fail(`${filename} upload fail`)
|
||||||
fse.removeSync(localFile)
|
}).finally(_ => {
|
||||||
})
|
fse.removeSync(localFile)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.13.36",
|
"version": "0.13.38",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "./cmd dev",
|
"start": "./cmd dev",
|
||||||
|
|||||||
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/build/558.js
vendored
2
public/js/build/558.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/build/569.js
vendored
2
public/js/build/569.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/build/699.js
vendored
2
public/js/build/699.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/build/963.js
vendored
2
public/js/build/963.js
vendored
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
8670e2bbf86722cc
|
964ec56060e5c9b0
|
||||||
|
|||||||
34
resources/assets/js/functions/common.js
vendored
34
resources/assets/js/functions/common.js
vendored
@ -1004,6 +1004,40 @@
|
|||||||
window.scrollIntoView(element, options)
|
window.scrollIntoView(element, options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 等比缩放尺寸
|
||||||
|
* @param width
|
||||||
|
* @param height
|
||||||
|
* @param maxWidth
|
||||||
|
* @param maxHeight
|
||||||
|
* @returns {{width, height}|{width: number, height: number}}
|
||||||
|
*/
|
||||||
|
scaleToScale(width, height, maxWidth, maxHeight) {
|
||||||
|
let tempWidth;
|
||||||
|
let tempHeight;
|
||||||
|
if (width > 0 && height > 0) {
|
||||||
|
if (width / height >= maxWidth / maxHeight) {
|
||||||
|
if (width > maxWidth) {
|
||||||
|
tempWidth = maxWidth;
|
||||||
|
tempHeight = (height * maxWidth) / width;
|
||||||
|
} else {
|
||||||
|
tempWidth = width;
|
||||||
|
tempHeight = height;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (height > maxHeight) {
|
||||||
|
tempHeight = maxHeight;
|
||||||
|
tempWidth = (width * maxHeight) / height;
|
||||||
|
} else {
|
||||||
|
tempWidth = width;
|
||||||
|
tempHeight = height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {width: parseInt(tempWidth), height: parseInt(tempHeight)};
|
||||||
|
}
|
||||||
|
return {width, height};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -174,6 +174,21 @@ export default {
|
|||||||
}
|
}
|
||||||
text = text.trim().replace(/(\n\x20*){3,}/g, "\n\n");
|
text = text.trim().replace(/(\n\x20*){3,}/g, "\n\n");
|
||||||
text = text.replace(/\{\{RemoteURL\}\}/g, $A.apiUrl('../'))
|
text = text.replace(/\{\{RemoteURL\}\}/g, $A.apiUrl('../'))
|
||||||
|
const array = text.match(/<img\s+[^>]*?>/g);
|
||||||
|
if (array) {
|
||||||
|
const widthReg = new RegExp("width=\"(\\d+)\"")
|
||||||
|
const heightReg = new RegExp("height=\"(\\d+)\"")
|
||||||
|
array.some(res => {
|
||||||
|
if (widthReg.test(res) && heightReg.test(res)) {
|
||||||
|
let width = parseInt(res.match(widthReg)[1]),
|
||||||
|
height = parseInt(res.match(heightReg)[1]),
|
||||||
|
maxSize = res.indexOf("emoticon") > -1 ? 150 : 220;
|
||||||
|
let scale = $A.scaleToScale(width, height, maxSize, maxSize);
|
||||||
|
let value = res.replace(widthReg, `width=${scale.width}`).replace(heightReg, `height=${scale.height}`)
|
||||||
|
text = text.replace(res, value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
return text;
|
return text;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -290,7 +305,7 @@ export default {
|
|||||||
} else if (type === 'text') {
|
} else if (type === 'text') {
|
||||||
const baseUrl = $A.apiUrl('../');
|
const baseUrl = $A.apiUrl('../');
|
||||||
const array = msg.text.match(/<img\s+class="browse"[^>]*?src="(.*?)"[^>]*?>/g);
|
const array = msg.text.match(/<img\s+class="browse"[^>]*?src="(.*?)"[^>]*?>/g);
|
||||||
array.some(res => {
|
array && array.some(res => {
|
||||||
list.push(res.match(/<img\s+class="browse"[^>]*?src="(.*?)"[^>]*?>/)[1].replace(/\{\{RemoteURL\}\}/g, baseUrl))
|
list.push(res.match(/<img\s+class="browse"[^>]*?src="(.*?)"[^>]*?>/)[1].replace(/\{\{RemoteURL\}\}/g, baseUrl))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user