HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.ankua.asia/storage/framework/views/434bca7cf13ea647d8c5e6fc83391051.php
<?php $__env->startSection('template_title'); ?>
  <?php echo e(trans('installer::installer_messages.environment.template_title')); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('title'); ?>
  <i class="fa fa-magic fa-fw" aria-hidden="true"></i>
  <?php echo trans('installer::installer_messages.environment.title'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
  <?php
    $entry_key = 'installer::installer_messages.environment.';
  ?>
  <div class="install-4">
    <h3 class="mb-5"><?php echo e(__('installer::installer_messages.environment.title')); ?></h3>

    <form method="post" id="environment-form" action="<?php echo e(route('installer.environment.save')); ?>" novalidate class="needs-validation">
      <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">

      <div class="row gx-4 gy-3 mb-5 database-link-wrap">
        <div class="col-12">
          <div class="d-flex align-items-center title-status">
            <h5 class="mb-0"><?php echo e(__('installer::installer_messages.environment.database_link')); ?></h5>
            <div class="d-none ms-3 database-loading">
              <div class="spinner-border spinner-border-sm text-muted"></div>
              <span class="text-muted"><?php echo e(__('installer::installer_messages.environment.ajax_database_parameters')); ?></span>
            </div>
            <div class="text-danger d-flex align-items-center ms-3 d-none">
              <i class="bi bi-x-circle-fill fs-5 lh-1 me-1"></i><span></span>
            </div>
            <div class="text-success d-flex align-items-center ms-3 d-none"><i
                class="bi bi-check-circle-fill me-1 fs-4 lh-1"></i><?php echo e(__('installer::installer_messages.environment.ajax_database_success')); ?></div>
          </div>
          <hr class="mb-0">
        </div>

        <div class="col-sm-6">
          <label class="form-label">
            <?php echo e(trans($entry_key . 'db_connection_label')); ?>

          </label>
          <select name="database_connection" class="form-select" aria-label="Default select example">
            <option value="mysql" selected>
              <?php echo e(trans($entry_key . 'db_connection_label_mysql')); ?></option>
          </select>
        </div>

        <div class="col-sm-6">
          <label class="form-label">
            <?php echo e(trans($entry_key . 'db_host_label')); ?>

          </label>
          <input class="form-control <?php echo e($errors->has('database_hostname') ? 'is-invalid' : ''); ?>" name="database_hostname"
            value="<?php echo e(old('database_hostname', '127.0.0.1')); ?>" required
            placeholder="<?php echo e(trans($entry_key . 'db_host_placeholder')); ?>">
          <span class="invalid-feedback"
            role="alert"><?php echo e($errors->has('database_hostname') ? $errors->first('database_hostname') : __('common.error_required', ['name' => trans($entry_key . 'db_host_label')])); ?></span>
        </div>

        <div class="col-sm-6">
          <label class="form-label">
            <?php echo e(trans($entry_key . 'db_port_label')); ?>

          </label>
          <input class="form-control <?php echo e($errors->has('database_port') ? 'is-invalid' : ''); ?>" name="database_port"
            value="<?php echo e(old('database_port', '3306')); ?>" required
            placeholder="<?php echo e(trans($entry_key . 'db_host_placeholder')); ?>">
          <span class="invalid-feedback"
            role="alert"><?php echo e($errors->has('database_port') ? $errors->first('database_port') : __('common.error_required', ['name' => trans($entry_key . 'db_port_label')])); ?></span>
        </div>

        <div class="col-sm-6">
          <label class="form-label">
            <?php echo e(trans($entry_key . 'db_name_label')); ?>

          </label>
          <input class="form-control <?php echo e($errors->has('database_name') ? 'is-invalid' : ''); ?>" name="database_name"
            value="<?php echo e(old('database_name', '')); ?>" required
            placeholder="<?php echo e(trans($entry_key . 'db_name_placeholder')); ?>">
          <span class="invalid-feedback"
            role="alert"><?php echo e($errors->has('database_name') ? $errors->first('database_name') : __('common.error_required', ['name' => trans($entry_key . 'db_name_label')])); ?></span>
        </div>

        <div class="col-sm-6">
          <label class="form-label">
            <?php echo e(trans($entry_key . 'db_username_label')); ?>

          </label>
          <input class="form-control <?php echo e($errors->has('database_username') ? 'is-invalid' : ''); ?>"
            name="database_username" value="<?php echo e(old('database_username', 'root')); ?>" required
            placeholder="<?php echo e(trans($entry_key . 'db_username_placeholder')); ?>">
          <span class="invalid-feedback"
            role="alert"><?php echo e($errors->has('database_username') ? $errors->first('database_username') : __('common.error_required', ['name' => trans($entry_key . 'db_username_label')])); ?></span>
        </div>

        <div class="col-sm-6">
          <label class="form-label">
            <?php echo e(trans($entry_key . 'db_password_label')); ?>

          </label>
          <input class="form-control <?php echo e($errors->has('database_password') ? 'is-invalid' : ''); ?>"
            name="database_password" value="<?php echo e(old('database_password', '')); ?>"
            placeholder="<?php echo e(trans($entry_key . 'db_password_placeholder')); ?>">
          <span class="invalid-feedback"
            role="alert"><?php echo e($errors->has('database_password') ? $errors->first('database_password') : __('common.error_required', ['name' => trans($entry_key . 'db_password_label')])); ?></span>
        </div>

      </div>

      <div class="row gx-4 gy-3 admin-data-wrap d-none">
        <div class="col-12">
          <h5><?php echo e(__('installer::installer_messages.environment.admin_info')); ?></h5>
          <hr class="mb-0">
        </div>
        <div class="col-sm-6">
          <label class="form-label">
            <?php echo e(trans($entry_key . 'admin_email')); ?>

          </label>
          <input class="form-control <?php echo e($errors->has('admin_email') ? 'is-invalid' : ''); ?>" name="admin_email"
            value="<?php echo e(old('admin_email', 'root@guangda.work')); ?>" type="email" required placeholder="<?php echo e(trans($entry_key . 'admin_email')); ?>">
          <span class="invalid-feedback"
            role="alert"><?php echo e($errors->has('admin_email') ? $errors->first('admin_email') : __('installer::installer_messages.environment.error_email')); ?></span>
        </div>

        <div class="col-sm-6">
          <label class="form-label">
            <?php echo e(trans($entry_key . 'admin_password')); ?>

          </label>
          <input class="form-control <?php echo e($errors->has('admin_password') ? 'is-invalid' : ''); ?>" name="admin_password"
            name="admin_password" value="<?php echo e(old('admin_password', '')); ?>" required
            placeholder="<?php echo e(trans($entry_key . 'admin_password')); ?>">
          <span class="invalid-feedback"
            role="alert"><?php echo e($errors->has('admin_password') ? $errors->first('admin_password') : __('common.error_required', ['name' => trans($entry_key . 'admin_password')])); ?></span>
        </div>

        <div class="col-sm-12 my-5">
          <div class="d-flex justify-content-end">
            <button class="btn btn-primary d-flex align-items-center" id="submit-button" type="submit">
              <span class="spinner-border spinner-border-sm d-none me-2" role="status" aria-hidden="true"></span>
              <?php echo e(trans('installer::installer_messages.environment.install')); ?>

              <i class="bi bi-arrow-right-short fs-2 lh-1 ms-2"></i>
            </button>
          </div>
        </div>
      </div>
    </form>
  </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
  <script type="text/javascript">
    $(function() {
      $('input[name="admin_password"]').val(randomString(16));

      $('.database-link-wrap input').on('keyup', function() {
        if (isDatabaseInputVal()) {
          debounce(getDatabaseStatus, 500)
        }
      })

      if ($('input[name="admin_email"]').hasClass('is-invalid')) {
        $('.admin-data-wrap').removeClass('d-none')
      }

      if ($('.content > .alert-danger').length) {
        getDatabaseStatus()
      }

      // $('#submit-button').click(function() {
      //   setTimeout(() => {
      //     $(this).prop('disabled', true).addClass('text-white').find('span').removeClass('d-none')
      //   }, 0);
      // })
    })

    // Example starter JavaScript for disabling form submissions if there are invalid fields
    $(function() {
      var forms = document.querySelectorAll(".needs-validation");

      // Loop over them and prevent submission
      Array.prototype.slice.call(forms).forEach(function(form) {
        form.addEventListener("submit", function(event) {
          if (!form.checkValidity()) {
            event.preventDefault();
            event.stopPropagation();
          } else {
            $("#submit-button").prop('disabled', true).addClass('text-white').find('span').removeClass('d-none')
          }

          form.classList.add("was-validated");
        }, false);
      });
    });

    function randomString(length) {
      let str = '';
      for (; str.length < length; str += Math.random().toString(36).substr(2));
      return str.substr(0, length);
    }

    function isDatabaseInputVal() {
      let isDate = true;
      $('.database-link-wrap input').each((index, el) => {
        if ($(el).val() == '' && $(el).prop('name') != 'database_password') {
          isDate = false;
        }
      })

      return isDate
    }

    let _debounceTimeout = null;

    function debounce(fn, delay = 500) {
      clearTimeout(_debounceTimeout);
      _debounceTimeout = setTimeout(() => {
        fn();
      }, delay);
    }

    function getDatabaseStatus() {
      const self = this;
      $('.database-link-wrap input').removeClass('is-invalid')

      $.ajax({
        url: 'environment/validate_db',
        type: 'POST',
        data: $('form :input[name!="admin_email"][name!="admin_password"]').serialize(),
        beforeSend: function () {
          $('.database-loading').removeClass('d-none')
          $('.title-status .text-success, .title-status .text-danger').addClass('d-none')
        },
        complete: function() {
          $('.database-loading').addClass('d-none');
        },
        success: function(json) {
          $('.database-link-wrap input').addClass('is-valid')
          $('.title-status .text-success').removeClass('d-none')
          $('.admin-data-wrap').removeClass('d-none')
        },
        error: function(json) {
          json = json.responseJSON;
          var data = Object.keys(json.data);

          data.forEach((e)=> {
            $('.database-link-wrap input[name="' + e + '"]').addClass('is-invalid').next('.invalid-feedback').text(json.data[e])
          })

          if (json.data.database_version) {
            $('.title-status .text-danger').removeClass('d-none').find('span').text(json.data.database_version);
          }

          if (json.data.database_other) {
            $('.title-status .text-danger').removeClass('d-none').find('span').text(json.data.database_other);
          }

          $('.admin-data-wrap').addClass('d-none')
        }
      });
    }
  </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('installer::layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/www.ankua.asia/beike/Installer/Providers/../Views/environment-wizard.blade.php ENDPATH**/ ?>