From 749733e7aa36cb9b404765fb504fa854b76800a0 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 8 Mar 2024 11:20:46 +0800 Subject: [PATCH] * Adjust zanode create linkage. --- module/zanode/js/create.ui.js | 11 ++++++++--- module/zanode/ui/create.html.php | 11 +++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/module/zanode/js/create.ui.js b/module/zanode/js/create.ui.js index 636f1cd848..4aa73041c2 100644 --- a/module/zanode/js/create.ui.js +++ b/module/zanode/js/create.ui.js @@ -24,10 +24,10 @@ function onChangeType() } } -function onHostChange(event) +function onHostChange(host) { - var hostID = $(event.target).val(); - var link = $.createLink('zanode', 'ajaxGetImages', 'hostID=' + hostID); + const hostID = typeof host == 'object' ? $('[name=parent]').val() : host; + var link = $.createLink('zanode', 'ajaxGetImages', 'hostID=' + hostID); $.get(link, function(data) { if(data) @@ -106,3 +106,8 @@ function onChangeSystem(event) $osPicker.render({items: osItems}); $osPicker.$.clear(); } + +$(function() +{ + if(hostID) onHostChange(hostID); +}); diff --git a/module/zanode/ui/create.html.php b/module/zanode/ui/create.html.php index 6a19ee0f0d..ade04318d8 100644 --- a/module/zanode/ui/create.html.php +++ b/module/zanode/ui/create.html.php @@ -12,6 +12,7 @@ namespace zin; jsVar('linuxList', $config->zanode->linuxList); jsVar('windowsList', $config->zanode->windowsList); +jsVar('hostID', $hostID); formPanel ( @@ -26,10 +27,10 @@ formPanel ( array ( - 'toggle' => 'tooltip', - 'placement' => 'right', - 'title' => $lang->zanode->tips, - 'type' => 'white', + 'toggle' => 'tooltip', + 'placement' => 'right', + 'title' => $lang->zanode->tips, + 'type' => 'white', 'class-name' => 'text-gray border border-light' ) ), @@ -181,5 +182,3 @@ formPanel set::control('editor') ) ); - -render();