feat(admin): 增加崩溃报告联调信息展示
This commit is contained in:
@@ -27,6 +27,7 @@ const auditLogs = ref<any[]>([]);
|
||||
const currentAppId = ref("");
|
||||
const createdLicenseKey = ref("");
|
||||
const generatedClientConfig = ref("");
|
||||
const generatedCrashTestInfo = ref("");
|
||||
const runtime = reactive<any>({});
|
||||
|
||||
const appForm = reactive({ app_id: "", app_name: "" });
|
||||
@@ -526,6 +527,9 @@ async function generateClientConfig() {
|
||||
});
|
||||
generatedClientConfig.value =
|
||||
result.json_text || JSON.stringify(result.config || {}, null, 2);
|
||||
generatedCrashTestInfo.value =
|
||||
result.crash_test_text ||
|
||||
JSON.stringify(result.crash_test_config || {}, null, 2);
|
||||
ElMessage.success("客户端配置已生成");
|
||||
} catch (error) {
|
||||
handleError("生成客户端配置失败", error);
|
||||
@@ -537,6 +541,11 @@ async function copyGeneratedConfig() {
|
||||
ElMessage.success("客户端配置已复制");
|
||||
}
|
||||
|
||||
async function copyGeneratedCrashTestInfo() {
|
||||
await copyText(generatedCrashTestInfo.value);
|
||||
ElMessage.success("崩溃报告联调信息已复制");
|
||||
}
|
||||
|
||||
async function loadDevices() {
|
||||
if (!currentAppId.value) return;
|
||||
const data = await adminRequest<any>(
|
||||
@@ -917,7 +926,11 @@ onMounted(loadAll);
|
||||
<el-form-item label="License"><el-input v-model="configForm.license_key" placeholder="可从上方 License 列表填入;也可留空让客户端首次启动时输入" /></el-form-item>
|
||||
</el-form>
|
||||
<div class="action-row"><el-button type="primary" @click="generateClientConfig">生成配套配置</el-button><el-button :disabled="!generatedClientConfig" @click="copyGeneratedConfig">复制配置</el-button></div>
|
||||
<div class="config-section-title">客户端 app_config.json</div>
|
||||
<pre class="code-block">{{ generatedClientConfig || "尚未生成客户端配置" }}</pre>
|
||||
<el-alert class="mt-sm" type="warning" :closable="false" show-icon title="下面的崩溃报告联调信息只给管理员或测试人员查看,不会复制进客户端 app_config.json,也不要放进客户端配置文件。" />
|
||||
<div class="action-row mt-sm"><span class="config-section-title">崩溃报告接口联调信息</span><el-button :disabled="!generatedCrashTestInfo" @click="copyGeneratedCrashTestInfo">复制联调信息</el-button></div>
|
||||
<pre class="code-block">{{ generatedCrashTestInfo || "生成配套配置后显示崩溃报告接口、Token 和大小限制" }}</pre>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
|
||||
@@ -1144,6 +1157,19 @@ onMounted(loadAll);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.config-section-title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 32px;
|
||||
margin: 12px 0 6px;
|
||||
color: var(--el-text-color-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.action-row .config-section-title {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.code-block {
|
||||
min-height: 220px;
|
||||
max-height: 440px;
|
||||
|
||||
Reference in New Issue
Block a user