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

Servershell attr command not working #127

Closed
hasegeli opened this issue Jan 31, 2021 · 13 comments · Fixed by #133
Closed

Servershell attr command not working #127

hasegeli opened this issue Jan 31, 2021 · 13 comments · Fixed by #133
Assignees
Labels

Comments

@hasegeli
Copy link
Contributor

I wanted to give Serveradmin a try this weekend. The new interface looks neat. Good job!

I added a few attributes, servertypes, and objects. Object creating went smooth. Then I realized the "attr" command not working. Is it a known issue?

I looked at my JavaScript console, but haven't seen anything other than "Failed to load resource: the server responded with a status of 404 (Not Found) http://127.0.0.1:8000/static/js/popper.min.js.map".

This is Safari Version 14.0.2 (16610.3.7.1.9) on MacOS 11.1 here.

@kofrezo
Copy link
Contributor

kofrezo commented Jan 31, 2021

Hi Emre,

Thanks 😊.

The attr command should work. However there are some assumptions (left) which are specific to our configured servertypes and attributes.

I want to clean them up but did not have time yet or a good solution.

You could try adding the "state" attribute as this has the most hard coded dependencies.

I will check next week what the problem is here.

Thanks for your report!

@kofrezo
Copy link
Contributor

kofrezo commented Feb 1, 2021

Moin Emre,

I just tested it on my local computer. I added a few servertypes and attribute and made them visible via the Servershell attr command (see screenshot). This works for me.

What attributes and servertype do you use ?

Screenshot from 2021-02-01 09-37-51

@kofrezo kofrezo self-assigned this Feb 1, 2021
@kofrezo kofrezo added the verification Requires verification if this is a real bug or maybe just a miss configuration label Feb 1, 2021
@hasegeli
Copy link
Contributor Author

hasegeli commented Feb 1, 2021

I added an attribute typed "relation". Can you try that?

@kofrezo
Copy link
Contributor

kofrezo commented Feb 2, 2021

Screenshot from 2021-02-02 17-27-37
Screenshot from 2021-02-02 17-27-52
Screenshot from 2021-02-02 17-28-04

Works just fine for me. Do you see any difference to your setup ?

@hasegeli
Copy link
Contributor Author

hasegeli commented Feb 7, 2021

I tried exactly the same and the problem remained. I tried to find out why and noticed that there are two Javascript files named command.js. My browser is probably loading the wrong one. The problem goes away when I delete servershell/static/js/servershell/autocomplete/command.js.

@kofrezo
Copy link
Contributor

kofrezo commented Feb 8, 2021

Ah that makes sense.

I split the Javascript files up while the redesign to have an easier time for development. On the long term I wanted to have them merged and minified anyways so there it would not make a difference anymore but until then we could just rename one to a different name.

@kofrezo kofrezo added bug and removed verification Requires verification if this is a real bug or maybe just a miss configuration labels Feb 8, 2021
@kofrezo
Copy link
Contributor

kofrezo commented Feb 8, 2021

Can you please check if the linked PR fixes your problem @hasegeli ?

@hasegeli
Copy link
Contributor Author

It doesn't fix the problem. I was wrong. Though definitely it has something to do with the autocomplete. The problem goes away when the JavaScript file for autocomplete is removed.

Also, it's worth noting that not only attr but none of the commands work on my Safari. They do work on Chrome.

Can you not reproduce it on Safari?

@kofrezo
Copy link
Contributor

kofrezo commented Feb 11, 2021

Can you not reproduce it on Safari?

We have a few people working with Mac OS but I am unsure if they work with Safari - I will ask them. Otherwise I have a private Mac where I can try to reproduce it (Give me a few days).

Also, it's worth noting that not only attr but none of the commands work on my Safari. They do work on Chrome.

It is at least a bug in terms of design then. Auto completion should not break basic functionality.

@kofrezo
Copy link
Contributor

kofrezo commented Feb 19, 2021

Hey @hasegeli,

I can reproduce this now on my Mac.

The problem is with Safari that it seems not properly handle events which we use to update variables such as command, and search term. The command is just always and empty string for Safari because it never changes. I am checking why now. It works on all other Browser though Google Chrome, Opera, Safari, Firefox ...

@kofrezo
Copy link
Contributor

kofrezo commented Feb 19, 2021

Okay I found the issue. The problem is that the change event is not fired in Safari when the auto completion is enabled. If it is disabled it works just fine.

-> https://github.com/innogames/serveradmin/blob/master/serveradmin/servershell/static/js/servershell/search.js#L83

@kofrezo kofrezo linked a pull request Feb 23, 2021 that will close this issue
@kofrezo
Copy link
Contributor

kofrezo commented Feb 23, 2021

Hey @hasegeli.

I could not really find out why Safari and other browsers like Epihany do not fire or bubble up the change event for the input if the auto completion is enabled. My Fronted/Javascript knowledge is too limited for this.

However I found a work around that should work. Can you please try it out and let me know if it works for you ?

@hasegeli
Copy link
Contributor Author

Yes, it does work. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants