diff --git a/src/dev-center/css/style.css b/src/dev-center/css/style.css index 5e68a0c7b..64598450e 100644 --- a/src/dev-center/css/style.css +++ b/src/dev-center/css/style.css @@ -363,7 +363,7 @@ label { #edit-app{ display: none; } -#create-app-error, #edit-app-error, #jip-error { +#create-app-error,#deploy-app-error, #edit-app-error, #jip-error { display: none; } @@ -1468,3 +1468,36 @@ dialog{ .tab-btn-separator{ display: none; } + + +.deploy-app-card-container { + max-width: 100%; + margin: auto; +} + +.deploy-app-card { + background: #fff; + border: 1.5px solid #dbe3f0; + border-radius: 14px; + padding: 20px; + margin-bottom: 24px; + transition: border-color 0.2s ease; +} + +.deploy-app-card.deploy-app-active { + border-color: #3a85ff; +} + +.deploy-app-card-header { + display: flex; + justify-content: space-between; + align-items: flex-start; +} + +.deploy-app-card-or { + text-align: center; + margin: 10px 0 20px; + color: #9ca3af; + font-weight: 500; +} + diff --git a/src/dev-center/js/apps.js b/src/dev-center/js/apps.js index 3761f0060..cef38e823 100644 --- a/src/dev-center/js/apps.js +++ b/src/dev-center/js/apps.js @@ -277,7 +277,12 @@ async function create_app (title, source_path = null, items = null) { } $(document).on('click', '.deploy-btn', function (e) { - deploy(currently_editing_app, dropped_items); + const $activeCard = $('.deploy-app-card.deploy-app-active'); + if ( $activeCard.hasClass('deploy-app-card-files') ) { + deploy(currently_editing_app, dropped_items); + } else if ( $activeCard.hasClass('deploy-app-card-link') ) { + saveEditedApp('deploy-app-index-url'); + } }); $(document).on('click', '.edit-app, .go-to-edit-app', function (e) { @@ -288,6 +293,32 @@ $(document).on('click', '.edit-app, .go-to-edit-app', function (e) { $(document).on('click', '.delete-app', async function (e) { }); +$(document).on('click', '.deploy-app-card', function () { + if ( $(this).hasClass('deploy-app-active') ) { + return; + } + $('.deploy-btn').addClass('disabled'); + if ( $(this).hasClass('deploy-app-card-files') ) { + $('#deploy-app-index-url').val(''); + } + if ( $(this).hasClass('deploy-app-card-link') ) { + reset_drop_area(); + if ( $('#deploy-app-index-url').val() != '' ) { + $('.deploy-btn').removeClass('disabled'); + } + } + $('.deploy-app-card').removeClass('deploy-app-active'); + $(this) + .addClass('deploy-app-active') + .find('input[type="radio"]') + .prop('checked', true); + +}); + +$(document).on('input change', '#deploy-app-index-url', () => { + $('.deploy-btn').removeClass('disabled'); +}); + // generate app link function applink (app) { return `${protocol}://${domain}${port ? `:${port}` : ''}/app/${app.name}`; @@ -349,12 +380,40 @@ function generate_edit_app_section (app) {
Upload and deploy static assets like HTML, CSS, and JavaScript directly to host your app.
+Set the app’s index to any publicly accessible URL where your app is already deployed.
+