[PATCH 0/4] [UI] Host Repositories Management Support

Add host repositories management in this patch set. Hongliang Wang (4): [UI] Add i18n Strings for Repositories Management [UI] Add API Support for Repositories Management [UI] Add/Edit Repository Support [UI] Integrate Repositories Management into Host Tab po/POTFILES.in | 2 + ui/css/theme-default/host.css | 44 +++++++++++ ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++ ui/js/src/kimchi.api.js | 61 +++++++++++++++ ui/js/src/kimchi.host.js | 126 +++++++++++++++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++ ui/pages/i18n.html.tmpl | 18 +++++ ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 ++++ 12 files changed, 766 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl -- 1.8.1.4

i18n support for repositories management. Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com> --- ui/pages/i18n.html.tmpl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl index 38f71d9..9f93d88 100644 --- a/ui/pages/i18n.html.tmpl +++ b/ui/pages/i18n.html.tmpl @@ -77,6 +77,24 @@ var i18n = { 'KCHHOST6007M': "$_("Sent")", 'KCHHOST6008M': "$_("Shutting down or restarting host will cause unsaved work lost. Continue to shut down/restarting?")", + + 'KCHREPO6001M': "$_("Confirm")", + 'KCHREPO6002M': "$_("Repository will be removed permanently and can't be recovered. Do you want to continue?")", + 'KCHREPO6003M': "$_("Repositories")", + 'KCHREPO6004M': "$_("Repos ID")", + 'KCHREPO6005M': "$_("Repos Name")", + 'KCHREPO6006M': "$_("Base URL")", + 'KCHREPO6007M': "$_("Is Mirror")", + 'KCHREPO6008M': "$_("URL Args")", + 'KCHREPO6009M': "$_("Enabled")", + 'KCHREPO6010M': "$_("GPG Check")", + 'KCHREPO6011M': "$_("GPG Key")", + 'KCHREPO6012M': "$_("Add")", + 'KCHREPO6013M': "$_("Edit")", + 'KCHREPO6014M': "$_("Remove")", + 'KCHREPO6015M': "$_("Failed.")", + + 'KCHDR6001M': "$_("Debug report will be removed permanently and can't be recovered. Do you want to continue?")", 'KCHDR6002M': "$_("Debug Reports")", 'KCHDR6003M': "$_("Name")", -- 1.8.1.4

Add APIs. Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com> --- ui/js/src/kimchi.api.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js index fdd9cfc..df110c1 100644 --- a/ui/js/src/kimchi.api.js +++ b/ui/js/src/kimchi.api.js @@ -727,5 +727,66 @@ var kimchi = { success : suc, error : err }); + }, + + createRepository : function(settings, suc, err) { + kimchi.requestJSON({ + url : "host/repositories", + type : "POST", + contentType : "application/json", + data : JSON.stringify(settings), + dataType : "json", + success: suc, + error: err + }); + }, + + retrieveRepository : function(repository, suc, err) { + var reposID = encodeURIComponent(repository); + kimchi.requestJSON({ + url : kimchi.url + "host/repositories/" + reposID, + type : 'GET', + contentType : 'application/json', + dataType : 'json', + success : suc, + error : err + }); + }, + + updateRepository : function(name, settings, suc, err) { + var reposID = encodeURIComponent(name); + $.ajax({ + url : kimchi.url + "host/repositories/" + reposID, + type : 'PUT', + contentType : 'application/json', + data : JSON.stringify(settings), + dataType : 'json', + success : suc, + error : err + }); + }, + + deleteRepository : function(repository, suc, err) { + var reposID = encodeURIComponent(repository); + kimchi.requestJSON({ + url : kimchi.url + 'host/repositories/' + reposID, + type : 'DELETE', + contentType : 'application/json', + dataType : 'json', + success : suc, + error : err + }); + }, + + listRepositories : function(suc, err) { + kimchi.requestJSON({ + url : kimchi.url + 'host/repositories', + type : 'GET', + contentType : 'application/json', + dataType : 'json', + resend: true, + success : suc, + error : err + }); } }; -- 1.8.1.4

Repositories management support: 1) Add a repository 2) Edit a repository Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com> --- po/POTFILES.in | 2 + ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 ++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 ++++++++++++++++++++++ ui/pages/repository-add.html.tmpl | 104 ++++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++++ 7 files changed, 504 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl diff --git a/po/POTFILES.in b/po/POTFILES.in index 4ff7eaa..955a675 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -7,6 +7,8 @@ ui/pages/i18n.html.tmpl ui/pages/kimchi-ui.html.tmpl ui/pages/login-window.html.tmpl ui/pages/report-add.html.tmpl +ui/pages/repository-add.html.tmpl +ui/pages/repository-edit.html.tmpl ui/pages/storagepool-add.html.tmpl ui/pages/tabs/guests.html.tmpl ui/pages/tabs/host.html.tmpl diff --git a/ui/css/theme-default/repository-add.css b/ui/css/theme-default/repository-add.css new file mode 100644 index 0000000..2434efd --- /dev/null +++ b/ui/css/theme-default/repository-add.css @@ -0,0 +1,39 @@ +/* + * Project Kimchi + * + * Copyright IBM, Corp. 2013 + * + * Authors: + * Hongliang Wang <hlwang@linux.vnet.ibm.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#repository-add-window { + height: 680px; + width: 1000px; +} + +#repository-add-window .required { + color: red; + padding-left: 5px; + vertical-align: top; +} + +#repository-add-window .textbox-wrapper input[type="text"] { + box-sizing: border-box; + width: 100%; +} + +#repository-add-window .textbox-wrapper label { + vertical-align: middle; +} diff --git a/ui/css/theme-default/repository-edit.css b/ui/css/theme-default/repository-edit.css new file mode 100644 index 0000000..ee6ad2e --- /dev/null +++ b/ui/css/theme-default/repository-edit.css @@ -0,0 +1,69 @@ +/* + * Project Kimchi + * + * Copyright IBM, Corp. 2013 + * + * Authors: + * Hongliang Wang <hlwang@linux.vnet.ibm.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#repository-edit-window { + height: 420px; + width: 1000px; +} + +.repository-edit-fieldset { + float: left; + padding: 1em; +} + +.repository-edit-wrapper-label, .repository-edit-wrapper-controls { + display: inline-block; + height: 38px; + line-height: 38px; + margin-top: 5px; + vertical-align: top; +} + +.repository-edit-wrapper-label { + width: 150px; +} + +.repository-edit-wrapper-controls label { + vertical-align: middle; +} + +.repository-edit-wrapper-controls { + width: 300px; +} + +.repository-edit-wrapper-controls input[type="text"] { + font-size: 16px; + height: 38px; + line-height: 38px; + background: #fff; + -webkit-border-radius: 5px; + border-radius: 5px; + box-shadow: 2px 2px 2px #eee inset; + border-top: 1px solid #bbb; + border-left: 1px solid #bbb; + padding: 0 10px; + width: 250px; +} + +.repository-edit-wrapper-controls input[type="text"][disabled] { + color: #bbb; + background-color: #fafafa; + cursor: not-allowed; +} diff --git a/ui/js/src/kimchi.repository_add_main.js b/ui/js/src/kimchi.repository_add_main.js new file mode 100644 index 0000000..75b785e --- /dev/null +++ b/ui/js/src/kimchi.repository_add_main.js @@ -0,0 +1,84 @@ +/* + * Project Kimchi + * + * Copyright IBM, Corp. 2013 + * + * Authors: + * Hongliang Wang <hlwang@linux.vnet.ibm.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +kimchi.repository_add_main = function() { + + var addForm = $('#form-repository-add'); + var addButton = $('#button-repository-add'); + + var nameBox = $('input[name="repo_id"]', addForm); + var urlBox = $('input[name="baseurl"]', addForm); + var isMirrorButton = $('input[name="is_mirror"]', addForm); + var urlArgsBox = $('input[name="url_args"]', addForm); + var gpgkeyBox = $('input[name="gpgkey"]', addForm); + + var validateForm = function(event) { + var valid = $(urlBox).val() !== ''; + $(addButton).prop('disabled', !valid); + return valid; + }; + + $(urlBox).on('input propertychange', validateForm); + + var booleanFields = ['is_mirror']; + + var addRepository = function(event) { + var valid = validateForm(); + if(!valid) { + return false; + } + + var formData = $(addForm).serializeObject(); + for(var p in formData) { + if(formData[p] == '') { + delete formData[p]; + } + } + + $(booleanFields).each(function(i, f) { + switch(formData[f]) { + case 'true': + formData[f] = true; + break; + case 'false': + formData[f] = false; + break; + default: + delete formData[f]; + break; + } + }); + + kimchi.createRepository(formData, function() { + kimchi.topic('kimchi/repositoryAdded').publish(); + kimchi.window.close(); + }, function(jqXHR, textStatus, errorThrown) { + var reason = jqXHR && + jqXHR['responseJSON'] && + jqXHR['responseJSON']['reason']; + reason = reason ? ': ' + reason : ''; + kimchi.message.error(i18n['KCHREPO6015M'] + reason); + }); + + return false; + }; + + $(addForm).on('submit', addRepository); +}; diff --git a/ui/js/src/kimchi.repository_edit_main.js b/ui/js/src/kimchi.repository_edit_main.js new file mode 100644 index 0000000..0ab008e --- /dev/null +++ b/ui/js/src/kimchi.repository_edit_main.js @@ -0,0 +1,85 @@ +/* + * Project Kimchi + * + * Copyright IBM, Corp. 2013 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +kimchi.repository_edit_main = function() { + + var editForm = $('#form-repository-edit'); + var saveButton = $('#repository-edit-button-save'); + + kimchi.retrieveRepository(kimchi.selectedRepository, function(repository) { + for(var prop in repository) { + var control = $('input[name="' + prop + '"]', editForm); + switch($(control).attr('type')) { + case 'text': + $(control).val(repository[prop]); + break; + case 'radio': + case 'checkbox': + $(control).each(function(i, c) { + var matched = ('' + repository[prop]) == $(c).val(); + $(c).prop('checked', matched); + }); + break; + default: + break; + } + + } + + $('input', editForm).on('input propertychange', function(event) { + if($(this).val() !== '') { + $(saveButton).prop('disabled', false); + } + }); + }); + + var booleanFields = ['is_mirror', 'gpgcheck']; + + var editRepository = function(event) { + var formData = $(editForm).serializeObject(); + + $(booleanFields).each(function(i, f) { + switch(formData[f]) { + case 'true': + formData[f] = true; + break; + case 'false': + formData[f] = false; + break; + default: + delete formData[f]; + break; + } + }); + + kimchi.updateRepository(kimchi.selectedRepository, formData, function() { + kimchi.topic('kimchi/repositoryUpdated').publish(); + kimchi.window.close(); + }, function(jqXHR, textStatus, errorThrown) { + var reason = jqXHR && + jqXHR['responseJSON'] && + jqXHR['responseJSON']['reason']; + reason = reason ? ': ' + reason : ''; + kimchi.message.error(i18n['KCHREPO6015M'] + reason); + }); + + return false; + }; + + $(editForm).on('submit', editRepository); + $(saveButton).on('click', editRepository); +}; diff --git a/ui/pages/repository-add.html.tmpl b/ui/pages/repository-add.html.tmpl new file mode 100644 index 0000000..5208f50 --- /dev/null +++ b/ui/pages/repository-add.html.tmpl @@ -0,0 +1,104 @@ +#* + * Project Kimchi + * + * Copyright IBM, Corp. 2013 + * + * Authors: + * Hongliang Wang <hlwang@linux.vnet.ibm.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *# +#unicode UTF-8 +#import gettext +#from kimchi.cachebust import href +#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang) +#silent _ = t.gettext +#silent _t = t.gettext +<div id="repository-add-window" class="window"> + <form id="form-repository-add"> + <header class="window-header"> + <h1 class="title">$_("Add a Repository")</h1> + <div class="close">X</div> + </header> + <div class="content"> + <section class="form-section"> + <h2>1. $_("Repository Name")</h2> + <div class="field"> + <p class="text-help"> + $_("Unique repository name for each repository, one word.") + </p> + <div class="textbox-wrapper"> + <input type="text" class="text" name="repo_id" /> + </div> + </div> + </section> + <section class="form-section"> + <h2>2. $_("Base URL")<span class="required" role="presentation" title="$_("Required Field")">*</span></h2> + <div class="field"> + <p class="text-help"> + $_("URL to the repodata directory when \"is_mirror\" is false. Otherwise, it can be URL to the mirror system for YUM. Can be an http://, ftp:// or file:// URL.") + </p> + <div class="textbox-wrapper"> + <input type="text" class="text" name="baseurl" /> + </div> + </div> + </section> + <section class="form-section"> + <h2>3. $_("Is Mirror")</h2> + <div class="field"> + <p class="text-help"> + $_("Set the given URI of baseurl as a mirror list, instead of use baseurl in repository configuration.") + </p> + <div class="textbox-wrapper"> + <input type="radio" id="isMirrorRadioTrue" name="is_mirror" value="true" /> + <label for="isMirrorRadioTrue">$_("Yes")</label> + <input type="radio" id="isMirrorRadioFalse" name="is_mirror" value="false" /> + <label for="isMirrorRadioFalse">$_("No")</label> + </div> + </div> + </section> + <section class="form-section"> + <h2>4. $_("URL Args")</h2> + <div class="field"> + <p class="text-help"> + $_("Arguments to be passed to baseurl, like the list of APT repositories provided by the same baseurl.") + </p> + <div class="textbox-wrapper"> + <input type="text" class="text" name="url_args" /> + </div> + </div> + </section> + <section class="form-section"> + <h2>5. $_("GPG Key")</h2> + <div class="field"> + <p class="text-help"> + $_("URL pointing to the ASCII-armored GPG key file for the repository. This option is used if yum needs a public key to verify a package and the required key hasn't been imported into the RPM database.") + </p> + <div class="textbox-wrapper"> + <input type="text" class="text" name="gpgkey" /> + </div> + </div> + </section> + </div> + <footer> + <div class="btn-group"> + <button type="submit" id="button-repository-add" class="btn-normal" disabled="disabled"> + <span class="text">$_("Add")</span> + </button> + </div> + </footer> + </form> +</div> +<script> + kimchi.repository_add_main(); +</script> diff --git a/ui/pages/repository-edit.html.tmpl b/ui/pages/repository-edit.html.tmpl new file mode 100644 index 0000000..cd488d7 --- /dev/null +++ b/ui/pages/repository-edit.html.tmpl @@ -0,0 +1,121 @@ +#* + * Project Kimchi + * + * Copyright IBM, Corp. 2013 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *# +#unicode UTF-8 +#import gettext +#from kimchi.cachebust import href +#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang) +#silent _ = t.gettext +#silent _t = t.gettext + +<div id="repository-edit-window" class="window"> + <header> + <h1 class="title">$_("Edit Repository")</h1> + <div class="close">X</div> + </header> + <div class="content"> + <form id="form-repository-edit"> + <fieldset class="repository-edit-fieldset"> + <div> + <div class="repository-edit-wrapper-label"> + <label for="repository-edit-id-textbox">$_("Repository ID")</label> + </div> + <div class="repository-edit-wrapper-controls"> + <input id="repository-edit-id-textbox" name="repo_id" type="text" /> + </div> + </div> + <div> + <div class="repository-edit-wrapper-label"> + <label for="repository-edit-name-textbox">$_("Repository Name")</label> + </div> + <div class="repository-edit-wrapper-controls"> + <input id="repository-edit-name-textbox" name="repo_name" type="text" /> + </div> + </div> + <div> + <div class="repository-edit-wrapper-label"> + <label for="repository-edit-baseurl-textbox">$_("Base URL")</label> + </div> + <div class="repository-edit-wrapper-controls"> + <input id="repository-edit-baseurl-textbox" name="baseurl" type="text" /> + </div> + </div> + <div> + <div class="repository-edit-wrapper-label"> + <label>$_("Is Mirror")</label> + </div> + <div class="repository-edit-wrapper-controls"> + <input id="repository-edit-ismirror-radio-true" name="is_mirror" type="radio" value="true" disabled="disabled" /> + <label for="repository-edit-ismirror-radio-true">$_("Yes")</label> + <input id="repository-edit-ismirror-radio-false" name="is_mirror" type="radio" value="false" disabled="disabled" /> + <label for="repository-edit-ismirror-radio-false">$_("No")</label> + </div> + </div> + </fieldset> + <fieldset class="repository-edit-fieldset"> + <div> + <div class="repository-edit-wrapper-label"> + <label for="repository-edit-urlargs-textbox">$_("URL Args")</label> + </div> + <div class="repository-edit-wrapper-controls"> + <input id="repository-edit-urlargs-textbox" name="url_args" type="text" /> + </div> + </div> + <div> + <div class="repository-edit-wrapper-label"> + <label>$_("Enabled")</label> + </div> + <div class="repository-edit-wrapper-controls"> + <input id="repository-edit-enabled-radio-true" name="enabled" type="radio" value="true" disabled="disabled" /> + <label for="repository-edit-enabled-radio-true">$_("Yes")</label> + <input id="repository-edit-enabled-radio-false" name="enabled" type="radio" value="false" disabled="disabled" /> + <label for="repository-edit-enabled-radio-false">$_("No")</label> + </div> + </div> + <div> + <div class="repository-edit-wrapper-label"> + <label>$_("GPG Check")</label> + </div> + <div class="repository-edit-wrapper-controls"> + <input id="repository-edit-gpgcheck-radio-true" name="gpgcheck" type="radio" value="true" /> + <label for="repository-edit-gpgcheck-radio-true">$_("Yes")</label> + <input id="repository-edit-gpgcheck-radio-false" name="gpgcheck" type="radio" value="false" /> + <label for="repository-edit-gpgcheck-radio-false">$_("No")</label> + </div> + </div> + <div> + <div class="repository-edit-wrapper-label"> + <label for="repository-edit-gpgkey-textbox">$_("GPG Key")</label> + </div> + <div class="repository-edit-wrapper-controls"> + <input id="repository-edit-gpgkey-textbox" name="gpgkey" type="text" /> + </div> + </div> + </fieldset> + </form> + </div> + <footer> + <div class="btn-group"> + <button id="repository-edit-button-save" class="btn-normal"> + <span class="text">$_("Save")</span> + </button> + </div> + </footer> +</div> +<script type="text/javascript"> + kimchi.repository_edit_main(); +</script> -- 1.8.1.4

Integrated repositories management into host tab. Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com> --- ui/css/theme-default/host.css | 44 +++++++++++++++ ui/js/src/kimchi.host.js | 126 ++++++++++++++++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 +++++ 3 files changed, 183 insertions(+) diff --git a/ui/css/theme-default/host.css b/ui/css/theme-default/host.css index 470ed1b..a1964aa 100644 --- a/ui/css/theme-default/host.css +++ b/ui/css/theme-default/host.css @@ -224,3 +224,47 @@ width: 300px; } /* End of Debug Report */ + +/* Repository */ +.host-panel #repositories-grid { + border-color: #ddd; + height: 300px; + width: 850px; +} + +.repository-rowno { + width: 30px; +} + +.repository-id { + width: 100px; +} + +.repository-name { + width: 100px; +} + +.repository-baseurl { + width: 200px; +} + +.repository-ismirror { + width: 60px; +} + +.repository-urlargs { + width: 70px; +} + +.repository-enabled { + width: 60px; +} + +.repository-gpgcheck { + width: 60px; +} + +.repository-gpgkey { + width: 300px; +} +/* End of Repository */ diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js index 7974054..57117a9 100644 --- a/ui/js/src/kimchi.host.js +++ b/ui/js/src/kimchi.host.js @@ -133,6 +133,129 @@ kimchi.host_main = function() { }); }; + var repositoriesGridID = 'repositories-grid'; + var repositoriesGrid = null; + var initRepositoriesGrid = function(repositories) { + repositoriesGrid = new kimchi.widget.Grid({ + container: 'repositories-grid-container', + id: repositoriesGridID, + title: i18n['KCHREPO6003M'], + toolbarButtons: [{ + id: repositoriesGridID + '-add-button', + label: i18n['KCHREPO6012M'], + onClick: function(event) { + kimchi.window.open('repository-add.html'); + } + }, { + id: repositoriesGridID + '-edit-button', + label: i18n['KCHREPO6013M'], + disabled: true, + onClick: function(event) { + var repository = repositoriesGrid.getSelected(); + if(!repository) { + return; + } + kimchi.selectedRepository = repository['repo_id']; + kimchi.window.open('repository-edit.html'); + } + }, { + id: repositoriesGridID + '-remove-button', + label: i18n['KCHREPO6014M'], + disabled: true, + onClick: function(event) { + var repository = repositoriesGrid.getSelected(); + if(!repository) { + return; + } + + var settings = { + title : i18n['KCHREPO6001M'], + content : i18n['KCHREPO6002M'], + confirm : i18n['KCHAPI6004M'], + cancel : i18n['KCHAPI6003M'] + }; + + kimchi.confirm(settings, function() { + kimchi.deleteRepository( + repository['repo_id'], + function(result) { + kimchi.topic('kimchi/repositoryDeleted').publish(result); + }, function(error) { + } + ); + }); + } + }], + onRowSelected: function(row) { + $('#' + repositoriesGridID + '-remove-button') + .prop('disabled', false); + $('#' + repositoriesGridID + '-edit-button') + .prop('disabled', false); + }, + frozenFields: [{ + name: 'rowno', + label: ' ', + 'class': 'repository-rowno' + }], + fields: [{ + name: 'repo_id', + label: i18n['KCHREPO6004M'], + 'class': 'repository-id' + }, { + name: 'repo_name', + label: i18n['KCHREPO6005M'], + 'class': 'repository-name' + }, { + name: 'baseurl', + label: i18n['KCHREPO6006M'], + 'class': 'repository-baseurl' + }, { + name: 'is_mirror', + label: i18n['KCHREPO6007M'], + 'class': 'repository-ismirror' + }, { + name: 'url_args', + label: i18n['KCHREPO6008M'], + 'class': 'repository-urlargs' + }, { + name: 'enabled', + label: i18n['KCHREPO6009M'], + 'class': 'repository-enabled' + }, { + name: 'gpgcheck', + label: i18n['KCHREPO6010M'], + 'class': 'repository-gpgcheck' + }, { + name: 'gpgkey', + label: i18n['KCHREPO6011M'], + 'class': 'repository-gpgkey' + }], + data: repositories + }); + kimchi.topic('kimchi/repositoryAdded').subscribe(listRepositories); + kimchi.topic('kimchi/repositoryUpdated').subscribe(listRepositories); + kimchi.topic('kimchi/repositoryDeleted').subscribe(listRepositories); + }; + + var listRepositories = function() { + kimchi.listRepositories(function(repositories) { + $.each(repositories, function(i, item) { + repositories[i]['rowno'] = i + 1; + }); + if(repositoriesGrid) { + repositoriesGrid.setData(repositories); + } + else { + initRepositoriesGrid(repositories); + } + }); + + $('#' + repositoriesGridID + '-remove-button') + .prop('disabled', true); + $('#' + repositoriesGridID + '-edit-button') + .prop('disabled', true); + }; + var shutdownButtonID = '#host-button-shutdown'; var restartButtonID = '#host-button-restart'; var shutdownHost = function(params) { @@ -198,6 +321,8 @@ kimchi.host_main = function() { $('#debug-report-section').removeClass('hidden'); listDebugReports(); }); + + listRepositories(); }; kimchi.topic('kimchi/debugReportAdded').subscribe(function(params) { @@ -469,5 +594,6 @@ kimchi.host_main = function() { delete kimchi.hostTimer; } reportGrid && reportGrid.destroy(); + repositoriesGrid && repositoriesGrid.destroy(); }); }; diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl index 23b9853..b34a351 100644 --- a/ui/pages/tabs/host.html.tmpl +++ b/ui/pages/tabs/host.html.tmpl @@ -120,6 +120,19 @@ </div> </div> </div> + <div id="repositories-section" class="host-section"> + <h3 class="section-header" + aria-controls="content-repositories"> + $_("Repositories") + </h3> + <div id="content-repositories" class="section-content"> + <div class="section-row"> + <div class="section-value"> + <div id="repositories-grid-container"></div> + </div> + </div> + </div> + </div> <div id="debug-report-section" class="host-section hidden"> <h3 class="section-header" aria-controls="content-sys-reports"> -- 1.8.1.4

