bittensor-cli 9.4.4__py3-none-any.whl → 9.5.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. bittensor_cli/cli.py +3 -10
  2. bittensor_cli/src/bittensor/templates/main-filters.j2 +24 -0
  3. bittensor_cli/src/bittensor/templates/main-header.j2 +36 -0
  4. bittensor_cli/src/bittensor/templates/neuron-details.j2 +111 -0
  5. bittensor_cli/src/bittensor/templates/price-multi.j2 +113 -0
  6. bittensor_cli/src/bittensor/templates/price-single.j2 +99 -0
  7. bittensor_cli/src/bittensor/templates/subnet-details-header.j2 +49 -0
  8. bittensor_cli/src/bittensor/templates/subnet-details.j2 +32 -0
  9. bittensor_cli/src/bittensor/templates/subnet-metrics.j2 +57 -0
  10. bittensor_cli/src/bittensor/templates/subnets-table.j2 +28 -0
  11. bittensor_cli/src/bittensor/templates/table.j2 +267 -0
  12. bittensor_cli/src/bittensor/templates/view.css +1058 -0
  13. bittensor_cli/src/bittensor/templates/view.j2 +43 -0
  14. bittensor_cli/src/bittensor/templates/view.js +1053 -0
  15. bittensor_cli/src/bittensor/utils.py +8 -38
  16. bittensor_cli/src/commands/stake/add.py +1 -1
  17. bittensor_cli/src/commands/stake/remove.py +1 -1
  18. bittensor_cli/src/commands/subnets/price.py +48 -289
  19. bittensor_cli/src/commands/sudo.py +10 -6
  20. bittensor_cli/src/commands/view.py +24 -2615
  21. bittensor_cli/src/commands/wallets.py +1 -7
  22. {bittensor_cli-9.4.4.dist-info → bittensor_cli-9.5.1.dist-info}/METADATA +5 -5
  23. bittensor_cli-9.5.1.dist-info/RECORD +48 -0
  24. bittensor_cli-9.4.4.dist-info/RECORD +0 -35
  25. {bittensor_cli-9.4.4.dist-info → bittensor_cli-9.5.1.dist-info}/WHEEL +0 -0
  26. {bittensor_cli-9.4.4.dist-info → bittensor_cli-9.5.1.dist-info}/entry_points.txt +0 -0
  27. {bittensor_cli-9.4.4.dist-info → bittensor_cli-9.5.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,267 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>{{ title }}</title>
6
+ <link href="https://fonts.googleapis.com/css2?family=DM+Mono:wght@400&display=swap" rel="stylesheet">
7
+ <link href="https://unpkg.com/tabulator-tables@6.2.5/dist/css/tabulator.min.css" rel="stylesheet">
8
+ <script type="text/javascript" src="https://oss.sheetjs.com/sheetjs/xlsx.full.min.js"></script>
9
+ <script type="text/javascript" src="https://unpkg.com/tabulator-tables@6.2.5/dist/js/tabulator.min.js"></script>
10
+ </head>
11
+ <style>
12
+ .tabulator {
13
+ font-family: 'DM Mono', monospace !important;
14
+ }
15
+
16
+ .tabulator .tabulator-header .tabulator-col {
17
+ font-family: 'DM Mono', monospace !important;
18
+ }
19
+
20
+ .tabulator .tabulator-tableHolder .tabulator-row .tabulator-cell {
21
+ font-family: 'DM Mono', monospace !important;
22
+ }
23
+
24
+ .tabulator .tabulator-header {
25
+ background-color: #282A2D !important;
26
+ color: white !important;
27
+ }
28
+
29
+ .tabulator .tabulator-header .tabulator-col {
30
+ background-color: #282A2D !important;
31
+ color: white !important;
32
+ padding: 16px 12px;
33
+ }
34
+
35
+ .tabulator .tabulator-tableHolder .tabulator-row .tabulator-cell {
36
+ padding: 16px 12px;
37
+ }
38
+
39
+ .tabulator .tabulator-tableHolder .tabulator-row:nth-child(even) {
40
+ background-color: #f2f2f2;
41
+ }
42
+
43
+ .tabulator .tabulator-tableHolder .tabulator-row:hover {
44
+ background-color: #ddd;
45
+ }
46
+
47
+ /* Apply styles only to the filter section selects */
48
+ .filter-section select {
49
+ -webkit-appearance: none;
50
+ -moz-appearance: none;
51
+ appearance: none;
52
+ padding: 8px;
53
+ border: 1px solid #DBDDE1;
54
+ border-radius: 4px;
55
+ font-family: 'DM Mono', monospace;
56
+ font-size: 12px;
57
+ color: #0E1013;
58
+ background-repeat: no-repeat;
59
+ background-position: right 10px center;
60
+ background-size: 10px;
61
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%230E1013" d="M2 0L0 2h4z"/></svg>');
62
+ }
63
+
64
+ /* Specific styles for each select element */
65
+ .filter-section #filter-field {
66
+ background-color: #F0F0F0;
67
+ }
68
+
69
+ .filter-section #filter-type {
70
+ background-color: #E8E8E8;
71
+ border: 1px solid #C0C0C0;
72
+ }
73
+
74
+ .filter-section #filter-value {
75
+ background-color: #FFFFFF;
76
+ border: 1px solid #DBDDE1;
77
+ }
78
+
79
+ </style>
80
+ <body style="margin: 0; padding: 0;">
81
+ <!-- Header Bar -->
82
+ <div style="position: relative; width: 1648px; height: 48px; margin: 32px auto 0 auto; background-color: white; color: #282A2D;">
83
+ <!-- Tao Symbol on the Left -->
84
+ <div style="position: absolute; width: 48px; height: 48px; left: 16px; top: 0; text-align: center;
85
+ font-family: 'GFS Neohellenic', serif; font-weight: 400; font-size: 48px; line-height: 48px; color: #282A2D;">
86
+ <?xml version="1.0" encoding="UTF-8"?>
87
+ <svg id="a" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34.44 36.91">
88
+ <path d="M20.88,28.32V13.19c0-3.78-3.12-6.86-6.9-6.86V30.51c0,4.81,4.08,6.4,6.6,6.4,2.09,0,3.27-.36,4.69-1.36-3.98-.42-4.39-2.82-4.39-7.23Z"/>
89
+ <path d="M6.29,0C2.82,0,0,2.87,0,6.34H28.15c3.47,0,6.29-2.87,6.29-6.34H6.29Z"/>
90
+ </svg>
91
+
92
+ </div>
93
+ <!-- Table Info slightly off-center and constrained to one line -->
94
+ <div style="position: absolute; left: 25%; transform: translateX(-25%); top: 12px; width: 60%;
95
+ font-family: 'DM Mono', monospace; font-weight: 400; font-size: 12px; letter-spacing: 0.05em;
96
+ text-transform: uppercase; color: #282A2D; white-space: nowrap;">
97
+ {{ table_info }}
98
+ </div>
99
+ </div>
100
+
101
+ <!-- Filter Section -->
102
+ <div class="filter-section"
103
+ style="display: flex; flex-direction: row; align-items: center; gap: 16px; padding: 16px; border: 1px dashed #0E1013; border-radius: 5px; width: fit-content; margin: 20px auto; box-sizing: border-box;">
104
+
105
+ <!-- Filter Field -->
106
+ <div style="display: flex; flex-direction: column; gap: 4px; flex-grow: 0;">
107
+ <label for="filter-field"
108
+ style="font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">
109
+ Filter Field
110
+ </label>
111
+ <select id="filter-field">
112
+ <option></option>
113
+ {% for col in column_names %}
114
+ <option value="{{ col }}">{{ col }}</option>
115
+ {% endfor %}
116
+ </select>
117
+ </div>
118
+
119
+ <!-- Filter Type -->
120
+ <div style="display: flex; flex-direction: column; gap: 4px; flex-grow: 0;">
121
+ <label for="filter-type"
122
+ style="font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">
123
+ Filter Type
124
+ </label>
125
+ <select id="filter-type">
126
+ <option value="=">=</option>
127
+ <option value="<"><</option>
128
+ <option value="<="><=</option>
129
+ <option value=">">></option>
130
+ <option value=">=">>=</option>
131
+ <option value="!=">!=</option>
132
+ <option value="like">like</option>
133
+ </select>
134
+ </div>
135
+
136
+ <!-- Filter Value -->
137
+ <div style="display: flex; flex-direction: column; gap: 4px; flex-grow: 0;">
138
+ <label for="filter-value"
139
+ style="font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">
140
+ Filter Value
141
+ </label>
142
+ <input id="filter-value" type="text" placeholder="value to filter"
143
+ style="padding: 8px; border: 1px solid #DBDDE1; border-radius: 4px; background: #FFFFFF; font-family: 'DM Mono'; font-size: 12px; color: #0E1013;">
144
+ </div>
145
+
146
+ <!-- Clear Button -->
147
+ <div style="display: flex; align-items: flex-end; flex-grow: 0;">
148
+ <button id="filter-clear"
149
+ style="padding: 8px 16px; border: 1px solid #DBDDE1; border-radius: 4px; background: #FFFFFF; font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">
150
+ Clear Filter
151
+ </button>
152
+ </div>
153
+
154
+ </div>
155
+
156
+ <!-- Table Placeholder (for reference) -->
157
+ <div id="my-table" style="width: 1648px; margin: 20px auto;">
158
+ <!-- Table content will go here -->
159
+ </div>
160
+
161
+ <div style="margin: 20px auto; text-align: center;">
162
+ <button id="download-csv" style="padding: 8px 16px; border: 1px solid #DBDDE1; border-radius: 4px; background: #FFFFFF; font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">Download CSV</button>
163
+ <button id="download-json" style="padding: 8px 16px; border: 1px solid #DBDDE1; border-radius: 4px; background: #FFFFFF; font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">Download JSON</button>
164
+ <button id="download-xlsx" style="padding: 8px 16px; border: 1px solid #DBDDE1; border-radius: 4px; background: #FFFFFF; font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">Download XLSX</button>
165
+ <button id="download-html" style="padding: 8px 16px; border: 1px solid #DBDDE1; border-radius: 4px; background: #FFFFFF; font-family: 'DM Mono'; font-size: 12px; text-transform: uppercase; color: #0E1013;">Download HTML</button>
166
+ </div>
167
+
168
+ </body>
169
+
170
+ <script>
171
+ const columns = {{ columns|safe }};
172
+ columns.forEach(column => {
173
+ if (column.customFormatter === "millify") {
174
+ column.formatter = millify;
175
+ delete column.customFormatter;
176
+ }
177
+ });
178
+ const None = null;
179
+ const table = new Tabulator("#my-table",
180
+ {
181
+ columns: columns,
182
+ data: {{ rows|safe }},
183
+ pagination: "local",
184
+ paginationSize: 50,
185
+ paginationSizeSelector: [50, 100, 150, 200],
186
+ movableColumns: true,
187
+ paginationCounter: "rows",
188
+ layout: "fitDataFill",
189
+ {% if tree %} dataTree: true, {% endif %}
190
+ }
191
+ )
192
+ //Define variables for input elements
193
+ const fieldEl = document.getElementById("filter-field");
194
+ const typeEl = document.getElementById("filter-type");
195
+ const valueEl = document.getElementById("filter-value");
196
+
197
+ //Custom filter example
198
+ function customFilter(data) {
199
+ return data.car && data.rating < 3;
200
+ }
201
+
202
+ //Trigger setFilter function with correct parameters
203
+ function updateFilter() {
204
+ var filterVal = fieldEl.options[fieldEl.selectedIndex].value;
205
+ var typeVal = typeEl.options[typeEl.selectedIndex].value;
206
+
207
+ var filter = filterVal == "function" ? customFilter : filterVal;
208
+
209
+ if (filterVal == "function") {
210
+ typeEl.disabled = true;
211
+ valueEl.disabled = true;
212
+ } else {
213
+ typeEl.disabled = false;
214
+ valueEl.disabled = false;
215
+ }
216
+
217
+ if (filterVal) {
218
+ table.setFilter(filter, typeVal, valueEl.value);
219
+ }
220
+ }
221
+
222
+ function millify(cell, formatterParams, onRendered) {
223
+ const millNames = ["", "K", "M", "B", "T"];
224
+ const n = cell.getValue();
225
+ const nAbs = Math.abs(n);
226
+ const millIdx = Math.max(0, Math.min(millNames.length - 1, Math.floor(nAbs === 0 ? 0 : Math.log10(nAbs) / 3)));
227
+
228
+ return (n / Math.pow(10, 3 * millIdx)).toFixed(2) + millNames[millIdx];
229
+ }
230
+
231
+ //Update filters on value change
232
+ document.getElementById("filter-field").addEventListener("change", updateFilter);
233
+ document.getElementById("filter-type").addEventListener("change", updateFilter);
234
+ document.getElementById("filter-value").addEventListener("keyup", updateFilter);
235
+
236
+ //Clear filters on "Clear Filters" button click
237
+ document.getElementById("filter-clear").addEventListener("click", function () {
238
+ fieldEl.value = "";
239
+ typeEl.value = "=";
240
+ valueEl.value = "";
241
+
242
+ table.clearFilter();
243
+ });
244
+
245
+ //trigger download of data.csv file
246
+ document.getElementById("download-csv").addEventListener("click", function () {
247
+ table.download("csv", "{{ title }}.csv");
248
+ });
249
+
250
+ //trigger download of data.json file
251
+ document.getElementById("download-json").addEventListener("click", function () {
252
+ table.download("json", "{{ title }}.json");
253
+ });
254
+
255
+ //trigger download of data.xlsx file
256
+ document.getElementById("download-xlsx").addEventListener("click", function () {
257
+ table.download("xlsx", "{{ title }}.xlsx", {sheetName: "My Data"});
258
+ });
259
+
260
+ //trigger download of data.html file
261
+ document.getElementById("download-html").addEventListener("click", function () {
262
+ table.download("html", "{{ title }}.html", {style: true});
263
+ });
264
+
265
+ </script>
266
+
267
+ </html>