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
Ali 2023-11-24 11:27:52 +13:00 committed by GitHub
parent 2f91315ac7
commit 04c1c7d8fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -65,6 +65,7 @@ func (handler *Handler) userCreate(w http.ResponseWriter, r *http.Request) *http
user = &portainer.User{
Username: payload.Username,
Role: portainer.UserRole(payload.Role),
UseCache: true,
}
settings, err := handler.DataStore.Settings().Settings()

View File

@ -2,6 +2,7 @@ import angular from 'angular';
import { confirm } from '@@/modals/confirm';
import { ModalType } from '@@/modals';
import { buildConfirmButton } from '@@/modals/utils';
import { dispatchCacheRefreshEvent } from '@/portainer/services/http-request.helper';
class KubernetesResourcePoolsController {
/* @ngInject */
@ -75,7 +76,11 @@ class KubernetesResourcePoolsController {
async getResourcePoolsAsync() {
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) {
this.Notifications.error('Failure', err, 'Unable to retreive namespaces');
}