Merge with master

This commit is contained in:
Andrew Shvayka 2016-12-05 17:26:18 +02:00
commit b2b2847803
33 changed files with 294 additions and 126 deletions

View File

@ -21,9 +21,9 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>server</artifactId>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>application</artifactId>
<packaging>jar</packaging>
@ -47,35 +47,35 @@
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-api</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-core</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>transport</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server.transport</groupId>
<groupId>org.thingsboard.transport</groupId>
<artifactId>http</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server.transport</groupId>
<groupId>org.thingsboard.transport</groupId>
<artifactId>coap</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server.transport</groupId>
<groupId>org.thingsboard.transport</groupId>
<artifactId>mqtt</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>dao</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>dao</artifactId>
<type>test-jar</type>
<scope>test</scope>
@ -103,7 +103,7 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>ui</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
@ -140,26 +140,6 @@
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path-assert</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_${scala.version}</artifactId>
@ -184,16 +164,6 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
@ -218,12 +188,50 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<artifactId>tools</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path-assert</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@ -337,17 +345,17 @@
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.thingsboard.server.extensions</groupId>
<groupId>org.thingsboard.extensions</groupId>
<artifactId>extension-rabbitmq</artifactId>
<classifier>extension</classifier>
</artifactItem>
<artifactItem>
<groupId>org.thingsboard.server.extensions</groupId>
<groupId>org.thingsboard.extensions</groupId>
<artifactId>extension-rest-api-call</artifactId>
<classifier>extension</classifier>
</artifactItem>
<artifactItem>
<groupId>org.thingsboard.server.extensions</groupId>
<groupId>org.thingsboard.extensions</groupId>
<artifactId>extension-kafka</artifactId>
<classifier>extension</classifier>
</artifactItem>

View File

@ -19,11 +19,13 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.Arrays;
@EnableAutoConfiguration
@SpringBootApplication
@EnableSwagger2
@ComponentScan({"org.thingsboard.server"})
public class ThingsboardServerApplication {

View File

@ -0,0 +1,78 @@
/**
* Copyright © 2016 The Thingsboard Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.thingsboard.server.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.thingsboard.server.common.data.security.Authority;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.*;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import java.util.List;
import static com.google.common.collect.Lists.newArrayList;
@Configuration
public class SwaggerConfiguration {
@Bean
public Docket thingsboardApi() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("thingsboard")
.apiInfo(apiInfo())
.select()
.paths(PathSelectors.any())
.build()
.securitySchemes(newArrayList(jwtTokenKey()))
.securityContexts(newArrayList(securityContext()));
}
private ApiKey jwtTokenKey() {
return new ApiKey("X-Authorization", "JWT token", "header");
}
private SecurityContext securityContext() {
return SecurityContext.builder()
.securityReferences(defaultAuth())
.forPaths(PathSelectors.regex("/api.*"))
.build();
}
List<SecurityReference> defaultAuth() {
AuthorizationScope[] authorizationScopes = new AuthorizationScope[3];
authorizationScopes[0] = new AuthorizationScope(Authority.SYS_ADMIN.name(), "System administrator");
authorizationScopes[1] = new AuthorizationScope(Authority.TENANT_ADMIN.name(), "Tenant administrator");
authorizationScopes[2] = new AuthorizationScope(Authority.CUSTOMER_USER.name(), "Customer");
return newArrayList(
new SecurityReference("X-Authorization", authorizationScopes));
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Thingsboard REST API")
.description("For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/rest-auth'>Documentation page</a>")
.contact(new Contact("Thingsboard team", "http://thingsboard.io", "info@thingsboard.io"))
.license("Apache License Version 2.0")
.licenseUrl("https://github.com/thingsboard/thingsboard/blob/master/LICENSE")
.version("2.0")
.build();
}
}

View File

@ -53,10 +53,11 @@ public class ThingsboardSecurityConfiguration extends WebSecurityConfigurerAdapt
public static final String JWT_TOKEN_HEADER_PARAM = "X-Authorization";
public static final String JWT_TOKEN_QUERY_PARAM = "token";
public static final String WEBJARS_ENTRY_POINT = "/webjars/**";
public static final String DEVICE_API_ENTRY_POINT = "/api/v1/**";
public static final String FORM_BASED_LOGIN_ENTRY_POINT = "/api/auth/login";
public static final String TOKEN_REFRESH_ENTRY_POINT = "/api/auth/token";
public static final String[] NON_TOKEN_BASED_AUTH_ENTRY_POINTS = new String[] {"/index.html", "/static/**", "/api/noauth/**"};
public static final String[] NON_TOKEN_BASED_AUTH_ENTRY_POINTS = new String[] {"/index.html", "/static/**", "/api/noauth/**", "/webjars/**"};
public static final String TOKEN_BASED_AUTH_ENTRY_POINT = "/api/**";
public static final String WS_TOKEN_BASED_AUTH_ENTRY_POINT = "/api/ws/**";
@ -89,7 +90,7 @@ public class ThingsboardSecurityConfiguration extends WebSecurityConfigurerAdapt
@Bean
protected JwtTokenAuthenticationProcessingFilter buildJwtTokenAuthenticationProcessingFilter() throws Exception {
List<String> pathsToSkip = new ArrayList(Arrays.asList(NON_TOKEN_BASED_AUTH_ENTRY_POINTS));
pathsToSkip.addAll(Arrays.asList(WS_TOKEN_BASED_AUTH_ENTRY_POINT, TOKEN_REFRESH_ENTRY_POINT, FORM_BASED_LOGIN_ENTRY_POINT, DEVICE_API_ENTRY_POINT));
pathsToSkip.addAll(Arrays.asList(WS_TOKEN_BASED_AUTH_ENTRY_POINT, TOKEN_REFRESH_ENTRY_POINT, FORM_BASED_LOGIN_ENTRY_POINT, DEVICE_API_ENTRY_POINT, WEBJARS_ENTRY_POINT));
SkipPathRequestMatcher matcher = new SkipPathRequestMatcher(pathsToSkip, TOKEN_BASED_AUTH_ENTRY_POINT);
JwtTokenAuthenticationProcessingFilter filter
= new JwtTokenAuthenticationProcessingFilter(failureHandler, jwtHeaderTokenExtractor, matcher);
@ -142,6 +143,7 @@ public class ThingsboardSecurityConfiguration extends WebSecurityConfigurerAdapt
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers(WEBJARS_ENTRY_POINT).permitAll() // Webjars
.antMatchers(DEVICE_API_ENTRY_POINT).permitAll() // Device HTTP Transport API
.antMatchers(FORM_BASED_LOGIN_ENTRY_POINT).permitAll() // Login end-point
.antMatchers(TOKEN_REFRESH_ENTRY_POINT).permitAll() // Token refresh end-point

View File

@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class WebConfig {
@RequestMapping(value = "/{path:^(?!api$)(?!static$)[^\\.]*}/**")
@RequestMapping(value = "/{path:^(?!api$)(?!static$)(?!webjars$)[^\\.]*}/**")
public String redirect() {
return "forward:/index.html";
}

View File

@ -15,6 +15,7 @@
*/
package org.thingsboard.server.controller;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -45,6 +46,18 @@ public class AdminController extends BaseController {
}
@PreAuthorize("hasAuthority('SYS_ADMIN')")
@ApiOperation(
value = "Save admin settings", notes = "Saves admin settings",
response = AdminSettings.class,
authorizations = {
@Authorization(value = "X-Authorization", scopes = {
@AuthorizationScope(scope = "SYS_ADMIN", description = "")
})})
@ApiResponses(value = {
@ApiResponse(code = 200, response = AdminSettings.class, message = "Admin settings successfully updated"),
@ApiResponse(code = 400, message = "Invalid admin settings payload supplied"),
@ApiResponse(code = 404, message = "Admin settings not found")}
)
@RequestMapping(value = "/settings", method = RequestMethod.POST)
@ResponseBody
public AdminSettings saveAdminSettings(@RequestBody AdminSettings adminSettings) throws ThingsboardException {

View File

@ -15,6 +15,9 @@
*/
package org.thingsboard.server.controller;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -34,6 +37,12 @@ import java.util.List;
@RequestMapping("/api")
public class RuleController extends BaseController {
@ApiOperation(value = "getRuleById", nickname = "Get Rule By ID")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success", response = RuleMetaData.class),
@ApiResponse(code = 401, message = "Unauthorized"),
@ApiResponse(code = 403, message = "Forbidden"),
@ApiResponse(code = 404, message = "Not Found")})
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
@RequestMapping(value = "/rule/{ruleId}", method = RequestMethod.GET)
@ResponseBody

View File

@ -19,11 +19,11 @@
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.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>data</artifactId>
<packaging>jar</packaging>

View File

@ -19,11 +19,11 @@
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.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>message</artifactId>
<packaging>jar</packaging>
@ -37,7 +37,7 @@
<dependencies>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>data</artifactId>
</dependency>
<dependency>

View File

@ -21,9 +21,9 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>server</artifactId>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>common</artifactId>
<packaging>pom</packaging>

View File

@ -19,11 +19,11 @@
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.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>transport</artifactId>
<packaging>jar</packaging>
@ -37,11 +37,11 @@
<dependencies>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>data</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>message</artifactId>
</dependency>
<dependency>

View File

@ -21,9 +21,9 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>server</artifactId>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>dao</artifactId>
<packaging>jar</packaging>
@ -37,7 +37,7 @@
<dependencies>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>data</artifactId>
</dependency>
<dependency>

File diff suppressed because one or more lines are too long

1
docker/.env Normal file
View File

@ -0,0 +1 @@
CASSANDRA_DATA_DIR=/home/docker/cassandra_volume

View File

@ -27,5 +27,5 @@ $command rm -f
echo "building images.."
$command build
echo "starting cassandra, zookeeper, db-schema images..."
$command up -d cassandra zookeeper db-schema
echo "starting cassandra, zookeeper, thingsboard-db-schema images..."
$command up -d cassandra zookeeper thingsboard-db-schema

View File

@ -18,7 +18,7 @@ version: '2'
services:
thingsboard:
build: thingsboard
image: "thingsboard/application:0.1"
ports:
- "8080:8080"
- "1883:1883"
@ -27,8 +27,6 @@ services:
- cassandra:db
- zookeeper:zk
- thingsboard-db-schema:thingsboard-db-schema
volumes:
- "../application/target/thingsboard.deb:/root/thingsboard.deb"
env_file:
- thingsboard.env
entrypoint: ./run_thingsboard.sh

View File

@ -17,6 +17,7 @@
FROM openjdk:8-jre
ADD run_thingsboard.sh /root/run_thingsboard.sh
ADD thingsboard.deb /root/thingsboard.deb
RUN chmod +x /root/run_thingsboard.sh

View File

@ -0,0 +1,25 @@
#!/bin/bash
#
# Copyright © 2016 The Thingsboard Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
cp ../../application/target/thingsboard.deb thingsboard.deb
docker build -t thingsboard/application:0.1 .
docker login
docker push thingsboard/application:0.1

View File

@ -21,9 +21,9 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>server</artifactId>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-api</artifactId>
<packaging>jar</packaging>
@ -37,11 +37,11 @@
<dependencies>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>data</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>message</artifactId>
</dependency>
<dependency>

View File

@ -21,9 +21,9 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>server</artifactId>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-core</artifactId>
<packaging>jar</packaging>
@ -37,7 +37,7 @@
<dependencies>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-api</artifactId>
<scope>provided</scope>
</dependency>

View File

@ -21,11 +21,11 @@
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.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>extensions</artifactId>
</parent>
<groupId>org.thingsboard.server.extensions</groupId>
<groupId>org.thingsboard.extensions</groupId>
<artifactId>extension-kafka</artifactId>
<packaging>jar</packaging>
@ -49,12 +49,12 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-core</artifactId>
<scope>provided</scope>
</dependency>

View File

@ -19,11 +19,11 @@
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.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>extensions</artifactId>
</parent>
<groupId>org.thingsboard.server.extensions</groupId>
<groupId>org.thingsboard.extensions</groupId>
<artifactId>extension-rabbitmq</artifactId>
<packaging>jar</packaging>
@ -41,12 +41,12 @@
<artifactId>amqp-client</artifactId>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-core</artifactId>
<scope>provided</scope>
</dependency>

View File

@ -21,11 +21,11 @@
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.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>extensions</artifactId>
</parent>
<groupId>org.thingsboard.server.extensions</groupId>
<groupId>org.thingsboard.extensions</groupId>
<artifactId>extension-rest-api-call</artifactId>
<packaging>jar</packaging>
@ -49,7 +49,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-api</artifactId>
<scope>provided</scope>
</dependency>
@ -59,7 +59,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-core</artifactId>
<scope>provided</scope>
</dependency>

View File

@ -21,9 +21,9 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>server</artifactId>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions</artifactId>
<packaging>pom</packaging>

37
pom.xml
View File

@ -68,6 +68,7 @@
<hazelcast-zookeeper.version>3.6.1</hazelcast-zookeeper.version>
<surfire.version>2.19.1</surfire.version>
<jar-plugin.version>3.0.2</jar-plugin.version>
<springfox-swagger.version>2.6.1</springfox-swagger.version>
</properties>
<modules>
@ -301,70 +302,70 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>extensions-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server.extensions</groupId>
<groupId>org.thingsboard.extensions</groupId>
<artifactId>extension-rabbitmq</artifactId>
<classifier>extension</classifier>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server.extensions</groupId>
<groupId>org.thingsboard.extensions</groupId>
<artifactId>extension-rest-api-call</artifactId>
<classifier>extension</classifier>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server.extensions</groupId>
<groupId>org.thingsboard.extensions</groupId>
<artifactId>extension-kafka</artifactId>
<classifier>extension</classifier>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>data</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>message</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>transport</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server.transport</groupId>
<groupId>org.thingsboard.transport</groupId>
<artifactId>http</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server.transport</groupId>
<groupId>org.thingsboard.transport</groupId>
<artifactId>coap</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server.transport</groupId>
<groupId>org.thingsboard.transport</groupId>
<artifactId>mqtt</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>dao</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>dao</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
@ -672,6 +673,16 @@
<artifactId>hazelcast</artifactId>
<version>${hazelcast.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox-swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-swagger.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@ -21,9 +21,9 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>server</artifactId>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>tools</artifactId>
<packaging>jar</packaging>
@ -37,7 +37,7 @@
<dependencies>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>data</artifactId>
</dependency>
<dependency>

View File

@ -19,11 +19,11 @@
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.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.server.transport</groupId>
<groupId>org.thingsboard.transport</groupId>
<artifactId>coap</artifactId>
<packaging>jar</packaging>
@ -37,7 +37,7 @@
<dependencies>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>transport</artifactId>
</dependency>
<dependency>

View File

@ -19,11 +19,11 @@
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.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.server.transport</groupId>
<groupId>org.thingsboard.transport</groupId>
<artifactId>http</artifactId>
<packaging>jar</packaging>
@ -37,7 +37,7 @@
<dependencies>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>transport</artifactId>
</dependency>
<dependency>

View File

@ -19,11 +19,11 @@
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.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.server.transport</groupId>
<groupId>org.thingsboard.transport</groupId>
<artifactId>mqtt</artifactId>
<packaging>jar</packaging>
@ -37,7 +37,7 @@
<dependencies>
<dependency>
<groupId>org.thingsboard.server.common</groupId>
<groupId>org.thingsboard.common</groupId>
<artifactId>transport</artifactId>
</dependency>
<dependency>

View File

@ -21,9 +21,9 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>server</artifactId>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>transport</artifactId>
<packaging>pom</packaging>

View File

@ -21,9 +21,9 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>server</artifactId>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard.server</groupId>
<groupId>org.thingsboard</groupId>
<artifactId>ui</artifactId>
<packaging>jar</packaging>

View File

@ -21,7 +21,7 @@ export default angular.module('thingsboard.api.telemetryWebsocket', [thingsboard
.name;
/*@ngInject*/
function TelemetryWebsocketService($log, $websocket, $timeout, $window, types, userService) {
function TelemetryWebsocketService($websocket, $timeout, $window, types, userService) {
var isOpening = false,
isOpened = false,
@ -57,9 +57,7 @@ function TelemetryWebsocketService($log, $websocket, $timeout, $window, types, u
if (isOpened && (cmdsWrapper.tsSubCmds.length > 0 ||
cmdsWrapper.historyCmds.length > 0 ||
cmdsWrapper.attrSubCmds.length > 0)) {
$log.debug("Sending subscription commands!");
dataStream.send(angular.copy(cmdsWrapper)).then(function () {
$log.debug("Subscription commands were sent!");
checkToClose();
});
cmdsWrapper.tsSubCmds = [];
@ -69,21 +67,17 @@ function TelemetryWebsocketService($log, $websocket, $timeout, $window, types, u
tryOpenSocket();
}
function onError (message) {
$log.debug("Websocket error:");
$log.debug(message);
function onError (/*message*/) {
isOpening = false;
}
function onOpen () {
$log.debug("Websocket opened");
isOpening = false;
isOpened = true;
publishCommands();
}
function onClose () {
$log.debug("Websocket closed");
isOpening = false;
isOpened = false;
}

View File

@ -46,8 +46,7 @@ var pluginActionsClazzHelpLinkMap = {
'org.thingsboard.server.extensions.rest.action.RestApiCallPluginAction': 'pluginActionRestApiCall'
};
//var helpBaseUrl = "http://thingsboard.io";
var helpBaseUrl = "http://localhost:4000";
var helpBaseUrl = "http://thingsboard.io";
export default angular.module('thingsboard.help', [])
.constant('helpLinks',