electron使用代理_我们如何用Electron打造Rodeo

news/2024/7/10 0:51:11 标签: vue, python, java, windows server, javascript

electron使用代理

Last week we announced the release of Rodeo v1.0. The big deal was that we’d taken Rodeo from a command line, python app built using Flask, to a more legitimate looking desktop app.

上周,我们宣布发布了Rodeo v1.0 。 重要的是,我们将Rodeo从命令行(使用Flask构建的python应用程序)转移到了外观更合理的桌面应用程序中。

There were comments on reddit and twitter mentioning that it seemed like Rodeo was running it’s own browser behind the scenes–and these comments were 100% correct! That’s because Rodeo 1.0 is built with Electron, a cross-platform framework for building desktop apps with good ‘ole javascript and HTML. (check out the code on GitHub)

关于reddit和twitter的评论中提到Rodeo似乎在幕后运行它自己的浏览器-这些评论是100%正确的! 那是因为Rodeo 1.0是用Electron构建的, Electron是一个跨平台框架,用于构建具有出色的ole javascript和HTML的桌面应用程序。 ( 在GitHub上查看代码 )

To put it simply, you can build great looking windows and osx applications without mastering C# or Objective-C…with a single codebase. Sounds pretty nice, right? Want to learn more about how we did it? Keep reading!

简而言之,您可以构建美观的Windows和osx应用程序,而无需使用单个代码库掌握C#或Objective-C。 听起来不错,对吗? 想更多地了解我们是如何做到的? 继续阅读!

Our latest creation, Rodeo, is built with Electron.

我们的最新作品Rodeo是用Electron构建的。

将Rodeo带到桌面 (Taking Rodeo to the desktop)

The first version of Rodeo ran as a Flask web app with a command line client. This worked well enough, but we found that by requiring Rodeo to be used via the command line, we were instantly decreasing our addressable user-base. Not so surprising.

Rodeo的第一个版本作为带有命令行客户端的Flask Web应用程序运行。 这足够有效,但是我们发现通过要求通过命令行使用Rodeo,我们立即减少了可寻址的用户群。 并不奇怪。

As a result, we decided that we needed a desktop version of Rodeo.

结果,我们决定需要台式版的Rodeo。

对电子说“你好” (Say “Hello” to Electron)

We really didn’t want to get into the business of building a native app– especially since our users are split fairly evenly between Mac and Windows. This led us to Electron. Electron really fit the bill:

我们真的不想从事构建本机应用程序的业务-特别是因为我们的用户在Mac和Windows之间平均分配。 这导致了我们到电子 。 Electron非常适合:

  • ships with windows and mac installers
  • runs on the desktop
  • no OS specific code required
  • ✓Windows和Mac安装程序附带
  • 在桌面上运行
  • 无需特定于操作系统的代码

But the real kicker is that you can write your entire application using node.js! For Rodeo, this meant that 80% of the code from the Flask app was reusable.

但是真正的缺点是您可以使用node.js编写整个应用程序 ! 对于Rodeo而言,这意味着Flask应用程序中80%的代码是可重用的。

Under the hood, it’s our old friends HTML, CSS, and Javascript.

在后台,这是我们的老朋友HTML,CSS和Javascript。

电子做什么 (What Electron does)

Aside from distribution, Electron is doing some pretty nifty stuff. By far my favorite thing it does is that it binds node.js to the native UI. You can use things like windows, file dialogs, and Finder/Explorer all from the comfort of javascript.

除了发行外,Electron还在做一些漂亮的事情。 到目前为止,我最喜欢做的是将node.js绑定到本机UI。 您可以使用javascript轻松使用诸如windows , 文件对话框和Finder / Explorer之类的东西。

In addition to native UI components, Electron acts as your “server”. In actuality it’s a Chromium window with some magic fairy dust sprinkled on top of it. It has built in support for websocket-esque messages (ipc) so it feels a lot like building a “regular” app.

除了本机UI组件之外,Electron还充当您的“服务器”。 实际上,这是一个Chromium窗口,上面洒了一些神奇的仙尘。 它内置了对websocket式消息( ipc )的支持,因此感觉很像构建“常规”应用程序。

