requestHeader.constants = constants;
requestHeader.urlChanged = false;
requestHeader.executedOperation = null;
+
requestHeader.selectedOperationsList = [];
requestHeader.selectedOperation = null;
requestHeader.requestUrl = '';
},
default: function (){
var dataType;
- if(requestHeader.executedOperation) {
- dataType = requestHeader.executedOperation === constants.OPERATION_GET ? constants.REQUEST_DATA_TYPE_RECEIVED : 'SENT';
+ if (requestHeader.executedOperation) {
+ dataType = requestHeader.executedOperation === constants.OPERATION_GET ?
+ constants.REQUEST_DATA_TYPE_RECEIVED :
+ 'SENT';
}
else {
- dataType = requestHeader.selectedOperation === constants.OPERATION_GET ? constants.REQUEST_DATA_TYPE_RECEIVED : 'SENT';
+ dataType = 'SENT';
}
$scope.rootBroadcast(constants.YANGMAN_GET_CODEMIRROR_DATA + dataType, params);
var preparedReceivedData = {};
- if (requestHeader.fillFormWithReceivedData) {
+ if (requestHeader.fillFormWithReceivedData || requestHeader.selectedShownDataType === constants.DISPLAY_TYPE_REQ_DATA ) {
preparedReceivedData = YangmanService.prepareReceivedData(
$scope.node,
requestHeader.selectedOperation,
'app/yangman/services/history-settings.services',
'app/yangman/directives/ui-codemirror.directive',
'app/yangman/directives/read_file.directive',
+ 'app/yangman/directives/height-watcher.directive',
], function () {
'use strict';
--- /dev/null
+define([], function () {
+ 'use strict';
+
+ angular.module('app.yangman').directive('heightWatcher', heightWatcherDirective);
+
+ function heightWatcherDirective() {
+ return {
+ restrict: 'A',
+ link: function (scope, element, attrs) {
+ scope.$watch(function () {
+ return element.css(attrs['watchAttribute']);
+ }, heightChangedCallBack,
+ true);
+
+ scope.heightTotal = null;
+
+ function heightChangedCallBack(newHeight, oldHeight) {
+ var heightReceivedData, heightSentData;
+
+ if (newHeight !== oldHeight) {
+ // set total available height
+ scope.heightTotal = angular.element('#jsonSection')[0].offsetHeight;
+
+ // set full height of ReceiveData (if there will be no sent data)
+ angular.element('#ReceiveData').css('height', scope.heightTotal + 'px');
+
+ heightSentData = angular.element('#sentData')[0].offsetHeight;
+ heightReceivedData = angular.element('#ReceiveData')[0].offsetHeight;
+
+ // set ReceiveData height to fill up bottom
+ if ((heightSentData + heightReceivedData) < scope.heightTotal) {
+ angular.element('#ReceiveData').css('height', scope.heightTotal - heightSentData + 'px');
+ }
+ }
+ }
+ }
+ };
+ }
+});
* @returns {number|*}
*/
function roundTimestampToDate(timeStamp){
- timeStamp -= timeStamp % (24 * 60 * 60 * 1000);//subtract amount of time since midnight
timeStamp += new Date().getTimezoneOffset() * 60 * 1000;//add on the timezone offset
+ timeStamp -= timeStamp % (24 * 60 * 60 * 1000);//subtract amount of time since midnight
return timeStamp;
}
<div flex="15" class="yangmanModule__requests-list__group__item__method" layout-align="center center">
<p id="{{itemId}}-operation" class="{{request.status === 'success' || !request.status ? request.method : 'error'}}"> {{request.method === vm.constants.OPERATION_DELETE ? 'DEL' : request.method }} </p>
- <md-tooltip ng-show="request.status.length" md-direction="bottom" ng-show="request.status">{{request.status | uppercase }}</md-tooltip>
+ <md-tooltip ng-show="request.status.length" md-direction="bottom" ng-show="request.status">
+ Status: {{request.status | uppercase }} <br />
+ Run at: {{request.timestamp | date: 'medium' }}
+ </md-tooltip>
</div>
<div flex class="yangmanModule__requests-list__group__item__path" layout="column">
{{'YANGMAN_REQ_RUN'| translate}}
</md-button>
</md-menu-item>
- id="{{itemId}}-show-sent-data"
<md-menu-item ng-if="request.collection.length">
<md-button aria-label="{{'YANGMAN_REQ_DUPLICATE'| translate}}"
id="{{itemId}}-duplicate"
<!-- JSON section -->
<section class="yangmanModule__right-panel__req-data bottom-content"
+ id="jsonSection"
ng-cloak
ng-show="rightPanelSection === main.constants.DISPLAY_TYPE_REQ_DATA">
ng-show="main.jsonView.sent"
ng-init="requestData.init('SENT')"
ng-class="{'half-size': main.jsonView.received && main.jsonView.sent}"
+ height-watcher watch-attribute="height"
+ id="sentData"
class="yangmanModule__right-panel__req-data__cm-SENT ym-resizable-s">
<section class="yangmanModule__right-panel__req-data__header" layout="row">
ng-show="main.jsonView.received"
ng-init="requestData.init(main.constants.REQUEST_DATA_TYPE_RECEIVED)"
ng-class="{'half-size': main.jsonView.received && main.jsonView.sent}"
+ id="ReceiveData"
class="yangmanModule__right-panel__req-data__cm-RECEIVED ym-resizable-s">
<section class="yangmanModule__right-panel__req-data__header" layout="row">
<div ng-repeat="elem in node.value" ng-show="node.expanded">
<!-- Leaf list values -->
- <md-input-container md-no-float class="input-icon-container">
+ <md-input-container md-no-float class="input-icon-container full_width">
<!-- input -->
- <input ng-change="yangLeafList.changed()" ng-model="elem.value" aria-label="{{elem.value}}">
+ <input ng-change="yangLeafList.changed()" ng-model="elem.value" aria-label="{{elem.value}}" class="full_width">
<!-- remove Icon -->
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-click="yangLeafList.removeListElem(elem)">
ng-repeat="type in node.getChildren('type')"
ng-include="yangForm.viewPath + '/config/types/' + yangLeaf.getLeafType() + '.tpl.html'"
{{yangLeaf.getLeafType() === 'union' ? 'flex="grow"' : ''}}
- layout="row">
+ layout="row"
+ class="full_width">
</div>
</div>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
ng-true-value="1"
ng-false-value="0"
ng-change="yangTypeBit.valueChanged()"
- ng-disabled="{{ yangOutput.notEditable }}"
+ ng-readonly="{{ yangOutput.notEditable }}"
aria-label="{{bit.label}}">
{{bit.label}}
</md-checkbox>
-<section ng-controller="YMTypeBooleanCtrl as yangTypeBolean" layout="row" class="layout-row flex-center" flex>
+<section ng-controller="YMTypeBooleanCtrl as yangTypeBolean" layout="row" class="layout-row flex-center">
<span class="mr8">F</span>
<md-switch ng-model="node.value"
id="{{ node.label + node.id }}"
aria-label="Boolean"
- ng-disabled="{{ yangOutput.notEditable }}">
+ ng-readonly="{{ yangOutput.notEditable }}">
</md-switch>
<span>T</span>
</section>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
</md-icon>
-
ng-true-value="1"
ng-false-value="0"
ng-change="yangTypeEmpty.valueChanged()"
- ng-disabled="{{ yangOutput.notEditable }}"
+ ng-readonly="{{ yangOutput.notEditable }}"
aria-label="{{type.label}}"></md-checkbox>
</section>
<md-input-container ng-controller="YMTypeEnumCtrl as yangTypeEnum">
- <md-select ng-model="type.selEnum" md-on-close="yangTypeEnum.valueChanged()" ng-disabled="{{ yangOutput.notEditable }}">
+ <md-select ng-model="type.selEnum" md-on-close="yangTypeEnum.valueChanged()" ng-readonly="{{ yangOutput.notEditable }}">
<md-option ng-repeat="enum in type.getChildren('enum')" ng-value="enum">
{{enum.label}}
</md-option>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
-</md-input-container>
\ No newline at end of file
+</md-input-container>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
-</md-input-container>
\ No newline at end of file
+</md-input-container>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
-<md-input-container md-no-float>
- <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}" ng-disabled="{{ yangOutput.notEditable }}">
+<md-input-container md-no-float class="full_width">
+ <input ng-change="yangType.valueChanged()" ng-model="node.value" aria-label="{{node.value}}" placeholder="{{type.label}}"
+ ng-readonly="{{ yangOutput.notEditable }}" class="full_width">
<md-tooltip md-direction="top">{{type.label}}</md-tooltip>
</md-input-container>
<md-icon md-font-set="material-icons" class="top-icon top-element pointer" ng-show="type.errors.length > 0">
<md-tooltip md-direction="top">{{type.errors.join('\n')}}</md-tooltip>
error_outline
-</md-icon>
\ No newline at end of file
+</md-icon>
<div ng-repeat="elem in node.value" ng-show="node.expanded">
<!-- Leaf list values -->
- <md-input-container md-no-float class="input-icon-container">
+ <md-input-container md-no-float class="input-icon-container full_width">
<!-- input -->
<input ng-model="elem.value" aria-label="{{elem.value}}" ng-disabled="true">
</md-input-container>
.mb0{
margin-bottom: 0;
}
+
+input:-moz-read-only {
+ color: rgba(140, 140, 140, 0.87);
+}
+
+input:read-only {
+ color: rgba(140, 140, 140, 0.87);
+}
+
+md-tooltip .md-content {
+ height: auto;
+}
+
+.full_width {
+ width: 100%;
+}