password.ejs 1.98 KB
<script type="text/javascript">
var type = '<%= type %>';
post_data = {
  "collection":'<%= collection %>'
}
function login() {
  if (document.getElementById("password").value == type) {
    redirectPost('/',post_data)
    }
  else {
    window.alert("비밀번호가 틀립니다!")
  }
}
function redirectPost(url, data) {
  var form = document.createElement('form');
  document.body.appendChild(form);
  form.method = 'post';
  form.action = url;
  for (var name in data) {
    var input = document.createElement('input');
    input.type = 'hidden';
    input.name = name;
    input.value = data[name];
    form.appendChild(input);
    }
    form.submit();
    }
</script>
<body>
  <div id="screen-lock" class="hide" style="opacity:0.95;">
    <div class="panel panel-warning" style="width:500px;margin: 168px 0px 0px -250px;left: 50%;position: absolute;">
      <!-- begin panel-heading -->
      <div class="panel-heading">
        <h4 class="panel-title">screenlock_message</h4>
      </div>
      <!-- end panel-heading -->
    
      <!-- begin panel-body -->
      <div class="panel-body">
        <!-- begin fieldset -->
        <fieldset>
          <!-- begin row -->
          <div class="row">
            <!-- begin col-8 -->
            <div class="col-md-10 offset-md-1">
              <!-- begin form-group -->
              <div class="form-group row m-b-10">
                <label class="col-md-5 col-form-label text-md-right">비밀번호</label>
                <div class="col-md-6">
                  <input type="password" name="password" id="password" class="form-control" />
                  <button id="LockPasswordCheckAction" class="btn btn-success" onclick="login()">unlock</button>
                </div>
              </div>
              <!-- end form-group -->
            </div>
            <!-- end col-8 -->
          </div>
          <!-- end row -->
        </fieldset>
        <!-- end fieldset -->
      </div>
      <!-- end panel-body -->
    </div>
    <!-- end panel -->
  </div>