cmdbox 0.5.3__py3-none-any.whl → 0.5.4__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/auth/__init__.py +0 -0
- cmdbox/app/auth/azure_signin.py +38 -0
- cmdbox/app/auth/azure_signin_saml.py +12 -0
- cmdbox/app/auth/github_signin.py +38 -0
- cmdbox/app/auth/google_signin.py +32 -0
- cmdbox/app/auth/signin.py +47 -4
- cmdbox/app/auth/signin_saml.py +61 -0
- cmdbox/app/edge.py +198 -61
- cmdbox/app/feature.py +2 -1
- 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_edge_config.py +19 -5
- 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 +4 -4
- cmdbox/app/features/cli/cmdbox_web_user_del.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_user_edit.py +4 -4
- 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_do_signin.py +79 -103
- cmdbox/app/features/web/cmdbox_web_exec_cmd.py +2 -2
- cmdbox/app/features/web/cmdbox_web_signin.py +23 -1
- cmdbox/app/options.py +9 -0
- cmdbox/app/server.py +15 -3
- cmdbox/app/web.py +13 -12
- cmdbox/extensions/features.yml +4 -4
- cmdbox/extensions/sample_project/sample/app/features/cli/sample_server_time.py +1 -1
- cmdbox/extensions/sample_project/sample/extensions/features.yml +23 -0
- cmdbox/extensions/sample_project/sample/extensions/user_list.yml +40 -6
- cmdbox/extensions/user_list.yml +36 -6
- cmdbox/licenses/LICENSE.async-timeout.5.0.1(Apache Software License).txt +13 -0
- cmdbox/licenses/files.txt +10 -9
- cmdbox/version.py +2 -2
- cmdbox/web/assets/cmdbox/audit.js +98 -34
- cmdbox/web/assets/cmdbox/signin.js +13 -0
- cmdbox/web/assets/cmdbox/users.js +1 -1
- cmdbox/web/audit.html +69 -44
- cmdbox/web/signin.html +10 -6
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.4.dist-info}/METADATA +69 -15
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.4.dist-info}/RECORD +71 -79
- cmdbox/app/features/web/cmdbox_web_load_pin.py +0 -43
- cmdbox/app/features/web/cmdbox_web_save_pin.py +0 -42
- cmdbox/licenses/LICENSE.argcomplete.3.6.1(Apache Software License).txt +0 -177
- cmdbox/licenses/LICENSE.gevent.25.4.1(MIT).txt +0 -25
- cmdbox/licenses/LICENSE.greenlet.3.2.0(MIT AND Python-2.0).txt +0 -30
- cmdbox/licenses/LICENSE.pillow.11.1.0(CMU License (MIT-CMU)).txt +0 -1213
- cmdbox/licenses/LICENSE.prompt_toolkit.3.0.50(BSD License).txt +0 -27
- cmdbox/licenses/LICENSE.psycopg-pool.3.2.6(GNU Lesser General Public License v3 (LGPLv3)).txt +0 -165
- cmdbox/licenses/LICENSE.pydantic.2.11.1(MIT License).txt +0 -21
- cmdbox/licenses/LICENSE.pydantic_core.2.33.0(MIT License).txt +0 -21
- cmdbox/licenses/LICENSE.starlette.0.46.1(BSD License).txt +0 -27
- cmdbox/licenses/LICENSE.typing_extensions.4.13.0(UNKNOWN).txt +0 -279
- cmdbox/licenses/LICENSE.urllib3.2.3.0(MIT License).txt +0 -21
- cmdbox/licenses/LICENSE.uvicorn.0.34.1(BSD License).txt +0 -27
- cmdbox/licenses/LICENSE.watchfiles.1.0.4(MIT License).txt +0 -21
- /cmdbox/licenses/{LICENSE.certifi.2025.1.31(Mozilla Public License 2.0 (MPL 2.0)).txt → LICENSE.certifi.2025.4.26(Mozilla Public License 2.0 (MPL 2.0)).txt} +0 -0
- /cmdbox/licenses/{LICENSE.gevent.24.11.1(MIT License).txt → LICENSE.gevent.25.4.2(MIT).txt} +0 -0
- /cmdbox/licenses/{LICENSE.greenlet.3.1.1(MIT License).txt → LICENSE.greenlet.3.2.1(MIT AND Python-2.0).txt} +0 -0
- /cmdbox/licenses/{LICENSE.h11.0.14.0(MIT License).txt → LICENSE.h11.0.16.0(MIT License).txt} +0 -0
- /cmdbox/licenses/{LICENSE.importlib_metadata.8.6.1(Apache Software License).txt → LICENSE.importlib_metadata.8.7.0(Apache Software License).txt} +0 -0
- /cmdbox/licenses/{LICENSE.more-itertools.10.6.0(MIT License).txt → LICENSE.more-itertools.10.7.0(MIT License).txt} +0 -0
- /cmdbox/licenses/{LICENSE.numpy.2.2.4(BSD License).txt → LICENSE.numpy.2.2.5(BSD License).txt} +0 -0
- /cmdbox/licenses/{LICENSE.packaging.24.2(Apache Software License; BSD License).txt → LICENSE.packaging.25.0(Apache Software License; BSD License).txt} +0 -0
- /cmdbox/licenses/{LICENSE.uvicorn.0.34.0(BSD License).txt → LICENSE.uvicorn.0.34.2(BSD License).txt} +0 -0
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.4.dist-info}/LICENSE +0 -0
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.4.dist-info}/WHEEL +0 -0
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.4.dist-info}/entry_points.txt +0 -0
- {cmdbox-0.5.3.dist-info → cmdbox-0.5.4.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
|
});
|
|
@@ -59,6 +59,7 @@ $(() => {
|
|
|
59
59
|
const btn_google = $('.btn-google');
|
|
60
60
|
const btn_github = $('.btn-github');
|
|
61
61
|
const btn_azure = $('.btn-azure');
|
|
62
|
+
const btn_saml_azure = $('.btn-saml-azure');
|
|
62
63
|
btn_google.off('click').on('click', async (event) => {
|
|
63
64
|
const path = window.location.pathname.replace('/signin', '');
|
|
64
65
|
window.location.href = `../oauth2/google${path}?n=${cmdbox.randam_string(8)}`;
|
|
@@ -71,6 +72,10 @@ $(() => {
|
|
|
71
72
|
const path = window.location.pathname.replace('/signin', '');
|
|
72
73
|
window.location.href = `../oauth2/azure${path}?n=${cmdbox.randam_string(8)}`;
|
|
73
74
|
});
|
|
75
|
+
btn_saml_azure.off('click').on('click', async (event) => {
|
|
76
|
+
const path = window.location.pathname.replace('/signin', '');
|
|
77
|
+
window.location.href = `../saml/azure${path}?n=${cmdbox.randam_string(8)}`;
|
|
78
|
+
});
|
|
74
79
|
oauth2_enabled().then((res) => {
|
|
75
80
|
if (res.google) btn_google.show();
|
|
76
81
|
else btn_google.hide();
|
|
@@ -79,6 +84,10 @@ $(() => {
|
|
|
79
84
|
if (res.azure) btn_azure.show();
|
|
80
85
|
else btn_azure.hide();
|
|
81
86
|
});
|
|
87
|
+
saml_enabled().then((res) => {
|
|
88
|
+
if (res.azure) btn_saml_azure.show();
|
|
89
|
+
else btn_saml_azure.hide();
|
|
90
|
+
});
|
|
82
91
|
});
|
|
83
92
|
const get_client_data = async () => {
|
|
84
93
|
const res = await fetch('gui/get_client_data', {method: 'GET'});
|
|
@@ -91,4 +100,8 @@ const bbforce_cmd = async () => {
|
|
|
91
100
|
const oauth2_enabled = async () => {
|
|
92
101
|
const res = await fetch('../oauth2/enabled', {method: 'GET'});
|
|
93
102
|
return await res.json();
|
|
103
|
+
}
|
|
104
|
+
const saml_enabled = async () => {
|
|
105
|
+
const res = await fetch('../saml/enabled', {method: 'GET'});
|
|
106
|
+
return await res.json();
|
|
94
107
|
}
|
|
@@ -63,7 +63,7 @@ users.users_list = async () => {
|
|
|
63
63
|
const row = $(modal.find('.row_content_template_choice').html()).appendTo(row_content);
|
|
64
64
|
row_content.find('.row_content_template_title').removeClass('row_content_template_title').text(col);
|
|
65
65
|
const select = row_content.find('.row_content_template_select').removeClass('row_content_template_select');
|
|
66
|
-
for (const h of ['', 'oauth2', 'plain', 'md5', 'sha1', 'sha256']) {
|
|
66
|
+
for (const h of ['', 'oauth2', 'saml', 'plain', 'md5', 'sha1', 'sha256']) {
|
|
67
67
|
$('<option>').text(h).val(h).appendTo(select);
|
|
68
68
|
}
|
|
69
69
|
select.attr('name', col).val(user && user[col] ? user[col] : '');
|
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>
|
cmdbox/web/signin.html
CHANGED
|
@@ -115,16 +115,20 @@
|
|
|
115
115
|
<button class="btn btn-primary w-100 py-2" type="submit">Sign in</button>
|
|
116
116
|
<div class="mt-3">
|
|
117
117
|
<button class="btn btn-outline-primary w-100 py-2 mb-3 btn-azure" type="button" style="display:none;">
|
|
118
|
-
<svg class="bi my-1 theme-icon-active" fill="currentColor" width="16" height="16"><use href="#azure"></use></svg>
|
|
119
|
-
Sign in with Microsoft
|
|
118
|
+
<svg class="bi my-1 theme-icon-active me-2" fill="currentColor" width="16" height="16"><use href="#azure"></use></svg>
|
|
119
|
+
Sign in with Microsoft OAuth2
|
|
120
120
|
</button>
|
|
121
121
|
<button class="btn btn-outline-primary w-100 py-2 mb-3 btn-google" type="button" style="display:none;">
|
|
122
|
-
<svg class="bi my-1 theme-icon-active" fill="currentColor" width="16" height="16"><use href="#google"></use></svg>
|
|
123
|
-
Sign in with Google
|
|
122
|
+
<svg class="bi my-1 theme-icon-active me-2" fill="currentColor" width="16" height="16"><use href="#google"></use></svg>
|
|
123
|
+
Sign in with Google OAuth2
|
|
124
124
|
</button>
|
|
125
125
|
<button class="btn btn-outline-primary w-100 py-2 mb-3 btn-github" type="button" style="display:none;">
|
|
126
|
-
<svg class="bi my-1 theme-icon-active" fill="currentColor" width="16" height="16"><use href="#github"></use></svg>
|
|
127
|
-
Sign in with Github
|
|
126
|
+
<svg class="bi my-1 theme-icon-active me-2" fill="currentColor" width="16" height="16"><use href="#github"></use></svg>
|
|
127
|
+
Sign in with Github OAuth2
|
|
128
|
+
</button>
|
|
129
|
+
<button class="btn btn-outline-primary w-100 py-2 mb-3 btn-saml-azure" type="button" style="display:none;">
|
|
130
|
+
<svg class="bi my-1 theme-icon-active me-2" fill="currentColor" width="16" height="16"><use href="#azure"></use></svg>
|
|
131
|
+
Sign in with Microsoft SAML
|
|
128
132
|
</button>
|
|
129
133
|
</div>
|
|
130
134
|
</form>
|