This commit is contained in:
Eason010212
2024-06-29 14:10:56 +08:00
2 changed files with 54 additions and 8 deletions

View File

@@ -50,6 +50,11 @@ https://gitee.com/bnu_mixly/mixio-linux-x86-dist/blob/darwin/mixio
4. Windows版可直接双击mixio.exe查看更多选项
5. Linux/MacOS版 可mixio install将mixio添加到systemctl中
## 不同版本间数据迁移
1. 复制服务器目录下的reserve文件夹进行替换即可完成数据迁移
2. 复制服务器目录下的config文件夹进行替换即可完成配置选项迁移新老版本间的配置文件可能存在差异建议手动配置
## 从源码运行debug模式
1. git clone https://gitee.com/mixly2/mixio.git

View File

@@ -3755,14 +3755,55 @@ var exportProjects = function() {
"timestamp": res[i].timestamp
})
}
var eleLink = document.createElement('a');
eleLink.download = "backup.json";
eleLink.style.display = 'none';
var blob = new Blob([JSON.stringify(exportRes, null, 4)]);
eleLink.href = URL.createObjectURL(blob);
document.body.appendChild(eleLink);
eleLink.click();
document.body.removeChild(eleLink);
// dialog, 允许用户选择导出哪些项目
var editForm = $('<div class="nnt" style="width:294px"/>')
editForm.append($('<div style="margin-top:-63px;margin-left:105px;margin-bottom:15px;box-shadow: 1px 1px 20px #4e73df;background-color:white;width:75px;height:75px;padding:40px;border-radius:80px;border:solid #4e73df 3px;display:flex;align-items:center;justify-content:center"><img src="icons/transfer.svg" style="width:45px;"></div>'))
editForm.append($('<h3 style="text-align:center;margin-bottom:5px">' + arrLang[lang].EXPORT + '</h3>'))
// 选择导出项目多选input选项为所有项目的projectName
var checkBoxes = $('<div style="display:flex;flex-direction:column;max-height:200px;overflow:auto"/>')
for (i in exportRes) {
var checkbox = $('<input type="checkbox" style="width:20px;height:20px;min-width:0!important;min-height:0!important;margin:10px" id="' + exportRes[i].projectName + '"/>')
var label = $('<label style="color:black;font-size:1rem;padding-top:2px" for="' + exportRes[i].projectName + '">' + exportRes[i].projectName + '</label>')
// 默认选中
checkbox.prop("checked", true)
checkBoxes.append($('<div style="display:flex;flex-direction:row;align-items:center;"/>').append(checkbox).append(label))
}
editForm.append(checkBoxes)
var bottomDiv = $('<div style="width:100%;margin-top:15px;display:flex;flex-direction:row;align-items:center;justify-content:space-around"/>')
var confirmEdit = $('<a class="btn btn-success btn-circle" style="box-shadow:1px 1px 5px #1cc88a"><i class="fa fa-check"></i></a>')
var cancelEdit = $('<a class="btn btn-danger btn-circle" style="box-shadow:1px 1px 5px #e74a3b"><i class="fa fa-arrow-left"></i></a>')
bottomDiv.append(confirmEdit)
bottomDiv.append(cancelEdit)
editForm.append(bottomDiv)
var modifyDia = dialog({
content: editForm[0],
cancel: false
})
modifyDia.showModal()
confirmEdit.click(function() {
var eleLink = document.createElement('a');
eleLink.download = "backup.json";
eleLink.style.display = 'none';
var selectedProjects = []
for (i in exportRes) {
if ($("#" + exportRes[i].projectName).prop("checked"))
selectedProjects.push(exportRes[i].projectName)
}
var selectedData = []
for (i in exportRes) {
if (selectedProjects.includes(exportRes[i].projectName))
selectedData.push(exportRes[i])
}
var blob = new Blob([JSON.stringify(selectedData, null, 4)]);
eleLink.href = URL.createObjectURL(blob);
document.body.appendChild(eleLink);
eleLink.click();
document.body.removeChild(eleLink);
modifyDia.close().remove()
})
cancelEdit.click(function() {
modifyDia.close().remove()
})
} else
showtext("Unknown Error")
})