Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mcartmel authored and scroix committed Apr 1, 2024
1 parent 783a972 commit 1933a3c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
6 changes: 3 additions & 3 deletions nodel-webui-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion nodel-webui-js/src/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,15 @@
</li>
<li class="form">
<div>
<select class="form-control uipicker goto" type="text"/>
<div class="btn-group btn-group-justified uipicker">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" disabled="disabled">
Select UI <span class="caret"></span>
</button>
<ul class="dropdown-menu">
</ul>
</div>
</div>
</div>
</li>
<li role="separator" class="divider"></li>
Expand Down
22 changes: 9 additions & 13 deletions nodel-webui-js/src/nodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1532,12 +1532,6 @@ var setEvents = function(){
$('body').on('shown.bs.dropdown', '.edtgrp', function () {
$(this).find('.renamenode').val(nodename).get(0).focus();
});
$('body').on('click', '.uipicker', function (e) {
e.stopPropagation();
});
$('body').on('change', '.uipicker', function (e) {
window.location.href = $(this).val();
});
$('body').on('keyup', '.renamenode', function(e) {
var charCode = e.charCode || e.keyCode;
if(charCode == 13) $(this).closest('.form').find('.renamenodesubmit').click();
Expand Down Expand Up @@ -1858,10 +1852,10 @@ var fillPicker = function() {

var fillUIPicker = function() {
// fill UI file list
var pickers = $('select.uipicker');
var pickers = $('.uipicker');
$.each(pickers, function(i,picker) {
$(picker).empty();
$(picker).append('<option value="" selected disabled hidden>select UI</option>');
var pickerlist = $(picker).find('.dropdown-menu');
$(pickerlist).empty();
$.getJSON(proto+'//' + host + '/REST/nodes/' + encodeURIComponent(node) + '/files', function (data) {
data.sort(function(a, b){
if (a['path'] == b['path']) return 0;
Expand All @@ -1870,13 +1864,13 @@ var fillUIPicker = function() {
});
$.each(data, function(i, file){
if(file['path'].match(/content\/(?!index\.htm|nodes\.xml|index-sample.xml|index-sample\.xml\.htm)\w*\.(xml|html|htm)/g)) {
$(picker).append('<option value="'+file['path'].replace('content/','')+'">'+file['path'].replace('content/','')+'</option>');
$(pickerlist).append('<li><a href="'+file['path'].replace('content/','')+'">'+file['path'].replace('content/','')+'</a></li>');
}
});
if($(picker).find('option').length == 1 ) {
$(picker).prop('disabled', true);
if($(pickerlist).find('li').length == 0) {
$(picker).find('.dropdown-toggle').prop('disabled', 'disabled');
} else {
$(picker).removeAttr('disabled');
$(picker).find('.dropdown-toggle').removeAttr('disabled');
}
});
});
Expand Down Expand Up @@ -2171,6 +2165,8 @@ var throttleLog = function(log, ani){
log.unprocessed = true;
log.id = log.source + '_' + log.type + '_' + log.alias;
log.ani = ani;
if(typeof throttle['logs'][log.id] !== 'undefined' && _.isMatch(log.arg, throttle['logs'][log.id]['arg'])) log.changed = false;
else log.changed = true;
throttle['logs'][log.id] = log;
if(!document.hidden) throttleLogProcess(ani);
};
Expand Down
10 changes: 10 additions & 0 deletions nodel-webui-js/src/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,16 @@ div.nodel-charts {
display: none;
}

.uipicker > .btn-group .btn {
text-align: left;
position: relative;
.caret {
float: right;
margin-top: @padding-base-vertical;
}
}


@keyframes spinner {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
Expand Down

0 comments on commit 1933a3c

Please sign in to comment.