1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-04 21:35:23 +02:00

extension(storidge): add Storidge extension (#1581)

This commit is contained in:
Anthony Lapenna 2018-01-21 17:26:24 +01:00 committed by GitHub
parent edadce359c
commit 7817d4bd0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 2484 additions and 44 deletions

View file

@ -0,0 +1,57 @@
function StoridgeProfileDefaultModel() {
this.Directory = '/cio/';
this.Capacity = 20;
this.Redundancy = 2;
this.Provisioning = 'thin';
this.Type = 'ssd';
this.MinIOPS = 100;
this.MaxIOPS = 2000;
this.MinBandwidth = 1;
this.MaxBandwidth = 100;
}
function StoridgeProfileListModel(data) {
this.Name = data;
this.Checked = false;
}
function StoridgeProfileModel(name, data) {
this.Name = name;
this.Directory = data.directory;
this.Capacity = data.capacity;
this.Provisioning = data.provision;
this.Type = data.type;
this.Redundancy = data.level;
if (data.iops) {
this.MinIOPS = data.iops.min;
this.MaxIOPS = data.iops.max;
}
if (data.bandwidth) {
this.MinBandwidth = data.bandwidth.min;
this.MaxBandwidth = data.bandwidth.max;
}
}
function StoridgeCreateProfileRequest(model) {
this.name = model.Name;
this.capacity = model.Capacity;
this.directory = model.Directory;
this.provision = model.Provisioning;
this.type = model.Type;
this.level = model.Redundancy;
if (model.MinIOPS && model.MaxIOPS) {
this.iops = {
min: model.MinIOPS,
max: model.MaxIOPS
};
}
if (model.MinBandwidth && model.MaxBandwidth) {
this.bandwidth = {
min: model.MinBandwidth,
max: model.MaxBandwidth
};
}
}