openanalytics / shinyproxy

ShinyProxy - Open Source Enterprise Deployment for Shiny and data science apps
https://www.shinyproxy.io
Apache License 2.0
525 stars 152 forks source link

Adding bar search in apps menu #418

Open mos790 opened 1 year ago

mos790 commented 1 year ago

Hello,

Thanks a lot for this solution,

Is it possible to add a bar search (similar to power BI server) allowing users to search apps ?

Thanks,

LEDfan commented 1 year ago

Hi

We don't have out of the box support for searching for apps. You could implement this yourselves by adding some javascript to the shinyproxy templates. For example, you could use the API to search for a list of applications.

See https://shinyproxy.io/documentation/api/ and https://github.com/openanalytics/shinyproxy-config-examples/tree/master/04-custom-html-template for more information.

I'll keep this issue open as a feature for request for a built-in search function.

corey-dawson commented 1 year ago

Has anyone done this? would love to see an example of adding a search bar to the main shinyproxy screen

PauloJhonny commented 1 year ago

Hi,

I don't know if i can help you in some way with my code, but I added this lines to index.html in order to show a search bar:


...
...
...

<div class="row">
        <div class="pull-right col-md-3">
            <input type="text" name="searchbox" id="searchbox" class="filterinput form-control"
                placeholder="&#xF002; Buscar módulo..."
                style="font-family: FontAwesome, Arial; font-style: normal">
        </div>
</div>

...
...
...

<script type="text/javascript" th:inline="javascript">

        $(document).ready(function () {
            $("#searchbox").on("keyup", function () {
                var value = $(this).val().toLowerCase();
                $('div[data-role="modulos_cards"]').filter(function () {
                    $(this).toggle($(this).find('a.card-title, a.card-subtitle').text().toLowerCase().indexOf(value) > -1)

                });
            });
        });

</script>

...
...
...

I hope it can help you!