diff --git a/api/cmd/portainer/main.go b/api/cmd/portainer/main.go
index 260270a72..588301c3a 100644
--- a/api/cmd/portainer/main.go
+++ b/api/cmd/portainer/main.go
@@ -398,7 +398,6 @@ func createTLSSecuredEndpoint(flags *portainer.CLIFlags, dataStore dataservices.
TLSConfig: tlsConfiguration,
UserAccessPolicies: portainer.UserAccessPolicies{},
TeamAccessPolicies: portainer.TeamAccessPolicies{},
- Extensions: []portainer.EndpointExtension{},
TagIDs: []portainer.TagID{},
Status: portainer.EndpointStatusUp,
Snapshots: []portainer.DockerSnapshot{},
@@ -460,7 +459,6 @@ func createUnsecuredEndpoint(endpointURL string, dataStore dataservices.DataStor
TLSConfig: portainer.TLSConfiguration{},
UserAccessPolicies: portainer.UserAccessPolicies{},
TeamAccessPolicies: portainer.TeamAccessPolicies{},
- Extensions: []portainer.EndpointExtension{},
TagIDs: []portainer.TagID{},
Status: portainer.EndpointStatusUp,
Snapshots: []portainer.DockerSnapshot{},
diff --git a/api/datastore/datastore_test.go b/api/datastore/datastore_test.go
index df8579ddf..3a504965c 100644
--- a/api/datastore/datastore_test.go
+++ b/api/datastore/datastore_test.go
@@ -96,7 +96,6 @@ func newEndpoint(endpointType portainer.EndpointType, id portainer.EndpointID, n
},
UserAccessPolicies: portainer.UserAccessPolicies{},
TeamAccessPolicies: portainer.TeamAccessPolicies{},
- Extensions: []portainer.EndpointExtension{},
TagIDs: []portainer.TagID{},
Status: portainer.EndpointStatusUp,
Snapshots: []portainer.DockerSnapshot{},
diff --git a/api/http/handler/endpointproxy/handler.go b/api/http/handler/endpointproxy/handler.go
index ecc5c073c..f9015a06a 100644
--- a/api/http/handler/endpointproxy/handler.go
+++ b/api/http/handler/endpointproxy/handler.go
@@ -34,7 +34,5 @@ func NewHandler(bouncer *security.RequestBouncer) *Handler {
bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.proxyRequestsToDockerAPI)))
h.PathPrefix("/{id}/agent/kubernetes").Handler(
bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.proxyRequestsToKubernetesAPI)))
- h.PathPrefix("/{id}/storidge").Handler(
- bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.proxyRequestsToStoridgeAPI)))
return h
}
diff --git a/api/http/handler/endpointproxy/proxy_storidge.go b/api/http/handler/endpointproxy/proxy_storidge.go
deleted file mode 100644
index 38bddfb4d..000000000
--- a/api/http/handler/endpointproxy/proxy_storidge.go
+++ /dev/null
@@ -1,59 +0,0 @@
-package endpointproxy
-
-// TODO: legacy extension management
-
-import (
- "errors"
- "strconv"
-
- httperror "github.com/portainer/libhttp/error"
- "github.com/portainer/libhttp/request"
- portainer "github.com/portainer/portainer/api"
-
- "net/http"
-)
-
-func (handler *Handler) proxyRequestsToStoridgeAPI(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
- endpointID, err := request.RetrieveNumericRouteVariableValue(r, "id")
- if err != nil {
- return &httperror.HandlerError{http.StatusBadRequest, "Invalid environment identifier route variable", err}
- }
-
- endpoint, err := handler.DataStore.Endpoint().Endpoint(portainer.EndpointID(endpointID))
- if handler.DataStore.IsErrObjectNotFound(err) {
- return &httperror.HandlerError{http.StatusNotFound, "Unable to find an environment with the specified identifier inside the database", err}
- } else if err != nil {
- return &httperror.HandlerError{http.StatusInternalServerError, "Unable to find an environment with the specified identifier inside the database", err}
- }
-
- err = handler.requestBouncer.AuthorizedEndpointOperation(r, endpoint)
- if err != nil {
- return &httperror.HandlerError{http.StatusForbidden, "Permission denied to access environment", err}
- }
-
- var storidgeExtension *portainer.EndpointExtension
- for _, extension := range endpoint.Extensions {
- if extension.Type == portainer.StoridgeEndpointExtension {
- storidgeExtension = &extension
- }
- }
-
- if storidgeExtension == nil {
- return &httperror.HandlerError{http.StatusServiceUnavailable, "Storidge extension not supported on this environment", errors.New("This extension is not supported")}
- }
-
- proxyExtensionKey := strconv.Itoa(endpointID) + "_" + strconv.Itoa(int(portainer.StoridgeEndpointExtension)) + "_" + storidgeExtension.URL
-
- var proxy http.Handler
- proxy = handler.ProxyManager.GetLegacyExtensionProxy(proxyExtensionKey)
- if proxy == nil {
- proxy, err = handler.ProxyManager.CreateLegacyExtensionProxy(proxyExtensionKey, storidgeExtension.URL)
- if err != nil {
- return &httperror.HandlerError{http.StatusInternalServerError, "Unable to create extension proxy", err}
- }
- }
-
- id := strconv.Itoa(endpointID)
- http.StripPrefix("/"+id+"/storidge", proxy).ServeHTTP(w, r)
- return nil
-}
diff --git a/api/http/handler/endpoints/endpoint_create.go b/api/http/handler/endpoints/endpoint_create.go
index b06887c6e..c80369489 100644
--- a/api/http/handler/endpoints/endpoint_create.go
+++ b/api/http/handler/endpoints/endpoint_create.go
@@ -284,7 +284,6 @@ func (handler *Handler) createAzureEndpoint(payload *endpointCreatePayload) (*po
PublicURL: payload.PublicURL,
UserAccessPolicies: portainer.UserAccessPolicies{},
TeamAccessPolicies: portainer.TeamAccessPolicies{},
- Extensions: []portainer.EndpointExtension{},
AzureCredentials: credentials,
TagIDs: payload.TagIDs,
Status: portainer.EndpointStatusUp,
@@ -330,7 +329,6 @@ func (handler *Handler) createEdgeAgentEndpoint(payload *endpointCreatePayload)
},
UserAccessPolicies: portainer.UserAccessPolicies{},
TeamAccessPolicies: portainer.TeamAccessPolicies{},
- Extensions: []portainer.EndpointExtension{},
TagIDs: payload.TagIDs,
Status: portainer.EndpointStatusUp,
Snapshots: []portainer.DockerSnapshot{},
@@ -385,7 +383,6 @@ func (handler *Handler) createUnsecuredEndpoint(payload *endpointCreatePayload)
},
UserAccessPolicies: portainer.UserAccessPolicies{},
TeamAccessPolicies: portainer.TeamAccessPolicies{},
- Extensions: []portainer.EndpointExtension{},
TagIDs: payload.TagIDs,
Status: portainer.EndpointStatusUp,
Snapshots: []portainer.DockerSnapshot{},
@@ -421,7 +418,6 @@ func (handler *Handler) createKubernetesEndpoint(payload *endpointCreatePayload)
},
UserAccessPolicies: portainer.UserAccessPolicies{},
TeamAccessPolicies: portainer.TeamAccessPolicies{},
- Extensions: []portainer.EndpointExtension{},
TagIDs: payload.TagIDs,
Status: portainer.EndpointStatusUp,
Snapshots: []portainer.DockerSnapshot{},
@@ -451,7 +447,6 @@ func (handler *Handler) createTLSSecuredEndpoint(payload *endpointCreatePayload,
},
UserAccessPolicies: portainer.UserAccessPolicies{},
TeamAccessPolicies: portainer.TeamAccessPolicies{},
- Extensions: []portainer.EndpointExtension{},
TagIDs: payload.TagIDs,
Status: portainer.EndpointStatusUp,
Snapshots: []portainer.DockerSnapshot{},
diff --git a/api/http/handler/endpoints/endpoint_extension_add.go b/api/http/handler/endpoints/endpoint_extension_add.go
deleted file mode 100644
index 361b9f4b7..000000000
--- a/api/http/handler/endpoints/endpoint_extension_add.go
+++ /dev/null
@@ -1,81 +0,0 @@
-package endpoints
-
-// TODO: legacy extension management
-
-import (
- "errors"
- "net/http"
-
- "github.com/asaskevich/govalidator"
- httperror "github.com/portainer/libhttp/error"
- "github.com/portainer/libhttp/request"
- "github.com/portainer/libhttp/response"
- portainer "github.com/portainer/portainer/api"
-)
-
-type endpointExtensionAddPayload struct {
- Type int
- URL string
-}
-
-func (payload *endpointExtensionAddPayload) Validate(r *http.Request) error {
- if payload.Type != 1 {
- return errors.New("Invalid type value. Value must be one of: 1 (Storidge)")
- }
- if payload.Type == 1 && govalidator.IsNull(payload.URL) {
- return errors.New("Invalid extension URL")
- }
- return nil
-}
-
-// @id endpointExtensionAdd
-// @tags endpoints
-// @deprecated
-// @param id path int true "Environment(Endpoint) identifier"
-// @success 204 "Success"
-// @router /endpoints/{id}/extensions [post]
-func (handler *Handler) endpointExtensionAdd(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
- endpointID, err := request.RetrieveNumericRouteVariableValue(r, "id")
- if err != nil {
- return &httperror.HandlerError{http.StatusBadRequest, "Invalid environment identifier route variable", err}
- }
-
- endpoint, err := handler.DataStore.Endpoint().Endpoint(portainer.EndpointID(endpointID))
- if handler.DataStore.IsErrObjectNotFound(err) {
- return &httperror.HandlerError{http.StatusNotFound, "Unable to find an environment with the specified identifier inside the database", err}
- } else if err != nil {
- return &httperror.HandlerError{http.StatusInternalServerError, "Unable to find an environment with the specified identifier inside the database", err}
- }
-
- var payload endpointExtensionAddPayload
- err = request.DecodeAndValidateJSONPayload(r, &payload)
- if err != nil {
- return &httperror.HandlerError{http.StatusBadRequest, "Invalid request payload", err}
- }
-
- extensionType := portainer.EndpointExtensionType(payload.Type)
-
- var extension *portainer.EndpointExtension
- for idx := range endpoint.Extensions {
- if endpoint.Extensions[idx].Type == extensionType {
- extension = &endpoint.Extensions[idx]
- }
- }
-
- if extension != nil {
- extension.URL = payload.URL
- } else {
- extension = &portainer.EndpointExtension{
- Type: extensionType,
- URL: payload.URL,
- }
- endpoint.Extensions = append(endpoint.Extensions, *extension)
- }
-
- err = handler.DataStore.Endpoint().UpdateEndpoint(endpoint.ID, endpoint)
- if err != nil {
- return &httperror.HandlerError{http.StatusInternalServerError, "Unable to persist environment changes inside the database", err}
- }
-
- return response.JSON(w, extension)
-}
diff --git a/api/http/handler/endpoints/endpoint_extension_remove.go b/api/http/handler/endpoints/endpoint_extension_remove.go
deleted file mode 100644
index f1133965a..000000000
--- a/api/http/handler/endpoints/endpoint_extension_remove.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package endpoints
-
-// TODO: legacy extension management
-
-import (
- "net/http"
-
- httperror "github.com/portainer/libhttp/error"
- "github.com/portainer/libhttp/request"
- "github.com/portainer/libhttp/response"
- portainer "github.com/portainer/portainer/api"
-)
-
-// @id endpointExtensionRemove
-// @tags endpoints
-// @deprecated
-// @param id path int true "Environment(Endpoint) identifier"
-// @param extensionType path string true "Extension Type"
-// @success 204 "Success"
-// @router /endpoints/{id}/extensions/{extensionType} [delete]
-func (handler *Handler) endpointExtensionRemove(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
- endpointID, err := request.RetrieveNumericRouteVariableValue(r, "id")
- if err != nil {
- return &httperror.HandlerError{http.StatusBadRequest, "Invalid environment identifier route variable", err}
- }
-
- endpoint, err := handler.DataStore.Endpoint().Endpoint(portainer.EndpointID(endpointID))
- if handler.DataStore.IsErrObjectNotFound(err) {
- return &httperror.HandlerError{http.StatusNotFound, "Unable to find an environment with the specified identifier inside the database", err}
- } else if err != nil {
- return &httperror.HandlerError{http.StatusInternalServerError, "Unable to find an environment with the specified identifier inside the database", err}
- }
-
- extensionType, err := request.RetrieveNumericRouteVariableValue(r, "extensionType")
- if err != nil {
- return &httperror.HandlerError{http.StatusBadRequest, "Invalid extension type route variable", err}
- }
-
- for idx, ext := range endpoint.Extensions {
- if ext.Type == portainer.EndpointExtensionType(extensionType) {
- endpoint.Extensions = append(endpoint.Extensions[:idx], endpoint.Extensions[idx+1:]...)
- }
- }
-
- err = handler.DataStore.Endpoint().UpdateEndpoint(endpoint.ID, endpoint)
- if err != nil {
- return &httperror.HandlerError{http.StatusInternalServerError, "Unable to persist environment changes inside the database", err}
- }
-
- return response.Empty(w)
-}
diff --git a/api/http/handler/endpoints/handler.go b/api/http/handler/endpoints/handler.go
index 8cf689a3f..2963933dc 100644
--- a/api/http/handler/endpoints/handler.go
+++ b/api/http/handler/endpoints/handler.go
@@ -62,10 +62,6 @@ func NewHandler(bouncer *security.RequestBouncer) *Handler {
bouncer.AdminAccess(httperror.LoggerHandler(h.endpointDelete))).Methods(http.MethodDelete)
h.Handle("/endpoints/{id}/dockerhub/{registryId}",
bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.endpointDockerhubStatus))).Methods(http.MethodGet)
- h.Handle("/endpoints/{id}/extensions",
- bouncer.RestrictedAccess(httperror.LoggerHandler(h.endpointExtensionAdd))).Methods(http.MethodPost)
- h.Handle("/endpoints/{id}/extensions/{extensionType}",
- bouncer.RestrictedAccess(httperror.LoggerHandler(h.endpointExtensionRemove))).Methods(http.MethodDelete)
h.Handle("/endpoints/{id}/snapshot",
bouncer.AdminAccess(httperror.LoggerHandler(h.endpointSnapshot))).Methods(http.MethodPost)
h.Handle("/endpoints/{id}/status",
diff --git a/api/http/handler/handler.go b/api/http/handler/handler.go
index d84c6cc83..76b0e0793 100644
--- a/api/http/handler/handler.go
+++ b/api/http/handler/handler.go
@@ -190,8 +190,6 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
http.StripPrefix("/api/endpoints", h.EndpointProxyHandler).ServeHTTP(w, r)
case strings.Contains(r.URL.Path, "/kubernetes/"):
http.StripPrefix("/api/endpoints", h.EndpointProxyHandler).ServeHTTP(w, r)
- case strings.Contains(r.URL.Path, "/storidge/"):
- http.StripPrefix("/api/endpoints", h.EndpointProxyHandler).ServeHTTP(w, r)
case strings.Contains(r.URL.Path, "/azure/"):
http.StripPrefix("/api/endpoints", h.EndpointProxyHandler).ServeHTTP(w, r)
case strings.Contains(r.URL.Path, "/agent/"):
diff --git a/api/http/proxy/factory/factory.go b/api/http/proxy/factory/factory.go
index 4310c5d51..4be80d51e 100644
--- a/api/http/proxy/factory/factory.go
+++ b/api/http/proxy/factory/factory.go
@@ -2,8 +2,6 @@ package factory
import (
"net/http"
- "net/http/httputil"
- "net/url"
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/dataservices"
@@ -40,18 +38,6 @@ func NewProxyFactory(dataStore dataservices.DataStore, signatureService portaine
}
}
-// NewLegacyExtensionProxy returns a new HTTP proxy to a legacy extension server (Storidge)
-func (factory *ProxyFactory) NewLegacyExtensionProxy(extensionAPIURL string) (http.Handler, error) {
- extensionURL, err := url.Parse(extensionAPIURL)
- if err != nil {
- return nil, err
- }
-
- extensionURL.Scheme = "http"
- proxy := httputil.NewSingleHostReverseProxy(extensionURL)
- return proxy, nil
-}
-
// NewEndpointProxy returns a new reverse proxy (filesystem based or HTTP) to an environment(endpoint) API server
func (factory *ProxyFactory) NewEndpointProxy(endpoint *portainer.Endpoint) (http.Handler, error) {
switch endpoint.Type {
diff --git a/api/http/proxy/manager.go b/api/http/proxy/manager.go
index e2e9dd3ef..953493be9 100644
--- a/api/http/proxy/manager.go
+++ b/api/http/proxy/manager.go
@@ -15,25 +15,21 @@ import (
"github.com/portainer/portainer/api/http/proxy/factory"
)
-// TODO: contain code related to legacy extension management
-
type (
- // Manager represents a service used to manage proxies to environments(endpoints) and extensions.
+ // Manager represents a service used to manage proxies to environments (endpoints).
Manager struct {
- proxyFactory *factory.ProxyFactory
- endpointProxies cmap.ConcurrentMap
- legacyExtensionProxies cmap.ConcurrentMap
- k8sClientFactory *cli.ClientFactory
+ proxyFactory *factory.ProxyFactory
+ endpointProxies cmap.ConcurrentMap
+ k8sClientFactory *cli.ClientFactory
}
)
// NewManager initializes a new proxy Service
func NewManager(dataStore dataservices.DataStore, signatureService portainer.DigitalSignatureService, tunnelService portainer.ReverseTunnelService, clientFactory *docker.ClientFactory, kubernetesClientFactory *cli.ClientFactory, kubernetesTokenCacheManager *kubernetes.TokenCacheManager) *Manager {
return &Manager{
- endpointProxies: cmap.New(),
- legacyExtensionProxies: cmap.New(),
- k8sClientFactory: kubernetesClientFactory,
- proxyFactory: factory.NewProxyFactory(dataStore, signatureService, tunnelService, clientFactory, kubernetesClientFactory, kubernetesTokenCacheManager),
+ endpointProxies: cmap.New(),
+ k8sClientFactory: kubernetesClientFactory,
+ proxyFactory: factory.NewProxyFactory(dataStore, signatureService, tunnelService, clientFactory, kubernetesClientFactory, kubernetesTokenCacheManager),
}
}
@@ -73,26 +69,6 @@ func (manager *Manager) DeleteEndpointProxy(endpointID portainer.EndpointID) {
manager.k8sClientFactory.RemoveKubeClient(endpointID)
}
-// CreateLegacyExtensionProxy creates a new HTTP reverse proxy for a legacy extension and adds it to the registered proxies
-func (manager *Manager) CreateLegacyExtensionProxy(key, extensionAPIURL string) (http.Handler, error) {
- proxy, err := manager.proxyFactory.NewLegacyExtensionProxy(extensionAPIURL)
- if err != nil {
- return nil, err
- }
-
- manager.legacyExtensionProxies.Set(key, proxy)
- return proxy, nil
-}
-
-// GetLegacyExtensionProxy returns a legacy extension proxy associated to a key
-func (manager *Manager) GetLegacyExtensionProxy(key string) http.Handler {
- proxy, ok := manager.legacyExtensionProxies.Get(key)
- if !ok {
- return nil
- }
- return proxy.(http.Handler)
-}
-
// CreateGitlabProxy creates a new HTTP reverse proxy that can be used to send requests to the Gitlab API
func (manager *Manager) CreateGitlabProxy(url string) (http.Handler, error) {
return manager.proxyFactory.NewGitlabProxy(url)
diff --git a/api/internal/authorization/authorizations.go b/api/internal/authorization/authorizations.go
index df3185b73..816cf7912 100644
--- a/api/internal/authorization/authorizations.go
+++ b/api/internal/authorization/authorizations.go
@@ -153,7 +153,6 @@ func DefaultEndpointAuthorizationsForEndpointAdministratorRole() portainer.Autho
portainer.OperationPortainerWebhookList: true,
portainer.OperationPortainerWebhookCreate: true,
portainer.OperationPortainerWebhookDelete: true,
- portainer.OperationIntegrationStoridgeAdmin: true,
portainer.EndpointResourcesAccess: true,
}
}
@@ -412,21 +411,19 @@ func DefaultEndpointAuthorizationsForReadOnlyUserRole(volumeBrowsingAuthorizatio
// DefaultPortainerAuthorizations returns the default Portainer authorizations used by non-admin users.
func DefaultPortainerAuthorizations() portainer.Authorizations {
return map[portainer.Authorization]bool{
- portainer.OperationPortainerDockerHubInspect: true,
- portainer.OperationPortainerEndpointGroupList: true,
- portainer.OperationPortainerEndpointList: true,
- portainer.OperationPortainerEndpointInspect: true,
- portainer.OperationPortainerEndpointExtensionAdd: true,
- portainer.OperationPortainerEndpointExtensionRemove: true,
- portainer.OperationPortainerMOTD: true,
- portainer.OperationPortainerRegistryList: true,
- portainer.OperationPortainerRegistryInspect: true,
- portainer.OperationPortainerTeamList: true,
- portainer.OperationPortainerTemplateList: true,
- portainer.OperationPortainerTemplateInspect: true,
- portainer.OperationPortainerUserList: true,
- portainer.OperationPortainerUserInspect: true,
- portainer.OperationPortainerUserMemberships: true,
+ portainer.OperationPortainerDockerHubInspect: true,
+ portainer.OperationPortainerEndpointGroupList: true,
+ portainer.OperationPortainerEndpointList: true,
+ portainer.OperationPortainerEndpointInspect: true,
+ portainer.OperationPortainerMOTD: true,
+ portainer.OperationPortainerRegistryList: true,
+ portainer.OperationPortainerRegistryInspect: true,
+ portainer.OperationPortainerTeamList: true,
+ portainer.OperationPortainerTemplateList: true,
+ portainer.OperationPortainerTemplateInspect: true,
+ portainer.OperationPortainerUserList: true,
+ portainer.OperationPortainerUserInspect: true,
+ portainer.OperationPortainerUserMemberships: true,
}
}
diff --git a/api/portainer.go b/api/portainer.go
index 57d2b2812..d0fb5b74d 100644
--- a/api/portainer.go
+++ b/api/portainer.go
@@ -296,10 +296,9 @@ type (
// Environment(Endpoint) group identifier
GroupID EndpointGroupID `json:"GroupId" example:"1"`
// URL or IP address where exposed containers will be reachable
- PublicURL string `json:"PublicURL" example:"docker.mydomain.tld:2375"`
- TLSConfig TLSConfiguration `json:"TLSConfig"`
- Extensions []EndpointExtension `json:"Extensions" example:""`
- AzureCredentials AzureCredentials `json:"AzureCredentials,omitempty" example:""`
+ PublicURL string `json:"PublicURL" example:"docker.mydomain.tld:2375"`
+ TLSConfig TLSConfiguration `json:"TLSConfig"`
+ AzureCredentials AzureCredentials `json:"AzureCredentials,omitempty" example:""`
// List of tag identifiers to which this environment(endpoint) is associated
TagIDs []TagID `json:"TagIds"`
// The status of the environment(endpoint) (1 - up, 2 - down)
@@ -349,17 +348,6 @@ type (
// EndpointAuthorizations represents the authorizations associated to a set of environments(endpoints)
EndpointAuthorizations map[EndpointID]Authorizations
- // EndpointExtension represents a deprecated form of Portainer extension
- // TODO: legacy extension management
- EndpointExtension struct {
- Type EndpointExtensionType `json:"Type"`
- URL string `json:"URL"`
- }
-
- // EndpointExtensionType represents the type of an environment(endpoint) extension. Only
- // one extension of each type can be associated to an environment(endpoint)
- EndpointExtensionType int
-
// EndpointGroup represents a group of environments(endpoints)
EndpointGroup struct {
// Environment(Endpoint) group Identifier
@@ -1450,12 +1438,6 @@ const (
StatusAcknowledged
)
-const (
- _ EndpointExtensionType = iota
- // StoridgeEndpointExtension represents the Storidge extension
- StoridgeEndpointExtension
-)
-
const (
_ EndpointStatus = iota
// EndpointStatusUp is used to represent an available environment(endpoint)
@@ -1730,101 +1712,102 @@ const (
OperationDockerAgentBrowsePut Authorization = "DockerAgentBrowsePut"
OperationDockerAgentBrowseRename Authorization = "DockerAgentBrowseRename"
- OperationPortainerDockerHubInspect Authorization = "PortainerDockerHubInspect"
- OperationPortainerDockerHubUpdate Authorization = "PortainerDockerHubUpdate"
- OperationPortainerEndpointGroupCreate Authorization = "PortainerEndpointGroupCreate"
- OperationPortainerEndpointGroupList Authorization = "PortainerEndpointGroupList"
- OperationPortainerEndpointGroupDelete Authorization = "PortainerEndpointGroupDelete"
- OperationPortainerEndpointGroupInspect Authorization = "PortainerEndpointGroupInspect"
- OperationPortainerEndpointGroupUpdate Authorization = "PortainerEndpointGroupEdit"
- OperationPortainerEndpointGroupAccess Authorization = "PortainerEndpointGroupAccess "
- OperationPortainerEndpointList Authorization = "PortainerEndpointList"
- OperationPortainerEndpointInspect Authorization = "PortainerEndpointInspect"
- OperationPortainerEndpointCreate Authorization = "PortainerEndpointCreate"
- OperationPortainerEndpointExtensionAdd Authorization = "PortainerEndpointExtensionAdd"
- OperationPortainerEndpointJob Authorization = "PortainerEndpointJob"
- OperationPortainerEndpointSnapshots Authorization = "PortainerEndpointSnapshots"
- OperationPortainerEndpointSnapshot Authorization = "PortainerEndpointSnapshot"
- OperationPortainerEndpointUpdate Authorization = "PortainerEndpointUpdate"
- OperationPortainerEndpointUpdateAccess Authorization = "PortainerEndpointUpdateAccess"
- OperationPortainerEndpointDelete Authorization = "PortainerEndpointDelete"
- OperationPortainerEndpointExtensionRemove Authorization = "PortainerEndpointExtensionRemove"
- OperationPortainerExtensionList Authorization = "PortainerExtensionList"
- OperationPortainerExtensionInspect Authorization = "PortainerExtensionInspect"
- OperationPortainerExtensionCreate Authorization = "PortainerExtensionCreate"
- OperationPortainerExtensionUpdate Authorization = "PortainerExtensionUpdate"
- OperationPortainerExtensionDelete Authorization = "PortainerExtensionDelete"
- OperationPortainerMOTD Authorization = "PortainerMOTD"
- OperationPortainerRegistryList Authorization = "PortainerRegistryList"
- OperationPortainerRegistryInspect Authorization = "PortainerRegistryInspect"
- OperationPortainerRegistryCreate Authorization = "PortainerRegistryCreate"
- OperationPortainerRegistryConfigure Authorization = "PortainerRegistryConfigure"
- OperationPortainerRegistryUpdate Authorization = "PortainerRegistryUpdate"
- OperationPortainerRegistryUpdateAccess Authorization = "PortainerRegistryUpdateAccess"
- OperationPortainerRegistryDelete Authorization = "PortainerRegistryDelete"
- OperationPortainerResourceControlCreate Authorization = "PortainerResourceControlCreate"
- OperationPortainerResourceControlUpdate Authorization = "PortainerResourceControlUpdate"
- OperationPortainerResourceControlDelete Authorization = "PortainerResourceControlDelete"
- OperationPortainerRoleList Authorization = "PortainerRoleList"
- OperationPortainerRoleInspect Authorization = "PortainerRoleInspect"
- OperationPortainerRoleCreate Authorization = "PortainerRoleCreate"
- OperationPortainerRoleUpdate Authorization = "PortainerRoleUpdate"
- OperationPortainerRoleDelete Authorization = "PortainerRoleDelete"
- OperationPortainerScheduleList Authorization = "PortainerScheduleList"
- OperationPortainerScheduleInspect Authorization = "PortainerScheduleInspect"
- OperationPortainerScheduleFile Authorization = "PortainerScheduleFile"
- OperationPortainerScheduleTasks Authorization = "PortainerScheduleTasks"
- OperationPortainerScheduleCreate Authorization = "PortainerScheduleCreate"
- OperationPortainerScheduleUpdate Authorization = "PortainerScheduleUpdate"
- OperationPortainerScheduleDelete Authorization = "PortainerScheduleDelete"
- OperationPortainerSettingsInspect Authorization = "PortainerSettingsInspect"
- OperationPortainerSettingsUpdate Authorization = "PortainerSettingsUpdate"
- OperationPortainerSettingsLDAPCheck Authorization = "PortainerSettingsLDAPCheck"
- OperationPortainerStackList Authorization = "PortainerStackList"
- OperationPortainerStackInspect Authorization = "PortainerStackInspect"
- OperationPortainerStackFile Authorization = "PortainerStackFile"
- OperationPortainerStackCreate Authorization = "PortainerStackCreate"
- OperationPortainerStackMigrate Authorization = "PortainerStackMigrate"
- OperationPortainerStackUpdate Authorization = "PortainerStackUpdate"
- OperationPortainerStackDelete Authorization = "PortainerStackDelete"
- OperationPortainerTagList Authorization = "PortainerTagList"
- OperationPortainerTagCreate Authorization = "PortainerTagCreate"
- OperationPortainerTagDelete Authorization = "PortainerTagDelete"
- OperationPortainerTeamMembershipList Authorization = "PortainerTeamMembershipList"
- OperationPortainerTeamMembershipCreate Authorization = "PortainerTeamMembershipCreate"
- OperationPortainerTeamMembershipUpdate Authorization = "PortainerTeamMembershipUpdate"
- OperationPortainerTeamMembershipDelete Authorization = "PortainerTeamMembershipDelete"
- OperationPortainerTeamList Authorization = "PortainerTeamList"
- OperationPortainerTeamInspect Authorization = "PortainerTeamInspect"
- OperationPortainerTeamMemberships Authorization = "PortainerTeamMemberships"
- OperationPortainerTeamCreate Authorization = "PortainerTeamCreate"
- OperationPortainerTeamUpdate Authorization = "PortainerTeamUpdate"
- OperationPortainerTeamDelete Authorization = "PortainerTeamDelete"
- OperationPortainerTemplateList Authorization = "PortainerTemplateList"
- OperationPortainerTemplateInspect Authorization = "PortainerTemplateInspect"
- OperationPortainerTemplateCreate Authorization = "PortainerTemplateCreate"
- OperationPortainerTemplateUpdate Authorization = "PortainerTemplateUpdate"
- OperationPortainerTemplateDelete Authorization = "PortainerTemplateDelete"
- OperationPortainerUploadTLS Authorization = "PortainerUploadTLS"
- OperationPortainerUserList Authorization = "PortainerUserList"
- OperationPortainerUserInspect Authorization = "PortainerUserInspect"
- OperationPortainerUserMemberships Authorization = "PortainerUserMemberships"
- OperationPortainerUserCreate Authorization = "PortainerUserCreate"
- OperationPortainerUserUpdate Authorization = "PortainerUserUpdate"
- OperationPortainerUserUpdatePassword Authorization = "PortainerUserUpdatePassword"
- OperationPortainerUserDelete Authorization = "PortainerUserDelete"
- OperationPortainerWebsocketExec Authorization = "PortainerWebsocketExec"
- OperationPortainerWebhookList Authorization = "PortainerWebhookList"
- OperationPortainerWebhookCreate Authorization = "PortainerWebhookCreate"
- OperationPortainerWebhookDelete Authorization = "PortainerWebhookDelete"
-
- OperationIntegrationStoridgeAdmin Authorization = "IntegrationStoridgeAdmin"
+ OperationPortainerDockerHubInspect Authorization = "PortainerDockerHubInspect"
+ OperationPortainerDockerHubUpdate Authorization = "PortainerDockerHubUpdate"
+ OperationPortainerEndpointGroupCreate Authorization = "PortainerEndpointGroupCreate"
+ OperationPortainerEndpointGroupList Authorization = "PortainerEndpointGroupList"
+ OperationPortainerEndpointGroupDelete Authorization = "PortainerEndpointGroupDelete"
+ OperationPortainerEndpointGroupInspect Authorization = "PortainerEndpointGroupInspect"
+ OperationPortainerEndpointGroupUpdate Authorization = "PortainerEndpointGroupEdit"
+ OperationPortainerEndpointGroupAccess Authorization = "PortainerEndpointGroupAccess "
+ OperationPortainerEndpointList Authorization = "PortainerEndpointList"
+ OperationPortainerEndpointInspect Authorization = "PortainerEndpointInspect"
+ OperationPortainerEndpointCreate Authorization = "PortainerEndpointCreate"
+ OperationPortainerEndpointJob Authorization = "PortainerEndpointJob"
+ OperationPortainerEndpointSnapshots Authorization = "PortainerEndpointSnapshots"
+ OperationPortainerEndpointSnapshot Authorization = "PortainerEndpointSnapshot"
+ OperationPortainerEndpointUpdate Authorization = "PortainerEndpointUpdate"
+ OperationPortainerEndpointUpdateAccess Authorization = "PortainerEndpointUpdateAccess"
+ OperationPortainerEndpointDelete Authorization = "PortainerEndpointDelete"
+ OperationPortainerExtensionList Authorization = "PortainerExtensionList"
+ OperationPortainerExtensionInspect Authorization = "PortainerExtensionInspect"
+ OperationPortainerExtensionCreate Authorization = "PortainerExtensionCreate"
+ OperationPortainerExtensionUpdate Authorization = "PortainerExtensionUpdate"
+ OperationPortainerExtensionDelete Authorization = "PortainerExtensionDelete"
+ OperationPortainerMOTD Authorization = "PortainerMOTD"
+ OperationPortainerRegistryList Authorization = "PortainerRegistryList"
+ OperationPortainerRegistryInspect Authorization = "PortainerRegistryInspect"
+ OperationPortainerRegistryCreate Authorization = "PortainerRegistryCreate"
+ OperationPortainerRegistryConfigure Authorization = "PortainerRegistryConfigure"
+ OperationPortainerRegistryUpdate Authorization = "PortainerRegistryUpdate"
+ OperationPortainerRegistryUpdateAccess Authorization = "PortainerRegistryUpdateAccess"
+ OperationPortainerRegistryDelete Authorization = "PortainerRegistryDelete"
+ OperationPortainerResourceControlCreate Authorization = "PortainerResourceControlCreate"
+ OperationPortainerResourceControlUpdate Authorization = "PortainerResourceControlUpdate"
+ OperationPortainerResourceControlDelete Authorization = "PortainerResourceControlDelete"
+ OperationPortainerRoleList Authorization = "PortainerRoleList"
+ OperationPortainerRoleInspect Authorization = "PortainerRoleInspect"
+ OperationPortainerRoleCreate Authorization = "PortainerRoleCreate"
+ OperationPortainerRoleUpdate Authorization = "PortainerRoleUpdate"
+ OperationPortainerRoleDelete Authorization = "PortainerRoleDelete"
+ OperationPortainerScheduleList Authorization = "PortainerScheduleList"
+ OperationPortainerScheduleInspect Authorization = "PortainerScheduleInspect"
+ OperationPortainerScheduleFile Authorization = "PortainerScheduleFile"
+ OperationPortainerScheduleTasks Authorization = "PortainerScheduleTasks"
+ OperationPortainerScheduleCreate Authorization = "PortainerScheduleCreate"
+ OperationPortainerScheduleUpdate Authorization = "PortainerScheduleUpdate"
+ OperationPortainerScheduleDelete Authorization = "PortainerScheduleDelete"
+ OperationPortainerSettingsInspect Authorization = "PortainerSettingsInspect"
+ OperationPortainerSettingsUpdate Authorization = "PortainerSettingsUpdate"
+ OperationPortainerSettingsLDAPCheck Authorization = "PortainerSettingsLDAPCheck"
+ OperationPortainerStackList Authorization = "PortainerStackList"
+ OperationPortainerStackInspect Authorization = "PortainerStackInspect"
+ OperationPortainerStackFile Authorization = "PortainerStackFile"
+ OperationPortainerStackCreate Authorization = "PortainerStackCreate"
+ OperationPortainerStackMigrate Authorization = "PortainerStackMigrate"
+ OperationPortainerStackUpdate Authorization = "PortainerStackUpdate"
+ OperationPortainerStackDelete Authorization = "PortainerStackDelete"
+ OperationPortainerTagList Authorization = "PortainerTagList"
+ OperationPortainerTagCreate Authorization = "PortainerTagCreate"
+ OperationPortainerTagDelete Authorization = "PortainerTagDelete"
+ OperationPortainerTeamMembershipList Authorization = "PortainerTeamMembershipList"
+ OperationPortainerTeamMembershipCreate Authorization = "PortainerTeamMembershipCreate"
+ OperationPortainerTeamMembershipUpdate Authorization = "PortainerTeamMembershipUpdate"
+ OperationPortainerTeamMembershipDelete Authorization = "PortainerTeamMembershipDelete"
+ OperationPortainerTeamList Authorization = "PortainerTeamList"
+ OperationPortainerTeamInspect Authorization = "PortainerTeamInspect"
+ OperationPortainerTeamMemberships Authorization = "PortainerTeamMemberships"
+ OperationPortainerTeamCreate Authorization = "PortainerTeamCreate"
+ OperationPortainerTeamUpdate Authorization = "PortainerTeamUpdate"
+ OperationPortainerTeamDelete Authorization = "PortainerTeamDelete"
+ OperationPortainerTemplateList Authorization = "PortainerTemplateList"
+ OperationPortainerTemplateInspect Authorization = "PortainerTemplateInspect"
+ OperationPortainerTemplateCreate Authorization = "PortainerTemplateCreate"
+ OperationPortainerTemplateUpdate Authorization = "PortainerTemplateUpdate"
+ OperationPortainerTemplateDelete Authorization = "PortainerTemplateDelete"
+ OperationPortainerUploadTLS Authorization = "PortainerUploadTLS"
+ OperationPortainerUserList Authorization = "PortainerUserList"
+ OperationPortainerUserInspect Authorization = "PortainerUserInspect"
+ OperationPortainerUserMemberships Authorization = "PortainerUserMemberships"
+ OperationPortainerUserCreate Authorization = "PortainerUserCreate"
+ OperationPortainerUserUpdate Authorization = "PortainerUserUpdate"
+ OperationPortainerUserUpdatePassword Authorization = "PortainerUserUpdatePassword"
+ OperationPortainerUserDelete Authorization = "PortainerUserDelete"
+ OperationPortainerWebsocketExec Authorization = "PortainerWebsocketExec"
+ OperationPortainerWebhookList Authorization = "PortainerWebhookList"
+ OperationPortainerWebhookCreate Authorization = "PortainerWebhookCreate"
+ OperationPortainerWebhookDelete Authorization = "PortainerWebhookDelete"
OperationDockerUndefined Authorization = "DockerUndefined"
OperationDockerAgentUndefined Authorization = "DockerAgentUndefined"
OperationPortainerUndefined Authorization = "PortainerUndefined"
EndpointResourcesAccess Authorization = "EndpointResourcesAccess"
+
+ // Deprecated operations
+ OperationPortainerEndpointExtensionAdd Authorization = "PortainerEndpointExtensionAdd"
+ OperationPortainerEndpointExtensionRemove Authorization = "PortainerEndpointExtensionRemove"
+ OperationIntegrationStoridgeAdmin Authorization = "IntegrationStoridgeAdmin"
)
const (
diff --git a/api/swagger.yaml b/api/swagger.yaml
index ae48df4ef..6ea6d03a2 100644
--- a/api/swagger.yaml
+++ b/api/swagger.yaml
@@ -849,10 +849,6 @@ definitions:
EdgeKey:
description: The key which is used to map the agent to Portainer
type: string
- Extensions:
- items:
- $ref: '#/definitions/portainer.EndpointExtension'
- type: array
GroupId:
description: Endpoint group identifier
example: 1
@@ -926,13 +922,6 @@ definitions:
additionalProperties:
$ref: '#/definitions/portainer.Authorizations'
type: object
- portainer.EndpointExtension:
- properties:
- Type:
- type: integer
- URL:
- type: string
- type: object
portainer.EndpointGroup:
properties:
AuthorizedTeams:
diff --git a/app/azure/_module.js b/app/azure/_module.js
index fc34bfd20..57068d13c 100644
--- a/app/azure/_module.js
+++ b/app/azure/_module.js
@@ -22,7 +22,7 @@ angular.module('portainer.azure', ['portainer.app', containerInstancesModule]).c
EndpointProvider.setEndpointID(endpoint.Id);
EndpointProvider.setEndpointPublicURL(endpoint.PublicURL);
EndpointProvider.setOfflineModeFromStatus(endpoint.Status);
- await StateManager.updateEndpointState(endpoint, []);
+ await StateManager.updateEndpointState(endpoint);
} catch (e) {
Notifications.error('Failed loading environment', e);
$state.go('portainer.home', {}, { reload: true });
diff --git a/app/docker/__module.js b/app/docker/__module.js
index 828862870..771806f8e 100644
--- a/app/docker/__module.js
+++ b/app/docker/__module.js
@@ -12,7 +12,7 @@ angular.module('portainer.docker', ['portainer.app', containersModule]).config([
parent: 'endpoint',
url: '/docker',
abstract: true,
- onEnter: /* @ngInject */ function onEnter(endpoint, $async, $state, EndpointService, EndpointProvider, LegacyExtensionManager, Notifications, StateManager, SystemService) {
+ onEnter: /* @ngInject */ function onEnter(endpoint, $async, $state, EndpointService, EndpointProvider, Notifications, StateManager, SystemService) {
return $async(async () => {
if (![1, 2, 4].includes(endpoint.Type)) {
$state.go('portainer.home');
@@ -39,8 +39,7 @@ angular.module('portainer.docker', ['portainer.app', containersModule]).config([
EndpointProvider.setEndpointPublicURL(endpoint.PublicURL);
EndpointProvider.setOfflineModeFromStatus(endpoint.Status);
- const extensions = await LegacyExtensionManager.initEndpointExtensions(endpoint);
- await StateManager.updateEndpointState(endpoint, extensions);
+ await StateManager.updateEndpointState(endpoint);
} catch (e) {
Notifications.error('Failed loading environment', e);
$state.go('portainer.home', {}, { reload: true });
diff --git a/app/docker/views/volumes/create/createVolumeController.js b/app/docker/views/volumes/create/createVolumeController.js
index 09ad36cd3..277261b8f 100644
--- a/app/docker/views/volumes/create/createVolumeController.js
+++ b/app/docker/views/volumes/create/createVolumeController.js
@@ -86,11 +86,6 @@ angular.module('portainer.docker').controller('CreateVolumeController', [
var name = $scope.formValues.Name;
var driver = $scope.formValues.Driver;
var driverOptions = $scope.formValues.DriverOptions;
- var storidgeProfile = $scope.formValues.StoridgeProfile;
-
- if (driver === 'cio:latest' && storidgeProfile) {
- driverOptions.push({ name: 'profile', value: storidgeProfile.Name });
- }
if ($scope.formValues.NFSData.useNFS) {
prepareNFSConfiguration(driverOptions);
diff --git a/app/docker/views/volumes/create/createvolume.html b/app/docker/views/volumes/create/createvolume.html
index 6310d977b..eb1cf3669 100644
--- a/app/docker/views/volumes/create/createvolume.html
+++ b/app/docker/views/volumes/create/createvolume.html
@@ -83,12 +83,6 @@
-
-
-
Deployment
diff --git a/app/docker/views/volumes/edit/volume.html b/app/docker/views/volumes/edit/volume.html
index 6141cc537..619e18222 100644
--- a/app/docker/views/volumes/edit/volume.html
+++ b/app/docker/views/volumes/edit/volume.html
@@ -51,32 +51,6 @@
-
-
-
-
-
-
diff --git a/app/docker/views/volumes/edit/volumeController.js b/app/docker/views/volumes/edit/volumeController.js
index e3cb8ce84..49d26374e 100644
--- a/app/docker/views/volumes/edit/volumeController.js
+++ b/app/docker/views/volumes/edit/volumeController.js
@@ -8,48 +8,7 @@ angular.module('portainer.docker').controller('VolumeController', [
'ContainerService',
'Notifications',
'HttpRequestHelper',
- 'StoridgeVolumeService',
- 'StoridgeSnapshotService',
- function ($scope, $state, $transition$, $q, ModalService, VolumeService, ContainerService, Notifications, HttpRequestHelper, StoridgeVolumeService, StoridgeSnapshotService) {
- $scope.storidgeSnapshots = [];
- $scope.storidgeVolume = {};
-
- $scope.removeSnapshot = function (selectedItems) {
- ModalService.confirm({
- title: 'Are you sure?',
- message: 'Do you want really want to remove this snapshot?',
- buttons: {
- confirm: {
- label: 'Remove',
- className: 'btn-danger',
- },
- },
- callback: function onConfirm(confirmed) {
- if (!confirmed) {
- return;
- }
- var actionCount = selectedItems.length;
- angular.forEach(selectedItems, function (item) {
- StoridgeSnapshotService.remove(item.Id)
- .then(function success() {
- Notifications.success('Snapshot successfully removed', item.Id);
- var index = $scope.storidgeSnapshots.indexOf(item);
- $scope.storidgeSnapshots.splice(index, 1);
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to remove snapshot');
- })
- .finally(function final() {
- --actionCount;
- if (actionCount === 0) {
- $state.reload();
- }
- });
- });
- },
- });
- };
-
+ function ($scope, $state, $transition$, $q, ModalService, VolumeService, ContainerService, Notifications, HttpRequestHelper) {
$scope.removeVolume = function removeVolume() {
ModalService.confirmDeletion('Do you want to remove this volume?', (confirmed) => {
if (confirmed) {
@@ -80,15 +39,7 @@ angular.module('portainer.docker').controller('VolumeController', [
$scope.volume = volume;
var containerFilter = { volume: [volume.Id] };
- $scope.isCioDriver = volume.Driver.includes('cio');
- if ($scope.isCioDriver) {
- return $q.all({
- containers: ContainerService.containers(1, containerFilter),
- storidgeVolume: StoridgeVolumeService.volume($transition$.params().id),
- });
- } else {
- return ContainerService.containers(1, containerFilter);
- }
+ return ContainerService.containers(1, containerFilter);
})
.then(function success(data) {
var dataContainers = $scope.isCioDriver ? data.containers : data;
@@ -98,16 +49,6 @@ angular.module('portainer.docker').controller('VolumeController', [
return container;
});
$scope.containersUsingVolume = containers;
-
- if ($scope.isCioDriver) {
- $scope.storidgeVolume = data.storidgeVolume;
- if ($scope.storidgeVolume.SnapshotEnabled) {
- return StoridgeSnapshotService.snapshots(data.storidgeVolume.Vdisk);
- }
- }
- })
- .then(function success(data) {
- $scope.storidgeSnapshots = data;
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to retrieve volume details');
diff --git a/app/index.js b/app/index.js
index fc95940c3..f6ec5e398 100644
--- a/app/index.js
+++ b/app/index.js
@@ -47,7 +47,6 @@ angular
'portainer.docker',
'portainer.kubernetes',
'portainer.edge',
- 'portainer.integrations',
'rzModule',
'moment-picker',
'angulartics',
diff --git a/app/integrations/_module.js b/app/integrations/_module.js
deleted file mode 100644
index e4ffc5170..000000000
--- a/app/integrations/_module.js
+++ /dev/null
@@ -1 +0,0 @@
-angular.module('portainer.integrations', ['portainer.integrations.storidge']);
diff --git a/app/integrations/storidge/_module.js b/app/integrations/storidge/_module.js
deleted file mode 100644
index 5bd4481d4..000000000
--- a/app/integrations/storidge/_module.js
+++ /dev/null
@@ -1,128 +0,0 @@
-// TODO: legacy extension management
-
-angular.module('portainer.integrations.storidge', []).config([
- '$stateRegistryProvider',
- function ($stateRegistryProvider) {
- 'use strict';
-
- var storidge = {
- name: 'storidge',
- parent: 'root',
- abstract: true,
- url: '/storidge',
- };
-
- var profiles = {
- name: 'storidge.profiles',
- url: '/profiles',
- views: {
- 'content@': {
- templateUrl: './views/profiles/profiles.html',
- controller: 'StoridgeProfilesController',
- },
- },
- };
-
- var profile = {
- name: 'storidge.profiles.profile',
- url: '/:id',
- views: {
- 'content@': {
- templateUrl: './views/profiles/edit/profile.html',
- controller: 'StoridgeProfileController',
- },
- },
- };
-
- var drives = {
- name: 'storidge.drives',
- url: '/drives',
- views: {
- 'content@': {
- templateUrl: './views/drives/drives.html',
- controller: 'StoridgeDrivesController',
- },
- },
- };
-
- var drive = {
- name: 'storidge.drives.drive',
- url: '/:id',
- views: {
- 'content@': {
- templateUrl: './views/drives/inspect/drive.html',
- controller: 'StoridgeDriveController',
- },
- },
- };
-
- var snapshot = {
- name: 'docker.volumes.volume.snapshot',
- url: '/:snapshotId',
- views: {
- 'content@': {
- templateUrl: './views/snapshots/inspect/snapshot.html',
- controller: 'StoridgeSnapshotController',
- },
- },
- };
-
- var profileCreation = {
- name: 'storidge.profiles.new',
- url: '/new',
- params: {
- profileName: '',
- },
- views: {
- 'content@': {
- templateUrl: './views/profiles/create/createprofile.html',
- controller: 'StoridgeCreateProfileController',
- },
- },
- };
-
- var cluster = {
- name: 'storidge.cluster',
- url: '/cluster',
- views: {
- 'content@': {
- templateUrl: './views/cluster/cluster.html',
- controller: 'StoridgeClusterController',
- },
- },
- };
-
- var node = {
- name: 'storidge.cluster.node',
- url: '/:name',
- views: {
- 'content@': {
- templateUrl: './views/nodes/inspect/node.html',
- controller: 'StoridgeNodeController',
- },
- },
- };
-
- var monitor = {
- name: 'storidge.monitor',
- url: '/events',
- views: {
- 'content@': {
- templateUrl: './views/monitor/monitor.html',
- controller: 'StoridgeMonitorController',
- },
- },
- };
-
- $stateRegistryProvider.register(storidge);
- $stateRegistryProvider.register(drives);
- $stateRegistryProvider.register(drive);
- $stateRegistryProvider.register(snapshot);
- $stateRegistryProvider.register(profiles);
- $stateRegistryProvider.register(profile);
- $stateRegistryProvider.register(profileCreation);
- $stateRegistryProvider.register(cluster);
- $stateRegistryProvider.register(node);
- $stateRegistryProvider.register(monitor);
- },
-]);
diff --git a/app/integrations/storidge/components/cluster-events-datatable/storidgeClusterEventsDatatable.html b/app/integrations/storidge/components/cluster-events-datatable/storidgeClusterEventsDatatable.html
deleted file mode 100644
index 446bea312..000000000
--- a/app/integrations/storidge/components/cluster-events-datatable/storidgeClusterEventsDatatable.html
+++ /dev/null
@@ -1,91 +0,0 @@
-
diff --git a/app/integrations/storidge/components/cluster-events-datatable/storidgeClusterEventsDatatable.js b/app/integrations/storidge/components/cluster-events-datatable/storidgeClusterEventsDatatable.js
deleted file mode 100644
index 7d818df4b..000000000
--- a/app/integrations/storidge/components/cluster-events-datatable/storidgeClusterEventsDatatable.js
+++ /dev/null
@@ -1,12 +0,0 @@
-angular.module('portainer.integrations.storidge').component('storidgeClusterEventsDatatable', {
- templateUrl: './storidgeClusterEventsDatatable.html',
- controller: 'GenericDatatableController',
- bindings: {
- titleText: '@',
- titleIcon: '@',
- dataset: '<',
- tableKey: '@',
- orderBy: '@',
- reverseOrder: '<',
- },
-});
diff --git a/app/integrations/storidge/components/drives-datatable/storidgeDrivesDatatable.html b/app/integrations/storidge/components/drives-datatable/storidgeDrivesDatatable.html
deleted file mode 100644
index eae7519c5..000000000
--- a/app/integrations/storidge/components/drives-datatable/storidgeDrivesDatatable.html
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/components/drives-datatable/storidgeDrivesDatatable.js b/app/integrations/storidge/components/drives-datatable/storidgeDrivesDatatable.js
deleted file mode 100644
index 01733db7c..000000000
--- a/app/integrations/storidge/components/drives-datatable/storidgeDrivesDatatable.js
+++ /dev/null
@@ -1,17 +0,0 @@
-angular.module('portainer.integrations.storidge').component('storidgeDrivesDatatable', {
- templateUrl: './storidgeDrivesDatatable.html',
- controller: 'StoridgeDrivesDatatableController',
- bindings: {
- titleText: '@',
- titleIcon: '@',
- dataset: '<',
- tableKey: '@',
- orderBy: '@',
- reverseOrder: '<',
- removeAction: '<',
- addAction: '<',
- rescanAction: '<',
- actionInProgress: '<',
- additionInProgress: '<',
- },
-});
diff --git a/app/integrations/storidge/components/drives-datatable/storidgeDrivesDatatableController.js b/app/integrations/storidge/components/drives-datatable/storidgeDrivesDatatableController.js
deleted file mode 100644
index fa21eca0b..000000000
--- a/app/integrations/storidge/components/drives-datatable/storidgeDrivesDatatableController.js
+++ /dev/null
@@ -1,45 +0,0 @@
-angular.module('portainer.docker').controller('StoridgeDrivesDatatableController', [
- '$scope',
- '$controller',
- 'DatatableService',
- function ($scope, $controller, DatatableService) {
- angular.extend(this, $controller('GenericDatatableController', { $scope: $scope }));
-
- this.allowSelection = function (item) {
- return item.Status !== 'normal';
- };
-
- this.$onInit = function () {
- this.setDefaults();
- this.prepareTableFromDataset();
-
- this.state.orderBy = this.orderBy;
- var storedOrder = DatatableService.getDataTableOrder(this.tableKey);
- if (storedOrder !== null) {
- this.state.reverseOrder = storedOrder.reverse;
- this.state.orderBy = storedOrder.orderBy;
- }
-
- var textFilter = DatatableService.getDataTableTextFilters(this.tableKey);
- if (textFilter !== null) {
- this.state.textFilter = textFilter;
- this.onTextFilterChange();
- }
-
- var storedFilters = DatatableService.getDataTableFilters(this.tableKey);
- if (storedFilters !== null) {
- this.filters = storedFilters;
- }
- if (this.filters && this.filters.state) {
- this.filters.state.open = false;
- }
-
- var storedSettings = DatatableService.getDataTableSettings(this.tableKey);
- if (storedSettings !== null) {
- this.settings = storedSettings;
- this.settings.open = false;
- }
- this.onSettingsRepeaterChange();
- };
- },
-]);
diff --git a/app/integrations/storidge/components/nodes-datatable/storidgeNodesDatatable.html b/app/integrations/storidge/components/nodes-datatable/storidgeNodesDatatable.html
deleted file mode 100644
index 00c7489d9..000000000
--- a/app/integrations/storidge/components/nodes-datatable/storidgeNodesDatatable.html
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
-
-
-
-
-
- To add a node to this cluster, run the following command on your new node
-
- {{ $ctrl.addInfo }}
-
- Copy
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/components/nodes-datatable/storidgeNodesDatatable.js b/app/integrations/storidge/components/nodes-datatable/storidgeNodesDatatable.js
deleted file mode 100644
index 0d74da376..000000000
--- a/app/integrations/storidge/components/nodes-datatable/storidgeNodesDatatable.js
+++ /dev/null
@@ -1,12 +0,0 @@
-angular.module('portainer.integrations.storidge').component('storidgeNodesDatatable', {
- templateUrl: './storidgeNodesDatatable.html',
- controller: 'StoridgeNodesDatatableController',
- bindings: {
- titleText: '@',
- titleIcon: '@',
- dataset: '<',
- tableKey: '@',
- orderBy: '@',
- reverseOrder: '<',
- },
-});
diff --git a/app/integrations/storidge/components/nodes-datatable/storidgeNodesDatatableController.js b/app/integrations/storidge/components/nodes-datatable/storidgeNodesDatatableController.js
deleted file mode 100644
index 94be23545..000000000
--- a/app/integrations/storidge/components/nodes-datatable/storidgeNodesDatatableController.js
+++ /dev/null
@@ -1,62 +0,0 @@
-angular.module('portainer.integrations.storidge').controller('StoridgeNodesDatatableController', [
- '$scope',
- '$controller',
- 'clipboard',
- 'Notifications',
- 'StoridgeNodeService',
- 'DatatableService',
- function ($scope, $controller, clipboard, Notifications, StoridgeNodeService, DatatableService) {
- angular.extend(this, $controller('GenericDatatableController', { $scope: $scope }));
-
- var ctrl = this;
-
- this.addNodeAction = function () {
- StoridgeNodeService.add()
- .then(function sucess(data) {
- ctrl.addInfo = data.content;
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to retrieve the "add node" command');
- });
- };
-
- this.copyAddNodeCommand = function () {
- clipboard.copyText(ctrl.addInfo);
- $('#copyNotification').show();
- $('#copyNotification').fadeOut(2000);
- };
-
- this.$onInit = function () {
- this.setDefaults();
- this.prepareTableFromDataset();
-
- this.state.orderBy = this.orderBy;
- var storedOrder = DatatableService.getDataTableOrder(this.tableKey);
- if (storedOrder !== null) {
- this.state.reverseOrder = storedOrder.reverse;
- this.state.orderBy = storedOrder.orderBy;
- }
-
- var textFilter = DatatableService.getDataTableTextFilters(this.tableKey);
- if (textFilter !== null) {
- this.state.textFilter = textFilter;
- this.onTextFilterChange();
- }
-
- var storedFilters = DatatableService.getDataTableFilters(this.tableKey);
- if (storedFilters !== null) {
- this.filters = storedFilters;
- }
- if (this.filters && this.filters.state) {
- this.filters.state.open = false;
- }
-
- var storedSettings = DatatableService.getDataTableSettings(this.tableKey);
- if (storedSettings !== null) {
- this.settings = storedSettings;
- this.settings.open = false;
- }
- this.onSettingsRepeaterChange();
- };
- },
-]);
diff --git a/app/integrations/storidge/components/profileSelector/storidgeProfileSelector.html b/app/integrations/storidge/components/profileSelector/storidgeProfileSelector.html
deleted file mode 100644
index 6629e114c..000000000
--- a/app/integrations/storidge/components/profileSelector/storidgeProfileSelector.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
diff --git a/app/integrations/storidge/components/profileSelector/storidgeProfileSelector.js b/app/integrations/storidge/components/profileSelector/storidgeProfileSelector.js
deleted file mode 100644
index 0d9005f0e..000000000
--- a/app/integrations/storidge/components/profileSelector/storidgeProfileSelector.js
+++ /dev/null
@@ -1,7 +0,0 @@
-angular.module('portainer.integrations.storidge').component('storidgeProfileSelector', {
- templateUrl: './storidgeProfileSelector.html',
- controller: 'StoridgeProfileSelectorController',
- bindings: {
- storidgeProfile: '=',
- },
-});
diff --git a/app/integrations/storidge/components/profileSelector/storidgeProfileSelectorController.js b/app/integrations/storidge/components/profileSelector/storidgeProfileSelectorController.js
deleted file mode 100644
index 9c3d2beb6..000000000
--- a/app/integrations/storidge/components/profileSelector/storidgeProfileSelectorController.js
+++ /dev/null
@@ -1,18 +0,0 @@
-angular.module('portainer.integrations.storidge').controller('StoridgeProfileSelectorController', [
- 'StoridgeProfileService',
- 'Notifications',
- function (StoridgeProfileService, Notifications) {
- var ctrl = this;
-
- this.$onInit = $onInit;
- function $onInit() {
- StoridgeProfileService.profiles()
- .then(function success(data) {
- ctrl.profiles = data;
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to retrieve Storidge profiles');
- });
- }
- },
-]);
diff --git a/app/integrations/storidge/components/profiles-datatable/storidgeProfilesDatatable.html b/app/integrations/storidge/components/profiles-datatable/storidgeProfilesDatatable.html
deleted file mode 100644
index f8c615f8b..000000000
--- a/app/integrations/storidge/components/profiles-datatable/storidgeProfilesDatatable.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/components/profiles-datatable/storidgeProfilesDatatable.js b/app/integrations/storidge/components/profiles-datatable/storidgeProfilesDatatable.js
deleted file mode 100644
index 81a6c8178..000000000
--- a/app/integrations/storidge/components/profiles-datatable/storidgeProfilesDatatable.js
+++ /dev/null
@@ -1,13 +0,0 @@
-angular.module('portainer.integrations.storidge').component('storidgeProfilesDatatable', {
- templateUrl: './storidgeProfilesDatatable.html',
- controller: 'GenericDatatableController',
- bindings: {
- titleText: '@',
- titleIcon: '@',
- dataset: '<',
- tableKey: '@',
- orderBy: '@',
- reverseOrder: '<',
- removeAction: '<',
- },
-});
diff --git a/app/integrations/storidge/components/snapshot-creation/storidgeSnapshotCreation.html b/app/integrations/storidge/components/snapshot-creation/storidgeSnapshotCreation.html
deleted file mode 100644
index 446b7f40d..000000000
--- a/app/integrations/storidge/components/snapshot-creation/storidgeSnapshotCreation.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
diff --git a/app/integrations/storidge/components/snapshot-creation/storidgeSnapshotCreation.js b/app/integrations/storidge/components/snapshot-creation/storidgeSnapshotCreation.js
deleted file mode 100644
index 8f5fe3aa7..000000000
--- a/app/integrations/storidge/components/snapshot-creation/storidgeSnapshotCreation.js
+++ /dev/null
@@ -1,7 +0,0 @@
-angular.module('portainer.docker').component('storidgeSnapshotCreation', {
- templateUrl: './storidgeSnapshotCreation.html',
- controller: 'StoridgeSnapshotCreationController',
- bindings: {
- volumeId: '<',
- },
-});
diff --git a/app/integrations/storidge/components/snapshot-creation/storidgeSnapshotCreationController.js b/app/integrations/storidge/components/snapshot-creation/storidgeSnapshotCreationController.js
deleted file mode 100644
index c0e1884e5..000000000
--- a/app/integrations/storidge/components/snapshot-creation/storidgeSnapshotCreationController.js
+++ /dev/null
@@ -1,28 +0,0 @@
-angular.module('portainer.docker').controller('StoridgeSnapshotCreationController', [
- 'StoridgeSnapshotService',
- 'Notifications',
- '$state',
- function (StoridgeSnapshotService, Notifications, $state) {
- var ctrl = this;
-
- this.formValues = {};
- this.state = {
- actionInProgress: false,
- };
-
- this.createSnapshot = function () {
- ctrl.state.actionInProgress = true;
- StoridgeSnapshotService.create(ctrl.volumeId, ctrl.formValues.Description)
- .then(function success() {
- Notifications.success('Success', 'Snapshot successfully created');
- $state.reload();
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to create snapshot');
- })
- .finally(function final() {
- ctrl.state.actionInProgress = false;
- });
- };
- },
-]);
diff --git a/app/integrations/storidge/components/snapshots-datatable/storidgeSnapshotsDatatable.html b/app/integrations/storidge/components/snapshots-datatable/storidgeSnapshotsDatatable.html
deleted file mode 100644
index ccc716269..000000000
--- a/app/integrations/storidge/components/snapshots-datatable/storidgeSnapshotsDatatable.html
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/components/snapshots-datatable/storidgeSnapshotsDatatable.js b/app/integrations/storidge/components/snapshots-datatable/storidgeSnapshotsDatatable.js
deleted file mode 100644
index 116b9d6e2..000000000
--- a/app/integrations/storidge/components/snapshots-datatable/storidgeSnapshotsDatatable.js
+++ /dev/null
@@ -1,13 +0,0 @@
-angular.module('portainer.integrations.storidge').component('storidgeSnapshotsDatatable', {
- templateUrl: './storidgeSnapshotsDatatable.html',
- controller: 'GenericDatatableController',
- bindings: {
- titleText: '@',
- titleIcon: '@',
- dataset: '<',
- tableKey: '@',
- orderBy: '@',
- reverseOrder: '<',
- removeAction: '<',
- },
-});
diff --git a/app/integrations/storidge/components/volume-storidge-info/volumeStoridgeInfo.html b/app/integrations/storidge/components/volume-storidge-info/volumeStoridgeInfo.html
deleted file mode 100644
index 5a909c884..000000000
--- a/app/integrations/storidge/components/volume-storidge-info/volumeStoridgeInfo.html
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-
-
-
-
-
- Name |
- {{ $ctrl.volume.Name }} |
-
-
- UUID |
- {{ $ctrl.volume.Uuid }} |
-
-
- Node |
- {{ $ctrl.volume.Node }} |
-
-
- Node ID |
- {{ $ctrl.volume.NodeID }} |
-
-
- Directory |
- {{ $ctrl.volume.Directory }} |
-
-
- Capacity |
- {{ $ctrl.volume.Capacity }} |
-
-
- Allocated |
- {{ $ctrl.volume.Allocated }} |
-
-
- IOPS Min |
- {{ $ctrl.volume.IOPSMin }} |
-
-
- IOPS Max |
- {{ $ctrl.volume.IOPSMax }} |
-
-
- Bandwidth Min |
- {{ $ctrl.volume.BandwidthMin }} |
-
-
- Bandwidth Max |
- {{ $ctrl.volume.BandwidthMax }} |
-
-
- Local Drive Only |
- {{ $ctrl.volume.LocalDriveOnly }} |
-
-
- Provisioning |
- {{ $ctrl.volume.Provisioning }} |
-
-
- Redundancy |
- {{ $ctrl.volume.Redundancy }} |
-
-
- Vdisk |
- {{ $ctrl.volume.Vdisk }} |
-
-
- IP |
- {{ $ctrl.volume.IP }} |
-
-
- Drive Type |
- {{ $ctrl.volume.DriveType }} |
-
-
- Encryption |
- {{ $ctrl.volume.Encryption }} |
-
-
- Snapshot Enabled |
- {{ $ctrl.volume.SnapshotEnabled }} |
-
-
- Snapshot Interval |
- {{ $ctrl.volume.SnapshotInterval }} minute(s) |
-
-
- Max Snapshots |
- {{ $ctrl.volume.SnapshotMax }} |
-
-
- Filesystem |
- {{ $ctrl.volume.Filesystem }} |
-
-
- Labels |
-
-
-
- {{ var|key: '=' }} |
- {{ var|value: '=' }} |
-
-
- |
-
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/components/volume-storidge-info/volumeStoridgeInfo.js b/app/integrations/storidge/components/volume-storidge-info/volumeStoridgeInfo.js
deleted file mode 100644
index d3c406e13..000000000
--- a/app/integrations/storidge/components/volume-storidge-info/volumeStoridgeInfo.js
+++ /dev/null
@@ -1,7 +0,0 @@
-angular.module('portainer.docker').component('volumeStoridgeInfo', {
- templateUrl: './volumeStoridgeInfo.html',
- controller: 'VolumeStoridgeInfoController',
- bindings: {
- volume: '<',
- },
-});
diff --git a/app/integrations/storidge/components/volume-storidge-info/volumeStoridgeInfoController.js b/app/integrations/storidge/components/volume-storidge-info/volumeStoridgeInfoController.js
deleted file mode 100644
index f4dd076bb..000000000
--- a/app/integrations/storidge/components/volume-storidge-info/volumeStoridgeInfoController.js
+++ /dev/null
@@ -1,105 +0,0 @@
-angular.module('portainer.docker').controller('VolumeStoridgeInfoController', [
- '$state',
- 'StoridgeVolumeService',
- 'Notifications',
- function ($state, StoridgeVolumeService, Notifications) {
- var ctrl = this;
-
- this.state = {
- updateInProgress: false,
- isUpdating: false,
- };
-
- this.addLabel = function () {
- this.formValues.Labels.push({ name: '', value: '' });
- };
-
- this.removeLabel = function (index) {
- this.formValues.Labels.splice(index, 1);
- };
-
- this.initLabels = function () {
- var labels = this.volume.Labels;
- if (labels) {
- this.formValues.Labels = Object.keys(labels).map(function (key) {
- return { name: key, value: labels[key] };
- });
- }
- };
-
- this.updateVolume = function () {
- this.state.updateInProgress = true;
- this.formValues = {
- IOPSMin: this.volume.IOPSMin,
- IOPSMax: this.volume.IOPSMax,
- Node: this.volume.Node,
- Capacity: this.volume.Capacity,
- BandwidthMin: this.volume.BandwidthMin,
- BandwidthMax: this.volume.BandwidthMax,
- Labels: [],
- };
- this.initLabels();
- };
-
- this.cancelUpdate = function () {
- this.state.updateInProgress = false;
- this.formValues = {};
- };
-
- this.prepareLabels = function (volume) {
- var labels = {};
- this.formValues.Labels.forEach(function (label) {
- if (label.name && label.value) {
- labels[label.name] = label.value;
- }
- });
- volume.Labels = labels;
- };
-
- this.prepareVolume = function () {
- var volume = angular.copy(this.formValues);
- var data = this.volume;
-
- if (volume.Node === data.Node || !volume.Node) {
- delete volume.Node;
- }
- if (volume.Capacity === data.Capacity || !volume.Capacity) {
- delete volume.Capacity;
- }
- if (volume.IOPSMin === data.IOPSMin || !volume.IOPSMin) {
- delete volume.IOPSMin;
- } else {
- volume.IOPSMin = volume.IOPSMin.toString();
- }
- if (volume.IOPSMax === data.IOPSMax || !volume.IOPSMax) {
- delete volume.IOPSMax;
- } else {
- volume.IOPSMax = volume.IOPSMax.toString();
- }
- if (volume.BandwidthMin === data.BandwidthMin || !volume.BandwidthMin) {
- delete volume.BandwidthMin;
- }
- if (volume.BandwidthMax === data.BandwidthMax || !volume.BandwidthMax) {
- delete volume.BandwidthMax;
- }
- this.prepareLabels(volume);
- return volume;
- };
-
- this.confirmUpdate = function () {
- this.state.isUpdating = true;
-
- var volume = this.prepareVolume();
- volume.Name = this.volume.Name;
- StoridgeVolumeService.update(volume)
- .then(function success() {
- Notifications.success('Volume successfully updated');
- $state.reload();
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to update volume');
- ctrl.state.isUpdating = false;
- });
- };
- },
-]);
diff --git a/app/integrations/storidge/filters/filters.js b/app/integrations/storidge/filters/filters.js
deleted file mode 100644
index c71a7ec66..000000000
--- a/app/integrations/storidge/filters/filters.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import _ from 'lodash-es';
-
-angular
- .module('portainer.integrations.storidge')
- .filter('drivestatusbadge', function () {
- 'use strict';
- return function (text) {
- var status = text ? _.toLower(text) : '';
- if (status === 'available') {
- return 'info';
- } else if (status === 'faulty') {
- return 'danger';
- }
- return 'success';
- };
- })
- .filter('storidgeNodeStatusBadge', function () {
- 'use strict';
- return function (text) {
- var status = text ? _.toLower(text) : '';
- if (status === 'cordoned' || status === 'maintenance') {
- return 'orange-icon';
- } else if (status === 'leaving' || status === 'failed') {
- return 'red-icon';
- }
- return 'green-icon';
- };
- })
- .filter('storidgeClusterConditionBadge', function () {
- 'use strict';
- return function (text) {
- var status = text ? _.toLower(text) : '';
- if (status === 'alert') {
- return 'red-icon';
- } else if (status === 'warning') {
- return 'orange-icon';
- }
- return 'green-icon';
- };
- })
- .filter('bytes', function () {
- return function (bytes, precision) {
- bytes = parseFloat(bytes);
- if (isNaN(bytes) || !isFinite(bytes)) return '-';
- if (!precision) precision = 1;
- var units = ['B', 'kB', 'MB', 'GB', 'TB', 'PB'];
- var number = Math.floor(Math.log(bytes) / Math.log(1024));
- if (bytes === 0) {
- return '0 B';
- }
- return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
- };
- });
diff --git a/app/integrations/storidge/models/drive.js b/app/integrations/storidge/models/drive.js
deleted file mode 100644
index 715165095..000000000
--- a/app/integrations/storidge/models/drive.js
+++ /dev/null
@@ -1,9 +0,0 @@
-export function StoridgeDriveModel(data) {
- this.Id = data.driveid;
- this.Node = data.node;
- this.Use = data.use;
- this.Status = data.drivestatus.toLowerCase();
- this.Size = data.size;
- this.Type = data.type;
- this.Device = data.device;
-}
diff --git a/app/integrations/storidge/models/events.js b/app/integrations/storidge/models/events.js
deleted file mode 100644
index b056e7484..000000000
--- a/app/integrations/storidge/models/events.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export function StoridgeEventModel(data) {
- this.Time = data.time;
- this.Category = data.category;
- this.Module = data.module;
- this.Content = data.content;
-}
diff --git a/app/integrations/storidge/models/info.js b/app/integrations/storidge/models/info.js
deleted file mode 100644
index 90b30608d..000000000
--- a/app/integrations/storidge/models/info.js
+++ /dev/null
@@ -1,17 +0,0 @@
-export function StoridgeInfoModel(data) {
- this.Domain = data.domain;
- this.Nodes = data.nodes;
- this.Condition = data.condition;
- 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;
-}
diff --git a/app/integrations/storidge/models/node.js b/app/integrations/storidge/models/node.js
deleted file mode 100644
index 0eef2e7b3..000000000
--- a/app/integrations/storidge/models/node.js
+++ /dev/null
@@ -1,31 +0,0 @@
-export function StoridgeNodeModel(name, data) {
- this.Name = name;
- this.IP = data.ip;
- this.Role = data.role;
- this.Status = data.status;
-}
-
-export function StoridgeNodeDetailedModel(name, properties) {
- this.Name = name;
- this.Condition = properties.condition;
- this.Domain = properties.domain;
- this.DomainID = properties.domainID;
- this.FreeBandwidth = properties.freeBandwidth;
- this.FreeCapacity = properties.freeCapacity;
- this.FreeIOPS = properties.freeIOPS;
- this.Hdds = properties.hdds;
- this.MetadataVersion = properties.metadataVersion;
- this.Nodes = properties.nodes;
- this.ProvisionedBandwidth = properties.provisionedBandwidth;
- this.ProvisionedCapacity = properties.provisionedCapacity;
- this.ProvisionedIOPS = properties.provisionedIOPS;
- this.Ssds = properties.ssds;
- this.Status = properties.status;
- this.TotalBandwidth = properties.totalBandwidth;
- this.TotalCapacity = properties.totalCapacity;
- this.TotalIOPS = properties.totalIOPS;
- this.UsedBandwidth = properties.usedBandwidth;
- this.UsedCapacity = properties.usedCapacity;
- this.UsedIOPS = properties.usedIOPS;
- this.Vdisks = properties.vdisks;
-}
diff --git a/app/integrations/storidge/models/profile.js b/app/integrations/storidge/models/profile.js
deleted file mode 100644
index 810c9ae96..000000000
--- a/app/integrations/storidge/models/profile.js
+++ /dev/null
@@ -1,133 +0,0 @@
-export 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;
- this.Filesystem = 'btrfs';
- this.SnapshotEnabled = false;
- this.SnapshotInterval = 1440;
- this.SnapshotMax = 1;
- this.EncryptionEnabled = false;
- this.InterfaceType = '';
- this.InterfaceDriver = '';
- this.InterfaceNetwork = '';
- this.InterfaceConf = '';
- this.Labels = [];
-}
-
-export function StoridgeProfileListModel(data) {
- this.Name = data;
- this.Checked = false;
-}
-
-export 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;
- }
-
- if (data.filesystem) {
- this.Filesystem = data.filesystem.type;
- }
- // this.Filesystem = data.filesystem;
-
- var service = data.service;
-
- if (service.snapshot) {
- this.SnapshotEnabled = service.snapshot.enabled;
- this.SnapshotInterval = service.snapshot.interval;
- this.SnapshotMax = service.snapshot.max;
- } else {
- this.SnapshotEnabled = false;
- }
-
- if (service.encryption) {
- this.EncryptionEnabled = service.encryption.enabled;
- } else {
- this.EncryptionEnabled = false;
- }
-
- if (data.interface) {
- this.InterfaceType = data.interface.type;
- this.InterfaceDriver = data.interface.driver;
- this.InterfaceNetwork = data.interface.network;
- this.InterfaceConf = data.interface.conf;
- }
-
- if (data.label) {
- this.Labels = data.label;
- } else {
- this.Labels = [];
- }
-}
-
-export 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,
- };
- }
-
- this.filesystem = {
- type: model.Filesystem,
- };
-
- var service = {};
-
- service.snapshot = {
- enabled: model.SnapshotEnabled,
- };
- if (model.SnapshotEnabled) {
- service.snapshot.interval = model.SnapshotInterval;
- service.snapshot.max = model.SnapshotMax;
- }
-
- service.encryption = {
- enabled: model.EncryptionEnabled,
- };
-
- this.service = service;
-
- this.interface = {
- driver: model.InterfaceDriver,
- network: model.InterfaceNetwork,
- conf: model.InterfaceConf,
- };
-
- if (model.InterfaceType) {
- this.interface.type = model.InterfaceType;
- }
-
- this.label = model.Labels;
-}
diff --git a/app/integrations/storidge/models/snapshot.js b/app/integrations/storidge/models/snapshot.js
deleted file mode 100644
index 3ee5d62ca..000000000
--- a/app/integrations/storidge/models/snapshot.js
+++ /dev/null
@@ -1,9 +0,0 @@
-export function StoridgeSnapshotModel(data) {
- this.Id = data.identifier;
- this.Date = data.date;
- this.Description = data.description;
- this.SourceID = data.sourceid;
- this.Type = data.type;
- this.Directory = data.directory;
- this.Source = data.source;
-}
diff --git a/app/integrations/storidge/models/volume.js b/app/integrations/storidge/models/volume.js
deleted file mode 100644
index 754942e3a..000000000
--- a/app/integrations/storidge/models/volume.js
+++ /dev/null
@@ -1,40 +0,0 @@
-export function StoridgeVolumeModel(data) {
- this.Allocated = data.allocated;
- this.Capacity = data.capacity;
- this.Directory = data.directory;
- this.IOPSMax = data.maximumIOPS;
- this.IOPSMin = data.minimumIOPS;
- this.BandwidthMin = data.minimumBandwidth;
- this.BandwidthMax = data.maximumBandwidth;
- this.LocalDriveOnly = data.localDriveOnly;
- this.Name = data.name;
- this.Node = data.node;
- this.NodeID = data.nodeid;
- this.Provisioning = data.provisioning;
- this.Redundancy = data.redundancy;
- this.Uuid = data.uuid;
- this.Vdisk = data.vdisk;
- this.Labels = data.labels;
-
- this.IP = data.ipaddr;
- this.DriveType = data.driveType;
- this.Encryption = data.encryption;
- this.SnapshotEnabled = data.snapshot;
- this.SnapshotInterval = data.snapInterval;
- this.SnapshotMax = data.maximumSnapshots;
- this.Filesystem = data.filesystem;
-}
-
-export function StoridgeVolumeUpdateModel(data) {
- this.name = data.Name;
- this.opts = {
- node: data.Node,
- nodeid: data.NodeID,
- capacity: data.Capacity,
- iopsmin: data.IOPSMin,
- iopsmax: data.IOPSMax,
- bandwidthmin: data.BandwidthMin,
- bandwidthmax: data.BandwidthMax,
- };
- this.labels = data.Labels;
-}
diff --git a/app/integrations/storidge/rest/storidge.js b/app/integrations/storidge/rest/storidge.js
deleted file mode 100644
index 83a9b107c..000000000
--- a/app/integrations/storidge/rest/storidge.js
+++ /dev/null
@@ -1,51 +0,0 @@
-angular.module('portainer.integrations.storidge').factory('Storidge', [
- '$resource',
- 'API_ENDPOINT_ENDPOINTS',
- 'EndpointProvider',
- function StoridgeFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
- 'use strict';
- return $resource(
- API_ENDPOINT_ENDPOINTS + '/:endpointId/storidge/:resource/:id/:action',
- {
- endpointId: EndpointProvider.endpointID,
- },
- {
- rebootCluster: { method: 'POST', params: { resource: 'clusters', action: 'reboot' } },
- shutdownCluster: { method: 'POST', params: { resource: 'clusters', action: 'shutdown' } },
- queryEvents: { method: 'GET', params: { resource: 'clusters', action: 'events' }, ignoreLoadingBar: true, isArray: true },
- getVersion: { method: 'GET', params: { resource: 'clusters', action: 'version' } },
- getInfo: { method: 'GET', params: { resource: 'clusters', action: 'info' }, ignoreLoadingBar: true },
-
- queryNodes: { method: 'GET', params: { resource: 'nodes' } },
- getNode: { method: 'GET', params: { resource: 'nodes', id: '@id' } },
- addNode: { method: 'POST', params: { resource: 'nodes' } },
- removeNode: { method: 'DELETE', params: { resource: 'nodes', id: '@id' } },
- cordonNode: { method: 'POST', params: { resource: 'nodes', action: 'cordon', id: '@id' } },
- uncordonNode: { method: 'POST', params: { resource: 'nodes', action: 'uncordon', id: '@id' } },
-
- queryProfiles: { method: 'GET', params: { resource: 'profiles' } },
- getProfile: { method: 'GET', params: { resource: 'profiles' } },
- createProfile: { method: 'POST', params: { resource: 'profiles' } },
- updateProfile: { method: 'PUT', params: { resource: 'profiles', id: '@name' } },
- deleteProfile: { method: 'DELETE', params: { resource: 'profiles' } },
-
- queryDrives: { method: 'GET', params: { resource: 'drives' } },
- getDrive: { method: 'GET', params: { resource: 'drives', id: '@id' } },
- addDrive: { method: 'POST', params: { resource: 'drives' } },
- removeDrive: { method: 'DELETE', params: { resource: 'drives', id: '@id' } },
- rescanDrives: { method: 'POST', params: { resource: 'drives', action: 'rescan' } },
-
- queryVolumes: { method: 'GET', params: { resource: 'volumes' } },
- createVolume: { method: 'POST', params: { resource: 'volumes' } },
- getVolume: { method: 'GET', params: { resource: 'volumes', id: '@id' } },
- updateVolume: { method: 'POST', params: { resource: 'volumes', id: '@name' } },
- removeVolume: { method: 'DELETE', params: { resource: 'volumes', id: '@id' } },
-
- querySnapshots: { method: 'GET', params: { resource: 'volumes', id: '@id', action: 'snapshots' } },
- createSnapshot: { method: 'POST', params: { resource: 'volumes', id: '@id', action: 'snapshot' } },
- getSnapshot: { method: 'GET', params: { resource: 'snapshots', id: '@id' } },
- removeSnapshot: { method: 'DELETE', params: { resource: 'snapshots', id: '@id' } },
- }
- );
- },
-]);
diff --git a/app/integrations/storidge/services/chartService.js b/app/integrations/storidge/services/chartService.js
deleted file mode 100644
index 733615914..000000000
--- a/app/integrations/storidge/services/chartService.js
+++ /dev/null
@@ -1,190 +0,0 @@
-import Chart from 'chart.js';
-import filesize from 'filesize';
-
-angular.module('portainer.integrations.storidge').factory('StoridgeChartService', [
- function StoridgeChartService() {
- 'use strict';
-
- // Max. number of items to display on a chart
- var CHART_LIMIT = 600;
-
- var service = {};
-
- service.CreateCapacityChart = function (context) {
- return new Chart(context, {
- type: 'doughnut',
- data: {
- datasets: [
- {
- data: [],
- backgroundColor: ['rgba(171, 213, 255, 0.7)', 'rgba(229, 57, 53, 0.7)'],
- },
- ],
- labels: [],
- },
- options: {
- tooltips: {
- callbacks: {
- label: function (tooltipItem, data) {
- var dataset = data.datasets[tooltipItem.datasetIndex];
- var label = data.labels[tooltipItem.index];
- var value = dataset.data[tooltipItem.index];
- return label + ': ' + filesize(value, { base: 10, round: 1 });
- },
- },
- },
- animation: {
- duration: 0,
- },
- responsiveAnimationDuration: 0,
- responsive: true,
- hover: {
- animationDuration: 0,
- },
- },
- });
- };
-
- service.CreateIOPSChart = function (context) {
- return new Chart(context, {
- type: 'line',
- data: {
- labels: [],
- datasets: [
- {
- label: 'IOPS',
- data: [],
- fill: true,
- backgroundColor: 'rgba(151,187,205,0.4)',
- borderColor: 'rgba(151,187,205,0.6)',
- pointBackgroundColor: 'rgba(151,187,205,1)',
- pointBorderColor: 'rgba(151,187,205,1)',
- pointRadius: 2,
- borderWidth: 2,
- },
- ],
- },
- options: {
- animation: {
- duration: 0,
- },
- responsiveAnimationDuration: 0,
- responsive: true,
- tooltips: {
- mode: 'index',
- intersect: false,
- position: 'nearest',
- },
- hover: {
- animationDuration: 0,
- },
- scales: {
- yAxes: [
- {
- ticks: {
- beginAtZero: true,
- },
- },
- ],
- },
- },
- });
- };
-
- service.CreateBandwidthChart = function (context) {
- return new Chart(context, {
- type: 'line',
- data: {
- labels: [],
- datasets: [
- {
- label: 'Bandwidth',
- data: [],
- fill: true,
- backgroundColor: 'rgba(151,187,205,0.4)',
- borderColor: 'rgba(151,187,205,0.6)',
- pointBackgroundColor: 'rgba(151,187,205,1)',
- pointBorderColor: 'rgba(151,187,205,1)',
- pointRadius: 2,
- borderWidth: 2,
- },
- ],
- },
- options: {
- animation: {
- duration: 0,
- },
- responsiveAnimationDuration: 0,
- responsive: true,
- tooltips: {
- mode: 'index',
- intersect: false,
- position: 'nearest',
- callbacks: {
- label: function (tooltipItem, data) {
- var datasetLabel = data.datasets[tooltipItem.datasetIndex].label;
- return bytePerSecBasedTooltipLabel(datasetLabel, tooltipItem.yLabel);
- },
- },
- },
- hover: {
- animationDuration: 0,
- },
- scales: {
- yAxes: [
- {
- ticks: {
- beginAtZero: true,
- callback: bytePerSecBasedAxisLabel,
- },
- },
- ],
- },
- },
- });
- };
-
- service.UpdateChart = function (label, value, chart) {
- chart.data.labels.push(label);
- chart.data.datasets[0].data.push(value);
-
- if (chart.data.datasets[0].data.length > CHART_LIMIT) {
- chart.data.labels.pop();
- chart.data.datasets[0].data.pop();
- }
-
- chart.update(0);
- };
-
- service.UpdatePieChart = function (label, value, chart) {
- var idx = chart.data.labels.indexOf(label);
- if (idx > -1) {
- chart.data.datasets[0].data[idx] = value;
- } else {
- chart.data.labels.push(label);
- chart.data.datasets[0].data.push(value);
- }
-
- chart.update(0);
- };
-
- function bytePerSecBasedTooltipLabel(label, value) {
- var processedValue = 0;
- if (value > 5) {
- processedValue = filesize(value, { base: 10, round: 1 });
- } else {
- processedValue = value.toFixed(1) + 'B';
- }
- return label + ': ' + processedValue + '/s';
- }
-
- function bytePerSecBasedAxisLabel(value) {
- if (value > 5) {
- return filesize(value, { base: 10, round: 1 });
- }
- return value.toFixed(1) + 'B/s';
- }
-
- return service;
- },
-]);
diff --git a/app/integrations/storidge/services/clusterService.js b/app/integrations/storidge/services/clusterService.js
deleted file mode 100644
index f7302bb67..000000000
--- a/app/integrations/storidge/services/clusterService.js
+++ /dev/null
@@ -1,68 +0,0 @@
-import { StoridgeInfoModel } from '../models/info';
-import { StoridgeEventModel } from '../models/events';
-
-angular.module('portainer.integrations.storidge').factory('StoridgeClusterService', [
- '$q',
- 'Storidge',
- function StoridgeClusterServiceFactory($q, Storidge) {
- 'use strict';
- var service = {};
-
- service.reboot = function () {
- return Storidge.rebootCluster().$promise;
- };
-
- service.shutdown = function () {
- return Storidge.shutdownCluster().$promise;
- };
-
- service.info = function () {
- var deferred = $q.defer();
-
- Storidge.getInfo()
- .$promise.then(function success(data) {
- var info = new StoridgeInfoModel(data);
- deferred.resolve(info);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge information', err: err });
- });
-
- return deferred.promise;
- };
-
- service.version = function () {
- var deferred = $q.defer();
-
- Storidge.getVersion()
- .$promise.then(function success(data) {
- var version = data.version;
- deferred.resolve(version);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge version', err: err });
- });
-
- return deferred.promise;
- };
-
- service.events = function () {
- var deferred = $q.defer();
-
- Storidge.queryEvents()
- .$promise.then(function success(data) {
- var events = data.map(function (item) {
- return new StoridgeEventModel(item);
- });
- deferred.resolve(events);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge events', err: err });
- });
-
- return deferred.promise;
- };
-
- return service;
- },
-]);
diff --git a/app/integrations/storidge/services/driveService.js b/app/integrations/storidge/services/driveService.js
deleted file mode 100644
index d34c97501..000000000
--- a/app/integrations/storidge/services/driveService.js
+++ /dev/null
@@ -1,81 +0,0 @@
-import { StoridgeDriveModel } from '../models/drive';
-
-angular.module('portainer.integrations.storidge').factory('StoridgeDriveService', [
- '$q',
- 'Storidge',
- function StoridgeDriveServiceFactory($q, Storidge) {
- 'use strict';
- var service = {};
-
- service.drives = function () {
- var deferred = $q.defer();
-
- Storidge.queryDrives()
- .$promise.then(function success(data) {
- var driveData = data.drives;
- var drives = driveData.map(function (drive) {
- return new StoridgeDriveModel(drive);
- });
-
- deferred.resolve(drives);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge drives', err: err });
- });
-
- return deferred.promise;
- };
-
- service.drive = function (id) {
- var deferred = $q.defer();
-
- Storidge.getDrive({ id: id })
- .$promise.then(function success(data) {
- var drive = new StoridgeDriveModel(data);
- Storidge.getNode({ id: data.nodeid }).$promise.then(function (data) {
- drive.Node = data.name;
- deferred.resolve(drive);
- });
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge drive', err: err });
- });
-
- return deferred.promise;
- };
-
- service.add = function (device, node) {
- var deferred = $q.defer();
-
- Storidge.addDrive({ device: device, node: node })
- .$promise.then(function success() {
- deferred.resolve();
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to add Storidge drive', err: err });
- });
-
- return deferred.promise;
- };
-
- service.remove = function (id) {
- var deferred = $q.defer();
-
- Storidge.removeDrive({ id: id })
- .$promise.then(function success() {
- deferred.resolve();
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to remove Storidge drive', err: err });
- });
-
- return deferred.promise;
- };
-
- service.rescan = function () {
- return Storidge.rescanDrives().$promise;
- };
-
- return service;
- },
-]);
diff --git a/app/integrations/storidge/services/nodeService.js b/app/integrations/storidge/services/nodeService.js
deleted file mode 100644
index 1e506c17b..000000000
--- a/app/integrations/storidge/services/nodeService.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import { StoridgeNodeModel, StoridgeNodeDetailedModel } from '../models/node';
-
-angular.module('portainer.integrations.storidge').factory('StoridgeNodeService', [
- '$q',
- 'Storidge',
- function StoridgeNodeServiceFactory($q, Storidge) {
- 'use strict';
- var service = {};
-
- service.nodes = function () {
- var deferred = $q.defer();
-
- Storidge.queryNodes()
- .$promise.then(function success(data) {
- var nodeData = data.nodes;
- var nodes = [];
-
- for (var key in nodeData) {
- if (Object.prototype.hasOwnProperty.call(nodeData, key)) {
- nodes.push(new StoridgeNodeModel(key, nodeData[key]));
- }
- }
-
- deferred.resolve(nodes);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge nodes', err: err });
- });
-
- return deferred.promise;
- };
-
- service.node = function (id) {
- var deferred = $q.defer();
-
- Storidge.getNode({ id: id })
- .$promise.then(function success(data) {
- var node = new StoridgeNodeDetailedModel(data.name, data.properties);
- deferred.resolve(node);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge node', err: err });
- });
-
- return deferred.promise;
- };
-
- service.add = function () {
- return Storidge.addNode().$promise;
- };
-
- service.cordon = function (id) {
- return Storidge.cordonNode({ id: id }).$promise;
- };
-
- service.uncordon = function (id) {
- return Storidge.uncordonNode({ id: id }).$promise;
- };
-
- service.remove = function (id) {
- return Storidge.removeNode({ id: id }).$promise;
- };
-
- return service;
- },
-]);
diff --git a/app/integrations/storidge/services/profileService.js b/app/integrations/storidge/services/profileService.js
deleted file mode 100644
index 1dafec195..000000000
--- a/app/integrations/storidge/services/profileService.js
+++ /dev/null
@@ -1,58 +0,0 @@
-import { StoridgeCreateProfileRequest, StoridgeProfileListModel, StoridgeProfileModel } from '../models/profile';
-
-angular.module('portainer.integrations.storidge').factory('StoridgeProfileService', [
- '$q',
- 'Storidge',
- function StoridgeProfileServiceFactory($q, Storidge) {
- 'use strict';
- var service = {};
-
- service.create = function (model) {
- var payload = new StoridgeCreateProfileRequest(model);
- return Storidge.createProfile(payload).$promise;
- };
-
- service.update = function (model) {
- var payload = new StoridgeCreateProfileRequest(model);
- return Storidge.updateProfile(payload).$promise;
- };
-
- service.delete = function (profileName) {
- return Storidge.deleteProfile({ id: profileName }).$promise;
- };
-
- service.profile = function (profileName) {
- var deferred = $q.defer();
-
- Storidge.getProfile({ id: profileName })
- .$promise.then(function success(data) {
- var profile = new StoridgeProfileModel(profileName, data);
- deferred.resolve(profile);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge profile details', err: err });
- });
-
- return deferred.promise;
- };
-
- service.profiles = function () {
- var deferred = $q.defer();
-
- Storidge.queryProfiles()
- .$promise.then(function success(data) {
- var profiles = data.profiles.map(function (item) {
- return new StoridgeProfileListModel(item);
- });
- deferred.resolve(profiles);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge profiles', err: err });
- });
-
- return deferred.promise;
- };
-
- return service;
- },
-]);
diff --git a/app/integrations/storidge/services/snapshotService.js b/app/integrations/storidge/services/snapshotService.js
deleted file mode 100644
index ae964e12d..000000000
--- a/app/integrations/storidge/services/snapshotService.js
+++ /dev/null
@@ -1,83 +0,0 @@
-import { StoridgeSnapshotModel } from '../models/snapshot';
-
-angular.module('portainer.integrations.storidge').factory('StoridgeSnapshotService', [
- '$q',
- 'Storidge',
- function StoridgeSnapshotServiceFactory($q, Storidge) {
- 'use strict';
- var service = {};
-
- service.snapshots = snapshots;
- service.snapshot = snapshot;
- service.create = create;
- service.remove = remove;
-
- function snapshots(volumeId) {
- var deferred = $q.defer();
-
- Storidge.querySnapshots({ id: volumeId })
- .$promise.then(function success(data) {
- var snapshotsData = data.snapshots;
- let snapshotsArray = [];
- for (const key in snapshotsData) {
- if (Object.prototype.hasOwnProperty.call(snapshotsData, key)) {
- snapshotsArray.push(snapshotsData[key]);
- }
- }
- var snapshots = snapshotsArray.map(function (snapshot) {
- return new StoridgeSnapshotModel(snapshot);
- });
- deferred.resolve(snapshots);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge snapshots', err: err });
- });
-
- return deferred.promise;
- }
-
- function snapshot(id) {
- var deferred = $q.defer();
-
- Storidge.getSnapshot({ id: id })
- .$promise.then(function success(data) {
- var snapshot = new StoridgeSnapshotModel(data.snapshot);
- deferred.resolve(snapshot);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge snapshot', err: err });
- });
-
- return deferred.promise;
- }
-
- function create(volumeId, description) {
- var deferred = $q.defer();
- Storidge.createSnapshot({ id: volumeId, opts: { description: description } })
- .$promise.then(function success(data) {
- deferred.resolve(data);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to create Storidge volume snapshot', err: err });
- });
-
- return deferred.promise;
- }
-
- function remove(id) {
- var deferred = $q.defer();
-
- Storidge.removeSnapshot({ id: id })
- .$promise.then(function success() {
- deferred.resolve();
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to remove Storidge volume snapshot', err: err });
- });
-
- return deferred.promise;
- }
-
- return service;
- },
-]);
diff --git a/app/integrations/storidge/services/volumeService.js b/app/integrations/storidge/services/volumeService.js
deleted file mode 100644
index 84cb617a8..000000000
--- a/app/integrations/storidge/services/volumeService.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import { StoridgeVolumeModel, StoridgeVolumeUpdateModel } from '../models/volume';
-
-angular.module('portainer.integrations.storidge').factory('StoridgeVolumeService', [
- '$q',
- 'Storidge',
- function StoridgeVolumeServiceFactory($q, Storidge) {
- 'use strict';
- var service = {};
-
- service.volume = function (id) {
- var deferred = $q.defer();
-
- Storidge.getVolume({ id: id })
- .$promise.then(function success(data) {
- var volume = new StoridgeVolumeModel(data);
- deferred.resolve(volume);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to retrieve Storidge volume', err: err });
- });
-
- return deferred.promise;
- };
-
- service.update = function (data) {
- var deferred = $q.defer();
- var volume = new StoridgeVolumeUpdateModel(data);
- Storidge.updateVolume(volume)
- .$promise.then(function success(data) {
- deferred.resolve(data);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to update Storidge volume', err: err });
- });
-
- return deferred.promise;
- };
-
- return service;
- },
-]);
diff --git a/app/integrations/storidge/views/cluster/cluster.html b/app/integrations/storidge/views/cluster/cluster.html
deleted file mode 100644
index 972209783..000000000
--- a/app/integrations/storidge/views/cluster/cluster.html
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
- Storidge
-
-
-
-
-
-
-
-
-
-
-
- Domain |
- {{ clusterInfo.Domain }} |
-
-
- Condition |
-
- {{ clusterInfo.Condition }}
- |
-
-
- Version |
- {{ clusterVersion }} |
-
-
-
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/views/cluster/clusterController.js b/app/integrations/storidge/views/cluster/clusterController.js
deleted file mode 100644
index f0200f773..000000000
--- a/app/integrations/storidge/views/cluster/clusterController.js
+++ /dev/null
@@ -1,89 +0,0 @@
-angular.module('portainer.integrations.storidge').controller('StoridgeClusterController', [
- '$q',
- '$scope',
- '$state',
- 'Notifications',
- 'StoridgeClusterService',
- 'StoridgeNodeService',
- 'ModalService',
- function ($q, $scope, $state, Notifications, StoridgeClusterService, StoridgeNodeService, ModalService) {
- $scope.state = {
- shutdownInProgress: false,
- rebootInProgress: false,
- };
-
- $scope.rebootCluster = function () {
- ModalService.confirm({
- title: 'Are you sure?',
- message: 'All the nodes in the cluster will reboot during the process. Do you want to reboot the Storidge cluster?',
- buttons: {
- confirm: {
- label: 'Reboot',
- className: 'btn-danger',
- },
- },
- callback: function onConfirm(confirmed) {
- if (!confirmed) {
- return;
- }
- rebootCluster();
- },
- });
- };
-
- function rebootCluster() {
- $scope.state.rebootInProgress = true;
- StoridgeClusterService.reboot().finally(function final() {
- $scope.state.rebootInProgress = false;
- Notifications.success('Cluster successfully rebooted');
- $state.reload();
- });
- }
-
- $scope.shutdownCluster = function () {
- ModalService.confirm({
- title: 'Are you sure?',
- message: 'All the nodes in the cluster will shutdown. Do you want to shutdown the Storidge cluster?',
- buttons: {
- confirm: {
- label: 'Shutdown',
- className: 'btn-danger',
- },
- },
- callback: function onConfirm(confirmed) {
- if (!confirmed) {
- return;
- }
- shutdownCluster();
- },
- });
- };
-
- function shutdownCluster() {
- $scope.state.shutdownInProgress = true;
- StoridgeClusterService.shutdown().finally(function final() {
- $scope.state.shutdownInProgress = false;
- Notifications.success('Cluster successfully shutdown');
- $state.go('docker.dashboard');
- });
- }
-
- function initView() {
- $q.all({
- info: StoridgeClusterService.info(),
- version: StoridgeClusterService.version(),
- nodes: StoridgeNodeService.nodes(),
- })
- .then(function success(data) {
- $scope.clusterInfo = data.info;
- $scope.clusterVersion = data.version;
- $scope.clusterNodes = data.nodes;
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to retrieve cluster information');
- });
- }
-
- initView();
- },
-]);
diff --git a/app/integrations/storidge/views/drives/drives.html b/app/integrations/storidge/views/drives/drives.html
deleted file mode 100644
index 699a8acf8..000000000
--- a/app/integrations/storidge/views/drives/drives.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
- Storidge > Drives
-
-
-
diff --git a/app/integrations/storidge/views/drives/drivesController.js b/app/integrations/storidge/views/drives/drivesController.js
deleted file mode 100644
index 516de04c2..000000000
--- a/app/integrations/storidge/views/drives/drivesController.js
+++ /dev/null
@@ -1,51 +0,0 @@
-angular.module('portainer.integrations.storidge').controller('StoridgeDrivesController', [
- '$scope',
- '$state',
- 'Notifications',
- 'StoridgeDriveService',
- function ($scope, $state, Notifications, StoridgeDriveService) {
- $scope.state = {
- additionInProgress: [],
- actionInProgress: false,
- };
-
- $scope.addAction = function (drive, idx) {
- $scope.state.additionInProgress[idx] = true;
- $scope.state.actionInProgress = true;
- StoridgeDriveService.add(drive.Device, drive.Node)
- .then(function success() {
- Notifications.success('Drive ' + drive.Device + ' successfully added on node ' + drive.Node);
- $state.reload();
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to add drive');
- })
- .finally(function final() {
- $scope.state.additionInProgress[idx] = false;
- $scope.state.actionInProgress = false;
- });
- };
-
- $scope.rescanAction = function () {
- StoridgeDriveService.rescan()
- .then(function sucess() {
- $state.reload();
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to scan drives');
- });
- };
-
- function initView() {
- StoridgeDriveService.drives()
- .then(function success(data) {
- $scope.drives = data;
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to retrieve drives');
- });
- }
-
- initView();
- },
-]);
diff --git a/app/integrations/storidge/views/drives/inspect/drive.html b/app/integrations/storidge/views/drives/inspect/drive.html
deleted file mode 100644
index de366547d..000000000
--- a/app/integrations/storidge/views/drives/inspect/drive.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
- Storidge > Drives > {{ drive.Id }}
-
-
-
-
-
-
-
-
-
-
-
- ID |
-
- {{ drive.Id }}
-
- |
-
-
- Node |
- {{ drive.Node }} |
-
-
- Device |
- {{ drive.Device }} |
-
-
- Size |
- {{ drive.Size }} |
-
-
- Use |
- {{ drive.Use }} |
-
-
- Type |
- {{ drive.Type }} |
-
-
- Status |
-
- {{ drive.Status | capitalize }}
- |
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/views/drives/inspect/driveController.js b/app/integrations/storidge/views/drives/inspect/driveController.js
deleted file mode 100644
index e3ffb413d..000000000
--- a/app/integrations/storidge/views/drives/inspect/driveController.js
+++ /dev/null
@@ -1,55 +0,0 @@
-angular.module('portainer.integrations.storidge').controller('StoridgeDriveController', [
- '$scope',
- '$state',
- '$transition$',
- 'Notifications',
- 'ModalService',
- 'StoridgeDriveService',
- function ($scope, $state, $transition$, Notifications, ModalService, StoridgeDriveService) {
- $scope.actionInProgress = false;
-
- $scope.removeDrive = function () {
- ModalService.confirm({
- title: 'Are you sure?',
- message: 'Do you want really want to remove this drive from the storage pool?',
- buttons: {
- confirm: {
- label: 'Remove',
- className: 'btn-danger',
- },
- },
- callback: function onConfirm(confirmed) {
- if (!confirmed) {
- return;
- }
- $scope.actionInProgress = true;
- StoridgeDriveService.remove($scope.drive.Id)
- .then(function () {
- Notifications.success('Success', 'Drive removed from storage pool');
- $state.go('storidge.drives', {}, { reload: true });
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to remove drive from storage pool');
- })
- .finally(function final() {
- $scope.actionInProgress = false;
- });
- },
- });
- };
-
- function initView() {
- $scope.id = $transition$.params().id;
-
- StoridgeDriveService.drive($scope.id)
- .then(function success(data) {
- $scope.drive = data;
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to retrieve drive details');
- });
- }
-
- initView();
- },
-]);
diff --git a/app/integrations/storidge/views/monitor/monitor.html b/app/integrations/storidge/views/monitor/monitor.html
deleted file mode 100644
index f292b9670..000000000
--- a/app/integrations/storidge/views/monitor/monitor.html
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-
-
-
-
- Storidge > Cluster monitoring
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Capacity available |
- {{ ((info.FreeCapacity * 100) / info.TotalCapacity).toFixed(1) }}% |
-
-
- Provisioned capacity |
-
- {{ info.ProvisionedCapacity | humansize }}
-
-
-
- |
-
-
- Total capacity |
- {{ info.TotalCapacity | humansize }} |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- IOPS available |
- {{ ((info.FreeIOPS * 100) / info.TotalIOPS).toFixed(1) }}% |
-
-
- Provisioned IOPS |
-
- {{ info.ProvisionedIOPS | number }}
-
-
-
- |
-
-
- Total IOPS |
- {{ info.TotalIOPS | number }} |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Bandwidth available |
- {{ ((info.FreeBandwidth * 100) / info.TotalBandwidth).toFixed(1) }}% |
-
-
- Provisioned bandwidth |
-
- {{ info.ProvisionedBandwidth | humansize }}
-
-
-
- |
-
-
- Total bandwidth |
- {{ info.TotalBandwidth | humansize }} /s |
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/views/monitor/monitorController.js b/app/integrations/storidge/views/monitor/monitorController.js
deleted file mode 100644
index 5166e6e18..000000000
--- a/app/integrations/storidge/views/monitor/monitorController.js
+++ /dev/null
@@ -1,109 +0,0 @@
-import moment from 'moment';
-
-angular.module('portainer.integrations.storidge').controller('StoridgeMonitorController', [
- '$q',
- '$scope',
- '$interval',
- '$document',
- 'Notifications',
- 'StoridgeClusterService',
- 'StoridgeChartService',
- function ($q, $scope, $interval, $document, Notifications, StoridgeClusterService, StoridgeChartService) {
- $scope.$on('$destroy', function () {
- stopRepeater();
- });
-
- function stopRepeater() {
- var repeater = $scope.repeater;
- if (angular.isDefined(repeater)) {
- $interval.cancel(repeater);
- repeater = null;
- }
- }
-
- function updateIOPSChart(info, chart) {
- var usedIOPS = info.UsedIOPS;
- var label = moment(new Date()).format('HH:mm:ss');
-
- StoridgeChartService.UpdateChart(label, usedIOPS, chart);
- }
-
- function updateBandwithChart(info, chart) {
- var usedBandwidth = info.UsedBandwidth;
- var label = moment(new Date()).format('HH:mm:ss');
-
- StoridgeChartService.UpdateChart(label, usedBandwidth, chart);
- }
-
- function updateCapacityChart(info, chart) {
- var usedCapacity = info.UsedCapacity;
- var freeCapacity = info.FreeCapacity;
-
- StoridgeChartService.UpdatePieChart('Free', freeCapacity, chart);
- StoridgeChartService.UpdatePieChart('Used', usedCapacity, chart);
- }
-
- function setUpdateRepeater(iopsChart, bandwidthChart, capacityChart) {
- var refreshRate = 5000;
- $scope.repeater = $interval(function () {
- $q.all({
- events: StoridgeClusterService.events(),
- info: StoridgeClusterService.info(),
- })
- .then(function success(data) {
- $scope.events = data.events;
- var info = data.info;
- $scope.info = info;
- updateIOPSChart(info, iopsChart);
- updateBandwithChart(info, bandwidthChart);
- updateCapacityChart(info, capacityChart);
- })
- .catch(function error(err) {
- stopRepeater();
- Notifications.error('Failure', err, 'Unable to retrieve cluster information');
- });
- }, refreshRate);
- }
-
- function startViewUpdate(iopsChart, bandwidthChart, capacityChart) {
- $q.all({
- events: StoridgeClusterService.events(),
- info: StoridgeClusterService.info(),
- })
- .then(function success(data) {
- $scope.events = data.events;
- var info = data.info;
- $scope.info = info;
- updateIOPSChart(info, iopsChart);
- updateBandwithChart(info, bandwidthChart);
- updateCapacityChart(info, capacityChart);
- setUpdateRepeater(iopsChart, bandwidthChart, capacityChart);
- })
- .catch(function error(err) {
- stopRepeater();
- Notifications.error('Failure', err, 'Unable to retrieve cluster information');
- });
- }
-
- function initCharts() {
- var iopsChartCtx = $('#iopsChart');
- var iopsChart = StoridgeChartService.CreateIOPSChart(iopsChartCtx);
-
- var bandwidthChartCtx = $('#bandwithChart');
- var bandwidthChart = StoridgeChartService.CreateBandwidthChart(bandwidthChartCtx);
-
- var capacityChartCtx = $('#capacityChart');
- var capacityChart = StoridgeChartService.CreateCapacityChart(capacityChartCtx);
-
- startViewUpdate(iopsChart, bandwidthChart, capacityChart);
- }
-
- function initView() {
- $document.ready(function () {
- initCharts();
- });
- }
-
- initView();
- },
-]);
diff --git a/app/integrations/storidge/views/nodes/inspect/node.html b/app/integrations/storidge/views/nodes/inspect/node.html
deleted file mode 100644
index ad0b17176..000000000
--- a/app/integrations/storidge/views/nodes/inspect/node.html
+++ /dev/null
@@ -1,166 +0,0 @@
-
-
-
- Storidge > {{ node.Name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Name |
- {{ node.Name }} |
-
-
- Domain |
- {{ node.Domain }} |
-
-
- Domain ID |
- {{ node.DomainID }} |
-
-
- Node status |
-
-
- {{ node.Status }}
- |
-
-
- Operating condition |
-
-
- {{ node.Condition }}
- |
-
-
- Metadata version |
- {{ node.MetadataVersion }} |
-
-
- Nodes |
- {{ node.Nodes }} |
-
-
- HDDs |
- {{ node.Hdds }} |
-
-
- SSDs |
- {{ node.Ssds }} |
-
-
- VDisks |
- {{ node.Vdisks }} |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Free |
- {{ node.FreeBandwidth }} |
-
-
- Used |
- {{ node.UsedBandwidth }} |
-
-
- Provisioned |
- {{ node.ProvisionedBandwidth }} |
-
-
- Total |
- {{ node.TotalBandwidth }} |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Free |
- {{ node.FreeCapacity | bytes }} |
-
-
- Used |
- {{ node.UsedCapacity | bytes }} |
-
-
- Provisioned |
- {{ node.ProvisionedCapacity | bytes }} |
-
-
- Total |
- {{ node.TotalCapacity | bytes }} |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Free |
- {{ node.FreeIOPS }} |
-
-
- Used |
- {{ node.UsedIOPS }} |
-
-
- Provisioned |
- {{ node.ProvisionedIOPS }} |
-
-
- Total |
- {{ node.TotalIOPS }} |
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/views/nodes/inspect/nodeController.js b/app/integrations/storidge/views/nodes/inspect/nodeController.js
deleted file mode 100644
index fe019d79b..000000000
--- a/app/integrations/storidge/views/nodes/inspect/nodeController.js
+++ /dev/null
@@ -1,117 +0,0 @@
-angular.module('portainer.integrations.storidge').controller('StoridgeNodeController', [
- '$scope',
- '$state',
- '$transition$',
- 'Notifications',
- 'StoridgeNodeService',
- 'ModalService',
- function ($scope, $state, $transition$, Notifications, StoridgeNodeService, ModalService) {
- $scope.removeNodeAction = function (selectedItems) {
- ModalService.confirm({
- title: 'Are you sure?',
- message: 'Do you want really want to remove the node from the cluster?',
- buttons: {
- confirm: {
- label: 'Remove',
- className: 'btn-danger',
- },
- },
- callback: function onConfirm(confirmed) {
- if (!confirmed) {
- return;
- }
- remove(selectedItems);
- },
- });
- };
-
- function remove() {
- StoridgeNodeService.remove($scope.node.Name)
- .then(function success() {
- Notifications.success('Node successfully removed', $scope.node.Name);
- $state.go('storidge.cluster');
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to remove node');
- });
- }
-
- $scope.cordonNodeAction = function (selectedItems) {
- ModalService.confirm({
- title: 'Are you sure?',
- message: 'Do you want really want to put the node in maintenance mode?',
- buttons: {
- confirm: {
- label: 'Enter maintenance',
- className: 'btn-danger',
- },
- },
- callback: function onConfirm(confirmed) {
- if (!confirmed) {
- return;
- }
- cordonNode(selectedItems);
- },
- });
- };
-
- function cordonNode() {
- StoridgeNodeService.cordon($scope.node.Name)
- .then(function success() {
- Notifications.success('Node successfully put in maintenance');
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to put node in maintenance mode');
- })
- .finally(function final() {
- $state.reload();
- });
- }
-
- $scope.uncordonNodeAction = function (selectedItems) {
- ModalService.confirm({
- title: 'Are you sure?',
- message: 'Do you want really want to bring the nodes out of maintenance mode?',
- buttons: {
- confirm: {
- label: 'Exit maintenance',
- className: 'btn-danger',
- },
- },
- callback: function onConfirm(confirmed) {
- if (!confirmed) {
- return;
- }
- uncordonNode(selectedItems);
- },
- });
- };
-
- function uncordonNode() {
- StoridgeNodeService.uncordon($scope.node.Name)
- .then(function success() {
- Notifications.success('Node successfully bringed back');
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to put node out of maintenance mode');
- })
- .finally(function final() {
- $state.reload();
- });
- }
-
- function initView() {
- $scope.name = $transition$.params().name;
-
- StoridgeNodeService.node($scope.name)
- .then(function success(data) {
- $scope.node = data;
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to retrieve node details');
- });
- }
-
- initView();
- },
-]);
diff --git a/app/integrations/storidge/views/profiles/create/createProfileController.js b/app/integrations/storidge/views/profiles/create/createProfileController.js
deleted file mode 100644
index 58daa98c6..000000000
--- a/app/integrations/storidge/views/profiles/create/createProfileController.js
+++ /dev/null
@@ -1,112 +0,0 @@
-import _ from 'lodash-es';
-import { StoridgeProfileDefaultModel } from '../../../models/profile';
-
-angular.module('portainer.integrations.storidge').controller('StoridgeCreateProfileController', [
- '$scope',
- '$state',
- '$transition$',
- 'Notifications',
- 'StoridgeProfileService',
- function ($scope, $state, $transition$, Notifications, StoridgeProfileService) {
- $scope.formValues = {
- Labels: [],
- };
-
- $scope.state = {
- NoLimit: true,
- LimitIOPS: false,
- LimitBandwidth: false,
- ManualInputDirectory: false,
- actionInProgress: false,
- };
-
- $scope.RedundancyOptions = [
- { value: 2, label: '2-copy' },
- { value: 3, label: '3-copy' },
- ];
-
- $scope.addLabel = function () {
- $scope.formValues.Labels.push({ name: '', value: '' });
- };
-
- $scope.removeLabel = function (index) {
- $scope.formValues.Labels.splice(index, 1);
- };
-
- function prepareLabels(profile) {
- var labels = {};
- $scope.formValues.Labels.forEach(function (label) {
- if (label.name && label.value) {
- labels[label.name] = label.value;
- }
- });
- profile.Labels = labels;
- }
-
- $scope.create = function () {
- var profile = $scope.model;
-
- if (!$scope.state.LimitIOPS) {
- delete profile.MinIOPS;
- delete profile.MaxIOPS;
- }
-
- if (!$scope.state.LimitBandwidth) {
- delete profile.MinBandwidth;
- delete profile.MaxBandwidth;
- }
-
- if (profile.SnapshotEnabled) {
- if (!profile.SnapshotMax || profile.SnapshotMax <= 0) {
- profile.SnapshotMax = 1;
- }
- if (!$scope.state.RecurringSnapshotEnabled) {
- delete profile.SnapshotInterval;
- }
- if ($scope.state.RecurringSnapshotEnabled && (!profile.SnapshotInterval || profile.SnapshotInterval <= 0)) {
- profile.SnapshotInterval = 1440;
- }
- } else {
- delete profile.SnapshotMax;
- delete profile.SnapshotInterval;
- }
-
- prepareLabels(profile);
-
- $scope.state.actionInProgress = true;
- StoridgeProfileService.create(profile)
- .then(function success() {
- Notifications.success('Profile successfully created');
- $state.go('storidge.profiles');
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to create profile');
- })
- .finally(function final() {
- $scope.state.actionInProgress = false;
- });
- };
-
- $scope.updatedName = function () {
- if (!$scope.state.ManualInputDirectory) {
- var profile = $scope.model;
- profile.Directory = '/cio/' + (profile.Name ? _.toLower(profile.Name) : '');
- }
- };
-
- $scope.updatedDirectory = function () {
- if (!$scope.state.ManualInputDirectory) {
- $scope.state.ManualInputDirectory = true;
- }
- };
-
- function initView() {
- var profile = new StoridgeProfileDefaultModel();
- profile.Name = $transition$.params().profileName;
- profile.Directory = profile.Directory + _.toLower(profile.Name);
- $scope.model = profile;
- }
-
- initView();
- },
-]);
diff --git a/app/integrations/storidge/views/profiles/create/createprofile.html b/app/integrations/storidge/views/profiles/create/createprofile.html
deleted file mode 100644
index 56bc3a32f..000000000
--- a/app/integrations/storidge/views/profiles/create/createprofile.html
+++ /dev/null
@@ -1,323 +0,0 @@
-
-
- Storidge > Profiles > Add profile
-
-
-
diff --git a/app/integrations/storidge/views/profiles/edit/profile.html b/app/integrations/storidge/views/profiles/edit/profile.html
deleted file mode 100644
index e636500bd..000000000
--- a/app/integrations/storidge/views/profiles/edit/profile.html
+++ /dev/null
@@ -1,313 +0,0 @@
-
-
- Storidge > Profiles > {{ profile.Name }}
-
-
-
diff --git a/app/integrations/storidge/views/profiles/edit/profileController.js b/app/integrations/storidge/views/profiles/edit/profileController.js
deleted file mode 100644
index a3879bfd4..000000000
--- a/app/integrations/storidge/views/profiles/edit/profileController.js
+++ /dev/null
@@ -1,145 +0,0 @@
-angular.module('portainer.integrations.storidge').controller('StoridgeProfileController', [
- '$scope',
- '$state',
- '$transition$',
- 'Notifications',
- 'StoridgeProfileService',
- 'ModalService',
- function ($scope, $state, $transition$, Notifications, StoridgeProfileService, ModalService) {
- $scope.formValues = {
- Labels: [],
- };
-
- $scope.state = {
- NoLimit: false,
- LimitIOPS: false,
- LimitBandwidth: false,
- updateInProgress: false,
- deleteInProgress: false,
- RecurringSnapshotEnabled: false,
- };
-
- $scope.addLabel = function () {
- $scope.formValues.Labels.push({ name: '', value: '' });
- };
-
- $scope.removeLabel = function (index) {
- $scope.formValues.Labels.splice(index, 1);
- };
-
- function prepareLabels(profile) {
- var labels = {};
- $scope.formValues.Labels.forEach(function (label) {
- if (label.name && label.value) {
- labels[label.name] = label.value;
- }
- });
- profile.Labels = labels;
- }
-
- function initLabels(labels) {
- $scope.formValues.Labels = Object.keys(labels).map(function (key) {
- return { name: key, value: labels[key] };
- });
- }
-
- $scope.RedundancyOptions = [
- { value: 2, label: '2-copy' },
- { value: 3, label: '3-copy' },
- ];
-
- $scope.update = function () {
- var profile = $scope.profile;
-
- if (!$scope.state.LimitIOPS) {
- delete profile.MinIOPS;
- delete profile.MaxIOPS;
- }
-
- if (!$scope.state.LimitBandwidth) {
- delete profile.MinBandwidth;
- delete profile.MaxBandwidth;
- }
-
- if (profile.SnapshotEnabled) {
- if (!profile.SnapshotMax || profile.SnapshotMax <= 0) {
- profile.SnapshotMax = 1;
- }
- if (!$scope.state.RecurringSnapshotEnabled) {
- delete profile.SnapshotInterval;
- }
- if ($scope.state.RecurringSnapshotEnabled && (!profile.SnapshotInterval || profile.SnapshotInterval <= 0)) {
- profile.SnapshotInterval = 1440;
- }
- } else {
- delete profile.SnapshotMax;
- delete profile.SnapshotInterval;
- }
-
- prepareLabels(profile);
-
- $scope.state.updateInProgress = true;
- StoridgeProfileService.update(profile)
- .then(function success() {
- Notifications.success('Profile successfully updated');
- $state.go('storidge.profiles');
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to update profile');
- })
- .finally(function final() {
- $scope.state.updateInProgress = false;
- });
- };
-
- $scope.delete = function () {
- ModalService.confirmDeletion('Do you want to remove this profile?', function onConfirm(confirmed) {
- if (!confirmed) {
- return;
- }
- deleteProfile();
- });
- };
-
- function deleteProfile() {
- var profile = $scope.profile;
-
- $scope.state.deleteInProgress = true;
- StoridgeProfileService.delete(profile.Name)
- .then(function success() {
- Notifications.success('Profile successfully deleted');
- $state.go('storidge.profiles');
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to delete profile');
- })
- .finally(function final() {
- $scope.state.deleteInProgress = false;
- });
- }
-
- function initView() {
- StoridgeProfileService.profile($transition$.params().id)
- .then(function success(data) {
- var profile = data;
- if ((profile.MinIOPS && profile.MinIOPS !== 0) || (profile.MaxIOPS && profile.MaxIOPS !== 0)) {
- $scope.state.LimitIOPS = true;
- } else if ((profile.MinBandwidth && profile.MinBandwidth !== 0) || (profile.MaxBandwidth && profile.MaxBandwidth !== 0)) {
- $scope.state.LimitBandwidth = true;
- } else {
- $scope.state.NoLimit = true;
- }
- if (profile.SnapshotEnabled && profile.SnapshotInterval !== 0) {
- $scope.state.RecurringSnapshotEnabled = true;
- }
- initLabels(profile.Labels);
- $scope.profile = profile;
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to retrieve profile details');
- });
- }
-
- initView();
- },
-]);
diff --git a/app/integrations/storidge/views/profiles/profiles.html b/app/integrations/storidge/views/profiles/profiles.html
deleted file mode 100644
index 656da4c8b..000000000
--- a/app/integrations/storidge/views/profiles/profiles.html
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
-
- Storidge > Profiles
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/views/profiles/profilesController.js b/app/integrations/storidge/views/profiles/profilesController.js
deleted file mode 100644
index 1fa962dc6..000000000
--- a/app/integrations/storidge/views/profiles/profilesController.js
+++ /dev/null
@@ -1,76 +0,0 @@
-import _ from 'lodash-es';
-import { StoridgeProfileDefaultModel } from '../../models/profile';
-
-angular.module('portainer.integrations.storidge').controller('StoridgeProfilesController', [
- '$q',
- '$scope',
- '$state',
- 'Notifications',
- 'StoridgeProfileService',
- function ($q, $scope, $state, Notifications, StoridgeProfileService) {
- $scope.state = {
- actionInProgress: false,
- };
-
- $scope.formValues = {
- Name: '',
- };
-
- $scope.removeAction = function (selectedItems) {
- var actionCount = selectedItems.length;
- angular.forEach(selectedItems, function (profile) {
- StoridgeProfileService.delete(profile.Name)
- .then(function success() {
- Notifications.success('Profile successfully removed', profile.Name);
- var index = $scope.profiles.indexOf(profile);
- $scope.profiles.splice(index, 1);
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to remove profile');
- })
- .finally(function final() {
- --actionCount;
- if (actionCount === 0) {
- $state.reload();
- }
- });
- });
- };
-
- $scope.create = function () {
- var model = new StoridgeProfileDefaultModel();
- model.Labels = {};
- model.Name = $scope.formValues.Name;
- model.Directory = model.Directory + _.toLower(model.Name);
- delete model.MinBandwidth;
- delete model.MaxBandwidth;
- delete model.MinIOPS;
- delete model.MaxIOPS;
-
- $scope.state.actionInProgress = true;
- StoridgeProfileService.create(model)
- .then(function success() {
- Notifications.success('Profile successfully created');
- $state.reload();
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to create profile');
- })
- .finally(function final() {
- $scope.state.actionInProgress = false;
- });
- };
-
- function initView() {
- StoridgeProfileService.profiles()
- .then(function success(data) {
- $scope.profiles = data;
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to retrieve profiles');
- });
- }
-
- initView();
- },
-]);
diff --git a/app/integrations/storidge/views/snapshots/inspect/snapshot.html b/app/integrations/storidge/views/snapshots/inspect/snapshot.html
deleted file mode 100644
index 0b09a9051..000000000
--- a/app/integrations/storidge/views/snapshots/inspect/snapshot.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
- Volumes > {{ volumeId }} > Snapshots >
- {{ snapshot.Id }}
-
-
-
-
-
-
-
-
-
-
-
- ID |
-
- {{ snapshot.Id }}
-
- |
-
-
- Date |
- {{ snapshot.Date }} |
-
-
- Description |
- {{ snapshot.Description }} |
-
-
- SourceID |
- {{ snapshot.SourceID }} |
-
-
- Type |
- {{ snapshot.Type }} |
-
-
- Directory |
- {{ snapshot.Directory }} |
-
-
- Source |
- {{ snapshot.Source }} |
-
-
-
-
-
-
-
diff --git a/app/integrations/storidge/views/snapshots/inspect/snapshotController.js b/app/integrations/storidge/views/snapshots/inspect/snapshotController.js
deleted file mode 100644
index 56db7c98e..000000000
--- a/app/integrations/storidge/views/snapshots/inspect/snapshotController.js
+++ /dev/null
@@ -1,50 +0,0 @@
-angular.module('portainer.integrations.storidge').controller('StoridgeSnapshotController', [
- '$scope',
- '$state',
- '$transition$',
- 'Notifications',
- 'ModalService',
- 'StoridgeSnapshotService',
- function ($scope, $state, $transition$, Notifications, ModalService, StoridgeSnapshotService) {
- $scope.removeSnapshot = function () {
- ModalService.confirm({
- title: 'Are you sure?',
- message: 'Do you want really want to remove this snapshot?',
- buttons: {
- confirm: {
- label: 'Remove',
- className: 'btn-danger',
- },
- },
- callback: function onConfirm(confirmed) {
- if (!confirmed) {
- return;
- }
- StoridgeSnapshotService.remove($scope.snapshot.Id)
- .then(function () {
- Notifications.success('Success', 'Snapshot removed');
- $state.go('portainer.volumes.volume', { id: $scope.volumeId });
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to remove snapshot');
- });
- },
- });
- };
-
- function initView() {
- $scope.volumeId = $transition$.params().id;
- $scope.snapshotId = $transition$.params().snapshotId;
-
- StoridgeSnapshotService.snapshot($scope.snapshotId)
- .then(function success(data) {
- $scope.snapshot = data;
- })
- .catch(function error(err) {
- Notifications.error('Failure', err, 'Unable to retrieve snapshot details');
- });
- }
-
- initView();
- },
-]);
diff --git a/app/kubernetes/__module.js b/app/kubernetes/__module.js
index 853c7a641..9afdd9d42 100644
--- a/app/kubernetes/__module.js
+++ b/app/kubernetes/__module.js
@@ -30,7 +30,7 @@ angular.module('portainer.kubernetes', ['portainer.app', registriesModule, custo
}
EndpointProvider.setEndpointID(endpoint.Id);
- await StateManager.updateEndpointState(endpoint, []);
+ await StateManager.updateEndpointState(endpoint);
if (endpoint.Type === 7 && endpoint.Status === 2) {
throw new Error('Unable to contact Edge agent, please ensure that the agent is properly running on the remote environment.');
diff --git a/app/portainer/components/UsersSelector/UsersSelector.mocks.ts b/app/portainer/components/UsersSelector/UsersSelector.mocks.ts
index 8b77c1d04..793f8c1f4 100644
--- a/app/portainer/components/UsersSelector/UsersSelector.mocks.ts
+++ b/app/portainer/components/UsersSelector/UsersSelector.mocks.ts
@@ -9,8 +9,6 @@ export function createMockUser(id: number, username: string): UserViewModel {
EndpointAuthorizations: {},
PortainerAuthorizations: {
PortainerDockerHubInspect: true,
- PortainerEndpointExtensionAdd: true,
- PortainerEndpointExtensionRemove: true,
PortainerEndpointGroupInspect: true,
PortainerEndpointGroupList: true,
PortainerEndpointInspect: true,
diff --git a/app/portainer/rest/legacyExtension.js b/app/portainer/rest/legacyExtension.js
deleted file mode 100644
index c3a98582e..000000000
--- a/app/portainer/rest/legacyExtension.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// TODO: legacy extension management
-angular.module('portainer.app').factory('LegacyExtensions', [
- '$resource',
- 'EndpointProvider',
- 'API_ENDPOINT_ENDPOINTS',
- function LegacyExtensions($resource, EndpointProvider, API_ENDPOINT_ENDPOINTS) {
- 'use strict';
- return $resource(
- API_ENDPOINT_ENDPOINTS + '/:endpointId/extensions/:type',
- {
- endpointId: EndpointProvider.endpointID,
- },
- {
- register: { method: 'POST' },
- deregister: { method: 'DELETE', params: { type: '@type' } },
- }
- );
- },
-]);
diff --git a/app/portainer/services/api/legacyExtensionService.js b/app/portainer/services/api/legacyExtensionService.js
deleted file mode 100644
index 18c737571..000000000
--- a/app/portainer/services/api/legacyExtensionService.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// TODO: legacy extension management
-angular.module('portainer.app').factory('LegacyExtensionService', [
- 'LegacyExtensions',
- function LegacyExtensionServiceFactory(LegacyExtensions) {
- 'use strict';
- var service = {};
-
- service.registerStoridgeExtension = function (url) {
- var payload = {
- Type: 1,
- URL: url,
- };
-
- return LegacyExtensions.register(payload).$promise;
- };
-
- service.deregisterStoridgeExtension = function () {
- return LegacyExtensions.deregister({ type: 1 }).$promise;
- };
-
- return service;
- },
-]);
diff --git a/app/portainer/services/legacyExtensionManager.js b/app/portainer/services/legacyExtensionManager.js
deleted file mode 100644
index fd416f325..000000000
--- a/app/portainer/services/legacyExtensionManager.js
+++ /dev/null
@@ -1,86 +0,0 @@
-import _ from 'lodash-es';
-
-// TODO: legacy extension management
-angular.module('portainer.app').factory('LegacyExtensionManager', [
- '$q',
- 'PluginService',
- 'SystemService',
- 'NodeService',
- 'LegacyExtensionService',
- function ExtensionManagerFactory($q, PluginService, SystemService, NodeService, LegacyExtensionService) {
- 'use strict';
- var service = {};
-
- service.initEndpointExtensions = function (endpoint) {
- var deferred = $q.defer();
-
- if (endpoint.Status !== 1) {
- deferred.resolve([]);
- return deferred.promise;
- }
-
- SystemService.version()
- .then(function success(data) {
- var endpointAPIVersion = parseFloat(data.ApiVersion);
-
- return $q.all([endpointAPIVersion >= 1.25 ? initStoridgeExtension() : {}]);
- })
- .then(function success(data) {
- var extensions = data;
- deferred.resolve(extensions);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'Unable to connect to the Docker environment', err: err });
- });
-
- return deferred.promise;
- };
-
- function initStoridgeExtension() {
- var deferred = $q.defer();
-
- PluginService.volumePlugins()
- .then(function success(data) {
- var volumePlugins = data;
- if (_.includes(volumePlugins, 'cio:latest')) {
- return registerStoridgeUsingSwarmManagerIP();
- } else {
- return deregisterStoridgeExtension();
- }
- })
- .then(function success(data) {
- deferred.resolve(data);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'An error occured during Storidge extension check', err: err });
- });
-
- return deferred.promise;
- }
-
- function registerStoridgeUsingSwarmManagerIP() {
- var deferred = $q.defer();
-
- NodeService.getActiveManager()
- .then(function success(data) {
- var managerIP = data.Addr;
- var storidgeAPIURL = 'tcp://' + managerIP + ':8282';
- return LegacyExtensionService.registerStoridgeExtension(storidgeAPIURL);
- })
- .then(function success(data) {
- deferred.resolve(data);
- })
- .catch(function error(err) {
- deferred.reject({ msg: 'An error occured during Storidge extension initialization', err: err });
- });
-
- return deferred.promise;
- }
-
- function deregisterStoridgeExtension() {
- return LegacyExtensionService.deregisterStoridgeExtension();
- }
-
- return service;
- },
-]);
diff --git a/app/portainer/services/stateManager.js b/app/portainer/services/stateManager.js
index 462a43cd0..de8ac780f 100644
--- a/app/portainer/services/stateManager.js
+++ b/app/portainer/services/stateManager.js
@@ -26,7 +26,6 @@ function StateManagerFactory(
dismissedInfoPanels: {},
dismissedInfoHash: '',
},
- extensions: [],
};
manager.setVersionInfo = function (versionInfo) {
@@ -153,20 +152,7 @@ function StateManagerFactory(
return cacheValidity < APPLICATION_CACHE_VALIDITY;
}
- function assignExtensions(endpointExtensions) {
- var extensions = [];
-
- for (var i = 0; i < endpointExtensions.length; i++) {
- var extension = endpointExtensions[i];
- if (extension.Type === 1) {
- extensions.push('storidge');
- }
- }
-
- return extensions;
- }
-
- manager.updateEndpointState = function (endpoint, extensions) {
+ manager.updateEndpointState = function (endpoint) {
var deferred = $q.defer();
if (endpoint.Type === 3) {
@@ -196,7 +182,6 @@ function StateManagerFactory(
state.endpoint.name = endpoint.Name;
state.endpoint.type = endpoint.Type;
state.endpoint.apiVersion = endpointAPIVersion;
- state.endpoint.extensions = assignExtensions(extensions);
if (endpointMode.agentProxy && endpoint.Status === 1) {
return AgentPingService.ping().then(function onPingSuccess(data) {
diff --git a/app/portainer/teams/CreateTeamForm/CreateTeamForm.mocks.ts b/app/portainer/teams/CreateTeamForm/CreateTeamForm.mocks.ts
index 590c6cea0..33f7366a7 100644
--- a/app/portainer/teams/CreateTeamForm/CreateTeamForm.mocks.ts
+++ b/app/portainer/teams/CreateTeamForm/CreateTeamForm.mocks.ts
@@ -24,8 +24,6 @@ export function mockExampleData() {
EndpointAuthorizations: {},
PortainerAuthorizations: {
PortainerDockerHubInspect: true,
- PortainerEndpointExtensionAdd: true,
- PortainerEndpointExtensionRemove: true,
PortainerEndpointGroupInspect: true,
PortainerEndpointGroupList: true,
PortainerEndpointInspect: true,
@@ -51,8 +49,6 @@ export function mockExampleData() {
EndpointAuthorizations: {},
PortainerAuthorizations: {
PortainerDockerHubInspect: true,
- PortainerEndpointExtensionAdd: true,
- PortainerEndpointExtensionRemove: true,
PortainerEndpointGroupInspect: true,
PortainerEndpointGroupList: true,
PortainerEndpointInspect: true,
diff --git a/app/portainer/views/sidebar/sidebar.html b/app/portainer/views/sidebar/sidebar.html
index c07061a6f..46af92d9a 100644
--- a/app/portainer/views/sidebar/sidebar.html
+++ b/app/portainer/views/sidebar/sidebar.html
@@ -39,26 +39,6 @@
>
-
-
- Monitor
- Profiles
- Drives
-
-
-
Edge Devices
diff --git a/yarn.lock b/yarn.lock
index cc0c76981..935082d60 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -12597,7 +12597,7 @@ locate-path@^6.0.0:
dependencies:
p-locate "^5.0.0"
-lodash-es@^4.17.15, lodash-es@^4.17.21:
+lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==