Use new code style
This commit is contained in:
@ -7,76 +7,76 @@
|
||||
?>
|
||||
<div id="wu-dns-table" class="wu-widget-list-table wu-advanced-filters wu--m-3 wu-mt-2 wu--mb-3 wu-border-0 wu-border-t wu-border-solid wu-border-gray-400">
|
||||
|
||||
<table class="wp-list-table widefat fixed striped wu-border-t-0" v-cloak>
|
||||
<table class="wp-list-table widefat fixed striped wu-border-t-0" v-cloak>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="wu-w-4/12"><?php _e('Host', 'wp-ultimo'); ?></th>
|
||||
<th class="wu-w-2/12"><?php _e('Type', 'wp-ultimo'); ?></th>
|
||||
<th class="wu-w-4/12"><?php _e('IP / Target', 'wp-ultimo'); ?></th>
|
||||
<th class="wu-w-2/12"><?php _e('TTL', 'wp-ultimo'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="wu-w-4/12"><?php _e('Host', 'wp-ultimo'); ?></th>
|
||||
<th class="wu-w-2/12"><?php _e('Type', 'wp-ultimo'); ?></th>
|
||||
<th class="wu-w-4/12"><?php _e('IP / Target', 'wp-ultimo'); ?></th>
|
||||
<th class="wu-w-2/12"><?php _e('TTL', 'wp-ultimo'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody v-if="loading">
|
||||
<tbody v-if="loading">
|
||||
|
||||
<tr>
|
||||
<tr>
|
||||
|
||||
<td colspan="4">
|
||||
<td colspan="4">
|
||||
|
||||
<?php _e('Loading DNS entries...', 'wp-ultimo'); ?>
|
||||
<?php _e('Loading DNS entries...', 'wp-ultimo'); ?>
|
||||
|
||||
</td>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</tbody>
|
||||
|
||||
<tbody v-if="!loading && error">
|
||||
<tbody v-if="!loading && error">
|
||||
|
||||
<tr>
|
||||
<tr>
|
||||
|
||||
<td colspan="4">
|
||||
<td colspan="4">
|
||||
|
||||
<div class="wu-mt-0 wu-p-4 wu-bg-red-100 wu-border wu-border-solid wu-border-red-200 wu-rounded-sm wu-text-red-500" v-html="error[0].message"></div>
|
||||
<div class="wu-mt-0 wu-p-4 wu-bg-red-100 wu-border wu-border-solid wu-border-red-200 wu-rounded-sm wu-text-red-500" v-html="error[0].message"></div>
|
||||
|
||||
</td>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</tbody>
|
||||
|
||||
<tbody v-if="!loading && !error">
|
||||
<tbody v-if="!loading && !error">
|
||||
|
||||
<tr v-for="dns in results.entries">
|
||||
<td>{{ dns.host }}<span v-html="dns.tag" v-if="dns.tag"></span></td>
|
||||
<td>{{ dns.type }}</td>
|
||||
<td>{{ dns.data }}</td>
|
||||
<td>{{ dns.ttl }}</td>
|
||||
</tr>
|
||||
<tr v-for="dns in results.entries">
|
||||
<td>{{ dns.host }}<span v-html="dns.tag" v-if="dns.tag"></span></td>
|
||||
<td>{{ dns.type }}</td>
|
||||
<td>{{ dns.data }}</td>
|
||||
<td>{{ dns.ttl }}</td>
|
||||
</tr>
|
||||
|
||||
<tr v-for="dns in results.auth">
|
||||
<td>{{ dns.host }}<span v-html="dns.tag" v-if="dns.tag"></span></td>
|
||||
<td>{{ dns.type }}</td>
|
||||
<td>{{ dns.data }}</td>
|
||||
<td>{{ dns.ttl }}</td>
|
||||
</tr>
|
||||
<tr v-for="dns in results.auth">
|
||||
<td>{{ dns.host }}<span v-html="dns.tag" v-if="dns.tag"></span></td>
|
||||
<td>{{ dns.type }}</td>
|
||||
<td>{{ dns.data }}</td>
|
||||
<td>{{ dns.ttl }}</td>
|
||||
</tr>
|
||||
|
||||
<tr v-for="dns in results.additional">
|
||||
<td>{{ dns.host }}<span v-html="dns.tag" v-if="dns.tag"></span></td>
|
||||
<td>{{ dns.type }}</td>
|
||||
<td>{{ dns.data }}</td>
|
||||
<td>{{ dns.ttl }}</td>
|
||||
</tr>
|
||||
<tr v-for="dns in results.additional">
|
||||
<td>{{ dns.host }}<span v-html="dns.tag" v-if="dns.tag"></span></td>
|
||||
<td>{{ dns.type }}</td>
|
||||
<td>{{ dns.data }}</td>
|
||||
<td>{{ dns.ttl }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><?php _e('Your Network IP', 'wp-ultimo'); ?></td>
|
||||
<td colspan="2" class="wu-text-left">{{ results.network_ip }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><?php _e('Your Network IP', 'wp-ultimo'); ?></td>
|
||||
<td colspan="2" class="wu-text-left">{{ results.network_ip }}</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
@ -84,48 +84,48 @@
|
||||
|
||||
(function($) {
|
||||
|
||||
wu_dns_table = new Vue({
|
||||
el: '#wu-dns-table',
|
||||
data: {
|
||||
error: null,
|
||||
results: {},
|
||||
loading: true,
|
||||
},
|
||||
updated() {
|
||||
this.$nextTick(function() {
|
||||
wu_dns_table = new Vue({
|
||||
el: '#wu-dns-table',
|
||||
data: {
|
||||
error: null,
|
||||
results: {},
|
||||
loading: true,
|
||||
},
|
||||
updated() {
|
||||
this.$nextTick(function() {
|
||||
|
||||
window.wu_initialize_tooltip();
|
||||
window.wu_initialize_tooltip();
|
||||
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
$.ajax({
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'wu_get_dns_records',
|
||||
domain: '<?php echo esc_js($domain->get_domain()); ?>',
|
||||
},
|
||||
success: function(data) {
|
||||
$.ajax({
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'wu_get_dns_records',
|
||||
domain: '<?php echo esc_js($domain->get_domain()); ?>',
|
||||
},
|
||||
success: function(data) {
|
||||
|
||||
Vue.set(wu_dns_table, 'loading', false);
|
||||
Vue.set(wu_dns_table, 'loading', false);
|
||||
|
||||
if (data.success) {
|
||||
if (data.success) {
|
||||
|
||||
Vue.set(wu_dns_table, 'results', data.data);
|
||||
Vue.set(wu_dns_table, 'results', data.data);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
Vue.set(wu_dns_table, 'error', data.data);
|
||||
Vue.set(wu_dns_table, 'error', data.data);
|
||||
|
||||
} // end if;
|
||||
} // end if;
|
||||
|
||||
},
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
</script>
|
||||
|
@ -7,17 +7,17 @@
|
||||
?>
|
||||
<div id="wu-domain-log" class="">
|
||||
|
||||
<pre id="content" class="wu-overflow-auto wu-p-4 wu-m-0 wu-mt-3 wu-rounded wu-content-center wu-bg-gray-800 wu-text-white wu-font-mono wu-border wu-border-solid wu-border-gray-300 wu-max-h-screen wu-overflow-y-auto">
|
||||
<?php _e('Loading log contents...', 'wp-ultimo') ; ?>
|
||||
</pre>
|
||||
<pre id="content" class="wu-overflow-auto wu-p-4 wu-m-0 wu-mt-3 wu-rounded wu-content-center wu-bg-gray-800 wu-text-white wu-font-mono wu-border wu-border-solid wu-border-gray-300 wu-max-h-screen wu-overflow-y-auto">
|
||||
<?php _e('Loading log contents...', 'wp-ultimo'); ?>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="wu-box-border wu-p-4 wu-border-t wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300 wu-border-solid wu-bg-gray-200 wu-text-right wu--mx-3 wu-mt-3 wu--mb-3 wu-relative wu-overflow-hidden">
|
||||
|
||||
<button id="refresh-logs" type="submit" name="submit_button" value="refresh-logs" class="button wu-float-right">
|
||||
<?php _e('Refresh Logs', 'wp-ultimo'); ?>
|
||||
</button>
|
||||
<button id="refresh-logs" type="submit" name="submit_button" value="refresh-logs" class="button wu-float-right">
|
||||
<?php _e('Refresh Logs', 'wp-ultimo'); ?>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
@ -25,52 +25,52 @@
|
||||
|
||||
(function($) {
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
const refresh_logs = function(callback) {
|
||||
const refresh_logs = function(callback) {
|
||||
|
||||
$.ajax({
|
||||
url: ajaxurl,
|
||||
method: 'GET',
|
||||
data: {
|
||||
action: 'wu_handle_view_logs',
|
||||
file: '<?php echo esc_js($log_path); ?>domain-<?php echo esc_js($domain->get_domain()); ?>.log',
|
||||
return_ascii: 'no',
|
||||
},
|
||||
success(response) {
|
||||
$.ajax({
|
||||
url: ajaxurl,
|
||||
method: 'GET',
|
||||
data: {
|
||||
action: 'wu_handle_view_logs',
|
||||
file: '<?php echo esc_js($log_path); ?>domain-<?php echo esc_js($domain->get_domain()); ?>.log',
|
||||
return_ascii: 'no',
|
||||
},
|
||||
success(response) {
|
||||
|
||||
$('#content').html(response.data.contents);
|
||||
$('#content').html(response.data.contents);
|
||||
|
||||
if (typeof callback !== 'undefined') {
|
||||
if (typeof callback !== 'undefined') {
|
||||
|
||||
callback();
|
||||
callback();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
} // end refresh_logs;
|
||||
} // end refresh_logs;
|
||||
|
||||
refresh_logs();
|
||||
refresh_logs();
|
||||
|
||||
setInterval(refresh_logs, 60000);
|
||||
setInterval(refresh_logs, 60000);
|
||||
|
||||
$(document).on('click', '#refresh-logs', function(e) {
|
||||
$(document).on('click', '#refresh-logs', function(e) {
|
||||
|
||||
const block_content = wu_block_ui('#content');
|
||||
const block_content = wu_block_ui('#content');
|
||||
|
||||
e.preventDefault();
|
||||
e.preventDefault();
|
||||
|
||||
refresh_logs(function() {
|
||||
refresh_logs(function() {
|
||||
|
||||
block_content.unblock();
|
||||
block_content.unblock();
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
Reference in New Issue
Block a user