04-13-2020 10:44 AM
Hi,
I'm playing around with the webvi_plug template stuff from https://github.com/ni/systemlink-web-interface-template and I'm wondering:
Solved! Go to Solution.
04-14-2020 05:11 PM
Hi Andre,
(The example on Github uses 'webvi_plugin' in the NXG example, and 'webapp_plugin' in the manual example. I primarily used the manually installed example, so use 'webapp_plugin' throughout my response).
1. To configure security/access control for all Web VIs in one place, modify the `52_webapp_plugin.conf` file, and duplicate the <Directory> tag to specify any other plugins. E.g.
<Directory htdocs/plugins/webapp_plugin/resources>
# Tell the privilege module to use webapp_plugin.htpriv
Session On
AuthNIPrivilegeApplication webapp_plugin
Require privilege ModifyResource
</Directory>
<Directory htdocs/plugins/webapp_plugin2/resources>
# Tell the privilege module to use webapp_plugin.htpriv
Session On
AuthNIPrivilegeApplication webapp_plugin
Require privilege ModifyResource
</Directory>
2a. To change the name of the plugin in the SystemLink homepage, change the "pluginTitle" value within the en.json file –
htdocs\plugins\webapp_plugin\resources\json\locales\en.json
2b. To change the name of the application shown in the NI Web Server Configuration utility, change the <description> tag within the `webapp_plugin.xml` file. E.g.
<description xml:lang="en">Web Application</description>
To duplicate the webapp_plugin, you would also need to update a few other values with the config.json and en.json files. E.g.
C:\Program Files\National Instruments\Shared\Web Server\htdocs\plugins\webapp_plugin2\config.json
{
"authorizationMarker": "/plugins/webapp_plugin2/resources/marker.txt",
"buttonIconCls": "fa fa-area-chart",
"buttonLabelToken": "webapp_plugin2.pluginTitle",
"buttonTooltipToken": "webapp_plugin2.pluginTitle",
"iframeResources": {
"en": {
"json": [
"resources/json/locales/en.json"
]
}
},
"iframeSrc": "plugins/webapp_plugin2/index.html",
"orderWeight": 2,
"permission": "",
"resources": {
"en": {
"css": [
"plugins/webapp_plugin2/resources/css/webapp_plugin.css"
],
"json": [
"plugins/webapp_plugin2/resources/json/locales/en.json"
]
}
},
"routeToken": "webapp_plugin2",
"titleToken": "webapp_plugin2.pluginTitle",
"waitUntilLaunched": false
}
C:\Program Files\National Instruments\Shared\Web Server\htdocs\plugins\webapp_plugin2\resources\json\locales\en.json
{
"webapp_plugin2": {
"pluginTitle": "Web Application 2"
}
}
3. You should be able to rename the file from within the Project Files pane in NXG. Right-click > Rename.
4. You should be able to import new conf files in the same way. Right-click `support files` > Import file…
Hope this helps!
04-15-2020 01:55 AM - edited 04-15-2020 01:58 AM
Thanks Fred, this helps tremendous.
Would it be something to add to the readme in the Github repo?
I will try and add a new file to a webvi dist using a new project started in NXG 4, the example was a converted project from NXG 3.1
There a few annoyance for me with NXG 4's performance compared to 3.1, I'm hoping the next release will provide a better experience on some topics. Since it's so cose I'll check when it's released and provide in app feedback when it's still an annoyance/problem.