fix
This commit is contained in:
@@ -40,8 +40,8 @@ export default {
|
|||||||
notification: {
|
notification: {
|
||||||
days: 'today | tomorrow | {count} days later',
|
days: 'today | tomorrow | {count} days later',
|
||||||
gotoLink: 'Please visit <a class="notification-link" href="{link}">Plugin Setting Page</a>.',
|
gotoLink: 'Please visit <a class="notification-link" href="{link}">Plugin Setting Page</a>.',
|
||||||
expired: 'Your plugin {plugin} license has expired.<br>@:license.notification.gotoLink',
|
expired: 'Your plugin {plugin} license has expired.',
|
||||||
warning: 'Your plugin {plugin} license will be expired {days}.<br>@:license.notification.gotoLink'
|
warning: 'Your plugin {plugin} license will be expired {days}.'
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
label: 'License Status: ',
|
label: 'License Status: ',
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ export default {
|
|||||||
notification: {
|
notification: {
|
||||||
days: '今日 | 明日 | {count}日後',
|
days: '今日 | 明日 | {count}日後',
|
||||||
gotoLink: 'ご利用には<a class="notification-link" href="{link}">「プラグインの設定」</a>をご確認ください。',
|
gotoLink: 'ご利用には<a class="notification-link" href="{link}">「プラグインの設定」</a>をご確認ください。',
|
||||||
expired: 'プラグイン「{plugin}」の有効期限が切れました。<br>@:license.notification.gotoLink',
|
expired: 'プラグイン「{plugin}」の有効期限が切れました。',
|
||||||
warning: 'プラグイン「{plugin}」の試用期間が{days}で終了します。<br>@:license.notification.gotoLink'
|
warning: 'プラグイン「{plugin}」の試用期間が{days}で終了します。'
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
label: 'ライセンス状態: ',
|
label: 'ライセンス状態: ',
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { LicenseStorage } from '@/utils/LicenseStorage';
|
|||||||
import { PermissionService } from '@/utils/permissions';
|
import { PermissionService } from '@/utils/permissions';
|
||||||
import { Notification } from 'kintone-ui-component/lib/notification';
|
import { Notification } from 'kintone-ui-component/lib/notification';
|
||||||
import { MobileNotification } from 'kintone-ui-component/lib/mobile/notification';
|
import { MobileNotification } from 'kintone-ui-component/lib/mobile/notification';
|
||||||
|
import manifestJson from '@/manifest.json';
|
||||||
|
|
||||||
const { t: $t } = i18n.global;
|
const { t: $t } = i18n.global;
|
||||||
|
|
||||||
@@ -145,7 +146,7 @@ export class LicenseService {
|
|||||||
*/
|
*/
|
||||||
static async showNotification(license: LicenseInfo | undefined, isWarning: boolean) {
|
static async showNotification(license: LicenseInfo | undefined, isWarning: boolean) {
|
||||||
let message;
|
let message;
|
||||||
const link = `https://alicorn.cybozu.com/k/admin/app/${kintone.app.getId()}/plugin/config?pluginId=${this.getPluginId()}`
|
const plugin = manifestJson.name[kintone.getLoginUser().language];
|
||||||
if (isWarning) {
|
if (isWarning) {
|
||||||
// 尚未到期
|
// 尚未到期
|
||||||
const remainingDays = this.getDaysRemaining(license!.expiredTime);
|
const remainingDays = this.getDaysRemaining(license!.expiredTime);
|
||||||
@@ -153,19 +154,21 @@ export class LicenseService {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const days = $t('license.notification.days', remainingDays)
|
const days = $t('license.notification.days', remainingDays)
|
||||||
message = $t('license.notification.warning', { plugin: this.getPluginId(), link, days });
|
message = $t('license.notification.warning', { plugin, days });
|
||||||
} else {
|
} else {
|
||||||
// 既に期限切れ
|
// 既に期限切れ
|
||||||
message = $t('license.notification.expired', { plugin: this.getPluginId(), link });
|
message = $t('license.notification.expired', { plugin });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await kintone.isMobilePage()) {
|
if (await kintone.isMobilePage()) {
|
||||||
const notification = new MobileNotification({
|
const notification = new MobileNotification({
|
||||||
content: message,
|
content: message,
|
||||||
});
|
});
|
||||||
notification.open();
|
notification.open();
|
||||||
} else {
|
} else {
|
||||||
|
const link = `https://alicorn.cybozu.com/k/admin/app/${kintone.app.getId()}/plugin/config?pluginId=${this.getPluginId()}`
|
||||||
const notification = new Notification({
|
const notification = new Notification({
|
||||||
content: message,
|
content: message + '<br />' + $t('license.notification.gotoLink', { link }),
|
||||||
type: isWarning ? 'info' : 'danger',
|
type: isWarning ? 'info' : 'danger',
|
||||||
});
|
});
|
||||||
notification.open();
|
notification.open();
|
||||||
|
|||||||
Reference in New Issue
Block a user