OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
leantime.settingController = (function () {
// Variables (underscore for private variables)
var publicThing = "not secret";
var _privateThing = "secret";
var _uploadResult;
//Functions
var readURL = function (input) {
clearCroppie();
if (input.files && input.files[0]) {
var reader = new FileReader();
var profileImg = jQuery('#logoImg');
reader.onload = function (e) {
//profileImg.attr('src', e.currentTarget.result);
_uploadResult = profileImg
.croppie(
{
enableExif: true,
enforceBoundary: false,
viewport:{
width: 220,
height: 40,
type: 'square'
},
boundary: {
width: 400,
height: 200
}
}
);
_uploadResult.croppie(
'bind',
{
url: e.currentTarget.result
}
);
jQuery("#previousImage").hide();
};
reader.readAsDataURL(input.files[0]);
}
};
var clearCroppie = function () {
jQuery('#logoImg').croppie('destroy');
jQuery("#previousImage").show();
};
var saveCroppie = function () {
jQuery('#save-logo').addClass('running');
jQuery('#logoImg').attr('src', leantime.appUrl + '/images/loaders/loader28.gif');
_uploadResult.croppie(
'result',
{
type: "blob",
circle: false,
size: "original",
quality:1
}
).then(
function (result) {
leantime.settingService.saveLogo(result);
}
);
};
// Make public what you want to have public, everything else is private
return {
readURL: readURL,
clearCroppie: clearCroppie,
saveCroppie: saveCroppie
};
})();

View File

@@ -0,0 +1,39 @@
leantime.settingRepository = (function () {
// Variables (underscore for private variables)
var publicThing = "not secret";
var _privateThing = "secret";
//Constructor
(function () {
})();
//Functions
var saveLogo = function (photo) {
var formData = new FormData();
formData.append('file', photo);
jQuery.ajax(
{
type: 'POST',
url: leantime.appUrl + '/setting/logo',
data: formData,
processData: false,
contentType: false,
success: function (resp) {
jQuery('#save-logo').removeClass('running');
location.reload();
},
error: function (err) {
console.log(err);
}
}
);
};
// Make public what you want to have public, everything else is private
return {
saveLogo: saveLogo
};
})();

View File

@@ -0,0 +1,22 @@
leantime.settingService = (function () {
// Variables (underscore for private variables)
var publicThing = "not secret";
var _privateThing = "secret";
//Constructor
(function () {
})();
//Functions
var saveLogo = function (photo) {
leantime.settingRepository.saveLogo(photo);
};
// Make public what you want to have public, everything else is private
return {
saveLogo: saveLogo
};
})();