This commit is contained in:
2025-10-23 19:12:21 +08:00
parent e531b50a0d
commit 3961285b32
3 changed files with 11 additions and 8 deletions

View File

@@ -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();