cleaner looking danger zone for app AdminTab
This commit is contained in:
parent
e556461f73
commit
80193603c6
5 changed files with 62 additions and 36 deletions
|
@ -37,6 +37,7 @@ class AcrariumCard extends PolymerElement {
|
||||||
|
|
||||||
slot[class~="divider"]::slotted(:not(:first-child)) {
|
slot[class~="divider"]::slotted(:not(:first-child)) {
|
||||||
border-top: 1px solid var(--lumo-contrast-20pct);
|
border-top: 1px solid var(--lumo-contrast-20pct);
|
||||||
|
margin-top: 0.5em;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<slot name="header" class="acrarium-card-header" on-click="handleClick"></slot>
|
<slot name="header" class="acrarium-card-header" on-click="handleClick"></slot>
|
||||||
|
|
|
@ -117,8 +117,8 @@ public class Translatable<T extends Component> extends Composite<T> implements L
|
||||||
return new Translatable<>(new TextArea("", initialValue, ""), textField -> textField.setLabel(textField.getTranslation(captionId, params)));
|
return new Translatable<>(new TextArea("", initialValue, ""), textField -> textField.setLabel(textField.getTranslation(captionId, params)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> Translatable<ComboBox<T>> createComboBox(@NonNull Collection<T> items, @NonNull String captionId, @NonNull Object... params) {
|
public static <T> Translatable.Value<ComboBox<T>, T> createComboBox(@NonNull Collection<T> items, @NonNull String captionId, @NonNull Object... params) {
|
||||||
return new Translatable<>(new ComboBox<>("", items), tComboBox -> tComboBox.setLabel(tComboBox.getTranslation(captionId, params)));
|
return new Translatable.Value<>(new ComboBox<>("", items), tComboBox -> tComboBox.setLabel(tComboBox.getTranslation(captionId, params)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> Translatable<Select<T>> createSelect(@NonNull Collection<T> items, @NonNull String captionId, @NonNull Object... params) {
|
public static <T> Translatable<Select<T>> createSelect(@NonNull Collection<T> items, @NonNull String captionId, @NonNull Object... params) {
|
||||||
|
|
|
@ -185,22 +185,35 @@ public class AdminTab extends AppTab<Div> {
|
||||||
.addYesNoButtons(p -> getDataService().changeConfiguration(app, new App.Configuration(score.getValue().intValue())), true)
|
.addYesNoButtons(p -> getDataService().changeConfiguration(app, new App.Configuration(score.getValue().intValue())), true)
|
||||||
.show();
|
.show();
|
||||||
}, Messages.CONFIGURE));
|
}, Messages.CONFIGURE));
|
||||||
NumberField age = new NumberField();
|
Box purgeAgeBox = new Box(Translatable.createLabel(Messages.PURGE_OLD), Translatable.createLabel(Messages.PURGE_OLD_DETAILS), Translatable.createButton(e -> {
|
||||||
age.setStep(1d);
|
Translatable.Value<NumberField, Double> age = Translatable.createNumberField(30d, Messages.REPORTS_OLDER_THAN1).with(it -> {
|
||||||
age.setMin(1d);
|
it.setStep(1d);
|
||||||
age.setValue(30d);
|
it.setMin(1d);
|
||||||
age.setPreventInvalidInput(true);
|
it.setPreventInvalidInput(true);
|
||||||
age.setHasControls(true);
|
it.setHasControls(true);
|
||||||
age.setWidthFull();
|
it.setWidthFull();
|
||||||
age.setSuffixComponent(Translatable.createLabel(Messages.REPORTS_OLDER_THAN2));
|
it.setSuffixComponent(Translatable.createLabel(Messages.REPORTS_OLDER_THAN2));
|
||||||
FlexLayout purgeAge = new FlexLayout();
|
}
|
||||||
purgeAge.setWidthFull();
|
);
|
||||||
purgeAge.preventWhiteSpaceBreaking();
|
new Popup().addComponent(age)
|
||||||
purgeAge.setAlignItems(FlexComponent.Alignment.CENTER);
|
.addYesNoButtons(popup -> {
|
||||||
purgeAge.add(Translatable.createButton(e -> getDataService().deleteReportsOlderThanDays(app, age.getValue().intValue()), Messages.PURGE),
|
getDataService().deleteReportsOlderThanDays(app, age.getValue().intValue());
|
||||||
Translatable.createLabel(Messages.REPORTS_OLDER_THAN1),
|
}, true).show();
|
||||||
age);
|
}, Messages.PURGE));
|
||||||
purgeAge.expand(age);
|
Box purgeVersionBox = new Box(Translatable.createLabel(Messages.PURGE_VERSION), Translatable.createLabel(Messages.PURGE_VERSION_DETAILS), Translatable.createButton(e -> {
|
||||||
|
Translatable.Value<ComboBox<Integer>, Integer> versionBox = Translatable.createComboBox(getDataService().getFromReports(app, null, report.stacktrace.version.code), Messages.REPORTS_BEFORE_VERSION);
|
||||||
|
new Popup().addComponent(versionBox)
|
||||||
|
.addYesNoButtons(popup -> {
|
||||||
|
if (versionBox.getValue() != null) {
|
||||||
|
getDataService().deleteReportsBeforeVersion(app, versionBox.getValue());
|
||||||
|
}
|
||||||
|
}, true).show();
|
||||||
|
}, Messages.PURGE));
|
||||||
|
Box deleteBox = new Box(Translatable.createLabel(Messages.DELETE_APP), Translatable.createLabel(Messages.DELETE_APP_DETAILS), Translatable.createButton(e ->
|
||||||
|
new Popup().setTitle(Messages.DELETE_APP_CONFIRM).addYesNoButtons(popup -> {
|
||||||
|
getDataService().delete(app);
|
||||||
|
UI.getCurrent().navigate(Overview.class);
|
||||||
|
}, true).show(), Messages.DELETE));
|
||||||
ComboBox<Integer> versionBox = new ComboBox<>(null, getDataService().getFromReports(app, null, QReport.report.stacktrace.version.code));
|
ComboBox<Integer> versionBox = new ComboBox<>(null, getDataService().getFromReports(app, null, QReport.report.stacktrace.version.code));
|
||||||
versionBox.setWidth("100%");
|
versionBox.setWidth("100%");
|
||||||
FlexLayout purgeVersion = new FlexLayout();
|
FlexLayout purgeVersion = new FlexLayout();
|
||||||
|
@ -218,7 +231,7 @@ public class AdminTab extends AppTab<Div> {
|
||||||
UI.getCurrent().navigate(Overview.class);
|
UI.getCurrent().navigate(Overview.class);
|
||||||
}, true).show(), Messages.DELETE_APP);
|
}, true).show(), Messages.DELETE_APP);
|
||||||
deleteButton.setWidthFull();
|
deleteButton.setWidthFull();
|
||||||
Card dangerCard = createCard(configBox, matchingBox, purgeAge, purgeVersion, deleteButton);
|
Card dangerCard = createCard(configBox, matchingBox, purgeAgeBox, purgeVersionBox, deleteBox);
|
||||||
dangerCard.setHeader(Translatable.createLabel(Messages.DANGER_ZONE));
|
dangerCard.setHeader(Translatable.createLabel(Messages.DANGER_ZONE));
|
||||||
dangerCard.enableDivider();
|
dangerCard.enableDivider();
|
||||||
dangerCard.setHeaderColor("var(----lumo-error-text-color)", "var(--lumo-error-color)");
|
dangerCard.setHeaderColor("var(----lumo-error-text-color)", "var(--lumo-error-color)");
|
||||||
|
|
|
@ -50,7 +50,7 @@ solved=Gelöst
|
||||||
statistics=Statistiken
|
statistics=Statistiken
|
||||||
newAcraConfig=Erzeuge neue ACRA Konfiguration
|
newAcraConfig=Erzeuge neue ACRA Konfiguration
|
||||||
confirm=Bestätigen
|
confirm=Bestätigen
|
||||||
newAcraConfigConfirm=Sind Sie sicher dass Sie eine neue ACRA Konfiguration erzeugen wollen?<br>Die existierende Konfiguration wird dadurch ungültig
|
newAcraConfigConfirm=Sind Sie sicher dass Sie eine neue ACRA Konfiguration erzeugen wollen? Die existierende Konfiguration wird dadurch ungültig
|
||||||
newBugConfig=Bugzusammenfassung konfigurieren
|
newBugConfig=Bugzusammenfassung konfigurieren
|
||||||
minScore=Minimaler Score
|
minScore=Minimaler Score
|
||||||
newBugConfigConfirm=Sind Sie sicher dass sie diese Konfiguration speichern wollen? Alle Bugs werden überprüft, was eine Weile dauern kann. Beachten Sie außerdem, dass ein höherer Wert keine bereits gebildeten Zusammenfassungen auflöst.
|
newBugConfigConfirm=Sind Sie sicher dass sie diese Konfiguration speichern wollen? Alle Bugs werden überprüft, was eine Weile dauern kann. Beachten Sie außerdem, dass ein höherer Wert keine bereits gebildeten Zusammenfassungen auflöst.
|
||||||
|
@ -170,3 +170,9 @@ other=Weitere
|
||||||
newAcraConfigDetails=Nützlich wenn Sie die Konfiguration vergessen haben oder invalidieren wollen
|
newAcraConfigDetails=Nützlich wenn Sie die Konfiguration vergessen haben oder invalidieren wollen
|
||||||
configure=Konfigurieren
|
configure=Konfigurieren
|
||||||
newBugConfigDetails=Anpassen wie ähnlich Bugs sein müssen um automatisch zusammgeführt zu werden
|
newBugConfigDetails=Anpassen wie ähnlich Bugs sein müssen um automatisch zusammgeführt zu werden
|
||||||
|
purgeOld=Lösche alte Berichte
|
||||||
|
purgeOldDetails=Lösche Berichte, die älter als das gegebene Datum sind
|
||||||
|
purgeVersion=Lösche Berichte aus alten Versionen
|
||||||
|
purgeVersionDetails=Lösche Berichte, die älter als die gegebene Version sind
|
||||||
|
deleteAppDetails=Lösche diese App und alle zugehörigen Daten
|
||||||
|
delete=Lösche
|
|
@ -50,7 +50,7 @@ solved=Solved
|
||||||
statistics=Statistics
|
statistics=Statistics
|
||||||
newAcraConfig=Create new ACRA Configuration
|
newAcraConfig=Create new ACRA Configuration
|
||||||
confirm=Confirm
|
confirm=Confirm
|
||||||
newAcraConfigConfirm=Are you sure you want to create a new ACRA configuration?<br>The existing configuration will be invalidated
|
newAcraConfigConfirm=Are you sure you want to create a new ACRA configuration? The existing configuration will be invalidated
|
||||||
newBugConfig=Configure Bug matching
|
newBugConfig=Configure Bug matching
|
||||||
minScore=Minimum Score
|
minScore=Minimum Score
|
||||||
newBugConfigConfirm=Are you sure you want to save this configuration?\
|
newBugConfigConfirm=Are you sure you want to save this configuration?\
|
||||||
|
@ -172,3 +172,9 @@ other=Other
|
||||||
newAcraConfigDetails=Useful if you forgot or want to invalidate the old configuration
|
newAcraConfigDetails=Useful if you forgot or want to invalidate the old configuration
|
||||||
configure=Configure
|
configure=Configure
|
||||||
newBugConfigDetails=Change how similar bugs have to be to be merged automatically
|
newBugConfigDetails=Change how similar bugs have to be to be merged automatically
|
||||||
|
purgeOld=Purge old reports
|
||||||
|
purgeOldDetails=Delete reports older than a certain date
|
||||||
|
purgeVersion=Purge reports from previous versions
|
||||||
|
purgeVersionDetails=Delete reports older than a certain version
|
||||||
|
deleteAppDetails=Delete this app and all data associated with it
|
||||||
|
delete=Delete
|
Loading…
Reference in a new issue