1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 22:05: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,6 @@
function StoridgeEventModel(data) {
this.Time = data.time;
this.Category = data.category;
this.Module = data.module;
this.Content = data.content;
}

View file

@ -0,0 +1,17 @@
function StoridgeInfoModel(data) {
this.Domain = data.domain;
this.Nodes = data.nodes;
this.Status = data.status;
this.ProvisionedBandwidth = data.provisionedBandwidth;
this.UsedBandwidth = data.usedBandwidth;
this.FreeBandwidth = data.freeBandwidth;
this.TotalBandwidth = data.totalBandwidth;
this.ProvisionedIOPS = data.provisionedIOPS;
this.UsedIOPS = data.usedIOPS;
this.FreeIOPS = data.freeIOPS;
this.TotalIOPS = data.totalIOPS;
this.ProvisionedCapacity = data.provisionedCapacity;
this.UsedCapacity = data.usedCapacity;
this.FreeCapacity = data.freeCapacity;
this.TotalCapacity = data.totalCapacity;
}

View file

@ -0,0 +1,6 @@
function StoridgeNodeModel(name, data) {
this.Name = name;
this.IP = data.ip;
this.Role = data.role;
this.Status = data.status;
}

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
};
}
}