MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / make_progress

Method make_progress

webiojs/src/handlers/input.ts:284–300  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

282
283 // 显示提交进度条,返回进度更新函数
284 make_progress() {
285 let html = `<div class="progress" style="margin-top: 4px;">
286 <div class="progress-bar bg-info progress-bar-striped progress-bar-animated" role="progressbar"
287 style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%
288 </div>
289 </div>`;
290 let elem = $(html);
291 this.element.find('.card-body').append(elem);
292
293 let bar = elem.find('.progress-bar');
294 return function (loaded: number, total: number) {
295 let progress = "" + (100.0 * loaded / total).toFixed(1);
296 bar[0].style.width = progress + "%";
297 bar.attr("aria-valuenow", progress);
298 bar.text(progress + "%");
299 }
300 };
301
302 dispatch_ctrl_message(spec: any) {
303 // 恢复原本可点击的按钮

Callers 1

create_elementMethod · 0.80

Calls 2

appendMethod · 0.80
$Function · 0.50

Tested by

no test coverage detected