Skip to content

Commit b5f2c24

Browse files
committed
WIP
1 parent 111f505 commit b5f2c24

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StorageResources.java

+14
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,20 @@ public StoragePluginModel(PluginConfigWrapper plugin, HttpServletRequest request
573573
csrfToken = WebUtils.getCsrfTokenFromHttpRequest(request);
574574
}
575575

576+
/**
577+
* Returns the path for the image used in the list view.
578+
* @return
579+
*/
580+
public String getImagePath() {
581+
if (getCleanType().contentEquals("FileSystem")) {
582+
return "/static/img/storage_logos/FileSystem.png";
583+
}
584+
585+
// If the plugin is in contrib, get the full path
586+
String path = plugin.getConfig().getClass().getResource("/storage_logos/" + getCleanType() + ".png").getPath();
587+
return path;
588+
}
589+
576590
public String getCleanType() {
577591
String pluginName = type.replace("Config", "");
578592
pluginName = pluginName.replace("Plugin", "");

exec/java-exec/src/main/resources/rest/storage/list.ftl

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
<tr>
6262
<td style="border:none;">
6363
<img src="/static/img/storage_logos/${pluginModel.getCleanType()}.png" alt="${pluginModel.getCleanType()}" height=40 width=40 />
64+
${pluginModel.getImagePath()}
6465
</td>
6566
<td style="border:none; max-width: 200px; overflow: hidden; text-overflow: ellipsis;">
6667
${pluginModel.getPlugin().getName()}

0 commit comments

Comments
 (0)