@@ -295,7 +295,7 @@ angular.module( 'patternfly.card' ).directive('pfAggregateStatusCard', function
295
295
} ) ;
296
296
; /**
297
297
* @ngdoc directive
298
- * @name patternfly.card.directive:pfCard
298
+ * @name patternfly.card.directive:pfCard Timeframe Filters
299
299
* @restrict A
300
300
* @element ANY
301
301
* @param {string } headTitle Title for the card
@@ -330,37 +330,98 @@ angular.module( 'patternfly.card' ).directive('pfAggregateStatusCard', function
330
330
<file name="index.html">
331
331
<div ng-controller="ChartCtrl">
332
332
<label class="label-title">Timeframe filter in header</label>
333
- <div pf-card head-title="Card Title" sub-title="Card Subtitle" show-top-border="true" filter="filterConfigHeader" style="width: 50%">
334
- Card Contents
335
- </div>
336
-
333
+ <div pf-card head-title="Card Title" sub-title="Card Subtitle" show-top-border="true" filter="filterConfigHeader" style="width: 50%">
334
+ Card Contents
335
+ </div>
337
336
<label class="label-title">Footer with Link & Timeframe filter</label>
338
337
<div pf-card head-title="Card Title" sub-title="Card Subtitle" show-top-border="true"
339
338
footer="footerConfig" filter="filterConfig" style="width: 50%">
340
- Card Contents
339
+ Card Contents
341
340
</div>
341
+ </div>
342
+ </file>
343
+ <file name="script.js">
344
+ angular.module( 'demo', ['patternfly.charts', 'patternfly.card'] ).controller( 'ChartCtrl', function( $scope ) {
345
+
346
+ $scope.footerConfig = {
347
+ 'iconClass' : 'fa fa-flag',
348
+ 'text' : 'View All Events',
349
+ 'callBackFn': function () {
350
+ alert("Footer Callback Fn Called");
351
+ }
352
+ }
353
+
354
+ $scope.filterConfigHeader = {
355
+ 'filters' : [{label:'Last 30 Days', value:'30'},
356
+ {label:'Last 15 Days', value:'15'},
357
+ {label:'Today', value:'today'}],
358
+ 'callBackFn': function (f) {
359
+ alert("Header Filter Callback Fn Called for '" + f.label + "' value = " + f.value);
360
+ },
361
+ 'position' : 'header'
362
+ }
363
+
364
+ $scope.filterConfig = {
365
+ 'filters' : [{label:'Last 30 Days', value:'30'},
366
+ {label:'Last 15 Days', value:'15'},
367
+ {label:'Today', value:'today'}],
368
+ 'callBackFn': function (f) {
369
+ alert("Filter Callback Fn Called for '" + f.label + "' value = " + f.value);
370
+ },
371
+ 'defaultFilter' : '1'
372
+ }
373
+ });
374
+ </file>
375
+ </example>
376
+ */
377
+ ; /**
378
+ * @ngdoc directive
379
+ * @name patternfly.card.directive:pfCard Trends
380
+ * @restrict A
381
+ * @element ANY
382
+ * @param {string } headTitle Title for the card
383
+ * @param {string= } subTitle Sub-Title for the card
384
+ * @param {boolean= } showTopBorder Show/Hide the blue top border. True shows top border, false (default) hides top border
385
+ * @param {boolean= } showTitlesSeparator Show/Hide the grey line between the title and sub-title.
386
+ * True (default) shows the line, false hides the line
387
+ * @param {object= } footer footer configuration properties:<br/>
388
+ * <ul style='list-style-type: none'>
389
+ * <li>.iconClass - (optional) the icon to show on the bottom left of the footer panel
390
+ * <li>.text - (optional) the text to show on the bottom left of the footer panel, to the right of the icon
391
+ * <li>.href - (optional) the href link to navigate to when the footer href is clicked
392
+ * <li>.callBackFn - (optional) user defined function to call when the footer href is clicked
393
+ * </ul>
394
+ * *Note: If a href link and a callBackFn are specified, the href link will be called
395
+ * @param {object= } filter filter configuration properties:<br/>
396
+ * <ul style='list-style-type: none'>
397
+ * <li>.filters - drop down items for the filter.
398
+ *<pre class=''>
399
+ * Ex: 'filters' : [{label:'Last 30 Days', value:'30'},
400
+ * {label:'Last 15 Days', value:'15'},
401
+ * {label:'Today', value:'today'}]</pre>
402
+ * <li>.defaultFilter - integer, 0 based index into the filters array
403
+ * <li>.callBackFn - user defined function to call when a filter is selected
404
+ * </ul>
405
+ * @description
406
+ * Directive for easily displaying a card with html content
407
+ *
408
+ * @example
409
+ <example module="demo">
342
410
411
+ <file name="index.html">
412
+ <div ng-controller="ChartCtrl">
343
413
<label class="label-title">Card With Single Trend Chart</label>
344
414
<div pf-card head-title="Cluster Utilization" show-top-border="true" footer="footerConfig" filter="filterConfig" style="width: 50%">
345
415
<div pf-trends-chart config="configSingle" chart-data="dataSingle"></div>
346
416
</div>
347
-
348
417
<label class="label-title">Card With Multiple Trends</label>
349
418
<div pf-card head-title="Performance" sub-title="Last 30 Days" show-top-border="false"
350
419
show-titles-separator="false" style="width: 65%" footer="actionBarConfig">
351
420
<div pf-trends-chart config="configVirtual" chart-data="dataVirtual"></div>
352
421
<div pf-trends-chart config="configPhysical" chart-data="dataPhysical"></div>
353
422
<div pf-trends-chart config="configMemory" chart-data="dataMemory"></div>
354
423
</div>
355
-
356
- <label class="label-title">Card With Multiple Utilization Bars</label>
357
- <div pf-card head-title="System Resources" show-top-border="true" style="width: 65%">
358
- <div pf-utilization-bar-chart chart-data=data2 chart-title=title2 layout=layoutInline units=units2 threshold-error="85" threshold-warning="60"></div>
359
- <div pf-utilization-bar-chart chart-data=data3 chart-title=title3 layout=layoutInline units=units3 threshold-error="85" threshold-warning="60"></div>
360
- <div pf-utilization-bar-chart chart-data=data4 chart-title=title4 layout=layoutInline units=units4 threshold-error="85" threshold-warning="60"></div>
361
- <div pf-utilization-bar-chart chart-data=data5 chart-title=title5 layout=layoutInline units=units5 threshold-error="85" threshold-warning="60"></div>
362
- </div>
363
-
424
+ </div>
364
425
</div>
365
426
</file>
366
427
<file name="script.js">
@@ -374,16 +435,6 @@ angular.module( 'patternfly.card' ).directive('pfAggregateStatusCard', function
374
435
}
375
436
}
376
437
377
- $scope.filterConfigHeader = {
378
- 'filters' : [{label:'Last 30 Days', value:'30'},
379
- {label:'Last 15 Days', value:'15'},
380
- {label:'Today', value:'today'}],
381
- 'callBackFn': function (f) {
382
- alert("Header Filter Callback Fn Called for '" + f.label + "' value = " + f.value);
383
- },
384
- 'position' : 'header'
385
- }
386
-
387
438
$scope.filterConfig = {
388
439
'filters' : [{label:'Last 30 Days', value:'30'},
389
440
{label:'Last 15 Days', value:'15'},
@@ -464,9 +515,60 @@ angular.module( 'patternfly.card' ).directive('pfAggregateStatusCard', function
464
515
alert("Footer Callback Fn Called");
465
516
}
466
517
}
518
+ });
519
+ </file>
520
+ </example>
521
+ */
522
+ ; /**
523
+ * @ngdoc directive
524
+ * @name patternfly.card.directive:pfCard Utilization
525
+ * @restrict A
526
+ * @element ANY
527
+ * @param {string } headTitle Title for the card
528
+ * @param {string= } subTitle Sub-Title for the card
529
+ * @param {boolean= } showTopBorder Show/Hide the blue top border. True shows top border, false (default) hides top border
530
+ * @param {boolean= } showTitlesSeparator Show/Hide the grey line between the title and sub-title.
531
+ * True (default) shows the line, false hides the line
532
+ * @param {object= } footer footer configuration properties:<br/>
533
+ * <ul style='list-style-type: none'>
534
+ * <li>.iconClass - (optional) the icon to show on the bottom left of the footer panel
535
+ * <li>.text - (optional) the text to show on the bottom left of the footer panel, to the right of the icon
536
+ * <li>.href - (optional) the href link to navigate to when the footer href is clicked
537
+ * <li>.callBackFn - (optional) user defined function to call when the footer href is clicked
538
+ * </ul>
539
+ * *Note: If a href link and a callBackFn are specified, the href link will be called
540
+ * @param {object= } filter filter configuration properties:<br/>
541
+ * <ul style='list-style-type: none'>
542
+ * <li>.filters - drop down items for the filter.
543
+ *<pre class=''>
544
+ * Ex: 'filters' : [{label:'Last 30 Days', value:'30'},
545
+ * {label:'Last 15 Days', value:'15'},
546
+ * {label:'Today', value:'today'}]</pre>
547
+ * <li>.defaultFilter - integer, 0 based index into the filters array
548
+ * <li>.callBackFn - user defined function to call when a filter is selected
549
+ * </ul>
550
+ * @description
551
+ * Directive for easily displaying a card with html content
552
+ *
553
+ * @example
554
+ <example module="demo">
555
+
556
+ <file name="index.html">
557
+ <div ng-controller="ChartCtrl">
558
+ <label class="label-title">Card With Multiple Utilization Bars</label>
559
+ <div pf-card head-title="System Resources" show-top-border="true" style="width: 65%">
560
+ <div pf-utilization-bar-chart chart-data=data2 chart-title=title2 layout=layoutInline units=units2 threshold-error="85" threshold-warning="60"></div>
561
+ <div pf-utilization-bar-chart chart-data=data3 chart-title=title3 layout=layoutInline units=units3 threshold-error="85" threshold-warning="60"></div>
562
+ <div pf-utilization-bar-chart chart-data=data4 chart-title=title4 layout=layoutInline units=units4 threshold-error="85" threshold-warning="60"></div>
563
+ <div pf-utilization-bar-chart chart-data=data5 chart-title=title5 layout=layoutInline units=units5 threshold-error="85" threshold-warning="60"></div>
564
+ </div>
565
+ </div>
566
+ </file>
567
+ <file name="script.js">
568
+ angular.module( 'demo', ['patternfly.charts', 'patternfly.card'] ).controller( 'ChartCtrl', function( $scope ) {
467
569
468
- $scope.title2 = 'Memory';
469
- $scope.units2 = 'GB';
570
+ $scope.title2 = 'Memory';
571
+ $scope.units2 = 'GB';
470
572
471
573
$scope.data2 = {
472
574
'used': '25',
0 commit comments