six-updater-web 0.20.4 → 0.20.5
Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile
CHANGED
@@ -7,6 +7,8 @@ class RepositoriesController < ApplicationController
|
|
7
7
|
:network,
|
8
8
|
:created_at,
|
9
9
|
:updated_at,
|
10
|
+
:ping,
|
11
|
+
:tracert,
|
10
12
|
:priority,
|
11
13
|
:disabled
|
12
14
|
]
|
@@ -16,4 +18,14 @@ class RepositoriesController < ApplicationController
|
|
16
18
|
config.columns[column].inplace_edit = true
|
17
19
|
end
|
18
20
|
end
|
21
|
+
|
22
|
+
def ping
|
23
|
+
Repository.find(params[:id]).ping
|
24
|
+
render :nothing => true
|
25
|
+
end
|
26
|
+
|
27
|
+
def tracert
|
28
|
+
Repository.find(params[:id]).tracert
|
29
|
+
render :nothing => true
|
30
|
+
end
|
19
31
|
end
|
@@ -2,11 +2,23 @@ class Repository < ActiveRecord::Base
|
|
2
2
|
belongs_to :network
|
3
3
|
six_guid
|
4
4
|
|
5
|
+
def ping
|
6
|
+
SixUpdaterWeb.run_program("ping", SixUpdaterWeb::BASE_PATH, "-r 9 -n 30 -t #{self.address}")
|
7
|
+
end
|
8
|
+
|
9
|
+
def tracert
|
10
|
+
SixUpdaterWeb.run_program("tracert", SixUpdaterWeb::BASE_PATH, "-d #{self.address}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def address
|
14
|
+
self.url.sub("rsync://", "")
|
15
|
+
end
|
16
|
+
|
5
17
|
def to_label
|
6
|
-
"#{url}"
|
18
|
+
"#{self.url}"
|
7
19
|
end
|
8
20
|
|
9
21
|
def to_updater_yml
|
10
|
-
url
|
22
|
+
self.url
|
11
23
|
end
|
12
24
|
end
|