chore: update xpack integration references (#12628)

This commit is contained in:
ssongliu
2026-04-28 17:46:56 +08:00
committed by zhengkunwang223
parent eb527857f3
commit 5c61217c78
49 changed files with 152 additions and 158 deletions

18
.gitignore vendored
View File

@@ -40,23 +40,23 @@ core/cmd/server/web/index.html
frontend/auto-imports.d.ts
frontend/components.d.ts
frontend/src/xpack
frontend/src/xpack-ee
frontend/src/enterprise
agent/xpack
agent/xpack-ee
agent/enterprise
agent/router/entry_xpack.go
agent/router/entry_xpackee.go
agent/router/entry_enterprise.go
agent/server/init_xpack.go
agent/server/init_xpackee.go
agent/server/init_enterprise.go
agent/utils/xpack/xpack.go
agent/utils/xpack/xpackee.go
agent/utils/xpack/enterprise.go
core/xpack
core/xpack-ee
core/enterprise
core/router/entry_xpack.go
core/router/entry_xpackee.go
core/router/entry_enterprise.go
core/server/init_xpack.go
core/server/init_xpackee.go
core/server/init_enterprise.go
core/utils/xpack/xpack.go
core/utils/xpack/xpackee.go
core/utils/xpack/enterprise.go
.history/
dist/

View File

@@ -1,4 +1,4 @@
//go:build !xpack && !xpackee
//go:build !xpack && !enterprise
package router

View File

@@ -1,4 +1,4 @@
//go:build !xpack && !xpackee
//go:build !xpack && !enterprise
package server

View File

@@ -1,4 +1,4 @@
//go:build !xpack && !xpackee
//go:build !xpack && !enterprise
package xpack

View File

@@ -238,16 +238,16 @@ func (b *BaseApi) GetLoginSetting(c *gin.Context) {
ip := common.GetRealClientIP(c)
needCaptcha := global.IPTracker.NeedCaptcha(ip)
res := &dto.LoginSetting{
IsDemo: global.CONF.Base.IsDemo,
IsIntl: global.CONF.Base.Edition == "intl",
IsFxplay: global.CONF.Base.IsFxplay,
IsOffLine: global.CONF.Base.IsOffLine,
IsXPackEE: global.CONF.Base.IsXpackEE,
Language: settingInfo.Language,
MenuTabs: settingInfo.MenuTabs,
PanelName: settingInfo.PanelName,
Theme: settingInfo.Theme,
NeedCaptcha: needCaptcha,
IsDemo: global.CONF.Base.IsDemo,
IsIntl: global.CONF.Base.Edition == "intl",
IsFxplay: global.CONF.Base.IsFxplay,
IsOffLine: global.CONF.Base.IsOffLine,
IsEnterprise: global.CONF.Base.IsEnterprise,
Language: settingInfo.Language,
MenuTabs: settingInfo.MenuTabs,
PanelName: settingInfo.PanelName,
Theme: settingInfo.Theme,
NeedCaptcha: needCaptcha,
}
res.PasskeySetting = xpack.AuthProvider.PasskeyStatus(c)
helper.SuccessWithData(c, res)

View File

@@ -293,7 +293,7 @@ type LoginSetting struct {
IsIntl bool `json:"isIntl"`
IsOffLine bool `json:"isOffLine"`
IsFxplay bool `json:"isFxplay"`
IsXPackEE bool `json:"isXpackEE"`
IsEnterprise bool `json:"isEnterprise"`
Language string `json:"language"`
MenuTabs string `json:"menuTabs"`
PanelName string `json:"panelName"`

View File

@@ -4,7 +4,7 @@ base:
is_demo: false
is_offline: false
is_fxplay: false
is_xpackee: true
is_enterprise: false
port: 9999
username: admin
password: admin123

View File

@@ -15,7 +15,7 @@ type Base struct {
IsOffLine bool `mapstructure:"is_offline"`
IsFxplay bool `mapstructure:"is_fxplay"`
Edition string `mapstructure:"edition"`
IsXpackEE bool `mapstructure:"is_xpackee"`
IsEnterprise bool `mapstructure:"is_enterprise"`
Version string `mapstructure:"version"`
InstallDir string `mapstructure:"install_dir"`
ChangeUserInfo string `mapstructure:"change_user_info"`

View File

@@ -73,7 +73,7 @@ ErrLicenseExist: "This license record already exists. You can directly go to the
ErrXpackNotFound: "This section requires Business Edition. Import a license in Panel Settings > License."
ErrXpackExceptional: "This section requires Business Edition. Sync the license status in Panel Settings > License."
ErrXpackLost: "The license retry limit has been reached. Go to Panel Settings > License and run a manual sync."
ErrXpackEELicenseRequired: "Enterprise Edition license is not imported. Import a license first."
ErrEnterpriseLicenseRequired: "Enterprise Edition license is not imported. Import a license first."
ErrDeviceLost: "Required files for license verification are missing, check and try again!"
ErrDeviceErr: "Current environment does not match the license import environment. Edit the license and re-import."
ErrXpackTimeout: "Request timeout, network connection might be unstable, try again later!"

View File

@@ -73,7 +73,7 @@ ErrXpackNotFound: "Esta sección requiere la edición Business. Importa una lice
ErrXpackExceptional: "Esta sección requiere la edición Business. Sincroniza el estado de la licencia en Configuración del panel > Licencia."
ErrXpackOutOfDate: "La licencia actual ha expirado, importe nuevamente la licencia en Panel > Ajustes > Licencia"
ErrXpackLost: "La licencia alcanzó el límite de reintentos. Ve a Configuración del panel > Licencia y ejecuta una sincronización manual."
ErrXpackEELicenseRequired: "La licencia de la edición Enterprise no se ha importado. Importa primero una licencia."
ErrEnterpriseLicenseRequired: "La licencia de la edición Enterprise no se ha importado. Importa primero una licencia."
ErrDeviceLost: "Faltan archivos necesarios para la verificación de licencia, verifique e intente de nuevo"
ErrDeviceErr: "El entorno actual no coincide con el entorno de importación de la licencia. Edite la licencia e impórtela de nuevo"
ErrXpackTimeout: "Tiempo de espera de la solicitud, puede que la conexión de red sea inestable, intente más tarde"

View File

@@ -68,7 +68,7 @@ ErrLicenseExist: "このライセンス記録は既に存在します。ライ
ErrXpackNotFound: "この機能は Business Edition で利用できます。パネル設定 > ライセンス でライセンスをインポートしてください"
ErrXpackExceptional: "この機能は Business Edition で利用できます。パネル設定 > ライセンス でライセンス状態を同期してください"
ErrXpackLost: "ライセンスの再試行回数が上限に達しました。パネル設定 > ライセンス で手動同期を実行してください"
ErrXpackEELicenseRequired: "Enterprise Edition のライセンスがインポートされていません。先にライセンスをインポートしてください"
ErrEnterpriseLicenseRequired: "Enterprise Edition のライセンスがインポートされていません。先にライセンスをインポートしてください"
ErrDeviceLost: "ライセンス検証に必要なファイルが失われました。確認して再試行してください!"
ErrDeviceErr: "現在の環境とライセンスのインポート環境が一致しません。ライセンスを編集して再度インポートしてください!"
ErrXpackTimeout: "リクエストタイムアウト、ネットワーク接続が不安定な可能性があります。後で再試行してください"

View File

@@ -67,7 +67,7 @@ ErrLicenseExist: "해당 라이선스 기록이 이미 존재합니다. 라이
ErrXpackNotFound: "이 기능은 Business Edition에서 사용할 수 있습니다. 패널 설정 > 라이선스에서 라이선스를 가져오세요"
ErrXpackExceptional: "이 기능은 Business Edition에서 사용할 수 있습니다. 패널 설정 > 라이선스에서 라이선스 상태를 동기화하세요"
ErrXpackLost: "라이선스 재시도 한도에 도달했습니다. 패널 설정 > 라이선스에서 수동 동기화를 실행하세요"
ErrXpackEELicenseRequired: "Enterprise Edition 라이선스를 가져오지 않았습니다. 먼저 라이선스를 가져오세요"
ErrEnterpriseLicenseRequired: "Enterprise Edition 라이선스를 가져오지 않았습니다. 먼저 라이선스를 가져오세요"
ErrDeviceLost: "라이센스 검증에 필요한 파일이 누락되었습니다. 확인 후 다시 시도해 주세요"
ErrDeviceErr: "현재 환경이 라이선스 가져오기 환경과 일치하지 않습니다. 라이선스를 편집하고 다시 가져오십시오"
ErrXpackTimeout: "요청 시간 초과, 네트워크 연결이 불안정할 수 있습니다. 나중에 다시 시도해 주세요"

View File

@@ -66,7 +66,7 @@ ErrDeviceLost: "Fail yang diperlukan untuk pengesahan lesen hilang, sila semak d
ErrDeviceErr: "Persekitaran semasa tidak sepadan dengan persekitaran import lesen. Sila edit lesen dan import semula"
ErrXpackTimeout: "Permintaan tamat masa, sambungan rangkaian mungkin tidak stabil, sila cuba lagi kemudian"
ErrUnbindMaster: "Terdapat nod dalam pengurusan nod, sila keluarkan dahulu dan cuba lagi"
ErrXpackEELicenseRequired: "Lesen Edisi Enterprise belum diimport. Sila import lesen terlebih dahulu"
ErrEnterpriseLicenseRequired: "Lesen Edisi Enterprise belum diimport. Sila import lesen terlebih dahulu"
ErrFreeNodeLimit: "Had nod Edisi Community telah dicapai. Pergi ke www.lxware.cn/1panel untuk naik taraf dan cuba lagi"
ErrNodeBound: "Lesen ini telah diikat dengan nod lain, sila semak dan cuba lagi"
ErrNodeBoundDelete: "Lisensi ini telah diikat dan tidak menyokong operasi penghapusan. Sila semak dan cuba lagi"

View File

@@ -67,7 +67,7 @@ ErrLicenseExist: "Este registro de licença já existe. Você pode ir diretament
ErrXpackNotFound: "Este recurso requer a edição Business. Importe uma licença em Configurações do Painel > Licença."
ErrXpackExceptional: "Este recurso requer a edição Business. Sincronize o status da licença em Configurações do Painel > Licença."
ErrXpackLost: "A licença atingiu o limite de tentativas. Acesse Configurações do Painel > Licença e execute uma sincronização manual."
ErrXpackEELicenseRequired: "A licença da edição Enterprise não foi importada. Importe uma licença primeiro."
ErrEnterpriseLicenseRequired: "A licença da edição Enterprise não foi importada. Importe uma licença primeiro."
ErrDeviceLost: "Arquivos necessários para a verificação da licença estão faltando, por favor verifique e tente novamente"
ErrDeviceErr: "O ambiente atual não corresponde ao ambiente de importação da licença. Por favor, edite a licença e reimporte"
ErrXpackTimeout: "Requisição expirou, a conexão de rede pode estar instável, por favor tente novamente mais tarde"

View File

@@ -67,7 +67,7 @@ ErrLicenseExist: "Данная лицензия уже существует. В
ErrXpackNotFound: "Этот раздел доступен в Business Edition. Импортируйте лицензию в Настройки панели > Лицензия"
ErrXpackExceptional: "Этот раздел доступен в Business Edition. Синхронизируйте статус лицензии в Настройки панели > Лицензия"
ErrXpackLost: "Достигнут лимит повторных попыток по лицензии. Перейдите в Настройки панели > Лицензия и выполните ручную синхронизацию"
ErrXpackEELicenseRequired: "Лицензия Enterprise Edition не импортирована. Сначала импортируйте лицензию."
ErrEnterpriseLicenseRequired: "Лицензия Enterprise Edition не импортирована. Сначала импортируйте лицензию."
ErrDeviceLost: "Необходимые файлы для проверки лицензии отсутствуют, пожалуйста, проверьте и попробуйте снова"
ErrDeviceErr: "Текущая среда не соответствует среде импорта лицензии. Отредактируйте лицензию и повторите импорт"
ErrXpackTimeout: "Время ожидания запроса истекло, возможно нестабильное сетевое соединение, повторите попытку позже"

View File

@@ -67,7 +67,7 @@ ErrLicenseExist: "Bu lisans kaydı zaten mevcut. Düğüm bağlama için doğrud
ErrXpackNotFound: "Bu bölüm Business Sürüm gerektirir. Lisansı Panel Ayarları > Lisans bölümünden içe aktarın"
ErrXpackExceptional: "Bu bölüm Business Sürüm gerektirir. Lisans durumunu Panel Ayarları > Lisans bölümünden senkronize edin"
ErrXpackLost: "Lisans yeniden deneme sınırına ulaştı. Panel Ayarları > Lisans bölümüne gidip manuel senkronizasyon çalıştırın"
ErrXpackEELicenseRequired: "Enterprise Edition lisansı içe aktarılmamış. Önce bir lisans içe aktarın."
ErrEnterpriseLicenseRequired: "Enterprise Edition lisansı içe aktarılmamış. Önce bir lisans içe aktarın."
ErrDeviceLost: "Lisans doğrulama için gerekli dosyalar eksik, lütfen kontrol edip tekrar deneyin"
ErrXpackTimeout: "İstek zaman aşımı, ağ bağlantısı kararsız olabilir, lütfen daha sonra tekrar deneyin"
ErrUnbindMaster: "Düğüm yönetiminde düğümler tespit edildi, mevcut lisansın bağı çözülemiyor, lütfen önce düğümleri kaldırın ve tekrar deneyin"

View File

@@ -67,7 +67,7 @@ ErrLicenseExist: "該許可證記錄已存在,您可直接前往許可證頁
ErrXpackNotFound: "此功能需要商業版。請在 面板設定 > 許可證 匯入許可證"
ErrXpackExceptional: "此功能需要商業版。請在 面板設定 > 許可證 同步許可證狀態"
ErrXpackLost: "許可證已達重試上限,請前往 面板設定 > 許可證 手動同步"
ErrXpackEELicenseRequired: "企業版許可證未匯入,請先匯入許可證"
ErrEnterpriseLicenseRequired: "企業版許可證未匯入,請先匯入許可證"
ErrDeviceLost: "許可證驗證必要檔案遺失,請檢查後重試。"
ErrDeviceErr: "目前環境與許可證匯入環境不一致,請編輯許可證重新匯入!"
ErrXpackTimeout: "請求逾時,網路連接可能不穩定,請稍後再試。"

View File

@@ -73,7 +73,7 @@ ErrLicenseExist: "该许可证记录已存在,您可直接前往许可证页
ErrXpackNotFound: "该部分为专业版功能,请先在 面板设置-许可证 界面导入许可证"
ErrXpackExceptional: "该部分为专业版功能,请先在 面板设置-许可证 界面同步许可证状态"
ErrXpackLost: "许可证已达到最大重试次数,请进入【面板设置】【许可证】页面手动点击同步按钮,以确保专业版功能正常使用"
ErrXpackEELicenseRequired: "企业版许可证未导入,请先导入许可证"
ErrEnterpriseLicenseRequired: "企业版许可证未导入,请先导入许可证"
ErrDeviceLost: "许可证校验必要文件丢失,请检查后重试!"
ErrDeviceErr: "当前环境与许可证导入环境不一致,请编辑许可证重新导入!"
ErrXpackTimeout: "请求超时,网络连接可能不稳定,请稍后再试!"

View File

@@ -61,10 +61,10 @@ func handleUserInfo(tags string, settingRepo repo.ISettingRepo) {
if strings.Contains(global.CONF.Base.ChangeUserInfo, "entrance") {
settingMap["SecurityEntrance"] = common.RandStrAndNum(10)
}
if global.CONF.Base.IsXpackEE {
if global.CONF.Base.IsEnterprise {
if len(settingMap["UserName"]) != 0 || len(settingMap["Password"]) != 0 {
if err := xpack.AuthProvider.ResetSuperAdminUser(settingMap["UserName"], settingMap["Password"]); err != nil {
global.LOG.Fatalf("reset xpackee super admin failed, err: %v", err)
global.LOG.Fatalf("reset enterprise super admin failed, err: %v", err)
return
}
}

View File

@@ -84,7 +84,7 @@ func LoadMenus() string {
{ID: "12", Disabled: false, Title: "menu.logs", IsShow: true, Label: "Log-Menu", Path: "/logs", Sort: 1200},
{ID: "13", Disabled: true, Title: "menu.settings", IsShow: true, Label: "Setting-Menu", Path: "/settings", Sort: 1300},
}
if global.CONF.Base.IsXpackEE {
if global.CONF.Base.IsEnterprise {
for i := range item {
if item[i].Label != "Xpack-Menu" {
continue
@@ -95,7 +95,7 @@ func LoadMenus() string {
Title: "xpack.user.userManage",
IsShow: true,
Label: "UserManagement",
Path: "/xpack-ee/users",
Path: "/enterprise/users",
Sort: 350,
}, "NodeDashboard")
break

View File

@@ -46,7 +46,7 @@ var InitSetting = &gormigrate.Migration{
if global.CONF.Base.Language == "zh" {
language = "zh"
}
if !global.CONF.Base.IsXpackEE {
if !global.CONF.Base.IsEnterprise {
if err := tx.Create(&model.Setting{Key: "UserName", Value: global.CONF.Base.Username}).Error; err != nil {
return err
}
@@ -994,9 +994,9 @@ func normalizeAiMenuChild(children []dto.ShowMenu, fallback dto.ShowMenu, labels
}
var AddUserManagementMenu = &gormigrate.Migration{
ID: "20260414-add-user-management-menu",
ID: "20260415-add-user-management-menu",
Migrate: func(tx *gorm.DB) error {
if !global.CONF.Base.IsXpackEE {
if !global.CONF.Base.IsEnterprise {
return nil
}
var menuJSON string
@@ -1020,7 +1020,7 @@ var AddUserManagementMenu = &gormigrate.Migration{
Title: "xpack.user.userManage",
IsShow: true,
Label: "UserManagement",
Path: "/xpack-ee/users",
Path: "/enterprise/users",
Sort: 350,
}

View File

@@ -18,9 +18,9 @@ func PasswordExpired() gin.HandlerFunc {
if strings.HasPrefix(c.Request.URL.Path, "/api/v2/core/auth") ||
c.Request.URL.Path == "/api/v2/core/settings/search" ||
c.Request.URL.Path == "/api/v2/core/settings/search/base" ||
c.Request.URL.Path == "/api/v2/core/xpackee/licenses/info" ||
c.Request.URL.Path == "/api/v2/core/xpackee/licenses/status" ||
c.Request.URL.Path == "/api/v2/core/xpackee/licenses/upload" {
c.Request.URL.Path == "/api/v2/core/enterprise/licenses/info" ||
c.Request.URL.Path == "/api/v2/core/enterprise/licenses/status" ||
c.Request.URL.Path == "/api/v2/core/enterprise/licenses/upload" {
c.Next()
return
}

View File

@@ -1,4 +1,4 @@
//go:build !xpack && !xpackee
//go:build !xpack && !enterprise
package router

View File

@@ -1,4 +1,4 @@
//go:build !xpack && !xpackee
//go:build !xpack && !enterprise
package server

View File

@@ -1,4 +1,4 @@
//go:build !xpack && !xpackee
//go:build !xpack && !enterprise
package xpack

View File

@@ -79,7 +79,7 @@ class RequestHttp {
});
return Promise.reject(data);
}
if (data.code == ResultEnum.ERRRBAC) {
if (data.code == ResultEnum.ERR_RBAC) {
MsgError(data.message || i18n.global.t('commons.res.forbidden'));
return Promise.reject(data);
}
@@ -87,30 +87,30 @@ class RequestHttp {
router.push({ name: 'Expired' });
return;
}
if (data.code == ResultEnum.ERRXPACK) {
if (data.code == ResultEnum.ERR_XPACK) {
globalStore.isProductPro = false;
window.location.reload();
return Promise.reject(data);
}
if (data.code == ResultEnum.ERRXPACKEE) {
globalStore.isXpackEELicensed = false;
if (data.code == ResultEnum.ERR_ENTERPRISE) {
globalStore.isEnterpriseLicensed = false;
const routeName = router.currentRoute.value.name;
if (
globalStore.isLogin &&
routeName !== 'entrance' &&
routeName !== 'login' &&
routeName !== 'XpackEELicenseRequired'
routeName !== 'EnterpriseLicenseRequired'
) {
router.push({ name: 'XpackEELicenseRequired' });
router.push({ name: 'EnterpriseLicenseRequired' });
}
return Promise.reject(data);
}
if (data.code == ResultEnum.NodeUnBind) {
if (data.code == ResultEnum.NODE_UNBIND) {
changeToLocal();
window.location.reload();
return;
}
if (data.code == ResultEnum.ERRGLOBALLOADING) {
if (data.code == ResultEnum.ERR_GLOBAL_LOADING) {
globalStore.$patch({
isLoading: true,
loadingText: data.message,
@@ -121,7 +121,7 @@ class RequestHttp {
globalStore.isLoading = false;
}
}
if (data.code == ResultEnum.ERRAUTH) {
if (data.code == ResultEnum.ERR_AUTH) {
return data;
}
if (data.code && data.code !== ResultEnum.SUCCESS) {

View File

@@ -40,7 +40,7 @@ export namespace Login {
panelName: string;
theme: string;
isOffLine: boolean;
isXpackEE: boolean;
isEnterprise: boolean;
needCaptcha: boolean;
passkeySetting: boolean;
}

View File

@@ -56,18 +56,18 @@ export const listAppNodes = () => {
return http.get<Array<Setting.NodeAppItem>>(`/core/xpack/nodes/apps/update`, {}, { timeout: TimeoutEnum.T_60S });
};
// xpackee
// enterprise
export const loadNodeByUser = () => {
return http.get<Array<Setting.NodeItem>>(`/core/xpackee/users/nodes`);
return http.get<Array<Setting.NodeItem>>(`/core/enterprise/users/nodes`);
};
export const uploadXpackEELicense = (params: FormData) => {
return http.upload('/core/xpackee/licenses/upload', params);
export const uploadEnterpriseLicense = (params: FormData) => {
return http.upload('/core/enterprise/licenses/upload', params);
};
export const getXpackEELicense = () => {
return http.get<Setting.LicenseEE>(`/core/xpackee/licenses/info`);
export const getEnterpriseLicense = () => {
return http.get<Setting.LicenseEE>(`/core/enterprise/licenses/info`);
};
export const getXpackEELicenseStatus = () => {
return http.get<Setting.LicenseStatus>(`/core/xpackee/licenses/status`);
export const getEnterpriseLicenseStatus = () => {
return http.get<Setting.LicenseStatus>(`/core/enterprise/licenses/status`);
};
// agent

View File

@@ -59,7 +59,7 @@
import i18n from '@/lang';
import { ref } from 'vue';
import { MsgSuccess } from '@/utils/message';
import { uploadLicense, uploadXpackEELicense } from '@/api/modules/setting';
import { uploadLicense, uploadEnterpriseLicense } from '@/api/modules/setting';
import DockerProxy from '@/components/docker-proxy/index.vue';
import { GlobalStore } from '@/store';
import { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile, genFileId } from 'element-plus';
@@ -126,9 +126,9 @@ const submit = async () => {
const file = uploaderFiles.value[0];
const formData = new FormData();
formData.append('file', file.raw);
if (globalStore.isXpackEE) {
if (globalStore.isEnterprise) {
loading.value = true;
await uploadXpackEELicense(formData)
await uploadEnterpriseLicense(formData)
.then(async () => {
handleAfterSubmit();
})
@@ -166,10 +166,10 @@ const handleAfterSubmit = () => {
open.value = false;
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
if (!isImport.value) {
if (!globalStore.isXpackEE) globalStore.isProductPro = true;
if (!globalStore.isEnterprise) globalStore.isProductPro = true;
globalStore.isMasterProductPro = true;
} else {
globalStore.isXpackEELicensed = true;
globalStore.isEnterpriseLicensed = true;
}
if (!withoutReload.value) {
loadMasterProductProFromDB();

View File

@@ -22,7 +22,7 @@
</span>
<div class="flex flex-wrap items-center">
<el-link underline="never" type="primary" @click="toLxware">
<span v-if="isXpackEE">
<span v-if="isEnterprise">
{{ $t('license.ee') }}
</span>
<span v-else-if="isMasterPro">
@@ -79,7 +79,7 @@ const releasesRef = ref();
const isMasterPro = computed(() => {
return globalStore.isMasterPro();
});
const isXpackEE = computed(() => {
const isEnterprise = computed(() => {
return globalStore.isEE();
});

View File

@@ -1,7 +1,7 @@
import communityProvider from './community';
import type { EditionFrontendProvider } from './provider';
import proProvider from '@xpack-pro/edition';
import eeProvider from '@xpack-ee/edition';
import eeProvider from '@enterprise/edition';
const edition = (import.meta.env.VITE_FRONTEND_EDITION || 'community').toLowerCase();

View File

@@ -1,7 +1,7 @@
export enum ResultEnum {
SUCCESS = 200,
ERRIP = 310,
ERRDOMAIN = 311,
ERR_IP = 310,
ERR_DOMAIN = 311,
UNSAFETY = 312,
EXPIRED = 313,
@@ -9,12 +9,12 @@ export enum ResultEnum {
OVERDUE = 401,
FORBIDDEN = 403,
NOTFOUND = 404,
ERRAUTH = 406,
ERRGLOBALLOADING = 407,
ERRXPACK = 410,
NodeUnBind = 411,
ERRRBAC = 412,
ERRXPACKEE = 413,
ERR_AUTH = 406,
ERR_GLOBAL_LOADING = 407,
ERR_XPACK = 410,
NODE_UNBIND = 411,
ERR_RBAC = 412,
ERR_ENTERPRISE = 413,
TIMEOUT = 20000,
TYPE = 'success',
}

View File

@@ -3,7 +3,7 @@ type VueComponent = { template?: string } | Record<string, any>;
const EmptyComponent: VueComponent = { template: '<div></div>' };
const extensionViewModules = {
...import.meta.glob('@/xpack/views/**/*.vue'),
...import.meta.glob('@/xpack-ee/views/**/*.vue'),
...import.meta.glob('@/enterprise/views/**/*.vue'),
};
function findLoader(suffix: string) {

View File

@@ -5,10 +5,10 @@ type RouteModuleMap = Record<string, { default?: ExtensionRouteRecord }>;
export function getXpackRoutes(baseModules: RouteModuleMap = {}): RouteModuleMap {
const xpackRoutes = import.meta.glob('@/xpack/routers/*.ts', { eager: true }) as RouteModuleMap;
const xpackEERoutes = import.meta.glob('@/xpack-ee/routers/*.ts', { eager: true }) as RouteModuleMap;
const enterpriseRoutes = import.meta.glob('@/enterprise/routers/*.ts', { eager: true }) as RouteModuleMap;
const routes = {
...xpackRoutes,
...xpackEERoutes,
...enterpriseRoutes,
};
const rawRoutes = (
Object.keys(routes)

View File

@@ -16,9 +16,9 @@ export function loadXpackStyles() {
const xpackLoader = findModule(xpackModules, '/styles/index.scss');
xpackLoader?.();
const xpackEEModules = import.meta.glob('@/xpack-ee/styles/index.scss');
const xpackEELoader = findModule(xpackEEModules, '/styles/index.scss');
xpackEELoader?.();
const enterpriseModules = import.meta.glob('@/enterprise/styles/index.scss');
const enterpriseLoader = findModule(enterpriseModules, '/styles/index.scss');
enterpriseLoader?.();
}
export function setXpackPrimaryColor(color: string) {
@@ -29,12 +29,12 @@ export function setXpackPrimaryColor(color: string) {
const xpackModule = findModule(xpackModules, '/utils/theme/tool.ts');
xpackModule?.setPrimaryColor?.(color);
const xpackEEModules = import.meta.glob('@/xpack-ee/utils/theme/tool.ts', { eager: true }) as Record<
const enterpriseModules = import.meta.glob('@/enterprise/utils/theme/tool.ts', { eager: true }) as Record<
string,
XpackThemeModule
>;
const xpackEEModule = findModule(xpackEEModules, '/utils/theme/tool.ts');
xpackEEModule?.setPrimaryColor?.(color);
const enterpriseModule = findModule(enterpriseModules, '/utils/theme/tool.ts');
enterpriseModule?.setPrimaryColor?.(color);
}
export const loadExtensionStyles = loadXpackStyles;

View File

@@ -3,7 +3,7 @@ type XpackSettingModule = {
updateXSettingByKey?: (key: string, value: string) => Promise<any>;
};
type XpackeeUserModule = {
type EnterpriseUserModule = {
getUserInfo?: (currentNode: string) => Promise<any>;
};
@@ -40,16 +40,16 @@ export async function updateXpackSettingByKey(key: string, value: string) {
return module.updateXSettingByKey(key, value);
}
function getXpackeeUserModule(): XpackeeUserModule | null {
const xpackModules = import.meta.glob('@/xpack-ee/api/modules/user.ts', { eager: true }) as Record<
function getEnterpriseUserModule(): EnterpriseUserModule | null {
const enterpriseModules = import.meta.glob('@/enterprise/api/modules/user.ts', { eager: true }) as Record<
string,
XpackeeUserModule
EnterpriseUserModule
>;
return findModule(xpackModules, '/api/modules/user.ts');
return findModule(enterpriseModules, '/api/modules/user.ts');
}
export async function getXpackeeUserInfo(currentNode: string) {
const module = getXpackeeUserModule();
export async function getEnterpriseUserInfo(currentNode: string) {
const module = getEnterpriseUserModule();
if (!module?.getUserInfo) {
return null;
}

View File

@@ -191,7 +191,7 @@ const changeNode = async (command: string) => {
for (const item of nodes.value) {
if (item.name == command) {
if (command == 'local') {
if (globalStore.isXpackEE) {
if (globalStore.isEnterprise) {
await loadCurrentUser('local');
}
await loadGlobalSetting('local');
@@ -222,7 +222,7 @@ const changeNode = async (command: string) => {
localStorage.removeItem('upgradeChecked');
globalStore.currentNode = command;
globalStore.currentNodeAddr = item.addr;
if (globalStore.isXpackEE) {
if (globalStore.isEnterprise) {
await loadCurrentUser(command);
}
menuStore.setMenuList([]);

View File

@@ -772,10 +772,6 @@ const registerPasskey = async () => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
passkeyForm.name = '';
await loadPasskeys();
} catch (res: any) {
if (res?.message) {
console.log(res.message);
}
} finally {
passkeyLoading.value = false;
}

View File

@@ -10,12 +10,12 @@ import { MsgError } from '@/utils/message';
const axiosCanceler = new AxiosCanceler();
let isRedirecting = false;
const xpackEELicenseCheckWhiteList = ['XpackEELicenseRequired', 'entrance', 'login', 'Expired'];
const enterpriseLicenseCheckWhiteList = ['EnterpriseLicenseRequired', 'entrance', 'login', 'Expired'];
const clearLicenseStatus = () => {
const globalStore = GlobalStore();
globalStore.isXpackEELicensed = false;
globalStore.isXpackEELicenseLoaded = false;
globalStore.isEnterpriseLicensed = false;
globalStore.isEnterpriseLicenseLoaded = false;
};
const clearLoginStatus = () => {
@@ -52,17 +52,17 @@ router.beforeEach(async (to, from, next) => {
NProgress.done();
return;
}
if (globalStore.isLogin && globalStore.isXpackEE && !xpackEELicenseCheckWhiteList.includes(String(to.name))) {
if (!globalStore.isXpackEELicenseLoaded) {
if (globalStore.isLogin && globalStore.isEnterprise && !enterpriseLicenseCheckWhiteList.includes(String(to.name))) {
if (!globalStore.isEnterpriseLicenseLoaded) {
await loadProductProFromDB();
}
if (!globalStore.isXpackEELicensed) {
next({ name: 'XpackEELicenseRequired', query: { code: String(to.params.code || '') } });
if (!globalStore.isEnterpriseLicensed) {
next({ name: 'EnterpriseLicenseRequired', query: { code: String(to.params.code || '') } });
NProgress.done();
return;
}
}
if (to.name === 'XpackEELicenseRequired') {
if (to.name === 'EnterpriseLicenseRequired') {
if (!globalStore.isLogin) {
next({
name: 'entrance',
@@ -71,7 +71,7 @@ router.beforeEach(async (to, from, next) => {
NProgress.done();
return;
}
if (!globalStore.isXpackEE || globalStore.isXpackEELicensed) {
if (!globalStore.isEnterprise || globalStore.isEnterpriseLicensed) {
next({ name: 'home' });
NProgress.done();
return;

View File

@@ -78,11 +78,11 @@ export const routes: RouteRecordRaw[] = [
},
},
{
path: '/xpack-ee/license-required',
name: 'XpackEELicenseRequired',
path: '/enterprise/license-required',
name: 'EnterpriseLicenseRequired',
component: () => import('@/views/setting/license-required/index.vue'),
meta: {
key: 'xpack-ee-license-required',
key: 'enterprise-license-required',
},
},
{

View File

@@ -58,7 +58,7 @@ export interface GlobalState {
isAdmin: boolean;
permissions: string[];
nodeRoles: Array<{ nodeId: number; nodeName: string; roleId: number; roleName: string }>;
isXpackEE: boolean;
isEnterprise: boolean;
isIntl: boolean;
docWithRegion: boolean;
isFxplay: boolean;
@@ -67,8 +67,8 @@ export interface GlobalState {
isProductPro: boolean;
productProExpires: number;
isMasterProductPro: boolean;
isXpackEELicensed: boolean;
isXpackEELicenseLoaded: boolean;
isEnterpriseLicensed: boolean;
isEnterpriseLicenseLoaded: boolean;
// multi-node
masterAlias: string;
currentNode: string;

View File

@@ -55,7 +55,7 @@ const GlobalStore = defineStore({
isAdmin: false,
permissions: [],
nodeRoles: [],
isXpackEE: false,
isEnterprise: false,
isIntl: false,
docWithRegion: true,
isFxplay: false,
@@ -64,8 +64,8 @@ const GlobalStore = defineStore({
isProductPro: false,
productProExpires: 0,
isMasterProductPro: false,
isXpackEELicensed: false,
isXpackEELicenseLoaded: false,
isEnterpriseLicensed: false,
isEnterpriseLicenseLoaded: false,
// multi-node
masterAlias: '',
currentNode: 'local',
@@ -147,13 +147,13 @@ const GlobalStore = defineStore({
return this.masterAlias || i18n.global.t('xpack.node.master');
},
isEE() {
return this.isXpackEE && this.isXpackEELicensed;
return this.isEnterprise && this.isEnterpriseLicensed;
},
isXpackOrEE() {
return (this.isXpackEE && this.isXpackEELicensed) || this.isMasterProductPro;
return (this.isEnterprise && this.isEnterpriseLicensed) || this.isMasterProductPro;
},
isXpackNodeOrEE() {
return (this.isXpackEE && this.isXpackEELicensed) || this.isProductPro;
return (this.isEnterprise && this.isEnterpriseLicensed) || this.isProductPro;
},
isMasterPro() {
return this.isMasterProductPro;

View File

@@ -1,5 +1,5 @@
import { getUserInfo } from '@/api/modules/auth';
import { getXpackeeUserInfo } from '@/extensions/xpack';
import { getEnterpriseUserInfo } from '@/extensions/xpack';
import { GlobalStore } from '@/store';
import type { RouteMeta } from 'vue-router';
@@ -18,11 +18,11 @@ type RouteAccessTarget = {
export const syncAuthInfo = async (currentNode?: string) => {
const globalStore = GlobalStore();
if (!globalStore.isXpackEE) {
if (!globalStore.isEnterprise) {
const res = await getUserInfo();
return res.data;
}
const res = await getXpackeeUserInfo(currentNode ?? globalStore.currentNode);
const res = await getEnterpriseUserInfo(currentNode ?? globalStore.currentNode);
globalStore.setAuthInfo({
isAdmin: res.data.role === 'ADMIN',
permissions: res.data.permissions || [],

View File

@@ -2,7 +2,7 @@ import {
getLicenseStatus,
getMasterLicenseStatus,
getSettingBaseInfo,
getXpackEELicenseStatus,
getEnterpriseLicenseStatus,
} from '@/api/modules/setting';
import { useTheme } from '@/global/use-theme';
import {
@@ -83,8 +83,8 @@ const loadDataFromDB = async () => {
export async function loadProductProFromDB() {
const globalStore = getGlobalStore();
if (!globalStore.isXpackEE) {
globalStore.isXpackEELicenseLoaded = true;
if (!globalStore.isEnterprise) {
globalStore.isEnterpriseLicenseLoaded = true;
const res = await getLicenseStatus();
if (!res || !res.data) {
globalStore.isProductPro = false;
@@ -96,19 +96,19 @@ export async function loadProductProFromDB() {
}
return;
}
const res = await getXpackEELicenseStatus();
globalStore.isXpackEELicenseLoaded = true;
const res = await getEnterpriseLicenseStatus();
globalStore.isEnterpriseLicenseLoaded = true;
if (!res || !res.data) {
globalStore.isXpackEELicensed = false;
globalStore.isEnterpriseLicensed = false;
} else {
globalStore.isXpackEELicensed = res.data.status === 'Bound';
globalStore.isEnterpriseLicensed = res.data.status === 'Bound';
}
}
export async function loadMasterProductProFromDB() {
const globalStore = getGlobalStore();
if (!globalStore.isXpackEE) {
globalStore.isXpackEELicenseLoaded = true;
if (!globalStore.isEnterprise) {
globalStore.isEnterpriseLicenseLoaded = true;
const res = await getMasterLicenseStatus();
if (!res || !res.data) {
globalStore.isMasterProductPro = false;
@@ -116,12 +116,12 @@ export async function loadMasterProductProFromDB() {
globalStore.isMasterProductPro = res.data.status === 'Bound';
}
} else {
const res = await getXpackEELicenseStatus();
globalStore.isXpackEELicenseLoaded = true;
const res = await getEnterpriseLicenseStatus();
globalStore.isEnterpriseLicenseLoaded = true;
if (!res || !res.data) {
globalStore.isXpackEELicensed = false;
globalStore.isEnterpriseLicensed = false;
} else {
globalStore.isXpackEELicensed = res.data.status === 'Bound';
globalStore.isEnterpriseLicensed = res.data.status === 'Bound';
globalStore.isMasterProductPro = res.data.status === 'Bound';
}
}

View File

@@ -13,7 +13,7 @@ import AccountView from '@/views/ai/agents/model/index.vue';
import LocalView from '@/views/ai/model/local/index.vue';
import { loadOptionalComponent } from '@/extensions/optional';
const AIProxyView = defineAsyncComponent(() => loadOptionalComponent('/src/xpack-ee/views/ai-proxy/index.vue'));
const AIProxyView = defineAsyncComponent(() => loadOptionalComponent('/src/enterprise/views/ai-proxy/index.vue'));
const route = useRoute();
const router = useRouter();

View File

@@ -185,9 +185,7 @@ const sync = async () => {
} else {
res = await syncApp(syncReq);
}
console.log(res);
if (res.message != '' && res.message != 'success') {
console.log(res.message);
MsgSuccess(res.message);
} else {
openTaskLog(taskID);

View File

@@ -629,8 +629,8 @@ const getSetting = async () => {
isFxplay.value = res.data.isFxplay;
globalStore.isFxplay = isFxplay.value;
globalStore.isOffLine = res.data.isOffLine;
globalStore.isXpackEE = res.data.isXpackEE;
globalStore.isXpackEELicenseLoaded = !res.data.isXpackEE;
globalStore.isEnterprise = res.data.isEnterprise;
globalStore.isEnterpriseLicenseLoaded = !res.data.isEnterprise;
globalStore.ignoreCaptcha = !res.data.needCaptcha;
passkeySetting.value = res.data.passkeySetting;
if (!globalStore.ignoreCaptcha) {

View File

@@ -11,7 +11,7 @@
import { computed } from 'vue';
import i18n from '@/lang';
import { useGlobalStore } from '@/composables/useGlobalStore';
const { isOffLine, isFxplay, isAdmin, isXpackEE } = useGlobalStore();
const { isOffLine, isFxplay, isAdmin, isEnterprise } = useGlobalStore();
const buttons = computed(() => {
const items = [
@@ -44,7 +44,7 @@ const buttons = computed(() => {
: [
{
label: i18n.global.t('setting.license'),
path: isXpackEE.value ? '/xpack-ee/license' : '/settings/license',
path: isEnterprise.value ? '/enterprise/license' : '/settings/license',
},
]),
...(isFxplay.value

View File

@@ -60,7 +60,7 @@ import { computed, onMounted, reactive, ref } from 'vue';
import { useRouter } from 'vue-router';
import type { UploadFile, UploadFiles, UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
import { genFileId } from 'element-plus';
import { getXpackEELicense, uploadXpackEELicense } from '@/api/modules/setting';
import { getEnterpriseLicense, uploadEnterpriseLicense } from '@/api/modules/setting';
import { getLoginSetting } from '@/api/modules/auth';
import { GlobalStore } from '@/store';
import { MsgSuccess } from '@/utils/message';
@@ -103,8 +103,8 @@ const loadImage = (name: string) => {
const loadLoginTheme = async () => {
const res = await getLoginSetting();
globalStore.isXpackEE = res.data.isXpackEE;
globalStore.isXpackEELicenseLoaded = !res.data.isXpackEE;
globalStore.isEnterprise = res.data.isEnterprise;
globalStore.isEnterpriseLicenseLoaded = !res.data.isEnterprise;
globalStore.isIntl = res.data.isIntl;
globalStore.isFxplay = res.data.isFxplay;
globalStore.isOffLine = res.data.isOffLine;
@@ -125,7 +125,7 @@ const loadLoginTheme = async () => {
'--login-loading-mask-color',
adjustColorToRGBA(loginBtnLinkColor.value, 30, 15),
);
if (!globalStore.isXpackEE) {
if (!globalStore.isEnterprise) {
router.replace(
globalStore.isLogin ? { name: 'home' } : { name: 'entrance', params: { code: globalStore.entrance } },
);
@@ -157,11 +157,11 @@ const loadBackground = async () => {
};
const loadLicenseInfo = async () => {
const res = await getXpackEELicense();
globalStore.isXpackEELicenseLoaded = true;
const res = await getEnterpriseLicense();
globalStore.isEnterpriseLicenseLoaded = true;
licenseInfo.deviceID = res.data.deviceID;
if (res.data.status === 'Bound') {
globalStore.isXpackEELicensed = true;
globalStore.isEnterpriseLicensed = true;
router.replace({ name: 'home' });
}
};
@@ -188,9 +188,9 @@ const submit = async () => {
const formData = new FormData();
formData.append('file', file.raw);
loading.value = true;
await uploadXpackEELicense(formData)
await uploadEnterpriseLicense(formData)
.then(() => {
globalStore.isXpackEELicensed = true;
globalStore.isEnterpriseLicensed = true;
globalStore.isMasterProductPro = true;
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
router.replace({ name: 'home' });