Compare commits

...

2 Commits

Author SHA1 Message Date
Sheldan
aa1ffc7ce0 [SIS-xxx] updating abstracto to get @time duration handling
adding instant parsing ability for meetup parameter
remove change meetup time text command
removing not needed method
2026-02-15 23:11:31 +01:00
Sheldan
82378e3f5e [SIS-xxx] updating grafana dashboards
adding http request panel
updating abstracto versions to get http metric and remind hint text
2026-01-08 00:40:29 +01:00
10 changed files with 183 additions and 83 deletions

2
.env
View File

@@ -1,4 +1,4 @@
REGISTRY_PREFIX=harbor.sheldan.dev/sissi/
ABSTRACTO_PREFIX=harbor.sheldan.dev/abstracto/
VERSION=1.5.20
ABSTRACTO_VERSION=1.6.19
ABSTRACTO_VERSION=1.6.20

View File

@@ -5,7 +5,6 @@ import dev.sheldan.abstracto.core.command.condition.AbstractConditionableCommand
import dev.sheldan.abstracto.core.command.config.CommandConfiguration;
import dev.sheldan.abstracto.core.command.config.HelpInfo;
import dev.sheldan.abstracto.core.command.config.Parameter;
import dev.sheldan.abstracto.core.command.execution.CommandContext;
import dev.sheldan.abstracto.core.command.execution.CommandResult;
import dev.sheldan.abstracto.core.config.FeatureDefinition;
import dev.sheldan.abstracto.core.interaction.ComponentService;
@@ -13,10 +12,7 @@ import dev.sheldan.abstracto.core.interaction.InteractionService;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandConfig;
import dev.sheldan.abstracto.core.interaction.slash.SlashCommandPrivilegeLevels;
import dev.sheldan.abstracto.core.interaction.slash.parameter.SlashCommandParameterService;
import dev.sheldan.abstracto.core.service.ChannelService;
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
import dev.sheldan.abstracto.core.templating.service.TemplateService;
import dev.sheldan.abstracto.core.utils.FutureUtils;
import dev.sheldan.abstracto.core.utils.ParseUtils;
import dev.sheldan.sissi.module.meetup.config.MeetupFeatureDefinition;
import dev.sheldan.sissi.module.meetup.config.MeetupSlashCommandNames;
import dev.sheldan.sissi.module.meetup.exception.MeetupPastTimeException;
@@ -57,44 +53,6 @@ public class ChangeMeetupTime extends AbstractConditionableCommand {
@Autowired
private MeetupServiceBean meetupServiceBean;
@Autowired
private ChannelService channelService;
@Autowired
private TemplateService templateService;
@Override
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
List<Object> parameters = commandContext.getParameters().getParameters();
Long meetupId = (Long) parameters.get(0);
Meetup meetup = meetupManagementServiceBean.getMeetup(meetupId, commandContext.getGuild().getIdLong());
if(!meetup.getOrganizer().getUserReference().getId().equals(commandContext.getAuthor().getIdLong())) {
throw new NotMeetupOrganizerException();
}
Long newTimestamp = (Long) parameters.get(1);
Instant newMeetupTime = Instant.ofEpochSecond(newTimestamp);
if(newMeetupTime.isBefore(Instant.now())) {
throw new MeetupPastTimeException();
}
String confirmationId = componentService.generateComponentId();
String cancelId = componentService.generateComponentId();
MeetupChangeTimeConfirmationModel model = MeetupChangeTimeConfirmationModel
.builder()
.meetupTime(newMeetupTime)
.topic(meetup.getTopic())
.description(meetup.getDescription())
.userId(commandContext.getAuthor().getIdLong())
.guildId(commandContext.getGuild().getIdLong())
.meetupId(meetupId)
.confirmationId(confirmationId)
.cancelId(cancelId)
.build();
MessageToSend messageToSend = templateService.renderEmbedTemplate(CHANGE_MEETUP_TIME_CONFIRMATION, model, commandContext.getGuild().getIdLong());
return FutureUtils.toSingleFutureGeneric(channelService.sendMessageToSendToChannel(messageToSend, commandContext.getChannel()))
.thenAccept(unused -> meetupServiceBean.storeMeetupChangeTimeConfirmation(model))
.thenApply(unused -> CommandResult.fromSuccess());
}
@Override
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
Long meetupId = slashCommandParameterService.getCommandOption(MEETUP_ID_PARAMETER, event, Integer.class).longValue();
@@ -102,8 +60,8 @@ public class ChangeMeetupTime extends AbstractConditionableCommand {
if(!meetup.getOrganizer().getUserReference().getId().equals(event.getMember().getIdLong())) {
throw new NotMeetupOrganizerException();
}
Integer time = slashCommandParameterService.getCommandOption(MEETUP_NEW_TIMESTAMP_PARAMETER, event, Long.class, Integer.class);
Instant meetupTime = Instant.ofEpochSecond(time);
String time = slashCommandParameterService.getCommandOption(MEETUP_NEW_TIMESTAMP_PARAMETER, event, String.class, String.class);
Instant meetupTime = ParseUtils.parseInstant(time);
if(meetupTime.isBefore(Instant.now())) {
throw new MeetupPastTimeException();
}
@@ -138,7 +96,7 @@ public class ChangeMeetupTime extends AbstractConditionableCommand {
.builder()
.templated(true)
.name(MEETUP_NEW_TIMESTAMP_PARAMETER)
.type(Long.class)
.type(Instant.class)
.build();
List<Parameter> parameters = Arrays.asList(meetupIdParameter, newTimeStampParameter);
@@ -162,6 +120,7 @@ public class ChangeMeetupTime extends AbstractConditionableCommand {
.async(true)
.slashCommandConfig(slashCommandConfig)
.supportsEmbedException(true)
.slashCommandOnly(true)
.causesReaction(true)
.parameters(parameters)
.help(helpInfo)

View File

@@ -23,6 +23,7 @@ import dev.sheldan.abstracto.core.service.management.UserInServerManagementServi
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
import dev.sheldan.abstracto.core.templating.service.TemplateService;
import dev.sheldan.abstracto.core.utils.FutureUtils;
import dev.sheldan.abstracto.core.utils.ParseUtils;
import dev.sheldan.sissi.module.meetup.config.MeetupFeatureDefinition;
import dev.sheldan.sissi.module.meetup.config.MeetupSlashCommandNames;
import dev.sheldan.sissi.module.meetup.model.command.MeetupConfirmationModel;
@@ -114,7 +115,7 @@ public class CreateMeetup extends AbstractConditionableCommand {
@Override
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
Integer time = slashCommandParameterService.getCommandOption(MEETUP_TIME_PARAMETER, event, Long.class, Integer.class);
String time = slashCommandParameterService.getCommandOption(MEETUP_TIME_PARAMETER, event, Instant.class, String.class);
String topic = slashCommandParameterService.getCommandOption(TOPIC_PARAMETER, event, String.class);
String description;
if(slashCommandParameterService.hasCommandOption(DESCRIPTION_PARAMETER, event)) {
@@ -129,7 +130,7 @@ public class CreateMeetup extends AbstractConditionableCommand {
} else {
location = DEFAULT_LOCATION_STRING;
}
Instant meetupTime = Instant.ofEpochSecond(time);
Instant meetupTime = ParseUtils.parseInstant(time);
AUserInAServer organizer = userInServerManagementService.loadOrCreateUser(event.getMember());
AChannel meetupChannel = channelManagementService.loadChannel(event.getChannel().getIdLong());
Meetup meetup = meetupManagementServiceBean.createMeetup(meetupTime, topic, description, organizer, meetupChannel, location);

View File

@@ -30,10 +30,6 @@ public class MeetupComponentManagementServiceBean {
return meetupComponentRepository.save(component);
}
public void deleteComponent(MeetupComponent meetupComponent) {
meetupComponentRepository.delete(meetupComponent);
}
public void deleteAllComponents(Meetup meetup) {
meetupComponentRepository.deleteAll(meetup.getMeetupComponents());
}

View File

@@ -20,7 +20,6 @@
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
@@ -33,11 +32,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -69,7 +70,7 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
@@ -95,10 +96,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -127,11 +130,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -163,7 +168,7 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
@@ -189,10 +194,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -221,11 +228,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -257,7 +266,7 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
@@ -283,10 +292,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -315,11 +326,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -351,7 +364,7 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
@@ -377,10 +390,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -409,11 +424,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -445,7 +462,7 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
@@ -471,10 +488,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -542,11 +561,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -578,7 +599,7 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
@@ -604,10 +625,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -636,11 +659,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -672,7 +697,7 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
@@ -698,10 +723,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -730,11 +757,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -766,7 +795,7 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
@@ -792,10 +821,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -824,11 +855,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -860,7 +893,100 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 15,
"w": 24,
"x": 0,
"y": 32
},
"id": 11,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"editorMode": "code",
"expr": "increase(jda_request_total{namespace=\"sissi\"}[1m]) / 2",
"legendFormat": "{{ "{{" }} http_key {{ "}}" }}",
"range": true,
"refId": "A"
}
],
"title": "HTTP Requests",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
@@ -875,7 +1001,7 @@
"h": 16,
"w": 24,
"x": 0,
"y": 32
"y": 47
},
"id": 9,
"options": {
@@ -886,10 +1012,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -908,18 +1036,21 @@
"type": "timeseries"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 38,
"style": "dark",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": [
{
"current": {
"text": "Sissi",
"value": "Sissi"
},
"hide": 2,
"label": "",
"name": "application",
"query": "Sissi",
"skipUrlSync": false,
"skipUrlSync": true,
"type": "constant"
}
]
@@ -932,7 +1063,7 @@
"timezone": "",
"title": "Sissi Discord status",
"uid": "a7b3297d-972e-4dbd-9223-88d589817d34",
"version": 2,
"version": 3,
"weekStart": ""
},
"overwrite": true

