Files
VisualSapfor/src/_VisualDVM/Passes/All/SendBugReport.java

28 lines
1.1 KiB
Java
Raw Normal View History

2024-10-14 12:14:01 +03:00
package _VisualDVM.Passes.All;
2024-10-11 00:00:30 +03:00
import Common.Utils.Utils_;
import _VisualDVM.Global;
2024-10-14 15:19:13 +03:00
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
import _VisualDVM.Repository.BugReport.BugReport;
2024-10-09 22:21:57 +03:00
import _VisualDVM.Repository.BugReport.BugReportState;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
public class SendBugReport extends ComponentsRepositoryPass<BugReport> {
2023-09-17 22:13:42 +03:00
@Override
protected void ServerAction() throws Exception {
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
if (!target.project_version.isEmpty()) {
2023-09-17 22:13:42 +03:00
//отправить архив.
Command(new ServerExchangeUnit_2021(ServerCode.SendBugReport,
target.id,
Utils_.fileToBytes(target.getArchiveFile())
2023-09-17 22:13:42 +03:00
));
}
// синхрон бд
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, "", target));
2023-09-17 22:13:42 +03:00
}
@Override
protected void performFail() throws Exception {
target.state = BugReportState.draft;
2023-09-17 22:13:42 +03:00
}
}