import config from "@/config"
import http from "@/utils/request"

export default {
	network: {
		wanStatus: {
			url: `${config.API_URL}/api/network/pppoe-status`,
			name: "获取外网状态",
			get: async function () {
				return await http.get(this.url);
			}
		},
		nat: {
			list: {
				url: `${config.API_URL}/api/network/port-forward`,
				name: "获取端口转发列表",
				get: async function (params) {
					return await http.get(this.url,params);
				}
			},
			del:{
				url: `${config.API_URL}/api/network/delete-redirect`,
				name: "删除端口转发",
				post: async function (data) {
					return await http.post(this.url,data);
				}
			},
			redirect:{
				url: `${config.API_URL}/api/network/add-redirect`,
				name: "添加单端口转发",
				post: async function (data) {
					return await http.post(this.url,data);
				}
			},
			rangeRedirect:{
				url: `${config.API_URL}/api/network/add-range-redirect`,
				name: "添加范围端口转发",
				post: async function (data) {
					return await http.post(this.url,data);
				}
			}
		},
	},
	home:{
		status:	{
			url: `${config.API_URL}/api/system/status`,
			name: "获取系统状态",
			get: async function(){
				return await http.get(this.url);
			}
		},
		gatewayPrefix: {
			url: `${config.API_URL}/api/system/gateway-prefix`,
			name: "获取网关前缀",
			get: async function(){
				return await http.get(this.url);
			}
		}
	},
	device: {
		traffic: {
			list: {
				url: `${config.API_URL}/api/device/traffic/list`,
				name: "获取每日流量列表",
				get: async function (params) {
					return await http.get(this.url,params);
				}
			}
		}
	}
}