A few interface suggestions: Repositories table: Remove "Repos" string from column headers. It should be obvious this data relates to repositories from the section title Remove numerical column, making the ID column non-scrollable Combine Base URL and args into a single URL. Show full URLs onHover or via some gesture Reorder columns as follows. Column names & order would be: ID, Name, Enabled, URL, Mirror, GPG Check, GPG Key Edit window: Make edit window field names match column names with the possible exception of combining URL and Args Enable the radio buttons for enabled, mirror Will we ever want a value in GPG key, but GPG check disabled? If not, combine the 2 fields such that specifying a key implies they key should be checked, and vice versa. Add a Repository window: If it ever makes sense to have GPG Check false, but GPG Key filled then we need to add the "Check" boolean to this window Can we determine if the URL is a mirror programatically? If so we should. Why is "Base URL" the only required field? When I submit a new repo with an invalid URL, nothing appears to happen. When I submit one with only a valid URL, a number of fields are subsequently displayed as null. The dynamically generated ID and Name could be friendlier. On 03/04/2014 05:33 AM, Hongliang Wang wrote:
Add host repositories management in this patch set.
Hongliang Wang (4): [UI] Add i18n Strings for Repositories Management [UI] Add API Support for Repositories Management [UI] Add/Edit Repository Support [UI] Integrate Repositories Management into Host Tab
po/POTFILES.in | 2 + ui/css/theme-default/host.css | 44 +++++++++++ ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++ ui/js/src/kimchi.api.js | 61 +++++++++++++++ ui/js/src/kimchi.host.js | 126 +++++++++++++++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++ ui/pages/i18n.html.tmpl | 18 +++++ ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 ++++ 12 files changed, 766 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl
-- Adam King <rak@linux.vnet.ibm.com> IBM CSI

A few interface suggestions:
Repositories table: Remove "Repos" string from column headers. It should be obvious this data relates to repositories from the section title ACK Remove numerical column, making the ID column non-scrollable It's used to tell user how many packages in total and when user is scrolling, which line he is at. It's intentionally made non-scrollable as "frozen column", just as the non-scrollable first row, which is the
On 03/05/2014 03:53 AM, Adam King wrote: header of the table. Though in the future, we need enhance the Grid Widget with a status bar to show total information and at that time, I think we can remove the ID column.
Combine Base URL and args into a single URL. I was trying to combine them, though found seems base URL is already with args. What's the meaning of URL args? Is there any sample? I'm confused here. @Aline
Base URL example: https://mirrors.fedoraproject.org/metalink?repo=fedora-18&arch=x86_64
Show full URLs onHover or via some gesture In fact, you can resize the columns to see full URLs, Reorder columns as follows. Column names & order would be: ID, Name, Enabled, URL, Mirror, GPG Check, GPG Key ACK if it's confirmed.
Edit window: Make edit window field names match column names with the possible exception of combining URL and Args ACK Enable the radio buttons for enabled, mirror I did do that, but back-end APIs refused to update these 2 fields, so I disabled them. Need discussions. @Aline Will we ever want a value in GPG key, but GPG check disabled? If not, combine the 2 fields such that specifying a key implies they key should be checked, and vice versa. Makes sense. @Aline
Add a Repository window: If it ever makes sense to have GPG Check false, but GPG Key filled then we need to add the "Check" boolean to this window Yes. Need clearer API definition. @Aline Can we determine if the URL is a mirror programatically? If so we should. Why is "Base URL" the only required field? When I submit a new repo with an invalid URL, nothing appears to happen. I checked REST API and found it's the only required field. Seems we can add a invalid repos URL through shell, too. @Aline When I submit one with only a valid URL, a number of fields are subsequently displayed as null. The dynamically generated ID and Name could be friendlier. @Aline
On 03/04/2014 05:33 AM, Hongliang Wang wrote:
Add host repositories management in this patch set.
Hongliang Wang (4): [UI] Add i18n Strings for Repositories Management [UI] Add API Support for Repositories Management [UI] Add/Edit Repository Support [UI] Integrate Repositories Management into Host Tab
po/POTFILES.in | 2 + ui/css/theme-default/host.css | 44 +++++++++++ ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++ ui/js/src/kimchi.api.js | 61 +++++++++++++++ ui/js/src/kimchi.host.js | 126 +++++++++++++++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++ ui/pages/i18n.html.tmpl | 18 +++++ ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 ++++ 12 files changed, 766 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl

On 03/06/2014 06:44 AM, Hongliang Wang wrote:
A few interface suggestions:
Repositories table: Remove "Repos" string from column headers. It should be obvious this data relates to repositories from the section title ACK Remove numerical column, making the ID column non-scrollable It's used to tell user how many packages in total and when user is scrolling, which line he is at. It's intentionally made non-scrollable as "frozen column", just as the non-scrollable first row, which is the
On 03/05/2014 03:53 AM, Adam King wrote: header of the table.
Though in the future, we need enhance the Grid Widget with a status bar to show total information and at that time, I think we can remove the ID column.
Combine Base URL and args into a single URL. I was trying to combine them, though found seems base URL is already with args. What's the meaning of URL args? Is there any sample? I'm confused here. @Aline
Base URL example: https://mirrors.fedoraproject.org/metalink?repo=fedora-18&arch=x86_64
Show full URLs onHover or via some gesture In fact, you can resize the columns to see full URLs, Reorder columns as follows. Column names & order would be: ID, Name, Enabled, URL, Mirror, GPG Check, GPG Key ACK if it's confirmed.
Edit window: Make edit window field names match column names with the possible exception of combining URL and Args ACK Enable the radio buttons for enabled, mirror I did do that, but back-end APIs refused to update these 2 fields, so I disabled them. Need discussions. @Aline
From the API.md the is_mirror parameter can be updated. @Paulo more info on that?
Will we ever want a value in GPG key, but GPG check disabled? If not, combine the 2 fields such that specifying a key implies they key should be checked, and vice versa. Makes sense. @Aline
Yes.
Add a Repository window: If it ever makes sense to have GPG Check false, but GPG Key filled then we need to add the "Check" boolean to this window
Yes. Need clearer API definition. @Aline
The input field for GPG key can be triggered by the check box "GPG Check" If user select the GPG Check we enable the GPG key input and make it a required field. Makes sense?
Can we determine if the URL is a mirror programatically? If so we should.
Not sure. @Paulo
Why is "Base URL" the only required field? When I submit a new repo with an invalid URL, nothing appears to happen. I checked REST API and found it's the only required field. Seems we can add a invalid repos URL through shell, too. @Aline
Yes. It is the only required field for a repo. Maybe backend is missing a URL validation for properly display the error
When I submit one with only a valid URL, a number of fields are subsequently displayed as null. The dynamically generated ID and Name could be friendlier. @Aline
On 03/04/2014 05:33 AM, Hongliang Wang wrote:
Add host repositories management in this patch set.
Hongliang Wang (4): [UI] Add i18n Strings for Repositories Management [UI] Add API Support for Repositories Management [UI] Add/Edit Repository Support [UI] Integrate Repositories Management into Host Tab
po/POTFILES.in | 2 + ui/css/theme-default/host.css | 44 +++++++++++ ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++ ui/js/src/kimchi.api.js | 61 +++++++++++++++ ui/js/src/kimchi.host.js | 126 +++++++++++++++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++ ui/pages/i18n.html.tmpl | 18 +++++ ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 ++++ 12 files changed, 766 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 3/7/2014 3:09 PM, Aline Manera wrote:
On 03/06/2014 06:44 AM, Hongliang Wang wrote:
On 03/05/2014 03:53 AM, Adam King wrote:
A few interface suggestions:
Repositories table: Remove "Repos" string from column headers. It should be obvious this data relates to repositories from the section title ACK Remove numerical column, making the ID column non-scrollable It's used to tell user how many packages in total and when user is scrolling, which line he is at. It's intentionally made non-scrollable as "frozen column", just as the non-scrollable first row, which is the header of the table.
Though in the future, we need enhance the Grid Widget with a status bar to show total information and at that time, I think we can remove the ID column.
Combine Base URL and args into a single URL. I was trying to combine them, though found seems base URL is already with args. What's the meaning of URL args? Is there any sample? I'm confused here. @Aline
Base URL example: https://mirrors.fedoraproject.org/metalink?repo=fedora-18&arch=x86_64
Show full URLs onHover or via some gesture In fact, you can resize the columns to see full URLs, Reorder columns as follows. Column names & order would be: ID, Name, Enabled, URL, Mirror, GPG Check, GPG Key ACK if it's confirmed.
Edit window: Make edit window field names match column names with the possible exception of combining URL and Args ACK Enable the radio buttons for enabled, mirror I did do that, but back-end APIs refused to update these 2 fields, so I disabled them. Need discussions. @Aline
From the API.md the is_mirror parameter can be updated. @Paulo more info on that?
Will we ever want a value in GPG key, but GPG check disabled? If not, combine the 2 fields such that specifying a key implies they key should be checked, and vice versa. Makes sense. @Aline
Yes. Would you elaborate on when it would be desirable to maintain a key that we don't check?
Add a Repository window: If it ever makes sense to have GPG Check false, but GPG Key filled then we need to add the "Check" boolean to this window
Yes. Need clearer API definition. @Aline
The input field for GPG key can be triggered by the check box "GPG Check" If user select the GPG Check we enable the GPG key input and make it a required field.
Makes sense? It would make more sense to assume that the user wants the key checked if they provide one, and don't want it checked if they don't.
Can we determine if the URL is a mirror programatically? If so we should.
Not sure. @Paulo
Why is "Base URL" the only required field? When I submit a new repo with an invalid URL, nothing appears to happen. I checked REST API and found it's the only required field. Seems we can add a invalid repos URL through shell, too. @Aline
Yes. It is the only required field for a repo. Maybe backend is missing a URL validation for properly display the error I don't understand. If the URL is the only required field, why does it cause an error when only the URL field is supplied?
When I submit one with only a valid URL, a number of fields are subsequently displayed as null. The dynamically generated ID and Name could be friendlier. @Aline
On 03/04/2014 05:33 AM, Hongliang Wang wrote:
Add host repositories management in this patch set.
Hongliang Wang (4): [UI] Add i18n Strings for Repositories Management [UI] Add API Support for Repositories Management [UI] Add/Edit Repository Support [UI] Integrate Repositories Management into Host Tab
po/POTFILES.in | 2 + ui/css/theme-default/host.css | 44 +++++++++++ ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++ ui/js/src/kimchi.api.js | 61 +++++++++++++++ ui/js/src/kimchi.host.js | 126 +++++++++++++++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++ ui/pages/i18n.html.tmpl | 18 +++++ ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 ++++ 12 files changed, 766 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
-- Adam King <rak@linux.vnet.ibm.com> IBM C&SI

