Browse Source

REPORT-101166 【版本管理三期】集群环境,版本管理页面所有配置项都不可点

newui
Destiny.Lin 1 year ago
parent
commit
36d59dff5c
  1. 40
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

40
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -496,10 +496,7 @@ public class PreferencePane extends BasicPane {
saveCommitCheckBox.setVisible(!useV2); saveCommitCheckBox.setVisible(!useV2);
useVcsAutoCleanScheduleCheckBox.setSelected(useV2); useVcsAutoCleanScheduleCheckBox.setSelected(useV2);
useVcsAutoSaveScheduleCheckBox.setSelected(useV2); useVcsAutoSaveScheduleCheckBox.setSelected(useV2);
boolean useAutoClean =useV2 && FineScheduler.getInstance().isStarted(); checkAutoScheduleStartAndUpdateStatus();
useVcsAutoCleanScheduleCheckBox.setEnabled(useAutoClean);
autoCleanIntervalComboBox.setEnabled(useAutoClean);
autoCleanRetainIntervalComboBox.setEnabled(useAutoClean);
useVcsAutoSaveScheduleCheckBox.setEnabled(useV2); useVcsAutoSaveScheduleCheckBox.setEnabled(useV2);
} }
}); });
@ -518,14 +515,39 @@ public class PreferencePane extends BasicPane {
autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Content"))); autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Content")));
autoCleanPane.add(autoCleanRetainIntervalComboBox); autoCleanPane.add(autoCleanRetainIntervalComboBox);
autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Last"))); autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Last")));
boolean useAutoClean = !VcsHelper.getInstance().isLegacyMode() && FineScheduler.getInstance().isStarted(); checkAutoScheduleStartAndUpdateStatus();
useVcsAutoCleanScheduleCheckBox.setEnabled(useAutoClean);
autoCleanIntervalComboBox.setEnabled(useAutoClean);
autoCleanRetainIntervalComboBox.setEnabled(useAutoClean);
autoCleanPane.setVisible(false); autoCleanPane.setVisible(false);
return autoCleanPane; return autoCleanPane;
} }
private void checkAutoScheduleStartAndUpdateStatus() {
if (!VcsHelper.getInstance().isLegacyMode()) {
new SwingWorker<Boolean, Void>() {
@Override
protected Boolean doInBackground() throws Exception {
return WorkContext.getCurrent().get(VcsAutoCleanOperator.class).isSupport();
}
@Override
protected void done() {
try {
boolean useAutoClean = get();
updateAutoCleanEnabled(useAutoClean);
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
}
}.execute();
} else {
updateAutoCleanEnabled(false);
}
}
private void updateAutoCleanEnabled(boolean b) {
useVcsAutoCleanScheduleCheckBox.setEnabled(b);
autoCleanIntervalComboBox.setEnabled(b);
autoCleanRetainIntervalComboBox.setEnabled(b);
}
private JPanel createSaveIntervalPane() { private JPanel createSaveIntervalPane() {
JPanel saveIntervalPane = new JPanel(FRGUIPaneFactory.createLeftZeroLayout()); JPanel saveIntervalPane = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());
useVcsAutoSaveScheduleCheckBox = new UICheckBox(); useVcsAutoSaveScheduleCheckBox = new UICheckBox();
@ -1192,6 +1214,7 @@ public class PreferencePane extends BasicPane {
} else { } else {
VcsHelper.getInstance().stopAutoSave(); VcsHelper.getInstance().stopAutoSave();
} }
if (useVcsAutoCleanScheduleCheckBox.isEnabled()) {
if (useVcsAutoCleanScheduleCheckBox.isSelected()) { if (useVcsAutoCleanScheduleCheckBox.isSelected()) {
FineLoggerFactory.getLogger().info("[VcsV2] start auto clean!"); FineLoggerFactory.getLogger().info("[VcsV2] start auto clean!");
WorkContext.getCurrent().get(VcsAutoCleanOperator.class).addOrUpdateVcsAutoCleanJob( WorkContext.getCurrent().get(VcsAutoCleanOperator.class).addOrUpdateVcsAutoCleanJob(
@ -1202,6 +1225,7 @@ public class PreferencePane extends BasicPane {
WorkContext.getCurrent().get(VcsAutoCleanOperator.class).stopVcsAutoCleanJob(VcsAutoCleanService.VCS_AUTO_CLEAN_JOB_NAME); WorkContext.getCurrent().get(VcsAutoCleanOperator.class).stopVcsAutoCleanJob(VcsAutoCleanService.VCS_AUTO_CLEAN_JOB_NAME);
} }
} }
}
return null; return null;
} }
}.execute(); }.execute();

Loading…
Cancel
Save