More UI stuff

This commit is contained in:
2024-08-12 13:53:37 -04:00
parent e86de04a69
commit 35d3a399e3
5 changed files with 103 additions and 106 deletions
+14 -17
View File
@@ -57,24 +57,24 @@
});
}
function DnsProviderPopulate(){
app.api.get('/dns?detail=true', function(error, res){
if(error) return app.util.actionMessage(error, $.scope.DnsProvider.$this, 'danger');
$.scope.DnsProvider.push(...res.results)
});
}
$.scope.DnsProvider.parseData = function(row){
row['created_on_text'] = moment(row['updated_on'], "x").fromNow();
$(document).ready(function(){
return row
};
(async function(){
})()
$(document).ready(async function(){
// Set the jq Templates
$.scope.providerField.put = function(){};
$.scope.DnsProvider.parseData = function(row){
row['created_on_text'] = moment(row['updated_on'], "x").fromNow();
return row
}
$.scope.DnsProvider.push(...(await app.api.get('/dns?detail=true')).results);
// Populate
DnsProviderPopulate(); //populate the table
providerGet();
app.subscribe(/^model:/, function(data, topic){
@@ -196,13 +196,10 @@
</div>
</div>
<div class="mb-3">
<b jq-repeat='Domain_{{id}}' jq-repeat-index="domain" class="m-1 badge text-bg-info rounded-pill" style="display:none;">
<b jq-repeat='Domain_{{id}}' jq-repeat-index="domain" class="m-1 badge text-bg-info rounded-pill">
{{domain}}
</b>
<script type="text/javascript">
$.scope.Domain_{{id}}.put = function($el){
$el.fadeIn(10000)
};
app.api.get(`dns/domain/byProvider/{{id}}`, function(error, domains){
$.scope.Domain_{{id}}.push(...domains.results);
});
+10 -10
View File
@@ -69,12 +69,12 @@
$.scope.hosts.push(hostParseRow(host));
}
$.scope.hosts.__setPut(function($el, item, list){
$.scope.hosts.put = function($el, item, list){
$el.addClass('table-success');
$el.fadeIn(2000, function(){
$el.removeClass('table-success');
});
});
};
});
}
@@ -130,25 +130,25 @@
$editHostForm.find('[name=is_wildcard').attr('disabled', true);
hostPopulate(); //populate the table
$.scope.hosts.__setTake(function($el, item, list){
$.scope.hosts.take = function($el, item, list){
$el.addClass('table-danger');
$el.fadeOut(1000, function(){
$el.remove()
});
});
};
$.scope.hosts.__setUpdate(function($el, $render, item, list){
$.scope.hosts.update = function($el, $render, item, list){
$render.show()
$el.replaceWith($render);
});
};
$.scope.editHost.__setPut(function($el, item, list){
$.scope.editHost.put = function($el, item, list){
$el.slideDown();
});
};
$.scope.editHost.__setTake(function($el, item, list){
$.scope.editHost.take = function($el, item, list){
$el.slideUp();
});
};
// app.subscribe(/^model:Host/, function(data, topic){
// console.log(topic, data);