Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Regions View Updates #91

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/ui/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: A Helm chart for deploying Unikorn UI

type: application

version: v0.2.36
appVersion: v0.2.36
version: v0.2.37
appVersion: v0.2.37

icon: https://assets.unikorn-cloud.org/assets/images/logos/dark-on-light/icon.png

Expand Down
16 changes: 10 additions & 6 deletions src/routes/(shell)/regions/identities/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,17 @@

Stores.organizationStore.subscribe((value: Stores.OrganizationInfo) => {
organizationInfo = value;
update();
});

token.subscribe((token: InternalToken): void => {
at = token;
update();
});

const ticker = setInterval(update, 5000);
onDestroy(() => clearInterval(ticker));

function update(): void {
function update(
at: InternalToken,
organizationInfo: Stores.OrganizationInfo,
allowed: boolean
): void {
if (!at || !organizationInfo || !allowed) return;

const parameters = {
Expand All @@ -88,6 +87,11 @@
.catch((e: Error) => Clients.error(e));
}

$: update(at, organizationInfo, allowed);

const ticker = setInterval(() => update(at, organizationInfo, allowed), 5000);
onDestroy(() => clearInterval(ticker));

function remove(resource: Region.IdentityRead): void {
const modal: ModalSettings = {
type: 'confirm',
Expand Down
16 changes: 10 additions & 6 deletions src/routes/(shell)/regions/physicalnetworks/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,17 @@

Stores.organizationStore.subscribe((value: Stores.OrganizationInfo) => {
organizationInfo = value;
update();
});

token.subscribe((token: InternalToken): void => {
at = token;
update();
});

const ticker = setInterval(update, 5000);
onDestroy(() => clearInterval(ticker));

function update(): void {
function update(
at: InternalToken,
organizationInfo: Stores.OrganizationInfo,
allowed: boolean
): void {
if (!at || !organizationInfo || !allowed) return;

const parameters = {
Expand All @@ -81,6 +80,11 @@
.then((v: Array<Identity.ProjectRead>) => (projects = v))
.catch((e: Error) => Clients.error(e));
}

$: update(at, organizationInfo, allowed);

const ticker = setInterval(() => update(at, organizationInfo, allowed), 5000);
onDestroy(() => clearInterval(ticker));
</script>

<ShellPage {settings}>
Expand Down
Loading