Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bsa_miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nazarf
bsa_miner
Commits
0a6218fc
Commit
0a6218fc
authored
Mar 16, 2023
by
nazarf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change path to get and update miners
parent
bf226b2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
front_controller.rb
app/controllers/front_controller.rb
+3
-5
routes.rb
config/routes.rb
+2
-2
No files found.
app/controllers/front_controller.rb
View file @
0a6218fc
...
@@ -12,11 +12,12 @@ class FrontController < ApplicationController
...
@@ -12,11 +12,12 @@ class FrontController < ApplicationController
def
update_miner_activity
def
update_miner_activity
miner
=
Miner
.
find_by
(
name:
params
[
:name
])
miner
=
Miner
.
find_by
(
name:
params
[
:name
])
miner
.
update
(
status:
'work'
)
miner
.
update
(
status:
'work'
)
render
json:
{
status:
'ok'
}
render
json:
{
status:
'ok'
}
end
end
def
miners_activity
def
miners_activity
@data
=
Miner
.
all
.
map
do
|
miner
|
miner
=
Miner
.
find_by
(
name:
params
[
:name
])
@data
=
{
{
name:
miner
.
name
,
name:
miner
.
name
,
status:
miner
.
status
,
status:
miner
.
status
,
...
@@ -33,10 +34,7 @@ class FrontController < ApplicationController
...
@@ -33,10 +34,7 @@ class FrontController < ApplicationController
password_2:
miner
.
password_2
,
password_2:
miner
.
password_2
,
algorithm_2:
miner
.
algorithm_2
algorithm_2:
miner
.
algorithm_2
}
}
end
render
json:
@data
render
json:
@data
end
end
end
end
config/routes.rb
View file @
0a6218fc
...
@@ -32,8 +32,8 @@ Rails.application.routes.draw do
...
@@ -32,8 +32,8 @@ Rails.application.routes.draw do
get
'/'
=>
'front#index'
get
'/'
=>
'front#index'
get
'pages/:id'
=>
'front#page'
,
as: :front_page
get
'pages/:id'
=>
'front#page'
,
as: :front_page
get
'/miners_activity'
,
to:
'front#miners_activity'
,
as:
'miners_activity'
get
'/miners_activity
/:name
'
,
to:
'front#miners_activity'
,
as:
'miners_activity'
get
'/update_miner_activity'
,
to:
'front#update_miner_activity'
,
as:
'update_miner_activity'
get
'/update_miner_activity
/:name
'
,
to:
'front#update_miner_activity'
,
as:
'update_miner_activity'
root
'front#index'
root
'front#index'
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment