foreman_statistics 1.1.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_statistics/api/v2/statistics_controller.rb +8 -6
  3. data/app/helpers/foreman_statistics/trends_helper.rb +30 -20
  4. data/app/models/concerns/foreman_statistics/has_many_trends.rb +9 -0
  5. data/app/models/foreman_statistics/trend.rb +3 -1
  6. data/app/services/foreman_statistics/statistics/count_hosts.rb +26 -1
  7. data/app/services/foreman_statistics/statistics/count_puppet_classes.rb +1 -1
  8. data/app/services/foreman_statistics/statistics.rb +4 -2
  9. data/app/views/foreman_statistics/trends/_hosts.html.erb +1 -1
  10. data/app/views/foreman_statistics/trends/index.html.erb +0 -1
  11. data/app/views/foreman_statistics/trends/show.html.erb +6 -6
  12. data/config/jest.config.js +21 -0
  13. data/db/migrate/20210523143005_migrate_environments.rb +13 -0
  14. data/lib/foreman_statistics/engine.rb +17 -13
  15. data/lib/foreman_statistics/version.rb +1 -1
  16. data/locale/ca/LC_MESSAGES/foreman_statistics.mo +0 -0
  17. data/locale/ca/foreman_statistics.edit.po +263 -0
  18. data/locale/ca/foreman_statistics.po +202 -0
  19. data/locale/ca/foreman_statistics.po.time_stamp +0 -0
  20. data/locale/cs_CZ/LC_MESSAGES/foreman_statistics.mo +0 -0
  21. data/locale/cs_CZ/foreman_statistics.edit.po +267 -0
  22. data/locale/cs_CZ/foreman_statistics.po +206 -0
  23. data/locale/cs_CZ/foreman_statistics.po.time_stamp +0 -0
  24. data/locale/de/LC_MESSAGES/foreman_statistics.mo +0 -0
  25. data/locale/de/foreman_statistics.edit.po +271 -0
  26. data/locale/de/foreman_statistics.po +210 -0
  27. data/locale/de/foreman_statistics.po.time_stamp +0 -0
  28. data/locale/en/LC_MESSAGES/foreman_statistics.mo +0 -0
  29. data/locale/en/foreman_statistics.edit.po +1 -1
  30. data/locale/en/foreman_statistics.po +1 -1
  31. data/locale/en_GB/LC_MESSAGES/foreman_statistics.mo +0 -0
  32. data/locale/en_GB/foreman_statistics.edit.po +265 -0
  33. data/locale/en_GB/foreman_statistics.po +204 -0
  34. data/locale/en_GB/foreman_statistics.po.time_stamp +0 -0
  35. data/locale/es/LC_MESSAGES/foreman_statistics.mo +0 -0
  36. data/locale/es/foreman_statistics.edit.po +269 -0
  37. data/locale/es/foreman_statistics.po +208 -0
  38. data/locale/es/foreman_statistics.po.time_stamp +0 -0
  39. data/locale/foreman_statistics.pot +2 -2
  40. data/locale/fr/LC_MESSAGES/foreman_statistics.mo +0 -0
  41. data/locale/fr/foreman_statistics.edit.po +269 -0
  42. data/locale/fr/foreman_statistics.po +208 -0
  43. data/locale/fr/foreman_statistics.po.time_stamp +0 -0
  44. data/locale/gl/LC_MESSAGES/foreman_statistics.mo +0 -0
  45. data/locale/gl/foreman_statistics.edit.po +263 -0
  46. data/locale/gl/foreman_statistics.po +202 -0
  47. data/locale/gl/foreman_statistics.po.time_stamp +0 -0
  48. data/locale/it/LC_MESSAGES/foreman_statistics.mo +0 -0
  49. data/locale/it/foreman_statistics.edit.po +265 -0
  50. data/locale/it/foreman_statistics.po +204 -0
  51. data/locale/it/foreman_statistics.po.time_stamp +0 -0
  52. data/locale/ja/LC_MESSAGES/foreman_statistics.mo +0 -0
  53. data/locale/ja/foreman_statistics.edit.po +266 -0
  54. data/locale/ja/foreman_statistics.po +205 -0
  55. data/locale/ja/foreman_statistics.po.time_stamp +0 -0
  56. data/locale/ko/LC_MESSAGES/foreman_statistics.mo +0 -0
  57. data/locale/ko/foreman_statistics.edit.po +264 -0
  58. data/locale/ko/foreman_statistics.po +203 -0
  59. data/locale/ko/foreman_statistics.po.time_stamp +0 -0
  60. data/locale/nl_NL/LC_MESSAGES/foreman_statistics.mo +0 -0
  61. data/locale/nl_NL/foreman_statistics.edit.po +267 -0
  62. data/locale/nl_NL/foreman_statistics.po +206 -0
  63. data/locale/nl_NL/foreman_statistics.po.time_stamp +0 -0
  64. data/locale/pl/LC_MESSAGES/foreman_statistics.mo +0 -0
  65. data/locale/pl/foreman_statistics.edit.po +266 -0
  66. data/locale/pl/foreman_statistics.po +205 -0
  67. data/locale/pl/foreman_statistics.po.time_stamp +0 -0
  68. data/locale/pt_BR/LC_MESSAGES/foreman_statistics.mo +0 -0
  69. data/locale/pt_BR/foreman_statistics.edit.po +269 -0
  70. data/locale/pt_BR/foreman_statistics.po +208 -0
  71. data/locale/pt_BR/foreman_statistics.po.time_stamp +0 -0
  72. data/locale/ru/LC_MESSAGES/foreman_statistics.mo +0 -0
  73. data/locale/ru/foreman_statistics.edit.po +270 -0
  74. data/locale/ru/foreman_statistics.po +209 -0
  75. data/locale/ru/foreman_statistics.po.time_stamp +0 -0
  76. data/locale/sv_SE/LC_MESSAGES/foreman_statistics.mo +0 -0
  77. data/locale/sv_SE/foreman_statistics.edit.po +265 -0
  78. data/locale/sv_SE/foreman_statistics.po +204 -0
  79. data/locale/sv_SE/foreman_statistics.po.time_stamp +0 -0
  80. data/locale/zh_CN/LC_MESSAGES/foreman_statistics.mo +0 -0
  81. data/locale/zh_CN/foreman_statistics.edit.po +267 -0
  82. data/locale/zh_CN/foreman_statistics.po +206 -0
  83. data/locale/zh_CN/foreman_statistics.po.time_stamp +0 -0
  84. data/locale/zh_TW/LC_MESSAGES/foreman_statistics.mo +0 -0
  85. data/locale/zh_TW/foreman_statistics.edit.po +266 -0
  86. data/locale/zh_TW/foreman_statistics.po +205 -0
  87. data/locale/zh_TW/foreman_statistics.po.time_stamp +0 -0
  88. data/package.json +25 -24
  89. data/test/functional/foreman_statistics/api/v2/trends_controller_test.rb +1 -1
  90. data/test/functional/foreman_statistics/trends_controller_test.rb +0 -7
  91. data/test/unit/foreman_statistics/statistics_test.rb +24 -10
  92. data/webpack/src/Components/StatisticsChartsList/__snapshots__/StatisticsChartsList.test.js.snap +6 -0
  93. data/webpack/src/Router/StatisticsPage/__tests__/__snapshots__/StatisticsPage.test.js.snap +10 -0
  94. metadata +77 -92
  95. data/app/models/concerns/foreman_statistics/compute_resource_decorations.rb +0 -9
  96. data/app/models/concerns/foreman_statistics/environment_decorations.rb +0 -9
  97. data/app/models/concerns/foreman_statistics/general_setting_decorations.rb +0 -17
  98. data/app/models/concerns/foreman_statistics/hostgroup_decorations.rb +0 -9
  99. data/app/models/concerns/foreman_statistics/model_decorations.rb +0 -9
  100. data/app/models/concerns/foreman_statistics/operatingsystem_decorations.rb +0 -9
  101. data/app/models/concerns/foreman_statistics/setting_decorations.rb +0 -9
  102. data/webpack/__mocks__/foremanReact/API.js +0 -7
  103. data/webpack/__mocks__/foremanReact/common/HOC.js +0 -24
  104. data/webpack/__mocks__/foremanReact/common/I18n.js +0 -3
  105. data/webpack/__mocks__/foremanReact/common/helpers.js +0 -1
  106. data/webpack/__mocks__/foremanReact/common/urlHelpers.js +0 -1
  107. data/webpack/__mocks__/foremanReact/components/ChartBox/index.js +0 -2
  108. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +0 -2
  109. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalHooks.js +0 -10
  110. data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +0 -4
  111. data/webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js +0 -2
  112. data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +0 -2
  113. data/webpack/__mocks__/foremanReact/components/common/EmptyState.js +0 -5
  114. data/webpack/__mocks__/foremanReact/components/common/MessageBox.js +0 -4
  115. data/webpack/__mocks__/foremanReact/components/common/dates/LongDateTime.js +0 -5
  116. data/webpack/__mocks__/foremanReact/components/common/dates/RelativeDateTime.js +0 -3
  117. data/webpack/__mocks__/foremanReact/components/common/table/actionsHelpers/actionTypeCreator.js +0 -7
  118. data/webpack/__mocks__/foremanReact/components/common/table.js +0 -5
  119. data/webpack/__mocks__/foremanReact/constants.js +0 -24
  120. data/webpack/__mocks__/foremanReact/readme.md +0 -11
  121. data/webpack/__mocks__/foremanReact/redux/actions/toasts.js +0 -8
  122. data/webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js +0 -10
  123. data/webpack/__mocks__/foremanReact/routes/common/PageLayout/components/ExportButton/ExportButton.js +0 -5
  124. data/webpack/__mocks__/foremanReact/routes/common/reducerHOC/withDataReducer.js +0 -35