On 03/07/2014 05:26 PM, Adam King wrote:
On 03/06/2014 06:44 AM, Hongliang Wang wrote:
On 03/05/2014 03:53 AM, Adam King wrote:
A few interface suggestions:
Repositories table: Remove "Repos" string from column headers. It should be obvious this data relates to repositories from the section title ACK Remove numerical column, making the ID column non-scrollable It's used to tell user how many packages in total and when user is scrolling, which line he is at. It's intentionally made non-scrollable as "frozen column", just as the non-scrollable first row, which is the header of the table.
Though in the future, we need enhance the Grid Widget with a status bar to show total information and at that time, I think we can remove the ID column.
Combine Base URL and args into a single URL. I was trying to combine them, though found seems base URL is already with args. What's the meaning of URL args? Is there any sample? I'm confused here. @Aline
Base URL example: https://mirrors.fedoraproject.org/metalink?repo=fedora-18&arch=x86_64
Show full URLs onHover or via some gesture In fact, you can resize the columns to see full URLs, Reorder columns as follows. Column names & order would be: ID, Name, Enabled, URL, Mirror, GPG Check, GPG Key ACK if it's confirmed.
Edit window: Make edit window field names match column names with the possible exception of combining URL and Args ACK Enable the radio buttons for enabled, mirror I did do that, but back-end APIs refused to update these 2 fields, so I disabled them. Need discussions. @Aline
From the API.md the is_mirror parameter can be updated. @Paulo more info on that?
Will we ever want a value in GPG key, but GPG check disabled? If not, combine the 2 fields such that specifying a key implies they key should be checked, and vice versa. Makes sense. @Aline
Yes. Would you elaborate on when it would be desirable to maintain a key
On 3/7/2014 3:09 PM, Aline Manera wrote: that we don't check?
Yes, it makes sense for me. =) I've just agreed with your suggestion
Add a Repository window: If it ever makes sense to have GPG Check false, but GPG Key filled then we need to add the "Check" boolean to this window
Yes. Need clearer API definition. @Aline
The input field for GPG key can be triggered by the check box "GPG Check" If user select the GPG Check we enable the GPG key input and make it a required field.
Makes sense?
It would make more sense to assume that the user wants the key checked if they provide one, and don't want it checked if they don't.
ok
Can we determine if the URL is a mirror programatically? If so we should.
Not sure. @Paulo
Why is "Base URL" the only required field? When I submit a new repo with an invalid URL, nothing appears to happen. I checked REST API and found it's the only required field. Seems we can add a invalid repos URL through shell, too. @Aline
Yes. It is the only required field for a repo. Maybe backend is missing a URL validation for properly display the error
I don't understand. If the URL is the only required field, why does it cause an error when only the URL field is supplied?
Which error you got when trying it?
When I submit one with only a valid URL, a number of fields are subsequently displayed as null. The dynamically generated ID and Name could be friendlier. @Aline
On 03/04/2014 05:33 AM, Hongliang Wang wrote:
Add host repositories management in this patch set.
Hongliang Wang (4): [UI] Add i18n Strings for Repositories Management [UI] Add API Support for Repositories Management [UI] Add/Edit Repository Support [UI] Integrate Repositories Management into Host Tab
po/POTFILES.in | 2 + ui/css/theme-default/host.css | 44 +++++++++++ ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++ ui/js/src/kimchi.api.js | 61 +++++++++++++++ ui/js/src/kimchi.host.js | 126 +++++++++++++++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++ ui/pages/i18n.html.tmpl | 18 +++++ ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 ++++ 12 files changed, 766 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 3/7/2014 3:38 PM, Aline Manera wrote:
On 03/07/2014 05:26 PM, Adam King wrote:
On 03/06/2014 06:44 AM, Hongliang Wang wrote:
On 03/05/2014 03:53 AM, Adam King wrote:
A few interface suggestions:
Repositories table: Remove "Repos" string from column headers. It should be obvious this data relates to repositories from the section title ACK Remove numerical column, making the ID column non-scrollable It's used to tell user how many packages in total and when user is scrolling, which line he is at. It's intentionally made non-scrollable as "frozen column", just as the non-scrollable first row, which is the header of the table.
Though in the future, we need enhance the Grid Widget with a status bar to show total information and at that time, I think we can remove the ID column.
Combine Base URL and args into a single URL. I was trying to combine them, though found seems base URL is already with args. What's the meaning of URL args? Is there any sample? I'm confused here. @Aline
Base URL example: https://mirrors.fedoraproject.org/metalink?repo=fedora-18&arch=x86_64
Show full URLs onHover or via some gesture In fact, you can resize the columns to see full URLs, Reorder columns as follows. Column names & order would be: ID, Name, Enabled, URL, Mirror, GPG Check, GPG Key ACK if it's confirmed.
Edit window: Make edit window field names match column names with the possible exception of combining URL and Args ACK Enable the radio buttons for enabled, mirror I did do that, but back-end APIs refused to update these 2 fields, so I disabled them. Need discussions. @Aline
From the API.md the is_mirror parameter can be updated. @Paulo more info on that?
Will we ever want a value in GPG key, but GPG check disabled? If not, combine the 2 fields such that specifying a key implies they key should be checked, and vice versa. Makes sense. @Aline
Yes. Would you elaborate on when it would be desirable to maintain a key
On 3/7/2014 3:09 PM, Aline Manera wrote: that we don't check?
Yes, it makes sense for me. =) I've just agreed with your suggestion
Add a Repository window: If it ever makes sense to have GPG Check false, but GPG Key filled then we need to add the "Check" boolean to this window
Yes. Need clearer API definition. @Aline
The input field for GPG key can be triggered by the check box "GPG Check" If user select the GPG Check we enable the GPG key input and make it a required field.
Makes sense?
It would make more sense to assume that the user wants the key checked if they provide one, and don't want it checked if they don't.
ok
Can we determine if the URL is a mirror programatically? If so we should.
Not sure. @Paulo
Why is "Base URL" the only required field? When I submit a new repo with an invalid URL, nothing appears to happen. I checked REST API and found it's the only required field. Seems we can add a invalid repos URL through shell, too. @Aline
Yes. It is the only required field for a repo. Maybe backend is missing a URL validation for properly display the error
I don't understand. If the URL is the only required field, why does it cause an error when only the URL field is supplied?
Which error you got when trying it? I was getting an error before when I tried the update code, after using
Sorry, I misread that to mean that yes we would want to have a key we don't check, which I was having a hard time following. the repo code to create a new repo while only supplying the URL. I have done something to my src that I can't get Update Software to run, so can't reproduce the error atm, I'll try to sort it next time I update.
When I submit one with only a valid URL, a number of fields are subsequently displayed as null. The dynamically generated ID and Name could be friendlier. @Aline
On 03/04/2014 05:33 AM, Hongliang Wang wrote:
Add host repositories management in this patch set.
Hongliang Wang (4): [UI] Add i18n Strings for Repositories Management [UI] Add API Support for Repositories Management [UI] Add/Edit Repository Support [UI] Integrate Repositories Management into Host Tab
po/POTFILES.in | 2 + ui/css/theme-default/host.css | 44 +++++++++++ ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++ ui/js/src/kimchi.api.js | 61 +++++++++++++++ ui/js/src/kimchi.host.js | 126 +++++++++++++++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++ ui/pages/i18n.html.tmpl | 18 +++++ ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 ++++ 12 files changed, 766 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
-- Adam King <rak@linux.vnet.ibm.com> IBM C&SI