View File

@@ -20,8 +20,8 @@
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 12,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
@@ -29,6 +29,10 @@
"uid": "loki"
},
"description": "Display logs and search for logs",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 13,
"w": 24,
@@ -38,6 +42,7 @@
"id": 4,
"options": {
"dedupStrategy": "none",
"enableInfiniteScrolling": false,
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
@@ -46,6 +51,7 @@
"sortOrder": "Ascending",
"wrapLogMessage": true
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -68,6 +74,10 @@
"uid": "loki"
},
"description": "Any line on level ERROR",
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
@@ -77,6 +87,7 @@
"id": 2,
"options": {
"dedupStrategy": "none",
"enableInfiniteScrolling": false,
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
@@ -85,6 +96,7 @@
"sortOrder": "Ascending",
"wrapLogMessage": true
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -113,11 +125,13 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@@ -149,7 +163,7 @@
"steps": [
{
"color": "green",
"value": null
"value": 0
},
{
"color": "red",
@@ -175,10 +189,12 @@
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "12.1.1",
"targets": [
{
"datasource": {
@@ -195,20 +211,18 @@
"type": "timeseries"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 38,
"style": "dark",
"schemaVersion": 41,
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "",
"value": ""
},
"description": "What to search in the logs",
"hide": 0,
"name": "logFilter",
"options": [
{
@@ -218,7 +232,6 @@
}
],
"query": "",
"skipUrlSync": false,
"type": "textbox"
}
]
@@ -231,7 +244,7 @@
"timezone": "",
"title": "Sissi Logs",
"uid": "a5b429af-860c-4438-a575-24bed6dcba09",
"version": 2,
"version": 3,
"weekStart": ""
},
"overwrite": true

View File

@@ -94,7 +94,7 @@ templateDeployment:
repository: harbor.sheldan.dev/abstracto
pullPolicy: Always
image: abstracto-template-deployment
tag: 1.6.19
tag: 1.6.20
templateDeploymentData:
repository: harbor.sheldan.dev/sissi
pullPolicy: Always
@@ -105,7 +105,7 @@ dbConfigDeployment:
repository: harbor.sheldan.dev/abstracto
pullPolicy: Always
image: abstracto-db-deployment
tag: 1.6.19
tag: 1.6.20
dbConfigDeploymentData:
repository: harbor.sheldan.dev/sissi
pullPolicy: Always

View File

@@ -18,8 +18,8 @@
<properties>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<abstracto.version>1.6.19</abstracto.version>
<abstracto.templates.version>1.4.65</abstracto.templates.version>
<abstracto.version>1.6.20</abstracto.version>
<abstracto.templates.version>1.4.66</abstracto.templates.version>
<apache-jena.version>4.9.0</apache-jena.version>
<rssreader.version>3.5.0</rssreader.version>
<jsoup.version>1.21.2</jsoup.version>

View File

@@ -1 +1 @@
New time of the meetup (https://www.unixtimestamp.com/)
New time of the meetup (https://www.unixtimestamp.com/) or use @time: <time>

View File

@@ -1 +1 @@
Time of the meetup (https://www.unixtimestamp.com/)
Time of the meetup (https://www.unixtimestamp.com/) or use @time: <time>