-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive-orbis_monitor.php
More file actions
110 lines (87 loc) · 2.84 KB
/
archive-orbis_monitor.php
File metadata and controls
110 lines (87 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
global $post;
get_header();
?>
<div class="card">
<div class="card-block">
<?php get_template_part( 'templates/search_form' ); ?>
</div>
<?php if ( have_posts() ) : ?>
<div class="table-responsive">
<table class="table table-striped table-condense table-hover">
<thead>
<tr>
<th><?php esc_html_e( 'Title', 'orbis-5' ); ?></th>
<th><?php esc_html_e( 'URL', 'orbis-5' ); ?></th>
<th><?php esc_html_e( 'Required response code', 'orbis-5' ); ?></th>
<th><?php esc_html_e( 'Last response code', 'orbis-5' ); ?></th>
<th><?php esc_html_e( 'Last response message', 'orbis-5' ); ?></th>
<th><?php esc_html_e( 'Last response duration', 'orbis-5' ); ?></th>
<th><?php esc_html_e( 'Last time checked', 'orbis-5' ); ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while ( have_posts() ) :
the_post();
?>
<tr id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<td>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php get_template_part( 'templates/table-cell-comments' ); ?>
</td>
<td>
<?php
$url = get_post_meta( $post->ID, '_orbis_monitor_url', true );
$link = sprintf(
'<a href="%s">%s</a>',
$url,
$url
);
echo empty( $url ) ? '—' : wp_kses_post( $link );
?>
</td>
<td>
<?php echo get_post_meta( $post->ID, '_orbis_monitor_required_response_code' ) ? esc_html( get_post_meta( $post->ID, '_orbis_monitor_required_response_code', true ) ) : ''; ?>
</td>
<td>
<?php echo get_post_meta( $post->ID, '_orbis_monitor_response_code' ) ? esc_html( get_post_meta( $post->ID, '_orbis_monitor_response_code', true ) ) : ''; ?>
</td>
<td>
<?php echo get_post_meta( $post->ID, '_orbis_monitor_response_message' ) ? esc_html( get_post_meta( $post->ID, '_orbis_monitor_response_message', true ) ) : ''; ?>
</td>
<td>
<?php
$duration = get_post_meta( $post->ID, '_orbis_monitor_duration', true );
if ( empty( $duration ) ) {
echo '—';
} else {
echo esc_html( number_format_i18n( $duration, 2 ) );
}
?>
</td>
<td>
<?php
$time = get_post_meta( $post->ID, '_orbis_monitor_response_date', true );
if ( empty( $time ) ) {
echo '—';
} else {
echo esc_html( date_i18n( __( 'd-m-Y H:i', 'orbis-5' ), $time ) );
}
?>
</td>
<td>
<?php get_template_part( 'templates/table-cell-actions' ); ?>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<?php else : ?>
<?php get_template_part( 'templates/content-none' ); ?>
<?php endif; ?>
</div>
<?php orbis_content_nav(); ?>
<?php get_footer(); ?>