On Fri, 2014-03-07 at 17:09 -0300, Aline Manera wrote:
On 03/06/2014 06:44 AM, Hongliang Wang wrote:
A few interface suggestions:
Repositories table: Remove "Repos" string from column headers. It should be obvious this data relates to repositories from the section title ACK Remove numerical column, making the ID column non-scrollable It's used to tell user how many packages in total and when user is scrolling, which line he is at. It's intentionally made non-scrollable as "frozen column", just as the non-scrollable first row, which is the
On 03/05/2014 03:53 AM, Adam King wrote: header of the table.
Though in the future, we need enhance the Grid Widget with a status bar to show total information and at that time, I think we can remove the ID column.
Combine Base URL and args into a single URL. I was trying to combine them, though found seems base URL is already with args. What's the meaning of URL args? Is there any sample? I'm confused here. @Aline
Base URL example: https://mirrors.fedoraproject.org/metalink?repo=fedora-18&arch=x86_64
Show full URLs onHover or via some gesture In fact, you can resize the columns to see full URLs, Reorder columns as follows. Column names & order would be: ID, Name, Enabled, URL, Mirror, GPG Check, GPG Key ACK if it's confirmed.
Edit window: Make edit window field names match column names with the possible exception of combining URL and Args ACK Enable the radio buttons for enabled, mirror I did do that, but back-end APIs refused to update these 2 fields, so I disabled them. Need discussions. @Aline
From the API.md the is_mirror parameter can be updated. @Paulo more info on that?
Yes! You can modify a repository information to use a mirror instead of a baseurl. The idea is use the field of baseurl to input the new mirror url and check a box to enable it as a mirror. With baseurl and is_mirror, the backend will do the magic to add/update the repository using a mirror.
Will we ever want a value in GPG key, but GPG check disabled? If not, combine the 2 fields such that specifying a key implies they key should be checked, and vice versa. Makes sense. @Aline
Yes.
Add a Repository window: If it ever makes sense to have GPG Check false, but GPG Key filled then we need to add the "Check" boolean to this window
Yes. Need clearer API definition. @Aline
The input field for GPG key can be triggered by the check box "GPG Check" If user select the GPG Check we enable the GPG key input and make it a required field.
Makes sense?
Can we determine if the URL is a mirror programatically? If so we should.
Not sure. @Paulo
No, we can't.
Why is "Base URL" the only required field? When I submit a new repo with an invalid URL, nothing appears to happen. I checked REST API and found it's the only required field. Seems we can add a invalid repos URL through shell, too. @Aline
Yes. It is the only required field for a repo. Maybe backend is missing a URL validation for properly display the error
When I submit one with only a valid URL, a number of fields are subsequently displayed as null. The dynamically generated ID and Name could be friendlier. @Aline
On 03/04/2014 05:33 AM, Hongliang Wang wrote:
Add host repositories management in this patch set.
Hongliang Wang (4): [UI] Add i18n Strings for Repositories Management [UI] Add API Support for Repositories Management [UI] Add/Edit Repository Support [UI] Integrate Repositories Management into Host Tab
po/POTFILES.in | 2 + ui/css/theme-default/host.css | 44 +++++++++++ ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++ ui/js/src/kimchi.api.js | 61 +++++++++++++++ ui/js/src/kimchi.host.js | 126 +++++++++++++++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++ ui/pages/i18n.html.tmpl | 18 +++++ ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 ++++ 12 files changed, 766 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 03/11/2014 04:07 AM, Paulo Ricardo Paz Vital wrote:
On Fri, 2014-03-07 at 17:09 -0300, Aline Manera wrote:
On 03/06/2014 06:44 AM, Hongliang Wang wrote:
A few interface suggestions:
Repositories table: Remove "Repos" string from column headers. It should be obvious this data relates to repositories from the section title ACK Remove numerical column, making the ID column non-scrollable It's used to tell user how many packages in total and when user is scrolling, which line he is at. It's intentionally made non-scrollable as "frozen column", just as the non-scrollable first row, which is the
On 03/05/2014 03:53 AM, Adam King wrote: header of the table.
Though in the future, we need enhance the Grid Widget with a status bar to show total information and at that time, I think we can remove the ID column.
Combine Base URL and args into a single URL. I was trying to combine them, though found seems base URL is already with args. What's the meaning of URL args? Is there any sample? I'm confused here. @Aline
Base URL example: https://mirrors.fedoraproject.org/metalink?repo=fedora-18&arch=x86_64
Show full URLs onHover or via some gesture In fact, you can resize the columns to see full URLs, Reorder columns as follows. Column names & order would be: ID, Name, Enabled, URL, Mirror, GPG Check, GPG Key ACK if it's confirmed.
Edit window: Make edit window field names match column names with the possible exception of combining URL and Args ACK Enable the radio buttons for enabled, mirror I did do that, but back-end APIs refused to update these 2 fields, so I disabled them. Need discussions. @Aline From the API.md the is_mirror parameter can be updated. @Paulo more info on that? Yes! You can modify a repository information to use a mirror instead of a baseurl. The idea is use the field of baseurl to input the new mirror url and check a box to enable it as a mirror. With baseurl and is_mirror, the backend will do the magic to add/update the repository using a mirror. Hi Paulo, I'm confused that when I perform a update with baseurl and is_mirror changed, an error occurred: KCHAPI0004E: Parameters is_mirror are not allowed to be updated in repository
What's the correct way to do repository update? I'll send a patch out with my change set.
Will we ever want a value in GPG key, but GPG check disabled? If not, combine the 2 fields such that specifying a key implies they key should be checked, and vice versa. Makes sense. @Aline Yes.
Add a Repository window: If it ever makes sense to have GPG Check false, but GPG Key filled then we need to add the "Check" boolean to this window Yes. Need clearer API definition. @Aline The input field for GPG key can be triggered by the check box "GPG Check" If user select the GPG Check we enable the GPG key input and make it a required field.
Makes sense?
Can we determine if the URL is a mirror programatically? If so we should. Not sure. @Paulo No, we can't.
Why is "Base URL" the only required field? When I submit a new repo with an invalid URL, nothing appears to happen. I checked REST API and found it's the only required field. Seems we can add a invalid repos URL through shell, too. @Aline Yes. It is the only required field for a repo. Maybe backend is missing a URL validation for properly display the error
When I submit one with only a valid URL, a number of fields are subsequently displayed as null. The dynamically generated ID and Name could be friendlier. @Aline
On 03/04/2014 05:33 AM, Hongliang Wang wrote:
Add host repositories management in this patch set.
Hongliang Wang (4): [UI] Add i18n Strings for Repositories Management [UI] Add API Support for Repositories Management [UI] Add/Edit Repository Support [UI] Integrate Repositories Management into Host Tab
po/POTFILES.in | 2 + ui/css/theme-default/host.css | 44 +++++++++++ ui/css/theme-default/repository-add.css | 39 ++++++++++ ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++ ui/js/src/kimchi.api.js | 61 +++++++++++++++ ui/js/src/kimchi.host.js | 126 +++++++++++++++++++++++++++++++ ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++ ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++ ui/pages/i18n.html.tmpl | 18 +++++ ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++++++++ ui/pages/repository-edit.html.tmpl | 121 +++++++++++++++++++++++++++++ ui/pages/tabs/host.html.tmpl | 13 ++++ 12 files changed, 766 insertions(+) create mode 100644 ui/css/theme-default/repository-add.css create mode 100644 ui/css/theme-default/repository-edit.css create mode 100644 ui/js/src/kimchi.repository_add_main.js create mode 100644 ui/js/src/kimchi.repository_edit_main.js create mode 100644 ui/pages/repository-add.html.tmpl create mode 100644 ui/pages/repository-edit.html.tmpl
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 3/6/2014 4:44 AM, Hongliang Wang wrote:
Remove numerical column, making the ID column non-scrollable It's used to tell user how many packages in total and when user is scrolling, which line he is at. It's intentionally made non-scrollable as "frozen column", just as the non-scrollable first row, which is the header of the table.
Though in the future, we need enhance the Grid Widget with a status bar to show total information and at that time, I think we can remove the ID column.
I don't follow the value of the numerical column. I can see making ID non-scrollabe, as it is used as the ID of the repo. The # doesn't seem to be used for anything. If you want it so its easy to tell how many items are in the table, we can count programatically and put that info under the table. -- Adam King <rak@linux.vnet.ibm.com> IBM C&SI
participants (4)
-
Adam King
-
Aline Manera
-
Hongliang Wang
-
Paulo Ricardo Paz Vital