Skip to content

web_terminal_front #207

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

MdSayemkhan
Copy link

What type of PR is this?

What this PR does / why we need it:
/kind feature

Which issue(s) this PR fixes:
Fixes #57

Special notes for your reviewer:

Does this PR introduce a user-facing change?:
yes


@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 28, 2025
@karmada-bot karmada-bot requested review from jhnine and samzong March 28, 2025 19:48
@karmada-bot
Copy link
Collaborator

Welcome @MdSayemkhan! It looks like this is your first PR to karmada-io/dashboard 🎉

@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 28, 2025
@MdSayemkhan MdSayemkhan changed the title web_termiminal web_terminal_front Mar 28, 2025
@MdSayemkhan MdSayemkhan force-pushed the feature-add_web_terminal branch from f54a650 to cb63771 Compare March 28, 2025 19:59
@warjiang
Copy link
Contributor

/assign

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from warjiang. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: MdSayemkhan <sayemkhan4604@gmail.com>
Signed-off-by: MdSayemkhan <sayemkhan4604@gmail.com>
Signed-off-by: MdSayemkhan <sayemkhan4604@gmail.com>
@MdSayemkhan MdSayemkhan force-pushed the feature-add_web_terminal branch from 9e137dd to fa3403c Compare April 13, 2025 21:02
@MdSayemkhan
Copy link
Author

/assign @warjiang

Signed-off-by: MdSayemkhan <sayemkhan4604@gmail.com>
Signed-off-by: MdSayemkhan <sayemkhan4604@gmail.com>
@karmada-bot karmada-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 16, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubeconfig file should not be submitted

namespace: karmada-system
spec:
containers:
- image: docker.io/sayem4604/ttyd:latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide with the original Dockerfile for building docker.io/sayem4604/ttyd:latest image, it will help our customer to clarify what we add in the image, also we can make some customization to to ttyd image, make it more convenient for karmada community.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will not use the pod file directly, we can integrate the pod file with golang, like followoing:

pod := &v1.Pod{
        ObjectMeta: metav1.ObjectMeta{
            Name:      "ttyd-cbf14e3f-f53a-4e0c-99e2-b39ebc0d221d",
            Namespace: "karmada-system",
        },
        Spec: v1.PodSpec{
            Containers: []v1.Container{
                {
                    Name:  "ttyd-cbf14e3f-f53a-4e0c-99e2-b39ebc0d221d",
                    Image: "docker.io/sayem4604/ttyd:latest",
                    Ports: []v1.ContainerPort{
                        {
                            ContainerPort: 7681,
                        },
                    },
                },
            },
        },
    }
    podsClient := clientset.CoreV1().Pods("karmada-system")
    result, err := podsClient.Create(context.TODO(), pod, metav1.CreateOptions{})
    if err != nil {
        panic(err.Error())
    }

!!! Above is just an example, don't use it directly in your programe.

// Call the web_terminal function from the main entry point
func main() {
web_terminal() // Ensure this is called to initialize the terminal setup
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add extra line at the end of the file

terminal_setup.Init()// Call the init function if it exists
}

// Call the web_terminal function from the main entry point
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main file is useless, i seems that it just for testing, testing code expect UT code should not be submitted.

@@ -52,6 +55,16 @@ export const MainLayout: FC = () => {
<Outlet />
</AntdContent>
</AntdLayout>
<Navigation onTerminalClick={() => setIsTerminalOpen(true)} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here you will add two navigation component ?
image

@@ -52,7 +52,9 @@ export default defineConfig(({ mode }) => {
}),
],
resolve: {
alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format the code

@@ -8,10 +8,9 @@

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
/*"allowImportingTsExtensions": true,*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any explanation for the change

@@ -18,6 +18,7 @@ import type { ITerminalOptions } from '@xterm/xterm';
import { addEventListener, getDebugger } from './utils';
import BaseTerminal from './base.ts';
import { BaseTerminalOptions, ClientOptions } from './typing';
//import ZmodemAddon from '@karmada/xterm-addon-zmodem';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz recheckt the code, when submit PR, I think you can clean your code

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind of the golang code should be move to api module under the cmd folder

Signed-off-by: MdSayemkhan <sayemkhan4604@gmail.com>
Signed-off-by: MdSayemkhan <sayemkhan4604@gmail.com>
@karmada-bot karmada-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 12, 2025
Signed-off-by: MdSayemkhan <sayemkhan4604@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add web-terminal for karmada-dashboard
3 participants