-
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.
Browse files
Browse the repository at this point in the history
* Change some icons
- Loading branch information
Showing
59 changed files
with
1,681 additions
and
1,025 deletions.
There are no files selected for viewing
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
Binary file not shown.
Binary file added
BIN
+117 KB
...in/frontend/generated/jar-resources/images/custom-images/change-permissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+237 KB
src/main/frontend/generated/jar-resources/images/custom-images/play-button.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+874 KB
src/main/frontend/generated/jar-resources/images/custom-images/using-combo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.89 MB
src/main/frontend/generated/jar-resources/images/custom-images/write_flash.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Empty file.
10 changes: 10 additions & 0 deletions
10
src/main/frontend/themes/espflow/views/flash-view/wizard-dialog/wizard-dialog.css
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,10 @@ | ||
.avatar-step-inactive { | ||
color: black; | ||
border: 1px solid black; | ||
background-color: white; | ||
} | ||
|
||
.avatar-step-active { | ||
background: var(--lumo-primary-color); | ||
color: var(--lumo-primary-contrast-color); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.esp.espflow.entity; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Entity | ||
@Table(name = "wizard_flashesp") | ||
public class WizardEspEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private boolean isWizardEnabled; | ||
private String name; | ||
|
||
} |
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,9 @@ | ||
package com.esp.espflow.entity.dto; | ||
|
||
import lombok.Builder; | ||
|
||
/** | ||
* @author rub'n | ||
*/ | ||
@Builder | ||
public record WizardEspDto(boolean isWizardEnabled, String name) {} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/esp/espflow/entity/event/DialogHideEvent.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,5 @@ | ||
package com.esp.espflow.entity.event; | ||
|
||
public enum DialogHideEvent { | ||
HIDE | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/esp/espflow/mappers/WizardEspMapper.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,29 @@ | ||
package com.esp.espflow.mappers; | ||
|
||
import com.esp.espflow.entity.WizardEspEntity; | ||
import com.esp.espflow.entity.dto.WizardEspDto; | ||
|
||
/** | ||
* @author rub'n | ||
*/ | ||
public class WizardEspMapper { | ||
|
||
public static final WizardEspMapper INSTANCE = new WizardEspMapper(); | ||
|
||
private WizardEspMapper() { | ||
} | ||
|
||
public WizardEspEntity dtoToEntity(final WizardEspDto dto) { | ||
final WizardEspEntity entity = new WizardEspEntity(); | ||
entity.setName(dto.name()); | ||
entity.setWizardEnabled(dto.isWizardEnabled()); | ||
return entity; | ||
} | ||
|
||
public WizardEspDto entityToDto(final WizardEspEntity entity) { | ||
return WizardEspDto.builder() | ||
.name(entity.getName()) | ||
.isWizardEnabled(entity.isWizardEnabled()) | ||
.build(); | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/esp/espflow/security/UserDetailsServiceImpl.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
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
2 changes: 1 addition & 1 deletion
2
...m/esp/espflow/service/UserRepository.java → ...w/service/respository/UserRepository.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
14 changes: 14 additions & 0 deletions
14
src/main/java/com/esp/espflow/service/respository/WizardEspRepository.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,14 @@ | ||
package com.esp.espflow.service.respository; | ||
|
||
import com.esp.espflow.entity.WizardEspEntity; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Optional; | ||
|
||
@Repository | ||
public interface WizardEspRepository extends JpaRepository<WizardEspEntity, Long> { | ||
|
||
Optional<WizardEspEntity> findByName(String name); | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/com/esp/espflow/service/respository/impl/WizardEspService.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,52 @@ | ||
package com.esp.espflow.service.respository.impl; | ||
|
||
import com.esp.espflow.entity.WizardEspEntity; | ||
import com.esp.espflow.entity.dto.WizardEspDto; | ||
import com.esp.espflow.mappers.WizardEspMapper; | ||
import com.esp.espflow.service.respository.WizardEspRepository; | ||
import jakarta.transaction.Transactional; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.log4j.Log4j2; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.Optional; | ||
|
||
/** | ||
* @author rub'n | ||
*/ | ||
@Log4j2 | ||
@Service | ||
@RequiredArgsConstructor | ||
public class WizardEspService { | ||
|
||
private final WizardEspRepository wizardEspRepository; | ||
|
||
/** | ||
* @param wizardEspDto | ||
*/ | ||
public void save(WizardEspDto wizardEspDto) { | ||
var entity = WizardEspMapper.INSTANCE.dtoToEntity(wizardEspDto); | ||
this.wizardEspRepository.findByName(entity.getName()) | ||
.ifPresentOrElse(currentEntity -> { | ||
currentEntity.setWizardEnabled(entity.isWizardEnabled()); | ||
wizardEspRepository.save(currentEntity); | ||
log.info("Entity updated {}", currentEntity); | ||
}, () -> { | ||
wizardEspRepository.save(entity); | ||
log.info("Entity saved {}", entity); | ||
}); | ||
} | ||
|
||
/** | ||
* | ||
* @param name of this Wizard | ||
* | ||
* @return A {@link Optional< WizardEspEntity >} | ||
*/ | ||
@Transactional | ||
public Optional<WizardEspDto> findWizardFlashEsp(String name) { | ||
return this.wizardEspRepository.findByName(name) | ||
.map(WizardEspMapper.INSTANCE::entityToDto); | ||
} | ||
|
||
} |
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.