/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
- /*jshint -W106*/
- /*global define*/
- define(['underscore', 'backbone', 'models/application-model'], function(_, Backbone, models) {
- 'use strict';
- var ServerCollection = Backbone.Collection.extend({
- cluster: 1,
- url: function() {
- return '/api/v1/cluster/' + this.cluster + '/server';
- },
- initialize: function(models, options) {
- if (options && options.cluster) {
- this.cluster = options.cluster;
- }
- },
- model: models.ServerModel
- });
- return ServerCollection;
- });