Skip to content

Commit de5c8f3

Browse files
authored
Merge pull request #5 from rundeck-plugins/enh/icons
plugin icons and dynamic list
2 parents fffc024 + 6de7fec commit de5c8f3

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

src/main/java/org/rundeck/plugins/nodes/attributes/AttributeNodeEnhancer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"Adds new attributes to a node if a match is found.\n\nIf the attribute exists and "
1919
+ "optionally "
2020
+ "matches a certain value, add the custom attributes.")
21+
@PluginMetadata(key = "faicon", value = "list-alt")
2122
public class AttributeNodeEnhancer
2223
implements NodeEnhancerPlugin
2324
{

src/main/java/org/rundeck/plugins/nodes/icon/IconNodeEnhancer.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
import com.dtolabs.rundeck.core.common.INodeEntry;
44
import com.dtolabs.rundeck.core.plugins.Plugin;
55
import com.dtolabs.rundeck.core.plugins.configuration.DynamicProperties;
6-
import com.dtolabs.rundeck.plugins.descriptions.PluginDescription;
7-
import com.dtolabs.rundeck.plugins.descriptions.PluginProperty;
8-
import com.dtolabs.rundeck.plugins.descriptions.SelectLabels;
9-
import com.dtolabs.rundeck.plugins.descriptions.SelectValues;
6+
import com.dtolabs.rundeck.plugins.descriptions.*;
107
import com.dtolabs.rundeck.plugins.nodes.IModifiableNodeEntry;
118
import com.dtolabs.rundeck.plugins.nodes.NodeEnhancerPlugin;
129
import org.rundeck.app.spi.Services;
@@ -20,6 +17,7 @@
2017
description =
2118
"Adds an icon or badges based on an attribute.\n\nIf the attribute exists and optionally "
2219
+ "matches a certain value, use the selected icon")
20+
@PluginMetadata(key = "faicon", value = "palette")
2321
public class IconNodeEnhancer
2422
implements NodeEnhancerPlugin, DynamicProperties
2523
{
@@ -41,9 +39,14 @@ public class IconNodeEnhancer
4139
for (int i = 0; i < FAICON_NAMES.length; i++) {
4240
FAICON_NAMES[i] = "fa-" + FAICON_NAMES[i];
4341
}
44-
String[] all = new String[GLYPHICON_NAMES.length + FAICON_NAMES.length];
42+
String[] FABICON_NAMES = iconProperties.getProperty("fabicon.names").split(",");
43+
for (int i = 0; i < FABICON_NAMES.length; i++) {
44+
FABICON_NAMES[i] = "fab-" + FABICON_NAMES[i];
45+
}
46+
String[] all = new String[GLYPHICON_NAMES.length + FAICON_NAMES.length + FABICON_NAMES.length];
4547
System.arraycopy(GLYPHICON_NAMES, 0, all, 0, GLYPHICON_NAMES.length);
4648
System.arraycopy(FAICON_NAMES, 0, all, GLYPHICON_NAMES.length, FAICON_NAMES.length);
49+
System.arraycopy(FABICON_NAMES, 0, all, GLYPHICON_NAMES.length + FAICON_NAMES.length, FABICON_NAMES.length);
4750
ALL_NAMES = all;
4851
} catch (IOException e) {
4952
throw new RuntimeException("Unable to load resource", e);
@@ -65,10 +68,11 @@ public class IconNodeEnhancer
6568
@PluginProperty(title = "Icon Name",
6669
description =
6770
"Icon name to use, glyphicons start with `glyphicon-` and font-awesome icons start with "
68-
+ "`fa-`.\n\nSee [Font-Awesome](https://fontawesome"
71+
+ "`fa-`, and font-awesome Brand icons start with `fab-`.\n\nSee [Font-Awesome]"
72+
+ "(https://fontawesome"
6973
+ ".com/icons?d=gallery&m=free) and [Glyphicon](https://getbootstrap.com/docs/3"
7074
+ ".4/components/)")
71-
75+
@RenderingOption(key = "valueDisplayType", value = "icon")
7276
private String iconName;
7377
/**
7478
*
@@ -79,9 +83,9 @@ public class IconNodeEnhancer
7983
*
8084
*/
8185
@PluginProperty(title = "Badges",
82-
description = "Icon badges to add to the Node. Each badge should start with `fa-` or "
83-
+ "`glyphicon-`, *or* the selected Icon Family will be used.")
84-
86+
description = "Icon badges to add to the Node. Each badge should start with `fa-` or `fab-` or "
87+
+ "`glyphicon-`.")
88+
@RenderingOption(key = "valueDisplayType", value = "icon")
8589
private List<String> iconBadges;
8690