Lastly, and possibly most importantly, you can use node modules from within your “front-end”. So for example, if you’re adding an DOM event that will create a file, you can just use fs.writeFile instead of having to make an AJAX request to your server. In other words, you’re going to write a lot less code, and accomplish just as much!

最后,也是最重要的一点,您可以在“前端”中使用节点模块。 因此,例如,如果要添加将创建文件的DOM事件,则可以仅使用fs.writeFile而不必向服务器发出AJAX请求。 换句话说,您将编写更少的代码,并完成尽可能多的工作!

Do more by doing less.

事半功倍。

精美易用的套件 (Great, easy to use packages)

Another great part about Electron, without a doubt, is the packages that come with it. Even though it’s a relatively new project, there are already some very helpful 3rd party libraries. For instance, we’re using electron-packager to distribute OS specific executables, electron-builder to build OS specific installers, and Nuts for distribution/download management.

毫无疑问,Electron的另一个重要方面是它附带的包装。 即使这是一个相对较新的项目,也已经有一些非常有用的第三方库。 举例来说,我们使用电子打包分发操作系统特定的可执行文件, 电子制造商打造的操作系统特定的安装,以及坚果分发/下载管理。

There are tons of other great resources for getting started.

还有大量其他大量的入门资源 。

We’re using electron-builder to build windows and osx installers.

我们正在使用电子构建器来构建Windows和osx安装程序。

整理起来 (Finishing up)

翻译自: https://www.pybloggers.com/2015/10/how-we-built-rodeo-with-electron/

electron使用代理


http://www.niftyadmin.cn/n/983427.html

相关文章

HBase:HBase架构及读写流程

本篇博文从分析HBase架构开始,首先从架构中各个组成部分开始,接着从HBase写入过程角度入手,分析HFile的Compaction合并、Region的Split分裂过程及触发机制。 架构分析 1、HMaster 负责管理HBase元数据,即表的结构、表存储的Regi…

WebWork中的IOC

2019独角兽企业重金招聘Python工程师标准>>> WebWork实际上已经分出了一部分称为XWork,IOC实现在XWork中. IOC容器实现在包com.opensymphony.xwork.interceptor.component中,为了方便在XWork中扩展,它提供了ComponentManager接口,并提供了缺省实现:DefaultComponent…

TDengine在黑格智造的落地应用

作者介绍:大罗,黑格智造架构师,主要从事云原生,大数据系统开发,曾参与国家示范级工业互联网系统建设等。 做工业互联网或物联网系统,最基本的需求是展示数据曲线,比如功率曲线,类似…

TDengine容器化部署的最佳实践

作者:涛思数据|肖波 随着容器化的流行,越来越多的项目采取了容器化方案来设计架构、实施部署。 作为时序数据引擎核心的TDengine,在部署时一般建议采用FQDN(Fully Qualified Domain Name,完全限定域名)来进行节点之间…

HBase使用总结

HBase需要$JAVA_HOME配置,若在0.98.5以前,这个配置必须写在hbase-env.sh中,之后的版本会自动识别系统配置的环境变量。 开启:bin/start-hbase.sh客户端连接:bin/hbase shell创建表:create table_name, Colu…

Parquet介绍及简单使用

什么是parquet Parquet 是列式存储的一种文件类型 官网描述: Apache Parquet is a columnar storage format available to any project in the Hadoop ecosystem, regardless of the choice of data processing framework, data model or programming language 无…

浅谈.net 内存泄露和内存溢出

参考资料: 浅谈.net 内存泄露和内存溢出转载于:https://www.cnblogs.com/lihuali/p/6295870.html

Sqoop1.99.7安装、配置和使用(一)

转载请注明出处:http://blog.csdn.net/u012842205/article/details/52344196 最近被Sqoop2彻底搞蒙了,各种各样的奇怪问题,层出不穷,而且网上资料都没有针对这些问题的,官方文档也有各种各样的不完整描述。一些注意事项…