diff options
author | Simon Rettberg | 2016-05-19 12:07:58 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-05-19 12:07:58 +0200 |
commit | b12fb53ee2e1597f0246a961dc5ff29f8af04d47 (patch) | |
tree | 2e9437017ef71cdb6159dd107ebfa7557c9a52eb /modules-available/baseconfig_partitions_cdn | |
parent | MORE WMORK (diff) | |
download | slx-admin-b12fb53ee2e1597f0246a961dc5ff29f8af04d47.tar.gz slx-admin-b12fb53ee2e1597f0246a961dc5ff29f8af04d47.tar.xz slx-admin-b12fb53ee2e1597f0246a961dc5ff29f8af04d47.zip |
work work work work work
Diffstat (limited to 'modules-available/baseconfig_partitions_cdn')
11 files changed, 129 insertions, 22 deletions
diff --git a/modules-available/baseconfig_partitions_cdn/baseconfig/getconfig.inc.php b/modules-available/baseconfig_partitions_cdn/baseconfig/getconfig.inc.php new file mode 100644 index 00000000..6348fe71 --- /dev/null +++ b/modules-available/baseconfig_partitions_cdn/baseconfig/getconfig.inc.php @@ -0,0 +1,17 @@ +<?php + +$config = ''; +$res = Database::simpleQuery('SELECT partition_id, size, mount_point, options FROM setting_partition WHERE user = :user', + array('user'=>$_GET['user'])); +while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + $config .= "\n" . $row['partition_id'] . "," . $row['size']; + if(strlen($row['mount_point']) > 0) + $config .= "," . $row['mount_point']; + if(strlen($row['options']) > 0) + $config .= "," . $row['options']; +} +$config .= "\n"; + +// vm list url. doesn't really fit anywhere, seems to be a tie between here and dozmod +$configVars["SLX_PARTITION_TABLE"] = $config; +unset($config);
\ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/config.json b/modules-available/baseconfig_partitions_cdn/config.json index a3036a56..a355eef3 100644 --- a/modules-available/baseconfig_partitions_cdn/config.json +++ b/modules-available/baseconfig_partitions_cdn/config.json @@ -1,4 +1,4 @@ { - "category": "main.settings", + "category": "main.settings-client", "dependencies": [ "baseconfig" ] -}
\ No newline at end of file +} diff --git a/modules-available/baseconfig_partitions_cdn/lang/de/messages.json b/modules-available/baseconfig_partitions_cdn/lang/de/messages.json new file mode 100644 index 00000000..085214a3 --- /dev/null +++ b/modules-available/baseconfig_partitions_cdn/lang/de/messages.json @@ -0,0 +1,3 @@ +{ + "partitions-updated": "Partitionskonfiguration wurde aktualisiert" +}
\ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/lang/de/module.json b/modules-available/baseconfig_partitions_cdn/lang/de/module.json new file mode 100644 index 00000000..7a50f349 --- /dev/null +++ b/modules-available/baseconfig_partitions_cdn/lang/de/module.json @@ -0,0 +1,4 @@ +{ + "module_name": "Partitionierung", + "page_title": "Partitionierung" +}
\ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/lang/de/template-tags.json b/modules-available/baseconfig_partitions_cdn/lang/de/template-tags.json new file mode 100644 index 00000000..91cca0db --- /dev/null +++ b/modules-available/baseconfig_partitions_cdn/lang/de/template-tags.json @@ -0,0 +1,18 @@ +{ + "lang_addPartition": "Partition anlegen", + "lang_confirm": "Wollen Sie die Einstellungen unter \/srv\/openslx\/www\/boot\/config speichern?", + "lang_create": "Anlegen", + "lang_explanationText": "Hier k\u00f6nnen Sie bestimmen, welche Partitionen auf dem Client angelegt werden.", + "lang_helpId": "Partitions-ID", + "lang_helpMountPoint": "Muss ein Absolutes Verzeichnis im Zieldateisystem sein, z.B. \/mnt\/shares\/data", + "lang_helpOptions": "Zur Zeit ist hier nur 'bootable' erlaubt.", + "lang_helpSize": "Angabe im Format 10G um eine 10GiB-Partition zu erstellen.", + "lang_newPartition": "Neue Partition", + "lang_partitionId": "ID", + "lang_partitionManagement": "Partitionsverwaltung", + "lang_partitionMountPoint": "Mount point", + "lang_partitionOptions": "Optionen", + "lang_partitionSize": "Gr\u00f6\u00dfe", + "lang_resetConfirm": "Wollen Sie die Einstellungen wirklich auf die Standardwerte zur\u00fccksetzen?", + "lang_resetDefault": "Standardwerte laden" +}
\ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/lang/en/messages.json b/modules-available/baseconfig_partitions_cdn/lang/en/messages.json new file mode 100644 index 00000000..55289288 --- /dev/null +++ b/modules-available/baseconfig_partitions_cdn/lang/en/messages.json @@ -0,0 +1,3 @@ +{ + "partitions-updated": "Partition configuration has been updated" +}
\ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/lang/en/module.json b/modules-available/baseconfig_partitions_cdn/lang/en/module.json new file mode 100644 index 00000000..e3ed7ffa --- /dev/null +++ b/modules-available/baseconfig_partitions_cdn/lang/en/module.json @@ -0,0 +1,4 @@ +{ + "module_name": "Partitioning", + "page_title": "Partitioning" +}
\ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/lang/en/template-tags.json b/modules-available/baseconfig_partitions_cdn/lang/en/template-tags.json new file mode 100644 index 00000000..819d2273 --- /dev/null +++ b/modules-available/baseconfig_partitions_cdn/lang/en/template-tags.json @@ -0,0 +1,17 @@ +{ + "lang_confirm": "Would you like to save the settings on [ \/srv\/openslx\/www\/boot\/config ] ?", + "lang_create": "Create", + "lang_explanationText": "Here you can configure what kind of partitions will be created on the client computers, and where they will be mounted", + "lang_helpId": "Partition Id", + "lang_helpMountPoint": "Must be a directory: \/example\/directory\/", + "lang_helpOptions": "Currently, only option 'bootable' is available", + "lang_helpSize": "Must be in Gigabytes e.g. 15G", + "lang_newPartition": "New Partition", + "lang_partitionId": "Id", + "lang_partitionManagement": "Partition Managment", + "lang_partitionMountPoint": "Mount Point", + "lang_partitionOptions": "Options", + "lang_partitionSize": "Size", + "lang_resetConfirm": "Do you really wish to reset the variable to their default values?", + "lang_resetDefault": "Reset Default" +}
\ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/lang/pt/template-tags.json b/modules-available/baseconfig_partitions_cdn/lang/pt/template-tags.json new file mode 100644 index 00000000..a010e18c --- /dev/null +++ b/modules-available/baseconfig_partitions_cdn/lang/pt/template-tags.json @@ -0,0 +1,16 @@ +{ + "lang_confirm": "Voc\u00ea deseja salvar configura\u00e7\u00f5es em [ \/srv\/openslx\/www\/boot\/default\/config ] ?", + "lang_create": "Criar", + "lang_helpId": "Id da parti\u00e7\u00e3o", + "lang_helpMountPoint": "Precisa ser um diret\u00f3rio: \/exemplo\/diret\u00f3rio\/", + "lang_helpOptions": "Atualmente, apenas a op\u00e7\u00e3o 'bootable' est\u00e1 dispon\u00edvel", + "lang_helpSize": "Precisa estar em Gigabytes, por exemplo 15G", + "lang_newPartition": "Nova Parti\u00e7\u00e3o", + "lang_partitionId": "Id", + "lang_partitionManagement": "Gerenciamento de Parti\u00e7\u00f5es", + "lang_partitionMountPoint": "Mount Point", + "lang_partitionOptions": "Op\u00e7\u00f5es", + "lang_partitionSize": "Tamanho", + "lang_resetConfirm": "Voc\u00ea realmente deseja restaurar as vari\u00e1veis para seus valores padr\u00f5es?", + "lang_resetDefault": "Restaurar Padr\u00e3o" +}
\ No newline at end of file diff --git a/modules-available/baseconfig_partitions_cdn/page.inc.php b/modules-available/baseconfig_partitions_cdn/page.inc.php index b6ea869a..a1d1445f 100644 --- a/modules-available/baseconfig_partitions_cdn/page.inc.php +++ b/modules-available/baseconfig_partitions_cdn/page.inc.php @@ -73,7 +73,7 @@ class Page_BaseConfig_Partitions_CDN extends Page Util::traceError('Could not create new partition in DB'); } } - Util::redirect('?do=BaseConfig'); + Util::redirect('?do=BaseConfig_Partitions_CDN'); } private function deletePartition($id){ @@ -86,7 +86,7 @@ class Page_BaseConfig_Partitions_CDN extends Page Util::traceError('Could not delete partition in DB'); } } - Util::redirect('?do=BaseConfig'); + Util::redirect('?do=BaseConfig_Partitions_CDN'); } private function updatePartitions(){ @@ -113,7 +113,7 @@ class Page_BaseConfig_Partitions_CDN extends Page } if (!empty($partitions)) { Message::addSuccess('partitions-updated'); - Util::redirect('?do=BaseConfig'); + Util::redirect('?do=BaseConfig_Partitions_CDN'); } } diff --git a/modules-available/baseconfig_partitions_cdn/templates/_page.html b/modules-available/baseconfig_partitions_cdn/templates/_page.html index ee764e37..f7331186 100644 --- a/modules-available/baseconfig_partitions_cdn/templates/_page.html +++ b/modules-available/baseconfig_partitions_cdn/templates/_page.html @@ -1,17 +1,53 @@ -<h1>{{lang_partitioningManagement}}</h1> +<h1>{{lang_partitionManagement}}</h1> + +<p>{{lang_explanationText}}</p> <form action="?do=BaseConfig_Partitions_CDN" method="post"> <input type="hidden" name="token" value="{{token}}"> + <div class='list-group'> + {{#partitions}} + <div class='list-group-item'> + <div class='row'> + <div class='col-sm-2'> + <input name='partition-{{id}}-partition_id' type='text' class='form-control' value='{{partition_id}}' placeholder='{{lang_partitionId}}'> + </div> + <div class='col-sm-2'> + <input name='partition-{{id}}-size' type='text' class='form-control' value='{{size}}' placeholder='{{lang_partitionSize}}'> + </div> + <div class='col-sm-4 col-md-3'> + <input name='partition-{{id}}-mount_point' type='text' class='form-control' value='{{mount_point}}' placeholder='{{lang_partitionMountPoint}}'/> + </div> + <div class='col-sm-3'> + <input name='partition-{{id}}-options' type='text' class='form-control' size='30' value='{{options}}' placeholder='{{lang_partitionOptions}}'/> + </div> + <div class='col-sm-1 col-md-2'> + <a class='btn btn-danger' href='?do=BaseConfig_Partitions_CDN&deletePartition={{id}}&token={{token}}'> + <span class='glyphicon glyphicon-trash'></span> + <span class="hidden-sm">{{lang_delete}}</span> + </a> + </div> + </div> + </div> + {{/partitions}} + <div class='list-group-item clearfix'> + <div class="pull-right"> + <a class='btn btn-default ' data-toggle='modal' data-target='#add-partition'> + <span class='glyphicon glyphicon-plus'></span> {{lang_newPartition}} + </a> + </div> + </div> + </div> <button class="btn btn-lg btn-primary" type="submit">{{lang_save}}</button> <button class="btn btn-lg btn-primary" type="reset">{{lang_reset}}</button> <a class="btn btn-lg btn-primary" href="#" onclick="saveConfig()">Download</a> </form> + <div> -<form method="post" action="?do=BaseConfig_Partitions_CDN"> - <input type="hidden" name="token" value="{{token}}"> - <input type="hidden" name="action" value="reset"> - <button class="btn btn-default" type="submit" onclick="return confirm('{{lang_resetConfirm}}');">{{lang_resetDefault}}</button> -</form> + <form method="post" action="?do=BaseConfig_Partitions_CDN"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="action" value="reset"> + <button class="btn btn-default" type="submit" onclick="return confirm('{{lang_resetConfirm}}');">{{lang_resetDefault}}</button> + </form> </div> <!-- Create Partition Window --> @@ -53,17 +89,6 @@ <input type="hidden" name="token" value="{{token}}"> </form> <script type="text/javascript"> - document.getElementById("cat-extra-6").innerHTML = "<div class='list-group'> <div class='list-group-item' style='background-color:#f5f5f5;color:#428bca;'> " + - "{{lang_catPartition}} <span style='display:inline-block; float: right; margin-top: -7px;'> <a class='btn btn-default ' data-toggle='modal' " + - "data-target='#add-partition'> <span class='glyphicon glyphicon-plus'></span> </a> </span> </div> {{#partitions}} <div class='list-group-item'> " + - "<div class='row'> <div class='col-md-1'> <input name='partition-{{id}}-partition_id' type='text' class='form-control' size='30' value='{{partition_id}}'" + - " placeholder='{{lang_partitionId}}' /> </div> <div class='col-md-1'> <input name='partition-{{id}}-size' type='text' class='form-control' size='30' " + - "value='{{size}}' placeholder='{{lang_partitionSize}}'/> </div> <div class='col-md-4'> <input name='partition-{{id}}-mount_point' type='text' " + - "class='form-control' size='30' value='{{mount_point}}' placeholder='{{lang_partitionMountPoint}}'/> </div> <div class='col-md-4'> <input " + - "name='partition-{{id}}-options' type='text' class='form-control' size='30' value='{{options}}' placeholder='{{lang_partitionOptions}}'/> </div> " + - "<div class='col-md-2'> <a class='btn btn-danger' href='?do=BaseConfig&deletePartition={{id}}&token={{token}}' ><span class='glyphicon glyphicon-trash'>" + - "</span> {{lang_delete}}</a> </div> </div> </div> {{/partitions}} </div> </div>"; - function saveConfig(){ if(confirm('{{lang_confirm}}')) window.location = 'api.php?do=baseconfig&user={{user}}&save=true'; |