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:
parent
edadce359c
commit
7817d4bd0b
47 changed files with 2484 additions and 44 deletions
6
app/extensions/storidge/models/events.js
Normal file
6
app/extensions/storidge/models/events.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
function StoridgeEventModel(data) {
|
||||
this.Time = data.time;
|
||||
this.Category = data.category;
|
||||
this.Module = data.module;
|
||||
this.Content = data.content;
|
||||
}
|
17
app/extensions/storidge/models/info.js
Normal file
17
app/extensions/storidge/models/info.js
Normal 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;
|
||||
}
|
6
app/extensions/storidge/models/node.js
Normal file
6
app/extensions/storidge/models/node.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
function StoridgeNodeModel(name, data) {
|
||||
this.Name = name;
|
||||
this.IP = data.ip;
|
||||
this.Role = data.role;
|
||||
this.Status = data.status;
|
||||
}
|
57
app/extensions/storidge/models/profile.js
Normal file
57
app/extensions/storidge/models/profile.js
Normal 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
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue