').text(value.street).html() + ' st., bld. ' + $('
').text(value.building).html();
55 | $(element).html(html);
56 | },
57 |
58 | /**
59 | Gets value from element's html
60 |
61 | @method html2value(html)
62 | **/
63 | html2value: function(html) {
64 | /*
65 | you may write parsing method to get value by element's html
66 | e.g. "Moscow, st. Lenina, bld. 15" => {city: "Moscow", street: "Lenina", building: "15"}
67 | but for complex structures it's not recommended.
68 | Better set value directly via javascript, e.g.
69 | editable({
70 | value: {
71 | city: "Moscow",
72 | street: "Lenina",
73 | building: "15"
74 | }
75 | });
76 | */
77 | return null;
78 | },
79 |
80 | /**
81 | Converts value to string.
82 | It is used in internal comparing (not for sending to server).
83 |
84 | @method value2str(value)
85 | **/
86 | value2str: function(value) {
87 | var str = '';
88 | if(value) {
89 | for(var k in value) {
90 | str = str + k + ':' + value[k] + ';';
91 | }
92 | }
93 | return str;
94 | },
95 |
96 | /*
97 | Converts string to value. Used for reading value from 'data-value' attribute.
98 |
99 | @method str2value(str)
100 | */
101 | str2value: function(str) {
102 | /*
103 | this is mainly for parsing value defined in data-value attribute.
104 | If you will always set value by javascript, no need to overwrite it
105 | */
106 | return str;
107 | },
108 |
109 | /**
110 | Sets value of input.
111 |
112 | @method value2input(value)
113 | @param {mixed} value
114 | **/
115 | value2input: function(value) {
116 | if(!value) {
117 | return;
118 | }
119 | this.$input.filter('[name="city"]').val(value.city);
120 | this.$input.filter('[name="street"]').val(value.street);
121 | this.$input.filter('[name="building"]').val(value.building);
122 | },
123 |
124 | /**
125 | Returns value of input.
126 |
127 | @method input2value()
128 | **/
129 | input2value: function() {
130 | return {
131 | city: this.$input.filter('[name="city"]').val(),
132 | street: this.$input.filter('[name="street"]').val(),
133 | building: this.$input.filter('[name="building"]').val()
134 | };
135 | },
136 |
137 | /**
138 | Activates input: sets focus on the first field.
139 |
140 | @method activate()
141 | **/
142 | activate: function() {
143 | this.$input.filter('[name="city"]').focus();
144 | },
145 |
146 | /**
147 | Attaches handler to submit form in case of 'showbuttons=false' mode
148 |
149 | @method autosubmit()
150 | **/
151 | autosubmit: function() {
152 | this.$input.keydown(function (e) {
153 | if (e.which === 13) {
154 | $(this).closest('form').submit();
155 | }
156 | });
157 | }
158 | });
159 |
160 | Address.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
161 | tpl: '
City:
'+
162 | '
Street:
'+
163 | '
Building:
',
164 |
165 | inputclass: ''
166 | });
167 |
168 | $.fn.editabletypes.address = Address;
169 |
170 | }(window.jQuery));
--------------------------------------------------------------------------------
/templates/x-editable/inputs-ext/typeaheadjs/lib/typeahead.js-bootstrap.css:
--------------------------------------------------------------------------------
1 | .twitter-typeahead .tt-query,
2 | .twitter-typeahead .tt-hint {
3 | margin-bottom: 0;
4 | }
5 |
6 | .tt-dropdown-menu {
7 | min-width: 160px;
8 | margin-top: 2px;
9 | padding: 5px 0;
10 | background-color: #fff;
11 | border: 1px solid #ccc;
12 | border: 1px solid rgba(0,0,0,.2);
13 | *border-right-width: 2px;
14 | *border-bottom-width: 2px;
15 | -webkit-border-radius: 6px;
16 | -moz-border-radius: 6px;
17 | border-radius: 6px;
18 | -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
19 | -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
20 | box-shadow: 0 5px 10px rgba(0,0,0,.2);
21 | -webkit-background-clip: padding-box;
22 | -moz-background-clip: padding;
23 | background-clip: padding-box;
24 | }
25 |
26 | .tt-suggestion {
27 | display: block;
28 | padding: 3px 20px;
29 | }
30 |
31 | .tt-suggestion.tt-is-under-cursor {
32 | color: #fff;
33 | background-color: #0081c2;
34 | background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
35 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
36 | background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
37 | background-image: -o-linear-gradient(top, #0088cc, #0077b3);
38 | background-image: linear-gradient(to bottom, #0088cc, #0077b3);
39 | background-repeat: repeat-x;
40 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0)
41 | }
42 |
43 | .tt-suggestion.tt-is-under-cursor a {
44 | color: #fff;
45 | }
46 |
47 | .tt-suggestion p {
48 | margin: 0;
49 | }
50 |
--------------------------------------------------------------------------------
/templates/x-editable/inputs-ext/typeaheadjs/typeaheadjs.js:
--------------------------------------------------------------------------------
1 | /**
2 | Typeahead.js input, based on [Twitter Typeahead](http://twitter.github.io/typeahead.js).
3 | It is mainly replacement of typeahead in Bootstrap 3.
4 |
5 |
6 | @class typeaheadjs
7 | @extends text
8 | @since 1.5.0
9 | @final
10 | @example
11 |
12 |
30 | **/
31 | (function ($) {
32 | "use strict";
33 |
34 | var Constructor = function (options) {
35 | this.init('typeaheadjs', options, Constructor.defaults);
36 | };
37 |
38 | $.fn.editableutils.inherit(Constructor, $.fn.editabletypes.text);
39 |
40 | $.extend(Constructor.prototype, {
41 | render: function() {
42 | this.renderClear();
43 | this.setClass();
44 | this.setAttr('placeholder');
45 | this.$input.typeahead(this.options.typeahead);
46 |
47 | // copy `input-sm | input-lg` classes to placeholder input
48 | if($.fn.editableform.engine === 'bs3') {
49 | if(this.$input.hasClass('input-sm')) {
50 | this.$input.siblings('input.tt-hint').addClass('input-sm');
51 | }
52 | if(this.$input.hasClass('input-lg')) {
53 | this.$input.siblings('input.tt-hint').addClass('input-lg');
54 | }
55 | }
56 | }
57 | });
58 |
59 | Constructor.defaults = $.extend({}, $.fn.editabletypes.list.defaults, {
60 | /**
61 | @property tpl
62 | @default
63 | **/
64 | tpl:'
',
65 | /**
66 | Configuration of typeahead itself.
67 | [Full list of options](https://github.com/twitter/typeahead.js#dataset).
68 |
69 | @property typeahead
70 | @type object
71 | @default null
72 | **/
73 | typeahead: null,
74 | /**
75 | Whether to show `clear` button
76 |
77 | @property clear
78 | @type boolean
79 | @default true
80 | **/
81 | clear: true
82 | });
83 |
84 | $.fn.editabletypes.typeaheadjs = Constructor;
85 |
86 | }(window.jQuery));
--------------------------------------------------------------------------------
/templates/x-editable/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/bootstrap-wysihtml5-0.0.2.css:
--------------------------------------------------------------------------------
1 | ul.wysihtml5-toolbar {
2 | margin: 0;
3 | padding: 0;
4 | display: block;
5 | }
6 |
7 | ul.wysihtml5-toolbar::after {
8 | clear: both;
9 | display: table;
10 | content: "";
11 | }
12 |
13 | ul.wysihtml5-toolbar > li {
14 | float: left;
15 | display: list-item;
16 | list-style: none;
17 | margin: 0 5px 10px 0;
18 | }
19 |
20 | ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] {
21 | font-weight: bold;
22 | }
23 |
24 | ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] {
25 | font-style: italic;
26 | }
27 |
28 | ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] {
29 | text-decoration: underline;
30 | }
31 |
32 | ul.wysihtml5-toolbar a.btn.wysihtml5-command-active {
33 | background-image: none;
34 | -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
35 | -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
36 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
37 | background-color: #E6E6E6;
38 | background-color: #D9D9D9;
39 | outline: 0;
40 | }
41 |
42 | ul.wysihtml5-commands-disabled .dropdown-menu {
43 | display: none !important;
44 | }
45 |
46 | ul.wysihtml5-toolbar div.wysihtml5-colors {
47 | display:block;
48 | width: 50px;
49 | height: 20px;
50 | margin-top: 2px;
51 | margin-left: 5px;
52 | position: absolute;
53 | pointer-events: none;
54 | }
55 |
56 | ul.wysihtml5-toolbar a.wysihtml5-colors-title {
57 | padding-left: 70px;
58 | }
59 |
60 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] {
61 | background: black !important;
62 | }
63 |
64 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] {
65 | background: silver !important;
66 | }
67 |
68 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] {
69 | background: gray !important;
70 | }
71 |
72 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] {
73 | background: maroon !important;
74 | }
75 |
76 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] {
77 | background: red !important;
78 | }
79 |
80 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] {
81 | background: purple !important;
82 | }
83 |
84 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] {
85 | background: green !important;
86 | }
87 |
88 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] {
89 | background: olive !important;
90 | }
91 |
92 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] {
93 | background: navy !important;
94 | }
95 |
96 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] {
97 | background: blue !important;
98 | }
99 |
100 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] {
101 | background: orange !important;
102 | }
103 |
--------------------------------------------------------------------------------
/templates/x-editable/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/wysiwyg-color.css:
--------------------------------------------------------------------------------
1 | .wysiwyg-color-black {
2 | color: black;
3 | }
4 |
5 | .wysiwyg-color-silver {
6 | color: silver;
7 | }
8 |
9 | .wysiwyg-color-gray {
10 | color: gray;
11 | }
12 |
13 | .wysiwyg-color-white {
14 | color: white;
15 | }
16 |
17 | .wysiwyg-color-maroon {
18 | color: maroon;
19 | }
20 |
21 | .wysiwyg-color-red {
22 | color: red;
23 | }
24 |
25 | .wysiwyg-color-purple {
26 | color: purple;
27 | }
28 |
29 | .wysiwyg-color-fuchsia {
30 | color: fuchsia;
31 | }
32 |
33 | .wysiwyg-color-green {
34 | color: green;
35 | }
36 |
37 | .wysiwyg-color-lime {
38 | color: lime;
39 | }
40 |
41 | .wysiwyg-color-olive {
42 | color: olive;
43 | }
44 |
45 | .wysiwyg-color-yellow {
46 | color: yellow;
47 | }
48 |
49 | .wysiwyg-color-navy {
50 | color: navy;
51 | }
52 |
53 | .wysiwyg-color-blue {
54 | color: blue;
55 | }
56 |
57 | .wysiwyg-color-teal {
58 | color: teal;
59 | }
60 |
61 | .wysiwyg-color-aqua {
62 | color: aqua;
63 | }
64 |
65 | .wysiwyg-color-orange {
66 | color: orange;
67 | }
--------------------------------------------------------------------------------
/templates/x-editable/inputs-ext/wysihtml5/wysihtml5.js:
--------------------------------------------------------------------------------
1 | /**
2 | Bootstrap wysihtml5 editor. Based on [bootstrap-wysihtml5](https://github.com/jhollingworth/bootstrap-wysihtml5).
3 | You should include **manually** distributives of `wysihtml5` and `bootstrap-wysihtml5`:
4 |
5 |
6 |
7 |
8 |
9 | And also include `wysihtml5.js` from `inputs-ext` directory of x-editable:
10 |
11 |
12 |
13 | **Note:** It's better to use fresh bootstrap-wysihtml5 from it's [master branch](https://github.com/jhollingworth/bootstrap-wysihtml5/tree/master/src) as there is update for correct image insertion.
14 |
15 | @class wysihtml5
16 | @extends abstractinput
17 | @final
18 | @since 1.4.0
19 | @example
20 |
21 |
29 | **/
30 | (function ($) {
31 | "use strict";
32 |
33 | var Wysihtml5 = function (options) {
34 | this.init('wysihtml5', options, Wysihtml5.defaults);
35 |
36 | //extend wysihtml5 manually as $.extend not recursive
37 | this.options.wysihtml5 = $.extend({}, Wysihtml5.defaults.wysihtml5, options.wysihtml5);
38 | };
39 |
40 | $.fn.editableutils.inherit(Wysihtml5, $.fn.editabletypes.abstractinput);
41 |
42 | $.extend(Wysihtml5.prototype, {
43 | render: function () {
44 | var deferred = $.Deferred(),
45 | msieOld;
46 |
47 | //generate unique id as it required for wysihtml5
48 | this.$input.attr('id', 'textarea_'+(new Date()).getTime());
49 |
50 | this.setClass();
51 | this.setAttr('placeholder');
52 |
53 | //resolve deffered when widget loaded
54 | $.extend(this.options.wysihtml5, {
55 | events: {
56 | load: function() {
57 | deferred.resolve();
58 | }
59 | }
60 | });
61 |
62 | this.$input.wysihtml5(this.options.wysihtml5);
63 |
64 | /*
65 | In IE8 wysihtml5 iframe stays on the same line with buttons toolbar (inside popover).
66 | The only solution I found is to add
. If you fine better way, please send PR.
67 | */
68 | msieOld = /msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase());
69 | if(msieOld) {
70 | this.$input.before('
');
71 | }
72 |
73 | return deferred.promise();
74 | },
75 |
76 | value2html: function(value, element) {
77 | $(element).html(value);
78 | },
79 |
80 | html2value: function(html) {
81 | return html;
82 | },
83 |
84 | value2input: function(value) {
85 | this.$input.data("wysihtml5").editor.setValue(value, true);
86 | },
87 |
88 | activate: function() {
89 | this.$input.data("wysihtml5").editor.focus();
90 | },
91 |
92 | isEmpty: function($element) {
93 | if($.trim($element.html()) === '') {
94 | return true;
95 | } else if($.trim($element.text()) !== '') {
96 | return false;
97 | } else {
98 | //e.g. '
', '
', '
'
99 | return !$element.height() || !$element.width();
100 | }
101 | }
102 | });
103 |
104 | Wysihtml5.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
105 | /**
106 | @property tpl
107 | @default
108 | **/
109 | tpl:'
',
110 | /**
111 | @property inputclass
112 | @default editable-wysihtml5
113 | **/
114 | inputclass: 'editable-wysihtml5',
115 | /**
116 | Placeholder attribute of input. Shown when input is empty.
117 |
118 | @property placeholder
119 | @type string
120 | @default null
121 | **/
122 | placeholder: null,
123 | /**
124 | Wysihtml5 default options.
125 | See https://github.com/jhollingworth/bootstrap-wysihtml5#options
126 |
127 | @property wysihtml5
128 | @type object
129 | @default {stylesheets: false}
130 | **/
131 | wysihtml5: {
132 | stylesheets: false //see https://github.com/jhollingworth/bootstrap-wysihtml5/issues/183
133 | }
134 | });
135 |
136 | $.fn.editabletypes.wysihtml5 = Wysihtml5;
137 |
138 | }(window.jQuery));
139 |
--------------------------------------------------------------------------------
/views/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine on
2 | RewriteRule \.(php)$ - [R=404]
--------------------------------------------------------------------------------
/views/access/index.css:
--------------------------------------------------------------------------------
1 | .add_user_form label {
2 | width: 120px;
3 | }
4 | .add_user_form input {
5 | width: 300px;
6 | }
7 | .add_group_form label {
8 | width: 200px;
9 | }
10 |
11 | .permission_checkbox {
12 | max-height: 350px;
13 | overflow-x: hidden;
14 | overflow-y: auto;
15 | }
16 |
17 | .add_group_form.simpleform .form-element {
18 | margin-top: 0px;
19 | margin-bottom: 0px;
20 | }
21 | .add_group_form.simpleform .form-element:nth-child(even) {
22 | background-color: #F0F0F0;
23 | }
24 |
25 | .add_group_form.simpleform .form-element label {
26 | margin: 0px;
27 | }
--------------------------------------------------------------------------------
/views/access/index.tpl.php:
--------------------------------------------------------------------------------
1 |
Users/Groups
2 |
3 |
4 |
5 |
Add new user
6 |
7 |
8 |
9 | Username
10 | Options
11 |
12 |
13 |
14 |
15 |
16 |
17 |
Add new access group
18 |
19 |
20 |
21 | Name
22 | Options
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/views/access/user_add.tpl.php:
--------------------------------------------------------------------------------
1 | Add a new user
2 |
2 | PHPMiner could not find a group where the same pools are configurated as currently in CGMiner/SGMiner, so you have to create a pool where this match.
3 |
You have the following possibilities:
4 | - You can delete a non-active pool from CGMiner/SGMiner
5 | - You can add a pool to CGMiner/SGMiner which is only within the selected group.
6 | - You can delete a pool within the selected group which is not configurated within CGMiner/SGMiner.
7 | - You can add a pool within the selected group which is configurated within CGMiner/SGMiner but no in the group.
8 |
9 |
10 |
11 | The result must be, that in both systems (CGMiner/SGMiner and group) the same pools exist. The order is NOT important.
12 | You can proceed if all pool entries have a green background.
13 |
14 |
CGMiner/SGMiner configurated pools:
15 |
33 |
34 |
Group configurated pools:
35 | - Please select a group -
36 | get_variable('cfg_groups') AS $cfg_group): ?>
37 |
38 |
39 | -
Search for best match
40 |
41 |
42 |
43 | Url
44 | Username
45 | options
46 |
47 |
48 |
49 |
50 | You didn't selected a group yet, or this group does not have any pools configurated.
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/views/main/init.css:
--------------------------------------------------------------------------------
1 |
2 | table:not(.layout_table).device_list td.enabled {
3 | background: #007E05 linear-gradient(#07A714, #007E05);
4 |
5 | }
6 |
7 | @-moz-keyframes blink {
8 | from { background: #A70707 ; color: #FFF; }
9 | to { background: #F5F5F5 ; color: #3F3F3F; }
10 | }
11 | @-webkit-keyframes blink {
12 | from { background: #A70707 ; color: #FFF; }
13 | to { background: #F5F5F5 ; color: #3F3F3F; }
14 | }
15 | @-o-keyframes blink {
16 | from { background: #A70707 ; color: #FFF; }
17 | to { background: #F5F5F5 ; color: #3F3F3F; }
18 | }
19 | @-ms-keyframes blink {
20 | from { background: #A70707 ; color: #FFF; }
21 | to { background: #F5F5F5 ; color: #3F3F3F; }
22 | }
23 | @keyframes blink {
24 | from { background: #A70707 ; color: #FFF; }
25 | to { background: #F5F5F5 ; color: #3F3F3F; }
26 | }
27 |
28 | table:not(.layout_table).device_list td.disabled {
29 | background: #A70707 linear-gradient(#A70707, #7E0000);
30 | animation: blink 2s step-end infinite;
31 | -moz-animation: blink 2s step-end infinite;
32 | -o-animation: blink 2s step-end infinite;
33 | -webkit-animation: blink 2s infinite;
34 | color: #FFF;
35 | }
36 |
37 |
38 | .device_list td.enabled .icon-check,
39 | .device_list td.disabled .icon-cancel,
40 | .device_list td.invalid .icon-cancel,
41 | .device_list td.invalid .icon-attention,
42 | .device_list td.clickable:hover .icon-check {
43 | color: #FFF;
44 | }
45 |
46 | .device_list .icon-check {
47 | color: #208102;
48 | }
49 |
50 | .device_list .icon-cancel {
51 | color: #DD0000;
52 | }
53 |
54 | .modal .form-element .unit {
55 | margin-left: 10px;
56 | }
57 |
58 | .remove_pool {
59 | margin-left: 10px;
60 | }
61 |
62 | .pool_switching_container {
63 | display: block;
64 | }
65 |
66 | .pool_switching_container.hidden {
67 | display: none;
68 | }
69 | .pool_switching_container label {
70 | margin-top: 3px;
71 | float: right;
72 | margin-left: 10px;
73 | }
74 | .pool_switching_container select {
75 | margin-bottom: 5px;
76 | padding: 2px 5px;
77 | float: right;
78 | }
79 |
80 | select.custom_commands {
81 | margin-bottom: 5px;
82 | padding: 2px 5px;
83 | margin-left: 10px;
84 | }
85 |
86 |
87 | .rig {
88 | padding: 10px;
89 | border: 1px solid #A5A5A5;
90 | box-shadow: 0px 0px 15px 0px #BEBEBE;
91 | border-radius: 5px;
92 | margin-bottom: 20px;
93 | background: #EEE9E2;
94 | }
95 |
96 | .rig_btn {
97 | display: inline-block;
98 | vertical-align: text-bottom;
99 | margin-left: 15px;
100 | cursor: pointer;
101 | }
102 |
103 | .device_list th {
104 | white-space: nowrap;
105 | }
106 |
107 | .rig_hashrate {
108 | margin-left: 30px;
109 | }
110 |
111 | .swap_rig {
112 | cursor: pointer;
113 | }
114 |
115 | div.rig > div.rig_header {
116 | float: left;
117 | }
118 | div.rig > div > h2 {
119 | display: inline;
120 | }
--------------------------------------------------------------------------------
/views/main/init.tpl.php:
--------------------------------------------------------------------------------
1 | get_variable('config'); ?>
2 |
3 |
Add a new rig
4 |
5 |
6 |
Rig's per page:
7 |
12 |
13 |
14 |
15 |
Reset all rig stats
16 |
17 |
18 |
--------------------------------------------------------------------------------
/views/main/settings.css:
--------------------------------------------------------------------------------
1 |
2 |
3 | table.config_table td.key {
4 | padding: 0px 0px 0px 10px;
5 | }
6 |
7 | table.config_table td.value {
8 | padding: 0px;
9 | }
10 |
11 | table.config_table td.value input {
12 | margin: 0px;
13 | width: 100%;
14 | }
15 |
16 | table.config_table td {
17 | vertical-align: middle;
18 | }
19 |
20 | table.config_table td label {
21 | margin-bottom: 0px;
22 | font-weight: normal;
23 | }
--------------------------------------------------------------------------------
/views/main/settings.js:
--------------------------------------------------------------------------------
1 | Soopfw.behaviors.main_settings = function() {
2 | if (phpminer.settings.rigs !== undefined) {
3 | $.each(phpminer.settings.rigs, function(rig, rig_data) {
4 | var configs_to_add = $.extend({}, phpminer.settings.possible_configs);
5 |
6 | if (rig_data.cgminer_conf === undefined) {
7 | rig_data.cgminer_conf = {};
8 | }
9 |
10 | $.each(rig_data.cgminer_conf, function(k, v) {
11 | if (k === 'pools' || phpminer.settings.possible_configs[k] === undefined) {
12 | return;
13 | }
14 | delete configs_to_add[k];
15 | add_config(rig, k, v);
16 | });
17 |
18 | $.each(configs_to_add, function(k, v) {
19 | $('.add_config_key[data-rig="' + rig + '"]').append('
' + k + ' - ' + v.description + ' ');
20 | });
21 |
22 | $('.add_config_key[data-rig="' + rig + '"]').change(function() {
23 | var key = $(this).val();
24 | $(this).val("");
25 | if(phpminer.settings.possible_configs[key] !== undefined) {
26 | add_config(rig, key);
27 | $('option[value="' + key + '"]', this).remove();
28 | $('*[data-toggle="tooltip"]').tooltip();
29 | }
30 |
31 | });
32 | });
33 | }
34 | $('#save_config').off('click').on('click', function() {
35 | var values = {};
36 | $('input, select', $('#system_settings')).each(function() {
37 | if ($(this).attr('type') === 'checkbox') {
38 | values[$(this).attr('name')] = ($(this).prop('checked')) ? $(this).val() : '0';
39 | }
40 | else {
41 | values[$(this).attr('name')] = $(this).val();
42 | }
43 | });
44 | ajax_request(murl('main', 'save_settings'), {settings: values}, function(result) {
45 | if (result !== undefined && result !== null && result['url'] !== undefined) {
46 | Soopfw.location(result.url);
47 | }
48 | else {
49 | success_alert('Configuration saved successfully.');
50 | }
51 | });
52 | });
53 |
54 | $('.save_cgminer_config').off('click').on('click', function() {
55 | var values = {};
56 | $('input', $('#cgminer_settings')).each(function() {
57 | values[$(this).attr('name')] = $(this).val();
58 | });
59 |
60 | var values = {};
61 | $('.rig_data').each(function() {
62 | var rig = $(this).data('tab_title');
63 | values[rig] = {};
64 | $('input, select', $('.cgminer_settings[data-rig="' + rig + '"] tbody')).each(function() {
65 | if ($(this).attr('type') === 'checkbox') {
66 | values[rig][$(this).attr('name')] = ($(this).prop('checked')) ? $(this).val() : '0';
67 | }
68 | else {
69 | values[rig][$(this).attr('name')] = $(this).val();
70 | }
71 | });
72 | });
73 | wait_dialog()
74 | ajax_request(murl('main', 'save_cgminer_settings'), {settings: values}, function() {
75 | success_alert('Configuration saved successfully.');
76 | });
77 | });
78 |
79 | $('.tabs').each(function() {
80 |
81 | var tab_headers = $('
');
82 | $('div[data-tab]').addClass('js').each(function() {
83 | tab_headers.append('' + $(this).data('tab_title') + ' ');
84 | });
85 | $(this).prepend(tab_headers);
86 | var that = this;
87 | $(".tab_links li", this).each(function() {
88 |
89 | $(this).click(function() {
90 | $('div[data-tab]', that).hide();
91 | $('div[data-tab="' + $(this).attr('id').split('-')[1] + '"]', that).show();
92 | $(this).addClass('selected').siblings().removeClass('selected');
93 | });
94 |
95 | });
96 | $('li:first-child', this).click();
97 | });
98 |
99 | var pre_val = 0;
100 | if (!empty(phpminer.settings.config['donation'])) {
101 | pre_val = parseInt(phpminer.settings.config['donation']);
102 | }
103 | $('#donation').noUiSlider({
104 | range: [5, 241],
105 | start: pre_val,
106 | handles: 1,
107 | margin: 2,
108 | step: 1,
109 | decimals: 1,
110 | slide: function() {
111 | var value = parseInt($(this).val());
112 | if (value === 5) {
113 | value = 0;
114 | }
115 | else {
116 | value--;
117 | }
118 |
119 | $('.donation_new_value_percent').html(Math.round(((100/1440) * value)*100)/100);
120 | $('.donation_new_value').html(Math.round(value));
121 | }
122 | }).change(function() {
123 | var value = parseInt($(this).val());
124 | if (value === 5) {
125 | value = 0;
126 | }
127 | else {
128 | value--;
129 | }
130 | $('#donation_val').val(value);
131 | });
132 | $('.donation_new_value_percent').html(Math.round(((100/1440) * pre_val)*100)/100);
133 | $('.donation_new_value').html(Math.round(pre_val));
134 |
135 | };
136 |
137 | function add_config(rig, key, value) {
138 | var html = '';
139 | html += ' ';
140 | if (typeof(phpminer.settings.possible_configs[key].values) === "object" || (phpminer.settings.possible_configs[key].values === PDT_BOOL && !phpminer.settings.possible_configs[key].multivalue)){
141 | html += ' ';
142 | if (phpminer.settings.possible_configs[key].values === PDT_BOOL) {
143 | html += ' True ';
144 | html += ' False ';
145 | }
146 | else {
147 | $.each(phpminer.settings.possible_configs[key].values, function(k2, v2) {
148 | html += ' ' + v2 + ' ';
149 | });
150 | }
151 | html += ' ';
152 | }
153 | else {
154 | if (value !== undefined) {
155 | value = ' value="' + value + '"';
156 | }
157 | else {
158 | value = '';
159 | }
160 | html += ' ';
161 | }
162 | html += ' ';
163 | $('.cgminer_settings_container[data-rig="' + rig + '"]').append(
164 | $('')
165 | .append('' + key+ ' ')
166 | .append(html)
167 | .append($(' ').off('click').on('click', function() {
168 | var key = $(this).parent().data('key');
169 | $('.add_config_key[data-rig="' + rig + '"]').append('' + key + ' - ' + phpminer.settings.possible_configs[key].description + ' ');
170 | $(this).parent().fadeOut('fast', function() {
171 | $(this).remove();
172 | });
173 | }))
174 | );
175 | }
--------------------------------------------------------------------------------
/views/main/settings.tpl.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | has_permission(AccessControl::PERM_CHANGE_MAIN_SETTINGS)): ?>
5 | get_variable('config'); ?>
6 |
7 | System settings
8 |
60 |
61 |
62 | has_permission(AccessControl::PERM_CHANGE_MINER_SETTINGS)): ?>
63 | get_variable('rigs'); ?>
64 |
65 | CGMiner/SGMiner config per rig
66 |
67 |
68 | No rigs are configurated, please configurate at least one rig.
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | Variable
77 | Value
78 | Options
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | Select config key which you want to add.
87 |
88 |
89 | Save CGMiner/SGMiner config
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/views/notify/settings.css:
--------------------------------------------------------------------------------
1 |
2 |
3 | table.config_table td.key {
4 | padding: 0px 0px 0px 10px;
5 | }
6 |
7 | table.config_table td.value {
8 | padding: 0px;
9 | }
10 |
11 | table.config_table td.value input,
12 | table.config_table td.value select {
13 | margin: 0px;
14 | width: 100%;
15 | }
16 |
17 | table.config_table .noUi-target {
18 | margin-left: 20px;
19 | width: 400px;
20 | }
21 |
22 | table.config_table td.value .noUi-target + input {
23 | width: 140px;
24 | }
25 |
26 | table.config_table td {
27 | vertical-align: middle;
28 | }
29 |
30 | table.config_table td label {
31 | margin-bottom: 0px;
32 | font-weight: normal;
33 | }
--------------------------------------------------------------------------------
/views/notify/settings.js:
--------------------------------------------------------------------------------
1 | Soopfw.behaviors.notify_settings = function() {
2 | $('#save_config').off('click').on('click', function() {
3 | var values = {};
4 | $('input, select', $('#system_settings')).each(function() {
5 | if ($(this).attr('type') === 'checkbox') {
6 | values[$(this).attr('name')] = ($(this).prop('checked')) ? $(this).val() : '0';
7 | }
8 | else {
9 | values[$(this).attr('name')] = $(this).val();
10 | }
11 | });
12 | ajax_request(murl('notify', 'save_settings'), {settings: values}, function() {
13 | success_alert('Configuration saved successfully.');
14 | });
15 | });
16 |
17 | $('.save_config_notify').off('click').on('click', function() {
18 | var values = {};
19 | $('.rig_data').each(function() {
20 | var rig = $(this).data('tab_title');
21 | values[rig] = {};
22 | $('input, select', $('.notification_settings[data-rig="' + rig + '"]')).each(function() {
23 | if ($(this).attr('type') === 'checkbox') {
24 | values[rig][$(this).attr('name')] = ($(this).prop('checked')) ? $(this).val() : '0';
25 | }
26 | else {
27 | values[rig][$(this).attr('name')] = $(this).val();
28 | }
29 | });
30 | });
31 |
32 | ajax_request(murl('notify', 'save_settings'), {settings: {rigs: values}}, function() {
33 | success_alert('Configuration saved successfully.');
34 | });
35 | });
36 |
37 | $('.tabs').each(function() {
38 |
39 | var tab_headers = $('');
40 | $('div[data-tab]').addClass('js').each(function() {
41 | tab_headers.append('' + $(this).data('tab_title') + ' ');
42 | });
43 | $(this).prepend(tab_headers);
44 | var that = this;
45 | $(".tab_links li", this).each(function() {
46 |
47 | $(this).click(function() {
48 | $('div[data-tab]', that).hide();
49 | $('div[data-tab="' + $(this).attr('id').split('-')[1] + '"]', that).show();
50 | $(this).addClass('selected').siblings().removeClass('selected');
51 | });
52 |
53 | });
54 | $('li:first-child', this).click();
55 | });
56 | };
--------------------------------------------------------------------------------
/views/pools/main.css:
--------------------------------------------------------------------------------
1 | #rig_based_help ul {
2 | list-style-type: none;
3 | }
4 |
5 | .pool_table {
6 | white-space: nowrap;
7 | }
8 |
9 | .panel-body .btn-sm {
10 | margin-bottom: 5px;
11 | }
12 |
13 | .panel-body .btn-danger {
14 | float: right;
15 | }
--------------------------------------------------------------------------------
/views/pools/main.tpl.php:
--------------------------------------------------------------------------------
1 | has_permission(AccessControl::PERM_CHANGE_POOL_GROUP)): ?>
2 | Add a group
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/views/system/setup.js:
--------------------------------------------------------------------------------
1 | Soopfw.behaviors.system_setup = function() {
2 | add_rig_dialog();
3 | };
4 |
5 |
--------------------------------------------------------------------------------
/views/system/setup.tpl.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/prdatur/phpminer/2cb2cf11c34c3e5aaee4c5314699cb295cdeeb8a/views/system/setup.tpl.php
--------------------------------------------------------------------------------
awesome
comment!