-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change some icons
- Loading branch information
Showing
26 changed files
with
940 additions
and
279 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
src/main/frontend/generated/jar-resources/images/svg-icons/broken-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
src/main/frontend/generated/jar-resources/images/svg-icons/usb-port-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/com/esp/espflow/entity/event/EspMessageListItemEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.esp.espflow.entity.event; | ||
|
||
import com.esp.espflow.util.svgfactory.SvgFactory; | ||
import com.vaadin.flow.component.messages.MessageListItem; | ||
import com.vaadin.flow.server.StreamResource; | ||
import lombok.extern.log4j.Log4j2; | ||
|
||
import java.security.SecureRandom; | ||
import java.time.LocalDateTime; | ||
import java.time.ZoneOffset; | ||
import java.util.Arrays; | ||
|
||
import static com.esp.espflow.util.EspFlowConstants.FRONTEND_IMAGES_SVG_ICONS; | ||
|
||
/** | ||
* @author rub'n | ||
*/ | ||
@Log4j2 | ||
public class EspMessageListItemEvent extends MessageListItem { | ||
/* | ||
* For Custom colors | ||
*/ | ||
private static final SecureRandom SECURE_RANDOM = new SecureRandom(); | ||
|
||
public EspMessageListItemEvent(String operation, String port) { | ||
super.setText(operation); | ||
super.setTime(LocalDateTime.now().toInstant(ZoneOffset.UTC)); | ||
super.setUserName(port); | ||
this.setCustomImage(); | ||
var colors = Arrays.asList(0, 1, 2, 3, 4, 5, 6); | ||
super.setUserColorIndex(colors.get(SECURE_RANDOM.nextInt(colors.size()))); | ||
} | ||
|
||
private void setCustomImage() { | ||
final StreamResource resource = new StreamResource("usb-port-black.svg", | ||
() -> SvgFactory.class.getResourceAsStream(FRONTEND_IMAGES_SVG_ICONS + "usb-port-black.svg")); | ||
super.setUserImageResource(resource); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.