Commit b2fe7e51 by Torkel Ödegaard

ux(): added specific fallback logos for plugin depending on type, polished layout selector style

parent 6bf05a81
......@@ -40,7 +40,7 @@ func GetDataSources(c *middleware.Context) {
if plugin, exists := plugins.DataSources[ds.Type]; exists {
dsItem.TypeLogoUrl = plugin.Info.Logos.Small
} else {
dsItem.TypeLogoUrl = "public/img/plugin-default-logo_dark.svg"
dsItem.TypeLogoUrl = "public/img/icn-datasources.svg"
}
result = append(result, dsItem)
......
......@@ -23,17 +23,17 @@ func (fp *FrontendPluginBase) initFrontendPlugin() {
fp.handleModuleDefaults()
fp.Info.Logos.Small = getPluginLogoUrl(fp.Info.Logos.Small, fp.BaseUrl)
fp.Info.Logos.Large = getPluginLogoUrl(fp.Info.Logos.Large, fp.BaseUrl)
fp.Info.Logos.Small = getPluginLogoUrl(fp.Type, fp.Info.Logos.Small, fp.BaseUrl)
fp.Info.Logos.Large = getPluginLogoUrl(fp.Type, fp.Info.Logos.Large, fp.BaseUrl)
for i := 0; i < len(fp.Info.Screenshots); i++ {
fp.Info.Screenshots[i].Path = evalRelativePluginUrlPath(fp.Info.Screenshots[i].Path, fp.BaseUrl)
}
}
func getPluginLogoUrl(path, baseUrl string) string {
func getPluginLogoUrl(pluginType, path, baseUrl string) string {
if path == "" {
return "public/img/plugin-default-logo_dark.svg"
return "public/img/icn-" + pluginType + ".svg"
}
return evalRelativePluginUrlPath(path, baseUrl)
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100px" height="100px" viewBox="692 0 100 100" style="enable-background:new 692 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#787878;}
</style>
<g>
<path class="st0" d="M780.9,44.8c-3.2,0-5.9,2.1-6.7,5h-18.6c-0.2-1.6-0.6-3.1-1.2-4.6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6-3.6,3.6C717.3,21.3,715.6,19.6,715.6,17.6z M704.8,35.7c-2,0-3.6-1.6-3.6-3.6c0-2,1.6-3.6,3.6-3.6s3.6,1.6,3.6,3.6
C708.5,34.1,706.8,35.7,704.8,35.7z M707.9,57.8c-3.3,0-6-2.7-6-6c0-3.3,2.7-6,6-6c3.3,0,6,2.7,6,6
C713.9,55.1,711.2,57.8,707.9,57.8z M707.5,72.4c0,2.3-1.9,4.1-4.1,4.1s-4.1-1.9-4.1-4.1c0-2.3,1.9-4.1,4.1-4.1
S707.5,70.2,707.5,72.4z M719.4,92.9c0,2.2-1.8,3.9-3.9,3.9c-2.2,0-3.9-1.8-3.9-3.9s1.8-3.9,3.9-3.9
C717.7,88.9,719.4,90.7,719.4,92.9z M739.1,87c-2.8,0-5-2.3-5-5s2.3-5,5-5c2.8,0,5,2.3,5,5S741.8,87,739.1,87z M764.8,89.3
c0,2.3-1.9,4.1-4.1,4.1c-2.3,0-4.1-1.9-4.1-4.1s1.9-4.1,4.1-4.1C762.9,85.2,764.8,87,764.8,89.3z M763.2,59.5
c3.5,0,6.4,2.9,6.4,6.4s-2.9,6.4-6.4,6.4c-3.5,0-6.4-2.9-6.4-6.4S759.7,59.5,763.2,59.5z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100px" height="100px" viewBox="692 0 100 100" style="enable-background:new 692 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#787878;}
</style>
<g>
<polygon class="st0" points="705.4,0.6 692,14.1 692,24.9 716.3,0.6 "/>
<path class="st0" d="M730.3,0.6h-10.2L692,28.7v10.2c0,0.2,0,0.4,0,0.6l38.8-38.8C730.7,0.6,730.5,0.6,730.3,0.6z"/>
<path class="st0" d="M733.9,1.3l-41.2,41.2c1,2.4,3,4.4,5.6,5.3l41-41C738.3,4.4,736.4,2.4,733.9,1.3z"/>
<path class="st0" d="M739.8,39.3l-9.1,9.1C735.6,48.2,739.6,44.3,739.8,39.3z"/>
<path class="st0" d="M701.5,48.4h10.8l27.5-27.5V10.2c0,0,0,0,0-0.1L701.5,48.4C701.5,48.4,701.5,48.4,701.5,48.4z"/>
<polygon class="st0" points="716.1,48.4 726.9,48.4 739.8,35.5 739.8,24.7 "/>
<path class="st0" d="M701.5,0.6c-5.3,0-9.5,4.3-9.5,9.5v0.1l9.7-9.7H701.5z"/>
<path class="st0" d="M744.2,38.9c0,2,0.6,3.8,1.6,5.3l42-42c-1.5-1-3.3-1.6-5.3-1.6h-4L744.2,35V38.9z"/>
<path class="st0" d="M753.7,48.4h2.4L792,12.6v-2.4c0-2.3-0.8-4.5-2.3-6.2l-42.2,42.2C749.2,47.6,751.4,48.4,753.7,48.4z"/>
<path class="st0" d="M753.7,0.6c-5.3,0-9.5,4.3-9.5,9.5v6.4l16-16H753.7z"/>
<polygon class="st0" points="744.2,31.2 774.8,0.6 763.9,0.6 744.2,20.3 "/>
<path class="st0" d="M782.5,48.4c1.3,0,2.5-0.3,3.6-0.7l5.2-5.2c0.5-1.1,0.7-2.4,0.7-3.6V31l-17.5,17.5L782.5,48.4L782.5,48.4z"/>
<polygon class="st0" points="770.8,48.4 792,27.2 792,16.4 759.9,48.4 "/>
<path class="st0" d="M701.5,51.6c-1.5,0-2.9,0.4-4.2,1l-4.4,4.4c-0.6,1.3-1,2.7-1,4.2v7.7l17.2-17.2H701.5z"/>
<path class="st0" d="M730.3,99.4c5.3,0,9.5-4.3,9.5-9.5v-6.7l-16.2,16.2H730.3z"/>
<polygon class="st0" points="739.8,68.5 709,99.4 719.8,99.4 739.8,79.4 "/>
<path class="st0" d="M730.3,51.6h-2.7L692,87.1v2.7c0,2.3,0.8,4.4,2.1,6l42.2-42.2C734.7,52.4,732.6,51.6,730.3,51.6z"/>
<polygon class="st0" points="713,51.6 692,72.5 692,83.4 723.8,51.6 "/>
<path class="st0" d="M739.8,61.1c0-2-0.6-3.9-1.7-5.5l-42,42c1.6,1.1,3.4,1.7,5.5,1.7h3.7l34.6-34.6V61.1z"/>
<path class="st0" d="M782,99.4h0.4c5.3,0,9.5-4.3,9.5-9.5v-0.4L782,99.4z"/>
<path class="st0" d="M744.2,60.4l8.8-8.8C748.3,51.9,744.5,55.7,744.2,60.4z"/>
<polygon class="st0" points="744.2,64.2 744.2,75 767.7,51.6 756.8,51.6 "/>
<polygon class="st0" points="771.4,51.6 744.2,78.8 744.2,89.6 782.3,51.6 "/>
<path class="st0" d="M792,61.1c0-0.3,0-0.6,0-0.8l-39.1,39.1c0.3,0,0.6,0,0.8,0h10L792,71.1L792,61.1L792,61.1z"/>
<path class="st0" d="M785.5,52.1l-40.8,40.8c0.9,2.5,2.8,4.6,5.2,5.7l41.3-41.3C790.1,54.8,788,52.9,785.5,52.1z"/>
<polygon class="st0" points="792,74.8 767.4,99.4 778.3,99.4 792,85.7 "/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100px" height="100px" viewBox="200 0 100 100" style="enable-background:new 200 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#787878;}
</style>
<g>
<path class="st0" d="M299.7,29.9c0.2-0.9,0.3-1.8,0.3-2.7c0-7.2-5.4-13.8-15.1-18.7c-9.4-4.7-21.7-7.2-34.9-7.2
c-13.1,0-25.5,2.6-34.9,7.2c-9.7,4.9-15.1,11.5-15.1,18.7c0,0.9,0.1,1.8,0.3,2.7c-0.2,0.9-0.3,1.8-0.3,2.7c0,2.6,0.7,5,2,7.4
c-1.3,2.3-2,4.8-2,7.4c0,0.9,0.1,1.8,0.3,2.7c-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15.3
c-8.8,4.4-20.6,6.9-33.2,6.9c-12.6,0-24.3-2.4-33.2-6.9c-8.4-4.2-13-9.7-13-15.3c0-1.3,0.3-2.6,0.7-3.8c2.6,2.9,6.1,5.6,10.7,7.8
c9.4,4.7,21.7,7.2,34.9,7.2s25.5-2.6,34.9-7.2c4.5-2.3,8.1-4.9,10.7-7.8C296,44.8,296.2,46,296.2,47.3z M216.8,12
c8.8-4.4,20.6-6.9,33.2-6.9s24.3,2.4,33.2,6.9c8.4,4.2,13,9.7,13,15.3s-4.6,11.1-13,15.3c-8.8,4.4-20.6,6.9-33.2,6.9
s-24.3-2.5-33.2-6.9c-8.4-4.2-13-9.7-13-15.3S208.4,16.1,216.8,12z M283.2,48c-8.8,4.4-20.6,6.9-33.2,6.9s-24.3-2.4-33.2-6.9
c-4.3-2.2-7.7-4.6-9.9-7.4c2.2,2,5,3.8,8.2,5.4c9.4,4.7,21.7,7.2,34.9,7.2c13.1,0,25.5-2.6,34.9-7.2c3.2-1.6,6-3.4,8.2-5.4
C290.8,43.3,287.5,45.8,283.2,48z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100px" height="100px" viewBox="510 0 100 100" style="enable-background:new 510 0 100 100;" xml:space="preserve">
<style type="text/css">
.st0{fill:#787878;}
</style>
<g>
<path class="st0" d="M592.1,0h-64.1C518.1,0,510,8,510,17.9v64.1c0,9.9,8,17.9,17.9,17.9h64.1c9.9,0,17.9-8,17.9-17.9V17.9
C610,8,602,0,592.1,0z M592.1,96.3h-64.1c-7.9,0-14.3-6.4-14.3-14.3V17.9c0-7.9,6.4-14.3,14.3-14.3h64.1c7.9,0,14.3,6.4,14.3,14.3
v64.1C606.3,89.9,599.9,96.3,592.1,96.3z"/>
<path class="st0" d="M588.9,11.8h-57.8c-4.6,0-8.4,3.3-9.2,7.7h76.1C597.3,15.1,593.5,11.8,588.9,11.8z"/>
<path class="st0" d="M592.2,53.4c-0.4,0-1.4,0-4.9-1.7h-35.4c-6.8,7.8-7.5,8.3-7.8,8.5c-0.8,0.6-1.7,1.1-12.4-0.8l-6.4,4.4h73V51.7
h-2.4C593.3,53.4,592.8,53.4,592.2,53.4z"/>
<path class="st0" d="M550.5,45l0.1-0.1l7.7-7.9h-36.6V49H547C548.1,47.7,549.4,46.3,550.5,45z"/>
<path class="st0" d="M584,49l-7-6.8l-12.5-3.9l-10,10.2c-0.1,0.2-0.3,0.3-0.4,0.5L584,49L584,49L584,49z"/>
<path class="st0" d="M531.5,53.8c3.7,0.7,8.1,1.4,9.8,1.5c0.7-0.7,1.9-2,3.3-3.6h-22.8v7.9l8.6-6L531.5,53.8z"/>
<rect x="521.8" y="66.4" class="st0" width="76.4" height="12.1"/>
<path class="st0" d="M579.8,37.5l9.6,9.3c0.9,0.4,1.8,0.8,2.4,1.1c1.3-0.9,3.9-2.9,6.4-4.9v-6.1h-20.2L579.8,37.5z"/>
<polygon class="st0" points="521.8,34.2 561,34.2 563,32.2 569.5,34.2 598.2,34.2 598.2,22.2 521.8,22.2 "/>
<path class="st0" d="M531.1,88.2h57.8c4.3,0,8-3,9-7h-75.8C523.1,85.2,526.8,88.2,531.1,88.2z"/>
</g>
</svg>
.layout-selector {
@include clearfix();
text-align: right;
margin: 0 $spacer*1.5 $spacer;
position: relative;
......@@ -7,10 +9,12 @@
button {
background: $input-label-bg;
color: $text-color-weak;
box-shadow: $card-shadow;
border: none;
padding: 0.5rem;
line-height: 1;
font-size: 130%;
float: right;
&:focus {
outline: none;
......@@ -20,6 +24,15 @@
background-color: lighten($input-label-bg, 5%);
color: $link-color;
}
&:nth-child(2) {
border-radius: 3px 0 0 3px;
border-right: 1px solid $panel-border;
}
&:nth-child(1) {
border-radius: 0 3px 3px 0;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment