Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Webportal: add pai-version attribute to <pai-plugin> (#2245)
Browse files Browse the repository at this point in the history
* Webportal: add pai-version attribute to <pai-plugin>

* Use preprocess to apply window.PAI_VERSION

* set version in layout.html
  • Loading branch information
Gerhut authored Mar 4, 2019
1 parent d150ced commit 2d57bc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/webportal/src/app/layout/layout.component.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
<div class="control-sidebar-bg"></div>

</div>
<script>window.PAI_VERSION = <%=JSON.stringify(htmlWebpackPlugin.options.version)%></script>
<script src="/scripts/env.js"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion src/webportal/src/app/plugin/plugin.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ $(document).ready(function() {

loadScript(plugin.uri, function() {
const $plugin = $('<pai-plugin>')
.attr('pai-rest-server-uri', window.ENV.restServerUri);
.attr('pai-rest-server-uri', window.ENV.restServerUri)
.attr('pai-version', window.PAI_VERSION);
if (cookies.get('token')) {
$plugin.attr('pai-user', cookies.get('user'))
.attr('pai-rest-server-token', cookies.get('token'));
Expand Down

0 comments on commit 2d57bc6

Please sign in to comment.