volumes: add mount UI

This commit is contained in:
Girish Ramakrishnan
2021-05-12 21:40:30 -07:00
parent c56c43c464
commit fd3fb23955
3 changed files with 88 additions and 3 deletions

View File

@@ -2665,10 +2665,12 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.addVolume = function (name, hostPath, callback) {
Client.prototype.addVolume = function (name, hostPath, mountType, mountOptions, callback) {
var data = {
name: name,
hostPath: hostPath
hostPath: hostPath,
mountType: mountType,
mountOptions: mountOptions
};
var that = this;
@@ -2676,6 +2678,17 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
if (error) return callback(error);
if (status !== 201) return callback(new ClientError(status, data));
callback(null, data.id);
});
};
Client.prototype.mountVolume = function (volumeId, data, callback) {
var that = this;
post('/api/v1/volumes/' + volumeId + '/mount_config', data, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 201) return callback(new ClientError(status, data));
callback();
});
};