This repository was archived by the owner on Sep 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 5151if ( !$ results ) {
5252 die ( $ mysqli ->error );
5353}
54+
55+ $ update = isset ( $ _POST ['update ' ] );
56+
57+ echo '<div class="consoleLog"> ' ;
58+
5459$ wikis = [];
5560while ( $ data = $ results ->fetch_assoc () ) {
5661 $ wiki = $ data ['wiki ' ];
5762 $ wikis [$ wiki ] = $ data ;
63+
64+ if ( $ update ) {
65+ $ cmd = make_shell_command (
66+ [
67+ 'PATCHDEMO ' => __DIR__ ,
68+ 'NAME ' => $ wiki ,
69+ ],
70+ 'sh -c \'php $PATCHDEMO/wikis/$NAME/w/maintenance/initSiteStats.php --update --active \''
71+ );
72+ shell_echo ( $ cmd );
73+ }
74+
5875 $ stats = $ mysqli ->query ( "
5976 SELECT *,
6077 ( SELECT MAX( rev_timestamp ) FROM patchdemo_ $ wiki.revision ) AS last_edit
6683 }
6784}
6885
86+ echo '</div> ' ;
87+
6988uksort ( $ wikis , static function ( $ a , $ b ) use ( $ wikis ) {
7089 return ( $ wikis [ $ b ][ 'ss_total_edits ' ] ?? -1 ) <=> ( $ wikis [ $ a ][ 'ss_total_edits ' ] ?? -1 );
7190} );
7291
92+ echo new OOUI \FormLayout ( [
93+ 'method ' => 'POST ' ,
94+ 'items ' => [
95+ new OOUI \FieldsetLayout ( [
96+ 'label ' => null ,
97+ 'items ' => [
98+ new OOUI \FieldLayout (
99+ new OOUI \ButtonInputWidget ( [
100+ 'classes ' => [ 'form-submit ' ],
101+ 'label ' => 'Update stats ' ,
102+ 'type ' => 'submit ' ,
103+ 'name ' => 'update ' ,
104+ 'flags ' => [ 'progressive ' ]
105+ ] ),
106+ [
107+ 'align ' => 'inline ' ,
108+ ]
109+ ),
110+ ]
111+ ] ),
112+ ]
113+ ] );
114+
73115echo '<table class="wikis"><tr class="headerRow"><th>Wiki</th> ' ;
74116foreach ( $ short_fields as $ field => $ fieldMeta ) {
75117 echo '<th> ' . $ fieldMeta ['label ' ] . '</th> ' ;
You can’t perform that action at this time.
0 commit comments