SyuanYu 2 tahun lalu
induk
melakukan
5b33a2461b

+ 1 - 1
backstage/static/js/sidebar.js

@@ -92,6 +92,6 @@ $("#updatePassword").on("input", (e) => {
 $("#updateBtn").on("click", () => {
   let classValue = $('#updateBtn').attr('class');
   if (!classValue.includes('disabled')) {
-    alert("更新成功");
+    alert("更新成功!請點擊確認並稍候…");
   }
 });

+ 69 - 58
backstage/templates/further.html

@@ -5,70 +5,81 @@
 <script src="https://cdn.jsdelivr.net/npm/@editorjs/image@latest"></script><!-- Image -->
 <script type="text/javascript" src="/static/js/yo.js"></script>
 <style>
-    .table__data {
-        padding: 5px;
-    }
+  .table__data {
+    padding: 5px;
+  }
 </style>
 <table>
-    <tbody id='contactData'>
-        <h1 class="h3"><i class="fas fa-pen mr-3 mb-3"></i>{{ title }}</h1>
-        <tr>
-            <td>文章名稱 <span class="text-danger">(請務必填寫文章名稱,否則此項文章不予載入)</span></td>
-            <td>文章連結</td>
-        </tr>
-        <tr>
-            <td class="table__data"><input class="form-control" id="data01" type="text" style="width: 600px;" placeholder="文章內容" /></td>
-            <td class="table__data"><input class="form-control" id="data00" type="text" style="width: 600px;" placeholder="文章連結" /></td>
-        </tr>
-        <tr>
-            <td class="table__data"><input class="form-control" id="data11" type="text" style="width: 600px;" placeholder="文章內容" /></td>
-            <td class="table__data"><input class="form-control" id="data10" type="text" style="width: 600px;" placeholder="文章連結" /></td>
-        </tr>
-        <tr>
-            <td class="table__data"><input class="form-control" id="data21" type="text" style="width: 600px;" placeholder="文章內容" /></td>
-            <td class="table__data"><input class="form-control" id="data20" type="text" style="width: 600px;" placeholder="文章連結" /></td>
-        </tr>
-        <tr>
-            <td class="table__data"><input class="form-control" id="data31" type="text" style="width: 600px;" placeholder="文章內容" /></td>
-            <td class="table__data"><input class="form-control" id="data30" type="text" style="width: 600px;" placeholder="文章連結" /></td>
-        </tr>
-        <tr>
-            <td class="table__data"><input class="form-control" id="data41" type="text" style="width: 600px;" placeholder="文章內容" /></td>
-            <td class="table__data"><input class="form-control" id="data40" type="text" style="width: 600px;" placeholder="文章連結" /></td>
-        </tr>
-        <tr>
-            <td>
-                <div class="d-flex justify-content-center mt-3" style="width: 200%;">
-                    <button class="btn btn_light mr-1" onclick="changeArticles();"><b>儲存</b> <i
-                            class="fas fa-pencil-alt"></i></button>
-                </div>
-            </td>
-        </tr>
+  <tbody id='contactData'>
+    <h1 class="h3"><i class="fas fa-pen mr-3 mb-3"></i>{{ title }}</h1>
+    <tr>
+      <td>文章名稱 <span class="text-danger">(請務必填寫文章名稱,否則此項文章不予載入)</span></td>
+      <td>文章連結</td>
+    </tr>
+    <tr>
+      <td class="table__data"><input class="form-control" id="data01" type="text" style="width: 600px;"
+          placeholder="文章內容" /></td>
+      <td class="table__data"><input class="form-control" id="data00" type="text" style="width: 600px;"
+          placeholder="文章連結" /></td>
+    </tr>
+    <tr>
+      <td class="table__data"><input class="form-control" id="data11" type="text" style="width: 600px;"
+          placeholder="文章內容" /></td>
+      <td class="table__data"><input class="form-control" id="data10" type="text" style="width: 600px;"
+          placeholder="文章連結" /></td>
+    </tr>
+    <tr>
+      <td class="table__data"><input class="form-control" id="data21" type="text" style="width: 600px;"
+          placeholder="文章內容" /></td>
+      <td class="table__data"><input class="form-control" id="data20" type="text" style="width: 600px;"
+          placeholder="文章連結" /></td>
+    </tr>
+    <tr>
+      <td class="table__data"><input class="form-control" id="data31" type="text" style="width: 600px;"
+          placeholder="文章內容" /></td>
+      <td class="table__data"><input class="form-control" id="data30" type="text" style="width: 600px;"
+          placeholder="文章連結" /></td>
+    </tr>
+    <tr>
+      <td class="table__data"><input class="form-control" id="data41" type="text" style="width: 600px;"
+          placeholder="文章內容" /></td>
+      <td class="table__data"><input class="form-control" id="data40" type="text" style="width: 600px;"
+          placeholder="文章連結" /></td>
+    </tr>
+    <tr>
+      <td>
+        <div class="d-flex justify-content-center mt-3" style="width: 200%;">
+          <button class="btn btn_light mr-1" onclick="changeArticles();"><b>儲存</b> <i
+              class="fas fa-pencil-alt"></i></button>
+        </div>
+      </td>
+    </tr>
 
-    </tbody>
+  </tbody>
 </table>
 <script>
-    $(function(){
-        axios.get('/backstage/edit_blog_getfurther').then(({ data }) => {
-            $('#data00').val(data.data[0][0]);
-            $('#data01').val(data.data[0][1]);
-            $('#data10').val(data.data[1][0]);
-            $('#data11').val(data.data[1][1]);
-            $('#data20').val(data.data[2][0]);
-            $('#data21').val(data.data[2][1]);
-            $('#data30').val(data.data[3][0]);
-            $('#data31').val(data.data[3][1]);
-            $('#data40').val(data.data[4][0]);
-            $('#data41').val(data.data[4][1]);
-        });
-        
+  $(function () {
+    axios.get('/backstage/edit_blog_getfurther').then(({ data }) => {
+      $('#data00').val(data.data[0][0]);
+      $('#data01').val(data.data[0][1]);
+      $('#data10').val(data.data[1][0]);
+      $('#data11').val(data.data[1][1]);
+      $('#data20').val(data.data[2][0]);
+      $('#data21').val(data.data[2][1]);
+      $('#data30').val(data.data[3][0]);
+      $('#data31').val(data.data[3][1]);
+      $('#data40').val(data.data[4][0]);
+      $('#data41').val(data.data[4][1]);
     });
+  });
 
-    function changeArticles() {
-        axios.get('/backstage/edit_blog_editfurther?data00='+$('#data00').val()+'&data01='+$('#data01').val()+'&data10='+$('#data10').val()+'&data11='+$('#data11').val()+'&data20='+$('#data20').val()+'&data21='+$('#data21').val()+'&data30='+$('#data30').val()+'&data31='+$('#data31').val()+'&data40='+$('#data40').val()+'&data41='+$('#data41').val()).then(({ data }) => {
-            alert('已儲存');
-        }).finally((data) => { location.reload(); });
-    };
+  function changeArticles() {
+    axios.get('/backstage/edit_blog_editfurther?data00=' + $('#data00').val() + '&data01=' + $('#data01').val() + '&data10=' + $('#data10').val() + '&data11=' + $('#data11').val() + '&data20=' + $('#data20').val() + '&data21=' + $('#data21').val() + '&data30=' + $('#data30').val() + '&data31=' + $('#data31').val() + '&data40=' + $('#data40').val() + '&data41=' + $('#data41').val())
+      .then(({ data }) => {
+        alert('已儲存');
+      })
+      .finally((data) => { location.reload(); });
+  };
 
 </script>
-{% endblock main %}
+{% endblock main %}

+ 1 - 1
backstage/templates/layout.html

@@ -16,7 +16,7 @@
   <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles/main.css') }}">
 
   <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js"></script>
-  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+  <script src="https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js"></script>
   <script src='https://code.jquery.com/jquery-3.2.1.slim.min.js'></script>
 
   <style>