Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync #5

Merged
merged 6 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.npm
~/.cache
~/go/pkg/mod
key: ${{ runner.os }}-1panel-build-${{ github.sha }}
restore-keys: ${{ runner.os }}-1panel-build-
- name: Setup Node
uses: actions/setup-node@v4
with:
Expand All @@ -25,6 +34,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: 'false'
- name: Build Release
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
1 change: 1 addition & 0 deletions backend/constant/errs.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var (
ErrXpackNotFound = "ErrXpackNotFound"
ErrXpackNotActive = "ErrXpackNotActive"
ErrXpackLost = "ErrXpackLost"
ErrXpackTimeout = "ErrXpackTimeout"
ErrXpackOutOfDate = "ErrXpackOutOfDate"
)

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/app-status/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ const isDB = () => {
return key.value === 'mysql' || key.value === 'mariadb' || key.value === 'postgresql';
};

const onCheck = async () => {
await CheckAppInstalled(key.value, name.value)
const onCheck = async (key: any, name: any) => {
await CheckAppInstalled(key, name)
.then((res) => {
data.value = res.data;
em('isExist', res.data);
Expand Down Expand Up @@ -206,7 +206,7 @@ const onOperate = async (operation: string) => {
.then(() => {
em('update:loading', false);
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
onCheck();
onCheck(key.value, name.value);
em('after');
})
.catch(() => {
Expand Down Expand Up @@ -234,7 +234,7 @@ const getTitle = (key: string) => {
onMounted(() => {
key.value = props.appKey;
name.value = props.appName;
onCheck();
onCheck(key.value, name.value);
});

defineExpose({
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,8 @@ const message = {
Disable: 'Disabled',
lostHelper:
'The license has reached the maximum number of retry attempts. Please manually click the sync button to ensure the professional version features are functioning properly.',
disableHelper:
'License synchronization verification failed. Please manually click the sync button to ensure that the professional version features are functioning properly.',
quickUpdate: 'Quick Update',
import: 'Import',
power: 'Authorize',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@ const message = {
Enable: '已啟用',
Disable: '未啟用',
lostHelper: '許可證已達到最大重試次數,請手動點擊同步按鈕,以確保專業版功能正常使用。',
disableHelper: '許可證同步驗證失敗,請手動點擊同步按鈕,以確保專業版功能正常使用。',
quickUpdate: '快速更新',
import: '導入',
power: '授 權',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,7 @@ const message = {
Enable: '已激活',
Disable: '未激活',
lostHelper: '许可证已达到最大重试次数,请手动点击同步按钮,以确保专业版功能正常使用。',
disableHelper: '许可证同步验证失败,请手动点击同步按钮,以确保专业版功能正常使用。',
quickUpdate: '快速更新',
import: '导入',
power: '授 权',
Expand Down
17 changes: 14 additions & 3 deletions frontend/src/styles/element-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ html.dark {
}

.el-overlay {
background-color: #2E313D90;
background-color: rgb(46 49 61 / 80%);
}

.el-tag.el-tag--primary {
Expand All @@ -159,7 +159,7 @@ html.dark {
}

.el-loading-mask {
background-color:var(--panel-main-bg-color-10);
background-color: #24263375;
}

.el-input {
Expand Down Expand Up @@ -244,10 +244,13 @@ html.dark {
}

.el-button--primary:active {
--el-button-hover-text-color: var(--panel-text-color-white);
--el-button-hover-text-color: var(--panel-main-bg-color-7);
--el-button-active-bg-color: var(--el-color-primary-light-3);
--el-button-active-border-color: var(--el-color-primary-light-3);
}
.el-button--primary.is-plain:active {
color: var(--panel-main-bg-color-10);
}

.el-button:focus-visible {
outline: none;
Expand Down Expand Up @@ -443,4 +446,12 @@ html.dark {
color: #ffffff;
background-color: var(--panel-main-bg-color-10) !important;
}

.el-checkbox__input.is-checked .el-checkbox__inner::after {
border-color: var(--panel-main-bg-color-10);
}

.el-checkbox__input.is-indeterminate .el-checkbox__inner::before {
background-color: var(--panel-main-bg-color-10);
}
}
4 changes: 1 addition & 3 deletions frontend/src/views/database/mysql/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,13 @@ const onSetting = async () => {
};

const changeDatabase = async () => {
if (currentDB.value.from === 'local') {
appStatusRef.value.onCheck();
}
for (const item of dbOptionsLocal.value) {
if (item.database == currentDBName.value) {
currentDB.value = item;
appKey.value = item.type;
appName.value = item.database;
search();
appStatusRef.value?.onCheck(appKey.value, appName.value);
return;
}
}
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/views/database/postgresql/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,13 @@ const onSetting = async () => {
};

const changeDatabase = async () => {
if (currentDB.value.from === 'local') {
appStatusRef.value.onCheck();
}
for (const item of dbOptionsLocal.value) {
if (item.database == currentDBName.value) {
currentDB.value = item;
appKey.value = item.type;
appName.value = item.database;
search();
appStatusRef.value?.onCheck(appKey.value, appName.value);
return;
}
}
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/views/database/redis/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,12 @@ const goRouter = async (target: string) => {
};

const changeDatabase = async () => {
if (currentDB.value.from === 'local') {
appStatusRef.value.onCheck();
}
for (const item of dbOptionsLocal.value) {
if (item.database == currentDBName.value) {
currentDB.value = item;
appKey.value = item.type;
appName.value = item.database;
appStatusRef.value?.onCheck(appKey.value, appName.value);
reOpenTerminal();
return;
}
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/views/setting/license/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@
</el-descriptions-item>
<el-descriptions-item :label="$t('license.productStatus')">
<div v-if="license.status">
<el-tooltip
v-if="license.status.indexOf('Lost') !== -1"
:content="license.message"
placement="top"
>
<el-tooltip v-if="license.message" :content="license.message" placement="top">
<el-tag type="info">
{{ $t('license.' + license.status) }}
</el-tag>
Expand All @@ -57,7 +53,7 @@
<span v-else>-</span>
</el-descriptions-item>
<el-descriptions-item class="descriptions" :label="$t('commons.table.message')">
{{ showSync() ? $t('license.lostHelper') : '' }}
{{ showSync() ? loadInfo() : '' }}
</el-descriptions-item>
</el-descriptions>
</div>
Expand Down Expand Up @@ -146,6 +142,10 @@ const toHalo = () => {
window.open('https://www.lxware.cn/1panel' + '', '_blank', 'noopener,noreferrer');
};

const loadInfo = () => {
return license.status === 'Lost' ? i18n.global.t('license.lostHelper') : i18n.global.t('license.disableHelper');
};

const onSync = async () => {
loading.value = true;
await syncLicense()
Expand Down Expand Up @@ -250,7 +250,7 @@ onMounted(() => {
margin-right: 10px;
line-height: 18px;
&:hover {
background-color: rgba(0, 94, 235, 0.03);
background-color: var(--panel-main-bg-color-8);
}
}
:deep(.license-card .el-card) {
Expand Down
Loading