thingsboard/ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.ts

55 lines
1.6 KiB
TypeScript
Raw Normal View History

2020-09-02 18:32:57 +03:00
///
2024-01-09 10:46:16 +02:00
/// Copyright © 2016-2024 The Thingsboard Authors
2020-09-02 18:32:57 +03:00
///
/// 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 { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityTabsComponent } from '../../components/entity/entity-tabs.component';
2020-10-09 18:06:22 +03:00
import {
DeviceProfile,
DeviceTransportType,
deviceTransportTypeHintMap,
deviceTransportTypeTranslationMap
} from '@shared/models/device.models';
2020-09-02 18:32:57 +03:00
@Component({
selector: 'tb-device-profile-tabs',
templateUrl: './device-profile-tabs.component.html',
styleUrls: []
})
export class DeviceProfileTabsComponent extends EntityTabsComponent<DeviceProfile> {
deviceTransportTypes = Object.values(DeviceTransportType);
2020-10-09 18:06:22 +03:00
deviceTransportTypeTranslations = deviceTransportTypeTranslationMap;
2020-10-09 18:06:22 +03:00
deviceTransportTypeHints = deviceTransportTypeHintMap;
isTransportTypeChanged = false;
2020-09-02 18:32:57 +03:00
constructor(protected store: Store<AppState>) {
super(store);
}
ngOnInit() {
super.ngOnInit();
this.detailsForm.get('transportType').valueChanges.subscribe(() => {
this.isTransportTypeChanged = true;
});
2020-09-02 18:32:57 +03:00
}
}