PageRenderTime 38ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/dashboard/app/scripts/collections/server-collection.js

https://github.com/hnuzhoulin/calamari-clients
JavaScript | 21 lines | 16 code | 3 blank | 2 comment | 2 complexity | 862f0a4e084430f2cd74ac40816501d6 MD5 | raw file
Possible License(s): Apache-2.0
  1. /*jshint -W106*/
  2. /*global define*/
  3. define(['underscore', 'backbone', 'models/application-model'], function(_, Backbone, models) {
  4. 'use strict';
  5. var ServerCollection = Backbone.Collection.extend({
  6. cluster: 1,
  7. url: function() {
  8. return '/api/v1/cluster/' + this.cluster + '/server';
  9. },
  10. initialize: function(models, options) {
  11. if (options && options.cluster) {
  12. this.cluster = options.cluster;
  13. }
  14. },
  15. model: models.ServerModel
  16. });
  17. return ServerCollection;
  18. });