table: minor ux options update

This commit is contained in:
Torkel Ödegaard
2017-05-08 15:57:15 +02:00
parent 076a94560b
commit f168c9e53d

View File

@@ -29,108 +29,106 @@
<div class="section gf-form-group"> <div class="section gf-form-group">
<h5 class="section-heading">Table Display</h5> <h5 class="section-heading">Table Display</h5>
<div class="gf-form-inline"> <div class="gf-form">
<div class="gf-form"> <label class="gf-form-label width-8">Rows per page</label>
<label class="gf-form-label width-8">Rows per page</label> <input type="number" class="gf-form-input width-6"
<input type="number" class="gf-form-input width-6" placeholder="100" data-placement="right"
placeholder="100" data-placement="right" ng-model="editor.panel.pageSize"
ng-model="editor.panel.pageSize" ng-change="editor.render()"
ng-change="editor.render()" ng-model-onblur>
ng-model-onblur> </div>
</div> <gf-form-switch class="gf-form" label-class="width-8" switch-class="max-width-6" label="Scroll" checked="editor.panel.scroll" on-change="editor.render()"></gf-form-switch>
<gf-form-switch class="gf-form" label-class="width-4" label="Scroll" checked="editor.panel.scroll" on-change="editor.render()"></gf-form-switch> <div class="gf-form max-width-17">
<div class="gf-form max-width-17"> <label class="gf-form-label width-8">Font size</label>
<label class="gf-form-label width-6">Font size</label> <div class="gf-form-select-wrapper width-6">
<div class="gf-form-select-wrapper max-width-15"> <select class="gf-form-input"
<select class="gf-form-input" ng-model="editor.panel.fontSize"
ng-model="editor.panel.fontSize" ng-options="f for f in editor.fontSizes"
ng-options="f for f in editor.fontSizes" ng-change="editor.render()"></select>
ng-change="editor.render()"></select> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
<h5 class="section-heading"> <h5 class="section-heading">
<span style="padding-right: 10px;">Column Style Rules</span> <span style="padding-right: 10px;">Column Style Rules</span>
<button class="btn btn-secondary btn-small" ng-click="editor.addColumnStyle()"> <button class="btn btn-secondary btn-small" ng-click="editor.addColumnStyle()">
<i class="fa fa-plus"></i>&nbsp;Add <i class="fa fa-plus"></i>&nbsp;Add
</button> </button>
</h5> </h5>
<div class="form-tabs-wrapper"> <div class="form-tabs-wrapper">
<ul class="gf-tabs"> <ul class="gf-tabs">
<li class="gf-tabs-item" ng-repeat="style in editor.panel.styles"> <li class="gf-tabs-item" ng-repeat="style in editor.panel.styles">
<a class="gf-tabs-link" ng-click="editor.activeStyleIndex = $index" ng-class="{active: editor.activeStyleIndex === $index}">{{style.pattern || 'New rule'}}</a> <a class="gf-tabs-link" ng-click="editor.activeStyleIndex = $index" ng-class="{active: editor.activeStyleIndex === $index}">{{style.pattern || 'New rule'}}</a>
</li> </li>
</ul> </ul>
</div> </div>
<div class="form-tabs-content" ng-repeat="style in editor.panel.styles" ng-if="editor.activeStyleIndex === $index"> <div class="form-tabs-content" ng-repeat="style in editor.panel.styles" ng-if="editor.activeStyleIndex === $index">
<div class="section gf-form-group"> <div class="section gf-form-group">
<h5 class="section-heading">Options</h5> <h5 class="section-heading">Options</h5>
<div class="gf-form-inline"> <div class="gf-form-inline">
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-13">Apply to columns named</label> <label class="gf-form-label width-13">Apply to columns named</label>
<input type="text" placeholder="Name or regex" class="gf-form-input width-13" ng-model="style.pattern" bs-tooltip="'Specify regex using /my.*regex/ syntax'" bs-typeahead="editor.getColumnNames" ng-blur="editor.render()" data-min-length=0 data-items=100 ng-model-onblur data-placement="right"> <input type="text" placeholder="Name or regex" class="gf-form-input width-13" ng-model="style.pattern" bs-tooltip="'Specify regex using /my.*regex/ syntax'" bs-typeahead="editor.getColumnNames" ng-blur="editor.render()" data-min-length=0 data-items=100 ng-model-onblur data-placement="right">
</div> </div>
</div> </div>
<div class="gf-form" ng-if="style.type !== 'hidden'"> <div class="gf-form" ng-if="style.type !== 'hidden'">
<label class="gf-form-label width-13">Column Header</label> <label class="gf-form-label width-13">Column Header</label>
<input type="text" class="gf-form-input width-13" ng-model="style.alias" ng-change="editor.render()" ng-model-onblur placeholder="Override header label"> <input type="text" class="gf-form-input width-13" ng-model="style.alias" ng-change="editor.render()" ng-model-onblur placeholder="Override header label">
</div> </div>
</div> </div>
<div class="section gf-form-group"> <div class="section gf-form-group">
<h5 class="section-heading">Type</h5> <h5 class="section-heading">Type</h5>
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-8">Type</label> <label class="gf-form-label width-8">Type</label>
<div class="gf-form-select-wrapper width-12"> <div class="gf-form-select-wrapper width-12">
<select class="gf-form-input" ng-model="style.type" ng-options="c.value as c.text for c in editor.columnTypes" ng-change="editor.render()"></select> <select class="gf-form-input" ng-model="style.type" ng-options="c.value as c.text for c in editor.columnTypes" ng-change="editor.render()"></select>
</div> </div>
</div> </div>
<div class="gf-form" ng-if="style.type === 'date'"> <div class="gf-form" ng-if="style.type === 'date'">
<label class="gf-form-label width-8">Date Format</label> <label class="gf-form-label width-8">Date Format</label>
<metric-segment-model property="style.dateFormat" options="editor.dateFormats" on-change="editor.render()" custom="true"></metric-segment-model> <metric-segment-model property="style.dateFormat" options="editor.dateFormats" on-change="editor.render()" custom="true"></metric-segment-model>
</div> </div>
<div ng-if="style.type === 'string'"> <div ng-if="style.type === 'string'">
<gf-form-switch class="gf-form" label-class="width-8" ng-if="style.type === 'string'" label="Sanitize HTML" checked="style.sanitize" change="editor.render()"></gf-form-switch> <gf-form-switch class="gf-form" label-class="width-8" ng-if="style.type === 'string'" label="Sanitize HTML" checked="style.sanitize" change="editor.render()"></gf-form-switch>
</div> </div>
<div ng-if="style.type === 'number'"> <div ng-if="style.type === 'number'">
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-8">Unit</label> <label class="gf-form-label width-8">Unit</label>
<div class="gf-form-dropdown-typeahead width-12" ng-model="style.unit" dropdown-typeahead2="editor.unitFormats" dropdown-typeahead-on-select="editor.setUnitFormat(style, $subItem)"></div> <div class="gf-form-dropdown-typeahead width-12" ng-model="style.unit" dropdown-typeahead2="editor.unitFormats" dropdown-typeahead-on-select="editor.setUnitFormat(style, $subItem)"></div>
</div> </div>
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-8">Decimals</label> <label class="gf-form-label width-8">Decimals</label>
<input type="number" class="gf-form-input width-4" data-placement="right" ng-model="style.decimals" ng-change="editor.render()" ng-model-onblur> <input type="number" class="gf-form-input width-4" data-placement="right" ng-model="style.decimals" ng-change="editor.render()" ng-model-onblur>
</div> </div>
</div> </div>
</div> </div>
<div class="section gf-form-group" ng-if="style.type === 'number'"> <div class="section gf-form-group" ng-if="style.type === 'number'">
<h5 class="section-heading">Thresholds</h5> <h5 class="section-heading">Thresholds</h5>
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-8">Thresholds<tip>Comma separated values</tip></label> <label class="gf-form-label width-8">Thresholds<tip>Comma separated values</tip></label>
<input type="text" class="gf-form-input width-10" ng-model="style.thresholds" placeholder="50,80" ng-blur="editor.render()" array-join ng-model-onblur> <input type="text" class="gf-form-input width-10" ng-model="style.thresholds" placeholder="50,80" ng-blur="editor.render()" array-join ng-model-onblur>
</div> </div>
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-8">Color Mode</label> <label class="gf-form-label width-8">Color Mode</label>
<div class="gf-form-select-wrapper width-10"> <div class="gf-form-select-wrapper width-10">
<select class="gf-form-input" ng-model="style.colorMode" ng-options="c.value as c.text for c in editor.colorModes" ng-change="editor.render()"></select> <select class="gf-form-input" ng-model="style.colorMode" ng-options="c.value as c.text for c in editor.colorModes" ng-change="editor.render()"></select>
</div> </div>
</div> </div>
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-8">Colors</label> <label class="gf-form-label width-8">Colors</label>
<span class="gf-form-label"> <span class="gf-form-label">
<spectrum-picker ng-model="style.colors[0]" ng-change="editor.render()"></spectrum-picker> <spectrum-picker ng-model="style.colors[0]" ng-change="editor.render()"></spectrum-picker>
</span> </span>
<span class="gf-form-label"> <span class="gf-form-label">
<spectrum-picker ng-model="style.colors[1]" ng-change="editor.render()"></spectrum-picker> <spectrum-picker ng-model="style.colors[1]" ng-change="editor.render()"></spectrum-picker>
</span> </span>
<span class="gf-form-label"> <span class="gf-form-label">