Skip to content

Commit

Permalink
Switch all UI over to eye_ui
Browse files Browse the repository at this point in the history
  • Loading branch information
GregMefford committed Sep 3, 2018
1 parent 769f071 commit e441a85
Show file tree
Hide file tree
Showing 22 changed files with 113 additions and 4,377 deletions.
2 changes: 0 additions & 2 deletions eye/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ use Mix.Config
# config :logger, level: :info
#

config :eye, port: 4000

config :picam, camera: Picam.FakeCamera

config :logger,
Expand Down
4 changes: 1 addition & 3 deletions eye/lib/eye/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ defmodule Eye.Application do

def start(_type, _args) do
camera_module = Application.get_env(:picam, :camera, Picam.Camera)
cowboy_port = Application.get_env(:eye, :port, 80)

# List all child processes to be supervised
children = [
camera_module,
Eye.Camera,
Eye.BarcodeScanner,
Plug.Adapters.Cowboy.child_spec(:http, Eye.Router, [], [port: cowboy_port])
Eye.BarcodeScanner
]

# See https://hexdocs.pm/elixir/Supervisor.html
Expand Down
72 changes: 0 additions & 72 deletions eye/lib/eye/router.ex

This file was deleted.

5 changes: 0 additions & 5 deletions eye/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ defmodule Eye.MixProject do
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:absinthe, "~> 1.4"},
{:absinthe_plug, "~> 1.4"},
{:cowboy, "~> 1.1.2"},
{:picam, "~> 0.3.0"},
{:plug, "~> 1.6.2"},
{:poison, "~> 3.1.0"},
{:zbar, "~> 0.1.0"}
]
end
Expand Down
6 changes: 4 additions & 2 deletions eye_fw/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ config :logger, RingLogger,
level: :info,
format: "$dateT$time [$level] $message\n"

# Pull in the base configuration from the `eye_ui` application.
import_config "../../eye_ui/config/base.exs"

# Authorize the device to receive firmware using your public key.
# See https://hexdocs.pm/nerves_firmware_ssh/readme.html for more information
# on configuring nerves_firmware_ssh.
Expand Down Expand Up @@ -57,5 +60,4 @@ config :nerves_init_gadget,
# Import target specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
# Uncomment to use target specific configurations

# import_config "#{Mix.Project.config[:target]}.exs"
import_config "#{Mix.Project.config[:target]}.exs"
19 changes: 19 additions & 0 deletions eye_fw/config/host.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use Mix.Config

# Pull in the `dev` configuration from the `eye_ui` application
# when running on the `host` target.
import_config "../../eye_ui/config/dev.exs"

# Disable `:code_reloader` when running from `eye_fw` because
# it is declared as `only: :dev` in the `eye_ui` application,
# so it won't be available when `eye_ui` is added as a dependency.
config :eye_ui, EyeUiWeb.Endpoint,
code_reloader: false

config :logger,
level: :debug

config :logger, :console,
level: :debug,
format: "[$level] $message\n"

27 changes: 27 additions & 0 deletions eye_fw/config/rpi0_zbar.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use Mix.Config

# Pull in the `prod` configuration from the `eye_ui` application
# when running on the `rpi0_zbar` target.
import_config "../../eye_ui/config/prod.exs"

config :eye_ui, EyeUiWeb.Endpoint,
http: [port: 80],
url: [host: "nerves.local", port: 80],
# Start the server since we're running in a release instead of through `mix`
server: true,
# We can't easily check the origin because the host you connect to might
# end up being whatever the device's IP address is
check_origin: false,
# We don't load from system env because we bake it into the Nerves firmware either way
load_from_system_env: false

config :logger,
compile_time_purge_level: :info,
level: :info,
utc_log: true

config :logger, :console,
level: :info,
format: "$dateT$time [level=$level $metadata] $message\n",
metadata: [:module]

5 changes: 3 additions & 2 deletions eye_fw/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ defmodule EyeFw.MixProject do
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:eye, path: "../eye"},
{:eye_ui, path: "../eye_ui"},
{:nerves, "~> 1.3", runtime: false},
{:shoehorn, "~> 0.4"},
{:ring_logger, "~> 0.4"},
{:eye, path: "../eye"}
{:shoehorn, "~> 0.4"}
] ++ deps(@target)
end

Expand Down
Loading

0 comments on commit e441a85

Please sign in to comment.