Commit 4636fea5 authored by combineli's avatar combineli
Browse files

配置中心

parent b7b928c5
Showing with 1134 additions and 0 deletions
+1134 -0
<template>
<section>
<let-table :data="configList" :empty-msg="$t('common.nodata')">
<let-table-column :title="$t('cache.config.remark')" prop="remark"></let-table-column>
<let-table-column :title="$t('cache.config.path')" prop="path"></let-table-column>
<let-table-column :title="$t('cache.config.item')" prop="item"></let-table-column>
<let-table-column :title="$t('cache.config.value')" prop="config_value"></let-table-column>
</let-table>
</section>
</template>
<script>
export default {
props: {
moduleName: {type: String, required: true},
serverName: {type: String, required: true},
nodeName: {type: String, required: true},
},
data () {
return {
configList: []
}
},
methods: {
async getServerConfig () {
try {
let option = {
moduleName: this.moduleName,
serverName: this.serverName,
nodeName: this.nodeName,
};
let configItemList = await this.$ajax.getJSON('/server/api/cache/getServerConfig', option);
this.configList = configItemList;
} catch (err) {
console.error(err)
this.$tip.error(`${this.$t('common.error')}: ${err.message || err.err_msg}`);
}
}
},
created () {
this.getServerConfig();
}
}
</script>
<style>
</style>
<template>
<section>
<let-table :data="configList" :title="$t('cache.config.tableTitle')" :empty-msg="$t('common.nodata')">
<let-table-column :title="$t('cache.config.remark')" prop="remark"></let-table-column>
<let-table-column :title="$t('cache.config.path')" prop="path"></let-table-column>
<let-table-column :title="$t('cache.config.item')" prop="item"></let-table-column>
<let-table-column :title="$t('cache.config.config_value')" prop="config_value"></let-table-column>
</let-table>
</section>
</template>
<script>
export default {
data () {
return {
configList: []
}
},
created () {
}
}
</script>
<style>
</style>
<template>
<section class="container">
abc
</section>
</template>
<script>
export default {
}
</script>
<style>
</style>
<template>
<section class="page_operation">
<let-button theme="primary" size="small">{{$t('cache.config.add')}}</let-button>
<let-table :data="list" :title="$t('cache.config.tableTitle')" :empty-msg="$t('common.nodata')">
<let-table-column title="ID" prop="id"></let-table-column>
<let-table-column title="备注" prop="remark"></let-table-column>
<let-table-column title="路径" prop="path"></let-table-column>
<let-table-column title="配置项" prop="AnalyseLog"></let-table-column>
<let-table-column title="加载生效" prop="reload"></let-table-column>
<let-table-column title="版本" prop="period"></let-table-column>
<let-table-column title="操作" prop="id">
<template slot-scope="scope">
<let-table-operation >{{$t('operate.update')}}</let-table-operation>
<let-table-operation class="danger" >{{$t('operate.delete')}}</let-table-operation>
</template>
</let-table-column>
</let-table>
</section>
</template>
<script>
export default {
data () {
return {
list: []
}
},
async created () {
try {
let {configItemList} = await this.$ajax.getJSON('/server/api/cache/getConfig');
this.list = configItemList;
} catch (err) {
console.error(err)
this.$tip.error(`${this.$t('common.error')}: ${err.message || err.err_msg}`);
}
}
}
</script>
<style>
</style>
<template>
<section class="">
<!-- 服务列表 -->
<let-table v-if="serverList" :data="serverList" :title="$t('serverList.title.serverList')" :empty-msg="$t('common.nodata')" ref="serverListLoading">
<let-table-column :title="$t('serverList.table.th.service')" prop="server_name"></let-table-column>
<let-table-column :title="$t('serverList.table.th.ip')" prop="node_name" width="140px"></let-table-column>
<let-table-column :title="$t('serverList.table.th.ip')" width="140px">
<template slot-scope="{row:{cache_server_type}}">
<span v-if="cache_server_type===0">{{$t('cache.mainEngine')}}</span>
<span v-else-if="cache_server_type===1">{{$t('cache.standByEngine')}}</span>
<span v-else-if="cache_server_type===2">{{$t('cache.mirror')}}</span>
</template>
</let-table-column>
<let-table-column :title="$t('serverList.table.th.configStatus')" width="90px">
<template slot-scope="scope">
<span :class="scope.row.setting_state === 'active' ? 'status-active' : 'status-off'"></span>
</template>
</let-table-column>
<let-table-column :title="$t('serverList.table.th.currStatus')" width="65px">
<template slot-scope="scope">
<span :class="scope.row.present_state === 'active' ? 'status-active' : scope.row.present_state === 'activating' ? 'status-activating' : 'status-off'"></span>
</template>
</let-table-column>
<let-table-column :title="$t('serverList.table.th.time')">
<template slot-scope="scope">
<span style="word-break: break-word">{{handleNoPublishedTime(scope.row.patch_time)}}</span>
</template>
</let-table-column>
<let-table-column :title="$t('operate.operates')" width="260px">
<template slot-scope="scope">
<let-table-operation >{{$t('operate.update')}}</let-table-operation>
<let-table-operation >{{$t('operate.view')}}</let-table-operation>
</template>
</let-table-column>
</let-table>
<let-table :data="configList" :title="$t('cache.config.tableTitle')" :empty-msg="$t('common.nodata')">
<let-table-column :title="$t('cache.config.remark')" prop="remark"></let-table-column>
<let-table-column :title="$t('cache.config.path')" prop="path"></let-table-column>
<let-table-column :title="$t('cache.config.item')" prop="item"></let-table-column>
<let-table-column :title="$t('cache.config.config_value')" prop="config_value"></let-table-column>
<let-table-column :title="$t('cache.config.modify_value')" prop="period">
<template slot-scope="{row}">
<let-input size="small"></let-input>
</template>
</let-table-column>
</let-table>
<!-- 查看服务列表配置-->
<let-modal
v-model="serverCacheVisible"
:footShow="false"
:closeOnClickBackdrop="true"
></let-modal>
</section>
</template>
<script>
export default {
data () {
return {
moduleName: this.$route.params.treeid,
configList: [],
serverList: [],
serverCacheVisible: false
}
},
methods: {
async getModuleConfig () {
try {
let configItemList = await this.$ajax.getJSON('/server/api/cache/getModuleConfig', {moduleName: this.moduleName});
this.configList = configItemList;
} catch (err) {
console.error(err)
this.$tip.error(`${this.$t('common.error')}: ${err.message || err.err_msg}`);
}
},
// 获取服务列表
async getServerList() {
try {
let data = await this.$ajax.getJSON('/server/api/get_cache_server_list', {tree_node_id: this.moduleName});
this.serverList = data;
} catch (err) {
console.error(err)
this.$tip.error(`${this.$t('common.error')}: ${err.message || err.err_msg}`);
}
},
// 处理未发布时间显示
handleNoPublishedTime(timeStr, noPubTip = this.$t('pub.dlg.unpublished')) {
if (timeStr === '0000:00:00 00:00:00') {
return noPubTip;
}
return timeStr;
},
},
created () {
this.getModuleConfig();
this.getServerList();
}
}
</script>
<style>
</style>
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment