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

Release v1.0.3 #133

Merged
merged 25 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
278e86d
:art: Improved structure
abdheshnayak Mar 5, 2024
e16ed0c
Merge branch 'release-v1.0.3' of github.com:kloudlite/web into releas…
abdheshnayak Mar 5, 2024
5882eae
Added secret view feature on managed resources, fixed ui issues in ne…
tulsiojha Mar 5, 2024
165dbb6
Merge pull request #121 from kloudlite/features/mres
tulsiojha Mar 5, 2024
7d3a5fd
add reload on every event
nxtCoder19 Mar 5, 2024
3942bc6
Merge pull request #122 from kloudlite/add/nats-event-handler
abdheshnayak Mar 5, 2024
c5c8c99
Added labels field in nodepool
tulsiojha Mar 6, 2024
6f0135a
auto-scaling added in app settings
nxtcoder36 Mar 6, 2024
578e415
Merge pull request #125 from kloudlite/features/label_taints
tulsiojha Mar 6, 2024
9df12b8
:bug: Fixed issue with filler-image alignment
abdheshnayak Mar 6, 2024
30b031a
Designed new list view
tulsiojha Mar 6, 2024
692dc96
Merge pull request #126 from kloudlite/feature/design
tulsiojha Mar 6, 2024
f0b993f
:recycle: Refactored to work aws with accessKey and secretKey instead…
abdheshnayak Mar 7, 2024
2c621d9
Redesigned team selection popup in breadcrum
tulsiojha Mar 7, 2024
ed46ca7
Merge pull request #127 from kloudlite/feature/header
tulsiojha Mar 7, 2024
ec7fbc6
Implemented new breadcrum ui
tulsiojha Mar 7, 2024
f3f1245
Merge pull request #128 from kloudlite/feature/ui
tulsiojha Mar 7, 2024
7504052
Added tooltip for list items
tulsiojha Mar 7, 2024
0e6f3e3
Merge pull request #129 from kloudlite/ui/touchups
tulsiojha Mar 7, 2024
226be9a
Fixed error not showing in create new build
tulsiojha Mar 7, 2024
b5556df
Merge pull request #130 from kloudlite/bugs/handle-create-build-error
tulsiojha Mar 7, 2024
f1519d9
user profile page is now a seperate full screen page.
nxtcoder36 Mar 8, 2024
6c10eb1
Merge pull request #132 from kloudlite/refactoring/profile-settings
abdheshnayak Mar 8, 2024
2f6b47c
:sparkles: Refactored cloud provider
abdheshnayak Mar 10, 2024
ffa2aa9
:bug: Fixed issue
abdheshnayak Mar 10, 2024
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 Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tasks:
interactive: true
cmds:
- |
BASE_URL=dev.kloudlite.io
BASE_URL=gcp-production.kloudlite.io
COOKIE_DOMAIN=".kloudlite.io"
GATEWAY_URL="http://gateway.kloudlite.svc.cluster.local"
case {{.app}} in
Expand Down Expand Up @@ -55,7 +55,7 @@ tasks:

esac

REMIX_DEV_ORIGIN="https://{{.app}}$URL_SUFFIX.dev.kloudlite.io"
REMIX_DEV_ORIGIN="https://{{.app}}$URL_SUFFIX.$BASE_URL"

cp -r ./static/common/. ./public/
cp -r ./static/{{.app}}/. ./public/
Expand Down
40 changes: 15 additions & 25 deletions gql-queries-generator/doc/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ query consoleGetAccount($accountName: String!) {
name
annotations
}
targetNamespace
updateTime
contactEmail
displayName
Expand Down Expand Up @@ -300,10 +301,6 @@ query consoleListClusters($search: SearchCluster, $pagination: CursorPaginationI
spec {
messageQueueTopicName
kloudliteRelease
credentialsRef {
namespace
name
}
clusterTokenRef {
key
name
Expand Down Expand Up @@ -398,18 +395,6 @@ query consoleGetCluster($name: String!) {
name
namespace
}
credentialKeys {
keyAccessKey
keyAWSAccountId
keyAWSAssumeRoleExternalID
keyAWSAssumeRoleRoleARN
keyIAMInstanceProfileRole
keySecretKey
}
credentialsRef {
name
namespace
}
kloudliteRelease
messageQueueTopicName
output {
Expand Down Expand Up @@ -480,15 +465,15 @@ query consoleListProviderSecrets($search: SearchProviderSecret, $pagination: Cur
edges {
cursor
node {
aws {
awsAccountId
}
cloudProviderName
createdBy {
userEmail
userId
userName
}
aws {
authMechanism
}
creationTime
displayName
lastUpdatedBy {
Expand Down Expand Up @@ -528,9 +513,6 @@ mutation consoleDeleteProviderSecret($secretName: String!) {

query consoleGetProviderSecret($name: String!) {
infra_getProviderSecret(name: $name) {
aws {
awsAccountId
}
cloudProviderName
createdBy {
userEmail
Expand Down Expand Up @@ -3250,22 +3232,24 @@ query consoleListManagedResources($projectName: String!, $envName: String!, $sea
}
creationTime
displayName
enabled
environmentName
lastUpdatedBy {
userEmail
userId
userName
}
markedForDeletion
metadata {
annotations
creationTimestamp
deletionTimestamp
generation
labels
name
namespace
}
projectName
recordVersion
spec {
resourceName
resourceTemplate {
apiVersion
kind
Expand Down Expand Up @@ -3293,6 +3277,12 @@ query consoleListManagedResources($projectName: String!, $envName: String!, $sea
namespace
}
}
syncedOutputSecretRef {
metadata {
name
namespace
}
}
syncStatus {
action
error
Expand Down
44 changes: 41 additions & 3 deletions lib/client/helpers/socket/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Context = createContext<{
});

export const useSubscribe = <T extends IData>(
msg: ISocketMsg<T>,
msg: ISocketMsg<T> | ISocketMsg<T>[],
dep: never[]
) => {
const {
Expand All @@ -74,8 +74,31 @@ export const useSubscribe = <T extends IData>(

useEffect(() => {
(async () => {
setResp(responses[msg.for]?.[msg.data.id || 'default'] || []);
if (Array.isArray(msg)) {
setResp(resp);

const tr: ISocketResp[] = [];
const terr: ISocketResp[] = [];
const ti: ISocketResp[] = [];

for (let k = 0; k < msg.length; k += 1) {
const m = msg[k];

tr.push(...(responses[m.for]?.[m.data.id || 'default'] || []));
terr.push(...(e[m.for]?.[m.data.id || 'default'] || []));
ti.push(...(i[m.for]?.[m.data.id || 'default'] || []));
}
setResp(tr);
setErrors(terr);
setInfos(ti);

if (tr.length || ti.length) {
setSubscribed(true);
}
return;
}

setResp(responses[msg.for]?.[msg.data.id || 'default'] || []);
setErrors(e[msg.for]?.[msg.data.id || 'default'] || []);
setInfos(i[msg.for]?.[msg.data.id || 'default'] || []);

Expand All @@ -88,10 +111,25 @@ export const useSubscribe = <T extends IData>(
useDebounce(
() => {
console.log('subscribing');
sendMsg({ ...msg, data: { ...msg.data, event: 'subscribe' } });
if (Array.isArray(msg)) {
msg.forEach((m) => {
sendMsg({ ...m, data: { ...m.data, event: 'subscribe' } });
});
} else {
sendMsg({ ...msg, data: { ...msg.data, event: 'subscribe' } });
}

return () => {
console.log('unsubscribing');
if (Array.isArray(msg)) {
msg.forEach((m) => {
clear(m);
setSubscribed(false);
sendMsg({ ...m, data: { ...m.data, event: 'unsubscribe' } });
});
return;
}

clear(msg);
setSubscribed(false);
sendMsg({ ...msg, data: { ...msg.data, event: 'unsubscribe' } });
Expand Down
47 changes: 34 additions & 13 deletions lib/client/helpers/socket/useWatch.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
import { useEffect } from 'react';
import { useCallback, useEffect } from 'react';
import { ISocketResp, useSubscribe } from './context';
import { useReload } from '../reloader';

export const useSocketWatch = (
onUpdate: (v: ISocketResp<any>[]) => void,
topic: string
topic: string | string[]
) => {
const { responses, subscribed } = useSubscribe(
{
for: 'resource-update',
data: {
id: topic,
respath: topic,
},
},
Array.isArray(topic)
? topic.map((t) => {
return {
for: 'resource-update',
data: {
id: t,
respath: t,
},
};
})
: {
for: 'resource-update',
data: {
id: topic,
respath: topic,
},
},
[]
);

Expand All @@ -24,12 +34,23 @@ export const useSocketWatch = (
}, [responses]);
};

export const useWatchReload = (topic: string) => {
export const useWatchReload = (topic: string | string[]) => {
const reloadPage = useReload();
const topicMap: {
[key: string]: boolean;
} = useCallback(
() =>
Array.isArray(topic)
? topic.reduce((acc, curr) => {
return { ...acc, [curr]: true };
}, {})
: { [topic]: true },
[topic]
)();

useSocketWatch((rd) => {
console.log(rd);
if (rd.find((v) => v.id === topic)) {
console.log('reloading due to watch event', rd);
if (rd.find((v) => topicMap[v.id])) {
console.log('reloading due to watch event');
reloadPage();
}
}, topic);
Expand Down
4 changes: 2 additions & 2 deletions src/apps/console/components/code-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface ICodeView {
const CodeView = ({
data,
copy,
showShellPrompt,
showShellPrompt: _,
language = 'shell',
title,
}: ICodeView) => {
Expand Down Expand Up @@ -55,7 +55,7 @@ const CodeView = ({
}}
className="group/sha cursor-pointer p-lg rounded-md bodyMd flex flex-row gap-xl items-center hljs w-full"
>
<pre className="flex-1">
<pre className="flex-1 overflow-auto">
<code ref={ref}>{data}</code>
</pre>

Expand Down
Loading
Loading