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