mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 18:01:13 +02:00
yWeb 2.8.a.3 Alpha-Version
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@406 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -1,208 +1,57 @@
|
||||
{=include-block:Y_Blocks.txt;management_check_top=}
|
||||
{=include-block:Y_Blocks.txt;head=}
|
||||
<script type="text/javascript" src="/prototype.js"></script>
|
||||
<script type="text/javascript" src="/Y_Baselib.js"></script>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function do_submit()
|
||||
{
|
||||
show_waitbox(true);
|
||||
document.f.submit();
|
||||
}
|
||||
/*sLog*/
|
||||
var sLog_body;
|
||||
var sLog_line_number;
|
||||
function sLog_init()
|
||||
{
|
||||
sLog_line_number = 0;
|
||||
sLog_body=document.getElementById("slog_list");
|
||||
}
|
||||
function sLog_clear()
|
||||
{
|
||||
while(sLog_body.childNodes.length > 0)
|
||||
{
|
||||
aChild=sLog_body.firstChild;
|
||||
sLog_body.removeChild(aChild);
|
||||
}
|
||||
sLog_line_number = 0;
|
||||
}
|
||||
function sLog_addRow(_body, state, action_text, state_text)
|
||||
{
|
||||
sLog_line_number++;
|
||||
var mycurrent_row = y_add_row_to_table(_body, ((sLog_line_number % 2) ==0)?"a":"b" );
|
||||
var __img ="/images/ok.gif";
|
||||
switch (state)
|
||||
{
|
||||
case "green": __img = "/images/check_green.gif"; break;
|
||||
case "yellow": __img = "/images/excl_yellow.gif"; break;
|
||||
case "ok": __img = "/images/ok.gif"; break;
|
||||
case "red": __img = "/images/x_red.gif"; break;
|
||||
}
|
||||
y_add_html_cell_to_row(mycurrent_row, "icon", "<img src='"+__img+"'>");
|
||||
y_add_html_cell_to_row(mycurrent_row, "action_text", action_text);
|
||||
y_add_text_cell_to_row(mycurrent_row, "state_text", state_text);
|
||||
}
|
||||
/*update_list*/
|
||||
var update_body;
|
||||
var upd_extentions = new Array(); /*<upd_site>,<type=n|m>,<link text>,<link helptext>,<url>,<unique tag>,<version>,<url of installer>*/
|
||||
var installed_extentions = new Array(); /*<type=n|m>,<link text>,<link helptext>,<url>,<unique tag>,<version>*/
|
||||
var update_sites = new Array(); /*<type=u>,<update site name>,<update site helptext>,<url of extention list>*/
|
||||
function update_list_init()
|
||||
{
|
||||
update_body=document.getElementById("update_list");
|
||||
}
|
||||
function update_list_clear()
|
||||
{
|
||||
while(update_body.childNodes.length > 0){
|
||||
aChild=update_body.firstChild;
|
||||
update_body.removeChild(aChild);
|
||||
}
|
||||
}
|
||||
function update_list_addRow(_body, i, site, extention, tag, your_version, update_version)
|
||||
{
|
||||
var mycurrent_row = y_add_row_to_table(_body, ((i % 2) ==0)?"a":"b" );
|
||||
y_add_html_cell_to_row(mycurrent_row, "setupdate", '<input type="checkbox" name="setupdate">');
|
||||
y_add_text_cell_to_row(mycurrent_row, "site", site);
|
||||
y_add_text_cell_to_row(mycurrent_row, "extention", extention);
|
||||
y_add_text_cell_to_row(mycurrent_row, "tag", tag);
|
||||
y_add_text_cell_to_row(mycurrent_row, "your_version", your_version);
|
||||
y_add_html_cell_to_row(mycurrent_row, "update_version", update_version);
|
||||
}
|
||||
function build_list()
|
||||
{
|
||||
show_waitbox(true);
|
||||
window.setTimeout("build_list2()",300);
|
||||
}
|
||||
function build_list2()
|
||||
{
|
||||
sLog_init();
|
||||
update_list_init();
|
||||
update_list_clear();
|
||||
/*get installed ext and update sites*/
|
||||
var extlist = loadSyncURL("/control/exec?Y_Tools&get_extention_list&" + Math.random());
|
||||
var list = extlist.split("\n");
|
||||
installed_extentions = new Array();
|
||||
update_sites = new Array();
|
||||
for(i=0;i<list.length;i++){
|
||||
var ext_type = list[i].charAt(0);
|
||||
if(ext_type=="n" || ext_type=="m"){
|
||||
var pieces=list[i].split(",");
|
||||
installed_extentions.push(pieces);
|
||||
} else if(ext_type == "u"){
|
||||
var pieces=list[i].split(",");
|
||||
update_sites.push(pieces);
|
||||
}
|
||||
}
|
||||
sLog_addRow(sLog_body, "green", "installed Extentions: "+installed_extentions.length, "ok");
|
||||
/* get updatesite ext*/
|
||||
upd_extentions = new Array();
|
||||
for(i=0;i<update_sites.length;i++){
|
||||
var update_file = loadSyncURL("/control/exec?Y_Tools&url_get&"+update_sites[i][3]+"&ext_upt.txt&" + Math.random());
|
||||
//TODO: error checking
|
||||
sLog_addRow(sLog_body, "green", "get list from: "+update_sites[i][3], "ok");
|
||||
var list = update_file.split("\n");
|
||||
for(j=0;j<list.length;j++){
|
||||
var ext_type = list[j].charAt(0);
|
||||
if(ext_type=="n" || ext_type=="m"){
|
||||
var pieces=list[j].split(",");
|
||||
pieces.unshift(update_sites[i][1]);
|
||||
upd_extentions.push(pieces);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*build_list*/
|
||||
for(i=0;i<upd_extentions.length;i++){
|
||||
var your_version="%";
|
||||
for(j=0;j<installed_extentions.length;j++)
|
||||
if(installed_extentions[j][4]==upd_extentions[i][5])
|
||||
your_version = installed_extentions[j][5];
|
||||
update_list_addRow(update_body,i,upd_extentions[i][0],upd_extentions[i][2],upd_extentions[i][5],your_version,upd_extentions[i][6]);
|
||||
}
|
||||
show_waitbox(false);
|
||||
}
|
||||
function do_set_updates()
|
||||
{
|
||||
show_waitbox(true);
|
||||
window.setTimeout("do_set_updates2()",300);
|
||||
}
|
||||
function do_set_updates2()
|
||||
{
|
||||
var _rows = update_body.getElementsByTagName("tr");
|
||||
for(var i=0; i< _rows.length; i++){
|
||||
var rowNode = _rows.item(i);
|
||||
if(rowNode.firstChild.firstChild.checked == true){
|
||||
var res = loadSyncURL("/control/exec?Y_Tools&ext_installer&"+upd_extentions[i][7]);
|
||||
if(res.search(/error/)!=-1){
|
||||
alert(res);
|
||||
sLog_addRow(sLog_body, "red", "update error: "+res, "error");
|
||||
}
|
||||
else{
|
||||
sLog_addRow(sLog_body, "green", "installed/updates: "+upd_extentions[i][2], "ok");
|
||||
add_item_to_ext_list(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
sLog_addRow(sLog_body, "green", "updating local extention list. Starting ...", "ok");
|
||||
var ext=write_extentions();
|
||||
document.f.extentions.value=ext;
|
||||
show_waitbox(false);
|
||||
alert("update fertig. Menue neuladen.")
|
||||
do_submit();
|
||||
}
|
||||
function write_extentions()
|
||||
{
|
||||
var ext="";
|
||||
for(i=0;i<installed_extentions.length;i++)
|
||||
ext += installed_extentions[i]+"\n";
|
||||
for(i=0;i<update_sites.length;i++)
|
||||
ext += update_sites[i]+"\n";
|
||||
return ext;
|
||||
}
|
||||
function add_item_to_ext_list(upd_index)
|
||||
{
|
||||
/*allready installed*/
|
||||
var allready_installed = false;
|
||||
for(i=0;i<installed_extentions.length;i++){
|
||||
if(installed_extentions[i][4]==upd_extentions[upd_index][5]){
|
||||
allready_installed = true;
|
||||
for(j=0;j<=5;j++)
|
||||
installed_extentions[i][j] = upd_extentions[upd_index][j+1];
|
||||
}
|
||||
}
|
||||
if(!allready_installed){
|
||||
upd_extentions[upd_index].shift();//delete site name
|
||||
upd_extentions[upd_index].pop();//delete url
|
||||
var new_ext = upd_extentions[upd_index];
|
||||
installed_extentions.push(new_ext);
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<script type="text/javascript" src="/Y_yweb.js"></script>
|
||||
<script type="text/javascript" src="/Y_Ext_Update.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
{=var-set:wait_text=Values are updated.=}{=include-block:Y_Blocks.txt;snip_wait=}
|
||||
{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=}
|
||||
<div class="work_box">
|
||||
<div class="work_box_head"><div class="work_box_head_h2">
|
||||
{=var-set:help_url=Neutrino:yWeb:Extentions#Update=}{=var-set:menu=Extentions Updater/Installer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
|
||||
<div class="work_box_body" width="100%s">
|
||||
{=var-set:help_url=Help-Extensions-Update=}{=var-set:menu={=L:ext.installer_updater=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
|
||||
<div class="work_box_body" width="100%">
|
||||
<div id="statusline"><img border="0" src="/images/wait.gif" width="20" height="20" alt="wait"/>
|
||||
<span id="status">Search for Updates ...</span></div>
|
||||
|
||||
<form method="post" name="update" action="">
|
||||
<input type="button" value="build list" title="build list" onclick="build_list()"/>
|
||||
<!-- <input type="button" value="build list" title="build list" onclick="build_list()"/>-->
|
||||
<br/>
|
||||
<b>update Preview List</b>
|
||||
<table class="y_work_table" cellpadding="2">
|
||||
<div class="y_form_header_oline">update Preview List</div>
|
||||
<table class="lt_table" cellspacing="0" cellpadding="2">
|
||||
<thead align="left">
|
||||
<tr>
|
||||
<tr valign="bottom">
|
||||
<th> </th>
|
||||
<th>Site</th><th>Extention</th>
|
||||
<th>Tag</th><th>your Version</th><th>Update Version</th>
|
||||
<th>Site</th><th>Type</th><th>Extension</th>
|
||||
<th>Tag</th><th>your<br/>Version</th><th>Update<br/>Version</th>
|
||||
<th title="minimal yWeb version">yWeb</th><th>Size/k</th><th>Info</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="update_list">
|
||||
<tr><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="button" value="update/install" title="" name="set_updates" onclick="do_set_updates()"/>
|
||||
</form>
|
||||
<br/>New extention settings (preview)<br/>
|
||||
<button type="button" ytype="go" title="" name="set_updates" onclick="do_set_updates()">update/install</button>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="free">?</div>
|
||||
Free: <span id="avaiable">?</span>k
|
||||
<form method="post" name="log" action="">
|
||||
<div class="y_form_header_oline">Log</div>
|
||||
<table class="lt_table" cellspacing="0" cellpadding="4">
|
||||
<thead align="left">
|
||||
<tr>
|
||||
<th> </th><th>Action</th><th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="slog_list">
|
||||
<tr><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
</form>
|
||||
<br/>
|
||||
<div class="y_form_header">New extension settings (preview)</div>
|
||||
<form name="f" accept-charset="UTF-8" action="/y/cgi">
|
||||
<table border="0" class="y_form_table" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
@@ -212,24 +61,15 @@ function add_item_to_ext_list(upd_index)
|
||||
<br/>
|
||||
<input type="hidden" name="tmpl" value="Y_Ext_Update_refresh.yhtm"/>
|
||||
<input type="hidden" name="execute" value="include-block:Y_Blocks.txt;ext_save_settings;nix"/>
|
||||
</form>
|
||||
<br/>
|
||||
<form method="post" name="log" action="">
|
||||
<b>Log</b><br/>
|
||||
<table class="y_work_table" cellpadding="4">
|
||||
<thead align="left">
|
||||
<tr>
|
||||
<th> </th><th>Aktion</th><th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="slog_list">
|
||||
<tr><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
window.setTimeout("build_list();",500);
|
||||
yversion_str="{=ini-get:Y_Version.txt;version=}";
|
||||
//]]>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
{=include-block:Y_Blocks.txt;management_check_bottom=}
|
||||
|
Reference in New Issue
Block a user