8791
@Override
@@ -92,7 +96,7 @@ public Map<String, Object> dynamicProperties(
9296
{
9397
HashMap<String, Object> values = new HashMap<>();
9498
List<String> iconBadges = Arrays.asList(ALL_NAMES);
95-
values.put("iconName", iconBadges);
99+
values.put("iconBadges", iconBadges);
96100
return values;
97101
}
98102

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
glyphicon.names=asterisk,plus,euro,eur,minus,cloud,envelope,pencil,glass,music,search,heart,star,star-empty,user,film,th-large,th,th-list,ok,remove,zoom-in,zoom-out,off,signal,cog,trash,home,file,time,road,download-alt,download,upload,inbox,play-circle,repeat,refresh,list-alt,lock,flag,headphones,volume-off,volume-down,volume-up,qrcode,barcode,tag,tags,book,bookmark,print,camera,font,bold,italic,text-height,text-width,align-left,align-center,align-right,align-justify,list,indent-left,indent-right,facetime-video,picture,map-marker,adjust,tint,edit,share,check,move,step-backward,fast-backward,backward,play,pause,stop,forward,fast-forward,step-forward,eject,chevron-left,chevron-right,plus-sign,minus-sign,remove-sign,ok-sign,question-sign,info-sign,screenshot,remove-circle,ok-circle,ban-circle,arrow-left,arrow-right,arrow-up,arrow-down,share-alt,resize-full,resize-small,exclamation-sign,gift,leaf,fire,eye-open,eye-close,warning-sign,plane,calendar,random,comment,magnet,chevron-up,chevron-down,retweet,shopping-cart,folder-close,folder-open,resize-vertical,resize-horizontal,hdd,bullhorn,bell,certificate,thumbs-up,thumbs-down,hand-right,hand-left,hand-up,hand-down,circle-arrow-right,circle-arrow-left,circle-arrow-up,circle-arrow-down,globe,wrench,tasks,filter,briefcase,fullscreen,dashboard,paperclip,heart-empty,link,phone,pushpin,usd,gbp,sort,sort-by-alphabet,sort-by-alphabet-alt,sort-by-order,sort-by-order-alt,sort-by-attributes,sort-by-attributes-alt,unchecked,expand,collapse-down,collapse-up,log-in,flash,log-out,new-window,record,save,open,saved,import,export,send,floppy-disk,floppy-saved,floppy-remove,floppy-save,floppy-open,credit-card,transfer,cutlery,header,compressed,earphone,phone-alt,tower,stats,sd-video,hd-video,subtitles,sound-stereo,sound-dolby,sound-5-1,sound-6-1,sound-7-1,copyright-mark,registration-mark,cloud-download,cloud-upload,tree-conifer,tree-deciduous,cd,save-file,open-file,level-up,copy,paste,alert,equalizer,king,queen,pawn,bishop,knight,baby-formula,tent,blackboard,bed,apple,erase,hourglass,lamp,duplicate,piggy-bank,scissors,bitcoin,btc,xbt,yen,jpy,ruble,rub,scale,ice-lolly,ice-lolly-tasted,education,option-horizontal,option-vertical,menu-hamburger,modal-window,oil,grain,sunglasses,text-size,text-color,text-background,object-align-top,object-align-bottom,object-align-horizontal,object-align-left,object-align-vertical,object-align-right,triangle-right,triangle-left,triangle-bottom,triangle-top,console,superscript,subscript,menu-left,menu-right,menu-down,menu-up
22
faicon.names=address-book,address-card,angry,arrow-alt-circle-down,arrow-alt-circle-left,arrow-alt-circle-right,arrow-alt-circle-up,bell-slash,bell,bookmark,building,calendar-alt,calendar-check,calendar-minus,calendar-plus,calendar-times,calendar,caret-square-down,caret-square-left,caret-square-right,caret-square-up,chart-bar,check-circle,check-square,circle,clipboard,clock,clone,closed-captioning,comment-alt,comment-dots,comment,comments,compass,copy,copyright,credit-card,dizzy,dot-circle,edit,envelope-open,envelope,eye-slash,eye,file-alt,file-archive,file-audio,file-code,file-excel,file-image,file-pdf,file-powerpoint,file-video,file-word,file,flag,flushed,folder-open,folder,frown-open,frown,futbol,gem,grimace,grin-alt,grin-beam-sweat,grin-beam,grin-hearts,grin-squint-tears,grin-squint,grin-stars,grin-tears,grin-tongue-squint,grin-tongue-wink,grin-tongue,grin-wink,grin,hand-lizard,hand-paper,hand-peace,hand-point-down,hand-point-left,hand-point-right,hand-point-up,hand-pointer,hand-rock,hand-scissors,hand-spock,handshake,hdd,heart,hospital,hourglass,id-badge,id-card,image,images,keyboard,kiss-beam,kiss-wink-heart,kiss,laugh-beam,laugh-squint,laugh-wink,laugh,lemon,life-ring,lightbulb,list-alt,map,meh-blank,meh-rolling-eyes,meh,minus-square,money-bill-alt,moon,newspaper,object-group,object-ungroup,paper-plane,pause-circle,play-circle,plus-square,question-circle,registered,sad-cry,sad-tear,save,share-square,smile-beam,smile-wink,smile,snowflake,square,star-half,star,sticky-note,stop-circle,sun,surprise,thumbs-down,thumbs-up,times-circle,tired,trash-alt,user-circle,user,window-close,window-maximize,window-minimize,window-restore
3+
fabicon.names=500px,accessible-icon,accusoft,acquisitions-incorporated,adn,adobe,adversal,affiliatetheme,airbnb,algolia,alipay,amazon,amazon-pay,amilia,android,angellist,angrycreative,angular,app-store,app-store-ios,apper,apple,apple-pay,artstation,asymmetrik,atlassian,audible,autoprefixer,avianex,aviato,aws,bandcamp,battle-net,behance,behance-square,bimobject,bitbucket,bitcoin,bity,black-tie,blackberry,blogger,blogger-b,bluetooth,bluetooth-b,bootstrap,btc,buffer,buromobelexperte,buysellads,canadian-maple-leaf,cc-amazon-pay,cc-amex,cc-apple-pay,cc-diners-club,cc-discover,cc-jcb,cc-mastercard,cc-paypal,cc-stripe,cc-visa,centercode,centos,chrome,chromecast,cloudscale,cloudsmith,cloudversify,codepen,codiepie,confluence,connectdevelop,contao,cotton-bureau,cpanel,creative-commons,creative-commons-by,creative-commons-nc,creative-commons-nc-eu,creative-commons-nc-jp,creative-commons-nd,creative-commons-pd,creative-commons-pd-alt,creative-commons-remix,creative-commons-sa,creative-commons-sampling,creative-commons-sampling-plus,creative-commons-share,creative-commons-zero,critical-role,css3,css3-alt,cuttlefish,d-and-d,d-and-d-beyond,dashcube,delicious,deploydog,deskpro,dev,deviantart,dhl,diaspora,digg,digital-ocean,discord,discourse,dochub,docker,draft2digital,dribbble,dribbble-square,dropbox,drupal,dyalog,earlybirds,ebay,edge,elementor,ello,ember,empire,envira,erlang,ethereum,etsy,evernote,expeditedssl,facebook,facebook-f,facebook-messenger,facebook-square,fantasy-flight-games,fedex,fedora,figma,firefox,first-order,first-order-alt,firstdraft,flickr,flipboard,fly,font-awesome,font-awesome-alt,font-awesome-flag,fonticons,fonticons-fi,fort-awesome,fort-awesome-alt,forumbee,foursquare,free-code-camp,freebsd,fulcrum,galactic-republic,galactic-senate,get-pocket,gg,gg-circle,git,git-alt,git-square,github,github-alt,github-square,gitkraken,gitlab,gitter,glide,glide-g,gofore,goodreads,goodreads-g,google,google-drive,google-play,google-plus,google-plus-g,google-plus-square,google-wallet,gratipay,grav,gripfire,grunt,gulp,hacker-news,hacker-news-square,hackerrank,hips,hire-a-helper,hooli,hornbill,hotjar,houzz,html5,hubspot,imdb,instagram,intercom,internet-explorer,invision,ioxhost,itch-io,itunes,itunes-note,java,jedi-order,jenkins,jira,joget,joomla,js,js-square,jsfiddle,kaggle,keybase,keycdn,kickstarter,kickstarter-k,korvue,laravel,lastfm,lastfm-square,leanpub,less,line,linkedin,linkedin-in,linode,linux,lyft,magento,mailchimp,mandalorian,markdown,mastodon,maxcdn,medapps,medium,medium-m,medrt,meetup,megaport,mendeley,microsoft,mix,mixcloud,mizuni,modx,monero,napster,neos,nimblr,node,node-js,npm,ns8,nutritionix,odnoklassniki,odnoklassniki-square,old-republic,opencart,openid,opera,optin-monster,osi,page4,pagelines,palfed,patreon,paypal,penny-arcade,periscope,phabricator,phoenix-framework,phoenix-squadron,php,pied-piper,pied-piper-alt,pied-piper-hat,pied-piper-pp,pinterest,pinterest-p,pinterest-square,playstation,product-hunt,pushed,python,qq,quinscape,quora,r-project,raspberry-pi,ravelry,react,reacteurope,readme,rebel,red-river,reddit,reddit-alien,reddit-square,redhat,renren,replyd,researchgate,resolving,rev,rocketchat,rockrms,safari,salesforce,sass,schlix,scribd,searchengin,sellcast,sellsy,servicestack,shirtsinbulk,shopware,simplybuilt,sistrix,sith,sketch,skyatlas,skype,slack,slack-hash,slideshare,snapchat,snapchat-ghost,snapchat-square,soundcloud,sourcetree,speakap,speaker-deck,spotify,squarespace,stack-exchange,stack-overflow,stackpath,staylinked,steam,steam-square,steam-symbol,sticker-mule,strava,stripe,stripe-s,studiovinari,stumbleupon,stumbleupon-circle,superpowers,supple,suse,symfony,teamspeak,telegram,telegram-plane,tencent-weibo,the-red-yeti,themeco,themeisle,think-peaks,trade-federation,trello,tripadvisor,tumblr,tumblr-square,twitch,twitter,twitter-square,typo3,uber,ubuntu,uikit,uniregistry,untappd,ups,usb,usps,ussunnah,vaadin,viacoin,viadeo,viadeo-square,viber,vimeo,vimeo-square,vimeo-v,vine,vk,vnv,vuejs,waze,weebly,weibo,weixin,whatsapp,whatsapp-square,whmcs,wikipedia-w,windows,wix,wizards-of-the-coast,wolf-pack-battalion,wordpress,wordpress-simple,wpbeginner,wpexplorer,wpforms,wpressr,xbox,xing,xing-square,y-combinator,yahoo,yammer,yandex,yandex-international,yarn,yelp,yoast,youtube,youtube-square,zhihu

0 commit comments

Comments
 (0)