Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Sean Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 16 | import {Component, Input, OnInit} from '@angular/core'; |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 17 | import { animate, state, style, transition, trigger } from '@angular/animations'; |
| 18 | import { |
| 19 | LogService, |
| 20 | LoadingService, |
| 21 | FnService, |
| 22 | DetailsPanelBaseImpl, |
| 23 | WebSocketService |
| 24 | } from 'gui2-fw-lib'; |
Sean Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 25 | import {Node} from '../../layer/forcesvg/models'; |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 26 | |
| 27 | /* |
| 28 | ONOS GUI -- Topology Details Panel. |
| 29 | Displays details of selected device. |
| 30 | */ |
| 31 | @Component({ |
| 32 | selector: 'onos-details', |
| 33 | templateUrl: './details.component.html', |
| 34 | styleUrls: [ |
| 35 | './details.component.css', './details.theme.css', |
| 36 | '../../topology.common.css', |
| 37 | '../../../../fw/widget/panel.css', '../../../../fw/widget/panel-theme.css' |
| 38 | ], |
| 39 | animations: [ |
| 40 | trigger('detailsPanelState', [ |
| 41 | state('true', style({ |
| 42 | transform: 'translateX(0%)', |
| 43 | opacity: '100' |
| 44 | })), |
| 45 | state('false', style({ |
| 46 | transform: 'translateX(100%)', |
| 47 | opacity: '0' |
| 48 | })), |
| 49 | transition('0 => 1', animate('100ms ease-in')), |
| 50 | transition('1 => 0', animate('100ms ease-out')) |
| 51 | ]) |
| 52 | ] |
| 53 | }) |
| 54 | export class DetailsComponent extends DetailsPanelBaseImpl implements OnInit { |
Sean Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 55 | @Input() selectedNode: Node = undefined; |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 56 | |
| 57 | constructor( |
| 58 | protected fs: FnService, |
| 59 | protected log: LogService, |
| 60 | protected ls: LoadingService, |
| 61 | protected wss: WebSocketService, |
| 62 | ) { |
| 63 | super(fs, ls, log, wss, 'topo'); |
| 64 | this.log.debug('InstanceComponent constructed'); |
| 65 | } |
| 66 | |
| 67 | ngOnInit() { |
Sean Condon | 55c3053 | 2018-10-29 12:26:57 +0000 | [diff] [blame] | 68 | this.on = false; |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | } |