Ronald 9d21736e9f
Add UI copyright headers files (#16614)
* Add copyright headers to UI files

* Ensure copywrite file ignores external libs
2023-03-14 09:18:55 -04:00

34 lines
943 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { inject as service } from '@ember/service';
import RepositoryService from 'consul-ui/services/repository';
import dataSource from 'consul-ui/decorators/data-source';
const modelName = 'session';
export default class SessionService extends RepositoryService {
@service('store')
store;
getModelName() {
return modelName;
}
@dataSource('/:partition/:ns/:dc/sessions/for-node/:id')
findByNode(params, configuration = {}) {
if (typeof configuration.cursor !== 'undefined') {
params.index = configuration.cursor;
params.uri = configuration.uri;
}
return this.store.query(this.getModelName(), params);
}
// TODO: Why Key? Probably should be findBySlug like the others
@dataSource('/:partition/:ns/:dc/sessions/for-key/:id')
findByKey(params, configuration = {}) {
return this.findBySlug(...arguments);
}
}