cmdbox 0.5.3__py3-none-any.whl → 0.5.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cmdbox might be problematic. Click here for more details.
- cmdbox/app/feature.py +2 -0
- cmdbox/app/features/cli/audit_base.py +1 -1
- cmdbox/app/features/cli/cmdbox_audit_createdb.py +1 -1
- cmdbox/app/features/cli/cmdbox_audit_write.py +4 -0
- cmdbox/app/features/cli/cmdbox_client_file_copy.py +1 -1
- cmdbox/app/features/cli/cmdbox_client_file_download.py +1 -1
- cmdbox/app/features/cli/cmdbox_client_file_list.py +1 -1
- cmdbox/app/features/cli/cmdbox_client_file_mkdir.py +1 -1
- cmdbox/app/features/cli/cmdbox_client_file_move.py +1 -1
- cmdbox/app/features/cli/cmdbox_client_file_remove.py +1 -1
- cmdbox/app/features/cli/cmdbox_client_file_rmdir.py +1 -1
- cmdbox/app/features/cli/cmdbox_client_file_upload.py +1 -1
- cmdbox/app/features/cli/cmdbox_client_server_info.py +1 -1
- cmdbox/app/features/cli/cmdbox_gui_start.py +1 -1
- cmdbox/app/features/cli/cmdbox_server_start.py +1 -1
- cmdbox/app/features/cli/cmdbox_server_stop.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_apikey_add.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_apikey_del.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_group_add.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_group_del.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_group_edit.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_group_list.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_start.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_user_add.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_user_del.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_user_edit.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_user_list.py +1 -1
- cmdbox/app/features/web/cmdbox_web_audit.py +7 -1
- cmdbox/app/features/web/cmdbox_web_exec_cmd.py +2 -2
- cmdbox/app/options.py +9 -0
- cmdbox/app/server.py +15 -3
- cmdbox/extensions/features.yml +4 -4
- cmdbox/extensions/sample_project/sample/app/features/cli/sample_server_time.py +1 -1
- cmdbox/licenses/LICENSE.Jinja2.3.1.4(BSD License).txt +28 -0
- cmdbox/licenses/LICENSE.Pygments.2.18.0(BSD License).txt +25 -0
- cmdbox/licenses/LICENSE.Sphinx.8.1.3(BSD License).txt +31 -0
- cmdbox/licenses/LICENSE.anyio.4.6.2.post1(MIT License).txt +20 -0
- cmdbox/licenses/LICENSE.argcomplete.3.5.1(Apache Software License).txt +177 -0
- cmdbox/licenses/LICENSE.babel.2.16.0(BSD License).txt +27 -0
- cmdbox/licenses/LICENSE.certifi.2024.8.30(Mozilla Public License 2.0 (MPL 2.0)).txt +20 -0
- cmdbox/licenses/LICENSE.charset-normalizer.3.4.0(MIT License).txt +21 -0
- cmdbox/licenses/LICENSE.click.8.1.7(BSD License).txt +28 -0
- cmdbox/licenses/LICENSE.cryptography.43.0.3(Apache Software License; BSD License).txt +3 -0
- cmdbox/licenses/LICENSE.fastapi.0.115.5(MIT License).txt +21 -0
- cmdbox/licenses/LICENSE.importlib_metadata.8.5.0(Apache Software License).txt +202 -0
- cmdbox/licenses/LICENSE.keyring.25.5.0(MIT License).txt +17 -0
- cmdbox/licenses/LICENSE.more-itertools.10.5.0(MIT License).txt +19 -0
- cmdbox/licenses/LICENSE.nh3.0.2.18(MIT).txt +1 -0
- cmdbox/licenses/LICENSE.numpy.2.1.3(BSD License).txt +950 -0
- cmdbox/licenses/LICENSE.pillow.11.0.0(CMU License (MIT-CMU)).txt +1226 -0
- cmdbox/licenses/LICENSE.pkginfo.1.10.0(MIT License).txt +21 -0
- cmdbox/licenses/LICENSE.prettytable.3.12.0(BSD License).txt +30 -0
- cmdbox/licenses/LICENSE.pydantic.2.10.2(MIT License).txt +21 -0
- cmdbox/licenses/LICENSE.pydantic_core.2.27.1(MIT License).txt +21 -0
- cmdbox/licenses/LICENSE.python-dotenv.1.0.1(BSD License).txt +27 -0
- cmdbox/licenses/LICENSE.python-multipart.0.0.17(Apache Software License).txt +14 -0
- cmdbox/licenses/LICENSE.redis.5.2.0(MIT License).txt +21 -0
- cmdbox/licenses/LICENSE.rich.13.9.4(MIT License).txt +19 -0
- cmdbox/licenses/LICENSE.six.1.16.0(MIT License).txt +18 -0
- cmdbox/licenses/LICENSE.sphinx-intl.2.3.0(BSD License).txt +25 -0
- cmdbox/licenses/LICENSE.starlette.0.41.3(BSD License).txt +27 -0
- cmdbox/licenses/LICENSE.tomli.2.1.0(MIT License).txt +21 -0
- cmdbox/licenses/LICENSE.twine.5.1.1(Apache Software License).txt +174 -0
- cmdbox/licenses/LICENSE.typing_extensions.4.12.2(Python Software Foundation License).txt +279 -0
- cmdbox/licenses/LICENSE.urllib3.2.2.3(MIT License).txt +21 -0
- cmdbox/licenses/LICENSE.uvicorn.0.32.1(BSD License).txt +27 -0
- cmdbox/licenses/LICENSE.watchfiles.1.0.0(MIT License).txt +21 -0
- cmdbox/licenses/LICENSE.websockets.14.1(BSD License).txt +24 -0
- cmdbox/licenses/LICENSE.zope.interface.7.1.1(Zope Public License).txt +44 -0
- cmdbox/version.py +1 -1
- cmdbox/web/assets/cmdbox/audit.js +98 -34
- cmdbox/web/audit.html +69 -44
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.3.1.dist-info}/METADATA +6 -6
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.3.1.dist-info}/RECORD +78 -42
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.3.1.dist-info}/LICENSE +0 -0
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.3.1.dist-info}/WHEEL +0 -0
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.3.1.dist-info}/entry_points.txt +0 -0
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.3.1.dist-info}/top_level.txt +0 -0
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
const audit = {};
|
|
2
2
|
// 監査ログ一覧
|
|
3
3
|
audit.rawlog = async () => {
|
|
4
|
-
const
|
|
4
|
+
const modal = $('#search_modal');
|
|
5
5
|
const rawlog_area = $('#rawlog_area').html('');
|
|
6
|
-
const [title, opt] = cmdbox.get_param(
|
|
6
|
+
const [title, opt] = cmdbox.get_param(modal);
|
|
7
7
|
cmdbox.show_loading();
|
|
8
8
|
const data = await audit.query(opt);
|
|
9
9
|
if (!data) {
|
|
10
10
|
cmdbox.hide_loading();
|
|
11
|
+
modal.modal('hide');
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
audit.tracelog(JSON.parse(JSON.stringify(data)));
|
|
15
|
+
data.forEach((row) => {
|
|
16
|
+
if (row['clmsg_id']) {
|
|
17
|
+
row['clmsg_id'] = `<a href="#" data-id="${row['clmsg_id']}" onclick="audit.clmsg_id_click_func(this);">${row['clmsg_id']}</a>`;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
render_result_func(rawlog_area, data, 110);
|
|
15
21
|
await audit.metrics();
|
|
22
|
+
modal.modal('hide');
|
|
16
23
|
cmdbox.hide_loading();
|
|
17
24
|
};
|
|
25
|
+
// 監査ログのclmsg_idをクリックしたときの処理
|
|
26
|
+
audit.clmsg_id_click_func = (elem) => {
|
|
27
|
+
const clmsg_id = $(elem).attr('data-id');
|
|
28
|
+
const area = $(`#trace_area`);
|
|
29
|
+
const trace_tab = document.querySelector('#main_tabs #trace-tab')
|
|
30
|
+
bootstrap.Tab.getOrCreateInstance(trace_tab).show()
|
|
31
|
+
area.animate({scrollTop: $(`#${clmsg_id}`).offset().top - area.offset().top + area.scrollTop()}, 500);
|
|
32
|
+
};
|
|
18
33
|
// 監査ログのトレース
|
|
19
34
|
audit.tracelog = async (data) => {
|
|
20
35
|
const rawlog_area = $('#trace_area').html('');
|
|
@@ -45,7 +60,7 @@ audit.tracelog = async (data) => {
|
|
|
45
60
|
}).forEach((attr, i) => {
|
|
46
61
|
const tr = $('<tr></tr>').appendTo(table_body);
|
|
47
62
|
$(`<td>${attr['clmsg_user']}</td>`).appendTo(tr);
|
|
48
|
-
const div = $(`<td><span>clmsg_id : ${attr['clmsg_id']}</span><div/></td>`).appendTo(tr).find('div');
|
|
63
|
+
const div = $(`<td><span id="${attr['clmsg_id']}">clmsg_id : ${attr['clmsg_id']}</span><div/></td>`).appendTo(tr).find('div');
|
|
49
64
|
render_result_func(div, attr['row'], 100);
|
|
50
65
|
});
|
|
51
66
|
};
|
|
@@ -54,13 +69,13 @@ audit.query = async (opt) => {
|
|
|
54
69
|
const res = await fetch(`audit/rawlog`,
|
|
55
70
|
{method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(opt)});
|
|
56
71
|
if (res.status != 200) {
|
|
57
|
-
cmdbox.message({
|
|
72
|
+
cmdbox.message(`${res.status}: ${res.statusText}`);
|
|
58
73
|
return;
|
|
59
74
|
}
|
|
60
75
|
try {
|
|
61
76
|
const content = JSON.parse(await res.text());
|
|
62
77
|
if (!content['success']) {
|
|
63
|
-
cmdbox.message(
|
|
78
|
+
cmdbox.message(content);
|
|
64
79
|
return;
|
|
65
80
|
}
|
|
66
81
|
return content['success']['data'];
|
|
@@ -76,16 +91,20 @@ audit.metrics = async () => {
|
|
|
76
91
|
audit.list_audit_metrics().then((res) => {
|
|
77
92
|
if (!res['success']) return;
|
|
78
93
|
res['success'].forEach(async (row) => {
|
|
79
|
-
const
|
|
80
|
-
const [_, opt] = cmdbox.get_param(
|
|
94
|
+
const modal = $('#search_modal');
|
|
95
|
+
const [_, opt] = cmdbox.get_param(modal);
|
|
81
96
|
opt['select'] = row['vertical'];
|
|
82
97
|
opt['select'][row['horizontal']] = '-';
|
|
83
98
|
opt['select_date_format'] = row['horizontal_date_format'];
|
|
84
99
|
opt['groupby'] = [row['horizontal']];
|
|
85
100
|
opt['groupby_date_format'] = row['horizontal_date_format'];
|
|
86
101
|
opt['sort'][row['horizontal']] = 'DESC';
|
|
102
|
+
Object.keys(row).forEach((key) => {
|
|
103
|
+
if (!key.startsWith('filter_')) return;
|
|
104
|
+
opt[key] = row[key];
|
|
105
|
+
});
|
|
87
106
|
let data = await audit.query(opt);
|
|
88
|
-
if (!data)
|
|
107
|
+
if (!data) data = [];
|
|
89
108
|
data = data.reverse();
|
|
90
109
|
// 時系列グラフの追加
|
|
91
110
|
const card = $(`<div class="col-${row['col_size']} p-1"><div class="card card-hover"><div class="card-body"></div></div></div>`).appendTo(metrics_area);
|
|
@@ -141,7 +160,7 @@ audit.metrics_modal_func = (title) => {
|
|
|
141
160
|
modal.find('.modal-title').text(title ? `Edit Metrics : ${title}` : 'New Metrics');
|
|
142
161
|
const row_content = modal.find('.row_content');
|
|
143
162
|
row_content.empty();
|
|
144
|
-
audit.load_audit_metrics(title?title:null).then((res) => {
|
|
163
|
+
audit.load_audit_metrics(title?title:null).then(async (res) => {
|
|
145
164
|
const axis = ['','audit_type', 'clmsg_id', 'clmsg_date', 'clmsg_src', 'clmsg_title', 'clmsg_user', 'clmsg_body', 'clmsg_tag', 'svmsg_id', 'svmsg_date'];
|
|
146
165
|
const chart_type = ['','line', 'area', 'bar'];
|
|
147
166
|
const stroke_curve = ['','smooth', 'straight', 'stepline'];
|
|
@@ -149,27 +168,69 @@ audit.metrics_modal_func = (title) => {
|
|
|
149
168
|
const rows = [
|
|
150
169
|
{opt:'title', type:'str', default:title?title:'', required:true, multi:false, hide:false, choice:null},
|
|
151
170
|
{opt:'chart_type', type:'str', default:data['chart_type']?data['chart_type']:'line', required:true, multi:false, hide:false, choice:chart_type,
|
|
171
|
+
discription_en: 'Specifies the type of graph.',
|
|
172
|
+
discription_ja: 'グラフのタイプを指定します。',
|
|
152
173
|
choice_show: {
|
|
153
174
|
'line':['stroke_curve','stroke_width'],
|
|
154
175
|
'area':['stroke_curve','chart_stacked','stroke_width'],
|
|
155
176
|
'bar':['chart_stacked']}},
|
|
156
|
-
{opt:'stroke_curve', type:'str', default:data['stroke_curve']?data['stroke_curve']:'straight', required:false, multi:false, hide:false, choice:stroke_curve
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
{opt:'
|
|
160
|
-
|
|
177
|
+
{opt:'stroke_curve', type:'str', default:data['stroke_curve']?data['stroke_curve']:'straight', required:false, multi:false, hide:false, choice:stroke_curve,
|
|
178
|
+
discription_en: 'Specifies the type of line.',
|
|
179
|
+
discription_ja: '線のタイプを指定します。'},
|
|
180
|
+
{opt:'chart_stacked', type:'bool', default:data['chart_stacked']?data['chart_stacked']:false, required:false, multi:false, hide:false, choice:[false, true],
|
|
181
|
+
discription_en: 'Specifies whether to stack the graph.',
|
|
182
|
+
discription_ja: 'グラフを積み上げるかどうかを指定します。'},
|
|
183
|
+
{opt:'stroke_width', type:'int', default:data['stroke_width']?data['stroke_width']:2, required:false, multi:false, hide:false, choice:[...Array(5).keys()].map(i => i+1),
|
|
184
|
+
discription_en: 'Specifies the width of the line.',
|
|
185
|
+
discription_ja: '線の幅を指定します。'},
|
|
186
|
+
{opt:'col_size', type:'int', default:data['col_size']?data['col_size']:6, required:true, multi:false, hide:false, choice:[...Array(12).keys()].map(i => i+1),
|
|
187
|
+
discription_en: 'Specifies the size of the graph display width.',
|
|
188
|
+
discription_ja: 'グラフの表示幅のサイズを指定します。'},
|
|
189
|
+
{opt:'horizontal', type:'str', default:data['horizontal']?data['horizontal']:'clmsg_date', required:true, multi:false, hide:false, choice:axis,
|
|
190
|
+
discription_en: 'Specify the items to be displayed on the horizontal axis.',
|
|
191
|
+
discription_ja: '横軸の表示項目を指定します。',
|
|
161
192
|
choice_show: {
|
|
162
193
|
'clmsg_date':['horizontal_date_format'],
|
|
163
194
|
'svmsg_date':['horizontal_date_format']}},
|
|
164
195
|
{opt:'horizontal_date_format', type:'str', default:data['horizontal_date_format']?data['horizontal_date_format']:'%Y/%m/%d',
|
|
165
|
-
required:false, multi:false, hide:false, choice:['','%Y/%m/%d %H:%M', '%Y/%m/%d %H', '%Y/%m/%d', '%Y/%m', '%Y', '%m', '%w']
|
|
196
|
+
required:false, multi:false, hide:false, choice:['','%Y/%m/%d %H:%M', '%Y/%m/%d %H', '%Y/%m/%d', '%Y/%m', '%Y', '%m', '%w'],
|
|
197
|
+
discription_en: 'Specify the date format to be displayed on the horizontal axis.',
|
|
198
|
+
discription_ja: '横軸の表示日付フォーマットを指定します。'},
|
|
166
199
|
];
|
|
167
200
|
data['vertical'] = data['vertical'] || {'clmsg_id':'count'};
|
|
168
201
|
Object.keys(data['vertical']).forEach((key) => {
|
|
169
202
|
const def = {};
|
|
170
203
|
def[key] = data['vertical'][key];
|
|
171
204
|
rows.push({opt:'vertical', type:'dict', default:def, required:true, multi:true, hide:false,
|
|
172
|
-
choice:{
|
|
205
|
+
choice:{key:axis, val:['-','count','sum','avg','min','max']}});
|
|
206
|
+
});
|
|
207
|
+
const base_rows = await cmdbox.get_cmd_choices('audit', 'search');
|
|
208
|
+
base_rows.filter(row => row['opt'].startsWith('filter')).forEach((row) => {
|
|
209
|
+
row['hide'] = true;
|
|
210
|
+
if (data[row['opt']]) {
|
|
211
|
+
const val = data[row['opt']];
|
|
212
|
+
if (Array.isArray(val) && val.length > 0) {
|
|
213
|
+
val.forEach((v) => {
|
|
214
|
+
if (!v || v=='') return;
|
|
215
|
+
r = {...row};
|
|
216
|
+
r['default'] = v;
|
|
217
|
+
rows.push(r);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
else if (typeof val=='object') {
|
|
221
|
+
Object.keys(val).forEach((k) => {
|
|
222
|
+
if (!k || k=='') return;
|
|
223
|
+
if (!val[k] || val[k]=='') return;
|
|
224
|
+
r = {...row};
|
|
225
|
+
r['default'][k] = val[k];
|
|
226
|
+
rows.push(r);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
row['default'] = val;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
rows.push(row);
|
|
173
234
|
});
|
|
174
235
|
rows.forEach((row, i) => cmdbox.add_form_func(i, modal, row_content, row, null, 12, 6));
|
|
175
236
|
title && modal.find('[name="title"]').prop('readonly', true);
|
|
@@ -179,23 +240,23 @@ audit.metrics_modal_func = (title) => {
|
|
|
179
240
|
modal.find('#metrics_save').off('click').on('click', async () => {
|
|
180
241
|
const [title, opt] = cmdbox.get_param(modal);
|
|
181
242
|
if (!title || title == '') {
|
|
182
|
-
cmdbox.message({'
|
|
243
|
+
cmdbox.message({'warn': 'Title is required'});
|
|
183
244
|
return;
|
|
184
245
|
}
|
|
185
246
|
if (!opt['chart_type'] || opt['chart_type'] == '') {
|
|
186
|
-
cmdbox.message({'
|
|
247
|
+
cmdbox.message({'warn': 'chart_type is required'});
|
|
187
248
|
return;
|
|
188
249
|
}
|
|
189
250
|
if (!opt['col_size'] || opt['col_size'] == '') {
|
|
190
|
-
cmdbox.message({'
|
|
251
|
+
cmdbox.message({'warn': 'col_size is required'});
|
|
191
252
|
return;
|
|
192
253
|
}
|
|
193
254
|
if (!opt['horizontal'] || opt['horizontal'] == '') {
|
|
194
|
-
cmdbox.message({'
|
|
255
|
+
cmdbox.message({'warn': 'horizontal is required'});
|
|
195
256
|
return;
|
|
196
257
|
}
|
|
197
258
|
if (!opt['vertical'] || opt['vertical'] == '') {
|
|
198
|
-
cmdbox.message({'
|
|
259
|
+
cmdbox.message({'warn': 'vertical is required'});
|
|
199
260
|
return;
|
|
200
261
|
}
|
|
201
262
|
if (!window.confirm('Do you want to save?')) return;
|
|
@@ -217,22 +278,21 @@ audit.metrics_modal_func = (title) => {
|
|
|
217
278
|
// 監査ログのフィルターフォームの初期化
|
|
218
279
|
audit.init_form = async () => {
|
|
219
280
|
// フォームの初期化
|
|
220
|
-
const
|
|
221
|
-
const row_content =
|
|
281
|
+
const modal = $('#search_modal');
|
|
282
|
+
const row_content = modal.find('.row_content');
|
|
222
283
|
const res = await fetch('audit/mode_cmd', {method: 'GET'});
|
|
223
|
-
if (res.status != 200) cmdbox.message({
|
|
284
|
+
if (res.status != 200) cmdbox.message(`${res.status}: ${res.statusText}`);
|
|
224
285
|
const msg = await res.json();
|
|
225
286
|
if (!msg['success']) {
|
|
226
|
-
cmdbox.message(
|
|
287
|
+
cmdbox.message(msg);
|
|
227
288
|
return;
|
|
228
289
|
}
|
|
229
290
|
const args = msg['success'];
|
|
230
291
|
const py_get_cmd_choices = await cmdbox.get_cmd_choices(args['mode'], args['cmd']);
|
|
231
292
|
row_content.html('');
|
|
232
293
|
// 検索ボタンを表示
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
audit.rawlog();
|
|
294
|
+
$('#do_search').off('click').on('click', async (e) => {
|
|
295
|
+
await audit.rawlog();
|
|
236
296
|
const condition = {};
|
|
237
297
|
row_content.find(':input').each((i, el) => {
|
|
238
298
|
const elem = $(el);
|
|
@@ -250,14 +310,14 @@ audit.init_form = async () => {
|
|
|
250
310
|
// 主なフィルター条件のフォームを表示
|
|
251
311
|
const nml_conditions = ['filter_audit_type', 'filter_clmsg_id', 'filter_clmsg_src', 'filter_clmsg_title', 'filter_clmsg_title', 'filter_clmsg_user',
|
|
252
312
|
'filter_clmsg_tag', 'filter_svmsg_sdate', 'filter_svmsg_edate']
|
|
253
|
-
py_get_cmd_choices.filter(row => nml_conditions.includes(row.opt)).forEach((row, i) => cmdbox.add_form_func(i,
|
|
313
|
+
py_get_cmd_choices.filter(row => nml_conditions.includes(row.opt)).forEach((row, i) => cmdbox.add_form_func(i, modal, row_content, row, null, 12, 6));
|
|
254
314
|
const adv_link = $('<div class="text-center card-hover col-12 mb-3"><a href="#">[ advanced options ]</a></div>').appendTo(row_content);
|
|
255
315
|
adv_link.off('click').on('click', (e) => {row_content.find('.adv').toggle();});
|
|
256
316
|
// 高度なフィルター条件のフォームを表示
|
|
257
317
|
const adv_conditions = ['filter_clmsg_body', 'filter_clmsg_sdate', 'filter_svmsg_edate',
|
|
258
318
|
'filter_svmsg_id', 'sort', 'offset', 'limit'];
|
|
259
319
|
const adv_row_content = $('<div class="row_content"></div>').appendTo(row_content);
|
|
260
|
-
py_get_cmd_choices.filter(row => adv_conditions.includes(row.opt)).forEach((row, i) => cmdbox.add_form_func(i,
|
|
320
|
+
py_get_cmd_choices.filter(row => adv_conditions.includes(row.opt)).forEach((row, i) => cmdbox.add_form_func(i, modal, adv_row_content, row, null, 12, 12));
|
|
261
321
|
adv_row_content.children().each((i, elem) => {$(elem).addClass('adv').hide();}).appendTo(row_content);
|
|
262
322
|
adv_row_content.remove();
|
|
263
323
|
let condition = await cmdbox.load_user_data('audit', 'condition');
|
|
@@ -284,6 +344,12 @@ audit.init_form = async () => {
|
|
|
284
344
|
if (!val || val == '') return
|
|
285
345
|
$(elem).val(val);
|
|
286
346
|
});
|
|
347
|
+
$('#search_rawlog').off('click').on('click', (e) => {
|
|
348
|
+
modal.modal('show');
|
|
349
|
+
});
|
|
350
|
+
$('#search_trace').off('click').on('click', (e) => {
|
|
351
|
+
modal.modal('show');
|
|
352
|
+
});
|
|
287
353
|
};
|
|
288
354
|
audit.list_audit_metrics = async () => {
|
|
289
355
|
const formData = new FormData();
|
|
@@ -335,6 +401,4 @@ $(() => {
|
|
|
335
401
|
audit.metrics_modal_func();
|
|
336
402
|
});
|
|
337
403
|
});
|
|
338
|
-
// スプリッター初期化
|
|
339
|
-
$('.split-pane').splitPane();
|
|
340
404
|
});
|
cmdbox/web/audit.html
CHANGED
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
.card-hover:hover {
|
|
7
7
|
box-shadow: 0 0 8px gray;
|
|
8
8
|
}
|
|
9
|
-
.pane-divider {
|
|
10
|
-
border: 1px solid #C8C8C8 !important;
|
|
11
|
-
border-radius: 1px;
|
|
12
|
-
}
|
|
13
9
|
</style>
|
|
14
10
|
</head>
|
|
15
11
|
<body lang="ja" class="overflow-hidden p-2" style="background-color:rgb(33, 37, 41)">
|
|
@@ -44,6 +40,9 @@
|
|
|
44
40
|
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/>
|
|
45
41
|
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z"/>
|
|
46
42
|
</symbol>
|
|
43
|
+
<symbol id="svg_search_btn" viewBox="0 0 16 16">
|
|
44
|
+
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/>
|
|
45
|
+
</symbol>
|
|
47
46
|
</svg>
|
|
48
47
|
<!-- ナビゲーションバー -->
|
|
49
48
|
<nav class="navbar navbar-expand-sm fixed-top p-2">
|
|
@@ -100,50 +99,78 @@
|
|
|
100
99
|
</div>
|
|
101
100
|
</nav>
|
|
102
101
|
<div id="main_container" class="container-fluid overflow-auto split-pane fixed-left" style="margin-top:66px;height:calc(100vh - 120px);">
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
</
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
</
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
102
|
+
<ul id="main_tabs" class="nav nav-tabs" role="tablist">
|
|
103
|
+
<li class="nav-item" role="presentation">
|
|
104
|
+
<a class="nav-link active" id="metrics-tab" data-bs-toggle="tab" href="#metrics" role="tab" aria-controls="metrics" aria-selected="true">Metrics</a>
|
|
105
|
+
</li>
|
|
106
|
+
<li class="nav-item" role="presentation">
|
|
107
|
+
<a class="nav-link" id="trace-tab" data-bs-toggle="tab" href="#trace" role="tab" aria-controls="trace" aria-selected="false">Trace</a>
|
|
108
|
+
</li>
|
|
109
|
+
<li class="nav-item" role="presentation">
|
|
110
|
+
<a class="nav-link" id="rawlog-tab" data-bs-toggle="tab" href="#rawlog" role="tab" aria-controls="rawlog" aria-selected="false">Raw Log</a>
|
|
111
|
+
</li>
|
|
112
|
+
</ul>
|
|
113
|
+
<div class="tab-content">
|
|
114
|
+
<div class="tab-pane fade show active" id="metrics" role="tabpanel" aria-labelledby="metrics-tab">
|
|
115
|
+
<button id="add_metrics" type="button" class="btn">
|
|
116
|
+
<svg width="32" height="32" fill="currentColor" class="bi bi-plus-lg"><use href="#svg_add_btn"></use></svg>
|
|
117
|
+
</button>
|
|
118
|
+
<!-- メトリクスグラフ -->
|
|
119
|
+
<div class="row g-2 m-0 overflow-auto" id="metrics_area" style="height:calc(100vh - 220px);"></div>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="tab-pane fade" id="trace" role="tabpanel" aria-labelledby="trace-tab">
|
|
122
|
+
<button id="search_trace" type="button" class="btn">
|
|
123
|
+
<svg width="32" height="32" fill="currentColor" class="bi bi-plus-lg"><use href="#svg_search_btn"></use></svg>
|
|
124
|
+
</button>
|
|
125
|
+
<!-- トレース一覧 -->
|
|
126
|
+
<div class="row g-2 mt-1 overflow-auto" id="trace_area" style="height:calc(100vh - 220px);"></div>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="tab-pane fade" id="rawlog" role="tabpanel" aria-labelledby="rawlog-tab">
|
|
129
|
+
<button id="search_rawlog" type="button" class="btn">
|
|
130
|
+
<svg width="32" height="32" fill="currentColor" class="bi bi-plus-lg"><use href="#svg_search_btn"></use></svg>
|
|
131
|
+
</button>
|
|
132
|
+
<!-- 監査ログ一覧 -->
|
|
133
|
+
<div class="row g-2 mt-1 overflow-auto" id="rawlog_area" style="height:calc(100vh - 220px);"></div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
<!-- searchモーダル -->
|
|
138
|
+
<div id="search_modal" class="modal" tabindex="-1">
|
|
139
|
+
<div class="modal-dialog modal-lg">
|
|
140
|
+
<div id="search_form" class="modal-content novalidate">
|
|
141
|
+
<div class="modal-header">
|
|
142
|
+
<h5 class="modal-title">Search Condition</h5>
|
|
143
|
+
<button type="button" class="btn btn_window_stack">
|
|
144
|
+
<svg width="16" height="16" fill="currentColor" class="bi bi-window-stack" viewBox="0 0 16 16">
|
|
145
|
+
<use href="#svg_window_stack"></use>
|
|
146
|
+
</svg>
|
|
147
|
+
</button>
|
|
148
|
+
<button type="button" class="btn btn_window">
|
|
149
|
+
<svg width="16" height="16" fill="currentColor" class="bi bi-window" viewBox="0 0 16 16">
|
|
150
|
+
<use href="#svg_window"></use>
|
|
151
|
+
</svg>
|
|
152
|
+
</button>
|
|
153
|
+
<button type="button" class="btn btn_close p-0 m-0" data-bs-dismiss="modal" aria-label="Close" style="margin-left: 0px;">
|
|
154
|
+
<svg class="bi bi-x" width="24" height="24" fill="currentColor"><use href="#btn_x"></use></svg>
|
|
120
155
|
</button>
|
|
121
|
-
<div class="row g-2 m-0" id="metrics_area"></div>
|
|
122
156
|
</div>
|
|
123
|
-
<div class="
|
|
124
|
-
<div class="row
|
|
157
|
+
<div class="modal-body">
|
|
158
|
+
<div class="row row_content"></div>
|
|
159
|
+
<form id="filter_form" class="d-none filer_form">
|
|
160
|
+
<input name="filer_host" type="hidden" class="filer_host">
|
|
161
|
+
<input name="filer_port" type="hidden" class="filer_port">
|
|
162
|
+
<input name="filer_password" type="hidden" class="filer_password">
|
|
163
|
+
<input name="filer_svname" type="hidden" class="filer_svname">
|
|
164
|
+
<input name="filer_scope" type="hidden" class="filer_scope">
|
|
165
|
+
<input name="filer_client_data" type="hidden" class="filer_client_data">
|
|
166
|
+
</form>
|
|
125
167
|
</div>
|
|
126
|
-
<div class="
|
|
127
|
-
<
|
|
168
|
+
<div class="modal-footer">
|
|
169
|
+
<button id="do_search" type="button" class="btn btn-success">Search</button>
|
|
170
|
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
|
128
171
|
</div>
|
|
129
172
|
</div>
|
|
130
173
|
</div>
|
|
131
|
-
<!-- 左右のスプリッター -->
|
|
132
|
-
<div class="split-pane-divider pane-divider" style="left:80%;"></div>
|
|
133
|
-
<!-- フィルター側ペイン -->
|
|
134
|
-
<div id="right_container" class="split-pane-component" style="left:80%;">
|
|
135
|
-
<form class="d-none filer_form">
|
|
136
|
-
<input name="filer_host" type="hidden" class="filer_host">
|
|
137
|
-
<input name="filer_port" type="hidden" class="filer_port">
|
|
138
|
-
<input name="filer_password" type="hidden" class="filer_password">
|
|
139
|
-
<input name="filer_svname" type="hidden" class="filer_svname">
|
|
140
|
-
<input name="filer_scope" type="hidden" class="filer_scope">
|
|
141
|
-
<input name="filer_client_data" type="hidden" class="filer_client_data">
|
|
142
|
-
</form>
|
|
143
|
-
<div id="filter_form">
|
|
144
|
-
<div class="row row_content m-1"></div>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
174
|
</div>
|
|
148
175
|
<!-- metricsモーダル -->
|
|
149
176
|
<div id="metrics_modal" class="modal" tabindex="-1">
|
|
@@ -238,7 +265,6 @@
|
|
|
238
265
|
<link rel="stylesheet" href="assets/bootstrap/bootstrap.min.5.3.0.css">
|
|
239
266
|
<link rel="stylesheet" href="assets/cmdbox/color_mode.css">
|
|
240
267
|
<link rel="stylesheet" href="assets/tree-menu/css/tree-menu.css">
|
|
241
|
-
<link rel="stylesheet" href="assets/split-pane/split-pane.css">
|
|
242
268
|
<link rel="stylesheet" href="assets/apexcharts/apexcharts.css">
|
|
243
269
|
<style type="text/css">
|
|
244
270
|
.apexcharts-tooltip {
|
|
@@ -260,7 +286,6 @@
|
|
|
260
286
|
<script type="text/javascript" src="assets/jquery/jquery.min.3.2.0.js"></script>
|
|
261
287
|
<script type="text/javascript" src="assets/jquery-ui/jquery-ui.min.js"></script>
|
|
262
288
|
<script type="text/javascript" src="assets/jquery-resizable/jquery-resizable.min.js"></script>
|
|
263
|
-
<script type="text/javascript" src="assets/split-pane/split-pane.js"></script>
|
|
264
289
|
<script type="text/javascript" src="assets/apexcharts/apexcharts.min.js"></script>
|
|
265
290
|
<script type="text/javascript" src="assets/cmdbox/common.js"></script>
|
|
266
291
|
<script type="text/javascript" src="assets/cmdbox/view_result.js"></script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cmdbox
|
|
3
|
-
Version: 0.5.3
|
|
3
|
+
Version: 0.5.3.1
|
|
4
4
|
Summary: cmdbox: It is a command line application with a plugin mechanism.
|
|
5
5
|
Home-page: https://github.com/hamacom2004jp/cmdbox
|
|
6
6
|
Download-URL: https://github.com/hamacom2004jp/cmdbox
|
|
@@ -193,7 +193,7 @@ class ServerTime(feature.Feature):
|
|
|
193
193
|
dict(opt="password", type=Options.T_STR, default=self.default_pass, required=True, multi=False, hide=True, choice=None,
|
|
194
194
|
discription_ja="Redisサーバーのアクセスパスワード(任意)を指定します。省略時は `password` を使用します。",
|
|
195
195
|
discription_en="Specify the access password of the Redis server (optional). If omitted, `password` is used."),
|
|
196
|
-
dict(opt="svname", type=Options.T_STR, default=
|
|
196
|
+
dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None,
|
|
197
197
|
discription_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
|
|
198
198
|
discription_en="Specify the service name of the inference server. If omitted, `server` is used."),
|
|
199
199
|
dict(opt="timedelta", type=Options.T_INT, default=9, required=False, multi=False, hide=False, choice=None,
|
|
@@ -296,10 +296,10 @@ aliases: # Specify the alias for the specified co
|
|
|
296
296
|
mode: audit # Specify the mode of the feature to be searched.
|
|
297
297
|
cmd: search # Specify the command to be searched.
|
|
298
298
|
options: # Specify the options for the audit function.
|
|
299
|
-
host: localhost # Specify the service host of the audit Redis server.
|
|
300
|
-
port: 6379 # Specify the service port of the audit Redis server.
|
|
301
|
-
password: password # Specify the access password of the audit Redis server.
|
|
302
|
-
svname: server # Specify the audit service name of the inference server.
|
|
299
|
+
host: localhost # Specify the service host of the audit Redis server.However, if it is specified as a command line argument, it is ignored.
|
|
300
|
+
port: 6379 # Specify the service port of the audit Redis server.However, if it is specified as a command line argument, it is ignored.
|
|
301
|
+
password: password # Specify the access password of the audit Redis server.However, if it is specified as a command line argument, it is ignored.
|
|
302
|
+
svname: server # Specify the audit service name of the inference server.However, if it is specified as a command line argument, it is ignored.
|
|
303
303
|
retry_count: 3 # Specifies the number of reconnections to the audit Redis server.If less than 0 is specified, reconnection is forever.
|
|
304
304
|
retry_interval: 1 # Specifies the number of seconds before reconnecting to the audit Redis server.
|
|
305
305
|
timeout: 15 # Specify the maximum waiting time until the server responds.
|