AE86 1 anno fa
parent
commit
aace5f686f

+ 5 - 0
dbsyncer-biz/src/main/java/org/dbsyncer/biz/impl/DefaultLicenseServiceImpl.java

@@ -31,4 +31,9 @@ public final class DefaultLicenseServiceImpl implements LicenseService {
     public ProductInfo getProductInfo() {
         return null;
     }
+
+    @Override
+    public void updateLicense() {
+
+    }
 }

+ 5 - 0
dbsyncer-sdk/src/main/java/org/dbsyncer/sdk/spi/LicenseService.java

@@ -30,4 +30,9 @@ public interface LicenseService {
      * @return
      */
     ProductInfo getProductInfo();
+
+    /**
+     * 更新授权
+     */
+    void updateLicense();
 }

+ 1 - 0
dbsyncer-web/src/main/java/org/dbsyncer/web/controller/license/LicenseController.java

@@ -48,6 +48,7 @@ public class LicenseController {
                 File dest = new File(licenseService.getLicensePath() + filename);
                 FileUtils.deleteQuietly(dest);
                 FileUtils.copyInputStreamToFile(files[0].getInputStream(), dest);
+                licenseService.updateLicense();
                 logger.info("{}:{}", LogType.UserLog.UPLOAD_LICENSE_FILE.getMessage(), filename);
                 logService.log(LogType.UserLog.UPLOAD_LICENSE_FILE);
             }

+ 6 - 5
dbsyncer-web/src/main/resources/public/license/license.html

@@ -14,12 +14,11 @@
     <form th:if="${not #strings.isEmpty(key)}" class="form-horizontal" role="form">
         <div class="row text-center">
             <div class="page-header">
-                <h3>授权许可<img th:if="${productInfo?.products?.size() gt 0}" draggable="false" title="授权成功" th:src="@{'/img/check-circle.png'}"></h3>
+                <h3>授权许可<img th:if="${productInfo?.products?.size() gt 0}" draggable="false" title="授权成功" width="28px" height="28px" th:src="@{'/img/check-circle.png'}"></h3>
             </div>
         </div>
         <div class="form-group">
             <table class="table table-hover">
-                <caption>已授权([[${productInfo?.products?.size()} ?: 0]])</caption>
                 <thead>
                 <tr>
                     <th></th>
@@ -30,10 +29,12 @@
                 <tbody>
                 <tr th:id="${p?.name}" th:each="p,state : ${productInfo?.products}">
                     <td>[[${state.index+1}]]</td>
-                    <!-- 已过期 -->
-                    <td th:if="${#dates.createNow()?.time} > ${p?.effectiveTime}">[[${p?.name}]]<img draggable="false" width="30px" height="30px" title="已过期" th:src="@{'/img/warning.png'}"></td>
                     <!-- 有效期 -->
-                    <td th:if="${#dates.createNow()?.time} < ${p?.effectiveTime}">[[${p?.name}]]<img draggable="false" width="30px" height="30px" th:src="@{'/img/check.png'}"></td>
+                    <td th:if="${#dates.createNow()?.time} < ${p?.effectiveTime} and ${p?.effectiveTime} - 1296000000 > ${#dates.createNow()?.time}">[[${p?.name}]]&nbsp;<img draggable="false" width="20px" height="20px" th:src="@{'/img/check.png'}"></td>
+                    <!-- 即将过期 -->
+                    <td th:if="${#dates.createNow()?.time} < ${p?.effectiveTime} and ${p?.effectiveTime} - 1296000000 <= ${#dates.createNow()?.time}">[[${p?.name}]]&nbsp;<img draggable="false" width="20px" height="20px" title="即将过期, 请联系售前客服续期" th:src="@{'/img/remind.png'}"></td>
+                    <!-- 已过期 -->
+                    <td th:if="${#dates.createNow()?.time} > ${p?.effectiveTime}">[[${p?.name}]]&nbsp;<img draggable="false" width="20px" height="20px" title="已过期, 请联系售前客服续期" th:src="@{'/img/warning.png'}"></td>
                     <td th:text="${#dates.format(p?.effectiveTime, 'yyyy-MM-dd HH:mm:ss')}"/>
                 </tr>
                 </tbody>

BIN
dbsyncer-web/src/main/resources/static/img/remind.png