Spaces:
Build error
Build error
Commit 路
0489775
1
Parent(s): 62ea347
Proconty admin v1.0
Browse files- MOP-CRQ--NAME.xlsx +0 -0
- MOP-CRQ.xlsx +0 -0
- MOP-CRQ_Prove.xlsx +0 -0
- MopsPreaprobadas.xlsx +0 -0
- __pycache__/appIps.cpython-310.pyc +0 -0
- __pycache__/appMops.cpython-310.pyc +0 -0
- app.py +28 -0
- appIps.py +181 -0
- appMops.py +851 -0
- proconty.png +0 -0
- prueba.txt +0 -0
- requirements.txt +4 -0
MOP-CRQ--NAME.xlsx
ADDED
|
Binary file (32.9 kB). View file
|
|
|
MOP-CRQ.xlsx
ADDED
|
Binary file (41.3 kB). View file
|
|
|
MOP-CRQ_Prove.xlsx
ADDED
|
Binary file (41.5 kB). View file
|
|
|
MopsPreaprobadas.xlsx
ADDED
|
Binary file (70.8 kB). View file
|
|
|
__pycache__/appIps.cpython-310.pyc
ADDED
|
Binary file (6.63 kB). View file
|
|
|
__pycache__/appMops.cpython-310.pyc
ADDED
|
Binary file (21.6 kB). View file
|
|
|
app.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from appMops import mainMops
|
| 3 |
+
from appIps import mainJunos
|
| 4 |
+
|
| 5 |
+
st.sidebar.image('proconty.png')
|
| 6 |
+
#st.sidebar.title("Pasos a Producci贸n")
|
| 7 |
+
menuPrincipal = st.sidebar.radio('Menu Principal', ['Informaci贸n','1. Junos', '2. Mops'])
|
| 8 |
+
|
| 9 |
+
if menuPrincipal == 'Informaci贸n':
|
| 10 |
+
st.title("Pasos a Producci贸n")
|
| 11 |
+
st.write("""Seleccionar en el Menu Principal, una de las siguientes opciones:""")
|
| 12 |
+
st.subheader(' 1. Junos ')
|
| 13 |
+
st.write('(Permite generar archivo .csv para cargar las IPs maliciosas en el FW Atlas, as铆 como la comparaci贸n de nuevas IPs con la base de datos)')
|
| 14 |
+
st.subheader('2. Mops ')
|
| 15 |
+
st.write('(Permite generar MOPs gen茅ricos para la gesti贸n por parte de N2 o Proveedores)')
|
| 16 |
+
|
| 17 |
+
elif menuPrincipal == '1. Junos':
|
| 18 |
+
#st.sidebar.text("JUNOS")
|
| 19 |
+
st.title('[Archivo CSV para IPs Maliciosas]')
|
| 20 |
+
mainJunos()
|
| 21 |
+
|
| 22 |
+
elif menuPrincipal == '2. Mops':
|
| 23 |
+
#st.sidebar.text("MOPS")
|
| 24 |
+
st.title('[MOPs Gesti贸n - Preaprobadas]')
|
| 25 |
+
mainMops()
|
| 26 |
+
|
| 27 |
+
st.sidebar.write('All rights reserved. Developed by **[David Minango]**')
|
| 28 |
+
|
appIps.py
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### BIBLIOTECAS ####
|
| 2 |
+
import streamlit as st
|
| 3 |
+
import docx2txt
|
| 4 |
+
#import pdfplumber
|
| 5 |
+
from datetime import datetime, date
|
| 6 |
+
|
| 7 |
+
#UTILS
|
| 8 |
+
import base64
|
| 9 |
+
import time
|
| 10 |
+
timestr = time.strftime("%Y%m%d")
|
| 11 |
+
import pandas as pd
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class FileDownloader(object):
|
| 16 |
+
def __init__(self, data,filename='JUNOS_CRQ',file_ext='txt'):
|
| 17 |
+
super(FileDownloader, self).__init__()
|
| 18 |
+
self.data = data
|
| 19 |
+
self.filename = filename
|
| 20 |
+
self.file_ext = file_ext
|
| 21 |
+
|
| 22 |
+
def download(self):
|
| 23 |
+
b64 = base64.b64encode(self.data.encode()).decode()
|
| 24 |
+
new_filename = "{}_{}_.{}".format(self.filename,timestr,self.file_ext)
|
| 25 |
+
st.markdown("#### Download File ###")
|
| 26 |
+
href = f'<a href="data:file/{self.file_ext};base64,{b64}" download="{new_filename}">Click Here!!</a>'
|
| 27 |
+
st.markdown(href,unsafe_allow_html=True)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def mainJunos():
|
| 32 |
+
#st.title("Pasos a Producci贸n")
|
| 33 |
+
|
| 34 |
+
### INFORMACION LADO IZQUIERDO ###
|
| 35 |
+
#st.sidebar.image('proconty.jpg', width=300)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
### ESTRUCTURA PRINCIPAL ###
|
| 39 |
+
st.title('IPs MALICIOSAS - JUNOS')
|
| 40 |
+
|
| 41 |
+
menu = ['Archivo CSV - JUNOS', 'Comparaci贸n de IPs - JUNOS']
|
| 42 |
+
choice = st.sidebar.selectbox('Menu - JUNOS', menu)
|
| 43 |
+
|
| 44 |
+
#st.sidebar.markdown('[MENU PRINCIPAL](https://proconty-pap.herokuapp.com/)')
|
| 45 |
+
|
| 46 |
+
if choice == 'Archivo CSV - JUNOS':
|
| 47 |
+
st.write('Indicaciones de uso:')
|
| 48 |
+
st.write("Cargar el archivo (.txt), ingresar el n煤mero de CRQ y verificar que la fecha este correcta.")
|
| 49 |
+
st.write("Al presionar el boton GENERAR se creara un archivo con el formato para JUNOS.")
|
| 50 |
+
st.write("En la opcion Menu seleccionar el tipo de archivo que desea descargar (.txt o .csv)")
|
| 51 |
+
st.warning("Al abrirse la opcion de descargar colocar el n煤mero de CRQ")
|
| 52 |
+
|
| 53 |
+
### CARGAR Y VISUALIZAR ARCHIVO ###
|
| 54 |
+
docx_file = st.file_uploader('Cargar archivo .txt', type=['pdf','docx','txt'])
|
| 55 |
+
if docx_file is not None:
|
| 56 |
+
|
| 57 |
+
if docx_file.type == "text/plain":
|
| 58 |
+
# Read as string (decode bytes to string)
|
| 59 |
+
raw_text = str(docx_file.read(),"utf-8")
|
| 60 |
+
st.text(raw_text)
|
| 61 |
+
else:
|
| 62 |
+
raw_text = docx2txt.process(docx_file)
|
| 63 |
+
st.write(raw_text)
|
| 64 |
+
|
| 65 |
+
### INGRESAR CRQ Y FECHA ###
|
| 66 |
+
crq_num = st.text_input('Ingrese el n煤mero de la CRQ: ')
|
| 67 |
+
st.write("CRQ_"+crq_num)
|
| 68 |
+
day = date.today().strftime("%A")
|
| 69 |
+
day = day[0:3]
|
| 70 |
+
fecha = datetime.now().strftime("%d-%b-%Y %H:%M:%S")
|
| 71 |
+
st.write(day+', '+fecha)
|
| 72 |
+
|
| 73 |
+
##### GENERAR ARCHIVO TXT #####
|
| 74 |
+
def Convert(string):
|
| 75 |
+
li = list(string.split('\n'))
|
| 76 |
+
return li
|
| 77 |
+
|
| 78 |
+
if st.button('GENERAR'):
|
| 79 |
+
bandera = Convert(raw_text)
|
| 80 |
+
documento = 'prueba.txt'
|
| 81 |
+
with open(documento, 'w') as f:
|
| 82 |
+
f.write("#Rows which start with '#' are treated as a commented row \n")
|
| 83 |
+
f.write("# \n")
|
| 84 |
+
f.write('\n')
|
| 85 |
+
fechaCreacion = str('#Created time:,'+'"{}'.format(day)+", {}".format(fecha)+'"\n')
|
| 86 |
+
f.write(''.join(fechaCreacion))
|
| 87 |
+
f.write('#Version -11.4 \n')
|
| 88 |
+
f.write('\n')
|
| 89 |
+
f.write("# \n")
|
| 90 |
+
f.write("# \n")
|
| 91 |
+
f.write("# \n")
|
| 92 |
+
f.write('\n')
|
| 93 |
+
f.write('#Start - Please do not modify or change this line \n')
|
| 94 |
+
f.write('\n')
|
| 95 |
+
f.write('#Section Start - Network Address - Please do not modify or change this line \n')
|
| 96 |
+
f.write('#Explanation for the Column Names \n')
|
| 97 |
+
f.write('# \n')
|
| 98 |
+
f.write('#Name - Name of the Address \n')
|
| 99 |
+
f.write('#Domain - Domains for the Address to be created \n')
|
| 100 |
+
f.write('#Description - Description for Address \n')
|
| 101 |
+
f.write('#Type - Type of the Address. Values can be Network, IPRange or Host \n')
|
| 102 |
+
f.write("#IP Address - Ip Address(IPv4/IPv6) of the individual host. This field with 'Type' as Host or Network. It can be wildcard ip as well \n")
|
| 103 |
+
f.write('#Subnet Mask/Prefix - Subnet mask/prefix provided for the IP Address((IPv4/IPv6)) provided in previous column when Type is selected as Network \n')
|
| 104 |
+
f.write('#IP Range Min - Minimum IP(IPv4) Range in case range is provided. This should be provided when Type is Range \n')
|
| 105 |
+
f.write('#IP Range Max - Maximum IP(IPv4) Range in case range is provided. This should be provided when Type is Range \n')
|
| 106 |
+
f.write('#Host - Host Name of the host address. This should be provided when Type is Host. This field will be ignored if IP Address is provided \n')
|
| 107 |
+
f.write('#Wildcard Mask - Wildcard mask IP address (IPV4/IPV6) \n')
|
| 108 |
+
f.write('#Address Groups - Provide the Address Groups for the Address to be created. \n')
|
| 109 |
+
f.write('# If Address Group is not present it would be created. \n')
|
| 110 |
+
f.write("# More than one Address Groups should be seperated by '|' \n")
|
| 111 |
+
f.write('#Metadata - Add metadata with Logical Operatos to your Address. \n')
|
| 112 |
+
f.write('#DnsAddressType - Type of the DNS Address. Values can be ipv4-only or ipv6only \n')
|
| 113 |
+
f.write('# \n')
|
| 114 |
+
f.write('#Name, Description, Type, IP Address, Subnet Mask/Prefix, IP Range Min, IP Range Max, Host, Wildcard Mask, Address Groups, Metadata, DnsAddressType, Domain \n')
|
| 115 |
+
ipsMali = []
|
| 116 |
+
count = 0
|
| 117 |
+
for line in bandera:
|
| 118 |
+
if count != len(bandera):
|
| 119 |
+
ipsMali = str("Host_{}".format(line.strip())+',"CRQ{}",'.format(crq_num)+'Host,'+'{}'.format(line.strip())+',,,,,,,,,,'+'Global/FW_ATLAS')
|
| 120 |
+
f.write(''.join(ipsMali))
|
| 121 |
+
f.write('\n')
|
| 122 |
+
print(ipsMali)
|
| 123 |
+
else:
|
| 124 |
+
break
|
| 125 |
+
count =+ 1
|
| 126 |
+
|
| 127 |
+
f.write('\n')
|
| 128 |
+
f.write('#Section End - Network Address - Please do not modify or change this line \n')
|
| 129 |
+
f.write('#End - Please do not modify or change this line')
|
| 130 |
+
|
| 131 |
+
#### DESCARGAR #####
|
| 132 |
+
menu = ['Text', 'CSV']
|
| 133 |
+
choice = st.selectbox('Menu', menu)
|
| 134 |
+
|
| 135 |
+
if choice == 'Text':
|
| 136 |
+
if st.button('Guardar TXT'):
|
| 137 |
+
with open('prueba.txt', 'r') as file:
|
| 138 |
+
dataIPS = file.read()
|
| 139 |
+
download = FileDownloader(dataIPS).download()
|
| 140 |
+
|
| 141 |
+
if choice == 'CSV':
|
| 142 |
+
if st.button('Guardar CSV'):
|
| 143 |
+
with open('prueba.txt', 'r') as file:
|
| 144 |
+
dataIPScsv = file.read()
|
| 145 |
+
download = FileDownloader(dataIPScsv, file_ext='csv').download()
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
#st.write('All rights reserved. Developed by David Minango')
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
if choice == 'Comparaci贸n de IPs - JUNOS':
|
| 153 |
+
st.write('Indicaciones de uso:')
|
| 154 |
+
st.write("Cargar los dos archivos en (.txt), el archivo 1 debe ser la base de datos de JUNOS, el archivo 2 debe ser el enviado por Ingenieria.")
|
| 155 |
+
st.write("Al presionar el boton COMPARAR se generara una tabla con las ips no encontradas en la base de datos de JUNOS.")
|
| 156 |
+
|
| 157 |
+
### CARGAR Y VISUALIZAR ARCHIVO BASE DE DATOS###
|
| 158 |
+
upload_baseDatos = st.file_uploader('Base de Datos')
|
| 159 |
+
upload_ingenieria = st.file_uploader('Ingenieria')
|
| 160 |
+
if upload_baseDatos:
|
| 161 |
+
df1 = pd.read_table(upload_baseDatos, delimiter=" ", header=None)
|
| 162 |
+
df1 = pd.DataFrame(df1.values, columns=['BaseDatos'])
|
| 163 |
+
#st.write(df1)
|
| 164 |
+
if upload_ingenieria:
|
| 165 |
+
df2 = pd.read_table(upload_ingenieria, header=None)
|
| 166 |
+
df2 = pd.DataFrame(df2.values, columns=['BaseIngenieria'])
|
| 167 |
+
df2 = df2.drop_duplicates()
|
| 168 |
+
|
| 169 |
+
unir = st.checkbox('Unir archivos')
|
| 170 |
+
if unir:
|
| 171 |
+
unionDataFrames = pd.concat([df1,df2], axis=1)
|
| 172 |
+
st.write(unionDataFrames)
|
| 173 |
+
|
| 174 |
+
if st.button('Comparar'):
|
| 175 |
+
df_1notin2 = df2[~(df2['BaseIngenieria'].isin(df1['BaseDatos']) )].reset_index(drop=True)
|
| 176 |
+
st.write(df_1notin2)
|
| 177 |
+
|
| 178 |
+
#st.write('All rights reserved. Developed by David Minango')
|
| 179 |
+
|
| 180 |
+
|
| 181 |
+
|
appMops.py
ADDED
|
@@ -0,0 +1,851 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Bibliotecas
|
| 2 |
+
import streamlit as st
|
| 3 |
+
import openpyxl
|
| 4 |
+
|
| 5 |
+
################################################################################################################
|
| 6 |
+
def mopMantenimientos():
|
| 7 |
+
|
| 8 |
+
workbook = openpyxl.load_workbook('MOP-CRQ.xlsx')
|
| 9 |
+
sheets = workbook.sheetnames
|
| 10 |
+
sheet = workbook.active
|
| 11 |
+
|
| 12 |
+
nombreCRQ = st.text_input('Nombre del Mantenimiento:')
|
| 13 |
+
sheet['B9'] = nombreCRQ
|
| 14 |
+
sheet['C11'] = nombreCRQ
|
| 15 |
+
CRQ = nombreCRQ[4:9]
|
| 16 |
+
numCRQ = st.text_input('Numero de CRQ:', value=CRQ)
|
| 17 |
+
if numCRQ.isdigit() == True:
|
| 18 |
+
sheet['D10'] = numCRQ
|
| 19 |
+
else:
|
| 20 |
+
st.warning('Ingrese un numero valido')
|
| 21 |
+
|
| 22 |
+
impacto = st.text_input('Impacto / Alcance', value='Ninguno')
|
| 23 |
+
sheet['C13'] = impacto
|
| 24 |
+
|
| 25 |
+
n2Responsable = st.selectbox('N2', ['Carlos Castillo','Cristhian Vallejo', 'Elizabeth Pe帽aloza', 'Fabricio Oleas','Luis Chumo', 'Washington Chuqui', 'Xavier Ortiz'])
|
| 26 |
+
sheet['E18'] = n2Responsable
|
| 27 |
+
if n2Responsable == 'Carlos Castillo':
|
| 28 |
+
sheet['H18'] = 'carlos.castillocuenca@telefonica.com'
|
| 29 |
+
sheet['G18'] = '0999586043'
|
| 30 |
+
elif n2Responsable == 'Cristhian Vallejo':
|
| 31 |
+
sheet['H18'] = 'cristhian.vallejovillalva@telefonica.com'
|
| 32 |
+
sheet['G18'] = '0995386632'
|
| 33 |
+
elif n2Responsable == 'Elizabeth Pe帽aloza':
|
| 34 |
+
sheet['H18'] = 'julia.penaloza@telefonica.com'
|
| 35 |
+
sheet['G18'] = '0998124791'
|
| 36 |
+
elif n2Responsable == 'Fabricio Oleas':
|
| 37 |
+
sheet['H18'] = 'luis.oleas@telefonica.com'
|
| 38 |
+
sheet['G18'] = '0987537565'
|
| 39 |
+
elif n2Responsable == 'Luis Chumo':
|
| 40 |
+
sheet['H18'] = 'luis.chumo@telefonica.com'
|
| 41 |
+
sheet['G18'] = '0999281697'
|
| 42 |
+
elif n2Responsable == 'Washington Chuqui':
|
| 43 |
+
sheet['H18'] = 'washington.chuqui@telefonica.com'
|
| 44 |
+
sheet['G18'] = '0995652744'
|
| 45 |
+
elif n2Responsable == 'Xavier Ortiz':
|
| 46 |
+
sheet['H18'] = 'xavier.ortiz@telefonica.com'
|
| 47 |
+
sheet['G18'] = '0998542986'
|
| 48 |
+
|
| 49 |
+
menu = ['MOP DIA', 'MOP NOCHE']
|
| 50 |
+
choice = st.selectbox('Menu', menu)
|
| 51 |
+
|
| 52 |
+
if choice == 'MOP NOCHE':
|
| 53 |
+
st.title('MOP NOCHE')
|
| 54 |
+
st.subheader('Actividades')
|
| 55 |
+
with st.expander('1'):
|
| 56 |
+
act1 = st.text_input('Actividad 1', value='N1 se contacta con el NOC para abrir la ventana de mantenimiento')
|
| 57 |
+
sheet['B23'] = act1
|
| 58 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 59 |
+
with col1:
|
| 60 |
+
horaInicioAct1 = st.text_input('Hora I - 1', value='22:00')
|
| 61 |
+
sheet['D23'] = horaInicioAct1
|
| 62 |
+
with col2:
|
| 63 |
+
horaFinAct1 = st.text_input('Hora F - 1', value='22:30')
|
| 64 |
+
sheet['E23'] = horaFinAct1
|
| 65 |
+
with col3:
|
| 66 |
+
responsableAct1 = st.text_input('Responsable 1', value='N1/NOC')
|
| 67 |
+
sheet['F23'] = responsableAct1
|
| 68 |
+
with col4:
|
| 69 |
+
afectacionAct1 = st.selectbox('Afectacion 1', ['N','Y'] )
|
| 70 |
+
sheet['G23'] = afectacionAct1
|
| 71 |
+
|
| 72 |
+
with st.expander('2'):
|
| 73 |
+
act2 = st.text_input('Actividad 2', value='N1 se contacta con N2 para el inicio de la ventana')
|
| 74 |
+
sheet['B24'] = act2
|
| 75 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 76 |
+
with col1:
|
| 77 |
+
horaInicioAct2 = st.text_input('Hora I - 2', value='22:30')
|
| 78 |
+
sheet['D24'] = horaInicioAct2
|
| 79 |
+
with col2:
|
| 80 |
+
horaFinAct2 = st.text_input('Hora F - 2', value='23:00')
|
| 81 |
+
sheet['E24'] = horaFinAct2
|
| 82 |
+
with col3:
|
| 83 |
+
responsableAct2 = st.text_input('Responsable 2', value='N1/N2')
|
| 84 |
+
sheet['F24'] = responsableAct2
|
| 85 |
+
with col4:
|
| 86 |
+
afectacionAct2 = st.selectbox('Afectacion 2', ['N','Y'] )
|
| 87 |
+
sheet['G24'] = afectacionAct2
|
| 88 |
+
|
| 89 |
+
st.subheader('Inicio de Actividades')
|
| 90 |
+
with st.expander('3'):
|
| 91 |
+
act3 = st.text_input('Actividad 3', value='N2 inicia con las actividades de acuerdo a su Timeline')
|
| 92 |
+
sheet['B26'] = act3
|
| 93 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 94 |
+
with col1:
|
| 95 |
+
horaInicioAct3 = st.text_input('Hora I - 3', value='00:00')
|
| 96 |
+
sheet['D26'] = horaInicioAct3
|
| 97 |
+
with col2:
|
| 98 |
+
horaFinAct3 = st.text_input('Hora F - 3', value='03:00')
|
| 99 |
+
sheet['E26'] = horaFinAct3
|
| 100 |
+
with col3:
|
| 101 |
+
responsableAct3 = st.text_input('Responsable 3', value='N2')
|
| 102 |
+
sheet['F26'] = responsableAct3
|
| 103 |
+
with col4:
|
| 104 |
+
afectacionAct3 = st.selectbox('Afectacion 3', ['N','Y'] )
|
| 105 |
+
sheet['G26'] = afectacionAct3
|
| 106 |
+
|
| 107 |
+
with st.expander('4'):
|
| 108 |
+
act4 = st.text_input('Actividad 4', value='N1 solicita avances a N2')
|
| 109 |
+
sheet['B27'] = act4
|
| 110 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 111 |
+
with col1:
|
| 112 |
+
horaInicioAct4 = st.text_input('Hora I - 4', value='03:00')
|
| 113 |
+
sheet['D27'] = horaInicioAct4
|
| 114 |
+
with col2:
|
| 115 |
+
horaFinAct4 = st.text_input('Hora F - 4', value='04:00')
|
| 116 |
+
sheet['E27'] = horaFinAct4
|
| 117 |
+
with col3:
|
| 118 |
+
responsableAct4 = st.text_input('Responsable 4', value='N1/N2')
|
| 119 |
+
sheet['F27'] = responsableAct4
|
| 120 |
+
with col4:
|
| 121 |
+
afectacionAct4 = st.selectbox('Afectacion 4', ['N','Y'] )
|
| 122 |
+
sheet['G27'] = afectacionAct4
|
| 123 |
+
|
| 124 |
+
with st.expander('5'):
|
| 125 |
+
act5 = st.text_input('Actividad 5', value='N2 finaliza el mantenimiento')
|
| 126 |
+
sheet['B28'] = act5
|
| 127 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 128 |
+
with col1:
|
| 129 |
+
horaInicioAct5 = st.text_input('Hora I - 5', value='03:00')
|
| 130 |
+
sheet['D28'] = horaInicioAct5
|
| 131 |
+
with col2:
|
| 132 |
+
horaFinAct5 = st.text_input('Hora F - 5', value='04:00')
|
| 133 |
+
sheet['E28'] = horaFinAct5
|
| 134 |
+
with col3:
|
| 135 |
+
responsableAct5 = st.text_input('Responsable 5', value='N2')
|
| 136 |
+
sheet['F28'] = responsableAct5
|
| 137 |
+
with col4:
|
| 138 |
+
afectacionAct5 = st.selectbox('Afectacion 5', ['N','Y'] )
|
| 139 |
+
sheet['G28'] = afectacionAct5
|
| 140 |
+
|
| 141 |
+
with st.expander('6'):
|
| 142 |
+
act6 = st.text_input('Actividad 6', value='N1 valida alarmas con el NOC y se cierra la ventana')
|
| 143 |
+
sheet['B29'] = act6
|
| 144 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 145 |
+
with col1:
|
| 146 |
+
horaInicioAct6 = st.text_input('Hora I - 6', value='04:00')
|
| 147 |
+
sheet['D29'] = horaInicioAct6
|
| 148 |
+
with col2:
|
| 149 |
+
horaFinAct6 = st.text_input('Hora F - 6', value='05:00')
|
| 150 |
+
sheet['E29'] = horaFinAct6
|
| 151 |
+
with col3:
|
| 152 |
+
responsableAct6 = st.text_input('Responsable 6', value='N1/NOC')
|
| 153 |
+
sheet['F29'] = responsableAct6
|
| 154 |
+
with col4:
|
| 155 |
+
afectacionAct6 = st.selectbox('Afectacion 6', ['N','Y'] )
|
| 156 |
+
sheet['G29'] = afectacionAct6
|
| 157 |
+
|
| 158 |
+
st.subheader('Rollback')
|
| 159 |
+
rollback = st.selectbox('Rollback', ['NA', 'Inicio de ROLLBACK'])
|
| 160 |
+
if rollback == 'Inicio de ROLLBACK':
|
| 161 |
+
with st.expander('Rollback'):
|
| 162 |
+
rollbackAct1 = st.text_input('Inicio de Rollback', value='Inicio de Rolback')
|
| 163 |
+
sheet['B31'] = rollbackAct1
|
| 164 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 165 |
+
with col1:
|
| 166 |
+
horaInicioRollback = st.text_input('Hora I - RLB', value='04:00')
|
| 167 |
+
sheet['D31'] = horaInicioRollback
|
| 168 |
+
with col2:
|
| 169 |
+
horaFinRollback = st.text_input('Hora F - RLB', value='04:30')
|
| 170 |
+
sheet['E31'] = horaFinRollback
|
| 171 |
+
with col3:
|
| 172 |
+
responsableRollback = st.text_input('Responsable RLB', value='N1/N2')
|
| 173 |
+
sheet['F31'] = responsableRollback
|
| 174 |
+
with col4:
|
| 175 |
+
afectacionRollback = st.selectbox('Afectacion RLB', ['N','Y'] )
|
| 176 |
+
sheet['G31'] = afectacionRollback
|
| 177 |
+
|
| 178 |
+
rollbackAct2 = st.text_input('Fin Rollback', value='N1 valida alarmas con el NOC y se cierra la ventana')
|
| 179 |
+
sheet['B32'] = rollbackAct2
|
| 180 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 181 |
+
with col1:
|
| 182 |
+
horaInicioRollback2 = st.text_input('Hora I - RLB2', value='04:30')
|
| 183 |
+
sheet['D32'] = horaInicioRollback2
|
| 184 |
+
with col2:
|
| 185 |
+
horaFinRollback2 = st.text_input('Hora F - RLB2', value='05:00')
|
| 186 |
+
sheet['E32'] = horaFinRollback2
|
| 187 |
+
with col3:
|
| 188 |
+
responsableRollback2 = st.text_input('Responsable RLB2', value='N1/NOC')
|
| 189 |
+
sheet['F32'] = responsableRollback2
|
| 190 |
+
with col4:
|
| 191 |
+
afectacionRollback2 = st.selectbox('Afectacion RLB2', ['N','Y'] )
|
| 192 |
+
sheet['G32'] = afectacionRollback2
|
| 193 |
+
|
| 194 |
+
st.subheader('Path de la documentacion')
|
| 195 |
+
pathFolder = "\\\\10.112.47.36\\ingenieria\\o&m\\PLATAFORMAS Y REDES\\N1 O&M Redes y Plataformas\\"
|
| 196 |
+
pathDocu = st.text_area('Path de la Documentacion', value=pathFolder)
|
| 197 |
+
sheet['C34'] = pathDocu
|
| 198 |
+
|
| 199 |
+
|
| 200 |
+
#if st.button('Guardar'):
|
| 201 |
+
workbook.save('MOP-CRQ--NAME.xlsx')
|
| 202 |
+
|
| 203 |
+
st.subheader('Descargar Archivo')
|
| 204 |
+
if st.checkbox('Descargar:'):
|
| 205 |
+
with open('MOP-CRQ--NAME.xlsx','rb') as fp:
|
| 206 |
+
btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP-CRQ--NAME.xlsx')
|
| 207 |
+
|
| 208 |
+
st.write('All rights reserved. Developed by David Minango')
|
| 209 |
+
|
| 210 |
+
elif choice == 'MOP DIA':
|
| 211 |
+
st.title('MOP DIA')
|
| 212 |
+
|
| 213 |
+
st.subheader('Actividades')
|
| 214 |
+
with st.expander('1'):
|
| 215 |
+
act1 = st.text_input('Actividad 1', value='N1 se contacta con el NOC para abrir la ventana de mantenimiento')
|
| 216 |
+
sheet['B23'] = act1
|
| 217 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 218 |
+
with col1:
|
| 219 |
+
horaInicioAct1 = st.text_input('Hora I - 1', value='09:00')
|
| 220 |
+
sheet['D23'] = horaInicioAct1
|
| 221 |
+
with col2:
|
| 222 |
+
horaFinAct1 = st.text_input('Hora F - 1', value='09:30')
|
| 223 |
+
sheet['E23'] = horaFinAct1
|
| 224 |
+
with col3:
|
| 225 |
+
responsableAct1 = st.text_input('Responsable 1', value='N1/NOC')
|
| 226 |
+
sheet['F23'] = responsableAct1
|
| 227 |
+
with col4:
|
| 228 |
+
afectacionAct1 = st.selectbox('Afectacion 1', ['N','Y'] )
|
| 229 |
+
sheet['G23'] = afectacionAct1
|
| 230 |
+
|
| 231 |
+
with st.expander('2'):
|
| 232 |
+
act2 = st.text_input('Actividad 2', value='N1 se contacta con N2 para el inicio de la ventana')
|
| 233 |
+
sheet['B24'] = act2
|
| 234 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 235 |
+
with col1:
|
| 236 |
+
horaInicioAct2 = st.text_input('Hora I - 2', value='09:30')
|
| 237 |
+
sheet['D24'] = horaInicioAct2
|
| 238 |
+
with col2:
|
| 239 |
+
horaFinAct2 = st.text_input('Hora F - 2', value='09:45')
|
| 240 |
+
sheet['E24'] = horaFinAct2
|
| 241 |
+
with col3:
|
| 242 |
+
responsableAct2 = st.text_input('Responsable 2', value='N1/N2')
|
| 243 |
+
sheet['F24'] = responsableAct2
|
| 244 |
+
with col4:
|
| 245 |
+
afectacionAct2 = st.selectbox('Afectacion 2', ['N','Y'] )
|
| 246 |
+
sheet['G24'] = afectacionAct2
|
| 247 |
+
|
| 248 |
+
st.subheader('Inicio de Actividades')
|
| 249 |
+
with st.expander('3'):
|
| 250 |
+
act3 = st.text_input('Actividad 3', value='N2 inicia con las actividades de acuerdo a su Timeline')
|
| 251 |
+
sheet['B26'] = act3
|
| 252 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 253 |
+
with col1:
|
| 254 |
+
horaInicioAct3 = st.text_input('Hora I - 3', value='09:45')
|
| 255 |
+
sheet['D26'] = horaInicioAct3
|
| 256 |
+
with col2:
|
| 257 |
+
horaFinAct3 = st.text_input('Hora F - 3', value='14:00')
|
| 258 |
+
sheet['E26'] = horaFinAct3
|
| 259 |
+
with col3:
|
| 260 |
+
responsableAct3 = st.text_input('Responsable 3', value='N2')
|
| 261 |
+
sheet['F26'] = responsableAct3
|
| 262 |
+
with col4:
|
| 263 |
+
afectacionAct3 = st.selectbox('Afectacion 3', ['N','Y'] )
|
| 264 |
+
sheet['G26'] = afectacionAct3
|
| 265 |
+
|
| 266 |
+
with st.expander('4'):
|
| 267 |
+
act4 = st.text_input('Actividad 4', value='N1 solicita avances a N2')
|
| 268 |
+
sheet['B27'] = act4
|
| 269 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 270 |
+
with col1:
|
| 271 |
+
horaInicioAct4 = st.text_input('Hora I - 4', value='14:00')
|
| 272 |
+
sheet['D27'] = horaInicioAct4
|
| 273 |
+
with col2:
|
| 274 |
+
horaFinAct4 = st.text_input('Hora F - 4', value='15:00')
|
| 275 |
+
sheet['E27'] = horaFinAct4
|
| 276 |
+
with col3:
|
| 277 |
+
responsableAct4 = st.text_input('Responsable 4', value='N1/N2')
|
| 278 |
+
sheet['F27'] = responsableAct4
|
| 279 |
+
with col4:
|
| 280 |
+
afectacionAct4 = st.selectbox('Afectacion 4', ['N','Y'] )
|
| 281 |
+
sheet['G27'] = afectacionAct4
|
| 282 |
+
|
| 283 |
+
with st.expander('5'):
|
| 284 |
+
act5 = st.text_input('Actividad 5', value='N2 finaliza el mantenimiento')
|
| 285 |
+
sheet['B28'] = act5
|
| 286 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 287 |
+
with col1:
|
| 288 |
+
horaInicioAct5 = st.text_input('Hora I - 5', value='15:00')
|
| 289 |
+
sheet['D28'] = horaInicioAct5
|
| 290 |
+
with col2:
|
| 291 |
+
horaFinAct5 = st.text_input('Hora F - 5', value='17:00')
|
| 292 |
+
sheet['E28'] = horaFinAct5
|
| 293 |
+
with col3:
|
| 294 |
+
responsableAct5 = st.text_input('Responsable 5', value='N2')
|
| 295 |
+
sheet['F28'] = responsableAct5
|
| 296 |
+
with col4:
|
| 297 |
+
afectacionAct5 = st.selectbox('Afectacion 5', ['N','Y'] )
|
| 298 |
+
sheet['G28'] = afectacionAct5
|
| 299 |
+
|
| 300 |
+
with st.expander('6'):
|
| 301 |
+
act6 = st.text_input('Actividad 6', value='N1 valida alarmas con el NOC y se cierra la ventana')
|
| 302 |
+
sheet['B29'] = act6
|
| 303 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 304 |
+
with col1:
|
| 305 |
+
horaInicioAct6 = st.text_input('Hora I - 6', value='17:00')
|
| 306 |
+
sheet['D29'] = horaInicioAct6
|
| 307 |
+
with col2:
|
| 308 |
+
horaFinAct6 = st.text_input('Hora F - 6', value='18:00')
|
| 309 |
+
sheet['E29'] = horaFinAct6
|
| 310 |
+
with col3:
|
| 311 |
+
responsableAct6 = st.text_input('Responsable 6', value='N1/NOC')
|
| 312 |
+
sheet['F29'] = responsableAct6
|
| 313 |
+
with col4:
|
| 314 |
+
afectacionAct6 = st.selectbox('Afectacion 6', ['N','Y'] )
|
| 315 |
+
sheet['G29'] = afectacionAct6
|
| 316 |
+
|
| 317 |
+
st.subheader('Rollback')
|
| 318 |
+
rollback = st.selectbox('Rollback', ['NA', 'Inicio de ROLLBACK'])
|
| 319 |
+
if rollback == 'Inicio de ROLLBACK':
|
| 320 |
+
with st.expander('Rollback'):
|
| 321 |
+
rollbackAct1 = st.text_input('Inicio de Rollback', value='Inicio de Rolback')
|
| 322 |
+
sheet['B31'] = rollbackAct1
|
| 323 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 324 |
+
with col1:
|
| 325 |
+
horaInicioRollback = st.text_input('Hora I - RLB', value='17:00')
|
| 326 |
+
sheet['D31'] = horaInicioRollback
|
| 327 |
+
with col2:
|
| 328 |
+
horaFinRollback = st.text_input('Hora F - RLB', value='17:30')
|
| 329 |
+
sheet['E31'] = horaFinRollback
|
| 330 |
+
with col3:
|
| 331 |
+
responsableRollback = st.text_input('Responsable RLB', value='N1/N2')
|
| 332 |
+
sheet['F31'] = responsableRollback
|
| 333 |
+
with col4:
|
| 334 |
+
afectacionRollback = st.selectbox('Afectacion RLB', ['N','Y'] )
|
| 335 |
+
sheet['G31'] = afectacionRollback
|
| 336 |
+
|
| 337 |
+
rollbackAct2 = st.text_input('Fin Rollback', value='N1 valida alarmas con el NOC y se cierra la ventana')
|
| 338 |
+
sheet['B32'] = rollbackAct2
|
| 339 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 340 |
+
with col1:
|
| 341 |
+
horaInicioRollback2 = st.text_input('Hora I - RLB2', value='17:30')
|
| 342 |
+
sheet['D32'] = horaInicioRollback2
|
| 343 |
+
with col2:
|
| 344 |
+
horaFinRollback2 = st.text_input('Hora F - RLB2', value='18:00')
|
| 345 |
+
sheet['E32'] = horaFinRollback2
|
| 346 |
+
with col3:
|
| 347 |
+
responsableRollback2 = st.text_input('Responsable RLB2', value='N1/NOC')
|
| 348 |
+
sheet['F32'] = responsableRollback2
|
| 349 |
+
with col4:
|
| 350 |
+
afectacionRollback2 = st.selectbox('Afectacion RLB2', ['N','Y'] )
|
| 351 |
+
sheet['G32'] = afectacionRollback2
|
| 352 |
+
|
| 353 |
+
|
| 354 |
+
st.subheader('Path de la documentacion')
|
| 355 |
+
pathFolder = "\\\\10.112.47.36\\ingenieria\\o&m\\PLATAFORMAS Y REDES\\N1 O&M Redes y Plataformas\\"
|
| 356 |
+
pathDocu = st.text_area('Path de la Documentacion', value=pathFolder)
|
| 357 |
+
sheet['C34'] = pathDocu
|
| 358 |
+
|
| 359 |
+
|
| 360 |
+
#if st.button('Guardar'):
|
| 361 |
+
workbook.save('MOP-CRQ--NAME.xlsx')
|
| 362 |
+
|
| 363 |
+
st.subheader('Descargar Archivo')
|
| 364 |
+
if st.checkbox('Descargar:'):
|
| 365 |
+
with open('MOP-CRQ--NAME.xlsx','rb') as fp:
|
| 366 |
+
btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP-CRQ--NAME.xlsx')
|
| 367 |
+
################################################################################################################
|
| 368 |
+
################################################################################################################
|
| 369 |
+
def mopProveedor():
|
| 370 |
+
|
| 371 |
+
workbook = openpyxl.load_workbook('MOP-CRQ_Prove.xlsx')
|
| 372 |
+
sheets = workbook.sheetnames
|
| 373 |
+
sheet = workbook.active
|
| 374 |
+
|
| 375 |
+
nombreCRQ = st.text_input('Nombre del Mantenimiento:')
|
| 376 |
+
sheet['B9'] = nombreCRQ
|
| 377 |
+
sheet['C11'] = nombreCRQ
|
| 378 |
+
CRQ = nombreCRQ[4:9]
|
| 379 |
+
numCRQ = st.text_input('Numero de CRQ:', value=CRQ)
|
| 380 |
+
if numCRQ.isdigit() == True:
|
| 381 |
+
sheet['D10'] = numCRQ
|
| 382 |
+
else:
|
| 383 |
+
st.warning('Ingrese un numero valido')
|
| 384 |
+
|
| 385 |
+
impacto = st.text_input('Impacto / Alcance', value='Ninguno')
|
| 386 |
+
sheet['C13'] = impacto
|
| 387 |
+
|
| 388 |
+
n2Responsable = st.selectbox('N2', ['Carlos Castillo','Cristhian Vallejo', 'Elizabeth Pe帽aloza', 'Fabricio Oleas','Luis Chumo', 'Washington Chuqui', 'Xavier Ortiz'])
|
| 389 |
+
sheet['E18'] = n2Responsable
|
| 390 |
+
if n2Responsable == 'Carlos Castillo':
|
| 391 |
+
sheet['H18'] = 'carlos.castillocuenca@telefonica.com'
|
| 392 |
+
sheet['G18'] = '0999586043'
|
| 393 |
+
elif n2Responsable == 'Cristhian Vallejo':
|
| 394 |
+
sheet['H18'] = 'cristhian.vallejovillalva@telefonica.com'
|
| 395 |
+
sheet['G18'] = '0995386632'
|
| 396 |
+
elif n2Responsable == 'Elizabeth Pe帽aloza':
|
| 397 |
+
sheet['H18'] = 'julia.penaloza@telefonica.com'
|
| 398 |
+
sheet['G18'] = '0998124791'
|
| 399 |
+
elif n2Responsable == 'Fabricio Oleas':
|
| 400 |
+
sheet['H18'] = 'luis.oleas@telefonica.com'
|
| 401 |
+
sheet['G18'] = '0987537565'
|
| 402 |
+
elif n2Responsable == 'Luis Chumo':
|
| 403 |
+
sheet['H18'] = 'luis.chumo@telefonica.com'
|
| 404 |
+
sheet['G18'] = '0999281697'
|
| 405 |
+
elif n2Responsable == 'Washington Chuqui':
|
| 406 |
+
sheet['H18'] = 'washington.chuqui@telefonica.com'
|
| 407 |
+
sheet['G18'] = '0995652744'
|
| 408 |
+
elif n2Responsable == 'Xavier Ortiz':
|
| 409 |
+
sheet['H18'] = 'xavier.ortiz@telefonica.com'
|
| 410 |
+
sheet['G18'] = '0998542986'
|
| 411 |
+
|
| 412 |
+
proveedor = st.text_input('Proveedor')
|
| 413 |
+
sheet['E19'] = proveedor
|
| 414 |
+
proveedorNum = st.text_input('Proveedor Telefono')
|
| 415 |
+
sheet['G19'] = proveedorNum
|
| 416 |
+
proveedorEmail = st.text_input('Proveedor Correo')
|
| 417 |
+
sheet['H19'] = proveedorEmail
|
| 418 |
+
|
| 419 |
+
menu = ['MOP DIA', 'MOP NOCHE']
|
| 420 |
+
choice = st.selectbox('Menu', menu)
|
| 421 |
+
|
| 422 |
+
if choice == 'MOP NOCHE':
|
| 423 |
+
st.title('MOP NOCHE')
|
| 424 |
+
st.subheader('Actividades')
|
| 425 |
+
with st.expander('1'):
|
| 426 |
+
act1 = st.text_input('Actividad 1', value='N1 se contacta con el NOC para abrir la ventana de mantenimiento')
|
| 427 |
+
sheet['B23'] = act1
|
| 428 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 429 |
+
with col1:
|
| 430 |
+
horaInicioAct1 = st.text_input('Hora I - 1', value='22:00')
|
| 431 |
+
sheet['D23'] = horaInicioAct1
|
| 432 |
+
with col2:
|
| 433 |
+
horaFinAct1 = st.text_input('Hora F - 1', value='22:30')
|
| 434 |
+
sheet['E23'] = horaFinAct1
|
| 435 |
+
with col3:
|
| 436 |
+
responsableAct1 = st.text_input('Responsable 1', value='N1/NOC')
|
| 437 |
+
sheet['F23'] = responsableAct1
|
| 438 |
+
with col4:
|
| 439 |
+
afectacionAct1 = st.selectbox('Afectacion 1', ['N','Y'] )
|
| 440 |
+
sheet['G23'] = afectacionAct1
|
| 441 |
+
|
| 442 |
+
with st.expander('2'):
|
| 443 |
+
act2 = st.text_input('Actividad 2', value='N1 se contacta con Proveedor para el inicio de la ventana')
|
| 444 |
+
sheet['B24'] = act2
|
| 445 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 446 |
+
with col1:
|
| 447 |
+
horaInicioAct2 = st.text_input('Hora I - 2', value='22:30')
|
| 448 |
+
sheet['D24'] = horaInicioAct2
|
| 449 |
+
with col2:
|
| 450 |
+
horaFinAct2 = st.text_input('Hora F - 2', value='23:00')
|
| 451 |
+
sheet['E24'] = horaFinAct2
|
| 452 |
+
with col3:
|
| 453 |
+
responsableAct2 = st.text_input('Responsable 2', value='N1/Proveedor')
|
| 454 |
+
sheet['F24'] = responsableAct2
|
| 455 |
+
with col4:
|
| 456 |
+
afectacionAct2 = st.selectbox('Afectacion 2', ['N','Y'] )
|
| 457 |
+
sheet['G24'] = afectacionAct2
|
| 458 |
+
|
| 459 |
+
st.subheader('Inicio de Actividades')
|
| 460 |
+
with st.expander('3'):
|
| 461 |
+
act3 = st.text_input('Actividad 3', value='Proveedor inicia con las actividades de acuerdo a su Timeline')
|
| 462 |
+
sheet['B26'] = act3
|
| 463 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 464 |
+
with col1:
|
| 465 |
+
horaInicioAct3 = st.text_input('Hora I - 3', value='00:00')
|
| 466 |
+
sheet['D26'] = horaInicioAct3
|
| 467 |
+
with col2:
|
| 468 |
+
horaFinAct3 = st.text_input('Hora F - 3', value='03:00')
|
| 469 |
+
sheet['E26'] = horaFinAct3
|
| 470 |
+
with col3:
|
| 471 |
+
responsableAct3 = st.text_input('Responsable 3', value='Proveedor')
|
| 472 |
+
sheet['F26'] = responsableAct3
|
| 473 |
+
with col4:
|
| 474 |
+
afectacionAct3 = st.selectbox('Afectacion 3', ['N','Y'] )
|
| 475 |
+
sheet['G26'] = afectacionAct3
|
| 476 |
+
|
| 477 |
+
with st.expander('4'):
|
| 478 |
+
act4 = st.text_input('Actividad 4', value='N1 solicita avances a Proveedor')
|
| 479 |
+
sheet['B27'] = act4
|
| 480 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 481 |
+
with col1:
|
| 482 |
+
horaInicioAct4 = st.text_input('Hora I - 4', value='03:00')
|
| 483 |
+
sheet['D27'] = horaInicioAct4
|
| 484 |
+
with col2:
|
| 485 |
+
horaFinAct4 = st.text_input('Hora F - 4', value='04:00')
|
| 486 |
+
sheet['E27'] = horaFinAct4
|
| 487 |
+
with col3:
|
| 488 |
+
responsableAct4 = st.text_input('Responsable 4', value='N1/Proveedor')
|
| 489 |
+
sheet['F27'] = responsableAct4
|
| 490 |
+
with col4:
|
| 491 |
+
afectacionAct4 = st.selectbox('Afectacion 4', ['N','Y'] )
|
| 492 |
+
sheet['G27'] = afectacionAct4
|
| 493 |
+
|
| 494 |
+
with st.expander('5'):
|
| 495 |
+
act5 = st.text_input('Actividad 5', value='Proveedor finaliza el mantenimiento')
|
| 496 |
+
sheet['B28'] = act5
|
| 497 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 498 |
+
with col1:
|
| 499 |
+
horaInicioAct5 = st.text_input('Hora I - 5', value='03:00')
|
| 500 |
+
sheet['D28'] = horaInicioAct5
|
| 501 |
+
with col2:
|
| 502 |
+
horaFinAct5 = st.text_input('Hora F - 5', value='04:00')
|
| 503 |
+
sheet['E28'] = horaFinAct5
|
| 504 |
+
with col3:
|
| 505 |
+
responsableAct5 = st.text_input('Responsable 5', value='Proveedor')
|
| 506 |
+
sheet['F28'] = responsableAct5
|
| 507 |
+
with col4:
|
| 508 |
+
afectacionAct5 = st.selectbox('Afectacion 5', ['N','Y'] )
|
| 509 |
+
sheet['G28'] = afectacionAct5
|
| 510 |
+
|
| 511 |
+
with st.expander('6'):
|
| 512 |
+
act6 = st.text_input('Actividad 6', value='N1 valida alarmas con el NOC y se cierra la ventana')
|
| 513 |
+
sheet['B29'] = act6
|
| 514 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 515 |
+
with col1:
|
| 516 |
+
horaInicioAct6 = st.text_input('Hora I - 6', value='04:00')
|
| 517 |
+
sheet['D29'] = horaInicioAct6
|
| 518 |
+
with col2:
|
| 519 |
+
horaFinAct6 = st.text_input('Hora F - 6', value='05:00')
|
| 520 |
+
sheet['E29'] = horaFinAct6
|
| 521 |
+
with col3:
|
| 522 |
+
responsableAct6 = st.text_input('Responsable 6', value='N1/NOC')
|
| 523 |
+
sheet['F29'] = responsableAct6
|
| 524 |
+
with col4:
|
| 525 |
+
afectacionAct6 = st.selectbox('Afectacion 6', ['N','Y'] )
|
| 526 |
+
sheet['G29'] = afectacionAct6
|
| 527 |
+
|
| 528 |
+
st.subheader('Rollback')
|
| 529 |
+
rollback = st.selectbox('Rollback', ['NA', 'Inicio de ROLLBACK'])
|
| 530 |
+
if rollback == 'Inicio de ROLLBACK':
|
| 531 |
+
with st.expander('Rollback'):
|
| 532 |
+
rollbackAct1 = st.text_input('Inicio de Rollback', value='Inicio de Rolback')
|
| 533 |
+
sheet['B31'] = rollbackAct1
|
| 534 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 535 |
+
with col1:
|
| 536 |
+
horaInicioRollback = st.text_input('Hora I - RLB', value='04:00')
|
| 537 |
+
sheet['D31'] = horaInicioRollback
|
| 538 |
+
with col2:
|
| 539 |
+
horaFinRollback = st.text_input('Hora F - RLB', value='04:30')
|
| 540 |
+
sheet['E31'] = horaFinRollback
|
| 541 |
+
with col3:
|
| 542 |
+
responsableRollback = st.text_input('Responsable RLB', value='N1/Proveedor')
|
| 543 |
+
sheet['F31'] = responsableRollback
|
| 544 |
+
with col4:
|
| 545 |
+
afectacionRollback = st.selectbox('Afectacion RLB', ['N','Y'] )
|
| 546 |
+
sheet['G31'] = afectacionRollback
|
| 547 |
+
|
| 548 |
+
rollbackAct2 = st.text_input('Fin Rollback', value='N1 valida alarmas con el NOC y se cierra la ventana')
|
| 549 |
+
sheet['B32'] = rollbackAct2
|
| 550 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 551 |
+
with col1:
|
| 552 |
+
horaInicioRollback2 = st.text_input('Hora I - RLB2', value='04:30')
|
| 553 |
+
sheet['D32'] = horaInicioRollback2
|
| 554 |
+
with col2:
|
| 555 |
+
horaFinRollback2 = st.text_input('Hora F - RLB2', value='05:00')
|
| 556 |
+
sheet['E32'] = horaFinRollback2
|
| 557 |
+
with col3:
|
| 558 |
+
responsableRollback2 = st.text_input('Responsable RLB2', value='N1/NOC')
|
| 559 |
+
sheet['F32'] = responsableRollback2
|
| 560 |
+
with col4:
|
| 561 |
+
afectacionRollback2 = st.selectbox('Afectacion RLB2', ['N','Y'] )
|
| 562 |
+
sheet['G32'] = afectacionRollback2
|
| 563 |
+
|
| 564 |
+
st.subheader('Path de la documentacion')
|
| 565 |
+
pathFolder = "\\\\10.112.47.36\\ingenieria\\o&m\\PLATAFORMAS Y REDES\\N1 O&M Redes y Plataformas\\"
|
| 566 |
+
pathDocu = st.text_area('Path de la Documentacion', value=pathFolder)
|
| 567 |
+
sheet['C34'] = pathDocu
|
| 568 |
+
|
| 569 |
+
|
| 570 |
+
#if st.button('Guardar'):
|
| 571 |
+
workbook.save('MOP-CRQ--NAME2.xlsx')
|
| 572 |
+
|
| 573 |
+
st.subheader('Descargar Archivo')
|
| 574 |
+
if st.checkbox('Descargar:'):
|
| 575 |
+
with open('MOP-CRQ--NAME2.xlsx','rb') as fp:
|
| 576 |
+
btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP-CRQ--NAME.xlsx')
|
| 577 |
+
|
| 578 |
+
st.write('All rights reserved. Developed by David Minango')
|
| 579 |
+
|
| 580 |
+
elif choice == 'MOP DIA':
|
| 581 |
+
st.title('MOP DIA')
|
| 582 |
+
|
| 583 |
+
st.subheader('Actividades')
|
| 584 |
+
with st.expander('1'):
|
| 585 |
+
act1 = st.text_input('Actividad 1', value='N1 se contacta con el NOC para abrir la ventana de mantenimiento')
|
| 586 |
+
sheet['B23'] = act1
|
| 587 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 588 |
+
with col1:
|
| 589 |
+
horaInicioAct1 = st.text_input('Hora I - 1', value='09:00')
|
| 590 |
+
sheet['D23'] = horaInicioAct1
|
| 591 |
+
with col2:
|
| 592 |
+
horaFinAct1 = st.text_input('Hora F - 1', value='09:30')
|
| 593 |
+
sheet['E23'] = horaFinAct1
|
| 594 |
+
with col3:
|
| 595 |
+
responsableAct1 = st.text_input('Responsable 1', value='N1/NOC')
|
| 596 |
+
sheet['F23'] = responsableAct1
|
| 597 |
+
with col4:
|
| 598 |
+
afectacionAct1 = st.selectbox('Afectacion 1', ['N','Y'] )
|
| 599 |
+
sheet['G23'] = afectacionAct1
|
| 600 |
+
|
| 601 |
+
with st.expander('2'):
|
| 602 |
+
act2 = st.text_input('Actividad 2', value='N1 se contacta con Proveedor para el inicio de la ventana')
|
| 603 |
+
sheet['B24'] = act2
|
| 604 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 605 |
+
with col1:
|
| 606 |
+
horaInicioAct2 = st.text_input('Hora I - 2', value='09:30')
|
| 607 |
+
sheet['D24'] = horaInicioAct2
|
| 608 |
+
with col2:
|
| 609 |
+
horaFinAct2 = st.text_input('Hora F - 2', value='09:45')
|
| 610 |
+
sheet['E24'] = horaFinAct2
|
| 611 |
+
with col3:
|
| 612 |
+
responsableAct2 = st.text_input('Responsable 2', value='N1/Proveedor')
|
| 613 |
+
sheet['F24'] = responsableAct2
|
| 614 |
+
with col4:
|
| 615 |
+
afectacionAct2 = st.selectbox('Afectacion 2', ['N','Y'] )
|
| 616 |
+
sheet['G24'] = afectacionAct2
|
| 617 |
+
|
| 618 |
+
st.subheader('Inicio de Actividades')
|
| 619 |
+
with st.expander('3'):
|
| 620 |
+
act3 = st.text_input('Actividad 3', value='Proveedor inicia con las actividades de acuerdo a su Timeline')
|
| 621 |
+
sheet['B26'] = act3
|
| 622 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 623 |
+
with col1:
|
| 624 |
+
horaInicioAct3 = st.text_input('Hora I - 3', value='09:45')
|
| 625 |
+
sheet['D26'] = horaInicioAct3
|
| 626 |
+
with col2:
|
| 627 |
+
horaFinAct3 = st.text_input('Hora F - 3', value='14:00')
|
| 628 |
+
sheet['E26'] = horaFinAct3
|
| 629 |
+
with col3:
|
| 630 |
+
responsableAct3 = st.text_input('Responsable 3', value='Proveedor')
|
| 631 |
+
sheet['F26'] = responsableAct3
|
| 632 |
+
with col4:
|
| 633 |
+
afectacionAct3 = st.selectbox('Afectacion 3', ['N','Y'] )
|
| 634 |
+
sheet['G26'] = afectacionAct3
|
| 635 |
+
|
| 636 |
+
with st.expander('4'):
|
| 637 |
+
act4 = st.text_input('Actividad 4', value='N1 solicita avances a Proveedor')
|
| 638 |
+
sheet['B27'] = act4
|
| 639 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 640 |
+
with col1:
|
| 641 |
+
horaInicioAct4 = st.text_input('Hora I - 4', value='14:00')
|
| 642 |
+
sheet['D27'] = horaInicioAct4
|
| 643 |
+
with col2:
|
| 644 |
+
horaFinAct4 = st.text_input('Hora F - 4', value='15:00')
|
| 645 |
+
sheet['E27'] = horaFinAct4
|
| 646 |
+
with col3:
|
| 647 |
+
responsableAct4 = st.text_input('Responsable 4', value='N1/Proveedor')
|
| 648 |
+
sheet['F27'] = responsableAct4
|
| 649 |
+
with col4:
|
| 650 |
+
afectacionAct4 = st.selectbox('Afectacion 4', ['N','Y'] )
|
| 651 |
+
sheet['G27'] = afectacionAct4
|
| 652 |
+
|
| 653 |
+
with st.expander('5'):
|
| 654 |
+
act5 = st.text_input('Actividad 5', value='Proveedor finaliza el mantenimiento')
|
| 655 |
+
sheet['B28'] = act5
|
| 656 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 657 |
+
with col1:
|
| 658 |
+
horaInicioAct5 = st.text_input('Hora I - 5', value='15:00')
|
| 659 |
+
sheet['D28'] = horaInicioAct5
|
| 660 |
+
with col2:
|
| 661 |
+
horaFinAct5 = st.text_input('Hora F - 5', value='17:00')
|
| 662 |
+
sheet['E28'] = horaFinAct5
|
| 663 |
+
with col3:
|
| 664 |
+
responsableAct5 = st.text_input('Responsable 5', value='Proveedor')
|
| 665 |
+
sheet['F28'] = responsableAct5
|
| 666 |
+
with col4:
|
| 667 |
+
afectacionAct5 = st.selectbox('Afectacion 5', ['N','Y'] )
|
| 668 |
+
sheet['G28'] = afectacionAct5
|
| 669 |
+
|
| 670 |
+
with st.expander('6'):
|
| 671 |
+
act6 = st.text_input('Actividad 6', value='N1 valida alarmas con el NOC y se cierra la ventana')
|
| 672 |
+
sheet['B29'] = act6
|
| 673 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 674 |
+
with col1:
|
| 675 |
+
horaInicioAct6 = st.text_input('Hora I - 6', value='17:00')
|
| 676 |
+
sheet['D29'] = horaInicioAct6
|
| 677 |
+
with col2:
|
| 678 |
+
horaFinAct6 = st.text_input('Hora F - 6', value='18:00')
|
| 679 |
+
sheet['E29'] = horaFinAct6
|
| 680 |
+
with col3:
|
| 681 |
+
responsableAct6 = st.text_input('Responsable 6', value='N1/NOC')
|
| 682 |
+
sheet['F29'] = responsableAct6
|
| 683 |
+
with col4:
|
| 684 |
+
afectacionAct6 = st.selectbox('Afectacion 6', ['N','Y'] )
|
| 685 |
+
sheet['G29'] = afectacionAct6
|
| 686 |
+
|
| 687 |
+
st.subheader('Rollback')
|
| 688 |
+
rollback = st.selectbox('Rollback', ['NA', 'Inicio de ROLLBACK'])
|
| 689 |
+
if rollback == 'Inicio de ROLLBACK':
|
| 690 |
+
with st.expander('Rollback'):
|
| 691 |
+
rollbackAct1 = st.text_input('Inicio de Rollback', value='Inicio de Rolback')
|
| 692 |
+
sheet['B31'] = rollbackAct1
|
| 693 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 694 |
+
with col1:
|
| 695 |
+
horaInicioRollback = st.text_input('Hora I - RLB', value='17:00')
|
| 696 |
+
sheet['D31'] = horaInicioRollback
|
| 697 |
+
with col2:
|
| 698 |
+
horaFinRollback = st.text_input('Hora F - RLB', value='17:30')
|
| 699 |
+
sheet['E31'] = horaFinRollback
|
| 700 |
+
with col3:
|
| 701 |
+
responsableRollback = st.text_input('Responsable RLB', value='N1/Proveedor')
|
| 702 |
+
sheet['F31'] = responsableRollback
|
| 703 |
+
with col4:
|
| 704 |
+
afectacionRollback = st.selectbox('Afectacion RLB', ['N','Y'] )
|
| 705 |
+
sheet['G31'] = afectacionRollback
|
| 706 |
+
|
| 707 |
+
rollbackAct2 = st.text_input('Fin Rollback', value='N1 valida alarmas con el NOC y se cierra la ventana')
|
| 708 |
+
sheet['B32'] = rollbackAct2
|
| 709 |
+
col1,col2,col3,col4 = st.columns(4)
|
| 710 |
+
with col1:
|
| 711 |
+
horaInicioRollback2 = st.text_input('Hora I - RLB2', value='17:30')
|
| 712 |
+
sheet['D32'] = horaInicioRollback2
|
| 713 |
+
with col2:
|
| 714 |
+
horaFinRollback2 = st.text_input('Hora F - RLB2', value='18:00')
|
| 715 |
+
sheet['E32'] = horaFinRollback2
|
| 716 |
+
with col3:
|
| 717 |
+
responsableRollback2 = st.text_input('Responsable RLB2', value='N1/NOC')
|
| 718 |
+
sheet['F32'] = responsableRollback2
|
| 719 |
+
with col4:
|
| 720 |
+
afectacionRollback2 = st.selectbox('Afectacion RLB2', ['N','Y'] )
|
| 721 |
+
sheet['G32'] = afectacionRollback2
|
| 722 |
+
|
| 723 |
+
|
| 724 |
+
st.subheader('Path de la documentacion')
|
| 725 |
+
pathFolder = "\\\\10.112.47.36\\ingenieria\\o&m\\PLATAFORMAS Y REDES\\N1 O&M Redes y Plataformas\\"
|
| 726 |
+
pathDocu = st.text_area('Path de la Documentacion', value=pathFolder)
|
| 727 |
+
sheet['C34'] = pathDocu
|
| 728 |
+
|
| 729 |
+
|
| 730 |
+
#if st.button('Guardar'):
|
| 731 |
+
workbook.save('MOP-CRQ--NAME2.xlsx')
|
| 732 |
+
|
| 733 |
+
st.subheader('Descargar Archivo')
|
| 734 |
+
if st.checkbox('Descargar:'):
|
| 735 |
+
with open('MOP-CRQ--NAME2.xlsx','rb') as fp:
|
| 736 |
+
btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP-CRQ--NAME.xlsx')
|
| 737 |
+
|
| 738 |
+
################################################################################################################
|
| 739 |
+
################################################################################################################
|
| 740 |
+
def mopPreaprobadas():
|
| 741 |
+
|
| 742 |
+
workbook = openpyxl.load_workbook('MopsPreaprobadas.xlsx')
|
| 743 |
+
sheets = workbook.sheetnames
|
| 744 |
+
sheet = workbook.active
|
| 745 |
+
|
| 746 |
+
objetivo = st.text_input('Objetivo:')
|
| 747 |
+
sheet['C7'] = objetivo
|
| 748 |
+
|
| 749 |
+
nomMantenimiento = st.text_input('Nombre de mantenimiento:')
|
| 750 |
+
sheet['C8'] = nomMantenimiento
|
| 751 |
+
|
| 752 |
+
descripcion = st.text_input('Descripci贸n de impacto:', value='No se Espera Afectaci贸n')
|
| 753 |
+
sheet['C9'] = descripcion
|
| 754 |
+
|
| 755 |
+
col1, col2 = st.columns(2)
|
| 756 |
+
with col1:
|
| 757 |
+
fechaIniciomtto = st.date_input('Fecha Inicio MTTO')
|
| 758 |
+
sheet['F13'] = fechaIniciomtto.strftime('%d-%b-%Y')
|
| 759 |
+
fechaFinmtto = st.date_input('Fecha Fin MTTO')
|
| 760 |
+
sheet['F14'] = fechaIniciomtto.strftime('%d-%b-%Y')
|
| 761 |
+
fechaInicioAfectacion = st.date_input('Fecha Inicio Afectaci贸n')
|
| 762 |
+
sheet['F15'] = fechaInicioAfectacion.strftime('%d-%b-%Y')
|
| 763 |
+
fechaFinAfectacion = st.date_input('Fecha Fin Afectaci贸n')
|
| 764 |
+
sheet['F16'] = fechaFinAfectacion.strftime('%d-%b-%Y')
|
| 765 |
+
fechaInicioRollback = st.date_input('Fecha Inicio Rollback')
|
| 766 |
+
sheet['F17'] = fechaInicioRollback.strftime('%d-%b-%Y')
|
| 767 |
+
fechaFinRollback = st.date_input('Fecha Fin Rollback')
|
| 768 |
+
sheet['F18'] = fechaFinRollback.strftime('%d-%b-%Y')
|
| 769 |
+
|
| 770 |
+
with col2:
|
| 771 |
+
horaIniciomtto = st.text_input('Hora Inicio MTTO', value='00:00')
|
| 772 |
+
sheet['G13'] = horaIniciomtto
|
| 773 |
+
horaFinmtto = st.text_input('Hora Fin MTTO', value='05:00')
|
| 774 |
+
sheet['G14'] = horaFinmtto
|
| 775 |
+
horaInicioAfectacion = st.text_input('Hora Inicio Afectacion', value='00:00')
|
| 776 |
+
sheet['G15'] = horaInicioAfectacion
|
| 777 |
+
horaFinAfectacion = st.text_input('Hora Fin Afectacion',value='00:00')
|
| 778 |
+
sheet['G16'] = horaFinAfectacion
|
| 779 |
+
horaInicioRollback = st.text_input('Hora Inicio Rollback', value='03:30')
|
| 780 |
+
sheet['G17'] = horaInicioRollback
|
| 781 |
+
horaFinRollback = st.text_input('Hora Fin Rollback',value='04:30')
|
| 782 |
+
sheet['G18'] = horaFinRollback
|
| 783 |
+
|
| 784 |
+
sheet['C13'] = str(fechaIniciomtto.strftime('%d-%m-%Y')) +" "+ str(horaIniciomtto)
|
| 785 |
+
sheet['C14'] = str(fechaFinmtto.strftime('%d-%m-%Y')) +" "+ str(horaFinmtto)
|
| 786 |
+
sheet['C15'] = str(fechaInicioAfectacion.strftime('%d-%m-%Y')) +" "+ str(horaInicioAfectacion)
|
| 787 |
+
sheet['C16'] = str(fechaFinAfectacion.strftime('%d-%m-%Y')) +" "+ str(horaFinAfectacion)
|
| 788 |
+
sheet['C17'] = str(fechaInicioRollback.strftime('%d-%m-%Y')) +" "+ str(horaInicioRollback)
|
| 789 |
+
sheet['C18'] = str(fechaFinRollback.strftime('%d-%m-%Y')) +" "+ str(horaFinRollback)
|
| 790 |
+
|
| 791 |
+
ppmProyecto = st.text_input('PPM (Proyecto)',value='JIRA-')
|
| 792 |
+
sheet['C19'] = ppmProyecto
|
| 793 |
+
col12,col22 = st.columns(2)
|
| 794 |
+
with col12:
|
| 795 |
+
resOtecel = st.text_input('Responsable Otecel', value='N2 O&M')
|
| 796 |
+
sheet['C20'] = resOtecel
|
| 797 |
+
resProveedor = st.text_input('Responsable Proveedor', value='N1 PAP')
|
| 798 |
+
sheet['C23'] = resProveedor
|
| 799 |
+
|
| 800 |
+
|
| 801 |
+
with col22:
|
| 802 |
+
tlfOtecel = st.text_input('Telefono Otecel', value='0999729993')
|
| 803 |
+
if tlfOtecel.isdigit() == True:
|
| 804 |
+
sheet['C21'] = tlfOtecel
|
| 805 |
+
else:
|
| 806 |
+
st.warning('Ingrese un numero valido')
|
| 807 |
+
|
| 808 |
+
tlfProveedor = st.text_input('Telefono Proveedor', value='0999993070')
|
| 809 |
+
if tlfProveedor.isdigit() == True:
|
| 810 |
+
sheet['C24'] = tlfProveedor
|
| 811 |
+
else:
|
| 812 |
+
st.warning('Ingrese un numero valido')
|
| 813 |
+
|
| 814 |
+
emailProveedor = st.text_input('Email Proveedor', value='n1pap.ec@telefonica.com')
|
| 815 |
+
sheet['C25'] = emailProveedor
|
| 816 |
+
|
| 817 |
+
if st.button('Guardar'):
|
| 818 |
+
workbook.save('MOP_Preaprobadas.xlsx')
|
| 819 |
+
|
| 820 |
+
st.subheader('Descargar Archivo')
|
| 821 |
+
if st.checkbox('Descargar:'):
|
| 822 |
+
with open('MOP_Preaprobadas.xlsx','rb') as fp:
|
| 823 |
+
btn = st.download_button(label='Descargar Archivo', data=fp, file_name='MOP_Preaprobadas.xlsx')
|
| 824 |
+
################################################################################################################
|
| 825 |
+
|
| 826 |
+
def mainMops():
|
| 827 |
+
|
| 828 |
+
#st.image('proconty.png', use_column_width=True)
|
| 829 |
+
st.title('Pasos a Producci贸n')
|
| 830 |
+
|
| 831 |
+
#st.sidebar.image('proconty.png', width=300)
|
| 832 |
+
|
| 833 |
+
menu = ['MOP Gesti贸n N2 - Generico','MOP Proveedor - Generico', 'MOP Preaprobadas']
|
| 834 |
+
choice = st.sidebar.selectbox('Menu - MOPs', menu)
|
| 835 |
+
|
| 836 |
+
if choice == 'MOP Gesti贸n N2 - Generico':
|
| 837 |
+
st.subheader('MOP N2')
|
| 838 |
+
mopMantenimientos()
|
| 839 |
+
|
| 840 |
+
elif choice == 'MOP Proveedor - Generico':
|
| 841 |
+
st.subheader('MOP Proveedores')
|
| 842 |
+
mopProveedor()
|
| 843 |
+
|
| 844 |
+
elif choice == 'MOP Preaprobadas':
|
| 845 |
+
st.subheader('MOP Preaprobadas')
|
| 846 |
+
mopPreaprobadas()
|
| 847 |
+
|
| 848 |
+
|
| 849 |
+
#st.sidebar.markdown('[MENU PRINCIPAL](https://proconty-pap.herokuapp.com/)')
|
| 850 |
+
|
| 851 |
+
|
proconty.png
ADDED
|
prueba.txt
ADDED
|
File without changes
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pandas==1.3.2
|
| 2 |
+
docx2txt==0.8
|
| 3 |
+
streamlit==1.10.0
|
| 4 |
+
openpyxl==3.0.7
|