Enable server browser for certain image attributes.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8488 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2010-12-20 22:25:55 +00:00
parent aad10bb48c
commit 79ced60a6b

View File

@ -131,9 +131,9 @@ function loadImages(data) {
*/
// Create copy Linux button
var copyLinuxBtn = createButton('Copy Linux');
var copyLinuxBtn = createButton('Copy CD');
copyLinuxBtn.bind('click', function(event) {
loadCopyLinuxPage();
loadCopyCdPage();
});
// Create edit button
@ -464,7 +464,133 @@ function loadEditImagePage(tgtImage) {
// Create label and input for attribute
div = $('<div></div>').css('display', 'inline');
label = $('<label>' + key + ':</label>').css('vertical-align', 'middle');
input = $('<input type="text" value="' + value + '" title="' + defAttrs[key] + '"/>').css('margin-top', '5px');
input = $('<input type="text" id="' + key + '" value="' + value + '" title="' + defAttrs[key] + '"/>').css('margin-top', '5px');
// Create server browser
switch (key) {
case 'pkgdir':
input.serverBrowser({
onSelect : function(path) {
$('#pkgdir').val(path);
},
onLoad : function() {
return $('#pkgdir').val();
},
knownExt : [ 'exe', 'js', 'txt' ],
knownPaths : [{
text : 'Install',
image : 'desktop.png',
path : '/install'
}],
imageUrl : 'images/',
systemImageUrl : 'images/',
handlerUrl : 'lib/getpath.php',
title : 'Browse',
requestMethod : 'POST',
width : '500',
height : '300',
basePath : '/install' // Limit user to only install directory
});
break;
case 'otherpkgdir':
input.serverBrowser({
onSelect : function(path) {
$('#otherpkgdir').val(path);
},
onLoad : function() {
return $('#otherpkgdir').val();
},
knownExt : [ 'exe', 'js', 'txt' ],
knownPaths : [{
text : 'Install',
image : 'desktop.png',
path : '/install'
}],
imageUrl : 'images/',
systemImageUrl : 'images/',
handlerUrl : 'lib/getpath.php',
title : 'Browse',
requestMethod : 'POST',
width : '500',
height : '300',
basePath : '/install' // Limit user to only install directory
});
break;
case 'pkglist':
input.serverBrowser({
onSelect : function(path) {
$('#pkglist').val(path);
},
onLoad : function() {
return $('#pkglist').val();
},
knownExt : [ 'exe', 'js', 'txt' ],
knownPaths : [{
text : 'Install',
image : 'desktop.png',
path : '/install'
}],
imageUrl : 'images/',
systemImageUrl : 'images/',
handlerUrl : 'lib/getpath.php',
title : 'Browse',
requestMethod : 'POST',
width : '500',
height : '300',
basePath : '/opt/xcat/share' // Limit user to only install directory
});
break;
case 'otherpkglist':
input.serverBrowser({
onSelect : function(path) {
$('#otherpkglist').val(path);
},
onLoad : function() {
return $('#otherpkglist').val();
},
knownExt : [ 'exe', 'js', 'txt' ],
knownPaths : [{
text : 'Install',
image : 'desktop.png',
path : '/install'
}],
imageUrl : 'images/',
systemImageUrl : 'images/',
handlerUrl : 'lib/getpath.php',
title : 'Browse',
requestMethod : 'POST',
width : '500',
height : '300',
basePath : '/install' // Limit user to only install directory
});
break;
case 'template':
input.serverBrowser({
onSelect : function(path) {
$('#template').val(path);
},
onLoad : function() {
return $('#template').val();
},
knownExt : [ 'exe', 'js', 'txt' ],
knownPaths : [{
text : 'Install',
image : 'desktop.png',
path : '/install'
}],
imageUrl : 'images/',
systemImageUrl : 'images/',
handlerUrl : 'lib/getpath.php',
title : 'Browse',
requestMethod : 'POST',
width : '500',
height : '300',
basePath : '/opt/xcat/share' // Limit user to only install directory
});
break;
default:
// Do nothing
}
// Change border to blue onchange
input.bind('change', function(event) {
@ -564,11 +690,11 @@ function loadEditImagePage(tgtImage) {
}
/**
* Load copy CDs page
* Load copy CD page
*
* @return Nothing
*/
function loadCopyLinuxPage() {
function loadCopyCdPage() {
// Get provision tab
var tab = getProvisionTab();