six-updater-web 0.20.5 → 0.20.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/six-updater-web/app/controllers/main_controller.rb +2 -2
- data/lib/six-updater-web/app/controllers/sixconfigs_controller.rb +2 -1
- data/lib/six-updater-web/app/models/mod.rb +2 -1
- data/lib/six-updater-web/app/models/queryserver.rb +5 -0
- data/lib/six-updater-web/app/models/sixconfig.rb +25 -4
- data/lib/six-updater-web/config/six-updater-web.rb +1 -1
- data/lib/six-updater-web/db/migrate/20100715142961_add_queryserver_to_sixconfigs.rb +9 -0
- data/lib/six-updater-web/db/schema.rb +2 -1
- metadata +4 -3
data/Rakefile
CHANGED
@@ -207,8 +207,8 @@ class MainController < ApplicationController
|
|
207
207
|
if server
|
208
208
|
@msg << "Override server: <a href='/queryservers/edit/#{queryserver.id}' title='#{queryserver.mods.map{|e| e.name}.join(", ")}'>#{queryserver.to_label}</a>"
|
209
209
|
else
|
210
|
-
if preset.
|
211
|
-
server = preset.
|
210
|
+
if preset.get_server
|
211
|
+
server = preset.get_server
|
212
212
|
@msg << "Preset server: <a href='/servers/edit/#{server.id}' title='#{server.mods.map{|e| e.name}.join(", ")}'>#{server.to_label}"
|
213
213
|
end
|
214
214
|
end
|
@@ -6,6 +6,7 @@ class SixconfigsController < ApplicationController
|
|
6
6
|
config.columns = [
|
7
7
|
:name,
|
8
8
|
:mods,
|
9
|
+
:queryserver,
|
9
10
|
:server,
|
10
11
|
:appsetting,
|
11
12
|
:action,
|
@@ -22,7 +23,7 @@ class SixconfigsController < ApplicationController
|
|
22
23
|
config.create.columns.exclude :exec
|
23
24
|
|
24
25
|
|
25
|
-
[:mods, :server, :appsetting, :action].each do |c|
|
26
|
+
[:mods, :queryserver, :server, :appsetting, :action].each do |c|
|
26
27
|
config.columns[c].form_ui = :record_select
|
27
28
|
end
|
28
29
|
|
@@ -10,6 +10,7 @@ class Queryserver < ActiveRecord::Base
|
|
10
10
|
serialize :signatures, Array
|
11
11
|
|
12
12
|
has_and_belongs_to_many :mods
|
13
|
+
has_many :sixconfigs
|
13
14
|
|
14
15
|
def address
|
15
16
|
[self.ip, self.port].join(":")
|
@@ -107,6 +108,10 @@ class Queryserver < ActiveRecord::Base
|
|
107
108
|
s
|
108
109
|
end
|
109
110
|
|
111
|
+
def to_updater_yml
|
112
|
+
self.dynamic_server.to_updater_yml
|
113
|
+
end
|
114
|
+
|
110
115
|
def exec2
|
111
116
|
""
|
112
117
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class Sixconfig < ActiveRecord::Base
|
2
2
|
has_and_belongs_to_many :mods
|
3
|
+
|
4
|
+
belongs_to :queryserver
|
3
5
|
belongs_to :server
|
4
6
|
belongs_to :appsetting
|
5
7
|
belongs_to :action
|
@@ -12,13 +14,13 @@ class Sixconfig < ActiveRecord::Base
|
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
15
|
-
def all_mods(srv = self.
|
17
|
+
def all_mods(srv = self.get_server)
|
16
18
|
m = []
|
17
19
|
m += srv.mods if srv
|
18
20
|
self.mods.each { |mod| m << mod unless m.include?(mod) }
|
19
21
|
m.each {|mod| if (mod.new_record? && !mod.exists?(self.appsetting)); mod.disabled = true; end }
|
20
22
|
ms = []
|
21
|
-
m.each {|mod| ms
|
23
|
+
m.each {|mod| ms += mod.all_dependentmods; ms << mod }
|
22
24
|
ms.uniq
|
23
25
|
end
|
24
26
|
|
@@ -59,6 +61,25 @@ class Sixconfig < ActiveRecord::Base
|
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
64
|
+
|
65
|
+
def get_server
|
66
|
+
if self.queryserver.nil?
|
67
|
+
if self.server.nil?
|
68
|
+
return nil
|
69
|
+
else
|
70
|
+
begin
|
71
|
+
self.server
|
72
|
+
rescue
|
73
|
+
end
|
74
|
+
end
|
75
|
+
else
|
76
|
+
begin
|
77
|
+
self.queryserver
|
78
|
+
rescue
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
62
83
|
def auto_skip_status(setting_override = false, server_override = nil, force = false)
|
63
84
|
setting = if setting_override
|
64
85
|
setting_override
|
@@ -68,7 +89,7 @@ class Sixconfig < ActiveRecord::Base
|
|
68
89
|
srv = if server_override
|
69
90
|
server_override
|
70
91
|
else
|
71
|
-
self.
|
92
|
+
self.get_server
|
72
93
|
end
|
73
94
|
|
74
95
|
setting = Appsetting.new unless setting
|
@@ -102,7 +123,7 @@ class Sixconfig < ActiveRecord::Base
|
|
102
123
|
srv = if server_override
|
103
124
|
server_override
|
104
125
|
else
|
105
|
-
self.
|
126
|
+
self.get_server
|
106
127
|
end
|
107
128
|
|
108
129
|
setting = Appsetting.new unless setting
|
@@ -9,7 +9,7 @@
|
|
9
9
|
#
|
10
10
|
# It's strongly recommended to check this file into your version control system.
|
11
11
|
|
12
|
-
ActiveRecord::Schema.define(:version =>
|
12
|
+
ActiveRecord::Schema.define(:version => 20100715142961) do
|
13
13
|
|
14
14
|
create_table "actions", :id => false, :force => true do |t|
|
15
15
|
t.string "id", :limit => 36, :null => false
|
@@ -315,6 +315,7 @@ ActiveRecord::Schema.define(:version => 20100715142960) do
|
|
315
315
|
t.string "appsetting_id", :limit => 36
|
316
316
|
t.string "server_id", :limit => 36
|
317
317
|
t.string "action_id", :limit => 36
|
318
|
+
t.integer "queryserver_id"
|
318
319
|
end
|
319
320
|
|
320
321
|
create_table "system_settings", :force => true do |t|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 20
|
8
|
-
-
|
9
|
-
version: 0.20.
|
8
|
+
- 7
|
9
|
+
version: 0.20.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Sickboy
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-20 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -256,6 +256,7 @@ files:
|
|
256
256
|
- lib/six-updater-web/db/migrate/20100520101655_add_defaults_to_type.rb
|
257
257
|
- lib/six-updater-web/db/migrate/20100520101656_add_server_to_appsettings.rb
|
258
258
|
- lib/six-updater-web/db/migrate/20100715142960_add_beta_to_system_settings.rb
|
259
|
+
- lib/six-updater-web/db/migrate/20100715142961_add_queryserver_to_sixconfigs.rb
|
259
260
|
- lib/six-updater-web/db/schema.rb
|
260
261
|
- lib/six-updater-web/doc/README_FOR_APP
|
261
262
|
- lib/six-updater-web/init.rb
|