@@ -0,0 +1,266 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the foreman_statistics package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ # Translators:
7
+ # 0868a4d1af5275b3f70b0a6dac4c99a4, 2021
8
+ # ChrisLee <chris_lee@hiiir.com>, 2021
9
+ # Bryan Kearney <bryan.kearney@gmail.com>, 2021
10
+ #
11
+ msgid ""
12
+ msgstr ""
13
+ "Project-Id-Version: foreman_statistics 1.1.1\n"
14
+ "Report-Msgid-Bugs-To: \n"
15
+ "POT-Creation-Date: 2021-02-04 02:22+0100\n"
16
+ "PO-Revision-Date: 2021-02-03 22:59+0000\n"
17
+ "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2021\n"
18
+ "Language-Team: Chinese (Taiwan) (https://www.transifex.com/foreman/teams/114/z"
19
+ "h_TW/)\n"
20
+ "MIME-Version: 1.0\n"
21
+ "Content-Type: text/plain; charset=UTF-8\n"
22
+ "Content-Transfer-Encoding: 8bit\n"
23
+ "Language: zh_TW\n"
24
+ "Plural-Forms: nplurals=1; plural=0;\n"
25
+
26
+ #: ../app/controllers/foreman_statistics/api/v2/statistics_controller.rb:12
27
+ msgid "Get statistics"
28
+ msgstr "取得數據"
29
+
30
+ #: ../app/controllers/foreman_statistics/api/v2/trends_controller.rb:20
31
+ msgid "List of trends counters"
32
+ msgstr ""
33
+
34
+ #: ../app/controllers/foreman_statistics/api/v2/trends_controller.rb:25
35
+ msgid "Show a trend"
36
+ msgstr ""
37
+
38
+ #: ../app/controllers/foreman_statistics/api/v2/trends_controller.rb:29
39
+ msgid "Create a trend counter"
40
+ msgstr ""
41
+
42
+ #: ../app/controllers/foreman_statistics/api/v2/trends_controller.rb:42
43
+ msgid "Delete a trend counter"
44
+ msgstr ""
45
+
46
+ #: ../app/helpers/foreman_statistics/trends_helper.rb:6
47
+ msgid "Environment"
48
+ msgstr "環境"
49
+
50
+ #: ../app/helpers/foreman_statistics/trends_helper.rb:6
51
+ msgid "Operating system"
52
+ msgstr "作業系統"
53
+
54
+ #: ../app/helpers/foreman_statistics/trends_helper.rb:7
55
+ msgid "Model"
56
+ msgstr "型號"
57
+
58
+ #: ../app/helpers/foreman_statistics/trends_helper.rb:7
59
+ msgid "Facts"
60
+ msgstr "詳情"
61
+
62
+ #: ../app/helpers/foreman_statistics/trends_helper.rb:7
63
+ msgid "Host group"
64
+ msgstr "主機群組"
65
+
66
+ #: ../app/helpers/foreman_statistics/trends_helper.rb:7
67
+ msgid "Compute resource"
68
+ msgstr "運算設定檔"
69
+
70
+ #: ../app/helpers/foreman_statistics/trends_helper.rb:14
71
+ msgid "Trend of the last %s days."
72
+ msgstr "最後 %s 天的趨勢。"
73
+
74
+ #: ../app/jobs/foreman_statistics/trend_counter_job.rb:20
75
+ msgid "Trend Counter Job"
76
+ msgstr ""
77
+
78
+ #: ../app/models/concerns/foreman_statistics/general_setting_decorations.rb:12
79
+ msgid "Max days for Trends graphs"
80
+ msgstr "趨勢圖表的最大天數"
81
+
82
+ #: ../app/models/concerns/foreman_statistics/general_setting_decorations.rb:12
83
+ msgid "Max trends"
84
+ msgstr "最大趨勢"
85
+
86
+ #: ../app/services/foreman_statistics/statistics.rb:6
87
+ msgid "Architecture Distribution"
88
+ msgstr "架構發佈"
89
+
90
+ #: ../app/services/foreman_statistics/statistics.rb:7
91
+ msgid "Environment Distribution"
92
+ msgstr ""
93
+
94
+ #: ../app/services/foreman_statistics/statistics.rb:8
95
+ msgid "Host Group Distribution"
96
+ msgstr ""
97
+
98
+ #: ../app/services/foreman_statistics/statistics.rb:9
99
+ msgid "Compute Resource Distribution"
100
+ msgstr ""
101
+
102
+ #: ../app/services/foreman_statistics/statistics.rb:10
103
+ msgid "Number of CPUs"
104
+ msgstr "CPU 數量"
105
+
106
+ #: ../app/services/foreman_statistics/statistics.rb:11
107
+ msgid "Hardware"
108
+ msgstr "硬體"
109
+
110
+ #: ../app/services/foreman_statistics/statistics.rb:12
111
+ msgid "Average Memory Usage"
112
+ msgstr ""
113
+
114
+ #: ../app/services/foreman_statistics/statistics.rb:13
115
+ msgid "Average Swap Usage"
116
+ msgstr ""
117
+
118
+ #: ../app/services/foreman_statistics/statistics.rb:14
119
+ msgid "Class Distribution"
120
+ msgstr "類別發佈"
121
+
122
+ #: ../app/services/foreman_statistics/statistics.rb:15
123
+ msgid "Location Distribution"
124
+ msgstr ""
125
+
126
+ #: ../app/services/foreman_statistics/statistics.rb:16
127
+ msgid "Organization Distribution"
128
+ msgstr ""
129
+
130
+ #: ../app/services/foreman_statistics/statistics/count_numerical_fact_pair.rb:22
131
+ msgid "free memory"
132
+ msgstr "可用記憶體"
133
+
134
+ #: ../app/services/foreman_statistics/statistics/count_numerical_fact_pair.rb:26
135
+ msgid "used memory"
136
+ msgstr "已使用的記憶體"
137
+
138
+ #: ../app/views/foreman_statistics/trends/_empty_data.html.erb:1 ../app/views/foreman_statistics/trends/show.html.erb:2
139
+ msgid "Trends for %s"
140
+ msgstr "%s 的趨勢"
141
+
142
+ #: ../app/views/foreman_statistics/trends/_empty_data.html.erb:4
143
+ msgid "No data for this trend."
144
+ msgstr "此趨勢無資料。"
145
+
146
+ #: ../app/views/foreman_statistics/trends/_form.html.erb:4
147
+ msgid "Please Select"
148
+ msgstr "請選擇"
149
+
150
+ #: ../app/views/foreman_statistics/trends/_hosts.html.erb:7
151
+ msgid "Show Host"
152
+ msgstr "顯示主機"
153
+
154
+ #: ../app/views/foreman_statistics/trends/edit.html.erb:1
155
+ msgid "Edit Trend %s"
156
+ msgstr "編輯趨勢 %s"
157
+
158
+ #: ../app/views/foreman_statistics/trends/edit.html.erb:8
159
+ msgid "Fact Name"
160
+ msgstr "詳情名稱"
161
+
162
+ #: ../app/views/foreman_statistics/trends/edit.html.erb:9 ../app/views/foreman_statistics/trends/edit.html.erb:30
163
+ msgid "Display Name"
164
+ msgstr "顯示名稱"
165
+
166
+ #: ../app/views/foreman_statistics/trends/edit.html.erb:43
167
+ msgid "Cancel"
168
+ msgstr "取消"
169
+
170
+ #: ../app/views/foreman_statistics/trends/edit.html.erb:44
171
+ msgid "Submit"
172
+ msgstr "提交"
173
+
174
+ #: ../app/views/foreman_statistics/trends/index.html.erb:2 ../app/views/foreman_statistics/trends/welcome.html.erb:1 ../app/views/foreman_statistics/trends/welcome.html.erb:6 ../lib/foreman_statistics/engine.rb:63
175
+ msgid "Trends"
176
+ msgstr "趨勢"
177
+
178
+ #: ../app/views/foreman_statistics/trends/index.html.erb:3 ../app/views/foreman_statistics/trends/welcome.html.erb:10
179
+ msgid "Add Trend Counter"
180
+ msgstr "新增趨勢計數器"
181
+
182
+ #: ../app/views/foreman_statistics/trends/index.html.erb:9
183
+ msgid "Name"
184
+ msgstr "名稱"
185
+
186
+ #: ../app/views/foreman_statistics/trends/index.html.erb:10
187
+ msgid "Action"
188
+ msgstr "動作"
189
+
190
+ #: ../app/views/foreman_statistics/trends/index.html.erb:16
191
+ msgid "Show Trends"
192
+ msgstr "顯示趨勢"
193
+
194
+ #: ../app/views/foreman_statistics/trends/index.html.erb:19
195
+ msgid "Edit"
196
+ msgstr "編輯"
197
+
198
+ #: ../app/views/foreman_statistics/trends/index.html.erb:20
199
+ msgid "Delete all the trend history for %s?"
200
+ msgstr "是否要刪除 %s 的所有趨勢記錄?"
201
+
202
+ #: ../app/views/foreman_statistics/trends/index.html.erb:28
203
+ msgid "Last update:"
204
+ msgstr ""
205
+
206
+ #: ../app/views/foreman_statistics/trends/new.html.erb:1
207
+ msgid "Create Trend"
208
+ msgstr ""
209
+
210
+ #: ../app/views/foreman_statistics/trends/show.html.erb:7
211
+ msgid "last %s day"
212
+ msgid_plural "last %s days"
213
+ msgstr[0] ""
214
+ msgstr[1] ""
215
+
216
+ #: ../app/views/foreman_statistics/trends/show.html.erb:8
217
+ msgid "Number of Hosts"
218
+ msgstr "主機數量"
219
+
220
+ #: ../app/views/foreman_statistics/trends/show.html.erb:16
221
+ msgid "Hosts"
222
+ msgstr "主機"
223
+
224
+ #: ../app/views/foreman_statistics/trends/welcome.html.erb:7
225
+ msgid "Trends in Foreman allow you to track changes in your infrastructure over time. It allows you to track both Foreman related information and to any fact. The Trend pages give a graph of how the number of hosts with that value have changed over time, and list the current hosts."
226
+ msgstr ""
227
+
228
+ #: ../app/views/foreman_statistics/trends/welcome.html.erb:8
229
+ msgid "Learn more about this in the documentation."
230
+ msgstr "欲知更多,請參閱文件。"
231
+
232
+ #: ../lib/foreman_statistics/engine.rb:69 ../webpack/src/Router/StatisticsPage/StatisticsPage.js:8
233
+ msgid "Statistics"
234
+ msgstr "數據"
235
+
236
+ #: ../webpack/src/Components/StatisticsChartsList/index.js:14
237
+ msgid "No data available"
238
+ msgstr ""
239
+
240
+ #: ../webpack/src/Components/StatisticsChartsList/index.js:15
241
+ msgid "Expand the chart"
242
+ msgstr "展開圖表"
243
+
244
+ #: ../webpack/src/Router/StatisticsPage/Statistics/Statistics.js:13
245
+ msgid "No Charts To Load"
246
+ msgstr ""
247
+
248
+ #: action_names.rb:2
249
+ msgid "Action with sub plans"
250
+ msgstr "有子計畫的動作"
251
+
252
+ #: action_names.rb:3
253
+ msgid "Import facts"
254
+ msgstr "匯入詳情"
255
+
256
+ #: action_names.rb:4
257
+ msgid "Import Puppet classes"
258
+ msgstr "匯入 Puppet 類別"
259
+
260
+ #: action_names.rb:5
261
+ msgid "Remote action:"
262
+ msgstr "遠端動作:"
263
+
264
+ #: gemspec.rb:2
265
+ msgid "Statistics and Trends for Foreman gives users overview of their infrastructure."
266
+ msgstr ""
@@ -0,0 +1,205 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the foreman_statistics package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ # Translators:
7
+ # 0868a4d1af5275b3f70b0a6dac4c99a4, 2021
8
+ # ChrisLee <chris_lee@hiiir.com>, 2021
9
+ # Bryan Kearney <bryan.kearney@gmail.com>, 2021
10
+ #
11
+ msgid ""
12
+ msgstr ""
13
+ "Project-Id-Version: foreman_statistics 1.1.1\n"
14
+ "Report-Msgid-Bugs-To: \n"
15
+ "PO-Revision-Date: 2021-02-03 22:59+0000\n"
16
+ "Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2021\n"
17
+ "Language-Team: Chinese (Taiwan) (https://www.transifex.com/foreman/teams/114/z"
18
+ "h_TW/)\n"
19
+ "MIME-Version: 1.0\n"
20
+ "Content-Type: text/plain; charset=UTF-8\n"
21
+ "Content-Transfer-Encoding: 8bit\n"
22
+ "Language: zh_TW\n"
23
+ "Plural-Forms: nplurals=1; plural=0;\n"
24
+
25
+ msgid "Action"
26
+ msgstr "動作"
27
+
28
+ msgid "Action with sub plans"
29
+ msgstr "有子計畫的動作"
30
+
31
+ msgid "Add Trend Counter"
32
+ msgstr "新增趨勢計數器"
33
+
34
+ msgid "Architecture Distribution"
35
+ msgstr "架構發佈"
36
+
37
+ msgid "Average Memory Usage"
38
+ msgstr ""
39
+
40
+ msgid "Average Swap Usage"
41
+ msgstr ""
42
+
43
+ msgid "Cancel"
44
+ msgstr "取消"
45
+
46
+ msgid "Class Distribution"
47
+ msgstr "類別發佈"
48
+
49
+ msgid "Compute Resource Distribution"
50
+ msgstr ""
51
+
52
+ msgid "Compute resource"
53
+ msgstr "運算設定檔"
54
+
55
+ msgid "Create Trend"
56
+ msgstr ""
57
+
58
+ msgid "Create a trend counter"
59
+ msgstr ""
60
+
61
+ msgid "Delete a trend counter"
62
+ msgstr ""
63
+
64
+ msgid "Delete all the trend history for %s?"
65
+ msgstr "是否要刪除 %s 的所有趨勢記錄?"
66
+
67
+ msgid "Display Name"
68
+ msgstr "顯示名稱"
69
+
70
+ msgid "Edit"
71
+ msgstr "編輯"
72
+
73
+ msgid "Edit Trend %s"
74
+ msgstr "編輯趨勢 %s"
75
+
76
+ msgid "Environment"
77
+ msgstr "環境"
78
+
79
+ msgid "Environment Distribution"
80
+ msgstr ""
81
+
82
+ msgid "Expand the chart"
83
+ msgstr "展開圖表"
84
+
85
+ msgid "Fact Name"
86
+ msgstr "詳情名稱"
87
+
88
+ msgid "Facts"
89
+ msgstr "詳情"
90
+
91
+ msgid "Get statistics"
92
+ msgstr "取得數據"
93
+
94
+ msgid "Hardware"
95
+ msgstr "硬體"
96
+
97
+ msgid "Host Group Distribution"
98
+ msgstr ""
99
+
100
+ msgid "Host group"
101
+ msgstr "主機群組"
102
+
103
+ msgid "Hosts"
104
+ msgstr "主機"
105
+
106
+ msgid "Import Puppet classes"
107
+ msgstr "匯入 Puppet 類別"
108
+
109
+ msgid "Import facts"
110
+ msgstr "匯入詳情"
111
+
112
+ msgid "Last update:"
113
+ msgstr ""
114
+
115
+ msgid "Learn more about this in the documentation."
116
+ msgstr "欲知更多,請參閱文件。"
117
+
118
+ msgid "List of trends counters"
119
+ msgstr ""
120
+
121
+ msgid "Location Distribution"
122
+ msgstr ""
123
+
124
+ msgid "Max days for Trends graphs"
125
+ msgstr "趨勢圖表的最大天數"
126
+
127
+ msgid "Max trends"
128
+ msgstr "最大趨勢"
129
+
130
+ msgid "Model"
131
+ msgstr "型號"
132
+
133
+ msgid "Name"
134
+ msgstr "名稱"
135
+
136
+ msgid "No Charts To Load"
137
+ msgstr ""
138
+
139
+ msgid "No data available"
140
+ msgstr ""
141
+
142
+ msgid "No data for this trend."
143
+ msgstr "此趨勢無資料。"
144
+
145
+ msgid "Number of CPUs"
146
+ msgstr "CPU 數量"
147
+
148
+ msgid "Number of Hosts"
149
+ msgstr "主機數量"
150
+
151
+ msgid "Operating system"
152
+ msgstr "作業系統"
153
+
154
+ msgid "Organization Distribution"
155
+ msgstr ""
156
+
157
+ msgid "Please Select"
158
+ msgstr "請選擇"
159
+
160
+ msgid "Remote action:"
161
+ msgstr "遠端動作:"
162
+
163
+ msgid "Show Host"
164
+ msgstr "顯示主機"
165
+
166
+ msgid "Show Trends"
167
+ msgstr "顯示趨勢"
168
+
169
+ msgid "Show a trend"
170
+ msgstr ""
171
+
172
+ msgid "Statistics"
173
+ msgstr "數據"
174
+
175
+ msgid "Statistics and Trends for Foreman gives users overview of their infrastructure."
176
+ msgstr ""
177
+
178
+ msgid "Submit"
179
+ msgstr "提交"
180
+
181
+ msgid "Trend Counter Job"
182
+ msgstr ""
183
+
184
+ msgid "Trend of the last %s days."
185
+ msgstr "最後 %s 天的趨勢。"
186
+
187
+ msgid "Trends"
188
+ msgstr "趨勢"
189
+
190
+ msgid "Trends for %s"
191
+ msgstr "%s 的趨勢"
192
+
193
+ msgid "Trends in Foreman allow you to track changes in your infrastructure over time. It allows you to track both Foreman related information and to any fact. The Trend pages give a graph of how the number of hosts with that value have changed over time, and list the current hosts."
194
+ msgstr ""
195
+
196
+ msgid "free memory"
197
+ msgstr "可用記憶體"
198
+
199
+ msgid "last %s day"
200
+ msgid_plural "last %s days"
201
+ msgstr[0] ""
202
+ msgstr[1] ""
203
+
204
+ msgid "used memory"
205
+ msgstr "已使用的記憶體"
File without changes
data/package.json CHANGED
@@ -3,40 +3,41 @@
3
3
  "version": "1.0.0",
4
4
  "description": "DESCRIPTION",
5
5
  "main": "index.js",
6
- "scripts": {
7
- "lint": "tfm-lint --plugin -d /webpack",
8
- "test": "tfm-test --plugin",
9
- "test:watch": "tfm-test --plugin --watchAll",
10
- "test:current": "tfm-test --plugin --watch",
11
- "publish-coverage": "tfm-publish-coverage",
12
- "stories": "tfm-stories --plugin",
13
- "stories:build": "tfm-build-stories --plugin",
14
- "create-react-component": "yo react-domain"
15
- },
16
- "repository": {
17
- "type": "git",
18
- "url": "git+https://github.com/theforeman/foreman_statistics.git"
19
- },
20
6
  "bugs": {
21
7
  "url": "http://projects.theforeman.org/projects/foreman_statistics/issues"
22
8
  },
23
9
  "peerDependencies": {
24
- "@theforeman/vendor": ">= 4.0.2"
25
- },
26
- "dependencies": {
27
- "react-intl": "^2.8.0"
10
+ "@theforeman/vendor": ">= 6.0.0"
28
11
  },
29
12
  "devDependencies": {
30
13
  "@babel/core": "^7.7.0",
31
- "@theforeman/builder": "^4.0.2",
32
- "@theforeman/eslint-plugin-foreman": "4.0.5",
33
- "@theforeman/stories": "^4.0.2",
34
- "@theforeman/test": "^4.0.2",
35
- "@theforeman/vendor-dev": "^4.0.2",
14
+ "@theforeman/builder": "^8.4.1",
15
+ "@theforeman/eslint-plugin-foreman": "^8.4.1",
16
+ "@theforeman/find-foreman": "^8.4.1",
17
+ "@theforeman/stories": "^8.4.1",
18
+ "@theforeman/test": "^8.4.1",
19
+ "@theforeman/vendor-dev": "^8.4.1",
36
20
  "babel-eslint": "^10.0.3",
37
21
  "eslint": "^6.7.2",
38
- "prettier": "^1.13.5",
22
+ "prettier": "^1.19.1",
39
23
  "stylelint-config-standard": "^18.0.0",
40
24
  "stylelint": "^9.3.0"
25
+ },
26
+ "dependencies": {
27
+ "react-intl": "^2.8.0"
28
+ },
29
+ "scripts": {
30
+ "lint": "tfm-lint --plugin -d /webpack",
31
+ "test": "tfm-test --plugin --config config/jest.config.js",
32
+ "test:watch": "tfm-test --plugin --config config/jest.config.js --watchAll",
33
+ "test:current": "tfm-test --plugin --config config/jest.config.js --watch",
34
+ "publish-coverage": "tfm-publish-coverage",
35
+ "stories": "tfm-stories --plugin",
36
+ "stories:build": "tfm-build-stories --plugin",
37
+ "create-react-component": "yo react-domain"
38
+ },
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/theforeman/foreman_statistics.git"
41
42
  }
