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

Webportal: add pai-version attribute to <pai-plugin> #2245

Merged
merged 5 commits into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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