File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,8 +37,6 @@ <h1>{{ 'tools-header'|message }}</h1>
3737 < h4 class ="card-title ">
3838 {% if info.url %}
3939 < a href ="{{ info.url }} "> {{ info.title|default(tool.name) }}</ a >
40- {% elseif tool.toolinfo|length == 1 and active[tool.name] %}
41- < a href ="https://{{ tool.name }}.toolforge.org/ "> {{ tool.name }}</ a >
4240 {% else %}
4341 {{ info.title|default(tool.name) }}
4442 {% endif %}
Original file line number Diff line number Diff line change @@ -50,11 +50,9 @@ public function setLabsDao( $dao ) {
5050 }
5151
5252 protected function handleGet () {
53- $ active = $ this ->tools ->getActiveWebservices ();
5453 $ users = $ this ->labsDao ->getAllUsers ();
5554 $ tools = $ this ->labsDao ->getAllTools ();
5655
57- $ this ->view ->set ( 'active ' , $ active );
5856 $ this ->view ->set ( 'users ' , $ users );
5957 $ this ->view ->set ( 'tools ' , $ tools );
6058 $ this ->render ( 'tools.html ' );
Original file line number Diff line number Diff line change @@ -90,45 +90,4 @@ protected function getMemberInfo( array $members ) {
9090 }
9191 return $ ret ;
9292 }
93-
94- /**
95- * Get list of currently active webservices.
96- * @return array
97- */
98- public function getActiveWebservices () {
99- $ key = 'tools:active ' ;
100- $ services = $ this ->cache ->load ( $ key );
101- if ( !$ services ) {
102- // FIXME: /etc/active-proxy is not exposed to Kubernetes
103- // containers.
104- // $active_proxy = file_get_contents( '/etc/active-proxy' );
105- // Split horizon DNS should take us where we need to go
106- $ active_proxy = 'admin.toolforge.org ' ;
107- $ proxy_uri = "http:// {$ active_proxy }:8081/list " ;
108- $ client = new Client ();
109- $ response = $ client ->get ( $ proxy_uri );
110- $ body = $ response ->getBody ();
111- $ json = json_decode ( $ body , true );
112- if ( $ json ) {
113- $ proxies = json_decode ( $ body , true );
114- foreach ( $ proxies as $ key => $ value ) {
115- if (
116- array_key_exists ( 'status ' , $ value ) &&
117- $ value ['status ' ] == 'active '
118- ) {
119- $ services [$ key ] = 1 ;
120- }
121- }
122- $ this ->cache ->save ( $ key , $ services , 600 );
123- } else {
124- $ this ->logger ->error ( 'Error fetching webproxy status data ' , [
125- 'method ' => __METHOD__ ,
126- 'status ' => $ response ->getStatusCode (),
127- 'body ' => $ body ,
128- ] );
129- $ services = [];
130- }
131- }
132- return $ services ;
133- }
13493}
You can’t perform that action at this time.
0 commit comments