42
43
  }
@@ -9,7 +9,7 @@ class ForemanStatistics::Api::V2::TrendsControllerTest < ActionController::TestC
9
9
  end
10
10
 
11
11
  let(:host) { FactoryBot.create(:host) }
12
- let(:foreman_trend) { FactoryBot.create(:foreman_statistics_foreman_trend, :trendable_type => 'Environment', :fact_name => 'fact') }
12
+ let(:foreman_trend) { FactoryBot.create(:foreman_statistics_foreman_trend, :trendable_type => 'Operatingsystem', :fact_name => 'fact') }
13
13
  let(:fact_trend) { FactoryBot.create(:foreman_statistics_fact_trend, :trendable_type => 'FactName') }
14
14
  let(:os_fact) do
15
15
  FactoryBot.create(:fact_value, :value => 'fedora', :host => host,
@@ -4,7 +4,6 @@ module ForemanStatistics
4
4
  class TrendsControllerTest < ActionController::TestCase
5
5
  setup do
6
6
  @routes = ForemanStatistics::Engine.routes
7
- Setting::General.create(:name => 'max_trend', :default => 30, :description => 'Max days for Trends graphs')
8
7
  end
9
8
 
10
9
  let(:os_trend) { FactoryBot.create(:foreman_statistics_trend_os) }
@@ -50,12 +49,6 @@ module ForemanStatistics
50
49
  assert_equal entries_per_page, per_page_results
51
50
  end
52
51
 
53
- test 'should render per page dropdown with correct values' do
54
- get :index, params: { per_page: entries_per_page + 1 }, session: set_session_user
55
- assert_response :success
56
- assert_not_nil response.body['perPageOptions&quot;:[5,6,10,15,25,50]']
57
- end
58
-
59
52
  test 'sort links should include per page param' do
60
53
  get :index, params: { per_page: entries_per_page + 1 }, session: set_session_user
61
54
  assert_response :success
@@ -50,19 +50,33 @@ module ForemanStatistics
50
50
  assert_kind_of Array, stat.calculate
51
51
  end
52
52
 
53
- test 'it should initialize a host counter statistics object' do
54
- stat = Statistics::CountHosts.new(:count_by => :compute_resource)
55
- assert_kind_of Array, stat.calculate
56
- end
53
+ describe 'CountHosts' do
54
+ test 'initializes a host counter statistics object' do
55
+ stat = Statistics::CountHosts.new(:count_by => :compute_resource)
56
+ assert_kind_of Array, stat.calculate
57
+ end
57
58
 
58
- test 'it should fail to calculate a puppet class counter statistics object without an id' do
59
- assert_raise(ArgumentError) { Statistics::CountPuppetClasses.new }
59
+ test 'calculates stats by given metric' do
60
+ host = FactoryBot.create(:host, :with_operatingsystem)
61
+ stat = Statistics::CountHosts.new(count_by: :operatingsystem, title: 'OS Distribution').calculate
62
+ _(stat).must_be_instance_of(Array)
63
+ _(stat.first[:data]).must_equal(1)
64
+ _(stat.first[:label]).must_equal(host.operatingsystem.to_label)
65
+ end
60
66
  end
61
67
 
62
- test 'it should initialize a puppet class counter statistics object' do
63
- stat = Statistics::CountPuppetClasses.new(:id => :classes)
64
- assert_equal '/foreman_statistics/statistics/classes', stat.url
65
- assert_kind_of Array, stat.calculate
68
+ context 'with puppet plugin' do
69
+ test 'it should fail to calculate a puppet class counter statistics object without an id' do
70
+ skip('no puppet plugin') unless Foreman::Plugin.find(:foreman_puppet)
71
+ assert_raise(ArgumentError) { Statistics::CountPuppetClasses.new }
72
+ end
73
+
74
+ test 'it should initialize a puppet class counter statistics object' do
75
+ skip('no puppet plugin') unless Foreman::Plugin.find(:foreman_puppet)
76
+ stat = Statistics::CountPuppetClasses.new(:id => :classes)
77
+ assert_equal '/foreman_statistics/statistics/classes', stat.url
78
+ assert_kind_of Array, stat.calculate
79
+ end
66
80
  end
67
81
 
68
82
  test 'it should fail to calculate a Fact class counter statistics object without count_by' do
@@ -19,6 +19,9 @@ exports[`StatisticsChartsList rendering should render two panels for fixtures da
19
19
  "url": "statistics/operatingsystem",
20
20
  }
21
21
  }
22
+ className=""
23
+ config="regular"
24
+ errorText=""
22
25
  key="operatingsystem"
23
26
  noDataMsg="No data available"
24
27
  tip="Expand the chart"
@@ -33,6 +36,9 @@ exports[`StatisticsChartsList rendering should render two panels for fixtures da
33
36
  "url": "statistics/architecture",
34
37
  }
35
38
  }
39
+ className=""
40
+ config="regular"
41
+ errorText=""
36
42
  key="architecture"
37
43
  noDataMsg="No data available"
38
44
  tip="Expand the chart"
@@ -2,8 +2,18 @@
2
2
 
3
3
  exports[`StatisticsPage rendering render with props 1`] = `
4
4
  <PageLayout
5
+ beforeToolbarComponent={null}
6
+ breadcrumbOptions={null}
7
+ customBreadcrumbs={null}
5
8
  header="Statistics"
9
+ isLoading={false}
10
+ onBookmarkClick={[Function]}
11
+ onSearch={[Function]}
12
+ searchProps={Object {}}
13
+ searchQuery=""
6
14
  searchable={false}
15
+ toastNotifications={Array []}
16
+ toolbarButtons={null}
7
17
  >
8
18
  <Component
9
19
  getStatisticsMeta={[Function]}