ttl 提示

This commit is contained in:
Jesse-Ma
2022-12-06 10:55:14 +08:00
parent 4a8ff90081
commit 596a3c51d2
8 changed files with 48 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
NODE_ENV = developement
VUE_APP_BASE_NAME = developement
VUE_APP_BASE_URL = http://localhost:8080
NOTE_MAX_WORDS = 10240

View File

@@ -1,3 +1,4 @@
NODE_ENV = production
VUE_APP_BASE_NAME = production
VUE_APP_BASE_URL = https://flagnote.com
NOTE_MAX_WORDS = 10240

View File

@@ -4,6 +4,11 @@ import storage from "@/libs/storage";
import { md5 } from "@/libs/secret";
const servicePath = process.env.VUE_APP_BASE_URL;
const noteMaxWords = parseInt(process.env.NOTE_MAX_WORDS);
export {
noteMaxWords
}
export function saveNote(noteForm, secret) {
let storeKey = secret.storeKey;

View File

@@ -5,6 +5,7 @@ const en = {
content: {
blankTip: "I am Blank.",
noteTip: "Start writing something...",
deleteTip: "The note will be deleted automatically. ttl:"
},
button: {
ok: "OK",
@@ -24,7 +25,7 @@ const en = {
"100005": "Not Published!",
"100006": "Server Unavailable!",
"100011": "Empty Note!",
"100012": "Too Large, Beyond 200K!",
"100012": "Too Large, Beyond 400K!",
}
};
export default en;

View File

@@ -4,7 +4,8 @@ const zh = {
},
content: {
blankTip: "空白的内容。",
noteTip: "开始写下一些东西吧。。。"
noteTip: "开始写下一些东西吧。。。",
deleteTip: "笔记将被自动删除。剩余时间:"
},
button: {
ok: "好的",
@@ -19,12 +20,12 @@ const zh = {
error: {
"100001": "未知错误!",
"100002": "地址有误!",
"100003": "内容已删除!",
"100004": "内容已过期!",
"100005": "内容未分享!",
"100003": "笔记已删除!",
"100004": "笔记已过期!",
"100005": "笔记未分享!",
"100006": "服务器不可用!",
"100011": "内容为空!",
"100012": "内容过大,超过200K!",
"100011": "笔记为空!",
"100012": "笔记过大,超过400K!",
}
};
export default zh;

View File

@@ -152,7 +152,7 @@
<Form :model="noteForm" :label-width="80">
<div id="wrapper" style="border-left: 0px solid #FF3366;">
<Input element-id="noteText" type="textarea" :border="false" v-model="noteForm.text" autofocus
:autosize="{ minRows: 30, maxRows: 20480 }" :placeholder="$t('content.noteTip')" @input="recordText"
:autosize="{ minRows: 30, maxRows: 409600 }" :placeholder="$t('content.noteTip')" @input="recordText"
@on-keydown="recordEventKdown"/>
</div>
</Form>
@@ -341,7 +341,7 @@ export default {
},
recordText() {
let text = this.noteForm.text;
if (text.length > 204800) {
if (text.length > 409600) {
this.errorInfo = this.$t('error.100012');
this.model.showError = true;
return;
@@ -370,7 +370,7 @@ export default {
let end = event.currentTarget.selectionEnd;
let text = event.currentTarget.value;
if (text.length > 204800) {
if (text.length > 409600) {
this.errorInfo = this.$t('error.100012');
this.model.showError = true;
return;
@@ -416,7 +416,7 @@ export default {
},
validateForm() {
let text = this.noteForm.text;
if (text.length > 204800) {
if (text.length > 409600) {
this.errorInfo = this.$t('error.100012');
this.model.showError = true;
return false;

View File

@@ -202,9 +202,13 @@
<div style="float:right;width:auto;">
<Button-group size="large">
<Button aria-label="ttl" type="error"
style="margin-left:5px; border-radius: 0px;font-size: 21px; font-family: Arial, sans-serif"
@click="showTtlDeleteModel()" icon="md-alarm">{{ state.ttlDesc }}</Button>
<Button aria-label="share" type="error"
style="margin-left:5px; border-radius: 0px;font-size: 21px; font-family: Arial, sans-serif"
@click="showShareModel()" icon="md-alarm">{{ state.ttlDesc }}</Button>
@click="showShareModel()" icon="md-share"></Button>
<Button aria-label="menu" type="error" style="margin-left:5px; border-radius: 0px;font-size: 24px;"
@click="switchMenu()" @blur.native="hideMenu()" icon="md-menu"></Button>
@@ -293,6 +297,17 @@
</p>
</Modal>
<Modal v-model="model.showTtlDelete" width="360" footer-hide class-name="qrmodal" :styles="{ borderRadius: 0 }">
<p style="text-align: center;margin-top:20px;">
{{$t("content.deleteTip")}}{{ state.ttlDesc }}
</p>
<p style="text-align: center;margin-top:10px;">
<Button type="error" style="border-radius: 0px;font-size:19px;" @click="closeTtlDeleteModel()">{{ $t("button.close")
}}</Button>
</p>
</Modal>
<Modal v-model="model.showDelete" width="360" footer-hide class-name="fnmodal" :styles="{ borderRadius: 0 }">
<p style="text-align: center;font-size:medium;margin-bottom: 20px;">
{{ $t("message.askTodelete") }}
@@ -367,6 +382,7 @@ export default {
showDownloadText: false,
copyTip: false,
showError: false,
showTtlDelete: false,
},
toTopState: false,
showMenuState: false,
@@ -515,6 +531,12 @@ export default {
this.errorInfo = '';
this.model.showError = false;
},
showTtlDeleteModel(){
this.model.showTtlDelete = true;
},
closeTtlDeleteModel(){
this.model.showTtlDelete = false;
},
showShareModel() {
this.model.showShare = true;
storage.session.setText(this.secret.storeKey + "_share", '1');