Merge branch 'master' of https://github.com/thingsboard/thingsboard into map/3.0
This commit is contained in:
commit
889e55104a
@ -135,7 +135,7 @@ public class CassandraEntitiesToSqlMigrateService implements EntitiesMigrateServ
|
|||||||
stringColumn("entity_type"),
|
stringColumn("entity_type"),
|
||||||
stringColumn("attribute_type"),
|
stringColumn("attribute_type"),
|
||||||
stringColumn("attribute_key"),
|
stringColumn("attribute_key"),
|
||||||
booleanColumn("bool_v"),
|
booleanColumn("bool_v", true),
|
||||||
stringColumn("str_v"),
|
stringColumn("str_v"),
|
||||||
bigintColumn("long_v"),
|
bigintColumn("long_v"),
|
||||||
doubleColumn("dbl_v"),
|
doubleColumn("dbl_v"),
|
||||||
|
|||||||
@ -38,6 +38,7 @@ public class CassandraToSqlColumn {
|
|||||||
private int sqlType;
|
private int sqlType;
|
||||||
private int size;
|
private int size;
|
||||||
private Class<? extends Enum> enumClass;
|
private Class<? extends Enum> enumClass;
|
||||||
|
private boolean allowNullBoolean = false;
|
||||||
|
|
||||||
public static CassandraToSqlColumn idColumn(String name) {
|
public static CassandraToSqlColumn idColumn(String name) {
|
||||||
return new CassandraToSqlColumn(name, CassandraToSqlColumnType.ID);
|
return new CassandraToSqlColumn(name, CassandraToSqlColumnType.ID);
|
||||||
@ -60,7 +61,11 @@ public class CassandraToSqlColumn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static CassandraToSqlColumn booleanColumn(String name) {
|
public static CassandraToSqlColumn booleanColumn(String name) {
|
||||||
return new CassandraToSqlColumn(name, CassandraToSqlColumnType.BOOLEAN);
|
return booleanColumn(name, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CassandraToSqlColumn booleanColumn(String name, boolean allowNullBoolean) {
|
||||||
|
return new CassandraToSqlColumn(name, name, CassandraToSqlColumnType.BOOLEAN, null, allowNullBoolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CassandraToSqlColumn jsonColumn(String name) {
|
public static CassandraToSqlColumn jsonColumn(String name) {
|
||||||
@ -72,32 +77,33 @@ public class CassandraToSqlColumn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CassandraToSqlColumn(String columnName) {
|
public CassandraToSqlColumn(String columnName) {
|
||||||
this(columnName, columnName, CassandraToSqlColumnType.STRING, null);
|
this(columnName, columnName, CassandraToSqlColumnType.STRING, null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CassandraToSqlColumn(String columnName, CassandraToSqlColumnType type) {
|
public CassandraToSqlColumn(String columnName, CassandraToSqlColumnType type) {
|
||||||
this(columnName, columnName, type, null);
|
this(columnName, columnName, type, null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CassandraToSqlColumn(String columnName, CassandraToSqlColumnType type, Class<? extends Enum> enumClass) {
|
public CassandraToSqlColumn(String columnName, CassandraToSqlColumnType type, Class<? extends Enum> enumClass) {
|
||||||
this(columnName, columnName, type, enumClass);
|
this(columnName, columnName, type, enumClass, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CassandraToSqlColumn(String cassandraColumnName, String sqlColumnName) {
|
public CassandraToSqlColumn(String cassandraColumnName, String sqlColumnName) {
|
||||||
this(cassandraColumnName, sqlColumnName, CassandraToSqlColumnType.STRING, null);
|
this(cassandraColumnName, sqlColumnName, CassandraToSqlColumnType.STRING, null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CassandraToSqlColumn(String cassandraColumnName, String sqlColumnName, CassandraToSqlColumnType type,
|
public CassandraToSqlColumn(String cassandraColumnName, String sqlColumnName, CassandraToSqlColumnType type,
|
||||||
Class<? extends Enum> enumClass) {
|
Class<? extends Enum> enumClass, boolean allowNullBoolean) {
|
||||||
this.cassandraColumnName = cassandraColumnName;
|
this.cassandraColumnName = cassandraColumnName;
|
||||||
this.sqlColumnName = sqlColumnName;
|
this.sqlColumnName = sqlColumnName;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.enumClass = enumClass;
|
this.enumClass = enumClass;
|
||||||
|
this.allowNullBoolean = allowNullBoolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getColumnValue(Row row) {
|
public String getColumnValue(Row row) {
|
||||||
if (row.isNull(index)) {
|
if (row.isNull(index)) {
|
||||||
if (this.type == CassandraToSqlColumnType.BOOLEAN) {
|
if (this.type == CassandraToSqlColumnType.BOOLEAN && !this.allowNullBoolean) {
|
||||||
return Boolean.toString(false);
|
return Boolean.toString(false);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import static org.thingsboard.server.dao.model.ModelConstants.EPOCH_DIFF;
|
|||||||
public class CassandraToSqlEventTsColumn extends CassandraToSqlColumn {
|
public class CassandraToSqlEventTsColumn extends CassandraToSqlColumn {
|
||||||
|
|
||||||
CassandraToSqlEventTsColumn() {
|
CassandraToSqlEventTsColumn() {
|
||||||
super("id", "ts", CassandraToSqlColumnType.BIGINT, null);
|
super("id", "ts", CassandraToSqlColumnType.BIGINT, null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -85,7 +85,8 @@
|
|||||||
formControlName="entityId">
|
formControlName="entityId">
|
||||||
</tb-entity-select>
|
</tb-entity-select>
|
||||||
</section>
|
</section>
|
||||||
<div formGroupName="keys">
|
<div class="mat-accordion-container" formGroupName="keys">
|
||||||
|
<mat-accordion [multi]="true">
|
||||||
<mat-expansion-panel formGroupName="attributes" [expanded]="true">
|
<mat-expansion-panel formGroupName="attributes" [expanded]="true">
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
<mat-panel-title>
|
<mat-panel-title>
|
||||||
@ -130,6 +131,7 @@
|
|||||||
[dataKeyType]="dataKeyType.timeseries">
|
[dataKeyType]="dataKeyType.timeseries">
|
||||||
</tb-entity-keys-list>
|
</tb-entity-keys-list>
|
||||||
</mat-expansion-panel>
|
</mat-expansion-panel>
|
||||||
|
</mat-accordion>
|
||||||
</div>
|
</div>
|
||||||
<tb-datetime
|
<tb-datetime
|
||||||
dateText="entity-view.start-date"
|
dateText="entity-view.start-date"
|
||||||
|
|||||||
@ -14,16 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
:host {
|
:host {
|
||||||
mat-expansion-panel {
|
.mat-accordion-container {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tb-dialog {
|
|
||||||
:host {
|
|
||||||
mat-expansion-panel {
|
|
||||||
margin-left: 6px;
|
|
||||||
margin-right: 6px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -14,9 +14,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
:host ::ng-deep {
|
:host ::ng-deep {
|
||||||
.mat-checkbox.hinted-checkbox {
|
.mat-checkbox{
|
||||||
|
&.hinted-checkbox {
|
||||||
.mat-checkbox-inner-container {
|
.mat-checkbox-inner-container {
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mat-checkbox-layout{
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -812,7 +812,6 @@ mat-label {
|
|||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: auto;
|
|
||||||
}
|
}
|
||||||
.mat-dialog-content {
|
.mat-dialog-content {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -862,7 +861,7 @@ mat-label {
|
|||||||
.mat-dialog-container {
|
.mat-dialog-container {
|
||||||
> *:first-child, form {
|
> *:first-child, form {
|
||||||
min-width: 100% !important;
|
min-width: 100% !important;
|
||||||
height: 100vh;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.mat-dialog-content {
|
.mat-dialog-content {
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user