@ -0,0 +1,240 @@
|
||||
package com.fr.design.dialog; |
||||
|
||||
|
||||
import com.fr.concurrent.NamedThreadFactory; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.notification.Notification; |
||||
import com.fr.design.notification.NotificationCenter; |
||||
import com.fr.module.ModuleContext; |
||||
import com.fr.stable.StringUtils; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Color; |
||||
import java.awt.Dimension; |
||||
import java.awt.Frame; |
||||
import java.awt.event.MouseAdapter; |
||||
import java.awt.event.MouseEvent; |
||||
import java.awt.event.MouseListener; |
||||
import java.util.concurrent.ScheduledExecutorService; |
||||
import java.util.concurrent.TimeUnit; |
||||
import javax.swing.BorderFactory; |
||||
import javax.swing.Icon; |
||||
import javax.swing.JDialog; |
||||
import javax.swing.JPanel; |
||||
import javax.swing.JScrollPane; |
||||
import javax.swing.ScrollPaneConstants; |
||||
import javax.swing.UIManager; |
||||
|
||||
/** |
||||
* 带查看详情的简要通知框 |
||||
*/ |
||||
public class NotificationDialog extends JDialog { |
||||
public static final int ERROR_MESSAGE = 0; |
||||
public static final int NEW_MESSAGE = 1; |
||||
public static final int WARNING_MESSAGE = 2; |
||||
public static final String HTML_TAG_1 = "<html>"; |
||||
public static final String HTML_TAG_2 = "</html>"; |
||||
private static final String HIDE_MSG = "HIDE_MSG_TIMER"; |
||||
private UILabel messageText; |
||||
private NotificationDialogAction notificationDialogAction; |
||||
private ScheduledExecutorService TIMER; |
||||
|
||||
public NotificationDialog(Frame owner, String title, boolean isModal, int messageType, String message, NotificationDialogAction action) { |
||||
super(owner); |
||||
setTitle(title); |
||||
initComponents(StringUtils.EMPTY, messageType, message, isModal, action); |
||||
} |
||||
|
||||
public NotificationDialog(Builder builder) { |
||||
super(builder.owner); |
||||
setTitle(builder.title); |
||||
initComponents(builder.messageId, builder.messageType, builder.message, builder.modal, builder.action); |
||||
} |
||||
|
||||
public void initComponents(String messageId, int messageType, String message, boolean isModal, NotificationDialogAction action) { |
||||
NotificationCenter.getInstance().addNotification(new Notification(messageId, messageType, message, action)); |
||||
notificationDialogAction = action; |
||||
setModal(isModal); |
||||
setFocusable(false); |
||||
setAutoRequestFocus(false); |
||||
setResizable(false); |
||||
JPanel body = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
body.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
||||
|
||||
//消息内容
|
||||
UILabel icon = new UILabel(getIconForType(messageType)); |
||||
JPanel iconPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
iconPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 10, 8)); |
||||
iconPanel.add(icon); |
||||
body.add(iconPanel, BorderLayout.WEST); |
||||
|
||||
messageText = new UILabel(HTML_TAG_1 + message + HTML_TAG_2); |
||||
messageText.setForeground(new Color(51, 51, 52)); |
||||
JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
centerPanel.setBorder(BorderFactory.createEmptyBorder(8, 0, 5, 20)); |
||||
JScrollPane jScrollPane = new JScrollPane(messageText, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
||||
jScrollPane.setBorder(BorderFactory.createEmptyBorder()); |
||||
centerPanel.add(jScrollPane, BorderLayout.CENTER); |
||||
centerPanel.setPreferredSize(new Dimension(230, 95)); |
||||
body.add(centerPanel, BorderLayout.CENTER); |
||||
|
||||
//查看详情
|
||||
UILabel detailLabel = new UILabel(); |
||||
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); |
||||
detailLabel.setForeground(Color.BLUE); |
||||
JPanel detailPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||
detailPanel.add(detailLabel, BorderLayout.EAST); |
||||
body.add(detailPanel, BorderLayout.SOUTH); |
||||
|
||||
detailLabel.addMouseListener(detailClickListener); |
||||
messageText.addMouseListener(detailClickListener); |
||||
addMouseListener(bodyMouseListener); |
||||
|
||||
add(body); |
||||
Dimension dimension = body.getPreferredSize(); |
||||
setSize(dimension.width, dimension.height); |
||||
setLocation((DesignerContext.getDesignerFrame().getWidth() - dimension.width - 30 + DesignerContext.getDesignerFrame().getX()), |
||||
DesignerContext.getDesignerFrame().getY() + DesignerContext.getDesignerFrame().getHeight() - dimension.height - 30); |
||||
disappear(); |
||||
} |
||||
|
||||
private MouseListener detailClickListener = new MouseAdapter() { |
||||
@Override |
||||
public void mouseClicked(MouseEvent e) { |
||||
if (notificationDialogAction != null) { |
||||
hideDialog(); |
||||
notificationDialogAction.doClick(); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
private MouseListener bodyMouseListener = new MouseAdapter() { |
||||
@Override |
||||
public void mouseEntered(MouseEvent e) { |
||||
if (TIMER != null) { |
||||
TIMER.shutdownNow(); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void mouseExited(MouseEvent e) { |
||||
disappear(); |
||||
} |
||||
}; |
||||
|
||||
public void disappear() { |
||||
TIMER = createScheduleExecutorService(); |
||||
TIMER.schedule(new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
hideDialog(); |
||||
} |
||||
}, 10000, TimeUnit.MILLISECONDS); |
||||
} |
||||
|
||||
private ScheduledExecutorService createScheduleExecutorService() { |
||||
return ModuleContext.getExecutor().newSingleThreadScheduledExecutor(new NamedThreadFactory(HIDE_MSG)); |
||||
} |
||||
|
||||
/** |
||||
* 设置通知消息 |
||||
*/ |
||||
public void setMessage(String message) { |
||||
messageText.setText(HTML_TAG_1 + message + HTML_TAG_2); |
||||
} |
||||
|
||||
private void hideDialog() { |
||||
this.setVisible(false); |
||||
this.dispose(); |
||||
} |
||||
|
||||
protected Icon getIconForType(int messageType) { |
||||
String propertyName; |
||||
switch (messageType) { |
||||
case 0: |
||||
propertyName = "OptionPane.circularErrorIcon"; |
||||
break; |
||||
case 1: |
||||
propertyName = "OptionPane.newMessageIcon"; |
||||
break; |
||||
case 2: |
||||
propertyName = "OptionPane.circularWarningIcon"; |
||||
break; |
||||
default: |
||||
return null; |
||||
} |
||||
return UIManager.getIcon(propertyName); |
||||
} |
||||
|
||||
public static Builder Builder() { |
||||
return new NotificationDialog.Builder(); |
||||
} |
||||
|
||||
public static final class Builder { |
||||
public int messageType = WARNING_MESSAGE; |
||||
public String messageId; |
||||
public String message; |
||||
public boolean modal = true; |
||||
public Frame owner = null; |
||||
public String title; |
||||
public NotificationDialogAction action; |
||||
|
||||
private Builder() { |
||||
|
||||
} |
||||
|
||||
public NotificationDialog build() { |
||||
return new NotificationDialog(this); |
||||
} |
||||
|
||||
public Builder messageId(String messageId) { |
||||
this.messageId = messageId; |
||||
return this; |
||||
} |
||||
|
||||
public Builder owner(Frame owner) { |
||||
this.owner = owner; |
||||
return this; |
||||
} |
||||
|
||||
public Builder messageType(int messageType) { |
||||
this.messageType = messageType; |
||||
return this; |
||||
} |
||||
|
||||
public Builder message(String message) { |
||||
this.message = message; |
||||
return this; |
||||
} |
||||
|
||||
public Builder modal(boolean modal) { |
||||
this.modal = modal; |
||||
return this; |
||||
} |
||||
|
||||
public Builder title(String title) { |
||||
this.title = title; |
||||
return this; |
||||
} |
||||
|
||||
public Builder notificationDialogAction(NotificationDialogAction action) { |
||||
this.action = action; |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public static void defaultPopup(String messageId, String title, String body, NotificationDialogAction action) { |
||||
NotificationDialog.Builder() |
||||
.messageId(messageId) |
||||
.owner(DesignerContext.getDesignerFrame()) |
||||
.title(title) |
||||
.modal(false) |
||||
.messageType(NotificationDialog.NEW_MESSAGE) |
||||
.message(body) |
||||
.notificationDialogAction(action) |
||||
.build() |
||||
.setVisible(true); |
||||
} |
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.fr.design.dialog; |
||||
|
||||
public interface NotificationDialogAction { |
||||
|
||||
String name(); |
||||
|
||||
void doClick(); |
||||
} |
@ -0,0 +1,5 @@
|
||||
package com.fr.design.file; |
||||
|
||||
public interface Releasable { |
||||
void releaseResources(); |
||||
} |
@ -0,0 +1,112 @@
|
||||
package com.fr.design.login.message; |
||||
|
||||
import com.fr.concurrent.NamedThreadFactory; |
||||
import com.fr.design.DesignerEnvManager; |
||||
import com.fr.design.dialog.NotificationDialog; |
||||
import com.fr.design.dialog.NotificationDialogAction; |
||||
import com.fr.design.event.DesignerOpenedListener; |
||||
import com.fr.design.login.utils.DesignerLoginUtils; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.utils.BrowseUtils; |
||||
import com.fr.general.CloudCenter; |
||||
import com.fr.general.http.HttpToolbox; |
||||
import com.fr.json.JSON; |
||||
import com.fr.json.JSONFactory; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.stable.StringUtils; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
import java.util.concurrent.Executors; |
||||
import java.util.concurrent.ScheduledExecutorService; |
||||
import java.util.concurrent.TimeUnit; |
||||
|
||||
/** |
||||
* @author Lanlan |
||||
* @version 10.0 |
||||
* Created by Lanlan on 2021/6/11 |
||||
*/ |
||||
public class DesignerMessageHelper { |
||||
|
||||
private static final long DELAY = 7L; |
||||
private static final String STATUS = "status"; |
||||
private static final String DATA = "data"; |
||||
private static final String SUCCESS = "success"; |
||||
private static final String MESSAGE_ID = "messageId"; |
||||
private static final String TITLE = "title"; |
||||
private static final String BODY = "body"; |
||||
private static final String JUMP_TYPE = "jumpType"; |
||||
private static final String JUMP_TO = "jumpTo"; |
||||
|
||||
private static DesignerMessageHelper instance; |
||||
|
||||
private DesignerMessageHelper() { |
||||
} |
||||
|
||||
public static DesignerMessageHelper getInstance() { |
||||
if (instance == null) { |
||||
instance = new DesignerMessageHelper(); |
||||
} |
||||
return instance; |
||||
} |
||||
|
||||
public void prepareShowMessage() { |
||||
DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { |
||||
@Override |
||||
public void designerOpened() { |
||||
ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("DesignerMessageHelper")); |
||||
service.schedule(new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
try { |
||||
pullLatestMessage(); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
}, DELAY, TimeUnit.MINUTES); |
||||
service.shutdown(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
private void pullLatestMessage() throws Exception { |
||||
String url = CloudCenter.getInstance().acquireUrlByKind("designer.message.push", "https://market.fanruan.com/api/v1/message/designer"); |
||||
Map<String, String> params = new HashMap<>(); |
||||
params.put("designerId", DesignerEnvManager.getEnvManager().getUUID()); |
||||
String result = HttpToolbox.post(url, params); |
||||
JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); |
||||
String status = response.optString(STATUS); |
||||
if (SUCCESS.equals(status)) { |
||||
parseLatestMessage(response.optJSONObject(DATA)); |
||||
} |
||||
} |
||||
|
||||
private void parseLatestMessage(JSONObject data) { |
||||
String messageId = data.optString(MESSAGE_ID); |
||||
String title = data.optString(TITLE); |
||||
String body = data.optString(BODY); |
||||
int jumpType = data.optInt(JUMP_TYPE); |
||||
String jumpTo = data.optString(JUMP_TO); |
||||
if (StringUtils.isNotEmpty(messageId) && StringUtils.isNotEmpty(title) && StringUtils.isNotEmpty(body) && jumpType > 0 && StringUtils.isNotEmpty(jumpTo)) { |
||||
NotificationJumpType notificationJumpType = NotificationJumpType.valueOf(jumpType); |
||||
if (notificationJumpType == NotificationJumpType.WEB_URL) { |
||||
NotificationDialog.defaultPopup(messageId, title, body, new NotificationDialogAction() { |
||||
@Override |
||||
public String name() { |
||||
return jumpTo; |
||||
} |
||||
|
||||
@Override |
||||
public void doClick() { |
||||
String ssoUrl = DesignerLoginUtils.generateDesignerSSOUrl(jumpTo); |
||||
BrowseUtils.browser(ssoUrl); |
||||
} |
||||
}); |
||||
} else if (notificationJumpType == NotificationJumpType.DESIGNER_MODULE) { |
||||
NotificationActionType notificationActionType = NotificationActionType.valueOf(jumpTo); |
||||
NotificationDialog.defaultPopup(messageId, title, body, notificationActionType.getAction()); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,92 @@
|
||||
package com.fr.design.login.message; |
||||
|
||||
import com.fr.config.ServerPreferenceConfig; |
||||
import com.fr.design.dialog.NotificationDialogAction; |
||||
import com.fr.design.extra.WebViewDlgHelper; |
||||
import com.fr.design.mainframe.BaseJForm; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.mainframe.EastRegionContainerPane; |
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.design.os.impl.SupportOSImpl; |
||||
import com.fr.design.upm.UpmFinder; |
||||
import com.fr.design.utils.DesignUtils; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.stable.StringUtils; |
||||
import com.fr.stable.bridge.StableFactory; |
||||
import com.fr.stable.os.Arch; |
||||
import com.fr.stable.os.OperatingSystem; |
||||
|
||||
/** |
||||
* @author Lanlan |
||||
* @version 10.0 |
||||
* Created by Lanlan on 2021/6/11 |
||||
*/ |
||||
public enum NotificationActionType { |
||||
PLUGIN("PLUGIN", new NotificationDialogAction() { |
||||
@Override |
||||
public String name() { |
||||
return "PLUGIN"; |
||||
} |
||||
|
||||
@Override |
||||
public void doClick() { |
||||
try { |
||||
if (Arch.getArch() == Arch.ARM || OperatingSystem.isLinux() || SupportOSImpl.MACOS_WEB_PLUGIN_MANAGEMENT.support()) { |
||||
DesignUtils.visitEnvServerByParameters("#management/plugin", null, null); |
||||
return; |
||||
} |
||||
if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() || SupportOSImpl.MACOS_NEW_PLUGIN_MANAGEMENT.support()) { |
||||
UpmFinder.showUPMDialog(); |
||||
} else { |
||||
WebViewDlgHelper.createPluginDialog(); |
||||
} |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
}), |
||||
REUSE("REUSE", new NotificationDialogAction() { |
||||
@Override |
||||
public String name() { |
||||
return "REUSE"; |
||||
} |
||||
|
||||
@Override |
||||
public void doClick() { |
||||
try { |
||||
BaseJForm jform = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, BaseJForm.class); |
||||
DesignerContext.getDesignerFrame().addAndActivateJTemplate((JTemplate<?, ?>) jform); |
||||
EastRegionContainerPane.getInstance().showContainer(); |
||||
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); |
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
}), |
||||
UNKNOWN(StringUtils.EMPTY, new NotificationDialogAction() { |
||||
@Override |
||||
public String name() { |
||||
return "UNKNOWN"; |
||||
} |
||||
|
||||
@Override |
||||
public void doClick() { |
||||
} |
||||
}); |
||||
|
||||
private String jumpTo; |
||||
private NotificationDialogAction action; |
||||
|
||||
NotificationActionType(String jumpTo, NotificationDialogAction action) { |
||||
this.jumpTo = jumpTo; |
||||
this.action = action; |
||||
} |
||||
|
||||
public String getJumpTo() { |
||||
return jumpTo; |
||||
} |
||||
|
||||
public NotificationDialogAction getAction() { |
||||
return action; |
||||
} |
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.fr.design.login.message; |
||||
|
||||
/** |
||||
* @author Lanlan |
||||
* @version 10.0 |
||||
* Created by Lanlan on 2021/6/11 |
||||
*/ |
||||
public enum NotificationJumpType { |
||||
WEB_URL(1), |
||||
DESIGNER_MODULE(2), |
||||
UNKNOWN(-1); |
||||
|
||||
private int jumpType; |
||||
|
||||
NotificationJumpType(int jumpType) { |
||||
this.jumpType = jumpType; |
||||
} |
||||
|
||||
public int getJumpType() { |
||||
return jumpType; |
||||
} |
||||
|
||||
public static NotificationJumpType valueOf(int jumpType) { |
||||
for(NotificationJumpType value : NotificationJumpType.values()) { |
||||
if(value.getJumpType() == jumpType) { |
||||
return value; |
||||
} |
||||
} |
||||
return UNKNOWN; |
||||
} |
||||
} |
@ -0,0 +1,53 @@
|
||||
package com.fr.design.notification; |
||||
|
||||
import com.fr.design.dialog.NotificationDialogAction; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
public class Notification { |
||||
private String messageId; |
||||
private int type; |
||||
private String message; |
||||
private NotificationDialogAction notificationDialogAction; |
||||
public static final int ERROR_MESSAGE = 0; |
||||
public static final int NEW_MESSAGE = 1; |
||||
public static final int WARNING_MESSAGE = 2; |
||||
|
||||
public Notification(String messageId, int type, String message, NotificationDialogAction notificationDialogAction) { |
||||
this.messageId = messageId; |
||||
this.type = type; |
||||
this.message = message; |
||||
this.notificationDialogAction = notificationDialogAction; |
||||
} |
||||
|
||||
public Notification(String message) { |
||||
this.type = WARNING_MESSAGE; |
||||
this.message = message; |
||||
this.notificationDialogAction = new NotificationDialogAction() { |
||||
@Override |
||||
public String name() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
@Override |
||||
public void doClick() { |
||||
//do nothing
|
||||
} |
||||
}; |
||||
} |
||||
|
||||
public NotificationDialogAction getNotificationDialogAction() { |
||||
return notificationDialogAction; |
||||
} |
||||
|
||||
public int getType() { |
||||
return type; |
||||
} |
||||
|
||||
public String getMessage() { |
||||
return message; |
||||
} |
||||
|
||||
public String getMessageId() { |
||||
return messageId; |
||||
} |
||||
} |
@ -0,0 +1,42 @@
|
||||
package com.fr.design.notification; |
||||
|
||||
|
||||
import com.fr.design.notification.ui.NotificationCenterPane; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
public class NotificationCenter { |
||||
private static NotificationCenter notificationCenter = new NotificationCenter(); |
||||
private List<Notification> notifications; |
||||
private NotificationCenter(){ |
||||
notifications = new ArrayList<>(); |
||||
} |
||||
|
||||
public static NotificationCenter getInstance(){ |
||||
return notificationCenter; |
||||
} |
||||
|
||||
public void addNotification(Notification message){ |
||||
notifications.add(message); |
||||
NotificationCenterPane.getNotificationCenterPane().refreshButton(); |
||||
} |
||||
|
||||
public int getNotificationsCount(){ |
||||
return notifications.size(); |
||||
} |
||||
|
||||
public void removeNotification(int index){ |
||||
notifications.remove(index); |
||||
NotificationCenterPane.getNotificationCenterPane().refreshButton(); |
||||
} |
||||
|
||||
public Notification getNotification(int index){ |
||||
return notifications.get(index); |
||||
} |
||||
|
||||
public void clearAllNotifications(){ |
||||
notifications.clear(); |
||||
NotificationCenterPane.getNotificationCenterPane().refreshButton(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,133 @@
|
||||
package com.fr.design.notification.ui; |
||||
|
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.notification.Notification; |
||||
import com.fr.design.notification.NotificationCenter; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Color; |
||||
import java.awt.Dimension; |
||||
import java.awt.Frame; |
||||
import java.awt.Toolkit; |
||||
import java.awt.Window; |
||||
import java.awt.event.MouseAdapter; |
||||
import java.awt.event.MouseEvent; |
||||
import java.awt.event.WindowAdapter; |
||||
import java.awt.event.WindowEvent; |
||||
import java.util.ArrayList; |
||||
import javax.swing.JDialog; |
||||
import javax.swing.JPanel; |
||||
|
||||
public class NotificationCenterDialog extends JDialog { |
||||
|
||||
private ArrayList<NotificationPane> notificationNeedShow; |
||||
private JPanel centerPanel; |
||||
private UILabel deleteLabel; |
||||
private static final int NOTIFICATIONCOUNT = 5; |
||||
|
||||
private static NotificationCenterDialog instance; |
||||
|
||||
private NotificationCenterDialog(Frame parent) { |
||||
super(parent); |
||||
setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Notification")); |
||||
setResizable(false); |
||||
notificationNeedShow = new ArrayList<>(); |
||||
addWindowFocusListener(new WindowAdapter() { |
||||
@Override |
||||
public void windowLostFocus(WindowEvent e) { |
||||
hideDialog(); |
||||
} |
||||
}); |
||||
initComponents(); |
||||
} |
||||
|
||||
public static NotificationCenterDialog getInstance() { |
||||
if (instance == null) { |
||||
instance = new NotificationCenterDialog(DesignerContext.getDesignerFrame()); |
||||
} |
||||
return instance; |
||||
} |
||||
|
||||
private void initComponents() { |
||||
centerPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); |
||||
addNotification(); |
||||
deleteLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")"); |
||||
deleteLabel.setForeground(Color.BLUE); |
||||
|
||||
deleteLabel.addMouseListener(new MouseAdapter() { |
||||
@Override |
||||
public void mouseClicked(MouseEvent e) { |
||||
NotificationCenter.getInstance().clearAllNotifications(); |
||||
centerPanel.removeAll(); |
||||
addNotification(); |
||||
pack(); |
||||
deleteLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")"); |
||||
if (notificationNeedShow.size() == 0) { |
||||
hideDialog(); |
||||
} |
||||
} |
||||
}); |
||||
JPanel deletePane = new JPanel(FRGUIPaneFactory.createCenterFlowLayout()); |
||||
deletePane.add(deleteLabel); |
||||
deletePane.setPreferredSize(new Dimension(240, 30)); |
||||
add(centerPanel, BorderLayout.CENTER); |
||||
add(deletePane, BorderLayout.SOUTH); |
||||
pack(); |
||||
centerWindow(); |
||||
} |
||||
|
||||
public ArrayList<NotificationPane> getNotificationNeedShow() { |
||||
return notificationNeedShow; |
||||
} |
||||
|
||||
public JPanel getCenterPanel() { |
||||
return centerPanel; |
||||
} |
||||
|
||||
public UILabel getDeleteLabel() { |
||||
return deleteLabel; |
||||
} |
||||
|
||||
public void showDialog() { |
||||
this.setVisible(true); |
||||
} |
||||
|
||||
public void hideDialog() { |
||||
this.dispose(); |
||||
} |
||||
|
||||
public void addNotification() { |
||||
notificationNeedShow.clear(); |
||||
|
||||
int size = NotificationCenter.getInstance().getNotificationsCount(); |
||||
for (int i = NOTIFICATIONCOUNT; i > 0; i--) { |
||||
int j = size - i; |
||||
if (j >= 0) { |
||||
Notification notification = NotificationCenter.getInstance().getNotification(j); |
||||
NotificationPane notificationPane = new NotificationPane(this, notification.getMessageId(), notification.getType(), notification.getMessage(), i, notification.getNotificationDialogAction()); |
||||
notificationNeedShow.add(notificationPane); |
||||
} |
||||
} |
||||
size = notificationNeedShow.size(); |
||||
for (int i = size - 1; i >= 0; i--) { |
||||
centerPanel.add(notificationNeedShow.get(i)); |
||||
} |
||||
} |
||||
|
||||
private void centerWindow() { |
||||
Window win = this; |
||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); |
||||
|
||||
Dimension winSize = win.getSize(); |
||||
|
||||
if (winSize.height > screenSize.height) { |
||||
winSize.height = screenSize.height; |
||||
} |
||||
if (winSize.width > screenSize.width) { |
||||
winSize.width = screenSize.width; |
||||
} |
||||
//这里设置位置:水平居中,竖直偏上
|
||||
win.setLocation(screenSize.width - winSize.width - 90, 50); |
||||
} |
||||
} |
@ -0,0 +1,52 @@
|
||||
package com.fr.design.notification.ui; |
||||
|
||||
import com.fr.design.constants.UIConstants; |
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.gui.ibutton.UIButton; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.notification.NotificationCenter; |
||||
import com.fr.general.IOUtils; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Dimension; |
||||
import java.awt.event.MouseAdapter; |
||||
import java.awt.event.MouseEvent; |
||||
|
||||
public class NotificationCenterPane extends BasicPane { |
||||
private static NotificationCenterPane notificationCenterPane = new NotificationCenterPane(); |
||||
private static UIButton notificationCenterButton; |
||||
|
||||
private NotificationCenterPane() { |
||||
setPreferredSize(new Dimension(24, 24)); |
||||
setLayout(new BorderLayout()); |
||||
notificationCenterButton = new UIButton(); |
||||
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/notification/ui/notificationCenter.png")); |
||||
notificationCenterButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Show_Notification")); |
||||
notificationCenterButton.set4ToolbarButton(); |
||||
notificationCenterButton.setRolloverEnabled(false); |
||||
this.add(notificationCenterButton); |
||||
notificationCenterButton.addMouseListener(new MouseAdapter() { |
||||
@Override |
||||
public void mouseClicked(MouseEvent e) { |
||||
NotificationCenterDialog.getInstance().showDialog(); |
||||
} |
||||
}); |
||||
this.setBackground(UIConstants.TEMPLATE_TAB_PANE_BACKGROUND); |
||||
} |
||||
|
||||
public static NotificationCenterPane getNotificationCenterPane() { |
||||
return notificationCenterPane; |
||||
} |
||||
|
||||
public void refreshButton() { |
||||
if (NotificationCenter.getInstance().getNotificationsCount() > 0) { |
||||
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/notification/ui/notificationCenterDot.png")); |
||||
} else { |
||||
notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/notification/ui/notificationCenter.png")); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "NotificationCenter"; |
||||
} |
||||
} |
@ -0,0 +1,148 @@
|
||||
package com.fr.design.notification.ui; |
||||
|
||||
import com.fr.design.dialog.NotificationDialogAction; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.notification.NotificationCenter; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Color; |
||||
import java.awt.Cursor; |
||||
import java.awt.event.MouseAdapter; |
||||
import java.awt.event.MouseEvent; |
||||
import java.awt.event.MouseListener; |
||||
import javax.swing.BorderFactory; |
||||
import javax.swing.Icon; |
||||
import javax.swing.JPanel; |
||||
import javax.swing.UIManager; |
||||
|
||||
/** |
||||
* @author Lanlan |
||||
* @version 10.0 |
||||
* Created by Lanlan on 2021/6/21 |
||||
*/ |
||||
public class NotificationPane extends JPanel { |
||||
private NotificationCenterDialog parent; |
||||
private String messageId; |
||||
private int index; |
||||
private UILabel messageLabel; |
||||
private UILabel messageIcon; |
||||
private NotificationDialogAction notificationDialogAction; |
||||
|
||||
public NotificationPane(NotificationCenterDialog parent, String messageId, int type, String message, int index, NotificationDialogAction notificationDialogAction) { |
||||
this.parent = parent; |
||||
this.index = index; |
||||
this.messageId = messageId; |
||||
this.notificationDialogAction = notificationDialogAction; |
||||
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||
setTypeIcon(getIconForType(type)); |
||||
setNotification(message); |
||||
setDeleteIcon(); |
||||
} |
||||
|
||||
public void setTypeIcon(Icon icon) { |
||||
messageIcon = new UILabel(icon); |
||||
messageIcon.addMouseListener(messageAndIconListener); |
||||
JPanel messageIconPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
messageIconPanel.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); |
||||
messageIconPanel.add(messageIcon); |
||||
add(messageIconPanel, BorderLayout.WEST); |
||||
} |
||||
|
||||
public void setDeleteIcon() { |
||||
UILabel deleteIcon = new UILabel(UIManager.getIcon("OptionPane.deleteIcon")); |
||||
JPanel deleteIconPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
deleteIconPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 7)); |
||||
deleteIconPane.add(deleteIcon); |
||||
deleteIconPane.addMouseListener(new MouseAdapter() { |
||||
@Override |
||||
public void mouseClicked(MouseEvent e) { |
||||
NotificationCenter.getInstance().removeNotification(NotificationCenter.getInstance().getNotificationsCount() - index); |
||||
parent.getCenterPanel().removeAll(); |
||||
parent.addNotification(); |
||||
parent.getDeleteLabel().setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")"); |
||||
parent.pack(); |
||||
if (parent.getNotificationNeedShow().size() == 0) { |
||||
parent.hideDialog(); |
||||
} |
||||
NotificationCenterPane.getNotificationCenterPane().refreshButton(); |
||||
} |
||||
|
||||
@Override |
||||
public void mouseEntered(MouseEvent e) { |
||||
deleteIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void mouseExited(MouseEvent e) { |
||||
deleteIcon.setCursor(Cursor.getDefaultCursor()); |
||||
} |
||||
}); |
||||
add(deleteIconPane, BorderLayout.EAST); |
||||
} |
||||
|
||||
public int getIndex() { |
||||
return index; |
||||
} |
||||
|
||||
public String getMessageId() { |
||||
return messageId; |
||||
} |
||||
|
||||
public NotificationDialogAction getNotificationDialogAction() { |
||||
return notificationDialogAction; |
||||
} |
||||
|
||||
public void setNotification(String message) { |
||||
messageLabel = new UILabel("<html>" + message + "</html>"); |
||||
messageLabel.addMouseListener(messageAndIconListener); |
||||
JPanel labelPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
labelPanel.add(messageLabel); |
||||
this.add(labelPanel, BorderLayout.CENTER); |
||||
} |
||||
|
||||
protected Icon getIconForType(int messageType) { |
||||
String propertyName; |
||||
switch (messageType) { |
||||
case 0: |
||||
propertyName = "OptionPane.circularErrorIcon"; |
||||
break; |
||||
case 1: |
||||
propertyName = "OptionPane.newMessageIcon"; |
||||
break; |
||||
case 2: |
||||
propertyName = "OptionPane.circularWarningIcon"; |
||||
break; |
||||
default: |
||||
return null; |
||||
} |
||||
return UIManager.getIcon(propertyName); |
||||
} |
||||
|
||||
private void performTargetAction() { |
||||
parent.hideDialog(); |
||||
notificationDialogAction.doClick(); |
||||
} |
||||
|
||||
private MouseListener messageAndIconListener = new MouseAdapter() { |
||||
@Override |
||||
public void mouseClicked(MouseEvent e) { |
||||
performTargetAction(); |
||||
} |
||||
|
||||
@Override |
||||
public void mouseEntered(MouseEvent e) { |
||||
messageLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
||||
messageIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
||||
messageLabel.setForeground(new Color(250, 170, 57)); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void mouseExited(MouseEvent e) { |
||||
messageLabel.setCursor(Cursor.getDefaultCursor()); |
||||
messageIcon.setCursor(Cursor.getDefaultCursor()); |
||||
messageLabel.setForeground(Color.BLACK); |
||||
} |
||||
}; |
||||
} |
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 308 KiB |
After Width: | Height: | Size: 346 B |
After Width: | Height: | Size: 345 B |
After Width: | Height: | Size: 326 B |
After Width: | Height: | Size: 423 B |
Before Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 543 B |
@ -1,5 +1,59 @@
|
||||
var Store = { |
||||
i18n : { |
||||
'Designer-Login_User_Name': 'Username/Email/Phone number', |
||||
'Designer-Login_User_Name_Hint': 'Please enter username/email/phone number', |
||||
'Designer-Login_Password': 'Password', |
||||
'Designer-Login_Password_Hint': 'Please enter the password', |
||||
'Designer-Login': 'Login', |
||||
'Designer-Login_Title': 'FanRuan Passport Login', |
||||
'Designer-Login_I_Have_Read': 'I have read', |
||||
'Designer-Login_Service_Terms': 'Terms of Service', |
||||
'Designer-Login_Forget_Password': 'Forgot your password?', |
||||
'Designer-Login_Sms': 'SMS login', |
||||
'Designer-Login_Normal': 'Password login', |
||||
'Designer-Login_Phone': 'Phone number', |
||||
'Designer-Login_Phone_Hint': 'Please enter your phone number', |
||||
'Designer-Login_Code': 'Captcha', |
||||
'Designer-Login_Code_Hint': 'Please enter the captcha', |
||||
'Designer-Login_Code_Request': 'Get captcha', |
||||
'Designer-Login_Code_Request_Again': 'Re-acquire', |
||||
'Designer-Login_Register_Or_Login': 'Register/Login', |
||||
'Designer-Basic_Chinese_Mainland': 'Mainland China', |
||||
'Designer-Basic_Chinese_Hong_Kong': 'Hong Kong', |
||||
'Designer-Basic_Chinese_Macao': 'Macao', |
||||
'Designer-Basic_Chinese_Taiwan': 'Taiwan', |
||||
'Designer-Basic_Turkey': 'Turkey', |
||||
'Designer-Basic_South_Korea': 'South Korea', |
||||
'Designer-Basic_Japan': 'Japan', |
||||
'Designer-Basic_Singapore': 'Singapore', |
||||
'Designer-Basic_Malaysia': 'Malaysia', |
||||
'Designer-Login_Username_Not_Null': 'Username cannot be empty', |
||||
'Designer-Login_Password_Not_Null': 'Password cannot be empty', |
||||
'Designer-Login_Username_Or_Password_Incorrect': 'The username or password is incorrect, please check', |
||||
'Designer-Login_Phone_Not_Null': 'The phone number format is illegal', |
||||
'Designer-Login_Code_Not_Null': 'The captcha cannot be empty', |
||||
'Designer-Login_Code_Incorrect': 'The captcha has expired, please get it again', |
||||
'Designer-Login_Password_Setting_Hint': 'Enter the login password (6-16 digits password can be entered)', |
||||
'Designer-Login_Store_User_Not_Exist': 'The username does not exist', |
||||
'Designer-Login_Store_User_Password_Error': 'Username or password is incorrect', |
||||
'Designer-Login_Token_Request_Failed': 'Failed to get registration token', |
||||
'Designer-Login_Unexpected_Error': 'Unexpected error', |
||||
'Designer-Login_Internal_Error': 'Server internal error', |
||||
'Designer-Guide_Do_Not_Remind': 'No reminders within one month', |
||||
'Designer-Guide_Login': 'Login now', |
||||
'Designer-BBS_Register_Timeout': 'Register timeout, please resend the captcha', |
||||
'Designer-BBS_Phone_Is_Register': 'The phone number is already registered', |
||||
'Designer-BBS_Captcha_Send_Exceed_Limit': 'The captcha can only be sent once every 60s', |
||||
'Designer-BBS_Phone_Format_Error': 'Failed to send, the phone number format is incorrect', |
||||
'Designer-BBS_Captcha_Out_Of_Date': 'The captcha has expired, please get it again', |
||||
'Designer-BBS_Captcha_Try_Exceed_Limit': 'The number of attempts of the captcha has reached the upper limit, please get it again', |
||||
'Designer-BBS_Captcha_Error': 'Captcha error', |
||||
'Designer-BBS_Username_Format_Error': 'The nickname only supports Chinese, English and numbers', |
||||
'Designer-BBS_Username_Too_Short': 'The length of the nickname is too short', |
||||
'Designer-BBS_Username_Too_Long': 'The length of this nickname has reached the upper limit', |
||||
'Designer-BBS_Username_Is_Register': 'The user has been registered', |
||||
'Designer-BBS_Please_Enter_Correct_Phone': 'Please enter the correct phone number', |
||||
'Designer-Login_Network_Connected_Failed': 'Network connection failed', |
||||
|
||||
}} |
||||
window.Store = Store; |
@ -1,5 +1,59 @@
|
||||
var Store = { |
||||
i18n : { |
||||
'Designer-Login_User_Name': 'ユーザ名/メールアドレス/携帯番号', |
||||
'Designer-Login_User_Name_Hint': 'ユーザ名/メールアドレス/携帯番号を入力してください。', |
||||
'Designer-Login_Password': 'パスワード', |
||||
'Designer-Login_Password_Hint': 'パスワードを入力してください。', |
||||
'Designer-Login': 'ログイン', |
||||
'Designer-Login_Title': 'FanRuanアカウントでログイン', |
||||
'Designer-Login_I_Have_Read': '承認する', |
||||
'Designer-Login_Service_Terms': '利用規約', |
||||
'Designer-Login_Forget_Password': 'パスワードをお忘れですか', |
||||
'Designer-Login_Sms': '認証コードログイン', |
||||
'Designer-Login_Normal': 'パスワードでログイン', |
||||
'Designer-Login_Phone': '携帯番号', |
||||
'Designer-Login_Phone_Hint': '携帯番号を入力してください。', |
||||
'Designer-Login_Code': '認証コード', |
||||
'Designer-Login_Code_Hint': '認証コードを入力してください。', |
||||
'Designer-Login_Code_Request': '認証コードを取得', |
||||
'Designer-Login_Code_Request_Again': '再取得', |
||||
'Designer-Login_Register_Or_Login': '登録/ログイン', |
||||
'Designer-Basic_Chinese_Mainland': '中国大陸', |
||||
'Designer-Basic_Chinese_Hong_Kong': '中国香港', |
||||
'Designer-Basic_Chinese_Macao': '中国澳門', |
||||
'Designer-Basic_Chinese_Taiwan': '中国台湾', |
||||
'Designer-Basic_Turkey': 'トルコ共和国', |
||||
'Designer-Basic_South_Korea': '韓国', |
||||
'Designer-Basic_Japan': '日本', |
||||
'Designer-Basic_Singapore': 'シンガポール', |
||||
'Designer-Basic_Malaysia': 'マレーシア', |
||||
'Designer-Login_Username_Not_Null': 'ユーザ名は空白不可。', |
||||
'Designer-Login_Password_Not_Null': 'パスワードは空白不可。', |
||||
'Designer-Login_Username_Or_Password_Incorrect': 'ユーザ名又はパスワードが間違っています。ご確認ください。', |
||||
'Designer-Login_Phone_Not_Null': '携帯番号の形式が正しくない。', |
||||
'Designer-Login_Code_Not_Null': '認証コードは空白不可。', |
||||
'Designer-Login_Code_Incorrect': '認証コードが無効になりました。再取得してください。', |
||||
'Designer-Login_Password_Setting_Hint': 'パスワードを入力してください。(6‐16桁入力可能)', |
||||
'Designer-Login_Store_User_Not_Exist': 'ユーザ名は存在しません', |
||||
'Designer-Login_Store_User_Password_Error': 'ユーザ名又はパスワードが間違っています。', |
||||
'Designer-Login_Token_Request_Failed': '登録Token取得に失敗', |
||||
'Designer-Login_Unexpected_Error': '未知のエラー', |
||||
'Designer-Login_Internal_Error': 'サーバ内部エラー', |
||||
'Designer-Guide_Do_Not_Remind': '一か月内アラートしません。', |
||||
'Designer-Guide_Login': 'ログイン', |
||||
'Designer-BBS_Register_Timeout': '登録Timeout、検証コードをもう一度取得してください。', |
||||
'Designer-BBS_Phone_Is_Register': 'この携帯は既に登録されています。', |
||||
'Designer-BBS_Captcha_Send_Exceed_Limit': '認証コードは60s内に一回しか送信できません。', |
||||
'Designer-BBS_Phone_Format_Error': '携帯番号の形式が間違っています、検証コード送信失敗。', |
||||
'Designer-BBS_Captcha_Out_Of_Date': '認証コードが無効になりました。再取得してください。', |
||||
'Designer-BBS_Captcha_Try_Exceed_Limit': '認証コードの試行回数が上限に達しています。再取得してください。', |
||||
'Designer-BBS_Captcha_Error': '認証コードが間違っています。', |
||||
'Designer-BBS_Username_Format_Error': 'ユーザ名は漢字、アルバイトと数字しかサポートできません。', |
||||
'Designer-BBS_Username_Too_Short': 'ユーザ名が短すぎます。', |
||||
'Designer-BBS_Username_Too_Long': 'ユーザ名が長すぎます。', |
||||
'Designer-BBS_Username_Is_Register': 'このユーザは登録済みです。', |
||||
'Designer-BBS_Please_Enter_Correct_Phone': '正確な携帯番号を入力してください。', |
||||
'Designer-Login_Network_Connected_Failed': 'インターネット接続失敗', |
||||
|
||||
}} |
||||
window.Store = Store; |
@ -1,5 +1,59 @@
|
||||
var Store = { |
||||
i18n : { |
||||
'Designer-Login_User_Name': 'Username/Email/Phone number', |
||||
'Designer-Login_User_Name_Hint': 'Please enter username/email/phone number', |
||||
'Designer-Login_Password': 'Password', |
||||
'Designer-Login_Password_Hint': 'Please enter the password', |
||||
'Designer-Login': 'Login', |
||||
'Designer-Login_Title': 'FanRuan Passport Login', |
||||
'Designer-Login_I_Have_Read': 'I have read', |
||||
'Designer-Login_Service_Terms': 'Terms of Service', |
||||
'Designer-Login_Forget_Password': 'Forgot your password?', |
||||
'Designer-Login_Sms': 'SMS login', |
||||
'Designer-Login_Normal': 'Password login', |
||||
'Designer-Login_Phone': 'Phone number', |
||||
'Designer-Login_Phone_Hint': 'Please enter your phone number', |
||||
'Designer-Login_Code': 'Captcha', |
||||
'Designer-Login_Code_Hint': 'Please enter the captcha', |
||||
'Designer-Login_Code_Request': 'Get captcha', |
||||
'Designer-Login_Code_Request_Again': 'Re-acquire', |
||||
'Designer-Login_Register_Or_Login': 'Register/Login', |
||||
'Designer-Basic_Chinese_Mainland': 'Mainland China', |
||||
'Designer-Basic_Chinese_Hong_Kong': 'Hong Kong', |
||||
'Designer-Basic_Chinese_Macao': 'Macao', |
||||
'Designer-Basic_Chinese_Taiwan': 'Taiwan', |
||||
'Designer-Basic_Turkey': 'Turkey', |
||||
'Designer-Basic_South_Korea': 'South Korea', |
||||
'Designer-Basic_Japan': 'Japan', |
||||
'Designer-Basic_Singapore': 'Singapore', |
||||
'Designer-Basic_Malaysia': 'Malaysia', |
||||
'Designer-Login_Username_Not_Null': 'Username cannot be empty', |
||||
'Designer-Login_Password_Not_Null': 'Password cannot be empty', |
||||
'Designer-Login_Username_Or_Password_Incorrect': 'The username or password is incorrect, please check', |
||||
'Designer-Login_Phone_Not_Null': 'The phone number format is illegal', |
||||
'Designer-Login_Code_Not_Null': 'The captcha cannot be empty', |
||||
'Designer-Login_Code_Incorrect': 'The captcha has expired, please get it again', |
||||
'Designer-Login_Password_Setting_Hint': 'Enter the login password (6-16 digits password can be entered)', |
||||
'Designer-Login_Store_User_Not_Exist': 'The username does not exist', |
||||
'Designer-Login_Store_User_Password_Error': 'Username or password is incorrect', |
||||
'Designer-Login_Token_Request_Failed': 'Failed to get registration token', |
||||
'Designer-Login_Unexpected_Error': 'Unexpected error', |
||||
'Designer-Login_Internal_Error': 'Server internal error', |
||||
'Designer-Guide_Do_Not_Remind': 'No reminders within one month', |
||||
'Designer-Guide_Login': 'Login now', |
||||
'Designer-BBS_Register_Timeout': 'Register timeout, please resend the captcha', |
||||
'Designer-BBS_Phone_Is_Register': 'The phone number is already registered', |
||||
'Designer-BBS_Captcha_Send_Exceed_Limit': 'The captcha can only be sent once every 60s', |
||||
'Designer-BBS_Phone_Format_Error': 'Failed to send, the phone number format is incorrect', |
||||
'Designer-BBS_Captcha_Out_Of_Date': 'The captcha has expired, please get it again', |
||||
'Designer-BBS_Captcha_Try_Exceed_Limit': 'The number of attempts of the captcha has reached the upper limit, please get it again', |
||||
'Designer-BBS_Captcha_Error': 'Captcha error', |
||||
'Designer-BBS_Username_Format_Error': 'The nickname only supports Chinese, English and numbers', |
||||
'Designer-BBS_Username_Too_Short': 'The length of the nickname is too short', |
||||
'Designer-BBS_Username_Too_Long': 'The length of this nickname has reached the upper limit', |
||||
'Designer-BBS_Username_Is_Register': 'The user has been registered', |
||||
'Designer-BBS_Please_Enter_Correct_Phone': 'Please enter the correct phone number', |
||||
'Designer-Login_Network_Connected_Failed': 'Network connection failed', |
||||
|
||||
}} |
||||
window.Store = Store; |
@ -1,5 +1,59 @@
|
||||
var Store = { |
||||
i18n : { |
||||
'Designer-Login_User_Name': '帳號/郵箱/手機號', |
||||
'Designer-Login_User_Name_Hint': '請輸入帳號/郵箱/手機號', |
||||
'Designer-Login_Password': '密碼', |
||||
'Designer-Login_Password_Hint': '請輸入密碼', |
||||
'Designer-Login': '登入', |
||||
'Designer-Login_Title': '帆軟通行證登入', |
||||
'Designer-Login_I_Have_Read': '我已閱讀', |
||||
'Designer-Login_Service_Terms': '服務條款', |
||||
'Designer-Login_Forget_Password': '忘記密碼?', |
||||
'Designer-Login_Sms': '驗證碼登入', |
||||
'Designer-Login_Normal': '密碼登入', |
||||
'Designer-Login_Phone': '手機號碼', |
||||
'Designer-Login_Phone_Hint': '請輸入手機號碼', |
||||
'Designer-Login_Code': '驗證碼', |
||||
'Designer-Login_Code_Hint': '請輸入驗證碼', |
||||
'Designer-Login_Code_Request': '獲取驗證碼', |
||||
'Designer-Login_Code_Request_Again': '重新獲取', |
||||
'Designer-Login_Register_Or_Login': '註冊/登入', |
||||
'Designer-Basic_Chinese_Mainland': '中國大陸', |
||||
'Designer-Basic_Chinese_Hong_Kong': '中國香港', |
||||
'Designer-Basic_Chinese_Macao': '中國澳門', |
||||
'Designer-Basic_Chinese_Taiwan': '中國臺灣', |
||||
'Designer-Basic_Turkey': '土耳其', |
||||
'Designer-Basic_South_Korea': '韓國', |
||||
'Designer-Basic_Japan': '日本', |
||||
'Designer-Basic_Singapore': '新加坡', |
||||
'Designer-Basic_Malaysia': '馬來西亞', |
||||
'Designer-Login_Username_Not_Null': '使用者名稱不能為空', |
||||
'Designer-Login_Password_Not_Null': '密碼不能為空', |
||||
'Designer-Login_Username_Or_Password_Incorrect': '使用者名稱或者密碼錯誤,請檢查', |
||||
'Designer-Login_Phone_Not_Null': '手機號碼格式不正確', |
||||
'Designer-Login_Code_Not_Null': '驗證碼不能為空', |
||||
'Designer-Login_Code_Incorrect': '驗證碼已過期,請重新獲取', |
||||
'Designer-Login_Password_Setting_Hint': '輸入登入密碼(可輸入6-16位密碼)', |
||||
'Designer-Login_Store_User_Not_Exist': '帳號不存在', |
||||
'Designer-Login_Store_User_Password_Error': '帳號或密碼錯誤', |
||||
'Designer-Login_Token_Request_Failed': '註冊令牌獲取失敗', |
||||
'Designer-Login_Unexpected_Error': '未知錯誤', |
||||
'Designer-Login_Internal_Error': '伺服器內部錯誤', |
||||
'Designer-Guide_Do_Not_Remind': '一個月內不再提醒', |
||||
'Designer-Guide_Login': '立即登入', |
||||
'Designer-BBS_Register_Timeout': '註冊超時,請重新發送驗證碼', |
||||
'Designer-BBS_Phone_Is_Register': '該手機號碼已註冊', |
||||
'Designer-BBS_Captcha_Send_Exceed_Limit': '驗證碼每60s只能傳送一次', |
||||
'Designer-BBS_Phone_Format_Error': '傳送失敗,手機號格式錯誤', |
||||
'Designer-BBS_Captcha_Out_Of_Date': '驗證碼已過期,請重新獲取', |
||||
'Designer-BBS_Captcha_Try_Exceed_Limit': '驗證碼嘗試次數已達上限,請重新獲取', |
||||
'Designer-BBS_Captcha_Error': '驗證碼錯誤', |
||||
'Designer-BBS_Username_Format_Error': '暱稱只支援中英文和數字', |
||||
'Designer-BBS_Username_Too_Short': '暱稱長度太短', |
||||
'Designer-BBS_Username_Too_Long': '這個暱稱長度已經達到了上限', |
||||
'Designer-BBS_Username_Is_Register': '該帳號已被註冊', |
||||
'Designer-BBS_Please_Enter_Correct_Phone': '請輸入正確的手機號', |
||||
'Designer-Login_Network_Connected_Failed': '網路連線失敗', |
||||
|
||||
}} |
||||
window.Store = Store; |
After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 491 B |