显示源版本号信息
parent
3803ab045c
commit
c0f78b023f
|
@ -10,7 +10,10 @@
|
||||||
<use xlink:href="#icon-check-true" />
|
<use xlink:href="#icon-check-true" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<span v-if="label != null" :class="$style.label" v-text="label" />
|
<slot v-if="label == null" />
|
||||||
|
<span v-else :class="$style.label">
|
||||||
|
{{ label }}
|
||||||
|
</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -41,7 +41,11 @@ dd
|
||||||
.gap-top(v-for="item in apiSources" :key="item.id")
|
.gap-top(v-for="item in apiSources" :key="item.id")
|
||||||
base-checkbox(
|
base-checkbox(
|
||||||
:id="`setting_api_source_${item.id}`" name="setting_api_source"
|
:id="`setting_api_source_${item.id}`" name="setting_api_source"
|
||||||
need :model-value="appSetting['common.apiSource']" :disabled="item.disabled" :value="item.id" :label="item.label" @update:model-value="updateSetting({'common.apiSource': $event})")
|
need :model-value="appSetting['common.apiSource']" :disabled="item.disabled" :value="item.id" :aria-label="item.label" @update:model-value="updateSetting({'common.apiSource': $event})")
|
||||||
|
span(:class="$style.sourceLabel")
|
||||||
|
| {{ item.name }}
|
||||||
|
span(v-if="item.desc" :class="$style.desc") {{ item.desc }}
|
||||||
|
span(v-if="item.statusLabel" :class="$style.status") {{ item.statusLabel }}
|
||||||
.p.gap-top
|
.p.gap-top
|
||||||
base-btn.btn(min @click="isShowUserApiModal = true") {{ $t('setting__basic_source_user_api_btn') }}
|
base-btn.btn(min @click="isShowUserApiModal = true") {{ $t('setting__basic_source_user_api_btn') }}
|
||||||
|
|
||||||
|
@ -239,12 +243,16 @@ export default {
|
||||||
return [
|
return [
|
||||||
...apiSourceInfo.map(api => ({
|
...apiSourceInfo.map(api => ({
|
||||||
id: api.id,
|
id: api.id,
|
||||||
label: t('setting__basic_source_' + api.id) || api.name,
|
name: api.name,
|
||||||
|
label: api.name,
|
||||||
disabled: api.disabled,
|
disabled: api.disabled,
|
||||||
})),
|
})),
|
||||||
...userApi.list.map(api => ({
|
...userApi.list.map(api => ({
|
||||||
id: api.id,
|
id: api.id,
|
||||||
|
name: api.name,
|
||||||
label: `${api.name}${api.id == appSetting['common.apiSource'] ? `[${getApiStatus()}]` : ''}`,
|
label: `${api.name}${api.id == appSetting['common.apiSource'] ? `[${getApiStatus()}]` : ''}`,
|
||||||
|
desc: [/^\d/.test(api.version) ? `v${api.version}` : api.version, api.author].filter(Boolean).join(', '),
|
||||||
|
statusLabel: api.id == appSetting['common.apiSource'] ? `[${getApiStatus()}]` : '',
|
||||||
status: api.status,
|
status: api.status,
|
||||||
message: api.message,
|
message: api.message,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
@ -485,4 +493,21 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sourceLabel {
|
||||||
|
flex: auto;
|
||||||
|
margin-left: 5px;
|
||||||
|
line-height: 1.5;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
color: var(--color-500);
|
||||||
|
font-size: 12px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue