diff --git a/API.md b/API.md index 58f0f608c3..f3d1e9c9c3 100644 --- a/API.md +++ b/API.md @@ -882,13 +882,13 @@ openmct.install(openmct.plugins.CouchDB('http://localhost:9200')) * `openmct.plugins.URLIndicatorPlugin` adds an indicator which shows the availability of a URL with the following options: - `url` : URL to indicate the status of - - `icon`: Icon to show in the status bar, defaults to `database` + - `cssClass`: Icon to show in the status bar, defaults to `icon-database`, [list of all icons](https://nasa.github.io/openmct/style-guide/#/browse/styleguide:home?view=items) - `interval`: Interval between checking the connection, defaults to `10000` - `label` Name showing up as text in the status bar, defaults to url ```javascript openmct.install(openmct.plugins.URLIndicatorPlugin({ url: 'http://google.com', - icon: 'check', + cssClass: 'check', interval: 10000, label: 'Google' }) diff --git a/src/plugins/URLIndicatorPlugin/URLIndicator.js b/src/plugins/URLIndicatorPlugin/URLIndicator.js index 05d029f0b4..55ba73dc0d 100644 --- a/src/plugins/URLIndicatorPlugin/URLIndicator.js +++ b/src/plugins/URLIndicatorPlugin/URLIndicator.js @@ -40,7 +40,7 @@ define( }; function URLIndicator($http, $interval) { var self = this; - this.icon = "icon-" + (this.options.icon ? this.options.icon : "database"); + this.cssClass = this.options.cssClass ? this.options.cssClass : "icon-database"; this.URLpath = this.options.url; this.label = this.options.label ? this.options.label : this.options.url; this.interval = this.options.interval || 10000; @@ -60,7 +60,7 @@ define( } URLIndicator.prototype.getCssClass = function () { - return this.icon; + return this.cssClass; }; URLIndicator.prototype.getGlyphClass = function () { return this.state.glyphClass; diff --git a/src/plugins/URLIndicatorPlugin/URLIndicatorSpec.js b/src/plugins/URLIndicatorPlugin/URLIndicatorSpec.js index c3d7d27084..3967fb20d7 100644 --- a/src/plugins/URLIndicatorPlugin/URLIndicatorSpec.js +++ b/src/plugins/URLIndicatorPlugin/URLIndicatorSpec.js @@ -57,7 +57,7 @@ define( ); }); - it("has a database icon as default", function () { + it("has a database cssClass as default", function () { expect(indicatorWrapper.getCssClass()).toEqual("icon-database"); }); @@ -102,14 +102,14 @@ define( // Do check for specific class expect(indicatorWrapper.getGlyphClass()).toEqual("err"); }); - it("has a customized icon if supplied in initialization", function () { + it("has a customized cssClass if supplied in initialization", function () { opts = { url: "http://localhost:8080", - icon: "checked", + cssClass: "cssClass-checked", interval: 10000 }; indicatorWrapper = new Indicator(); - expect(indicatorWrapper.getCssClass()).toEqual("icon-checked"); + expect(indicatorWrapper.getCssClass()).toEqual("cssClass-checked"); }); it("has a customized interval if supplied in initialization", function () { opts = {