Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
eole-wol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
primtux-eole
Grenoble
eole-wol
Commits
f63ca23b
Verified
Commit
f63ca23b
authored
5 years ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Unbounded actions
parent
bf41a157
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
wol/www/index.php
+56
-12
56 additions, 12 deletions
wol/www/index.php
with
56 additions
and
12 deletions
wol/www/index.php
+
56
−
12
View file @
f63ca23b
...
@@ -23,7 +23,24 @@
...
@@ -23,7 +23,24 @@
<div
id=
"box"
style=
"font-size:large"
>
<div
id=
"box"
style=
"font-size:large"
>
<div
id=
"content"
>
<div
id=
"content"
>
<h1>
Interface de gestion des postes
</h1>
<h1>
Interface de gestion des postes
</h1>
<p>
test
</p>
<?php
ini_set
(
'display_errors'
,
1
);
ini_set
(
'display_startup_errors'
,
1
);
error_reporting
(
E_ALL
);
$lines
=
explode
(
PHP_EOL
,
shell_exec
(
"../scripts/get_registry.sh"
));
?>
<p>
<?php
echo
count
(
$lines
);
?>
postes sont inscrits sur ce serveur
</p>
<h2>
Actions globables
</h2>
<form
action=
"index.php"
method=
"post"
>
<input
type=
"hidden"
name=
"action"
value=
"upgradeAll"
>
<input
type=
"submit"
value=
"Mettre à jour tous les postes"
title=
"Mettre à jour tous les postes"
>
</form>
<form
action=
"index.php"
method=
"post"
>
<input
type=
"hidden"
name=
"action"
value=
"upgradeAllApt"
>
<input
type=
"submit"
value=
"Mettre à jour tous les postes avec mises à jour APT"
title=
"Mettre à jour tous les postes avec mises à jour APT"
>
</form>
<h2>
Gestion des postes
</h2>
<table>
<table>
<tr>
<tr>
<th>
Nom
</th>
<th>
Nom
</th>
...
@@ -37,9 +54,8 @@
...
@@ -37,9 +54,8 @@
<th>
Actions
</th>
<th>
Actions
</th>
</tr>
</tr>
<?php
<?php
$lines
=
shell_exec
(
"../scripts/get_registry.sh"
);
$registry
=
array
();
$registry
=
array
();
foreach
(
explode
(
PHP_EOL
,
$lines
)
as
$line
){
foreach
(
$lines
as
$line
){
if
(
$line
!=
""
){
if
(
$line
!=
""
){
$entry
=
explode
(
' '
,
$line
);
$entry
=
explode
(
' '
,
$line
);
array_push
(
$registry
,
$entry
);
array_push
(
$registry
,
$entry
);
...
@@ -62,24 +78,39 @@ foreach(explode(PHP_EOL, $lines) as $line){
...
@@ -62,24 +78,39 @@ foreach(explode(PHP_EOL, $lines) as $line){
}
}
# Last seen
# Last seen
echo
"<td>"
.
$entry
[
0
]
.
"</td>"
;
echo
"<td>"
.
$entry
[
0
]
.
"</td>"
;
echo
"<td>Todo</td>"
;
echo
"<td>"
;
echo
"</tr>"
;
# Actions
?>
<form
action=
"index.php"
method=
"post"
>
<input
type=
"hidden"
name=
"action"
value=
"wake"
>
<input
type=
"hidden"
name=
"mac"
value=
"
<?php
echo
$entry
[
1
];
?>
"
>
<input
type=
"submit"
value=
"Démarrer"
title=
"Démarrer la machine"
>
</form>
<form
action=
"index.php"
method=
"post"
>
<input
type=
"hidden"
name=
"action"
value=
"upgrade"
>
<input
type=
"hidden"
name=
"mac"
value=
"
<?php
echo
$entry
[
1
];
?>
"
>
<input
type=
"submit"
value=
"Mettre à jour"
title=
"Mettre à jour"
>
</form>
<form
action=
"index.php"
method=
"post"
>
<input
type=
"hidden"
name=
"action"
value=
"upgradeAPT"
>
<input
type=
"hidden"
name=
"mac"
value=
"
<?php
echo
$entry
[
1
]
?>
;"
>
<input
type=
"submit"
value=
"Mettre à jour + Apt"
title=
"Mettre à jour + apt"
>
</form>
<?php
echo
"</td></tr>"
;
}
}
}
}
?>
?>
</table>
</table>
<pre>
<pre>
<?
json_encode
(
$registry
);
?>
<?
php
json_encode
(
$registry
);
?>
</pre>
</pre>
<p>
Merci d'indiquer l'adresse MAC du PC à réveiller
</p>
<form
action=
"index.php"
method=
"post"
>
<input
type=
"hidden"
name=
"action"
value=
"wake"
>
<input
type=
"text"
name=
"mac"
title=
"MAC Addresse"
placeholder=
"1a:2b:3c:4e:5f:6a"
>
<input
type=
"submit"
value=
"Démarrer"
title=
"Démarrer la machine"
>
</form>
<?php
<?php
extract
(
$_POST
);
extract
(
$_POST
);
if
(
!
isset
(
$action
)){
exit
();
}
switch
(
$action
){
switch
(
$action
){
case
"wake"
:
case
"wake"
:
echo
"<div id='result'><p>Démarrage demandé pour la machine
$mac
, veuillez patienter</p></div>"
;
echo
"<div id='result'><p>Démarrage demandé pour la machine
$mac
, veuillez patienter</p></div>"
;
...
@@ -113,6 +144,19 @@ foreach(explode(PHP_EOL, $lines) as $line){
...
@@ -113,6 +144,19 @@ foreach(explode(PHP_EOL, $lines) as $line){
</script>
</script>
<?php
<?php
break
;
break
;
case
"upgradeAll"
:
echo
"I should upgradeAll machines, not implemented yet"
;
breaK
;
case
"upgradeAllApt"
:
echo
"I should upgradeAllApt machines, not implemented yet"
;
breaK
;
case
"upgrade"
:
echo
"I should upgrade
$mac
, not implemented yet"
;
break
;
case
"upgradeAPT"
:
echo
"I should upgrade
$mac
with apt, not implemented yet"
;
break
;
}
}
?>
?>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment