mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 13:55:21 +02:00
feat(uac): add multi user management and UAC (#647)
This commit is contained in:
parent
f28f223624
commit
80d50378c5
91 changed files with 3973 additions and 866 deletions
|
@ -10,11 +10,21 @@ function ContainerViewModel(data) {
|
|||
this.Image = data.Image;
|
||||
this.Command = data.Command;
|
||||
this.Checked = false;
|
||||
this.Labels = data.Labels;
|
||||
this.Ports = [];
|
||||
this.Mounts = data.Mounts;
|
||||
for (var i = 0; i < data.Ports.length; ++i) {
|
||||
var p = data.Ports[i];
|
||||
if (p.PublicPort) {
|
||||
this.Ports.push({ host: p.IP, private: p.PrivatePort, public: p.PublicPort });
|
||||
}
|
||||
}
|
||||
if (data.Portainer) {
|
||||
this.Metadata = {};
|
||||
if (data.Portainer.ResourceControl) {
|
||||
this.Metadata.ResourceControl = {
|
||||
OwnerId: data.Portainer.ResourceControl.OwnerId
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,10 @@ function ServiceViewModel(data) {
|
|||
if (data.Spec.TaskTemplate.ContainerSpec.Env) {
|
||||
this.Env = data.Spec.TaskTemplate.ContainerSpec.Env;
|
||||
}
|
||||
this.Mounts = [];
|
||||
if (data.Spec.TaskTemplate.ContainerSpec.Mounts) {
|
||||
this.Mounts = data.Spec.TaskTemplate.ContainerSpec.Mounts;
|
||||
}
|
||||
if (data.Endpoint.Ports) {
|
||||
this.Ports = data.Endpoint.Ports;
|
||||
}
|
||||
|
@ -33,4 +37,13 @@ function ServiceViewModel(data) {
|
|||
this.Checked = false;
|
||||
this.Scale = false;
|
||||
this.EditName = false;
|
||||
|
||||
if (data.Portainer) {
|
||||
this.Metadata = {};
|
||||
if (data.Portainer.ResourceControl) {
|
||||
this.Metadata.ResourceControl = {
|
||||
OwnerId: data.Portainer.ResourceControl.OwnerId
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
11
app/models/user.js
Normal file
11
app/models/user.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
function UserViewModel(data) {
|
||||
this.Id = data.Id;
|
||||
this.Username = data.Username;
|
||||
this.RoleId = data.Role;
|
||||
if (data.Role === 1) {
|
||||
this.RoleName = "administrator";
|
||||
} else {
|
||||
this.RoleName = "user";
|
||||
}
|
||||
this.Checked = false;
|
||||
}
|
14
app/models/volume.js
Normal file
14
app/models/volume.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
function VolumeViewModel(data) {
|
||||
this.Id = data.Id;
|
||||
this.Name = data.Name;
|
||||
this.Driver = data.Driver;
|
||||
this.Mountpoint = data.Mountpoint;
|
||||
if (data.Portainer) {
|
||||
this.Metadata = {};
|
||||
if (data.Portainer.ResourceControl) {
|
||||
this.Metadata.ResourceControl = {
|
||||
OwnerId: data.Portainer.ResourceControl.OwnerId
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue