Skip to content

Commit c405887

Browse files
committed
update styles, add view page styles
1 parent 79d4154 commit c405887

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

plugins/wpgraphql-logging/assets/css/settings/wp-graphql-logging-settings.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.settings_page_wpgraphql-logging #poststuff .postbox .inside h2 {
2-
font-size: 1.3em;
1+
.graphql-logs_page_wpgraphql-logging #poststuff .postbox .inside h2 {
2+
font-size: 16.9px;
33
font-weight: 600;
44
padding-left: 0;
55
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.wpgraphql-logging-view-header {
2+
display: flex;
3+
justify-content: space-between;
4+
align-items: center;
5+
margin-bottom: 20px;
6+
}
7+
8+
.wpgraphql-logging-view-table pre.wpgraphql-logging-query,
9+
.wpgraphql-logging-view-table pre.wpgraphql-logging-context,
10+
.wpgraphql-logging-view-table pre.wpgraphql-logging-extra {
11+
white-space: pre-wrap;
12+
max-height: 540px;
13+
overflow-y: scroll;
14+
padding: 15px;
15+
border: 1px solid #ddd;
16+
border-radius: 4px;
17+
}

plugins/wpgraphql-logging/src/Admin/View/Templates/WPGraphQLLoggerView.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
?>
1515
<div class="wrap">
16-
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
16+
<div class="wpgraphql-logging-view-header">
1717
<h1><?php esc_html_e( 'Log Entry', 'wpgraphql-logging' ); ?></h1>
1818
<a href="
1919
<?php
@@ -33,7 +33,7 @@
3333
</a>
3434
</div>
3535

36-
<table class="widefat striped">
36+
<table class="widefat striped wpgraphql-logging-view-table">
3737
<tbody>
3838
<tr>
3939
<th><?php esc_html_e( 'ID', 'wpgraphql-logging' ); ?></th>
@@ -61,15 +61,15 @@
6161
</tr>
6262
<tr>
6363
<th><?php esc_html_e( 'Query', 'wpgraphql-logging' ); ?></th>
64-
<td><pre style="overflow-x: auto; background: #f4f4f4; padding: 15px; border: 1px solid #ddd; border-radius: 4px;"><?php echo esc_html( (string) $log->get_query() ); ?></pre></td>
64+
<td><pre class="wpgraphql-logging-query"><?php echo esc_html( (string) $log->get_query() ); ?></pre></td>
6565
</tr>
6666
<tr>
6767
<th><?php esc_html_e( 'Context', 'wpgraphql-logging' ); ?></th>
68-
<td><pre><?php echo esc_html( (string) wp_json_encode( $log->get_context(), JSON_PRETTY_PRINT ) ); ?></pre></td>
68+
<td><pre class="wpgraphql-logging-context"><?php echo esc_html( (string) wp_json_encode( $log->get_context(), JSON_PRETTY_PRINT ) ); ?></pre></td>
6969
</tr>
7070
<tr>
7171
<th><?php esc_html_e( 'Extra', 'wpgraphql-logging' ); ?></th>
72-
<td><pre><?php echo esc_html( (string) wp_json_encode( $log->get_extra(), JSON_PRETTY_PRINT ) ); ?></pre></td>
72+
<td><pre class="wpgraphql-logging-extra"><?php echo esc_html( (string) wp_json_encode( $log->get_extra(), JSON_PRETTY_PRINT ) ); ?></pre></td>
7373
</tr>
7474
</tbody>
7575
</table>

plugins/wpgraphql-logging/src/Admin/ViewLogsPage.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ public function enqueue_admin_scripts_styles( string $hook_suffix ): void {
161161
);
162162
}
163163

164+
if ( file_exists( trailingslashit( WPGRAPHQL_LOGGING_PLUGIN_DIR ) . 'assets/css/view/wp-graphql-logging-view.css' ) ) {
165+
wp_enqueue_style(
166+
'wpgraphql-graphql-logging-view',
167+
trailingslashit( WPGRAPHQL_LOGGING_PLUGIN_URL ) . 'assets/css/view/wp-graphql-logging-view.css',
168+
[],
169+
WPGRAPHQL_LOGGING_VERSION
170+
);
171+
}
164172

165173
// Allow other plugins to enqueue their own scripts/styles.
166174
do_action( 'wpgraphql_logging_view_logs_admin_enqueue_scripts', $hook_suffix );

0 commit comments

Comments
 (0)