2022-11-23 00:18:34 +00:00
|
|
|
<div class="flex hmax">
|
2022-12-08 15:41:08 +00:00
|
|
|
<div class="center">
|
|
|
|
<div id="instances"></div>
|
|
|
|
<div id="instances-item">
|
|
|
|
<a href="#instance/software={software};instance={instance};content=filter-users">
|
|
|
|
<div class="flex">
|
|
|
|
<img data-src="img/software-{software}.png"/>
|
|
|
|
<div class="flex" style="padding: 0 2em">
|
|
|
|
<span class="center">{instance}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="flex" style="margin-top: .5em">
|
|
|
|
<button class="btn green center w100"
|
|
|
|
onclick="window.location.hash = '#add'">
|
|
|
|
<i class="fa fa-plus fa-fw"></i>New instance
|
|
|
|
</button>
|
2022-11-23 00:18:34 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
2022-11-24 23:21:52 +00:00
|
|
|
function title__home() { apcontrol_title('Panel') }
|
2022-11-23 00:18:34 +00:00
|
|
|
function load__home() {
|
|
|
|
http.get('api/v1/config/get',{},function(data) {
|
|
|
|
window.vars['instance_config'] = JSON.parse(data);
|
|
|
|
E.template('instances', function(TPL) {
|
|
|
|
var html = '';
|
|
|
|
for (var i = 0; i < window.vars.instance_config['supported_ap_software'].length; i++) {
|
|
|
|
const soft = window.vars.instance_config['supported_ap_software'][i];
|
|
|
|
for (var j = 0; j < window.vars.instance_config['hosts'][soft].length; j++) {
|
2022-12-08 15:41:08 +00:00
|
|
|
var tpl = TPL;
|
2022-11-23 00:18:34 +00:00
|
|
|
const hostcfg = window.vars.instance_config['hosts'][soft][j];
|
|
|
|
tpl = tpl.replaceAll('{software}', soft);
|
|
|
|
tpl = tpl.replaceAll('{software:cap}', capitalize(soft));
|
|
|
|
tpl = tpl.replaceAll('{instance}', hostcfg['instance']);
|
|
|
|
html += tpl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return html;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|