dsiuy42084 2019-04-21 09:38
浏览 51
已采纳

长时间运行的UI和API问题[关闭]

I have a web app that grabs an Apache 'access.conf' file from internal GitHub, and then sends it via an HTTPS type of authenticated request to our server farm in a temporary dir.

When the file gets to Server 1. A few things are done: 1. Via a script, existing access.conf is renamed to access.conf.back, and new file is moved in its place from temp to /etc/httpd/conf.d. 2. File is tested via apachectl -t 3. If the check fails, it means, a restart of apache gracefully will not succeed, therefore, do not reload, and move old file into place, and go to step 6. 5. If the check is passed, do: apachectl -k graceful 6. Go to next step for each server in list

This is all OK, but I need some direction from experienced web developers on how to show this in a nice table with a green tick mark for "good", and a red cross for "bad".

How would I go about displaying the status of the above three steps, plus the "deployment" of access.conf to the server, so that'd be three operations, "file sent," "file checked", "server restarted." This should all be in real time.

API: /deployfile/access.conf Now that's what I've been asked to do for the WebUI. I also have a ReST API which also does the deployment part. It would take the request, and do it. And store the result in a table, and return a unique transaction id.

API: /deployfile/status/id For the Status API, from above, it would display the deployment results in a JSON object taken from a transaction table.

API: /restartservices/id Finally, the restarting of Apache would also be an API, and after each restart, it would wait a few minutes for the load balancer to see that its healthy again, and then go to the next server. This would be done in another thread, as it would be time consuming.

API: /restartservices/status/id Again, display the results in JSON.

So anyhow, I am familiar with Vue, but wanted how this is done properly in the industry?

I may be over-thinking this, but better to ask.

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • douping4436 2019-04-23 17:37
    关注

    Use Server Side Events. There are many libraries for Go that do this.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 关于#java#的问题:找一份能快速看完mooc视频的代码
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