mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-09 07:00:48 +08:00
feat: Update agent appstore setting to core (#8550)
This commit is contained in:
parent
16ec5fb997
commit
91843382c3
17 changed files with 120 additions and 99 deletions
|
@ -192,39 +192,3 @@ func (b *BaseApi) GetAppListUpdate(c *gin.Context) {
|
||||||
}
|
}
|
||||||
helper.SuccessWithData(c, res)
|
helper.SuccessWithData(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Tags App
|
|
||||||
// @Summary Update appstore config
|
|
||||||
// @Accept json
|
|
||||||
// @Param request body request.AppstoreUpdate true "request"
|
|
||||||
// @Success 200
|
|
||||||
// @Security ApiKeyAuth
|
|
||||||
// @Security Timestamp
|
|
||||||
// @Router /apps/store/update [post]
|
|
||||||
func (b *BaseApi) UpdateAppstoreConfig(c *gin.Context) {
|
|
||||||
var req request.AppstoreUpdate
|
|
||||||
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
err := appService.UpdateAppstoreConfig(req)
|
|
||||||
if err != nil {
|
|
||||||
helper.InternalServer(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
helper.Success(c)
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Tags App
|
|
||||||
// @Summary Get appstore config
|
|
||||||
// @Success 200 {object} response.AppstoreConfig
|
|
||||||
// @Security ApiKeyAuth
|
|
||||||
// @Security Timestamp
|
|
||||||
// @Router /apps/store/config [get]
|
|
||||||
func (b *BaseApi) GetAppstoreConfig(c *gin.Context) {
|
|
||||||
res, err := appService.GetAppstoreConfig()
|
|
||||||
if err != nil {
|
|
||||||
helper.InternalServer(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
helper.SuccessWithData(c, res)
|
|
||||||
}
|
|
||||||
|
|
|
@ -127,8 +127,3 @@ type AppUpdateVersion struct {
|
||||||
AppInstallID uint `json:"appInstallID" validate:"required"`
|
AppInstallID uint `json:"appInstallID" validate:"required"`
|
||||||
UpdateVersion string `json:"updateVersion"`
|
UpdateVersion string `json:"updateVersion"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppstoreUpdate struct {
|
|
||||||
Scope string `json:"scope" validate:"required,oneof=UninstallDeleteImage UpgradeBackup UninstallDeleteBackup"`
|
|
||||||
Status string `json:"status"`
|
|
||||||
}
|
|
||||||
|
|
|
@ -163,9 +163,3 @@ type AppConfig struct {
|
||||||
Params []AppParam `json:"params"`
|
Params []AppParam `json:"params"`
|
||||||
request.AppContainerConfig
|
request.AppContainerConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppstoreConfig struct {
|
|
||||||
UninstallDeleteImage string `json:"uninstallDeleteImage"`
|
|
||||||
UpgradeBackup string `json:"upgradeBackup"`
|
|
||||||
UninstallDeleteBackup string `json:"uninstallDeleteBackup"`
|
|
||||||
}
|
|
||||||
|
|
|
@ -46,9 +46,6 @@ type IAppService interface {
|
||||||
GetAppUpdate() (*response.AppUpdateRes, error)
|
GetAppUpdate() (*response.AppUpdateRes, error)
|
||||||
GetAppDetailByID(id uint) (*response.AppDetailDTO, error)
|
GetAppDetailByID(id uint) (*response.AppDetailDTO, error)
|
||||||
SyncAppListFromLocal(taskID string)
|
SyncAppListFromLocal(taskID string)
|
||||||
|
|
||||||
GetAppstoreConfig() (*response.AppstoreConfig, error)
|
|
||||||
UpdateAppstoreConfig(req request.AppstoreUpdate) error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewIAppService() IAppService {
|
func NewIAppService() IAppService {
|
||||||
|
@ -1158,25 +1155,3 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a AppService) UpdateAppstoreConfig(req request.AppstoreUpdate) error {
|
|
||||||
settingService := NewISettingService()
|
|
||||||
return settingService.Update(req.Scope, req.Status)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a AppService) GetAppstoreConfig() (*response.AppstoreConfig, error) {
|
|
||||||
res := &response.AppstoreConfig{}
|
|
||||||
res.UninstallDeleteImage, _ = settingRepo.GetValueByKey("UninstallDeleteImage")
|
|
||||||
if res.UninstallDeleteImage == "" {
|
|
||||||
res.UninstallDeleteImage = "False"
|
|
||||||
}
|
|
||||||
res.UpgradeBackup, _ = settingRepo.GetValueByKey("UpgradeBackup")
|
|
||||||
if res.UpgradeBackup == "" {
|
|
||||||
res.UpgradeBackup = "False"
|
|
||||||
}
|
|
||||||
res.UninstallDeleteBackup, _ = settingRepo.GetValueByKey("UninstallDeleteBackup")
|
|
||||||
if res.UninstallDeleteBackup == "" {
|
|
||||||
res.UninstallDeleteBackup = "False"
|
|
||||||
}
|
|
||||||
return res, nil
|
|
||||||
}
|
|
||||||
|
|
|
@ -38,8 +38,6 @@ func (a *AppRouter) InitRouter(Router *gin.RouterGroup) {
|
||||||
appRouter.POST("/installed/params/update", baseApi.UpdateInstalled)
|
appRouter.POST("/installed/params/update", baseApi.UpdateInstalled)
|
||||||
appRouter.POST("/installed/update/versions", baseApi.GetUpdateVersions)
|
appRouter.POST("/installed/update/versions", baseApi.GetUpdateVersions)
|
||||||
appRouter.POST("/installed/config/update", baseApi.UpdateAppConfig)
|
appRouter.POST("/installed/config/update", baseApi.UpdateAppConfig)
|
||||||
appRouter.POST("/store/update", baseApi.UpdateAppstoreConfig)
|
|
||||||
appRouter.GET("/store/config", baseApi.GetAppstoreConfig)
|
|
||||||
|
|
||||||
appRouter.POST("/installed/ignore", baseApi.IgnoreAppUpgrade)
|
appRouter.POST("/installed/ignore", baseApi.IgnoreAppUpgrade)
|
||||||
appRouter.GET("/ignored/detail", baseApi.ListAppIgnored)
|
appRouter.GET("/ignored/detail", baseApi.ListAppIgnored)
|
||||||
|
|
|
@ -445,6 +445,42 @@ func (b *BaseApi) UpdateApiConfig(c *gin.Context) {
|
||||||
helper.Success(c)
|
helper.Success(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Tags App
|
||||||
|
// @Summary Update appstore config
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body dto.AppstoreUpdate true "request"
|
||||||
|
// @Success 200
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /settings/apps/store/update [post]
|
||||||
|
func (b *BaseApi) UpdateAppstoreConfig(c *gin.Context) {
|
||||||
|
var req dto.AppstoreUpdate
|
||||||
|
if err := helper.CheckBindAndValidate(&req, c); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err := settingService.UpdateAppstoreConfig(req)
|
||||||
|
if err != nil {
|
||||||
|
helper.InternalServer(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.Success(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Tags App
|
||||||
|
// @Summary Get appstore config
|
||||||
|
// @Success 200 {object} dto.AppstoreConfig
|
||||||
|
// @Security ApiKeyAuth
|
||||||
|
// @Security Timestamp
|
||||||
|
// @Router /settings/apps/store/config [get]
|
||||||
|
func (b *BaseApi) GetAppstoreConfig(c *gin.Context) {
|
||||||
|
res, err := settingService.GetAppstoreConfig()
|
||||||
|
if err != nil {
|
||||||
|
helper.InternalServer(c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
helper.SuccessWithData(c, res)
|
||||||
|
}
|
||||||
|
|
||||||
func checkEntrancePattern(val string) bool {
|
func checkEntrancePattern(val string) bool {
|
||||||
if len(val) == 0 {
|
if len(val) == 0 {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package dto
|
package dto
|
||||||
|
|
||||||
import "time"
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
type SettingInfo struct {
|
type SettingInfo struct {
|
||||||
UserName string `json:"userName"`
|
UserName string `json:"userName"`
|
||||||
|
@ -207,3 +209,13 @@ type TerminalInfo struct {
|
||||||
Scrollback string `json:"scrollback"`
|
Scrollback string `json:"scrollback"`
|
||||||
ScrollSensitivity string `json:"scrollSensitivity"`
|
ScrollSensitivity string `json:"scrollSensitivity"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AppstoreUpdate struct {
|
||||||
|
Scope string `json:"scope" validate:"required,oneof=UninstallDeleteImage UpgradeBackup UninstallDeleteBackup"`
|
||||||
|
Status string `json:"status" validate:"required,oneof=Disable Enable"`
|
||||||
|
}
|
||||||
|
type AppstoreConfig struct {
|
||||||
|
UninstallDeleteImage string `json:"uninstallDeleteImage"`
|
||||||
|
UpgradeBackup string `json:"upgradeBackup"`
|
||||||
|
UninstallDeleteBackup string `json:"uninstallDeleteBackup"`
|
||||||
|
}
|
||||||
|
|
|
@ -55,6 +55,9 @@ type ISettingService interface {
|
||||||
GenerateRSAKey() error
|
GenerateRSAKey() error
|
||||||
|
|
||||||
GetLoginSetting() (*dto.SystemSetting, error)
|
GetLoginSetting() (*dto.SystemSetting, error)
|
||||||
|
|
||||||
|
UpdateAppstoreConfig(req dto.AppstoreUpdate) error
|
||||||
|
GetAppstoreConfig() (*dto.AppstoreConfig, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewISettingService() ISettingService {
|
func NewISettingService() ISettingService {
|
||||||
|
@ -640,6 +643,27 @@ func (u *SettingService) GetLoginSetting() (*dto.SystemSetting, error) {
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u *SettingService) UpdateAppstoreConfig(req dto.AppstoreUpdate) error {
|
||||||
|
return settingRepo.UpdateOrCreate(req.Scope, req.Status)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *SettingService) GetAppstoreConfig() (*dto.AppstoreConfig, error) {
|
||||||
|
res := &dto.AppstoreConfig{}
|
||||||
|
res.UninstallDeleteImage, _ = settingRepo.GetValueByKey("UninstallDeleteImage")
|
||||||
|
if res.UninstallDeleteImage == "" {
|
||||||
|
res.UninstallDeleteImage = "False"
|
||||||
|
}
|
||||||
|
res.UpgradeBackup, _ = settingRepo.GetValueByKey("UpgradeBackup")
|
||||||
|
if res.UpgradeBackup == "" {
|
||||||
|
res.UpgradeBackup = "False"
|
||||||
|
}
|
||||||
|
res.UninstallDeleteBackup, _ = settingRepo.GetValueByKey("UninstallDeleteBackup")
|
||||||
|
if res.UninstallDeleteBackup == "" {
|
||||||
|
res.UninstallDeleteBackup = "False"
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
func loadDockerProxy(req dto.ProxyUpdate) string {
|
func loadDockerProxy(req dto.ProxyUpdate) string {
|
||||||
if len(req.ProxyType) == 0 || req.ProxyType == "close" || !req.ProxyDocker {
|
if len(req.ProxyType) == 0 || req.ProxyType == "close" || !req.ProxyDocker {
|
||||||
return ""
|
return ""
|
||||||
|
|
|
@ -25,6 +25,7 @@ func Init() {
|
||||||
migrations.InitScriptLibrary,
|
migrations.InitScriptLibrary,
|
||||||
migrations.AddOperationNode,
|
migrations.AddOperationNode,
|
||||||
migrations.AddScriptVersion,
|
migrations.AddScriptVersion,
|
||||||
|
migrations.AddAppStoreSetting,
|
||||||
})
|
})
|
||||||
if err := m.Migrate(); err != nil {
|
if err := m.Migrate(); err != nil {
|
||||||
global.LOG.Error(err)
|
global.LOG.Error(err)
|
||||||
|
|
|
@ -347,3 +347,19 @@ var AddScriptVersion = &gormigrate.Migration{
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var AddAppStoreSetting = &gormigrate.Migration{
|
||||||
|
ID: "20250506-add-appstore-setting",
|
||||||
|
Migrate: func(tx *gorm.DB) error {
|
||||||
|
if err := tx.Create(&model.Setting{Key: "UninstallDeleteImage", Value: "Disable"}).Error; err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := tx.Create(&model.Setting{Key: "UpgradeBackup", Value: "Enable"}).Error; err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := tx.Create(&model.Setting{Key: "UninstallDeleteBackup", Value: "Disable"}).Error; err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
@ -43,5 +43,8 @@ func (s *SettingRouter) InitRouter(Router *gin.RouterGroup) {
|
||||||
settingRouter.POST("/api/config/update", baseApi.UpdateApiConfig)
|
settingRouter.POST("/api/config/update", baseApi.UpdateApiConfig)
|
||||||
|
|
||||||
noAuthRouter.POST("/ssl/reload", baseApi.ReloadSSL)
|
noAuthRouter.POST("/ssl/reload", baseApi.ReloadSSL)
|
||||||
|
|
||||||
|
settingRouter.POST("/apps/store/update", baseApi.UpdateAppstoreConfig)
|
||||||
|
settingRouter.GET("/apps/store/config", baseApi.GetAppstoreConfig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,14 +111,6 @@ export const updateInstallConfig = (req: App.AppConfigUpdate) => {
|
||||||
return http.post(`apps/installed/config/update`, req);
|
return http.post(`apps/installed/config/update`, req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAppStoreConfig = () => {
|
|
||||||
return http.get<App.AppStoreConfig>(`apps/store/config`);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const updateAppStoreConfig = (req: App.AppStoreConfigUpdate) => {
|
|
||||||
return http.post(`apps/store/update`, req);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const syncCutomAppStore = (req: App.AppStoreSync) => {
|
export const syncCutomAppStore = (req: App.AppStoreSync) => {
|
||||||
return http.post(`/custom/app/sync`, req);
|
return http.post(`/custom/app/sync`, req);
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { Base64 } from 'js-base64';
|
||||||
import { ResPage, SearchWithPage, DescriptionUpdate, ReqPage } from '../interface';
|
import { ResPage, SearchWithPage, DescriptionUpdate, ReqPage } from '../interface';
|
||||||
import { Setting } from '../interface/setting';
|
import { Setting } from '../interface/setting';
|
||||||
import { TimeoutEnum } from '@/enums/http-enum';
|
import { TimeoutEnum } from '@/enums/http-enum';
|
||||||
|
import { App } from '../interface/app';
|
||||||
|
|
||||||
// license
|
// license
|
||||||
export const uploadLicense = (oldLicense: string, params: FormData) => {
|
export const uploadLicense = (oldLicense: string, params: FormData) => {
|
||||||
|
@ -121,6 +122,12 @@ export const loadMFA = (param: Setting.MFARequest) => {
|
||||||
export const bindMFA = (param: Setting.MFABind) => {
|
export const bindMFA = (param: Setting.MFABind) => {
|
||||||
return http.post(`/core/settings/mfa/bind`, param);
|
return http.post(`/core/settings/mfa/bind`, param);
|
||||||
};
|
};
|
||||||
|
export const getAppStoreConfig = () => {
|
||||||
|
return http.get<App.AppStoreConfig>(`/core/settings/apps/store/config`);
|
||||||
|
};
|
||||||
|
export const updateAppStoreConfig = (req: App.AppStoreConfigUpdate) => {
|
||||||
|
return http.post(`/core/settings/apps/store/update`, req);
|
||||||
|
};
|
||||||
|
|
||||||
// snapshot
|
// snapshot
|
||||||
export const loadSnapshotInfo = () => {
|
export const loadSnapshotInfo = () => {
|
||||||
|
|
|
@ -47,7 +47,8 @@
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
import { onBeforeUnmount, ref } from 'vue';
|
import { onBeforeUnmount, ref } from 'vue';
|
||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import { getAppStoreConfig, installedOp } from '@/api/modules/app';
|
import { installedOp } from '@/api/modules/app';
|
||||||
|
import { getAppStoreConfig } from '@/api/modules/setting';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import bus from '@/global/bus';
|
import bus from '@/global/bus';
|
||||||
import TaskLog from '@/components/log/task/index.vue';
|
import TaskLog from '@/components/log/task/index.vue';
|
||||||
|
@ -83,10 +84,10 @@ const acceptParams = async (app: App.AppInstallDto) => {
|
||||||
deleteReq.value = {
|
deleteReq.value = {
|
||||||
operate: 'delete',
|
operate: 'delete',
|
||||||
installId: 0,
|
installId: 0,
|
||||||
deleteBackup: config.data.uninstallDeleteBackup === 'True',
|
deleteBackup: config.data.uninstallDeleteBackup === 'Enable',
|
||||||
forceDelete: false,
|
forceDelete: false,
|
||||||
deleteDB: true,
|
deleteDB: true,
|
||||||
deleteImage: config.data.uninstallDeleteImage === 'True',
|
deleteImage: config.data.uninstallDeleteImage === 'Enable',
|
||||||
taskID: uuidv4(),
|
taskID: uuidv4(),
|
||||||
};
|
};
|
||||||
deleteInfo.value = '';
|
deleteInfo.value = '';
|
||||||
|
|
|
@ -85,7 +85,8 @@
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { App } from '@/api/interface/app';
|
import { App } from '@/api/interface/app';
|
||||||
import { getAppStoreConfig, getAppUpdateVersions, ignoreUpgrade, installedOp } from '@/api/modules/app';
|
import { getAppUpdateVersions, ignoreUpgrade, installedOp } from '@/api/modules/app';
|
||||||
|
import { getAppStoreConfig } from '@/api/modules/setting';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { ElMessageBox, FormInstance } from 'element-plus';
|
import { ElMessageBox, FormInstance } from 'element-plus';
|
||||||
import { reactive, ref, onBeforeUnmount } from 'vue';
|
import { reactive, ref, onBeforeUnmount } from 'vue';
|
||||||
|
@ -160,7 +161,7 @@ const initData = async () => {
|
||||||
const config = await getAppStoreConfig();
|
const config = await getAppStoreConfig();
|
||||||
newCompose.value = '';
|
newCompose.value = '';
|
||||||
useNewCompose.value = false;
|
useNewCompose.value = false;
|
||||||
operateReq.backup = config.data.upgradeBackup == 'True';
|
operateReq.backup = config.data.upgradeBackup == 'Enable';
|
||||||
operateReq.pullImage = true;
|
operateReq.pullImage = true;
|
||||||
operateReq.dockerCompose = '';
|
operateReq.dockerCompose = '';
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
<el-form-item :label="$t('app.uninstallDeleteBackup')" prop="uninstallDeleteBackup">
|
<el-form-item :label="$t('app.uninstallDeleteBackup')" prop="uninstallDeleteBackup">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="config.uninstallDeleteBackup"
|
v-model="config.uninstallDeleteBackup"
|
||||||
active-value="True"
|
active-value="Enable"
|
||||||
inactive-value="False"
|
inactive-value="Disable"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@change="updateConfig('UninstallDeleteBackup', config.uninstallDeleteBackup)"
|
@change="updateConfig('UninstallDeleteBackup', config.uninstallDeleteBackup)"
|
||||||
/>
|
/>
|
||||||
|
@ -24,8 +24,8 @@
|
||||||
<el-form-item :label="$t('app.uninstallDeleteImage')" prop="uninstallDeleteImage">
|
<el-form-item :label="$t('app.uninstallDeleteImage')" prop="uninstallDeleteImage">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="config.uninstallDeleteImage"
|
v-model="config.uninstallDeleteImage"
|
||||||
active-value="True"
|
active-value="Enable"
|
||||||
inactive-value="False"
|
inactive-value="Disable"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@change="updateConfig('UninstallDeleteImage', config.uninstallDeleteImage)"
|
@change="updateConfig('UninstallDeleteImage', config.uninstallDeleteImage)"
|
||||||
/>
|
/>
|
||||||
|
@ -33,8 +33,8 @@
|
||||||
<el-form-item :label="$t('app.upgradeBackup')" prop="upgradeBackup">
|
<el-form-item :label="$t('app.upgradeBackup')" prop="upgradeBackup">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="config.upgradeBackup"
|
v-model="config.upgradeBackup"
|
||||||
active-value="True"
|
active-value="Enable"
|
||||||
inactive-value="False"
|
inactive-value="Disable"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@change="updateConfig('UpgradeBackup', config.upgradeBackup)"
|
@change="updateConfig('UpgradeBackup', config.upgradeBackup)"
|
||||||
/>
|
/>
|
||||||
|
@ -48,7 +48,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getAppStoreConfig, getCurrentNodeCustomAppConfig, updateAppStoreConfig } from '@/api/modules/app';
|
import { getCurrentNodeCustomAppConfig } from '@/api/modules/app';
|
||||||
|
import { getAppStoreConfig, updateAppStoreConfig } from '@/api/modules/setting';
|
||||||
import { FormRules } from 'element-plus';
|
import { FormRules } from 'element-plus';
|
||||||
import CustomSetting from '@/xpack/views/appstore/index.vue';
|
import CustomSetting from '@/xpack/views/appstore/index.vue';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
|
|
|
@ -174,7 +174,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getAppStoreConfig, installedOp } from '@/api/modules/app';
|
import { installedOp } from '@/api/modules/app';
|
||||||
|
import { getAgentSettingByKey } from '@/api/modules/setting';
|
||||||
import { changeLauncherStatus, loadAppLauncher, loadAppLauncherOption } from '@/api/modules/dashboard';
|
import { changeLauncherStatus, loadAppLauncher, loadAppLauncherOption } from '@/api/modules/dashboard';
|
||||||
import i18n from '@/lang';
|
import i18n from '@/lang';
|
||||||
import { GlobalStore } from '@/store';
|
import { GlobalStore } from '@/store';
|
||||||
|
@ -254,9 +255,9 @@ const toLink = (link: string) => {
|
||||||
|
|
||||||
const getConfig = async () => {
|
const getConfig = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getAppStoreConfig();
|
const res = await getAgentSettingByKey('SystemIP');
|
||||||
if (res.data.defaultDomain != '') {
|
if (res.data != '') {
|
||||||
defaultLink.value = res.data.defaultDomain;
|
defaultLink.value = res.data;
|
||||||
}
|
}
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue