101 changed files with 1151 additions and 118 deletions
@ -1,2 +0,0 @@ |
|||
.tb-message-type-autocomplete .tb-not-found{display:block;line-height:1.5;height:48px}.tb-message-type-autocomplete .tb-not-found .tb-no-entries{line-height:48px}.tb-message-type-autocomplete li{height:auto!important;white-space:normal!important}.tb-generator-config tb-json-content.tb-message-body,.tb-generator-config tb-json-object-edit.tb-metadata-json{height:200px;display:block}.tb-mqtt-config .tb-credentials-panel-group .tb-panel-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-width:90px}@media (min-width:960px){.tb-mqtt-config .tb-credentials-panel-group .tb-panel-title{min-width:180px}}.tb-mqtt-config .tb-credentials-panel-group .tb-panel-prompt{font-size:14px;color:rgba(0,0,0,.87);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tb-mqtt-config .tb-credentials-panel-group.disabled .tb-panel-prompt,.tb-mqtt-config .tb-credentials-panel-group.disabled .tb-panel-title{color:rgba(0,0,0,.38)}.tb-mqtt-config .tb-credentials-panel-group md-icon.md-expansion-panel-icon{margin-right:0}.tb-mqtt-config .tb-container{width:100%}.tb-mqtt-config .dropdown-messages .tb-error-message{padding:5px 0 0}.tb-kv-map-config .header{padding-left:5px;padding-right:5px;padding-bottom:5px}.tb-kv-map-config .header .cell{padding-left:5px;padding-right:5px;color:rgba(0,0,0,.54);font-size:12px;font-weight:700;white-space:nowrap}.tb-kv-map-config .body{padding-left:5px;padding-right:5px;padding-bottom:20px;max-height:300px;overflow:auto}.tb-kv-map-config .body .row{padding-top:5px;max-height:40px}.tb-kv-map-config .body .cell{padding-left:5px;padding-right:5px}.tb-kv-map-config .body md-input-container.cell{margin:0;max-height:40px}.tb-kv-map-config .body .md-button{margin:0} |
|||
/*# sourceMappingURL=rulenode-core-config.css.map*/ |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,35 @@ |
|||
/* |
|||
* Copyright © 2016-2019 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. |
|||
*/ |
|||
|
|||
const ruleNodeUiforwardHost = 'localhost'; |
|||
const ruleNodeUiforwardPort = 8080; |
|||
|
|||
const PROXY_CONFIG = { |
|||
'/api': { |
|||
'target': 'http://localhost:8080', |
|||
'secure': false |
|||
}, |
|||
'/static/rulenode': { |
|||
'target': `http://${ruleNodeUiforwardHost}:${ruleNodeUiforwardPort}`, |
|||
'secure': false |
|||
}, |
|||
'/api/ws': { |
|||
'target': 'ws://localhost:8080', |
|||
'ws': true |
|||
} |
|||
} |
|||
|
|||
module.exports = PROXY_CONFIG; |
|||
@ -0,0 +1,22 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './alias-controller'; |
|||
export * from './data-aggregator'; |
|||
export * from './datasource.service'; |
|||
export * from './datasource-subcription'; |
|||
export * from './widget-api.models'; |
|||
export * from './widget-subscription'; |
|||
@ -0,0 +1,34 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './admin.service'; |
|||
export * from './alarm.service'; |
|||
export * from './asset.service'; |
|||
export * from './attribute.service'; |
|||
export * from './audit-log.service'; |
|||
export * from './component-descriptor.service'; |
|||
export * from './customer.service'; |
|||
export * from './dashboard.service'; |
|||
export * from './device.service'; |
|||
export * from './entity.service'; |
|||
export * from './entity-relation.service'; |
|||
export * from './entity-view.service'; |
|||
export * from './event.service'; |
|||
export * from './http-utils'; |
|||
export * from './rule-chain.service'; |
|||
export * from './tenant.service'; |
|||
export * from './user.service'; |
|||
export * from './widget.service'; |
|||
@ -0,0 +1,23 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './api/public-api'; |
|||
export * from './http/public-api'; |
|||
export * from './local-storage/local-storage.service'; |
|||
export * from './services/public-api'; |
|||
export * from './ws/telemetry-websocket.service'; |
|||
export * from './core.state'; |
|||
export * from './core.module'; |
|||
@ -0,0 +1,32 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './script/node-script-test.service'; |
|||
export * from './broadcast.models'; |
|||
export * from './broadcast.service'; |
|||
export * from './dashboard-utils.service'; |
|||
export * from './dialog.service'; |
|||
export * from './dynamic-component-factory.service'; |
|||
export * from './item-buffer.service'; |
|||
export * from './menu.models'; |
|||
export * from './menu.service'; |
|||
export * from './notification.service'; |
|||
export * from './raf.service'; |
|||
export * from './resources.service'; |
|||
export * from './time.service'; |
|||
export * from './title.service'; |
|||
export * from './utils.service'; |
|||
export * from './window.service'; |
|||
@ -0,0 +1,31 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
import { Injectable } from '@angular/core'; |
|||
import { Observable, of } from 'rxjs'; |
|||
|
|||
@Injectable({ |
|||
providedIn: 'root' |
|||
}) |
|||
export class NodeScriptTestService { |
|||
|
|||
testNodeScript(script: string, scriptType: any, functionTitle: string, |
|||
functionName: string, argNames: string[], ruleNodeId: string): Observable<string> { |
|||
console.log(`testNodeScript TODO: ${script}`); |
|||
return of(script); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './home-components.module'; |
|||
@ -0,0 +1,17 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './home-pages.module'; |
|||
@ -0,0 +1,56 @@ |
|||
<!-- |
|||
|
|||
Copyright © 2016-2019 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. |
|||
|
|||
--> |
|||
<form #ruleNodeForm="ngForm" (ngSubmit)="add()" style="min-width: 650px;"> |
|||
<mat-toolbar fxLayout="row" color="primary"> |
|||
<h2 translate>rulenode.add</h2> |
|||
<span fxFlex></span> |
|||
<div [tb-help]="helpLinkIdForRuleNodeType()"></div> |
|||
<button mat-button mat-icon-button |
|||
(click)="cancel()" |
|||
type="button"> |
|||
<mat-icon class="material-icons">close</mat-icon> |
|||
</button> |
|||
</mat-toolbar> |
|||
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async"> |
|||
</mat-progress-bar> |
|||
<div mat-dialog-content> |
|||
<fieldset [disabled]="isLoading$ | async"> |
|||
<tb-rule-node #tbRuleNode |
|||
[ruleNode]="ruleNode" |
|||
[ruleChainId]="ruleChainId" |
|||
[isEdit]="true" |
|||
[isReadOnly]="false"> |
|||
</tb-rule-node> |
|||
</fieldset> |
|||
</div> |
|||
<div mat-dialog-actions fxLayout="row"> |
|||
<span fxFlex></span> |
|||
<button mat-button mat-raised-button color="primary" |
|||
type="submit" |
|||
[disabled]="(isLoading$ | async) || tbRuleNode.ruleNodeForm.invalid || !tbRuleNode.ruleNodeForm.dirty"> |
|||
{{ 'action.add' | translate }} |
|||
</button> |
|||
<button mat-button color="primary" |
|||
style="margin-right: 20px;" |
|||
type="button" |
|||
[disabled]="(isLoading$ | async)" |
|||
(click)="cancel()" cdkFocusInitial> |
|||
{{ 'action.cancel' | translate }} |
|||
</button> |
|||
</div> |
|||
</form> |
|||
@ -0,0 +1,28 @@ |
|||
<!-- |
|||
|
|||
Copyright © 2016-2019 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. |
|||
|
|||
--> |
|||
<div [formGroup]="ruleNodeConfigFormGroup"> |
|||
<ng-container #definedConfigContent></ng-container> |
|||
<div class="tb-rulenode-directive-error" *ngIf="definedDirectiveError">{{definedDirectiveError}}</div> |
|||
<tb-json-object-edit *ngIf="!useDefinedDirective()" #jsonObjectEditComponent |
|||
class="tb-rule-node-configuration-json" |
|||
formControlName="configuration" |
|||
[label]="'rulenode.configuration' | translate" |
|||
[required]="required" |
|||
[fillHeight]="true"> |
|||
</tb-json-object-edit> |
|||
</div> |
|||
@ -0,0 +1,27 @@ |
|||
/** |
|||
* Copyright © 2016-2019 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. |
|||
*/ |
|||
:host { |
|||
tb-json-object-edit.tb-rule-node-configuration-json { |
|||
display: block; |
|||
height: 300px; |
|||
} |
|||
|
|||
.tb-rulenode-directive-error { |
|||
font-size: 13px; |
|||
font-weight: 400; |
|||
color: rgb(221, 44, 0); |
|||
} |
|||
} |
|||
@ -0,0 +1,208 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
import { |
|||
AfterViewInit, |
|||
Component, ElementRef, |
|||
EventEmitter, forwardRef, |
|||
Input, |
|||
OnChanges, |
|||
OnInit, |
|||
Output, |
|||
SimpleChanges, |
|||
ViewChild, |
|||
Compiler, |
|||
Injector, ComponentRef, OnDestroy |
|||
} from '@angular/core'; |
|||
import { PageComponent } from '@shared/components/page.component'; |
|||
import { Store } from '@ngrx/store'; |
|||
import { AppState } from '@core/core.state'; |
|||
import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, NgForm, Validators } from '@angular/forms'; |
|||
import { FcRuleNode, FcRuleEdge } from './rulechain-page.models'; |
|||
import { RuleNodeType, LinkLabel, RuleNodeDefinition, RuleNodeConfiguration, IRuleNodeConfigurationComponent } from '@shared/models/rule-node.models'; |
|||
import { EntityType } from '@shared/models/entity-type.models'; |
|||
import { Observable, of, Subscription } from 'rxjs'; |
|||
import { RuleChainService } from '@core/http/rule-chain.service'; |
|||
import { coerceBooleanProperty } from '@angular/cdk/coercion'; |
|||
import { deepClone } from '@core/utils'; |
|||
import { EntityAlias } from '@shared/models/alias.models'; |
|||
import { TruncatePipe } from '@shared/pipe/truncate.pipe'; |
|||
import { MatChipList, MatAutocomplete, MatChipInputEvent, MatAutocompleteSelectedEvent } from '@angular/material'; |
|||
import { TranslateService } from '@ngx-translate/core'; |
|||
import { COMMA, ENTER, SEMICOLON } from '@angular/cdk/keycodes'; |
|||
import { catchError, map, mergeMap, share } from 'rxjs/operators'; |
|||
import { DynamicWidgetComponent } from '@home/components/widget/dynamic-widget.component'; |
|||
import { SharedModule } from '@shared/shared.module'; |
|||
import { WidgetComponentsModule } from '@home/components/widget/widget-components.module'; |
|||
import { DynamicComponentFactoryService } from '@core/services/dynamic-component-factory.service'; |
|||
import { ViewContainerRef } from '@angular/core'; |
|||
import { JsonObjectEditComponent } from '@shared/components/json-object-edit.component'; |
|||
|
|||
@Component({ |
|||
selector: 'tb-rule-node-config', |
|||
templateUrl: './rule-node-config.component.html', |
|||
styleUrls: ['./rule-node-config.component.scss'], |
|||
providers: [{ |
|||
provide: NG_VALUE_ACCESSOR, |
|||
useExisting: forwardRef(() => RuleNodeConfigComponent), |
|||
multi: true |
|||
}] |
|||
}) |
|||
export class RuleNodeConfigComponent implements ControlValueAccessor, OnInit, OnDestroy, AfterViewInit { |
|||
|
|||
@ViewChild('definedConfigContent', {read: ViewContainerRef, static: true}) definedConfigContainer: ViewContainerRef; |
|||
|
|||
@ViewChild('jsonObjectEditComponent', {static: false}) jsonObjectEditComponent: JsonObjectEditComponent; |
|||
|
|||
private requiredValue: boolean; |
|||
get required(): boolean { |
|||
return this.requiredValue; |
|||
} |
|||
@Input() |
|||
set required(value: boolean) { |
|||
this.requiredValue = coerceBooleanProperty(value); |
|||
} |
|||
|
|||
@Input() |
|||
disabled: boolean; |
|||
|
|||
@Input() |
|||
ruleNodeId: string; |
|||
|
|||
nodeDefinitionValue: RuleNodeDefinition; |
|||
|
|||
@Input() |
|||
set nodeDefinition(nodeDefinition: RuleNodeDefinition) { |
|||
if (this.nodeDefinitionValue !== nodeDefinition) { |
|||
this.nodeDefinitionValue = nodeDefinition; |
|||
if (this.nodeDefinitionValue) { |
|||
this.validateDefinedDirective(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
get nodeDefinition(): RuleNodeDefinition { |
|||
return this.nodeDefinitionValue; |
|||
} |
|||
|
|||
definedDirectiveError: string; |
|||
|
|||
ruleNodeConfigFormGroup: FormGroup; |
|||
|
|||
changeSubscription: Subscription; |
|||
|
|||
private definedConfigComponentRef: ComponentRef<IRuleNodeConfigurationComponent>; |
|||
private definedConfigComponent: IRuleNodeConfigurationComponent; |
|||
|
|||
private configuration: RuleNodeConfiguration; |
|||
|
|||
private propagateChange = (v: any) => { }; |
|||
|
|||
constructor(private translate: TranslateService, |
|||
private ruleChainService: RuleChainService, |
|||
private fb: FormBuilder) { |
|||
this.ruleNodeConfigFormGroup = this.fb.group({ |
|||
configuration: [null, Validators.required] |
|||
}); |
|||
} |
|||
|
|||
registerOnChange(fn: any): void { |
|||
this.propagateChange = fn; |
|||
} |
|||
|
|||
registerOnTouched(fn: any): void { |
|||
} |
|||
|
|||
ngOnInit(): void { |
|||
} |
|||
|
|||
ngOnDestroy(): void { |
|||
if (this.definedConfigComponentRef) { |
|||
this.definedConfigComponentRef.destroy(); |
|||
} |
|||
} |
|||
|
|||
ngAfterViewInit(): void { |
|||
} |
|||
|
|||
setDisabledState(isDisabled: boolean): void { |
|||
this.disabled = isDisabled; |
|||
if (this.disabled) { |
|||
this.ruleNodeConfigFormGroup.disable({emitEvent: false}); |
|||
} else { |
|||
this.ruleNodeConfigFormGroup.enable({emitEvent: false}); |
|||
} |
|||
} |
|||
|
|||
writeValue(value: RuleNodeConfiguration): void { |
|||
this.configuration = value; |
|||
if (this.changeSubscription) { |
|||
this.changeSubscription.unsubscribe(); |
|||
this.changeSubscription = null; |
|||
} |
|||
if (this.definedConfigComponent) { |
|||
this.definedConfigComponent.configuration = this.configuration; |
|||
this.changeSubscription = this.definedConfigComponent.configurationChanged.subscribe((configuration) => { |
|||
this.updateModel(configuration); |
|||
}); |
|||
} else { |
|||
this.ruleNodeConfigFormGroup.get('configuration').patchValue(value, {emitEvent: false}); |
|||
this.changeSubscription = this.ruleNodeConfigFormGroup.get('configuration').valueChanges.subscribe( |
|||
(configuration: RuleNodeConfiguration) => { |
|||
this.updateModel(configuration); |
|||
} |
|||
); |
|||
} |
|||
} |
|||
|
|||
useDefinedDirective(): boolean { |
|||
return this.nodeDefinition && |
|||
(this.nodeDefinition.configDirective && |
|||
this.nodeDefinition.configDirective.length) && !this.definedDirectiveError; |
|||
} |
|||
|
|||
private updateModel(configuration: RuleNodeConfiguration) { |
|||
if (this.definedConfigComponent || this.ruleNodeConfigFormGroup.valid) { |
|||
this.propagateChange(configuration); |
|||
} else { |
|||
this.propagateChange(this.required ? null : configuration); |
|||
} |
|||
} |
|||
|
|||
private validateDefinedDirective() { |
|||
if (this.definedConfigComponentRef) { |
|||
this.definedConfigComponentRef.destroy(); |
|||
this.definedConfigComponentRef = null; |
|||
} |
|||
if (this.nodeDefinition.uiResourceLoadError && this.nodeDefinition.uiResourceLoadError.length) { |
|||
this.definedDirectiveError = this.nodeDefinition.uiResourceLoadError; |
|||
} else if (this.nodeDefinition.configDirective && this.nodeDefinition.configDirective.length) { |
|||
if (this.changeSubscription) { |
|||
this.changeSubscription.unsubscribe(); |
|||
this.changeSubscription = null; |
|||
} |
|||
this.definedConfigContainer.clear(); |
|||
const factory = this.ruleChainService.getRuleNodeConfigFactory(this.nodeDefinition.configDirective); |
|||
this.definedConfigComponentRef = this.definedConfigContainer.createComponent(factory); |
|||
this.definedConfigComponent = this.definedConfigComponentRef.instance; |
|||
this.definedConfigComponent.ruleNodeId = this.ruleNodeId; |
|||
this.definedConfigComponent.configuration = this.configuration; |
|||
this.changeSubscription = this.definedConfigComponent.configurationChanged.subscribe((configuration) => { |
|||
this.updateModel(configuration); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './home.module'; |
|||
@ -0,0 +1,17 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './page.component'; |
|||
@ -0,0 +1,33 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './alarm-id'; |
|||
export * from './asset-id'; |
|||
export * from './audit-log-id'; |
|||
export * from './customer-id'; |
|||
export * from './dashboard-id'; |
|||
export * from './device-credentials-id'; |
|||
export * from './device-id'; |
|||
export * from './entity-id'; |
|||
export * from './entity-view-id'; |
|||
export * from './event-id'; |
|||
export * from './has-uuid'; |
|||
export * from './rule-chain-id'; |
|||
export * from './rule-node-id'; |
|||
export * from './tenant-id'; |
|||
export * from './user-id'; |
|||
export * from './widget-type-id'; |
|||
export * from './widgets-bundle-id'; |
|||
@ -0,0 +1,19 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './page-data'; |
|||
export * from './page-link'; |
|||
export * from './sort-order'; |
|||
@ -0,0 +1,47 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './id/public-api'; |
|||
export * from './page/public-api'; |
|||
export * from './telemetry/telemetry.models'; |
|||
export * from './time/time.models'; |
|||
export * from './alarm.models'; |
|||
export * from './alias.models'; |
|||
export * from './audit-log.models'; |
|||
export * from './authority.enum'; |
|||
export * from './base-data'; |
|||
export * from './component-descriptor.models'; |
|||
export * from './constants'; |
|||
export * from './contact-based.model'; |
|||
export * from './customer.model'; |
|||
export * from './dashboard.models'; |
|||
export * from './device.models'; |
|||
export * from './entity.models'; |
|||
export * from './entity-type.models'; |
|||
export * from './entity-view.models'; |
|||
export * from './error.models'; |
|||
export * from './event.models'; |
|||
export * from './login.models'; |
|||
export * from './material.models'; |
|||
export * from './relation.models'; |
|||
export * from './rule-chain.models'; |
|||
export * from './rule-node.models'; |
|||
export * from './settings.models'; |
|||
export * from './tenant.model'; |
|||
export * from './user.model'; |
|||
export * from './widget.models'; |
|||
export * from './widgets-bundle.model'; |
|||
export * from './window-message.model'; |
|||
@ -0,0 +1,22 @@ |
|||
///
|
|||
/// Copyright © 2016-2019 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.
|
|||
///
|
|||
|
|||
export * from './enum-to-array.pipe'; |
|||
export * from './highlight.pipe'; |
|||
export * from './keyboard-shortcut.pipe'; |
|||
export * from './milliseconds-to-time-string.pipe'; |
|||
export * from './nospace.pipe'; |
|||
export * from './truncate.pipe'; |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue