Merge pull request #110 from bsinno/create-theme-customization-example
hawkBit app example that demonstrates theme customisation
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
Example projects that show how hawkBit can be used to create, run or access an hawkBit empowered update server.
|
Example projects that show how _hawkBit_ can be used to create, run or access an _hawkBit_ empowered update server.
|
||||||
|
|
||||||
|
- `hawkbit-device-simulator` : Simulates device software updates, leveraging the hawkBit device integration options.
|
||||||
|
- `hawkbit-example-app` : Allows you to run a Spring Boot and hawkBit based update server. Includes all _hawkBit_ interfaces, i.e. DDI, DMF, Mgmt-API, Mgmt-UI.
|
||||||
|
- `hawkbit-custom-theme-example` : Example for a customized theme for Management UI.
|
||||||
|
- `hawkbit-mgmt-api-client` : Example client for the _hawkBit_ Management API.
|
||||||
|
|
||||||
`hawkbit-device-simulator` : Simulates device software updates, leveraging the hawkBit device integration options.
|
|
||||||
`hawkbit-example-app` : Allows you to run a Spring Boot and hawkBit based update server.
|
|
||||||
`hawkbit-mgmt-api-client` : Example client for the hawkBit management API.
|
|
||||||
|
|||||||
1
examples/hawkbit-custom-theme-example/README.md
Normal file
1
examples/hawkbit-custom-theme-example/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Theme customization example for Eclipse hawkBit. See wiki for the theme customization guide.
|
||||||
112
examples/hawkbit-custom-theme-example/pom.xml
Normal file
112
examples/hawkbit-custom-theme-example/pom.xml
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
<!--
|
||||||
|
|
||||||
|
Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
|
||||||
|
All rights reserved. This program and the accompanying materials
|
||||||
|
are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
which accompanies this distribution, and is available at
|
||||||
|
http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
|
||||||
|
-->
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.eclipse.hawkbit</groupId>
|
||||||
|
<artifactId>hawkbit-examples-parent</artifactId>
|
||||||
|
<version>0.2.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>hawkbit-custom-theme-example</artifactId>
|
||||||
|
<name>hawkBit :: Custom Theme Example App</name>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.vaadin</groupId>
|
||||||
|
<artifactId>vaadin-maven-plugin</artifactId>
|
||||||
|
<version>${vaadin.plugin.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<warSourceDirectory>src/main/resources</warSourceDirectory>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>update-theme</goal>
|
||||||
|
<goal>compile-theme</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${baseDir}</outputDirectory>
|
||||||
|
<addResources>false</addResources>
|
||||||
|
<mainClass>org.eclipse.hawkbit.app.Start</mainClass>
|
||||||
|
<layout>JAR</layout>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- Hawkbit -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.hawkbit</groupId>
|
||||||
|
<artifactId>hawkbit-autoconfigure</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.hawkbit</groupId>
|
||||||
|
<artifactId>hawkbit-ui</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.hawkbit</groupId>
|
||||||
|
<artifactId>hawkbit-security-integration</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.hawkbit</groupId>
|
||||||
|
<artifactId>hawkbit-http-security</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-logging</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-aspects</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
|
package org.eclipse.hawkbit.app;
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.ui.login.HawkbitLoginUI;
|
||||||
|
import org.eclipse.hawkbit.ui.themes.HawkbitTheme;
|
||||||
|
|
||||||
|
import com.vaadin.annotations.Theme;
|
||||||
|
import com.vaadin.annotations.Title;
|
||||||
|
import com.vaadin.spring.annotation.SpringUI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example hawkBit login UI implementation.
|
||||||
|
*
|
||||||
|
* A {@link SpringUI} annotated class must be present in the classpath for the
|
||||||
|
* login path. The easiest way to get an hawkBit login UI running is to extend
|
||||||
|
* the {@link HawkbitLoginUI} and to annotated it with {@link SpringUI} as in
|
||||||
|
* this example to the defined {@link HawkbitTheme#LOGIN_UI_PATH}.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@SpringUI(path = HawkbitTheme.LOGIN_UI_PATH)
|
||||||
|
@Title("hawkBit Theme example")
|
||||||
|
@Theme(value = "exampletheme")
|
||||||
|
public class MyLoginUI extends HawkbitLoginUI {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package org.eclipse.hawkbit.app;
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.ui.HawkbitUI;
|
||||||
|
import org.eclipse.hawkbit.ui.UIEventProvider;
|
||||||
|
import org.eclipse.hawkbit.ui.push.DelayedEventBusPushStrategy;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import com.google.common.eventbus.EventBus;
|
||||||
|
import com.vaadin.annotations.Push;
|
||||||
|
import com.vaadin.annotations.Theme;
|
||||||
|
import com.vaadin.annotations.Title;
|
||||||
|
import com.vaadin.shared.communication.PushMode;
|
||||||
|
import com.vaadin.shared.ui.ui.Transport;
|
||||||
|
import com.vaadin.spring.annotation.SpringUI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example hawkBit UI implementation.
|
||||||
|
*
|
||||||
|
* A {@link SpringUI} annotated class must be present in the classpath. The
|
||||||
|
* easiest way to get an hawkBit UI running is to extend the {@link HawkbitUI}
|
||||||
|
* and to annotated it with {@link SpringUI} as in this example.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@SpringUI
|
||||||
|
@Push(value = PushMode.AUTOMATIC, transport = Transport.WEBSOCKET)
|
||||||
|
@Title("hawkBit Theme example")
|
||||||
|
@Theme(value = "exampletheme")
|
||||||
|
public class MyUI extends HawkbitUI {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public MyUI(final EventBus systemEventBus, final org.vaadin.spring.events.EventBus.SessionEventBus eventBus,
|
||||||
|
final UIEventProvider provider) {
|
||||||
|
super(new DelayedEventBusPushStrategy(eventBus, systemEventBus, provider));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.eclipse.hawkbit.app;
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.RepositoryApplicationConfiguration;
|
||||||
|
import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link SpringBootApplication} annotated class with a main method to start.
|
||||||
|
* The minimal configuration for the stand alone hawkBit server.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
@Import({ RepositoryApplicationConfiguration.class })
|
||||||
|
@EnableHawkbitManagedSecurityConfiguration
|
||||||
|
public class Start {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main method to start the spring-boot application.
|
||||||
|
*
|
||||||
|
* @param args
|
||||||
|
* the VM arguments.
|
||||||
|
*/
|
||||||
|
public static void main(final String[] args) {
|
||||||
|
SpringApplication.run(Start.class, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/addons.scss
|
||||||
|
/styles.css
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
$dark-gray: #848484;
|
||||||
|
|
||||||
|
//Example color change
|
||||||
|
$hawkbit-primary-color: $dark-gray;
|
||||||
|
$hawkbit-primary-color-light: #D8D8D8;
|
||||||
|
$app-selection-item-selection-color: $dark-gray;
|
||||||
|
$app-focus-color: $dark-gray;
|
||||||
|
$app-selection-color: $dark-gray;
|
||||||
|
$tag-text-color: $dark-gray;
|
||||||
|
$tab-sheet-caption-color: $dark-gray;
|
||||||
|
$table-details-tab-font-color: $dark-gray;
|
||||||
|
$widget-caption-color: $dark-gray;
|
||||||
|
$accordion-action-history-title-color: $dark-gray;
|
||||||
|
$menu-title-bg-color: $dark-gray;
|
||||||
|
$button-icon-color: $dark-gray;
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,29 @@
|
|||||||
|
<!--
|
||||||
|
|
||||||
|
Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
|
||||||
|
All rights reserved. This program and the accompanying materials
|
||||||
|
are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
which accompanies this distribution, and is available at
|
||||||
|
http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
.footer-content {
|
||||||
|
margin-top: 20px ;
|
||||||
|
}
|
||||||
|
.doc-link {
|
||||||
|
color: #26547a !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<footer>
|
||||||
|
<div class="footer-content">
|
||||||
|
<div style="color: #333; font-family: Helvetica Neue,Helvetica,Arial,sans-serif; font-size: 0.8em !important;line-height: 20px;">
|
||||||
|
<!-- Footer text goes here -->
|
||||||
|
<a class="doc-link" target="_blank" href="https://projects.eclipse.org/projects/iot.hawkbit">Eclipe hawkBit Project Page</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import "../hawkbit/customstyles/hawkbitvariables";
|
||||||
|
@import "customstyles/examplevariables";
|
||||||
|
@import "../hawkbit/hawkbittheme";
|
||||||
|
@import "addons";
|
||||||
|
|
||||||
|
// This file prefixes all rules with the theme name to avoid causing conflicts with other themes.
|
||||||
|
.exampletheme {
|
||||||
|
@include addons;
|
||||||
|
@include hawkbittheme;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
#
|
||||||
|
# All rights reserved. This program and the accompanying materials
|
||||||
|
# are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
# which accompanies this distribution, and is available at
|
||||||
|
# http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
#
|
||||||
|
|
||||||
|
# UI demo account
|
||||||
|
hawkbit.server.ui.demo.password=admin
|
||||||
|
hawkbit.server.ui.demo.user=admin
|
||||||
|
hawkbit.server.ui.demo.tenant=DEFAULT
|
||||||
|
|
||||||
|
# UI help links
|
||||||
|
hawkbit.server.ui.links.documentation.root=https://github.com/eclipse/hawkbit
|
||||||
@@ -67,6 +67,10 @@
|
|||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.validation</groupId>
|
||||||
|
<artifactId>validation-api</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.validation</groupId>
|
<groupId>javax.validation</groupId>
|
||||||
<artifactId>validation-api</artifactId>
|
<artifactId>validation-api</artifactId>
|
||||||
<version>1.1.0.Final</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.hateoas</groupId>
|
<groupId>org.springframework.hateoas</groupId>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
6
pom.xml
6
pom.xml
@@ -84,6 +84,7 @@
|
|||||||
<!-- Vaadin versions - END -->
|
<!-- Vaadin versions - END -->
|
||||||
|
|
||||||
<!-- Misc libraries versions - START -->
|
<!-- Misc libraries versions - START -->
|
||||||
|
<validation-api.version>1.1.0.Final</validation-api.version>
|
||||||
<fest-assert.version>1.4</fest-assert.version>
|
<fest-assert.version>1.4</fest-assert.version>
|
||||||
<org.easytesting.version>2.0M10</org.easytesting.version>
|
<org.easytesting.version>2.0M10</org.easytesting.version>
|
||||||
<allure.version>1.4.22</allure.version>
|
<allure.version>1.4.22</allure.version>
|
||||||
@@ -419,6 +420,11 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Misc -->
|
<!-- Misc -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.validation</groupId>
|
||||||
|
<artifactId>validation-api</artifactId>
|
||||||
|
<version>${validation-api.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.el</groupId>
|
<groupId>javax.el</groupId>
|
||||||
<artifactId>javax.el-api</artifactId>
|
<artifactId>javax.el-api</artifactId>
|
||||||
|
|||||||
Reference in New Issue
Block a user