[Kimchi-devel] [PATCH] Bug 461 Fix: (UI)Support Repository Meta Link
huoyuxin at linux.vnet.ibm.com
huoyuxin at linux.vnet.ibm.com
Mon Dec 15 07:38:20 UTC 2014
From: Yu Xin Huo <huoyuxin at linux.vnet.ibm.com>
Signed-off-by: Yu Xin Huo <huoyuxin at linux.vnet.ibm.com>
---
ui/js/src/kimchi.repository_add_main.js | 10 +++-------
ui/pages/repository-add.html.tmpl | 6 +++++-
ui/pages/repository-edit.html.tmpl | 8 ++++++++
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/ui/js/src/kimchi.repository_add_main.js b/ui/js/src/kimchi.repository_add_main.js
index 2a277fd..d572c69 100644
--- a/ui/js/src/kimchi.repository_add_main.js
+++ b/ui/js/src/kimchi.repository_add_main.js
@@ -57,17 +57,13 @@ kimchi.repository_add_main = function() {
}
var formData = $(addForm).serializeObject();
-
- if (formData && formData.isMirror!=undefined) {
- formData.isMirror=(String(formData.isMirror).toLowerCase() === 'true');
- }
- if(formData.isMirror) {
+ if(formData.linkType) {
if(formData.config==undefined) {
formData.config=new Object();
}
- formData.config.mirrorlist=formData.baseurl;
+ formData.config[formData.linkType]=formData.baseurl;
delete formData.baseurl;
- delete formData.isMirror;
+ delete formData.linkType;
}
weedObject(formData);
if(formData.config && formData.config.comps) {
diff --git a/ui/pages/repository-add.html.tmpl b/ui/pages/repository-add.html.tmpl
index 6de4f76..96cf6f6 100644
--- a/ui/pages/repository-add.html.tmpl
+++ b/ui/pages/repository-add.html.tmpl
@@ -63,9 +63,13 @@
</div>
<div class="field yum">
<p class="yum">
- <input type="checkbox" name="isMirror" value="true" id="isMirror" />
+ <input type="radio" name="linkType" value="mirrorlist" id="isMirror" />
<label for="isMirror">$_("Repository is a mirror")</label>
</p>
+ <p class="yum">
+ <input type="radio" name="linkType" value="metalink" id="isMeta" />
+ <label for="isMeta">$_("Repository is a meta link")</label>
+ </p>
</div>
</section>
<section class="form-section repository-dist deb">
diff --git a/ui/pages/repository-edit.html.tmpl b/ui/pages/repository-edit.html.tmpl
index f13cb90..4467ca8 100644
--- a/ui/pages/repository-edit.html.tmpl
+++ b/ui/pages/repository-edit.html.tmpl
@@ -71,6 +71,14 @@
<input id="repository-edit-urlargs-textbox" class="yum" name="config[mirrorlist]" type="text" />
</div>
</div>
+ <div class="yum">
+ <div class="repository-edit-wrapper-label">
+ <label for="repository-edit-urlargs-textbox">$_("Meta Link URL")</label>
+ </div>
+ <div class="repository-edit-wrapper-controls">
+ <input id="repository-edit-urlargs-textbox" class="yum" name="config[metalink]" type="text" />
+ </div>
+ </div>
<div class="repository-comps deb">
<div class="repository-edit-wrapper-label">
<label for="repository-edit-urlargs-textbox">$_("Components")</label>
--
1.7.1
More information about the Kimchi-devel
mailing list