mirror of https://github.com/portainer/portainer
fix(cache): cache fixes [EE-6293] (#10681)
* fix(cache): default cache to on for new users [EE-6293] * clear cache to transition terminating namespace * add rq requests back to the namespace view --------- Co-authored-by: testa113 <testa113>pull/10684/head
parent
2f91315ac7
commit
04c1c7d8fb
|
@ -65,6 +65,7 @@ func (handler *Handler) userCreate(w http.ResponseWriter, r *http.Request) *http
|
||||||
user = &portainer.User{
|
user = &portainer.User{
|
||||||
Username: payload.Username,
|
Username: payload.Username,
|
||||||
Role: portainer.UserRole(payload.Role),
|
Role: portainer.UserRole(payload.Role),
|
||||||
|
UseCache: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
settings, err := handler.DataStore.Settings().Settings()
|
settings, err := handler.DataStore.Settings().Settings()
|
||||||
|
|
|
@ -2,6 +2,7 @@ import angular from 'angular';
|
||||||
import { confirm } from '@@/modals/confirm';
|
import { confirm } from '@@/modals/confirm';
|
||||||
import { ModalType } from '@@/modals';
|
import { ModalType } from '@@/modals';
|
||||||
import { buildConfirmButton } from '@@/modals/utils';
|
import { buildConfirmButton } from '@@/modals/utils';
|
||||||
|
import { dispatchCacheRefreshEvent } from '@/portainer/services/http-request.helper';
|
||||||
|
|
||||||
class KubernetesResourcePoolsController {
|
class KubernetesResourcePoolsController {
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
|
@ -75,7 +76,11 @@ class KubernetesResourcePoolsController {
|
||||||
|
|
||||||
async getResourcePoolsAsync() {
|
async getResourcePoolsAsync() {
|
||||||
try {
|
try {
|
||||||
this.resourcePools = await this.KubernetesResourcePoolService.get();
|
this.resourcePools = await this.KubernetesResourcePoolService.get('', { getQuota: true });
|
||||||
|
// make sure table refreshes with fresh data when namespaces are in a terminating state
|
||||||
|
if (this.resourcePools.some((namespace) => namespace.Namespace.Status === 'Terminating')) {
|
||||||
|
dispatchCacheRefreshEvent();
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.Notifications.error('Failure', err, 'Unable to retreive namespaces');
|
this.Notifications.error('Failure', err, 'Unable to retreive namespaces');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue