Closed JustArchi closed 6 years ago
@KlappPc
Thanks a lot!
There might be an issue with showing commands' responses. https://i.imgur.com/VuBlSxL.png
@Botan626 Jeha I saw that, but to lazy to parse that stuff ;->
Before ASF printed "replied to command..." stuff, which it does not anymore. So instead of giving no feedback I printed the whole response.
Maybe if I find time later on I'll change that (since removing keys does not work atm). But I don't have time for that right now.
a bit off-topic, but i just made a small python3 module to use IPC api, because building a request is always annoying, and here it is: https://github.com/deluxghost/ASF_IPC/
@JustArchi Can you get the log.txt with API?
where do i find the log from Api? - because i want to know why i get an 404 ;)
@Basdower not that I am aware of.
@Benman2785 404 means you screwed up the link. Check the wiki for correct syntax.
@KlappPc i know - but here is my problem ;)
i can do:
< body> < form action="http://IP:1242/Api/Command/status BOT" method="GET" target="output"> < input type="submit" value="status BOT" /> < /form> < iframe name="output"/> < /body>
this works - but i have to hardcode any command to the button - because if i try
< body> < form action="http://IP:1242/Api/Command" method="get" target="output"> < input type="text"><input type="submit" value="Send"> < /form> < iframe name="output"/> < /body>
it wont work - i always get 404
@Benman2785 i think you must provide a command in url
action="http://IP:1242/Api/Command"
@Benman2785
You need to append the command using javascript. The second example will append stuff as parameters, while you need it there as in your first example. Just do it without the iframe and look at the URL of the page you are getting to.
@KlappPc https://discord.gg/qb7mHwV - pls find me there ;)
@deluxghost as i did in the first try - but that is not what i want - i want a textfield where i can put my command and execute it
lets say i want to redeem a key - i simply want to copy it in the textarea and klick redeem ;)
@Benman2785 I do not have discord and I do not give private support, there are enough examples out there, to figure it out.
This can give you a hint https://www.steamgifts.com/discussion/gCxhN/archis-steam-farm-asf-steam-cards-farmer-and-much-more-windowslinuxos-x/search?page=61#Xqj47Ox But that a specialiced thing for one purpose.
thank you ;) i simply wanted to avoid javascript
Merry X-Mas // dennoch schone Weihnachten ;)
@Benman2785 Well, without javascript you page is static. And since the commands are not appended as parameter, there is no way to do that with pure html without coding one button for each command (including parameters to that command.)
Danke gleichfalls.
that was the problem i was looking a solution for now i simply use your "hint" and modify it to redirect the output into the iframe
thank you again
edit - got it - also working with all my bots (in one file) ;)
As you are working on the new IPC interface right now, how about adding more information to the response, so you do not have to parse the Result to receive the info you want?
E.g.:
curl -s -X POST -d '' "http://127.0.0.1:1242/Api/Command/redeem^%20bot%20SD,SF%20abcde-abcde-abcde%20aaaaa-aaaaa-aaaaa" | jq
{
"Message": "OK",
"Resulttext": "\n<bot> Key: abcde-abcde-abcde | Status: Fail/BadActivationCode\n<bot> Key: aaaaa-aaaaa-aaaaa | Status: Fail/BadActivationCode",
"Result": [
{
"Key": "abcde-abcde-abcde",
"Status": false,
"Statustext": "BadActivationCode",
},
{
"Key": "aaaaa-aaaaa-aaaaa",
"Status": false,
"Statustext": "BadActivationCode",
}
],
"Success": true
}
The structure is just the first I came up with. This can be improved and enhanced by missing information, e.g. bot instance. It is just meant as an idea. I think it would help GUI developers and make scripting a lot simpler. Also it would allow enhancing the response without potentially breaking current parsers.
this is my console :B https://i.imgur.com/2ZL8hof.png
@Zarat99
looks nice! maybe we can work together on the design.
@JustArchi
Happy New Year. I am back from my holiday and will work on the GUI, so its half way functional. Then I will send it to you so you can merge it into ASF. Thanks for all the new features in IPC!
@MrBurrBurr How's the GUI coming along? Wouldn't mind getting my hands on it :D
thats my ugly but working "gui"
@JourneyOver
I am working on it but I cant spend as much time on it as I would like to due to work and other projects. Maybe I should just upload the unfinished, "dirty" base GUI. That way more people could work on it together and maybe help me out.
What do you think @JustArchi?
@MrBurrBurr know how it is, as I deal with that same problem daily :x I honestly wouldn't mind it even in a "dirty" state as you put it as it's a lot better than what I'd ever be able to come up with more than likely >..<
@MrBurrBurr That's up to you, you can post it if you want more people to work on it and eventually send PR, or finish it yourself. When it comes to me I'm just waiting for somebody to send a PR and start a thing, it's natural that other people will improve it once it's merged.
@MrBurrBurr i would appreciate if you upload your "dirty" GUI i would help (if i can) to clean it ;)
I will do some final clean up and remove some of the unfinished parts (like config generator). Then I will send a PR so you can implement the basic version of the GUI. In that way we got a base where everyone else that wants to help can do so.
I guess the code will also turn from ugly into something useable once we got a base. :slightly_smiling_face:
awesome ;)
@MrBurrBurr how is cleanup going? still waiting to get my hands on your GUI xD
To be honest I am kinda stuck right now.
Clean up is almost done but my main problem right now is getting rid of all the hardcoded shit I used when the GUI was just ment for me. For example reading the config values like IPC Host and IPC Port. Right now I am not using node.js or any other manager so reading values from a JSON file is kinda dirty.
I am open to help if anyone know how to counter that problem.
@MrBurrBurr , what about a cookie ?
I managed to solve some of my problems.
Right now the code is still a mess and here and there are some bugs. Still I want to release it finally so more people can work on it and so we finally get things started.
@JustArchi I tested the GUI with the latest stable version of ASF (3.0.5.9) and it should work. Should I just upload the new files in a pull request and you will then clean everything up? The GUI folder needs to be located inside of ASF folder,
While doing the clean up I also came up with a lot of ideas for the GUI. I think we should make a list with improvements that we want to have (like you did before with issue #659).
Here are some:
@MrBurrBurr I'm not archi but I say do it! but that's just me wanting the GUI already xD
The GUI folder needs to be located inside of ASF folder
What do you mean by that? Physical location of files doesn't matter for functionality.
Just create Website
folder in main ASF directory and put all html/css/js files there (in your wanted structure), then send a PR. I'll glue it with IPC server when I find some free time.
Closed by #731
Since we have a nicely working HTTP IPC in ASF V3 now, we could make use of that fact and code a nice ASF GUI purely in html, javascript and css. IPC can easily communicate with ASF and execute commands, fetch status and expose other things over friendly HTTP interface, with all sort of needed events and stuff. Something like typical web-admin interface for a game server.
Of course, as usual I'm not interested in doing any of that myself, so I'm just putting up issue on hold in case anybody would want to make it happen. I'm too awful at html/css/js to start working on that, but I can help gluing everything together if somebody has html/css/js ready and general idea how entire thing should work/look like.