AboutAtlas.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. define([ "require", "backbone", "hbs!tmpl/site/AboutAtlas_tmpl", "modules/Modal", "models/VCommon", "utils/UrlLinks" ], function(require, Backbone, AboutAtlasTmpl, Modal, VCommon, UrlLinks) {
  2. "use strict";
  3. var AboutAtlasView = Backbone.Marionette.LayoutView.extend({
  4. template: AboutAtlasTmpl,
  5. regions: {},
  6. ui: {
  7. atlasVersion: "[data-id='atlasVersion']"
  8. },
  9. events: function() {},
  10. initialize: function(options) {
  11. _.extend(this, options);
  12. var modal = new Modal({
  13. title: "Apache Atlas",
  14. content: this,
  15. okCloses: !0,
  16. showFooter: !0,
  17. allowCancel: !1
  18. }).open();
  19. modal.on("closeModal", function() {
  20. modal.trigger("cancel");
  21. });
  22. },
  23. bindEvents: function() {},
  24. onRender: function() {
  25. var that = this, url = UrlLinks.versionApiUrl(), VCommonModel = new VCommon();
  26. VCommonModel.aboutUs(url, {
  27. success: function(data) {
  28. var str = "<b>Version : </b>" + _.escape(data.Version);
  29. that.ui.atlasVersion.html(str);
  30. },
  31. complete: function() {}
  32. });
  33. }
  34. });
  35. return AboutAtlasView;
  36. });